The old uses of getCanonicalName() blithely assumed that the symlink-resolved
name was, in fact, still the same as the unresolved name. Oops.
Also tweaked use of List.toArray by giving it an correctly-sized argument
(avoiding the need to allocate a zero-size array, and then the real one), and to
remove the superfluous <copy> in ant.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@6320 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/build.xml b/build.xml
index bad7399..ae82d7e 100755
--- a/build.xml
+++ b/build.xml
@@ -171,10 +171,6 @@
<target name="apicheck-nobuild"
description="[action] Checks API compatibility to prior GWT revision">
- <copy tofile="${gwt.build.out}/userApi.conf" filtering="false"
- file="${gwt.apicheck.config}"
- overwrite="true">
- </copy>
<java failonerror="true" fork="true"
classname="com.google.gwt.tools.apichecker.ApiCompatibilityChecker">
<jvmarg line="-Xmx512m" />
@@ -188,7 +184,7 @@
<arg value="-refJar"/>
<arg path="${gwt.root}/tools/api-checker/reference/gwt-dev-modified.jar:${gwt.root}/tools/api-checker/reference/gwt-user-modified.jar"/>
<arg value="-configFile"/>
- <arg file="${gwt.build.out}/userApi.conf"/>
+ <arg file="${gwt.apicheck.config}"/>
<arg value="-logLevel"/>
<arg value="ERROR"/>
</java>
diff --git a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
index d1cc813..5d926f1 100644
--- a/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
+++ b/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java
@@ -1,12 +1,12 @@
/*
* Copyright 2008 Google Inc.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -53,8 +53,8 @@
/**
* {@link ApiCompatibilityChecker} Main class to check if the new API is
* compatible with the existing API.
- *
- *
+ *
+ *
* <p>
* To compute API diffs, follow these 2 steps:
* <ol>
@@ -62,14 +62,14 @@
* <li>call getApiDiff on the {@code ApiDiffGenerator}
* </ol>
* </p>
- *
+ *
* <p>
* An {@code ApiContainer} object is a list of {@link ApiPackage} objects.
* {@code ApiPackage} objects themselves are list of {@link ApiClass} objects.
* {@code ApiClass} objects contain list of {@code ApiConstructor}, {@code
* ApiMethod}, and {@code JField} objects.
* </p>
- *
+ *
* <p>
* Each {@code ApiDiffGenerator} object computes the list of intersecting and
* missing {@link ApiPackageDiffGenerator} objects. Each {@code
@@ -80,12 +80,12 @@
* for constructors, {@link ApiMethod} for methods, and {@link ApiField} for
* fields.
* </p>
- *
+ *
* <p>
* For each intersecting API member, a list of {@link ApiChange} objects is
* stored. Each ApiChange object encodes a specific {@code ApiChange} like
* adding the 'final' keyword to the API member.
- *
+ *
*/
public class ApiCompatibilityChecker extends ToolBase {
@@ -212,7 +212,7 @@
// initialize the ant scanner
excludeScanner = new ZipScanner();
List<String> list = new ArrayList<String>(excludedPaths);
- excludeScanner.setIncludes(list.toArray(new String[0]));
+ excludeScanner.setIncludes(list.toArray(new String[list.size()]));
excludeScanner.addDefaultExcludes();
excludeScanner.setCaseSensitive(true);
excludeScanner.init();
@@ -284,10 +284,12 @@
private boolean isIncluded(String fileName) {
if (excludeScanner.match(fileName)) {
+ logger.log(TreeLogger.SPAM, fileName + " is excluded");
return false;
}
for (String includedPath : includedPaths) {
if (fileName.startsWith(includedPath)) {
+ logger.log(TreeLogger.SPAM, fileName + " is not excluded, and is included by " + includedPath);
return true;
}
}
@@ -319,9 +321,9 @@
String fullExcludedPaths[] = new String[excludedPathsAsString.size()];
int count = 0;
- String dirRootCanonicalPath = getFileFromName("dirRoot: ", dirRoot).getCanonicalPath();
+ String dirRootAbsolutePath = getFileFromName("dirRoot: ", dirRoot).getAbsolutePath();
for (String excludedPath : excludedPathsAsString) {
- fullExcludedPaths[count++] = dirRootCanonicalPath + "/" + excludedPath;
+ fullExcludedPaths[count++] = dirRootAbsolutePath + "/" + excludedPath;
}
// initialize the ant scanner
@@ -372,7 +374,7 @@
if (file.getName().startsWith(".") || file.getName().equals("CVS")) {
continue;
}
- if (isExcludedFile(file.getCanonicalPath())) {
+ if (isExcludedFile(file.getAbsolutePath())) {
// do not process the subtree
logger.log(TreeLogger.DEBUG,
"not traversing " + file.toURI().toURL(), null);
@@ -904,7 +906,7 @@
* "java.util.ArrayList::size() MISSING". The {@code ApiElement} is
* represented as the string obtained by invoking the getRelativeSignature()
* method on {@link ApiElement}.
- *
+ *
*/
private Set<String> readWhiteListFromFile(FileReader fr) throws IOException {
Set<String> hashSet = new HashSet<String>();