Bug 178156 - [mis-compilation] Cannot create basic java class
Summary: [mis-compilation] Cannot create basic java class
Alias: None
Product: Fedora
Classification: Fedora
Component: eclipse
Version: rawhide
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Andrew Overholt
QA Contact:
: 179070 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2006-01-18 03:14 UTC by Ricky Ng-Adam
Modified: 2007-11-30 22:11 UTC (History)
5 users (show)

Clone Of:
Last Closed: 2006-02-07 16:37:25 UTC

Attachments (Terms of Use)
screenshot from clean workspace (99.84 KB, image/png)
2006-01-20 00:28 UTC, Ricky Ng-Adam
no flags Details

Description Ricky Ng-Adam 2006-01-18 03:14:53 UTC
Description of problem:

cannot create HelloWorld program:

Creation of element failed.

HelloWorld [in [Working copy] HelloWorld.java [in <default> [in <project root>
[in test2]]]] does not exist

and after that, when I click finish:

Creation of element failed.
Reason: /test2/HelloWorld.java already exists in target

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1. New java project
2. New class
3. HelloWorld with main()
Actual results:

inability to close wizard with finish (must press cancel)
empty HelloWorld.java file

Expected results:

A simple Java program

Additional info:

Comment 1 Andrew Overholt 2006-01-19 21:48:46 UTC
I can't duplicate this.  Did you try with a clean workspace?  You can use a
different workspace with:

eclipse -data <new workspace location ex. workspace2>

Comment 2 Ricky Ng-Adam 2006-01-20 00:28:50 UTC
Created attachment 123465 [details]
screenshot from clean workspace

Comment 3 Andrew Overholt 2006-01-20 15:12:39 UTC
Hmm.  Can you temporarily move ~/.eclipse out of the way?

mv ~/.eclipse{,.beforetest178156}
eclipse -data <newworkspace>
mv ~/.eclipse{.beforetest178156,}

(or something like that)

Also, can you give me the output of the following, please:

which java
java -version
which javac
javac -version
uname -a
rpm -q java-1.4.2-gcj-compat{,-devel}
rpm -q gcc-java

Comment 4 Andrew Overholt 2006-01-20 19:02:32 UTC
I am getting this now as well.  This is what is in <workspace>/.metadata/.log:

Java Model Exception: Java Model Status [Test2 [in [Working copy] Test2.java [in
<default> [in src [in Test]]]] does not exist]
   at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException
   at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed
   at org.eclipse.jdt.internal.core.JavaElement.getElementInfo
   at org.eclipse.jdt.internal.core.JavaElement.getElementInfo
   at org.eclipse.jdt.internal.core.JavaElement.getChildren (JavaElement.java:173)
   at org.eclipse.jdt.internal.core.JavaElement.getChildrenOfType
   at org.eclipse.jdt.internal.core.SourceType.getMethods (SourceType.java:355)
   at org.eclipse.jdt.ui.wizards.NewTypeWizardPage.createInheritedMethods
   at org.eclipse.jdt.ui.wizards.NewClassWizardPage.createTypeMembers
   at org.eclipse.jdt.ui.wizards.NewTypeWizardPage.createType
   at org.eclipse.jdt.internal.ui.wizards.NewClassCreationWizard.finishPage
   at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run
   at org.eclipse.jdt.internal.core.BatchOperation.executeOperation
   at org.eclipse.jdt.internal.core.JavaModelOperation.run
   at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1719)
   at org.eclipse.jdt.core.JavaCore.run (JavaCore.java:3761)
   at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run
   at org.eclipse.jface.operation.ModalContext$ModalContextThread.run

We will try to come up with a test case that is reproduceable.

Thanks for bringing this to my attention, Ricky.

Comment 5 Andrew Overholt 2006-01-20 19:26:46 UTC
Removing /usr/lib/gcj/eclipse/org.eclipse.jdt.core_3.1.1.jar.so{,.db} and then
doing a rebuild-gcj-db works around this issue so it appears to be one of native
compilation and not a class library issue.

Comment 6 Andrew Overholt 2006-01-20 19:37:30 UTC
I haven't tried any other arches, but this happens on at least i386.

Updating summary.

This should probably be added as an FC blocker.

Comment 7 Anthony Green 2006-01-28 01:09:38 UTC
(In reply to comment #6)
> I haven't tried any other arches, but this happens on at least i386.

This happens on x86-64 as well.

Comment 8 Anthony Green 2006-01-28 17:57:39 UTC
*** Bug 179070 has been marked as a duplicate of this bug. ***

Comment 9 Andrew Haley 2006-01-30 17:50:55 UTC
I'm debugging this.

Comment 10 Andrew Overholt 2006-02-07 16:37:25 UTC
This is fixed in eclipse-3.1.2-1jpp_4fc which hit rawhide today.  It was
compiled against gcc-4.1.0-0.23 which contains Andrew (H)'s fix.  Thanks again,
Andrew (H)!

Note You need to log in before you can comment on or make changes to this bug.