Strabon

changeset 911:a51678bf3598

beautification and some warning removals
author Babis Nikolaou <charnik@di.uoa.gr>
date Sat Mar 23 14:23:08 2013 +0200 (2013-03-23)
parents 49c22a8dc590
children 6f3741509ddd
files generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBStore.java generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBTripleRepository.java generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBValueFactory.java generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TripleManager.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBStore.java	Sat Mar 23 03:26:37 2013 +0200
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBStore.java	Sat Mar 23 14:23:08 2013 +0200
     1.3 @@ -8,15 +8,12 @@
     1.4  import java.sql.Connection;
     1.5  import java.sql.DatabaseMetaData;
     1.6  import java.sql.SQLException;
     1.7 -import java.util.Iterator;
     1.8  
     1.9 -import javax.imageio.spi.ServiceRegistry;
    1.10  import javax.naming.InitialContext;
    1.11  import javax.naming.NamingException;
    1.12  import javax.sql.DataSource;
    1.13  
    1.14  import org.apache.commons.dbcp.BasicDataSource;
    1.15 -
    1.16  import org.openrdf.sail.SailConnection;
    1.17  import org.openrdf.sail.SailException;
    1.18  import org.openrdf.sail.helpers.SailBase;
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBTripleRepository.java	Sat Mar 23 03:26:37 2013 +0200
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBTripleRepository.java	Sat Mar 23 14:23:08 2013 +0200
     2.3 @@ -48,6 +48,7 @@
     2.4   * {@link LiteralTable} for adding, removing, and retrieving statements from the
     2.5   * database.
     2.6   * 
     2.7 + * @author Manos Karpathiotatis <mk@di.uoa.gr>
     2.8   * @author James Leigh
     2.9   */
    2.10  public abstract class GeneralDBTripleRepository {
    2.11 @@ -490,20 +491,19 @@
    2.12  		}
    2.13  	}
    2.14  	
    2.15 -	/****XXX MY ADDITION 21/4/10 ***/
    2.16 -	public void clearGeoValues()
    2.17 -	throws RdbmsException
    2.18 +	/**
    2.19 +	 * @author Manos Karpathiotatis <mk@di.uoa.gr>
    2.20 +	 * @throws RdbmsException
    2.21 +	 */
    2.22 +	public void clearGeoValues() throws RdbmsException
    2.23  	{
    2.24 -
    2.25  		try
    2.26  		{
    2.27 -
    2.28 -			String query = buildDeleteQuery("geo_values", null,null,null,null);
    2.29 +			String query = buildDeleteQuery("geo_values", null, null, null, (RdbmsResource[]) null);
    2.30  			PreparedStatement stmt = conn.prepareStatement(query);
    2.31  			try {
    2.32 -				setSelectQuery(stmt, null,null,null,null);
    2.33 -				int count = stmt.executeUpdate();
    2.34 -
    2.35 +				setSelectQuery(stmt, null, null, null,(RdbmsResource[]) null);
    2.36 +				stmt.executeUpdate();
    2.37  			}
    2.38  			finally {
    2.39  				stmt.close();
    2.40 @@ -513,7 +513,6 @@
    2.41  		catch (SQLException e) {
    2.42  			throw new RdbmsException(e);
    2.43  		}
    2.44 -
    2.45  	}
    2.46  
    2.47  }
     3.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBValueFactory.java	Sat Mar 23 03:26:37 2013 +0200
     3.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBValueFactory.java	Sat Mar 23 14:23:08 2013 +0200
     3.3 @@ -239,26 +239,26 @@
     3.4  
     3.5      /****************************************************/
     3.6      public RdbmsLiteral asRdbmsLiteral(GeneralDBPolyhedron polyhedron) {
     3.7 -            try {
     3.8 -                    URI wkt = new URIImpl(GeoConstants.WKT);
     3.9 -                    RdbmsLiteral literal = new RdbmsLiteral(polyhedron.getInternalId(), polyhedron.getVersion(),new LiteralImpl(polyhedron.stringValue(), wkt));
    3.10 +        try {
    3.11 +                URI wkt = new URIImpl(GeoConstants.WKT);
    3.12 +                RdbmsLiteral literal = new RdbmsLiteral(polyhedron.getInternalId(), polyhedron.getVersion(),new LiteralImpl(polyhedron.stringValue(), wkt));
    3.13  
    3.14 -                    if (polyhedron instanceof GeneralDBPolyhedron) {
    3.15 -                            literals.cache(literal);
    3.16 -                            return (RdbmsLiteral)literal;
    3.17 -                    }
    3.18 +                if (polyhedron instanceof GeneralDBPolyhedron) {
    3.19 +                        literals.cache(literal);
    3.20 +                        return (RdbmsLiteral)literal;
    3.21 +                }
    3.22  
    3.23 -                    RdbmsLiteral lit = literals.findInCache(literal);
    3.24 -                    
    3.25 -                    if (lit == null) {
    3.26 -                            lit = new RdbmsLiteral(literal);
    3.27 -                            literals.cache(lit);
    3.28 -                    }
    3.29 -                    return lit;
    3.30 -            }
    3.31 -            catch (InterruptedException e) {
    3.32 -                    throw new RdbmsRuntimeException(e);
    3.33 -            }
    3.34 +                RdbmsLiteral lit = literals.findInCache(literal);
    3.35 +                
    3.36 +                if (lit == null) {
    3.37 +                        lit = new RdbmsLiteral(literal);
    3.38 +                        literals.cache(lit);
    3.39 +                }
    3.40 +                return lit;
    3.41 +        }
    3.42 +        catch (InterruptedException e) {
    3.43 +                throw new RdbmsRuntimeException(e);
    3.44 +        }
    3.45      }
    3.46      
    3.47      public RdbmsLiteral asRdbmsLiteral(StrabonPolyhedron polyhedron) {
     4.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java	Sat Mar 23 03:26:37 2013 +0200
     4.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java	Sat Mar 23 14:23:08 2013 +0200
     4.3 @@ -6,14 +6,12 @@
     4.4  package org.openrdf.sail.generaldb.managers;
     4.5  
     4.6  import java.sql.Connection;
     4.7 -import java.sql.DatabaseMetaData;
     4.8  import java.sql.SQLException;
     4.9  import java.util.Collection;
    4.10  import java.util.HashMap;
    4.11  import java.util.Map;
    4.12  import java.util.concurrent.BlockingQueue;
    4.13  
    4.14 -import org.openrdf.sail.generaldb.GeneralDBSqlTable;
    4.15  import org.openrdf.sail.generaldb.schema.Batch;
    4.16  import org.openrdf.sail.generaldb.schema.IdSequence;
    4.17  import org.openrdf.sail.generaldb.schema.TransactionTable;
    4.18 @@ -308,7 +306,6 @@
    4.19  
    4.20  	private String getEmptyTableName() {
    4.21  		StringBuilder sb = new StringBuilder(256);
    4.22 -		GeneralDBSqlTable temp = (GeneralDBSqlTable)temporaryTable;
    4.23  		sb.append("(");
    4.24  		sb.append("SELECT ");
    4.25  		sb.append(getZeroBigInt()).append(" AS ctx, ");
     5.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TripleManager.java	Sat Mar 23 03:26:37 2013 +0200
     5.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TripleManager.java	Sat Mar 23 14:23:08 2013 +0200
     5.3 @@ -6,10 +6,8 @@
     5.4  package org.openrdf.sail.generaldb.managers;
     5.5  
     5.6  import java.sql.SQLException;
     5.7 -import java.sql.Timestamp;
     5.8  
     5.9  import org.openrdf.generaldb.managers.base.ManagerBase;
    5.10 -import org.openrdf.sail.generaldb.managers.TransTableManager;
    5.11  /**
    5.12   * 
    5.13   * @author James Leigh