Commit 10db51ea authored by gmantele's avatar gmantele
Browse files

Merge pull request #9 from mbtaylor/adql13-java5

Permit ADQL library build for java5
parents 94b00c57 7a618199
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@
	
	<target name="compileLib" depends="clean,junitValidation" description="Build all the classes of the ADQL library. This target is particularly usefull because it lets highlighting missing dependencies.">
		<mkdir dir="${compileDir}" />
		<javac destdir="${compileDir}" srcdir="${srcDir}" includes="${includesList}" includeantruntime="false" encoding="utf8">
		<javac destdir="${compileDir}" srcdir="${srcDir}" includes="${includesList}" includeantruntime="false" encoding="utf8" bootclasspath="${adql.bootclasspath}">
			<classpath refid="adql.classpath" />
		</javac>
	</target>
+5 −2
Original line number Diff line number Diff line
@@ -215,7 +215,9 @@ public class DBChecker implements QueryChecker {
					tmp[cnt++] = udf;
			}
			// make a copy of the array:
			this.allowedUdfs = Arrays.copyOf(tmp, cnt, FunctionDef[].class);
                        this.allowedUdfs = new FunctionDef[cnt];
                        System.arraycopy(tmp, 0, this.allowedUdfs, 0, cnt);

			tmp = null;
			// sort the values:
			Arrays.sort(this.allowedUdfs);
@@ -318,7 +320,8 @@ public class DBChecker implements QueryChecker {
		}

		// Make an adjusted array copy:
		String[] copy = Arrays.copyOf(tmp, cnt);
		String[] copy = new String[cnt];
                System.arraycopy(tmp, 0, copy, 0, cnt);

		// Sort the values:
		Arrays.sort(copy);
+4 −4
Original line number Diff line number Diff line
@@ -66,15 +66,15 @@ public class UnresolvedIdentifiersException extends ParseException implements It
			exceptions.add(pe);
			if (pe instanceof UnresolvedColumnException){
				String colName = ((UnresolvedColumnException)pe).getColumnName();
				if (colName != null && !colName.trim().isEmpty())
				if (colName != null && colName.trim().length()>0)
					addIdentifierName(colName + " " + pe.getPosition());
			}else if (pe instanceof UnresolvedTableException){
				String tableName = ((UnresolvedTableException)pe).getTableName();
				if (tableName != null && !tableName.trim().isEmpty())
				if (tableName != null && tableName.trim().length()>0)
					addIdentifierName(tableName + " " + pe.getPosition());
			}else if (pe instanceof UnresolvedFunctionException){
				String fctName = (((UnresolvedFunctionException)pe).getFunction() == null) ? null : ((UnresolvedFunctionException)pe).getFunction().getName() + "(...)";
				if (fctName != null && !fctName.trim().isEmpty())
				if (fctName != null && fctName.trim().length()>0)
					addIdentifierName(fctName /*+ " " + pe.getPosition()*/);	// TODO Add the position of the function in the ADQL query!
			}else if (pe instanceof UnresolvedIdentifiersException)
				addIdentifierName(((UnresolvedIdentifiersException)pe).unresolvedIdentifiers);
@@ -87,7 +87,7 @@ public class UnresolvedIdentifiersException extends ParseException implements It
	 * @param name	Name (or description) of the identifier to add.
	 */
	private final void addIdentifierName(final String name){
		if (name != null && !name.trim().isEmpty()){
		if (name != null && name.trim().length()>0){
			if (unresolvedIdentifiers == null)
				unresolvedIdentifiers = "";
			else
+1 −1
Original line number Diff line number Diff line
@@ -398,7 +398,7 @@ public class ADQLParser implements ADQLParserConstants {

		try{

			if (file == null || file.isEmpty())
			if (file == null || file.length()==0)
				parser = new ADQLParser(System.in);
			else if (file.matches(urlRegex))
				parser = new ADQLParser((new java.net.URL(file)).openStream());