Author: akazakov
Date: 2012-02-22 19:14:00 -0500 (Wed, 22 Feb 2012)
New Revision: 39024
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/AddViewSupport.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/builder/ToggleSeamNatureAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/JavaStringHyperlinkDetector.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/scanner/JavaAnnotationScanner.java
Log:
Code cleanup
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -19,6 +19,7 @@
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.ScopeType;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.w3c.dom.Element;
/**
@@ -49,7 +50,7 @@
try {
this.scopeType = scope == null || scope.length() == 0 ? ScopeType.UNSPECIFIED :
ScopeType.valueOf(scope.toUpperCase());
} catch (IllegalArgumentException e) {
- //ignore
+ SeamCorePlugin.getDefault().logError(e);
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -310,12 +310,12 @@
try {
new FormatProcessorXML().formatFile((IFile) jbossAppXml);
} catch (IOException e) {
-
+ SeamCorePlugin.getDefault().logError(e);
} catch (CoreException e) {
-
+ SeamCorePlugin.getDefault().logError(e);
}
}
-
+
private void setValue(Document document, Node node, String value) {
Text text = document.createTextNode(value);
node.appendChild(text);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -34,6 +34,7 @@
import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.scanner.Util;
/**
@@ -174,7 +175,7 @@
try {
ts = current.type.getTypes();
} catch (JavaModelException e) {
- //ignore
+ SeamCorePlugin.getDefault().logError(e);
}
IType t = null;
if(ts != null) for (int i = 0; t == null && i < ts.length; i++) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -38,6 +38,7 @@
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.SeamComponentMethodType;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.BijectedAttribute;
import org.jboss.tools.seam.internal.core.DataModelSelectionAttribute;
import org.jboss.tools.seam.internal.core.Role;
@@ -366,7 +367,7 @@
try {
ms = type.getMethods();
} catch (JavaModelException e) {
- //ignore
+ SeamCorePlugin.getDefault().logError(e);
}
String name = m.getName().getIdentifier();
if(ms != null) for (int i = 0; i < ms.length; i++) {
@@ -396,7 +397,7 @@
try {
fs = type.getFields();
} catch (JavaModelException e1) {
- // ignore
+ SeamCorePlugin.getDefault().logError(e1);
}
String name = getFieldName(f);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -188,7 +188,7 @@
public void run() {
if(update()) {
- System.out.println("Running " + getId());
+// System.out.println("Running " + getId());
process();
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -178,15 +178,15 @@
process(ms[i], component, ds);
}
- IBinaryField[] fs = null;
- try {
- fs = cls.getFields();
- } catch (NoClassDefFoundError e) {
- //ignore
- }
- if(fs != null) for (int i = 0; i < fs.length; i++) {
- //TODO
- }
+// IBinaryField[] fs = null;
+// try {
+// fs = cls.getFields();
+// } catch (NoClassDefFoundError e) {
+// //ignore
+// }
+// if(fs != null) for (int i = 0; i < fs.length; i++) {
+// //TODO
+// }
}
private void process(IBinaryMethod m, SeamJavaComponentDeclaration component,
LoadedDeclarations ds) {
@@ -314,7 +314,7 @@
try {
ms = type.getMethods();
} catch (JavaModelException e) {
- //ignore
+ SeamCorePlugin.getDefault().logError(e);
}
if(ms != null) for (int i = 0; i < ms.length; i++) {
if(!ms[i].getElementName().equals(name)) continue;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/AddViewSupport.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/AddViewSupport.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/AddViewSupport.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -333,6 +333,7 @@
try {
ft.createNewFile();
} catch (IOException e) {
+ SeamPagesXMLPlugin.getDefault().logError(e);
}
if(templateString != null) {
FileUtil.writeFile(ft, templateString);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlink.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlink.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlink.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -152,7 +152,7 @@
} catch (PartInitException e) {
SeamExtPlugin.getPluginLog().logError(e);
} catch (JavaModelException e) {
- // Ignore. It is probably because of Java element is not found
+ SeamExtPlugin.getPluginLog().logError(e);
}
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/builder/ToggleSeamNatureAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/builder/ToggleSeamNatureAction.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/builder/ToggleSeamNatureAction.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -23,6 +23,7 @@
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
/**
* Class for toggling the Seam Nature.
@@ -108,6 +109,7 @@
description.setNatureIds(newNatures);
project.setDescription(description, null);
} catch (CoreException e) {
+ SeamGuiPlugin.getDefault().logError(e);
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -72,6 +72,7 @@
import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.common.java.IJavaSourceReference;
import org.jboss.tools.seam.core.IOpenableElement;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
/**
* Seam Search Result page
@@ -206,7 +207,7 @@
JavaUI.revealInEditor(part, (IJavaElement)javaElement);
}
} catch (JavaModelException e) {
- // Ignore. It is probably because of Java element is not found
+ SeamGuiPlugin.getDefault().logError(e);
}
} else if (match.getElement() instanceof IOpenableElement) {
((IOpenableElement)match.getElement()).open();
@@ -231,12 +232,11 @@
JavaUI.revealInEditor(part, (IJavaElement)javaElement);
}
} catch (JavaModelException e) {
- // Ignore. It is probably because of Java element is not found
+ SeamGuiPlugin.getDefault().logError(e);
}
-
}
}
-
+
private void showWithMarker(IEditorPart editor, IFile file, int offset, int length)
throws PartInitException {
IMarker marker= null;
try {
@@ -253,7 +253,7 @@
try {
marker.delete();
} catch (CoreException e) {
- // ignore
+ SeamGuiPlugin.getDefault().logError(e);
}
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -1091,6 +1091,7 @@
}
}
} catch (IndexOutOfBoundsException e) {
+ SeamGuiPlugin.getDefault().logError(e);
}
return false;
}
@@ -1228,7 +1229,6 @@
SearchPlugin.log(e);
} catch (CoreException e) {
SearchPlugin.log(e);
- } catch (StackOverflowError e) {
}
return false;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/JavaStringHyperlinkDetector.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/JavaStringHyperlinkDetector.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/JavaStringHyperlinkDetector.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -11,7 +11,6 @@
package org.jboss.tools.seam.ui.text.java;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -23,12 +22,7 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.MemberValuePair;
import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SimpleName;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
import org.eclipse.jdt.internal.ui.text.JavaWordFinder;
@@ -45,7 +39,6 @@
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamContextShortVariable;
import org.jboss.tools.seam.core.ISeamContextVariable;
-import org.jboss.tools.seam.core.ISeamFactory;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.BijectedAttribute;
@@ -177,7 +170,7 @@
try {
ms = type.getMethods();
} catch (JavaModelException e) {
- //ignore
+ SeamGuiPlugin.getDefault().logError(e);
}
String name = m.getName().getIdentifier();
if(ms != null) for (int i = 0; i < ms.length; i++) {
@@ -227,9 +220,9 @@
JavaUI.revealInEditor(part, (IJavaElement)fMember);
}
} catch (PartInitException e) {
-// SeamExtPlugin.getPluginLog().logError(e);
+ SeamGuiPlugin.getDefault().logError(e);
} catch (JavaModelException e) {
- // Ignore. It is probably because of Java element is not found
+ SeamGuiPlugin.getDefault().logError(e);
}
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/scanner/JavaAnnotationScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/scanner/JavaAnnotationScanner.java 2012-02-23
00:09:28 UTC (rev 39023)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/scanner/JavaAnnotationScanner.java 2012-02-23
00:14:00 UTC (rev 39024)
@@ -2,7 +2,6 @@
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -23,39 +22,23 @@
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.ASTRequestor;
-import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Block;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.MarkerAnnotation;
import org.eclipse.jdt.core.dom.MemberValuePair;
import org.eclipse.jdt.core.dom.MethodDeclaration;
-import org.eclipse.jdt.core.dom.Name;
import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.QualifiedName;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.seam.core.SeamCoreMessages;
-import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
-import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.ScannerException;
-import org.jboss.tools.seam.internal.core.scanner.Util;
import org.jboss.tools.seam.internal.core.scanner.java.ASTVisitorImpl;
import org.jboss.tools.seam.internal.core.scanner.java.AnnotatedASTNode;
-import org.jboss.tools.seam.internal.core.scanner.java.ComponentBuilder;
-import org.jboss.tools.seam.internal.core.scanner.java.JavaScanner;
import org.jboss.tools.seam.internal.core.scanner.java.ResolvedAnnotation;
-import org.jboss.tools.seam.internal.core.scanner.java.SeamAnnotations;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
public class JavaAnnotationScanner {
@@ -171,7 +154,7 @@
try {
ts = source.getTypes();
} catch (JavaModelException e) {
- //ignore
+ SeamGuiPlugin.getDefault().logError(e);
}
if(ts == null || ts.length == 0) return;
for (int i = 0; i < ts.length; i++) {
@@ -386,7 +369,7 @@
return (rs[0][0].length() == 0) ? rs[0][1] : rs[0][0] + "." + rs[0][1];
//$NON-NLS-1$
}
} catch (JavaModelException e) {
- // ignore
+ SeamGuiPlugin.getDefault().logError(e);
}
return n;