Author: rob.stryker(a)jboss.com
Date: 2007-10-18 01:19:22 -0400 (Thu, 18 Oct 2007)
New Revision: 4316
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/Activator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/AdaptorFactoryProviderForServiceXML.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLCorrectionAssistantProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLEditorConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLOutlineConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServicexmlModelHandler.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/wizards/NewMBeanWizard.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/util/PackageTypeSearcher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/util/ServiceXMLEditorUtil.java
Log:
JBIDE-1048 (Exception cleanup)
Also added headers and author tags
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/Activator.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/Activator.java 2007-10-18
05:11:04 UTC (rev 4315)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/Activator.java 2007-10-18
05:19:22 UTC (rev 4316)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.ui.mbeans;
import org.eclipse.ui.plugin.AbstractUIPlugin;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/AdaptorFactoryProviderForServiceXML.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/AdaptorFactoryProviderForServiceXML.java 2007-10-18
05:11:04 UTC (rev 4315)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/AdaptorFactoryProviderForServiceXML.java 2007-10-18
05:19:22 UTC (rev 4316)
@@ -24,6 +24,11 @@
import org.eclipse.wst.sse.core.internal.ltk.modelhandler.IDocumentTypeHandler;
import org.eclipse.wst.xml.ui.internal.registry.AdapterFactoryProviderForXML;
+/**
+ *
+ * @author Rob Stryker <rob.stryker(a)redhat.com>
+ *
+ */
public class AdaptorFactoryProviderForServiceXML extends
AdapterFactoryProviderForXML {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLCorrectionAssistantProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLCorrectionAssistantProvider.java 2007-10-18
05:11:04 UTC (rev 4315)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLCorrectionAssistantProvider.java 2007-10-18
05:19:22 UTC (rev 4316)
@@ -58,6 +58,11 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+/**
+ *
+ * @author Rob Stryker <rob.stryker(a)redhat.com>
+ *
+ */
public class ServiceXMLCorrectionAssistantProvider extends CorrectionAssistantProviderXML
{
public static IServiceXMLQuickFixProposalProvider[] providers;
@@ -70,7 +75,7 @@
try {
list.add((IServiceXMLQuickFixProposalProvider)cf[i].createExecutableExtension("class"));
} catch( CoreException ce ) {
- ce.printStackTrace();
+ // don't even log
}
}
providers = (IServiceXMLQuickFixProposalProvider[])
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLEditorConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLEditorConfiguration.java 2007-10-18
05:11:04 UTC (rev 4315)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLEditorConfiguration.java 2007-10-18
05:19:22 UTC (rev 4316)
@@ -72,6 +72,11 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+/**
+ *
+ * @author Rob Stryker <rob.stryker(a)redhat.com>
+ *
+ */
public class ServiceXMLEditorConfiguration extends
StructuredTextViewerConfigurationXML {
@@ -95,13 +100,13 @@
public class ServiceXMLContentAssistProcessor extends XMLContentAssistProcessor {
- private HashMap children;
- private HashMap attributes;
+ private HashMap<String, ArrayList<ChildOccurances>> children;
+ private HashMap<String, List> attributes;
public ServiceXMLContentAssistProcessor() {
super();
- children = new HashMap();
- attributes = new HashMap();
+ children = new HashMap<String, ArrayList<ChildOccurances>>();
+ attributes = new HashMap<String, List>();
fillChildren();
fillAttributes();
}
@@ -153,22 +158,22 @@
}
private void fillChildren() {
- ArrayList list = new ArrayList();
+ ArrayList<ChildOccurances> list = new ArrayList<ChildOccurances>();
list.add(new ChildOccurances("loader-repository",
ChildOccurances.ZERO_OR_ONE));
list.add(new ChildOccurances("local-directory",
ChildOccurances.ZERO_TO_INFINITY));
list.add(new ChildOccurances("classpath",
ChildOccurances.ZERO_TO_INFINITY));
list.add(new ChildOccurances("mbean", ChildOccurances.ZERO_TO_INFINITY));
children.put("server", list);
- list = new ArrayList();
+ list = new ArrayList<ChildOccurances>();
list.add(new ChildOccurances("loader-repository-config",
ChildOccurances.ZERO_TO_INFINITY));
children.put("loader-repository", list);
- children.put("loader-repository-config", new ArrayList());
- children.put("local-directory", new ArrayList());
- children.put("classpath", new ArrayList());
+ children.put("loader-repository-config", new
ArrayList<ChildOccurances>());
+ children.put("local-directory", new ArrayList<ChildOccurances>());
+ children.put("classpath", new ArrayList<ChildOccurances>());
- list = new ArrayList();
+ list = new ArrayList<ChildOccurances>();
list.add(new ChildOccurances("constructor", ChildOccurances.ZERO_OR_ONE));
list.add(new ChildOccurances("xmbean", ChildOccurances.ZERO_OR_ONE));
list.add(new ChildOccurances("attribute",
ChildOccurances.ZERO_TO_INFINITY));
@@ -176,25 +181,25 @@
list.add(new ChildOccurances("depends-list",
ChildOccurances.ZERO_TO_INFINITY));
children.put("mbean", list);
- children.put("xmbean", new ArrayList());
+ children.put("xmbean", new ArrayList<ChildOccurances>());
- list = new ArrayList();
+ list = new ArrayList<ChildOccurances>();
list.add(new ChildOccurances("arg", ChildOccurances.ZERO_TO_INFINITY));
children.put("constructor", list);
- children.put("arg", new ArrayList());
- children.put("attribute", new ArrayList());
- children.put("property", new ArrayList());
+ children.put("arg", new ArrayList<ChildOccurances>());
+ children.put("attribute", new ArrayList<ChildOccurances>());
+ children.put("property", new ArrayList<ChildOccurances>());
- list = new ArrayList();
+ list = new ArrayList<ChildOccurances>();
list.add(new ChildOccurances("mbean", ChildOccurances.ZERO_TO_INFINITY));
children.put("depends", list);
- list = new ArrayList();
+ list = new ArrayList<ChildOccurances>();
list.add(new ChildOccurances("depends-list-element",
ChildOccurances.ONE_TO_INFINITY));
children.put("depends-list", list);
- list = new ArrayList();
+ list = new ArrayList<ChildOccurances>();
list.add(new ChildOccurances("mbean", ChildOccurances.ZERO_TO_INFINITY));
children.put("depends-list-element", list);
@@ -355,7 +360,7 @@
String thisNode = contentAssistRequest.getNode().getNodeName();
if( thisNode.equals("#text")) thisNode = "";
- ArrayList possibleNodes = (ArrayList)children.get(parentElement);
+ ArrayList possibleNodes = children.get(parentElement);
ChildOccurances occ;
for( int i = 0; i < possibleNodes.size(); i++ ) {
occ = (ChildOccurances)possibleNodes.get(i);
@@ -370,13 +375,13 @@
super.addTagInsertionProposals(contentAssistRequest, childPosition);
List superProps = contentAssistRequest.getProposals();
ICompletionProposal[] proposals = (ICompletionProposal[]) superProps.toArray(new
ICompletionProposal[superProps.size()]);
- ArrayList alreadyAddedStrings = new ArrayList();
+ ArrayList<String> alreadyAddedStrings = new ArrayList<String>();
for( int i = 0; i < proposals.length; i++ ) {
alreadyAddedStrings.add(proposals[i].getDisplayString());
}
String parentElement = contentAssistRequest.getParent().getNodeName();
- ArrayList possibleNodes = (ArrayList)children.get(parentElement);
+ ArrayList possibleNodes = children.get(parentElement);
if( possibleNodes == null ) return;
@@ -423,7 +428,7 @@
if( attributes.containsKey(occ.name) ) {
- List l = (List)attributes.get(occ.name);
+ List l = attributes.get(occ.name);
Iterator i = l.iterator();
cursorLoc = -1;
String attributes = "";
@@ -462,7 +467,7 @@
super.addAttributeNameProposals(contentAssistRequest);
List superProps = contentAssistRequest.getProposals();
ICompletionProposal[] proposals = (ICompletionProposal[]) superProps.toArray(new
ICompletionProposal[superProps.size()]);
- ArrayList alreadyAddedStrings = new ArrayList();
+ ArrayList<String> alreadyAddedStrings = new ArrayList<String>();
for( int i = 0; i < proposals.length; i++ ) {
alreadyAddedStrings.add(proposals[i].getDisplayString());
}
@@ -470,7 +475,7 @@
Image attImage =
XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
- ArrayList activeAttributes = new ArrayList();
+ ArrayList<String> activeAttributes = new ArrayList<String>();
NamedNodeMap nnl = contentAssistRequest.getNode().getAttributes();
for( int i = 0; i < nnl.getLength(); i++ ) {
activeAttributes.add(nnl.item(i).getNodeName());
@@ -479,7 +484,7 @@
String elementName = contentAssistRequest.getNode().getNodeName();
String match = contentAssistRequest.getMatchString();
- List list = (List)attributes.get(elementName);
+ List list = attributes.get(elementName);
Iterator i = list.iterator();
while(i.hasNext()) {
DTDAttributes att = (DTDAttributes)i.next();
@@ -545,7 +550,7 @@
}
}
} catch( JavaModelException jme ) {
-
+ // do nothing
}
return false;
}
@@ -645,7 +650,7 @@
getHyperlinkRegion(attr)) };
}
} catch( Exception ce ) {
- ce.printStackTrace();
+ // do nothing
}
}
return null;
@@ -678,18 +683,15 @@
}
} catch (JavaModelException e) {
// ignore...TODO?
- e.printStackTrace();
} catch (PartInitException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
}
}
}
protected class LocalSearchRequestor extends SearchRequestor {
- private ArrayList list;
+ private ArrayList<Object> list;
public LocalSearchRequestor() {
- list = new ArrayList();
+ list = new ArrayList<Object>();
}
public void acceptSearchMatch(SearchMatch match) throws CoreException {
list.add(match.getElement());
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLOutlineConfiguration.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLOutlineConfiguration.java 2007-10-18
05:11:04 UTC (rev 4315)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServiceXMLOutlineConfiguration.java 2007-10-18
05:19:22 UTC (rev 4316)
@@ -49,6 +49,11 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+/**
+ *
+ * @author Rob Stryker <rob.stryker(a)redhat.com>
+ *
+ */
public class ServiceXMLOutlineConfiguration extends
XMLContentOutlineConfiguration {
@@ -99,7 +104,6 @@
try {
return delegate.getText(element);
} catch( Exception e ) {
- e.printStackTrace();
return null;
}
}
@@ -191,7 +195,6 @@
try {
list.add(new OutlineMenuProvider(cf[i]));
} catch( CoreException ce ) {
- ce.printStackTrace();
}
}
menuProviders = (OutlineMenuProvider[]) list.toArray(new
OutlineMenuProvider[list.size()]);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServicexmlModelHandler.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServicexmlModelHandler.java 2007-10-18
05:11:04 UTC (rev 4315)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/editors/ServicexmlModelHandler.java 2007-10-18
05:19:22 UTC (rev 4316)
@@ -29,7 +29,11 @@
import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentCharsetDetector;
import org.eclipse.wst.xml.core.internal.encoding.XMLDocumentLoader;
import org.eclipse.wst.xml.core.internal.modelhandler.XMLModelLoader;
-
+/**
+ *
+ * @author Rob Stryker <rob.stryker(a)redhat.com>
+ *
+ */
public class ServicexmlModelHandler extends AbstractModelHandler implements
IModelHandler{
final static String CONTENTTYPE_ID =
"org.jboss.ide.eclipse.as.ui.mbeans.servicexml"; //$NON-NLS-1$
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/wizards/NewMBeanWizard.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/wizards/NewMBeanWizard.java 2007-10-18
05:11:04 UTC (rev 4315)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/mbeans/wizards/NewMBeanWizard.java 2007-10-18
05:19:22 UTC (rev 4316)
@@ -1,3 +1,24 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.jboss.ide.eclipse.as.ui.mbeans.wizards;
import java.io.ByteArrayInputStream;
@@ -66,6 +87,11 @@
import org.eclipse.wst.xml.ui.internal.wizards.NewModelWizard;
import org.jboss.ide.eclipse.as.ui.mbeans.Messages;
+/**
+ *
+ * @author Rob Stryker <rob.stryker(a)redhat.com>
+ *
+ */
public class NewMBeanWizard extends NewModelWizard implements INewWizard {
private IStructuredSelection sel;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/util/PackageTypeSearcher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/util/PackageTypeSearcher.java 2007-10-18
05:11:04 UTC (rev 4315)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/util/PackageTypeSearcher.java 2007-10-18
05:19:22 UTC (rev 4316)
@@ -44,6 +44,11 @@
import org.eclipse.jface.text.contentassist.CompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+/**
+ *
+ * @author Rob Stryker <rob.stryker(a)redhat.com>
+ *
+ */
public class PackageTypeSearcher {
private String packageName;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/util/ServiceXMLEditorUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/util/ServiceXMLEditorUtil.java 2007-10-18
05:11:04 UTC (rev 4315)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/src/org/jboss/ide/eclipse/as/ui/util/ServiceXMLEditorUtil.java 2007-10-18
05:19:22 UTC (rev 4316)
@@ -29,6 +29,11 @@
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.ide.eclipse.as.ui.util.PackageTypeSearcher.ResultFilter;
+/**
+ *
+ * @author Rob Stryker <rob.stryker(a)redhat.com>
+ *
+ */
public class ServiceXMLEditorUtil {
public static IType findType(String codeClass ) {
final String codeClass2 = codeClass;