ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milen Dzhumerov <gameh...@1nsp1r3d.co.uk>
Subject Re: Weird compilation problems
Date Thu, 06 Apr 2006 21:39:43 GMT
Alexey N. Solofnenko wrote:
> It is not ANT problem - you have an anonymous inner class. Look for 
> "new AAA() {...." somewhere in your code.
>
> - Alexey.
>
> Milen Dzhumerov wrote:
>> Hi there,
>>
>> I've been trying to compile a few simple classes with Ant and 
>> everything is fine except that it produces a class twice with the name:
>> SqlErrorCond$1.class
>> SqlErrorCond.class
>> The files have different sizes.
>>
>> Here's the ant file:
>> <?xml version="1.0"?>
>> <project name="SWT Desk" default="compile" basedir=".">
>>
>> <!-- Project-wide settings. All directories are relative to the -->
>> <!-- project root directory -->
>>
>> <!-- Project directories -->
>> <property name="src.dir" value="src"/>
>> <property name="build.dir" value="build"/>
>>
>> <!-- Build the application -->
>> <target name="compile">
>>    <javac destdir="${build.dir}"
>>    debug="off"
>>    deprecation="off">
>>        <!-- We could have used javac's srcdir attribute -->
>>        <src path="${src.dir}"/>
>>    </javac>
>> </target>
>>
>> </project>
>>
>> And the verbose output:
>> G:\swtdesk>ant -v
>> Apache Ant version 1.6.5 compiled on June 2 2005
>> Buildfile: build.xml
>> Detected Java version: 1.5 in: C:\Program Files\Java\jdk1.5.0_06\jre
>> Detected OS: Windows XP
>> parsing buildfile G:\swtdesk\build.xml with URI = 
>> file:///G:/swtdesk/build.xml
>> Project base dir set to: G:\swtdesk
>> Build sequence for target(s) `compile' is [compile]
>> Complete build sequence is [compile, ]
>>
>> compile:
>>    [javac] InstallTableException.java added as 
>> InstallTableException.class doesn't exist.
>>    [javac] NoDatabaseConnectionException.java added as 
>> NoDatabaseConnectionException.class doesn't exist.
>>    [javac] PgDb.java added as PgDb.class doesn't exist.
>>    [javac] PgSqlException.java added as PgSqlException.class doesn't 
>> exist.
>>    [javac] SInstallTables.java added as SInstallTables.class doesn't 
>> exist.
>>    [javac] SObject.java added as SObject.class doesn't exist.
>>    [javac] SqlError.java added as SqlError.class doesn't exist.
>>    [javac] SqlErrorCond.java added as SqlErrorCond.class doesn't exist.
>>    [javac] SqlNames.java added as SqlNames.class doesn't exist.
>>    [javac] SqlUtils.java added as SqlUtils.class doesn't exist.
>>    [javac] Compiling 10 source files to G:\swtdesk\build
>>    [javac] Using modern compiler
>>    [javac] Compilation arguments:
>>    [javac] '-d'
>>    [javac] 'G:\swtdesk\build'
>>    [javac] '-classpath'
>>    [javac] 
>> 'G:\swtdesk\build;C:\ant\lib\ant-launcher.jar;C:\ant\lib\ant-antlr.jar;C:\ant\lib\ant-apache-bcel.jar;C:\ant\lib\ant-apache

>>
>> -bsf.jar;C:\ant\lib\ant-apache-log4j.jar;C:\ant\lib\ant-apache-oro.jar;C:\ant\lib\ant-apache-regexp.jar;C:\ant\lib\ant-apache-resolver.

>>
>> jar;C:\ant\lib\ant-commons-logging.jar;C:\ant\lib\ant-commons-net.jar;C:\ant\lib\ant-icontract.jar;C:\ant\lib\ant-jai.jar;C:\ant\lib\an

>>
>> t-javamail.jar;C:\ant\lib\ant-jdepend.jar;C:\ant\lib\ant-jmf.jar;C:\ant\lib\ant-jsch.jar;C:\ant\lib\ant-junit.jar;C:\ant\lib\ant-netrex

>>
>> x.jar;C:\ant\lib\ant-nodeps.jar;C:\ant\lib\ant-starteam.jar;C:\ant\lib\ant-stylebook.jar;C:\ant\lib\ant-swing.jar;C:\ant\lib\ant-trax.j

>>
>> ar;C:\ant\lib\ant-vaj.jar;C:\ant\lib\ant-weblogic.jar;C:\ant\lib\ant-xalan1.jar;C:\ant\lib\ant-xslp.jar;C:\ant\lib\ant.jar;C:\ant\lib\x

>>
>> ercesImpl.jar;C:\ant\lib\xml-apis.jar;C:\Program 
>> Files\Java\jdk1.5.0_06\lib\tools.jar'
>>    [javac] '-sourcepath'
>>    [javac] 'G:\swtdesk\src'
>>    [javac] '-g:none'
>>    [javac]
>>    [javac] The ' characters around the executable and arguments are
>>    [javac] not part of the command.
>>    [javac] Files to be compiled:
>>    [javac]     G:\swtdesk\src\InstallTableException.java
>>    [javac]     G:\swtdesk\src\NoDatabaseConnectionException.java
>>    [javac]     G:\swtdesk\src\PgDb.java
>>    [javac]     G:\swtdesk\src\PgSqlException.java
>>    [javac]     G:\swtdesk\src\SInstallTables.java
>>    [javac]     G:\swtdesk\src\SObject.java
>>    [javac]     G:\swtdesk\src\SqlError.java
>>    [javac]     G:\swtdesk\src\SqlErrorCond.java
>>    [javac]     G:\swtdesk\src\SqlNames.java
>>    [javac]     G:\swtdesk\src\SqlUtils.java
>>
>> BUILD SUCCESSFUL
>> Total time: 3 seconds
>> G:\swtdesk>
>>
>> Any suggestions are greatly appreciated.
>>
>> Kind regards,
>> gamehack
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
It seems that I do not have any inner classes. Here's the source of the 
file:
package dzhumerov.dbutil;

import dzhumerov.abstraction.SObject;

public class SqlErrorCond extends SObject
{
    private SqlErrorCond()
    {
        //
    }
   
    public Object clone() throws CloneNotSupportedException   
    {
        throw new CloneNotSupportedException();
        // that'll teach 'em
    }
   
    public static SqlError getError(String SQLState)
    {
        if(SQLState.equals("42P07"))
            return SqlError.TBL_DUPLICATE_TABLE;
       
        if(SQLState.equals("42710"))
            return SqlError.DB_DUPLICATE_ROLE;
       
        if(SQLState.equals("42P06"))
            return SqlError.DB_DUPLICATE_SCHEMA;
       
        if(SQLState.equals("42501"))
            return SqlError.INSUFFICIENT_PRIVILEGE;
       
        if(SQLState.equals("3D000"))
            return SqlError.DB_NAME;
       
        if(SQLState.equals("28000"))
            return SqlError.DB_AUTH;
       
        if(SQLState.equals("08006"))
            return SqlError.DB_NO_SSL;
       
        if(SQLState.equals("08004"))
            return SqlError.DB_INVALID_PORT;
       
        if(SQLState.equals("08001"))
            return SqlError.DB_HOST;
       
        if(SQLState.equals("3F000"))
            return SqlError.DB_INVALID_SCHEMA;
       
        if(SQLState.equals("42601"))
            return SqlError.SYNTAX_ERROR;
       
        return SqlError.DB_UNKNOWN;
    }
   
    public static String getErrorDescription(SqlError error)
    {
        switch(error)
        {
        case DB_DUPLICATE_ROLE:
            return "A role with that name already exists.";
        case DB_DUPLICATE_SCHEMA:
            return "A schema with that name already exists.";
        case TBL_DUPLICATE_TABLE:
            return "A table with that name already exists.";
        case INSUFFICIENT_PRIVILEGE:
            return "You do not have sufficient permissions to create 
database objects.";
        case DB_SUCCESS:
            return "Successful query";
        case DB_AUTH:
            return "Your login/password information is incorrect";
        case DB_HOST:
            return "The hostname you provided is invalid.";
        case DB_INVALID_PORT:
            return "The port you provided is invalid.";
        case DB_NAME:
            return "The database name you have provided is invalid";
        case DB_NO_DRIVER:
            return "The PostgreSQL driver is missing.";
        case DB_NO_SSL:
            return "You database server does not support SSL.";
        case DB_UNKNOWN:
            return "An unknown error occurred.";
        case DB_INVALID_SCHEMA:
            return "A schema with that name does not exist.";
        case SYNTAX_ERROR:
            return "These is a syntax error in the SQL query.";
        default:
            return "An unknown error occurred.";
        }
    }
}

I'm puzzled.

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message