### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ClassFile.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java,v retrieving revision 1.195 diff -u -r1.195 ClassFile.java --- compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 18 Sep 2009 13:59:48 -0000 1.195 +++ compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 6 Jan 2010 17:50:36 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -191,6 +191,7 @@ AbstractMethodDeclaration methodDecl = methodDecls[i]; MethodBinding method = methodDecl.binding; if (method == null || method.isConstructor()) continue; + method.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract; classFile.addAbstractMethod(methodDecl, method); } } else { @@ -209,7 +210,6 @@ } // add abstract methods classFile.addDefaultAbstractMethods(); - //classFile.addSpecialMethods(); } // propagate generation of (problem) member types @@ -260,17 +260,14 @@ /** * INTERNAL USE-ONLY - * Generate the byte for a problem method info that correspond to a boggus method. + * Generate the byte for a problem method info that correspond to a bogus method. * * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding */ public void addAbstractMethod( - AbstractMethodDeclaration method, - MethodBinding methodBinding) { - - // force the modifiers to be public and abstract - methodBinding.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract; + AbstractMethodDeclaration method, + MethodBinding methodBinding) { this.generateMethodInfoHeader(methodBinding); int methodAttributeOffset = this.contentsOffset; Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java,v retrieving revision 1.51 diff -u -r1.51 CodeSnippetClassFile.java --- eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java 30 Jun 2009 14:19:58 -0000 1.51 +++ eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java 6 Jan 2010 17:50:36 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -140,6 +140,15 @@ ClassFile classFile = new CodeSnippetClassFile(typeBinding, null, true); // inner attributes + if (typeBinding.hasMemberTypes()) { + // see bug 180109 + ReferenceBinding[] members = typeBinding.memberTypes; + for (int i = 0, l = members.length; i < l; i++) + classFile.recordInnerClasses(members[i]); + } + // TODO (olivier) handle cases where a field cannot be generated (name too long) + // TODO (olivier) handle too many methods + // inner attributes if (typeBinding.isNestedType()) { classFile.recordInnerClasses(typeBinding); } @@ -180,6 +189,7 @@ AbstractMethodDeclaration methodDecl = methodDecls[i]; MethodBinding method = methodDecl.binding; if (method == null || method.isConstructor()) continue; + method.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccAbstract; classFile.addAbstractMethod(methodDecl, method); } } else { @@ -189,6 +199,8 @@ if (method == null) continue; if (method.isConstructor()) { classFile.addProblemConstructor(methodDecl, method, problemsCopy); + } else if (method.isAbstract()) { + classFile.addAbstractMethod(methodDecl, method); } else { classFile.addProblemMethod(methodDecl, method, problemsCopy); }