Author: scabanovich
Date: 2011-05-13 19:01:00 -0400 (Fri, 13 May 2011)
New Revision: 31310
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeansXMLDefinition.java
Log:
Removed unnecessary check for null.
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeansXMLDefinition.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeansXMLDefinition.java 2011-05-13
22:45:22 UTC (rev 31309)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/BeansXMLDefinition.java 2011-05-13
23:01:00 UTC (rev 31310)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl.definition;
import java.util.HashSet;
@@ -7,6 +17,11 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.text.INodeReference;
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
public class BeansXMLDefinition {
static String NODE_INTERCEPTORS = "Interceptors";
static String NODE_DECORATORS = "Decorators";
@@ -23,31 +38,34 @@
public BeansXMLDefinition() {}
public void setBeansXML(XModelObject beansXML) {
- if(beansXML == null ||
!beansXML.getModelEntity().getName().startsWith("FileCDIBeans")) return;
- XModelObject interceptorsObject = beansXML.getChildByPath(NODE_INTERCEPTORS);
- if(interceptorsObject != null) {
- XModelObject[] cs = interceptorsObject.getChildren();
- for (XModelObject o: cs) {
- interceptors.add(new XMLNodeReference(o, ATTR_CLASS));
+ if(beansXML.getModelEntity().getName().startsWith("FileCDIBeans")) {
+
+ XModelObject interceptorsObject = beansXML.getChildByPath(NODE_INTERCEPTORS);
+ if(interceptorsObject != null) {
+ XModelObject[] cs = interceptorsObject.getChildren();
+ for (XModelObject o: cs) {
+ interceptors.add(new XMLNodeReference(o, ATTR_CLASS));
+ }
}
- }
- XModelObject decoratorsObject = beansXML.getChildByPath(NODE_DECORATORS);
- if(decoratorsObject != null) {
- XModelObject[] cs = decoratorsObject.getChildren();
- for (XModelObject o: cs) {
- decorators.add(new XMLNodeReference(o, ATTR_CLASS));
+ XModelObject decoratorsObject = beansXML.getChildByPath(NODE_DECORATORS);
+ if(decoratorsObject != null) {
+ XModelObject[] cs = decoratorsObject.getChildren();
+ for (XModelObject o: cs) {
+ decorators.add(new XMLNodeReference(o, ATTR_CLASS));
+ }
}
- }
- XModelObject alternativesObject = beansXML.getChildByPath(NODE_ALTERNATIVES);
- if(alternativesObject != null) {
- XModelObject[] cs = alternativesObject.getChildren("CDIClass");
- for (XModelObject o: cs) {
- typeAlternatives.add(new XMLNodeReference(o, ATTR_CLASS));
+ XModelObject alternativesObject = beansXML.getChildByPath(NODE_ALTERNATIVES);
+ if(alternativesObject != null) {
+ XModelObject[] cs = alternativesObject.getChildren("CDIClass");
+ for (XModelObject o: cs) {
+ typeAlternatives.add(new XMLNodeReference(o, ATTR_CLASS));
+ }
+ cs = alternativesObject.getChildren("CDIStereotype");
+ for (XModelObject o: cs) {
+ stereotypeAlternatives.add(new XMLNodeReference(o, ATTR_STEREOTYPE));
+ }
}
- cs = alternativesObject.getChildren("CDIStereotype");
- for (XModelObject o: cs) {
- stereotypeAlternatives.add(new XMLNodeReference(o, ATTR_STEREOTYPE));
- }
+
}
}