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 61817 Details for
Bug 178861
Executing run() in a scrapbook page leads to a NPE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_178861.txt (text/plain), 1.73 KB, created by
Olivier Thomann
on 2007-03-23 09:22:06 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-03-23 09:22:06 EDT
Size:
1.73 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java,v >retrieving revision 1.31 >diff -u -r1.31 CodeSnippetThisReference.java >--- eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java 10 May 2006 18:03:48 -0000 1.31 >+++ eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java 23 Mar 2007 13:21:23 -0000 >@@ -89,15 +89,20 @@ > // implicit this > this.constant = Constant.NotAConstant; > TypeBinding snippetType = null; >- if (this.isImplicit || checkAccess(scope.methodScope())){ >- snippetType = scope.enclosingSourceType(); >+ MethodScope methodScope = scope.methodScope(); >+ if (!this.isImplicit && !checkAccess(methodScope)) { >+ return null; > } >- if (snippetType == null) return null; >+ snippetType = scope.enclosingSourceType(); > > this.delegateThis = scope.getField(snippetType, DELEGATE_THIS, this); >- if (this.delegateThis == null) return null; // internal error, field should have been found >- if (this.delegateThis.isValidBinding()) return this.resolvedType = this.delegateThis.type; >- return this.resolvedType = snippetType; >+ if (this.delegateThis == null || !this.delegateThis.isValidBinding()) { >+ // should not happen >+ // if this happen we should report illegal access to this in a static context >+ methodScope.problemReporter().errorThisSuperInStatic(this); >+ return null; >+ } >+ return this.resolvedType = this.delegateThis.type; > } > public void setActualReceiverType(ReferenceBinding receiverType) { > // ignored
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 178861
: 61817