Skip to content

Commit 6e4cb40

Browse files
committed
Move attribute inheritance until all libraries are loaded
1 parent 37d248d commit 6e4cb40

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
<classpathentry kind="lib" path="lib/org.eclipse.core.commands_3.6.100.v20140528-1422.jar"/>
1212
<classpathentry kind="lib" path="lib/org.eclipse.core.runtime-3.10.0-v20140318-2214.jar"/>
1313
<classpathentry kind="lib" path="lib/org.eclipse.equinox.common-3.6.200.v20130402-1505.jar"/>
14-
<classpathentry kind="lib" path="lib/org.eclipse.jface_3.10.2.v20141021-1035.jar"/>
1514
<classpathentry kind="lib" path="lib/org.eclipse.jgit-4.4.1.201607150455-r.jar"/>
1615
<classpathentry kind="lib" path="lib/jgit/jsch-0.1.54.jar"/>
1716
<classpathentry kind="lib" path="lib/jgit/log4j-1.2-api-2.6.2.jar"/>
1817
<classpathentry kind="lib" path="lib/jgit/log4j-api-2.6.2.jar"/>
1918
<classpathentry kind="lib" path="lib/jgit/log4j-core-2.6.2.jar"/>
2019
<classpathentry kind="lib" path="lib/jgit/slf4j-api-1.7.21.jar"/>
2120
<classpathentry kind="lib" path="lib/jgit/slf4j-log4j12-1.7.21.jar"/>
21+
<classpathentry kind="lib" path="lib/org.eclipse.jface_3.12.0.v20160518-1929.jar"/>
2222
<classpathentry kind="output" path="bin"/>
2323
</classpath>

src/com/ibm/ServerWizard2/model/SystemModel.java

+20-14
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,27 @@ public void loadLibrary(String path) throws Exception {
225225
this.loadTargetTypes(file.getPath());
226226
}
227227
}
228-
}
228+
}
229+
//Add inherited attributes
230+
//must load twice so inherited attributes pick up their
231+
//inherited attributes
232+
for (int i=0;i<2;i++) {
233+
for (Map.Entry<String, Target> entry : targetModels.entrySet()) {
234+
Target target = entry.getValue();
235+
236+
// add inherited attributes
237+
addParentAttributes(target, target);
238+
if (target.getAttribute("CLASS").equals("BUS")) {
239+
busTypesTree.put(entry.getKey(),target);
240+
}
241+
}
242+
}
243+
busTypes.removeAllElements();
244+
for (Target t : busTypesTree.values()) {
245+
busTypes.add(t);
246+
}
229247
}
248+
230249
File partsDir = new File(path+File.separator+"parts"+File.separator);
231250
File filesList[] = partsDir.listFiles();
232251
if (filesList == null) {
@@ -614,19 +633,6 @@ public void loadTargetTypes(String fileName) throws SAXException,
614633
}
615634
}
616635
}
617-
for (Map.Entry<String, Target> entry : targetModels.entrySet()) {
618-
Target target = entry.getValue();
619-
620-
// add inherited attributes
621-
addParentAttributes(target, target);
622-
if (target.getAttribute("CLASS").equals("BUS")) {
623-
busTypesTree.put(entry.getKey(),target);
624-
}
625-
}
626-
busTypes.removeAllElements();
627-
for (Target t : busTypesTree.values()) {
628-
busTypes.add(t);
629-
}
630636
}
631637

632638
public void loadAttributes(String fileName) throws SAXException,

src/com/ibm/ServerWizard2/model/Target.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,14 @@ public void initBusses(Vector<Target> v) {
336336
////////////////////////////////////////////////////
337337
// XML file handling
338338
public void readModelXML(Element target, HashMap<String, Attribute> attrMap) {
339-
type = SystemModel.getElement(target, "id");
340-
parent = SystemModel.getElement(target, "parent");
339+
String tmptype = SystemModel.getElement(target, "id");
340+
String tmpparent = SystemModel.getElement(target, "parent");
341+
if (!tmptype.isEmpty()) {
342+
type = tmptype;
343+
}
344+
if (!tmpparent.isEmpty()) {
345+
parent = tmpparent;
346+
}
341347
NodeList parentList = target.getElementsByTagName("parent_type");
342348
for (int i = 0; i < parentList.getLength(); i++) {
343349
Element e = (Element) parentList.item(i);

0 commit comments

Comments
 (0)