Lines 66-72
Link Here
|
66 |
import org.netbeans.modules.ruby.api.project.rake.RakeArtifactQuery; |
66 |
import org.netbeans.modules.ruby.api.project.rake.RakeArtifactQuery; |
67 |
import org.netbeans.api.queries.CollocationQuery; |
67 |
import org.netbeans.api.queries.CollocationQuery; |
68 |
import org.netbeans.modules.ruby.modules.project.rake.RakeBasedProjectFactorySingleton; |
68 |
import org.netbeans.modules.ruby.modules.project.rake.RakeBasedProjectFactorySingleton; |
69 |
import org.netbeans.modules.ruby.modules.project.rake.Util; |
|
|
70 |
import org.netbeans.spi.project.AuxiliaryConfiguration; |
69 |
import org.netbeans.spi.project.AuxiliaryConfiguration; |
71 |
import org.netbeans.spi.project.SubprojectProvider; |
70 |
import org.netbeans.spi.project.SubprojectProvider; |
72 |
import org.openide.ErrorManager; |
71 |
import org.openide.ErrorManager; |
Lines 546-552
Link Here
|
546 |
// Linear search; always keeping references sorted first by foreign project |
545 |
// Linear search; always keeping references sorted first by foreign project |
547 |
// name, then by target name. |
546 |
// name, then by target name. |
548 |
Element nextRefEl = null; |
547 |
Element nextRefEl = null; |
549 |
Iterator<Element> it = Util.findSubElements(references).iterator(); |
548 |
Iterator<Element> it = XMLUtil.findSubElements(references).iterator(); |
550 |
while (it.hasNext()) { |
549 |
while (it.hasNext()) { |
551 |
Element testRefEl = it.next(); |
550 |
Element testRefEl = it.next(); |
552 |
RawReference testRef = RawReference.create(testRefEl); |
551 |
RawReference testRef = RawReference.create(testRefEl); |
Lines 793-799
Link Here
|
793 |
|
792 |
|
794 |
private static boolean removeRawReferenceElement(String foreignProjectName, String id, Element references, boolean escaped) throws IllegalArgumentException { |
793 |
private static boolean removeRawReferenceElement(String foreignProjectName, String id, Element references, boolean escaped) throws IllegalArgumentException { |
795 |
// As with addRawReference, do a linear search through. |
794 |
// As with addRawReference, do a linear search through. |
796 |
for (Element testRefEl : Util.findSubElements(references)) { |
795 |
for (Element testRefEl : XMLUtil.findSubElements(references)) { |
797 |
RawReference testRef = RawReference.create(testRefEl); |
796 |
RawReference testRef = RawReference.create(testRefEl); |
798 |
String refID = testRef.getID(); |
797 |
String refID = testRef.getID(); |
799 |
String refName = testRef.getForeignProjectName(); |
798 |
String refName = testRef.getForeignProjectName(); |
Lines 846-852
Link Here
|
846 |
} |
845 |
} |
847 |
|
846 |
|
848 |
private static RawReference[] getRawReferences(Element references) throws IllegalArgumentException { |
847 |
private static RawReference[] getRawReferences(Element references) throws IllegalArgumentException { |
849 |
List<Element> subEls = Util.findSubElements(references); |
848 |
List<Element> subEls = XMLUtil.findSubElements(references); |
850 |
List<RawReference> refs = new ArrayList<RawReference>(subEls.size()); |
849 |
List<RawReference> refs = new ArrayList<RawReference>(subEls.size()); |
851 |
for (Element subEl : subEls) { |
850 |
for (Element subEl : subEls) { |
852 |
refs.add(RawReference.create(subEl)); |
851 |
refs.add(RawReference.create(subEl)); |
Lines 888-894
Link Here
|
888 |
} |
887 |
} |
889 |
|
888 |
|
890 |
private static RawReference getRawReference(String foreignProjectName, String id, Element references, boolean escaped) throws IllegalArgumentException { |
889 |
private static RawReference getRawReference(String foreignProjectName, String id, Element references, boolean escaped) throws IllegalArgumentException { |
891 |
for (Element subEl : Util.findSubElements(references)) { |
890 |
for (Element subEl : XMLUtil.findSubElements(references)) { |
892 |
RawReference ref = RawReference.create(subEl); |
891 |
RawReference ref = RawReference.create(subEl); |
893 |
String refID = ref.getID(); |
892 |
String refID = ref.getID(); |
894 |
String refName = ref.getForeignProjectName(); |
893 |
String refName = ref.getForeignProjectName(); |
Lines 1513-1519
Link Here
|
1513 |
if (idx == -1) { |
1512 |
if (idx == -1) { |
1514 |
throw new IllegalArgumentException("bad subelement name: " + elName); // NOI18N |
1513 |
throw new IllegalArgumentException("bad subelement name: " + elName); // NOI18N |
1515 |
} |
1514 |
} |
1516 |
String val = Util.findText(el); |
1515 |
String val = XMLUtil.findText(el); |
1517 |
if (val == null) { |
1516 |
if (val == null) { |
1518 |
throw new IllegalArgumentException("empty subelement: " + el); // NOI18N |
1517 |
throw new IllegalArgumentException("empty subelement: " + el); // NOI18N |
1519 |
} |
1518 |
} |
Lines 1531-1537
Link Here
|
1531 |
if (!REF_NAME.equals(xml.getLocalName()) || !REFS_NS2.equals(xml.getNamespaceURI())) { |
1530 |
if (!REF_NAME.equals(xml.getLocalName()) || !REFS_NS2.equals(xml.getNamespaceURI())) { |
1532 |
throw new IllegalArgumentException("bad element name: " + xml); // NOI18N |
1531 |
throw new IllegalArgumentException("bad element name: " + xml); // NOI18N |
1533 |
} |
1532 |
} |
1534 |
List nl = Util.findSubElements(xml); |
1533 |
List nl = XMLUtil.findSubElements(xml); |
1535 |
if (nl.size() < 6) { |
1534 |
if (nl.size() < 6) { |
1536 |
throw new IllegalArgumentException("missing or extra data: " + xml); // NOI18N |
1535 |
throw new IllegalArgumentException("missing or extra data: " + xml); // NOI18N |
1537 |
} |
1536 |
} |
Lines 1546-1552
Link Here
|
1546 |
if (idx == -1) { |
1545 |
if (idx == -1) { |
1547 |
throw new IllegalArgumentException("bad subelement name: " + elName); // NOI18N |
1546 |
throw new IllegalArgumentException("bad subelement name: " + elName); // NOI18N |
1548 |
} |
1547 |
} |
1549 |
String val = Util.findText(el); |
1548 |
String val = XMLUtil.findText(el); |
1550 |
if (val == null) { |
1549 |
if (val == null) { |
1551 |
throw new IllegalArgumentException("empty subelement: " + el); // NOI18N |
1550 |
throw new IllegalArgumentException("empty subelement: " + el); // NOI18N |
1552 |
} |
1551 |
} |
Lines 1564-1572
Link Here
|
1564 |
if (!"properties".equals(el.getLocalName())) { // NOI18N |
1563 |
if (!"properties".equals(el.getLocalName())) { // NOI18N |
1565 |
throw new IllegalArgumentException("bad subelement. expected 'properties': " + el); // NOI18N |
1564 |
throw new IllegalArgumentException("bad subelement. expected 'properties': " + el); // NOI18N |
1566 |
} |
1565 |
} |
1567 |
for (Element el2 : Util.findSubElements(el)) { |
1566 |
for (Element el2 : XMLUtil.findSubElements(el)) { |
1568 |
String key = el2.getAttribute("name"); |
1567 |
String key = el2.getAttribute("name"); |
1569 |
String value = Util.findText(el2); |
1568 |
String value = XMLUtil.findText(el2); |
1570 |
// #53553: NPE |
1569 |
// #53553: NPE |
1571 |
if (value == null) { |
1570 |
if (value == null) { |
1572 |
value = ""; // NOI18N |
1571 |
value = ""; // NOI18N |