Author: dazarov
Date: 2011-04-11 19:36:13 -0400 (Mon, 11 Apr 2011)
New Revision: 30502
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java
Log:
https://issues.jboss.org/browse/JBIDE-8627
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java 2011-04-11
23:32:02 UTC (rev 30501)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MakeBeanScopedDependentMarkerResolution.java 2011-04-11
23:36:13 UTC (rev 30502)
@@ -58,6 +58,8 @@
@Override
public void run(IMarker marker) {
IAnnotation originalAnnotation = getScopeAnnotation();
+ if(originalAnnotation == null)
+ return;
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
ICompilationUnit compilationUnit = original.getWorkingCopy(new
NullProgressMonitor());
@@ -79,13 +81,15 @@
// delete import
String qualifiedName = getFullyQualifiedName();
- IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
- IImportContainer importContainer = compilationUnit.getImportContainer();
- if(importDeclaration != null && importContainer != null){
- int importSize =
importContainer.getSourceRange().getOffset()+importContainer.getSourceRange().getLength();
- String text = buffer.getText(importSize, buffer.getLength()-importSize);
- if(checkImport(text, originalAnnotation.getElementName()))
- importDeclaration.delete(false, new NullProgressMonitor());
+ if(qualifiedName != null){
+ IImportDeclaration importDeclaration = compilationUnit.getImport(qualifiedName);
+ IImportContainer importContainer = compilationUnit.getImportContainer();
+ if(importDeclaration != null && importContainer != null){
+ int importSize =
importContainer.getSourceRange().getOffset()+importContainer.getSourceRange().getLength();
+ String text = buffer.getText(importSize, buffer.getLength()-importSize);
+ if(checkImport(text, originalAnnotation.getElementName()))
+ importDeclaration.delete(false, new NullProgressMonitor());
+ }
}
}