Author: scabanovich
Date: 2012-01-06 14:16:09 -0500 (Fri, 06 Jan 2012)
New Revision: 37686
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddSetterMarkerResolution.java
Log:
JBIDE-10601
https://issues.joss.org/browse/JBIDE-10601
Method EclipseUtil.getCompilationUnit(IFile) should return existing Java element or null.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java 2012-01-06
18:03:03 UTC (rev 37685)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java 2012-01-06
19:16:09 UTC (rev 37686)
@@ -56,6 +56,9 @@
protected void deleteAnnotation(){
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
+ if(original == null) {
+ return;
+ }
ICompilationUnit compilationUnit = original.getWorkingCopy(new
NullProgressMonitor());
IJavaElement javaElement = compilationUnit.getElementAt(start);
@@ -120,6 +123,9 @@
protected void addAnnotation(String annotationString, boolean insertName){
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
+ if(original == null) {
+ return;
+ }
ICompilationUnit compilationUnit = original.getWorkingCopy(new
NullProgressMonitor());
IJavaElement javaElement = compilationUnit.getElementAt(start);
@@ -153,6 +159,9 @@
protected void addAnnotatedMethod(){
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
+ if(original == null) {
+ return;
+ }
ICompilationUnit compilationUnit = original.getWorkingCopy(new
NullProgressMonitor());
final String lineDelim= compilationUnit.findRecommendedLineSeparator();
@@ -192,6 +201,9 @@
protected void renameAnnotation(String param, String importName, boolean generate){
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
+ if(original == null) {
+ return;
+ }
ICompilationUnit compilationUnit = original.getWorkingCopy(new
NullProgressMonitor());
IJavaElement javaElement = compilationUnit.getElementAt(start);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddSetterMarkerResolution.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddSetterMarkerResolution.java 2012-01-06
18:03:03 UTC (rev 37685)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddSetterMarkerResolution.java 2012-01-06
19:16:09 UTC (rev 37686)
@@ -57,6 +57,9 @@
IFile file = (IFile)javaDeclaration.getResource();
try{
ICompilationUnit original = EclipseUtil.getCompilationUnit(file);
+ if(original == null) {
+ return;
+ }
ICompilationUnit compilationUnit = original.getWorkingCopy(new
NullProgressMonitor());
String lineDelim= JavaPropertyGenerator.getLineDelimiterUsed(compilationUnit);