Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Build errors (at least for me) in tapx-core #26

Closed
jochenberger opened this Issue Apr 6, 2011 · 2 comments

Comments

Projects
None yet
2 participants
Collaborator

jochenberger commented Apr 6, 2011

I get the following build errors in tapx-core

tapx-core/src/main/java/com/howardlewisship/tapx/core/tree/DefaultTreeModel.java:111: cannot find symbol
symbol  : constructor DefaultTreeModel(org.apache.tapestry5.ValueEncoder,com.howardlewisship.tapx.core.tree.TreeModelAdapter,java.util.List)
location: class com.howardlewisship.tapx.core.tree.DefaultTreeModel
        this(encoder, adapter, CollectionFactory.newList(root));
        ^

and

tapx-core/src/test/java/com/demo/data/FileSystemTreeModel.java:73: cannot find symbol
symbol  : constructor DefaultTreeModel(org.apache.tapestry5.ValueEncoder,com.howardlewisship.tapx.core.tree.TreeModelAdapter,java.util.List)
location: class com.howardlewisship.tapx.core.tree.DefaultTreeModel
        super(ENCODER, ADAPTER, CollectionFactory.newList(new File(rootDir).listFiles()));
        ^

This happens with Sun's JDK as well as with OpenJDK and regardless of whether I set the source/target level to 1.5 or 1.6. However, Eclipse seems to be perfectly fine with it.
Seems to be a similar problem as the first one in http://weblogs.java.net/blog/carcassi/archive/2010/04/09/two-problems-generics-java-0.
In the case of DefaultTreeModel, I can fix those errors by either using java.util.Collections.singletonList(root) instead of CollectionFactory.newList(root) or using the awfully ugly syntax CollectionFactory.<T,T>newList(root) (which I didn't even know to exist).
If you don't mind, I would like to commit the first alternative, but more importantly: do you have any idea why I get those errors while you don't?

Owner

hlship commented Apr 6, 2011

$ gr clean comJ
:tapx-core:clean
:tapx-core:compileJava
Note: /Users/hlship/workspaces/tapestry/tapx/tapx-core/src/main/java/com/howardlewisship/tapx/core/components/MultipleSelect.java
uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

BUILD SUCCESSFUL

Total time: 6.03 secs
~/workspaces/tapestry/tapx/tapx-core
$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
~/workspaces/tapestry/tapx/tapx-core

Feel free to commit what works for you; I doubt it will cause problems
on my end. Java Generics are just The Sux ... obviously, Eclipse
interprets something in the spec one way, and Oracle javac
differently. Bleh.

On Wed, Apr 6, 2011 at 12:09 AM, jochenberger
reply@reply.github.com
wrote:

I get the following build errors in tapx-core

tapx-core/src/main/java/com/howardlewisship/tapx/core/tree/DefaultTreeModel.java:111: cannot find symbol
symbol  : constructor DefaultTreeModel(org.apache.tapestry5.ValueEncoder,com.howardlewisship.tapx.core.tree.TreeModelAdapter,java.util.List<java.lang.Object>)
location: class com.howardlewisship.tapx.core.tree.DefaultTreeModel
       this(encoder, adapter, CollectionFactory.newList(root));
       ^

and

tapx-core/src/test/java/com/demo/data/FileSystemTreeModel.java:73: cannot find symbol
symbol  : constructor DefaultTreeModel(org.apache.tapestry5.ValueEncoder<java.io.File>,com.howardlewisship.tapx.core.tree.TreeModelAdapter<java.io.File>,java.util.List<java.lang.Object>)
location: class com.howardlewisship.tapx.core.tree.DefaultTreeModel<java.io.File>
       super(ENCODER, ADAPTER, CollectionFactory.newList(new File(rootDir).listFiles()));
       ^

This happens with Sun's JDK as well as with OpenJDK and regardless of whether I set the source/target level to 1.5 or 1.6. However, Eclipse seems to be perfectly fine with it.
Seems to be a similar problem as the first one in http://weblogs.java.net/blog/carcassi/archive/2010/04/09/two-problems-generics-java-0.
In the case of DefaultTreeModel, I can fix those errors by either using java.util.Collections.singletonList(root) instead of CollectionFactory.newList(root) or using the awfully ugly syntax CollectionFactory.<T,T>newList(root) (which I didn't even know to exist).
If you don't mind, I would like to commit the first alternative, but more importantly: do you have any idea why I get those errors while you don't?

Reply to this email directly or view it on GitHub:
#26

Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Collaborator

jochenberger commented Apr 7, 2011

fix build error in FileSystemTreeModel (closed by 2f4d077)
tapx-core/src/test/java/com/demo/data/FileSystemTreeModel.java:73: cannot find symbol
symbol : constructor DefaultTreeModel(org.apache.tapestry5.ValueEncoder,com.howardlewisship.tapx.core.tree.TreeModelAdapter,java.util.List)
location: class com.howardlewisship.tapx.core.tree.DefaultTreeModel
super(ENCODER, ADAPTER, CollectionFactory.newList(new File(rootDir).listFiles()));
^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment