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 53405 Details for
Bug 163600
[compiler] Internal references to static inner classes fail in presence of assert keyword
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_163600.txt (text/plain), 5.21 KB, created by
Olivier Thomann
on 2006-11-07 14:40:44 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2006-11-07 14:40:44 EST
Size:
5.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java,v >retrieving revision 1.52 >diff -u -r1.52 AssertStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java 15 Sep 2006 02:30:32 -0000 1.52 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java 7 Nov 2006 19:42:45 -0000 >@@ -176,7 +176,7 @@ > // need assertion flag: $assertionsDisabled on outer most source clas > // (in case of static member of interface, will use the outermost static member - bug 22334) > SourceTypeBinding outerMostClass = currentScope.enclosingSourceType(); >- while (outerMostClass.isLocalType()){ >+ while (outerMostClass.isLocalType()) { > ReferenceBinding enclosing = outerMostClass.enclosingType(); > if (enclosing == null || enclosing.isInterface()) break; > outerMostClass = (SourceTypeBinding) enclosing; >Index: compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java,v >retrieving revision 1.46 >diff -u -r1.46 Clinit.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java 15 Sep 2006 03:10:13 -0000 1.46 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Clinit.java 7 Nov 2006 19:42:45 -0000 >@@ -10,12 +10,24 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >-import org.eclipse.jdt.internal.compiler.*; >-import org.eclipse.jdt.internal.compiler.codegen.*; >-import org.eclipse.jdt.internal.compiler.flow.*; >-import org.eclipse.jdt.internal.compiler.lookup.*; >-import org.eclipse.jdt.internal.compiler.parser.*; >-import org.eclipse.jdt.internal.compiler.problem.*; >+import org.eclipse.jdt.internal.compiler.ASTVisitor; >+import org.eclipse.jdt.internal.compiler.ClassFile; >+import org.eclipse.jdt.internal.compiler.CompilationResult; >+import org.eclipse.jdt.internal.compiler.codegen.BranchLabel; >+import org.eclipse.jdt.internal.compiler.codegen.CodeStream; >+import org.eclipse.jdt.internal.compiler.codegen.ConstantPool; >+import org.eclipse.jdt.internal.compiler.flow.ExceptionHandlingFlowContext; >+import org.eclipse.jdt.internal.compiler.flow.FlowInfo; >+import org.eclipse.jdt.internal.compiler.flow.InitializationFlowContext; >+import org.eclipse.jdt.internal.compiler.lookup.Binding; >+import org.eclipse.jdt.internal.compiler.lookup.BlockScope; >+import org.eclipse.jdt.internal.compiler.lookup.ClassScope; >+import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; >+import org.eclipse.jdt.internal.compiler.lookup.MethodScope; >+import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; >+import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; >+import org.eclipse.jdt.internal.compiler.parser.Parser; >+import org.eclipse.jdt.internal.compiler.problem.AbortMethod; > > public class Clinit extends AbstractMethodDeclaration { > >@@ -313,9 +325,11 @@ > // we need to add the field right now, because the field infos are generated before the methods > if (needClassLiteralField) { > SourceTypeBinding sourceType = >- this.scope.outerMostMethodScope().enclosingSourceType(); >- this.classLiteralSyntheticField = >- sourceType.addSyntheticFieldForClassLiteral(sourceType, scope); >+ this.scope.outerMostClassScope().enclosingSourceType(); >+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=22334 >+ if (!sourceType.isInterface() && !sourceType.isBaseType()) { >+ this.classLiteralSyntheticField = sourceType.addSyntheticFieldForClassLiteral(sourceType, scope); >+ } > } > } > >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java,v >retrieving revision 1.43 >diff -u -r1.43 ClassLiteralAccess.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java 28 Oct 2006 04:11:27 -0000 1.43 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java 7 Nov 2006 19:42:45 -0000 >@@ -36,11 +36,10 @@ > FlowInfo flowInfo) { > > // if reachable, request the addition of a synthetic field for caching the class descriptor >- SourceTypeBinding sourceType = >- currentScope.outerMostMethodScope().enclosingSourceType(); >- if ((!(sourceType.isInterface() >- // no field generated in interface case (would'nt verify) see 1FHHEZL >- || sourceType.isBaseType())) >+ SourceTypeBinding sourceType = currentScope.outerMostClassScope().enclosingSourceType(); >+ // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=22334 >+ if (!sourceType.isInterface() >+ && !sourceType.isBaseType() > && currentScope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_5) { > syntheticField = sourceType.addSyntheticFieldForClassLiteral(targetType, currentScope); > }
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 163600
:
53334
|
53385
| 53405 |
53523
|
53524