mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
eclipse: don't add combineaccessrules if attribute was not present in the classpath (IDEA-151755)
This commit is contained in:
+11
-3
@@ -108,8 +108,12 @@ public class EclipseClasspathWriter {
|
||||
}
|
||||
}
|
||||
else if (entry instanceof ModuleOrderEntry) {
|
||||
Element orderEntry = addOrderEntry(EclipseXml.SRC_KIND, '/' + ((ModuleOrderEntry)entry).getModuleName(), classpathRoot);
|
||||
setAttributeIfAbsent(orderEntry, EclipseXml.COMBINEACCESSRULES_ATTR, EclipseXml.FALSE_VALUE);
|
||||
final String path = '/' + ((ModuleOrderEntry)entry).getModuleName();
|
||||
final Element oldElement = getOldElement(EclipseXml.SRC_KIND, path);
|
||||
Element orderEntry = addOrderEntry(EclipseXml.SRC_KIND, path, classpathRoot);
|
||||
if (oldElement == null) {
|
||||
setAttributeIfAbsent(orderEntry, EclipseXml.COMBINEACCESSRULES_ATTR, EclipseXml.FALSE_VALUE);
|
||||
}
|
||||
setExported(orderEntry, ((ExportableOrderEntry)entry));
|
||||
}
|
||||
else if (entry instanceof LibraryOrderEntry) {
|
||||
@@ -246,7 +250,7 @@ public class EclipseClasspathWriter {
|
||||
}
|
||||
|
||||
private Element addOrderEntry(@NotNull String kind, String path, Element classpathRoot, int index) {
|
||||
Element element = myOldEntries.get(kind + getJREKey(path));
|
||||
Element element = getOldElement(kind, path);
|
||||
if (element != null) {
|
||||
Element clonedElement = element.clone();
|
||||
if (index == -1 || index >= classpathRoot.getContentSize()) {
|
||||
@@ -272,6 +276,10 @@ public class EclipseClasspathWriter {
|
||||
return orderEntry;
|
||||
}
|
||||
|
||||
private Element getOldElement(@NotNull String kind, String path) {
|
||||
return myOldEntries.get(kind + getJREKey(path));
|
||||
}
|
||||
|
||||
private static String getJREKey(String path) {
|
||||
return path.startsWith(EclipseXml.JRE_CONTAINER) ? EclipseXml.JRE_CONTAINER : path;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<classpathentry kind="src" path=""/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/frst"/>
|
||||
<classpathentry kind="src" path="/frst2"/>
|
||||
<classpathentry kind="lib" path="/ws-internals/lib/jar-all-4.zip" sourcepath="jar-all-4-src.zip">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="jar:platform:/resource/scnd/jar-all-4-javadoc.zip!/doc/api"/>
|
||||
|
||||
Reference in New Issue
Block a user