am 34cf9d6e: (-s ours) Add wildcard support to stubpackages DO NOT MERGE
* commit '34cf9d6e3a6448578438e925384114177de3978a':
Add wildcard support to stubpackages DO NOT MERGE
diff --git a/build.gradle b/build.gradle
index 79d856e..382e10d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -14,7 +14,7 @@
String findToolsJar() {
new ByteArrayOutputStream().withStream { os ->
project.exec {
- executable "$rootDir/build/core/find-jdk-tools-jar.sh"
+ executable "../../build/core/find-jdk-tools-jar.sh"
standardOutput = os
}
@@ -22,9 +22,27 @@
}
}
-dependencies {
- compile files(findToolsJar())
- compile project(path: ':antlr', configuration: 'antlrRuntime')
- compile project(':jsilver')
- compile project(':tagsoup')
-}
\ No newline at end of file
+
+if (project.hasProperty("usePrebuilts") && project.usePrebuilts == "true") {
+ repositories {
+ maven { url '../../prebuilts/tools/common/m2/repository' }
+ }
+
+ dependencies {
+ compile files(findToolsJar())
+ compile files('../../prebuilts/misc/common/antlr/antlr-3.4-complete.jar')
+ compile 'com.google.jsilver:jsilver:1.0.0'
+ // TODO add tagsoup to prebuils to fully support building using prebuilts
+ compile project(':tagsoup')
+ // required by jsilver
+ compile 'com.google.guava:guava:15.0'
+ //compile project(path: ':junit', configuration: 'target')
+ }
+} else {
+ dependencies {
+ compile files(findToolsJar())
+ compile project(path: ':antlr', configuration: 'antlrRuntime')
+ compile project(':jsilver')
+ compile project(':tagsoup')
+ }
+}
diff --git a/src/com/google/doclava/ClassInfo.java b/src/com/google/doclava/ClassInfo.java
index a5ee7d4..8dde5c6 100644
--- a/src/com/google/doclava/ClassInfo.java
+++ b/src/com/google/doclava/ClassInfo.java
@@ -2092,9 +2092,12 @@
/*
* Similarly to the above, do not fail if this "new" method is really an override of an
* existing superclass method.
+ * But we should fail if this is overriding an abstract method, because method's
+ * abstractness affects how users use it. See also Stubs.methodIsOverride().
*/
MethodInfo mi = ClassInfo.overriddenMethod(mInfo, this);
- if (mi == null) {
+ if (mi == null ||
+ mi.isAbstract() != mInfo.isAbstract()) {
Errors.error(Errors.ADDED_METHOD, mInfo.position(), "Added public method "
+ mInfo.qualifiedName());
consistent = false;
diff --git a/src/com/google/doclava/Errors.java b/src/com/google/doclava/Errors.java
index 84df16b..156de66 100644
--- a/src/com/google/doclava/Errors.java
+++ b/src/com/google/doclava/Errors.java
@@ -172,6 +172,7 @@
public static final Error INVALID_CONTENT_TYPE = new Error(119, ERROR);
public static final Error INVALID_SAMPLE_INDEX = new Error(120, ERROR);
public static final Error HIDDEN_TYPE_PARAMETER = new Error(121, HIDDEN);
+ public static final Error PRIVATE_SUPERCLASS = new Error(122, ERROR);
public static final Error[] ERRORS =
{UNRESOLVED_LINK, BAD_INCLUDE_TAG, UNKNOWN_TAG, UNKNOWN_PARAM_TAG_NAME,
@@ -183,7 +184,7 @@
CHANGED_TRANSIENT, CHANGED_VOLATILE, CHANGED_TYPE, CHANGED_VALUE, CHANGED_SUPERCLASS,
CHANGED_SCOPE, CHANGED_ABSTRACT, CHANGED_THROWS, CHANGED_NATIVE, CHANGED_CLASS,
CHANGED_DEPRECATED, CHANGED_SYNCHRONIZED, ADDED_FINAL_UNINSTANTIABLE, REMOVED_FINAL,
- BROKEN_SINCE_FILE, INVALID_CONTENT_TYPE, HIDDEN_TYPE_PARAMETER};
+ BROKEN_SINCE_FILE, INVALID_CONTENT_TYPE, HIDDEN_TYPE_PARAMETER, PRIVATE_SUPERCLASS};
public static boolean setErrorLevel(int code, int level) {
for (Error e : ERRORS) {
diff --git a/src/com/google/doclava/Stubs.java b/src/com/google/doclava/Stubs.java
index 647c921..5ae1dd0 100644
--- a/src/com/google/doclava/Stubs.java
+++ b/src/com/google/doclava/Stubs.java
@@ -337,6 +337,10 @@
+ " stripped of unavailable superclass " + supr.qualifiedName());
} else {
cantStripThis(supr, notStrippable, "6:" + cl.realSuperclass().name() + cl.qualifiedName());
+ if (supr.isPrivate()) {
+ Errors.error(Errors.PRIVATE_SUPERCLASS, cl.position(), "Public class "
+ + cl.qualifiedName() + " extends private class " + supr.qualifiedName());
+ }
}
}
}