Index: compiler/org/eclipse/jdt/internal/compiler/ClassFile.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java,v retrieving revision 1.108 diff -u -r1.108 ClassFile.java --- compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 20 May 2005 20:02:27 -0000 1.108 +++ compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 26 May 2005 20:39:19 -0000 @@ -1469,11 +1469,12 @@ */ public void addSyntheticMethodAccessMethod(SyntheticMethodBinding methodBinding) { generateMethodInfoHeader(methodBinding); - // We know that we won't get more than 2 attribute: the code attribute + synthetic attribute - contents[contentsOffset++] = 0; - contents[contentsOffset++] = 2; + int methodAttributeOffset = this.contentsOffset; + // this will add exception attribute, synthetic attribute, deprecated attribute,... + int attributeNumber = generateMethodInfoAttribute(methodBinding); // Code attribute int codeAttributeOffset = contentsOffset; + attributeNumber++; // add code attribute generateCodeAttributeHeader(); codeStream.init(this); codeStream.generateSyntheticBodyForMethodAccess(methodBinding); @@ -1485,16 +1486,9 @@ .referenceCompilationUnit() .compilationResult .lineSeparatorPositions); - // add the synthetic attribute - int syntheticAttributeNameIndex = - constantPool.literalIndex(AttributeNamesConstants.SyntheticName); - contents[contentsOffset++] = (byte) (syntheticAttributeNameIndex >> 8); - contents[contentsOffset++] = (byte) syntheticAttributeNameIndex; - // the length of a synthetic attribute is equals to 0 - contents[contentsOffset++] = 0; - contents[contentsOffset++] = 0; - contents[contentsOffset++] = 0; - contents[contentsOffset++] = 0; + // update the number of attributes + contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8); + contents[methodAttributeOffset] = (byte) attributeNumber; } /** Index: compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java,v retrieving revision 1.106 diff -u -r1.106 CodeStream.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 20 May 2005 20:02:27 -0000 1.106 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 26 May 2005 20:39:19 -0000 @@ -2134,6 +2134,9 @@ } } } + if (!accessBinding.returnType.isBaseType()) { + this.checkcast(accessBinding.returnType); + } if ((type = methodBinding.returnType).isBaseType()) if (type == VoidBinding) this.return_();