Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-04-05 23:21:29 +0000
committerJay Arthanareeswaran2017-05-02 11:08:28 +0000
commit1a3674899faf0fdfaeb7e3e48c4a52390e904b91 (patch)
tree178bdb7e8f34c62aa4e0f0162a0039784310394b
parente0297b61a25828ff1beec6db6a20e5f991ff84d5 (diff)
downloadeclipse.jdt.core-I20170505-2000.tar.gz
eclipse.jdt.core-I20170505-2000.tar.xz
eclipse.jdt.core-I20170505-2000.zip
NO_EXTRA_ATTRIBUTES Change-Id: I2454c540511004f8f24203c488592a5adbff0497 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java4
2 files changed, 10 insertions, 10 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
index ad45148cc1..db6d24bba3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
@@ -4691,10 +4691,10 @@ public final class JavaCore extends Plugin {
} else if (containerPath.segmentCount() < 1) {
throw new ClasspathEntry.AssertionFailedException("Illegal classpath container path: \'" + containerPath.makeRelative().toString() + "\', must have at least one segment (containerID+hints)"); //$NON-NLS-1$//$NON-NLS-2$
}
- if (accessRules == null) {
+ if (accessRules == null || accessRules.length == 0) {
accessRules = ClasspathEntry.NO_ACCESS_RULES;
}
- if (extraAttributes == null) {
+ if (extraAttributes == null || extraAttributes.length == 0) {
extraAttributes = ClasspathEntry.NO_EXTRA_ATTRIBUTES;
}
return new ClasspathEntry(
@@ -4890,10 +4890,10 @@ public final class JavaCore extends Plugin {
boolean isExported) {
if (path == null) throw new ClasspathEntry.AssertionFailedException("Library path cannot be null"); //$NON-NLS-1$
- if (accessRules == null) {
+ if (accessRules == null || accessRules.length==0) {
accessRules = ClasspathEntry.NO_ACCESS_RULES;
}
- if (extraAttributes == null) {
+ if (extraAttributes == null || extraAttributes.length==0) {
extraAttributes = ClasspathEntry.NO_EXTRA_ATTRIBUTES;
}
boolean hasDotDot = ClasspathEntry.hasDotDot(path);
@@ -5021,10 +5021,10 @@ public final class JavaCore extends Plugin {
boolean isExported) {
if (!path.isAbsolute()) throw new ClasspathEntry.AssertionFailedException("Path for IClasspathEntry must be absolute"); //$NON-NLS-1$
- if (accessRules == null) {
+ if (accessRules == null || accessRules.length == 0) {
accessRules = ClasspathEntry.NO_ACCESS_RULES;
}
- if (extraAttributes == null) {
+ if (extraAttributes == null || extraAttributes.length == 0) {
extraAttributes = ClasspathEntry.NO_EXTRA_ATTRIBUTES;
}
return new ClasspathEntry(
@@ -5385,10 +5385,10 @@ public final class JavaCore extends Plugin {
if (variablePath.segmentCount() < 1) {
throw new ClasspathEntry.AssertionFailedException("Illegal classpath variable path: \'" + variablePath.makeRelative().toString() + "\', must have at least one segment"); //$NON-NLS-1$//$NON-NLS-2$
}
- if (accessRules == null) {
+ if (accessRules == null || accessRules.length == 0) {
accessRules = ClasspathEntry.NO_ACCESS_RULES;
}
- if (extraAttributes == null) {
+ if (extraAttributes == null || extraAttributes.length == 0) {
extraAttributes = ClasspathEntry.NO_EXTRA_ATTRIBUTES;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
index 537095b68c..c69d88fb8f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -323,7 +323,7 @@ public class ClasspathEntry implements IClasspathEntry {
// }
this.combineAccessRules = combineAccessRules;
- this.extraAttributes = extraAttributes;
+ this.extraAttributes = extraAttributes.length > 0 ? extraAttributes : NO_EXTRA_ATTRIBUTES;
if (inclusionPatterns != INCLUDE_ALL && inclusionPatterns.length > 0) {
this.fullInclusionPatternChars = UNINIT_PATTERNS;

Back to the top