Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 1706 Details for
Bug 21661
Compile dependency problems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
e-mail to jdt-core-dev@eclipse.org describing the phenomenon
e-mail.txt (text/plain), 3.40 KB, created by
Robert Klemme
on 2002-07-17 13:01:49 EDT
(
hide
)
Description:
e-mail to jdt-core-dev@eclipse.org describing the phenomenon
Filename:
MIME Type:
Creator:
Robert Klemme
Created:
2002-07-17 13:01:49 EDT
Size:
3.40 KB
patch
obsolete
> >hi there! > >> Would be interesting to see the actual test case. The compiler may indeed >> require classfiles indirectly referenced by others you explicitly >> reference. >> But if so, I am wondering why we would need more than actually needed to >> run (could be wrong, but would need the actual test case to assess). > >think of this scenario: > >public class X { >public void foo() { > if ( getCriterion() ) { > Y y = new Y(); > y.someMethod(); > } >} > >} > >now, as long as getCriterion() evaluates to "false" Y is never loaded by the >JVM when this is the only place referencing it (or all other places are not >accessed either). the jvm spec reads in section 2.17.3 Linking: >Verification, Preparation, and Resolution: > >The Java programming language allows an implementation flexibility as to >when linking activities (and, because of recursion, loading) take place, >provided that the semantics of the language are respected, that a class or interface >is completely verified and prepared before it is initialized, and that >errors detected during linkage are thrown at a point in the program where some >action is taken by the program that might require linkage to the class or >interface involved in the error. > >see >http://java.sun.com/docs/books/vmspec/2nd-edition/html/Concepts.doc.html#22574 > >the language spec reads in 12.4.1 When Initialization Occurs: > >A class or interface type T will be initialized immediately before the first >occurrence of any one of the following: > > - T is a class and an instance of T is created. > > - T is a class and a static method declared by T is invoked. > > - A static field declared by T is assigned. > > - A static field declared by T is used and the reference to the field is >not a compile-time constant (ยง15.28). References to compile-time constants must >be resolved at compile time to a copy of the compile-time constant value, so >uses of such a field never cause initialization. > >see >http://java.sun.com/docs/books/jls/second_edition/html/execution.doc.html#57946 > >in other words: if a class is missing, the error is only reported when it is >actually needed during execution, regardless which policy the vm employs to >load classes. > >> When you say it compiled fine using Ant compile, which compiler did you >> use in there ? > >the one coming with jdk build 1.3.1_04-b02. > >> I believe there is little you can do, but trying to add the missing types > >thanks to dave i could do this. i didn't realize the classes are there. >however, i think this is a more general problem since the antlr people could >have choosen not to disclose these classes without harm to the correct >functioning of their library. > >my personal preference would be to have a compiler switch for this with the >same three options "ignore", "warning" and "error" like the others. the >semantics would apply to classes referenced from classes that are outside the >scope of the current project's compilation, typically in jars and zips, but it >could be a class folder as well. > >> (or removing the reference path that leads to them - may be even harder). > >yes, this one is not feasible. > >> We might want to figure exactly what is going on here, and investigate a >> fix if proven to be a bug. >> >> Could you please enter a bug report against JDT/Core with steps to >> reproduce ? > >ok. i'll try to set up a minimal scenario that creates the problem. > >thank's for listening. > >regards > > robert >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 21661
: 1706 |
1718