mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for PR 58481
This commit is contained in:
parent
ff65631c31
commit
3f68cfad81
4 changed files with 46 additions and 17 deletions
|
@ -1,3 +1,18 @@
|
|||
2004-04-15 Alain Magloire
|
||||
|
||||
Fix for PR 58481
|
||||
Since TypeInfo shares have some common code
|
||||
with the Search the fix was put in the search to.
|
||||
The fix is to check the accessibility of the project
|
||||
before introspecting it, it may have been deleted.
|
||||
|
||||
* browser/org/eclipse/cdt/internal/core/browser/cache/TypeMatchLocator.java
|
||||
* search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
|
||||
|
||||
Remove the synchronized it is not necessary and causes
|
||||
deadlocks.
|
||||
* model/org/eclipse/cdt/internal/core/model/Openable.java
|
||||
|
||||
2004-04-14 Alain Magloire
|
||||
|
||||
This is temporary 'till we get the fancy ICType scheme
|
||||
|
|
|
@ -432,16 +432,24 @@ public class TypeMatchLocator implements ISourceElementRequestor, ICSearchConsta
|
|||
workingCopy= (IWorkingCopy) workingCopyMap.get(path);
|
||||
if (workingCopy != null) {
|
||||
currentResource= workingCopy.getResource();
|
||||
if (currentResource != null && currentResource.isAccessible()) {
|
||||
reader= new CharArrayReader(workingCopy.getContents());
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
currentResource= workspaceRoot.findMember(path, true);
|
||||
if (currentResource != null && currentResource instanceof IFile) {
|
||||
if (currentResource != null) {
|
||||
if (currentResource.isAccessible() && currentResource instanceof IFile) {
|
||||
IFile file= (IFile) currentResource;
|
||||
try {
|
||||
reader= new InputStreamReader(file.getContents());
|
||||
} catch (CoreException ex) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -198,10 +198,8 @@ public abstract class Openable extends Parent implements IOpenable, IBufferChang
|
|||
* @see org.eclipse.cdt.core.model.IOpenable#isOpen()
|
||||
*/
|
||||
public boolean isOpen() {
|
||||
synchronized(CModelManager.getDefault()){
|
||||
return CModelManager.getDefault().getInfo(this) != null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this represents a source element.
|
||||
|
|
|
@ -397,19 +397,27 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
|||
IWorkingCopy workingCopy = (IWorkingCopy)wcPaths.get( pathString );
|
||||
|
||||
if( workingCopy != null ){
|
||||
reader = new CharArrayReader( workingCopy.getContents() );
|
||||
currentResource = workingCopy.getResource();
|
||||
if ( currentResource != null && currentResource.isAccessible() ) {
|
||||
reader = new CharArrayReader( workingCopy.getContents() );
|
||||
realPath = currentResource.getLocation();
|
||||
project = currentResource.getProject();
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
currentResource = workspaceRoot.findMember( pathString, true );
|
||||
|
||||
try{
|
||||
if( currentResource != null && currentResource instanceof IFile ){
|
||||
if( currentResource != null ){
|
||||
if (currentResource.isAccessible() && currentResource instanceof IFile) {
|
||||
IFile file = (IFile) currentResource;
|
||||
reader = new InputStreamReader( file.getContents() );
|
||||
realPath = currentResource.getLocation();
|
||||
project = file.getProject();
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} catch ( CoreException e ){
|
||||
continue;
|
||||
|
|
Loading…
Add table
Reference in a new issue