Remove trailing whitespace throughout project
This commit is contained in:
parent
74b8f16aa2
commit
bd6140a8cc
1753 changed files with 24077 additions and 24077 deletions
|
@ -11,7 +11,7 @@ The list of JARs should be created by running the jarlist target of the build fi
|
|||
That will use JarJar to create a list of JAR file that are not directly referenced
|
||||
by the classes in the build. But what about JARs that are needed by a call using
|
||||
reflection? Like Class.forName("this.that.theOther"). We know this is how the MySQL
|
||||
driver is loaded (so we need mysql-connector-java-5.1.16-bin.jar). Are there any
|
||||
driver is loaded (so we need mysql-connector-java-5.1.16-bin.jar). Are there any
|
||||
others? This script will try to find them.
|
||||
|
||||
The jarlist target includes a list of JARs that we know are needed, such as the MySQL
|
||||
|
@ -20,7 +20,7 @@ list, and the target run again, in case they depend on other JARs in turn.
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
One of the tricks that this script uses is to prune the list of packages to
|
||||
One of the tricks that this script uses is to prune the list of packages to
|
||||
search for. If a JAR contains both "this.that.other" and "this.that", then we
|
||||
only need to search for "this.that", since it will reveal uses of "this.that.other"
|
||||
as well.
|
||||
|
@ -28,24 +28,24 @@ as well.
|
|||
--------------------------------------------------------------------------------
|
||||
|
||||
pass the name of the file that contains the JAR names
|
||||
pass the root directory of the combined vitro/vivo distro
|
||||
pass the root directory of the combined vitro/vivo distro
|
||||
(appbase)
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Search all of the *.java, *.jsp, *.js, *.tld, *.xml files for mention of these package names
|
||||
For each hit, print the file path, line number, the package name and the JAR name.
|
||||
|
||||
|
||||
To search files:
|
||||
find -X . -name \*.db -or -name \*pot | xargs grep 'org\.package\.name'
|
||||
grep -H -n -f file_with_package_patterns
|
||||
|
||||
|
||||
or can we do this all with grep on each string?
|
||||
grep -r --include=*.jsp
|
||||
|
||||
|
||||
grep -H -n -r --include=*.javaxd --include=*.jsp org\.package\.name .
|
||||
and precede the output with a header that lists the package
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
=end
|
||||
|
@ -121,7 +121,7 @@ def print_package_names_for_jars
|
|||
package_array.each do |package_name|
|
||||
puts " #{package_name}"
|
||||
end
|
||||
puts
|
||||
puts
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -172,9 +172,9 @@ if File.expand_path($0) == File.expand_path(__FILE__)
|
|||
if ARGV.length != 2
|
||||
raise("usage is: ruby jarUsageScanner.rb <jar_names_file> <scan_base_directory>")
|
||||
end
|
||||
|
||||
|
||||
@jar_names_file, @scan_base_directory = ARGV
|
||||
|
||||
|
||||
if !File.file?(@jar_names_file)
|
||||
raise "File does not exist: '#{@jar_names_file}'."
|
||||
end
|
||||
|
@ -184,9 +184,9 @@ if File.expand_path($0) == File.expand_path(__FILE__)
|
|||
end
|
||||
|
||||
print_args
|
||||
|
||||
|
||||
figure_package_names_from_jars
|
||||
print_package_names_for_jars
|
||||
|
||||
|
||||
show_packages_in_source_files
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* This class is created to work around a known bug in JarJar which did not get fixed in release 1.1.
|
||||
* See the comments in edu.cornell.mannlib.vitro.utilities.jarlist.JarLister
|
||||
*/
|
||||
|
|
|
@ -38,34 +38,34 @@ import org.xml.sax.SAXException;
|
|||
/**
|
||||
* Look at web.xml, and check for conditions that violate the Servlet 2.4 spec,
|
||||
* but that might not be noticed because Tomcat doesn't complain.
|
||||
*
|
||||
*
|
||||
* ------
|
||||
*
|
||||
*
|
||||
* Values of the <dispatcher/> tag:
|
||||
*
|
||||
*
|
||||
* The spec permits only these values: "FORWARD", "REQUEST", "INCLUDE", "ERROR",
|
||||
* but Tomcat also allows the lower-case equivalents. GlassFish or WebLogic will
|
||||
* barf on lower-case.
|
||||
*
|
||||
*
|
||||
* Check to see that only the upper-case values are used.
|
||||
*
|
||||
*
|
||||
* ------
|
||||
*
|
||||
*
|
||||
* Existence of Servlet classes:
|
||||
*
|
||||
*
|
||||
* The spec allows the container to either load all servlets at startup, or to
|
||||
* load them when requested. Since Tomcat only loads servlet when requested, it
|
||||
* doesn't notice or complain if web.xml cites a <servlet-class/> that doesn't
|
||||
* exist, as long as it is never invoked. On the other hand, WebLogic loads all
|
||||
* serlvets at startup, and will barf if the class is not found.
|
||||
*
|
||||
*
|
||||
* Check each <servlet-class/> to insure that the class can be loaded and
|
||||
* instantiated and assigned to HttpServlet.
|
||||
*
|
||||
*
|
||||
* ------
|
||||
*
|
||||
*
|
||||
* Embedded URIs in taglibs.
|
||||
*
|
||||
*
|
||||
* I can't find this definitively in the JSP spec, but some containers complain
|
||||
* if web.xml specifies a <taglib-uri/> that conflicts with the <uri/> embedded
|
||||
* in the taglib itself. As far as I can see in the spec, the embedded <uri/>
|
||||
|
@ -73,51 +73,51 @@ import org.xml.sax.SAXException;
|
|||
* "Implicit Map Entries From TLDs", which in turn is only relevant for TLDs
|
||||
* packaged in JAR files. So, I can't find support for this complaint, but it
|
||||
* seems a reasonable one.
|
||||
*
|
||||
*
|
||||
* Check each <taglib/> specified in web.xml. If the taglib has an embedded
|
||||
* <uri/> tag, it should match the <taglib-uri/> from web.xml.
|
||||
*
|
||||
*
|
||||
* ------
|
||||
*
|
||||
*
|
||||
* Existence of Listener and Filter classes.
|
||||
*
|
||||
*
|
||||
* As far as I can tell, there is no ambiguity here, and every container will
|
||||
* complain if any of the <listener-class/> or <filter-class/> entries are
|
||||
* unsuitable. I check them anyway, since the mechanism was already assembled
|
||||
* for checking <servlet-class/> entries.
|
||||
*
|
||||
*
|
||||
* Check each <listener-class/> to insure that the class can be loaded and
|
||||
* instantiated and assigned to ServletContextListener.
|
||||
*
|
||||
*
|
||||
* Check each <filter-class/> to insure that the class can be loaded and
|
||||
* instantiated and assigned to Filter.
|
||||
*
|
||||
*
|
||||
* ------
|
||||
*
|
||||
*
|
||||
* A <servlet/> tag for every <servlet-mapping/> tag
|
||||
*
|
||||
*
|
||||
* I can't find a mention of this in the spec, but Tomcat complains and refuses
|
||||
* to load the app if there is a <servlet-mapping/> tag whose <servlet-name/> is
|
||||
* not matched by a <servlet-name/> in a <servlet/> tag.
|
||||
*
|
||||
*
|
||||
* Get sets of all <servlet-name/> tags that are specified in <servlet/> and
|
||||
* <servlet-mapping/> tags. There should not be any names in the
|
||||
* servlet-mappings that are not in the servlets.
|
||||
*
|
||||
*
|
||||
* ---------------------------------------------------------------------
|
||||
*
|
||||
*
|
||||
* Although this class is executed as a JUnit test, it doesn't have the usual
|
||||
* structure for a unit test.
|
||||
*
|
||||
*
|
||||
* In order to produce the most diagnostic information, the test does not abort
|
||||
* on the first failure. Rather, failure messages are accumulated until all
|
||||
* checks have been performed, and the test list all such messages on failure.
|
||||
*
|
||||
*
|
||||
* ---------------------------------------------------------------------
|
||||
*
|
||||
*
|
||||
* Since this is not executed as part of the standard Vitro unit tests, it also
|
||||
* cannot use the standard logging mechanism. Log4J has not been initialized.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class CheckContainerNeutrality {
|
||||
private static final String PROPERTY_WEBAPP_DIR = "CheckContainerNeutrality.webapp.dir";
|
||||
|
|
|
@ -24,23 +24,23 @@ import com.tonicsystems.jarjar.KlugedDepFind;
|
|||
|
||||
/**
|
||||
* This takes the place of the JarJar main routine, in doing a Find operation.
|
||||
*
|
||||
*
|
||||
* One thing this lets us do is to call KlugedDepFind instead of DepFind.
|
||||
* KlugedDepFind was created because JarJar had a known bug that wasn't fixed in
|
||||
* the latest release. (see http://code.google.com/p/jarjar/issues/detail?id=6).
|
||||
* I had to put KlugedDepFind into the com.tonicsystems.jarjar package so it
|
||||
* wauld have access to DepFindVisitor, which is package-private.
|
||||
*
|
||||
*
|
||||
* The other thing we can do is to provide a custom DepHandler which records the
|
||||
* dependencies directly instead of writing them to a file which we would need
|
||||
* to parse. Since we have the dependencies in a data structure, it's easy to
|
||||
* walk the tree and find out what JARs are required, even through several
|
||||
* layers of dependency.
|
||||
*
|
||||
*
|
||||
* When calling this, pass 2 arguments. The first is the path to the JAR which
|
||||
* contains the Vitro (or VIVO) classes. The second is the path to the directory
|
||||
* that contains the JARs. (shouldn't end with a slash)
|
||||
*
|
||||
*
|
||||
* There is a list of JARs which we know we need but which aren't shown by the
|
||||
* analysis. For example, the MySQL driver is loaded dynamically by name, so an
|
||||
* analysis of the class files in the JARs won't show that it is used. For now,
|
||||
|
@ -50,9 +50,9 @@ import com.tonicsystems.jarjar.KlugedDepFind;
|
|||
public class JarLister {
|
||||
/**
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* What I originally wanted to do was this:
|
||||
*
|
||||
*
|
||||
* <target name="jarlist" depends="jar" description="Figure out what JARs are needed">
|
||||
* <java classname="com.tonicsystems.jarjar.Main" fork="no" failonerror="true">
|
||||
* <classpath refid="utility.run.classpath" />
|
||||
|
@ -62,9 +62,9 @@ public class JarLister {
|
|||
* <arg value="${appbase.dir}/lib/*" />
|
||||
* </java>
|
||||
* </target>
|
||||
*
|
||||
*
|
||||
* I ended up with this instead:
|
||||
*
|
||||
*
|
||||
* <target name="jarlist" depends="jar" description="Figure out what JARs are needed">
|
||||
* <java classname="edu.cornell.mannlib.vitro.utilities.jarlist.JarLister" fork="no" failonerror="true">
|
||||
* <classpath refid="utility.run.classpath" />
|
||||
|
@ -73,7 +73,7 @@ public class JarLister {
|
|||
* <arg value="${appbase.dir}/config/jarlist/known_dependencies.txt" />
|
||||
* </java>
|
||||
* </target>
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* A harness that runs a system-level command.
|
||||
*
|
||||
*
|
||||
* No provision is made for standard input.
|
||||
*
|
||||
*
|
||||
* The standard output and standard error streams are asynchronously read, so
|
||||
* the sub-process will not block on full buffers. Warning: if either of these
|
||||
* streams contain more data than can fit into a String, then we will have a
|
||||
|
@ -40,7 +40,7 @@ public class ProcessRunner {
|
|||
|
||||
/**
|
||||
* Run the command.
|
||||
*
|
||||
*
|
||||
* @param command
|
||||
* a list containing the operating system program and its
|
||||
* arguments. See
|
||||
|
|
|
@ -17,15 +17,15 @@ import edu.cornell.mannlib.vitro.utilities.revisioninfo.ProcessRunner.ProcessExc
|
|||
/**
|
||||
* Get release and revision information to display on screen. Put this
|
||||
* information into a single line and append it to the specified file.
|
||||
*
|
||||
*
|
||||
* Ask Git for the information. If Git is available, and if this is a working
|
||||
* directory, then we can build the info from the responses we get from
|
||||
* "git describe", "git symbolic-ref" and "git log".
|
||||
*
|
||||
*
|
||||
* If that doesn't work, read the information from the "revisionInfo" file in
|
||||
* the product directory. Presumably, that file was created when the source was
|
||||
* exported from Git.
|
||||
*
|
||||
*
|
||||
* If that doesn't work either, return something like this:
|
||||
* "productName ~ unknown ~ unknown"
|
||||
*/
|
||||
|
@ -123,7 +123,7 @@ public class RevisionInfoBuilder {
|
|||
if (revision == null) {
|
||||
System.out.println("Couldn't get commit ID from Git");
|
||||
}
|
||||
|
||||
|
||||
if ((revision == null) && (release == null)) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -25,10 +25,10 @@ import edu.cornell.mannlib.vitro.utilities.testing.VitroTestRunner.ReportLevel;
|
|||
* Listen to events as they come from the JUnit test runner. The events from the
|
||||
* lifecycle methods are broken down into semantic chunks and executed. Three
|
||||
* levels of output are available.
|
||||
*
|
||||
*
|
||||
* On the surface, JUnit treats "failures" (failed assertions) the same as
|
||||
* "errors" (unexpected exceptions). We're going to distinguish between them.
|
||||
*
|
||||
*
|
||||
* @author jeb228
|
||||
*/
|
||||
public class VitroTestRunListener extends RunListener {
|
||||
|
@ -303,10 +303,10 @@ public class VitroTestRunListener extends RunListener {
|
|||
/**
|
||||
* Trim the stack trace: don't show the line saying "23 more", and don't
|
||||
* show the lines about org.junit or java.lang.reflect or sun.reflect.
|
||||
*
|
||||
*
|
||||
* Once we hit some "client code", we won't trim any futher lines even if
|
||||
* they belong to org.junit, or the others.
|
||||
*
|
||||
*
|
||||
* If we have nested exceptions, the process repeats for each "Caused by"
|
||||
* section.
|
||||
*/
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.junit.runner.JUnitCore;
|
|||
* It runs the tests with a variety of reporting detail, depending on the level
|
||||
* selected. If the level selector is absent or unrecognized, the medium level
|
||||
* is used.
|
||||
*
|
||||
*
|
||||
* @author jeb228
|
||||
*/
|
||||
public class VitroTestRunner {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue