### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.builder Index: src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java,v retrieving revision 1.7 diff -u -r1.7 ParticipantBuildTests.java --- src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java 17 Jan 2006 19:09:50 -0000 1.7 +++ src/org/eclipse/jdt/core/tests/builder/ParticipantBuildTests.java 18 Jan 2006 01:18:04 -0000 @@ -11,11 +11,23 @@ package org.eclipse.jdt.core.tests.builder; import java.io.*; +import java.util.ArrayList; +import java.util.List; + import junit.framework.*; import org.eclipse.core.runtime.*; import org.eclipse.core.resources.*; import org.eclipse.jdt.core.compiler.*; +import org.eclipse.jdt.core.dom.AST; +import org.eclipse.jdt.core.dom.ASTParser; +import org.eclipse.jdt.core.dom.AbstractTypeDeclaration; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.IMethodBinding; +import org.eclipse.jdt.core.dom.ITypeBinding; +import org.eclipse.jdt.core.dom.IVariableBinding; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.tests.util.Util; @@ -75,6 +87,158 @@ fullBuild(projectPath); expectingNoProblems(); } + + public void testDefaultValue() throws JavaModelException { + IPath projectPath = env.addProject("Project", "1.5"); //$NON-NLS-1$ //$NON-NLS-2$ + env.addExternalJars(projectPath, Util.getJavaClassLibs()); + env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ + IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ + env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ + + String codeEntryPoint = "package test;\n" + + "public class EntryPoint {\n" + + " ClassWithNestedAnnotation nestedAnno;\n}"; + + env.addClass(root, "test", "EntryPoint", codeEntryPoint); + + String codeClassWithNestedAnnotation = + "package test; \n" + + "public class ClassWithNestedAnnotation {\n" + + " public final int FOUR = 4; \n " + + " public @interface NestedAnnotation{\n" + + " public enum Character{ \n" + + " Winnie, Tiger, Piglet, Eore; \n" + + " }\n"+ + " Character value() default Character.Eore; \n" + + " }\n" + + "}"; + + env.addClass(root, "test", "ClassWithNestedAnnotation", codeClassWithNestedAnnotation); + + // install compilationParticipant + new BuildTestParticipant() { + public boolean isAnnotationProcessor() { + return true; + } + public void processAnnotations(ICompilationParticipantResult[] files) { + final class ParticipantProblem extends CategorizedProblem implements IProblem { + + int counter = 0; + final String message; + final int id; + final char[] filename; + ParticipantProblem(String message, String filename){ + this.message = message; + id = counter ++; + this.filename = filename.toCharArray(); + } + public String[] getArguments() { return new String[0];} + public int getID() {return id; } + public String getMessage() { return message; } + public char[] getOriginatingFileName() { return filename; } + public int getSourceStart() { return 0; } + public int getSourceEnd() { return 0; } + public int getSourceLineNumber() { return 1; } + public boolean isError() { return true; } + public boolean isWarning() { return false; } + public void setSourceEnd(int sourceEnd) {/* not needed */} + public void setSourceLineNumber(int lineNumber) {/* not needed */} + public void setSourceStart(int sourceStart) {/* not needed */} + public int getCategoryID() { return 0; } + public String getMarkerType() { return "Test_Marker"; } + } + + final int total = files.length; + for( int i=0; i