You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Clifton C. Craig" <cc...@icsaward.com> on 2004/01/23 19:18:01 UTC

Javac task skips inner classes

I have an issue where I run <javac> over a .java file with an inner 
class and the inner class is not generated. My build process involves a 
lot of Java comppiles and I'm not sure exactly where things get out of 
step. What I do know is occasionally when a bug slips into our source 
control head rev it causes our compile task (which runs over a fileset 
containing all of our source) to stop abruptly while the rest of the 
build continues. (failonerror=no) I then notice that a couple of files 
with inner classes are partially compiled. That is their corresponding 
class files are present but their inner class .class files are not. An 
attempt to run <javac> over just the .java file or files that are 
incomplete does nothing and I assume it's probably because of <javac>'s 
dependancy checking where it see's the corresponding .class file for the 
.java and does nothing. An attempt to run <javac> over the .java after 
the .class is deleted creates both the class and inner class for the 
file. This is sometimes annoying as we sometimes need to test the rest 
of the app while one little bug is being fixed by another developer. It 
becomes a hard-ship to nail down exactly which class files were skipped 
due to a minor bug. Is there a way to turn off dependancy checking for 
javac and force it to compile all classes regardless of whether they 
already have an existing .java file? Also could someone explain how a 
.java file with an inner class can be partially compiled like this?

-- 
Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
2101 Embassy Drive
Lancaster, PA  17603

Phone:  717-295-7977 ext. 621
Fax:  717-295-7683
ccc@icsaward.com
ccraig@globalbeveragegroup.com
****************************************************************************


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


Re: Javac task skips inner classes

Posted by "Clifton C. Craig" <cc...@icsaward.com>.
Thanks Doug ,

You make a good point and I will look into the CLASSPATH to make sure 
there are no issues there. I still don't understand primarily how a 
class file can be partially compiled but I know it's happening in our 
case. The sequence of events is:
1. Delete the build output directory.
2. Run a full build which passes a fileset with all of our .java files 
to <javac>
3. <javac> fails due to a minor bug leaving some files non-compiled
4. I inspect the output folder to discover the .class missing its inner 
class.

I look a little deeper into this. Thanks.

Clifton C. Craig, Software Engineer
Intelligent Computer Systems -  A Division of GBG
2101 Embassy Drive
Lancaster, PA  17603

Phone:  717-295-7977 ext. 621
Fax:  717-295-7683
ccc@icsaward.com
ccraig@globalbeveragegroup.com
****************************************************************************



Doug Lochart wrote:

>Not knowing how your development procedure is laid out I can only comment on
>how I do it.
>First off I separate code as best I can into cohesive projects being very
>careful about cross project
>dependencies.  Thus I don't have to compile everything all the time unless I
>am doing a release.
>When I want to compile everything fresh I have a CVS deployment repository
>that contains ant
>deploymnet scripts for each major product that we have.  From there I select
>a product and kick off
>a build.  This will delete all files for that project in the cvs working
>directory and then do a fresh checkout
>from CVS of the source and then do a rebuild.  If you don't have a structure
>like this you can still accomplish this by
>creating a "clean" target that deletes all class files (and jars) from your
>classes directory or wherever they happen to
>live when they are built.
>
>As an aside your inner class problem may reside in your classpath but this
>is only a theory.
>We maintain jars for each project that is built.  When a project is being
>rebuilt if you include that jar in your classpath (by mistake or design)
>javac may find it in the jar and not rebuild it.  It may rebuild the main
>class based on dependency rules but I do
>not know if those same dependency rules apply to inner classes.
>
>good luck
>
>Doug
>
>Now I've gained some understanding
>Of the only world that we see.
>Things that I once dreamed of
>Have become reality.
>
>These walls that still surround me
>Still contain the same old me,
>Just one more who's searching for
>A world that ought to be.
>----- Original Message ----- 
>From: "Clifton C. Craig" <cc...@icsaward.com>
>To: "Ant Users List" <us...@ant.apache.org>
>Sent: Friday, January 23, 2004 1:18 PM
>Subject: Javac task skips inner classes
>
>
>  
>
>>I have an issue where I run <javac> over a .java file with an inner
>>class and the inner class is not generated. My build process involves a
>>lot of Java comppiles and I'm not sure exactly where things get out of
>>step. What I do know is occasionally when a bug slips into our source
>>control head rev it causes our compile task (which runs over a fileset
>>containing all of our source) to stop abruptly while the rest of the
>>build continues. (failonerror=no) I then notice that a couple of files
>>with inner classes are partially compiled. That is their corresponding
>>class files are present but their inner class .class files are not. An
>>attempt to run <javac> over just the .java file or files that are
>>incomplete does nothing and I assume it's probably because of <javac>'s
>>dependancy checking where it see's the corresponding .class file for the
>>.java and does nothing. An attempt to run <javac> over the .java after
>>the .class is deleted creates both the class and inner class for the
>>file. This is sometimes annoying as we sometimes need to test the rest
>>of the app while one little bug is being fixed by another developer. It
>>becomes a hard-ship to nail down exactly which class files were skipped
>>due to a minor bug. Is there a way to turn off dependancy checking for
>>javac and force it to compile all classes regardless of whether they
>>already have an existing .java file? Also could someone explain how a
>>.java file with an inner class can be partially compiled like this?
>>
>>-- 
>>Clifton C. Craig, Software Engineer
>>Intelligent Computer Systems -  A Division of GBG
>>2101 Embassy Drive
>>Lancaster, PA  17603
>>
>>Phone:  717-295-7977 ext. 621
>>Fax:  717-295-7683
>>ccc@icsaward.com
>>ccraig@globalbeveragegroup.com
>>
>>    
>>
>****************************************************************************
>  
>
>>---------------------------------------------------------------------
>>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
>
>
>
>  
>

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


