Author: adietish
Date: 2011-05-23 06:13:59 -0400 (Mon, 23 May 2011)
New Revision: 31428
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/utils/Assert.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/META-INF/MANIFEST.MF
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/unmarshal/HardwareProfileUnmarshaller.java
Log:
[JBIDE-8975] removed dependency to org.eclipse.core.runtime
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/META-INF/MANIFEST.MF
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/META-INF/MANIFEST.MF 2011-05-23
08:00:09 UTC (rev 31427)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/META-INF/MANIFEST.MF 2011-05-23
10:13:59 UTC (rev 31428)
@@ -5,7 +5,6 @@
Bundle-SymbolicName: org.jboss.tools.deltacloud.client
Bundle-Version: 0.2.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0"
Export-Package: org.jboss.tools.deltacloud.client,
org.jboss.tools.deltacloud.client.request;x-friends:="org.jboss.tools.deltacloud.client.test",
org.jboss.tools.deltacloud.client.transport,
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/unmarshal/HardwareProfileUnmarshaller.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/unmarshal/HardwareProfileUnmarshaller.java 2011-05-23
08:00:09 UTC (rev 31427)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/unmarshal/HardwareProfileUnmarshaller.java 2011-05-23
10:13:59 UTC (rev 31428)
@@ -22,10 +22,10 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.runtime.Assert;
import org.jboss.tools.deltacloud.client.HardwareProfile;
import org.jboss.tools.deltacloud.client.Property;
import org.jboss.tools.deltacloud.client.Property.Kind;
+import org.jboss.tools.deltacloud.client.utils.Assert;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -33,16 +33,19 @@
/**
* @author André Dietisheim
*/
-public class HardwareProfileUnmarshaller extends
AbstractDOMUnmarshaller<HardwareProfile> {
+public class HardwareProfileUnmarshaller extends
+ AbstractDOMUnmarshaller<HardwareProfile> {
public HardwareProfileUnmarshaller() {
super("hardware_profile", HardwareProfile.class);
}
@Override
- protected HardwareProfile doUnmarshall(Element element, HardwareProfile profile) throws
Exception {
+ protected HardwareProfile doUnmarshall(Element element,
+ HardwareProfile profile) throws Exception {
profile.setId(getAttributeText("id", element));
- profile.setProperties(createProperties(element.getElementsByTagName("property")));
+ profile.setProperties(createProperties(element
+ .getElementsByTagName("property")));
return profile;
}
@@ -79,14 +82,15 @@
private void setRange(Element propertyElement, Property property) {
Node node = propertyElement.getElementsByTagName("range").item(0);
- Assert.isLegal(node instanceof Element);
+ Assert.isTrue(node instanceof Element);
Element rangeElement = (Element) node;
- property.setRange(rangeElement.getAttribute("first"),
rangeElement.getAttribute("last"));
+ property.setRange(rangeElement.getAttribute("first"),
+ rangeElement.getAttribute("last"));
}
private void setEnum(Element propertyElement, Property property) {
Node node = propertyElement.getElementsByTagName("enum").item(0);
- Assert.isLegal(node instanceof Element);
+ Assert.isTrue(node instanceof Element);
Element enumElement = (Element) node;
NodeList nodeList = enumElement.getElementsByTagName("entry");
ArrayList<String> enumValues = new ArrayList<String>();
@@ -98,5 +102,5 @@
}
property.setEnums(enumValues);
}
-
+
}
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/utils/Assert.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/utils/Assert.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/utils/Assert.java 2011-05-23
10:13:59 UTC (rev 31428)
@@ -0,0 +1,41 @@
+/*************************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************************/
+
+package org.jboss.tools.deltacloud.client.utils;
+
+/**
+ * Various assertion utility methods.
+ *
+ * @author André Dietisheim
+ */
+public class Assert {
+
+ public static void isValidArgument(boolean assertionResult) {
+ if (!assertionResult) {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ public static void isTrue(boolean assertionResult) {
+ if (!assertionResult) {
+ throw new AssertionError();
+ }
+ }
+
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/utils/Assert.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain