Community
Participate
Working Groups
Fixing bug 124469 I got an AIOOBE while trying to export my test cases. I'll attach the initial source project I wrote. Unzip it and try to export the project in a jar file. You'll get following messages: JAR creation failed. See details for additional information. class file(s) on classpath not found or not accessible /b124469/test/C.java Exported with compile warnings: /b124469/test/V.java class file(s) on classpath not found or not accessible /b124469/test/P.java class file(s) on classpath not found or not accessible /b124469/test/M.java class file(s) on classpath not found or not accessible /b124469/test/F.java
Created attachment 34067 [details] Project which failed to export in jar file
Here's the stack trace I got in debugger: ClassFileAttribute(ClassFileStruct).u4At(byte[], int, int) line: 64 ClassFileAttribute.<init>(byte[], IConstantPool, int) line: 30 ClassFileReader.<init>(byte[], int) line: 262 ToolFactory.createDefaultClassFileReader(InputStream, int) line: 195 JarFileExportOperation.buildJavaToClassMap(IContainer, IProgressMonitor) line: 727 JarFileExportOperation.filesOnClasspath(IFile, IPath, IJavaProject, IPackageFragmentRoot, IProgressMonitor) line: 651 JarFileExportOperation.exportClassFiles(IProgressMonitor, IPackageFragmentRoot, IResource, IJavaProject, IPath) line: 470 JarFileExportOperation.exportElement(Object, IProgressMonitor) line: 345 JarFileExportOperation.exportJavaElement(IProgressMonitor, IJavaElement) line: 361 JarFileExportOperation.exportElement(Object, IProgressMonitor) line: 275 JarFileExportOperation.exportJavaElement(IProgressMonitor, IJavaElement) line: 361 JarFileExportOperation.exportElement(Object, IProgressMonitor) line: 275 JarFileExportOperation.exportSelectedElements(IProgressMonitor) line: 495 JarFileExportOperation.singleRun(IProgressMonitor) line: 905 JarFileExportOperation.execute(IProgressMonitor) line: 881 WorkspaceModifyOperation$1.run(IProgressMonitor) line: 100 Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) line: 1733 JarFileExportOperation(WorkspaceModifyOperation).run(IProgressMonitor) line: 112 ModalContext$ModalContextThread.run() line: 113
The problem comes from the fact that we accept such code: @interface A1 { E[] list(); } enum E { A, B, C, D; } @A1(list = new E[] { E.A, E.C }) public class X { public static void main(String[] args) { } } An member value pair that is an array type can only be an array initializer. It cannot be an array creation expression. Syntactically this is fine since the array creation expression is seen as a condition expression. javac reports: X.java:8: new not allowed in an annotation @A1(list = new E[] { E.A, E.C }) ^ 1 error
Philippe, I have a fix for it that is released in HEAD. Do you want to backport to 3.1.x? I would say yes since the resulting .class file is completely boggus. Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest.test188
Created attachment 34101 [details] Proposed patch
If backported, the new constant in IProblem needs to be internal since no new API can be added.
Verified for 3.2 M5 using build I20060215-0010
Is it possible to backport this fix to Eclipse 3.0.2?
3.0.2 doesn't contain a compiler that supports 1.5. So there is no need to backport to 3.0.2.
However we are getting the same JAR file exporting issue, when using SQLJ annotations in Java files. class file(s) on classpath not found or not accessible /Corebank/com/fnf/crb/accounting/batch/apdarentrycoderetroactv/DeleteEntryCode.java class file(s) on classpath not found or not accessible /Corebank/com/fnf/crb/accounting/batch/apdarentrycoderetroactv/ReadBookValue.java class file(s) on classpath not found or not accessible /Corebank/com/fnf/crb/accounting/batch/apdarownrshpprc2selsql/Ownership.java These .class files does exist in the Resource view. When testing on Eclipse 3.2 M6, the issue seems to be fixed.
Are you talking about 3.0.2 or 3.1.2?
Using IBM Rational Application Developer, should be build on top of Eclipse 3.0.2.
Then this is a different issue, because 3.0.2 code base is not aware of 1.5 features. The patch could not be applied to the 3.0.2 code base.
Do you recommend to create a bug for this issue?
Certainly with steps to reproduce.