Re: Javac task skips inner classes

Posted by Doug Lochart <dl...@capecomputing.com>.
Not knowing how your development procedure is laid out I can only comment on
how I do it.
First off I separate code as best I can into cohesive projects being very
careful about cross project
dependencies.  Thus I don't have to compile everything all the time unless I
am doing a release.
When I want to compile everything fresh I have a CVS deployment repository
that contains ant
deploymnet scripts for each major product that we have.  From there I select
a product and kick off
a build.  This will delete all files for that project in the cvs working
directory and then do a fresh checkout
from CVS of the source and then do a rebuild.  If you don't have a structure
like this you can still accomplish this by
creating a "clean" target that deletes all class files (and jars) from your
classes directory or wherever they happen to
live when they are built.

As an aside your inner class problem may reside in your classpath but this
is only a theory.
We maintain jars for each project that is built.  When a project is being
rebuilt if you include that jar in your classpath (by mistake or design)
javac may find it in the jar and not rebuild it.  It may rebuild the main
class based on dependency rules but I do
not know if those same dependency rules apply to inner classes.

good luck

Doug

Now I've gained some understanding
Of the only world that we see.
Things that I once dreamed of
Have become reality.

These walls that still surround me
Still contain the same old me,
Just one more who's searching for
A world that ought to be.
----- Original Message ----- 
From: "Clifton C. Craig" <cc...@icsaward.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Friday, January 23, 2004 1:18 PM
Subject: Javac task skips inner classes


> I have an issue where I run <javac> over a .java file with an inner
> class and the inner class is not generated. My build process involves a
> lot of Java comppiles and I'm not sure exactly where things get out of
> step. What I do know is occasionally when a bug slips into our source
> control head rev it causes our compile task (which runs over a fileset
> containing all of our source) to stop abruptly while the rest of the
> build continues. (failonerror=no) I then notice that a couple of files
> with inner classes are partially compiled. That is their corresponding
> class files are present but their inner class .class files are not. An
> attempt to run <javac> over just the .java file or files that are
> incomplete does nothing and I assume it's probably because of <javac>'s
> dependancy checking where it see's the corresponding .class file for the
> .java and does nothing. An attempt to run <javac> over the .java after
> the .class is deleted creates both the class and inner class for the
> file. This is sometimes annoying as we sometimes need to test the rest
> of the app while one little bug is being fixed by another developer. It
> becomes a hard-ship to nail down exactly which class files were skipped
> due to a minor bug. Is there a way to turn off dependancy checking for
> javac and force it to compile all classes regardless of whether they
> already have an existing .java file? Also could someone explain how a
> .java file with an inner class can be partially compiled like this?
>
> -- 
> Clifton C. Craig, Software Engineer
> Intelligent Computer Systems -  A Division of GBG
> 2101 Embassy Drive
> Lancaster, PA  17603
>
> Phone:  717-295-7977 ext. 621
> Fax:  717-295-7683
> ccc@icsaward.com
> ccraig@globalbeveragegroup.com
>
****************************************************************************
>
>
> ---------------------------------------------------------------------
> 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