Community
Participate
Working Groups
Tested in version: 3.1M5 I get an error with the message: An internal error occurred during: "Requesting Java AST from selection". There does not seem to be a way to get more information. This error keeps showing up anytime I make any action (including moving around) inside the java source editor. Unfortunately I have to dump a rather large source file in here; it seems that removing just about anything else from this dump causes the error to no longer happen. To 'activate' the bug, remove the // before the linke 'private transient'. -----------source file to reproduce the bug: package org.eden.swt; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipFile; public class Skin { private String fSkinLocation; private boolean fSkinLocationIsZip; //private transient //remove the first doubleslash on this line and the error happends. private Skin() { //intentionally left blank } public static Skin makeSkin(String pSkinLocation) throws IOException { Skin lNew = new Skin(); File lFile; lNew.fSkinLocation = pSkinLocation; lFile = new File(lNew.fSkinLocation); if ( !lFile.exists() ) { throw new FileNotFoundException( "Skin '" + pSkinLocation + "' not found."); } lNew.fSkinLocationIsZip = !lFile.isDirectory(); return lNew; } public static void setTempDirectory(String pTemp) { sTempDirectory = pTemp; } private InputStream getResource(String pResourceName) throws IOException { if ( fSkinLocationIsZip ) { return getResourceFromZip(pResourceName); } else { return getResourceFromDir(pResourceName); } } private InputStream getResourceFromZip(String pResourceName) throws IOException { ZipFile lZipFile; lZipFile = new ZipFile(fSkinLocation); } } ----------------- in case it's neccessary: properties of the project: Builders: Just the usual java builder, nothing else. build path: SWT (the jar from org.eclipse.swt.win32_3.1.0, java 1.5.1 system library. java compiler: JDK compliance levels: 5.0 default settings. If need be I can list the entire java compiler settings (all 50+ of em). Assuming for now that isn't it.
Created attachment 18757 [details] The test case (also found in the first comment).
Created attachment 18758 [details] My eclipse settings (project uses 'default' settings). These are the settings of my eclipse. The project uses all 'default' settings. As the settings, especially 'Java, Compiler' have marked effects on at least the outlook of the editor (what's a warning, what's an error, etcetera), this may be useful for trying to reproduce the bug.
AccTransient is the same value than AccVarArgs. A method cannot be transient. We should not preserve the AccTransient modifier. The illegal modifier for method is properly handled, but the code blows up when we try to generate the method. java.lang.ArrayIndexOutOfBoundsException: -1 at org.eclipse.jdt.internal.compiler.ast.Statement.generateArguments(Statement.java:59) at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.generateCode(AllocationExpression.java:115) at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.generateCode(LocalDeclaration.java:106) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:218) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:165) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:562) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:616) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:182) at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:516) at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:335) at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:2388) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1112) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1009) at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1001) at org.eclipse.jdt.core.tools.compiler.Compile.main(Compile.java:19)
Created attachment 18761 [details] Test case ready to compile
Added Varargs test027 to detect for collision case.
Verified in 20050330-0500