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 171562 Details for
Bug 316327
[model] JavaElement.newNotPresentException exceptions caused by use of IJavaScriptProject#findType
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix Patch - Update 1
316327_NotPresentException.txt (text/plain), 4.34 KB, created by
Ian Tewksbury
on 2010-06-09 14:15:19 EDT
(
hide
)
Description:
Fix Patch - Update 1
Filename:
MIME Type:
Creator:
Ian Tewksbury
Created:
2010-06-09 14:15:19 EDT
Size:
4.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.jsdt.ui >Index: src/org/eclipse/wst/jsdt/internal/ui/text/java/MethodProposalInfo.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/MethodProposalInfo.java,v >retrieving revision 1.10 >diff -u -r1.10 MethodProposalInfo.java >--- src/org/eclipse/wst/jsdt/internal/ui/text/java/MethodProposalInfo.java 6 Oct 2009 01:34:39 -0000 1.10 >+++ src/org/eclipse/wst/jsdt/internal/ui/text/java/MethodProposalInfo.java 9 Jun 2010 18:14:48 -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 >@@ -57,27 +57,35 @@ > */ > protected IMember resolveMember() throws JavaScriptModelException { > char[] declarationSignature= fProposal.getDeclarationSignature(); >- >+ IFunction func = null; > if (declarationSignature!=null) { > String typeName = SignatureUtil.stripSignatureToFQN(String > .valueOf(declarationSignature)); > String name = String.valueOf(fProposal.getName()); > String[] parameters = Signature.getParameterTypes(String > .valueOf(fProposal.getSignature())); >- IType type = fJavaProject.findType(typeName); >- if (type != null) { >- boolean isConstructor = fProposal.isConstructor(); >- >- return findMethod(name, parameters, isConstructor, type); >- } >- else >- { >+ //search all the possible types until a match is found >+ IType[] types = fJavaProject.findTypes(typeName); >+ if(types != null && types.length >0) { >+ for(int i = 0; i < types.length && func != null; ++i) { >+ IType type = types[i]; >+ if (type != null) { >+ boolean isConstructor = fProposal.isConstructor(); >+ try { >+ func = findMethod(name, parameters, isConstructor, type); >+ } catch(JavaScriptModelException e) { >+ //ignore, could not find method >+ } >+ } >+ } >+ } else { > ITypeRoot typeRoot=fJavaProject.findTypeRoot(typeName); >- if(typeRoot != null) >- return typeRoot.getFunction(name, parameters); >+ if(typeRoot != null) { >+ func = typeRoot.getFunction(name, parameters); >+ } > } > } >- return null; >+ return func; > } > > /* adapted from JavaModelUtil */ >Index: src/org/eclipse/wst/jsdt/internal/ui/text/java/FieldProposalInfo.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jsdt/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/java/FieldProposalInfo.java,v >retrieving revision 1.5 >diff -u -r1.5 FieldProposalInfo.java >--- src/org/eclipse/wst/jsdt/internal/ui/text/java/FieldProposalInfo.java 14 May 2008 15:43:49 -0000 1.5 >+++ src/org/eclipse/wst/jsdt/internal/ui/text/java/FieldProposalInfo.java 9 Jun 2010 18:14:47 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 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 >@@ -50,14 +50,19 @@ > if (declarationSignature == null) > return null; > String typeName= SignatureUtil.stripSignatureToFQN(String.valueOf(declarationSignature)); >- IType type= fJavaProject.findType(typeName); >- if (type != null) { >- String name= String.valueOf(fProposal.getName()); >- IField field= type.getField(name); >- if (field.exists()) >- return field; >+ IType[] types = this.fJavaProject.findTypes(typeName); >+ if(types != null && types.length > 0) { >+ for(int i = 0; i < types.length; ++i) { >+ IType type = types[i]; >+ if (type != null) { >+ String name= String.valueOf(fProposal.getName()); >+ IField field= type.getField(name); >+ if (field.exists()) >+ return field; >+ } >+ } > } >- >+ > return null; > } > }
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 316327
:
171541
| 171562