Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 16021 Details for
Bug 79110
[1.5] Missing attribute for local and anonymous classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Apply on HEAD on ClassFile
patch_79110.txt (text/plain), 2.90 KB, created by
Olivier Thomann
on 2004-11-19 16:30:41 EST
(
hide
)
Description:
Apply on HEAD on ClassFile
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2004-11-19 16:30:41 EST
Size:
2.90 KB
patch
obsolete
>Index: ClassFile.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java,v >retrieving revision 1.79 >diff -u -r1.79 ClassFile.java >--- ClassFile.java 21 Oct 2004 13:34:44 -0000 1.79 >+++ ClassFile.java 19 Nov 2004 21:27:51 -0000 >@@ -20,6 +20,7 @@ > import org.eclipse.jdt.internal.compiler.codegen.*; > import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; > import org.eclipse.jdt.internal.compiler.impl.Constant; >+import org.eclipse.jdt.internal.compiler.impl.ReferenceContext; > import org.eclipse.jdt.internal.compiler.impl.StringConstant; > import org.eclipse.jdt.internal.compiler.lookup.*; > import org.eclipse.jdt.internal.compiler.problem.ProblemSeverities; >@@ -343,6 +344,44 @@ > contents[contentsOffset++] = (byte) (signatureIndex >> 8); > contents[contentsOffset++] = (byte) signatureIndex; > attributeNumber++; >+ } >+ if (targetJDK >= ClassFileConstants.JDK1_5 >+ && (this.referenceBinding.isAnonymousType() || this.referenceBinding.isLocalType())) { >+ // add enclosing method attribute (1.5 mode only) >+ if (contentsOffset + 10 >= contents.length) { >+ resizeContents(10); >+ } >+ int enclosingMethodAttributeNameIndex = >+ constantPool.literalIndex(AttributeNamesConstants.EnclosingMethodName); >+ contents[contentsOffset++] = (byte) (enclosingMethodAttributeNameIndex >> 8); >+ contents[contentsOffset++] = (byte) enclosingMethodAttributeNameIndex; >+ // the length of a signature attribute is equals to 2 >+ contents[contentsOffset++] = 0; >+ contents[contentsOffset++] = 0; >+ contents[contentsOffset++] = 0; >+ contents[contentsOffset++] = 4; >+ >+ int enclosingTypeIndex = constantPool.literalIndexForType(this.referenceBinding.enclosingType().constantPoolName()); >+ contents[contentsOffset++] = (byte) (enclosingTypeIndex >> 8); >+ contents[contentsOffset++] = (byte) enclosingTypeIndex; >+ byte methodIndexByte1 = 0; >+ byte methodIndexByte2 = 0; >+ if (this.referenceBinding.scope != null) { >+ MethodScope methodScope = this.referenceBinding.scope.methodScope(); >+ if (methodScope != null) { >+ ReferenceContext referenceContext = methodScope.referenceContext; >+ if (referenceContext instanceof AbstractMethodDeclaration) { >+ AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext; >+ MethodBinding methodBinding = methodDeclaration.binding; >+ int enclosingMethodIndex = constantPool.literalIndexForMethod(methodBinding.selector, methodBinding.signature()); >+ methodIndexByte1 = (byte) (enclosingMethodIndex >> 8); >+ methodIndexByte2 = (byte) enclosingMethodIndex; >+ } >+ } >+ } >+ contents[contentsOffset++] = methodIndexByte1; >+ contents[contentsOffset++] = methodIndexByte2; >+ attributeNumber++; > } > > // update the number of attributes
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 79110
: 16021