@@ -71,7 +71,8 @@ public final class Diagnostics {
* The error text when a security manager blocks access to a property.
* {@value}
*/
protected static final String ERROR_PROPERTY_ACCESS_BLOCKED = "Access to this property blocked by a security manager";
protected static final String ERROR_PROPERTY_ACCESS_BLOCKED
= "Access to this property blocked by a security manager";
/** utility class */
private Diagnostics() {
@@ -239,14 +240,13 @@ public final class Diagnostics {
}
/**
* ignore exceptions. This is to allow future
* ignore exceptions. This is to allow future
* implementations to log at a verbose level
* @param thrown
*/
private static void ignoreThrowable(Throwable thrown) {
}
/**
* get the location of a class. Stolen from axis/webapps/happyaxis.jsp
* @param clazz
@@ -279,7 +279,7 @@ public final class Diagnostics {
ignoreThrowable(e);
out.println("optional tasks : not available");
}
header(out, "ANT PROPERTIES");
doReportAntProperties(out);
@@ -306,10 +306,10 @@ public final class Diagnostics {
header(out, "Locale information");
doReportLocale(out);
header(out, "Proxy information");
doReportProxy(out);
out.println();
}
@@ -344,7 +344,7 @@ public final class Diagnostics {
/**
* Get the value of a system property. If a security manager
* blocks access to a property it fills the result in with an error
* blocks access to a property it fills the result in with an error
* @param key
* @return the system property's value or error text
* @see #ERROR_PROPERTY_ACCESS_BLOCKED
@@ -367,7 +367,8 @@ public final class Diagnostics {
Project p = new Project();
p.initProperties();
out.println(MagicNames.ANT_VERSION + ": " + p.getProperty(MagicNames.ANT_VERSION));
out.println(MagicNames.ANT_JAVA_VERSION + ": " + p.getProperty(MagicNames.ANT_JAVA_VERSION));
out.println(MagicNames.ANT_JAVA_VERSION + ": "
+ p.getProperty(MagicNames.ANT_JAVA_VERSION));
out.println(MagicNames.ANT_LIB + ": " + p.getProperty(MagicNames.ANT_LIB));
out.println(MagicNames.ANT_HOME + ": " + p.getProperty(MagicNames.ANT_HOME));
}
@@ -462,7 +463,7 @@ public final class Diagnostics {
Class.forName(classname);
props.remove(key);
} catch (ClassNotFoundException e) {
out.println(key + " : Not Available "
out.println(key + " : Not Available "
+ "(the implementation class is not present)");
} catch (NoClassDefFoundError e) {
String pkg = e.getMessage().replace('/', '.');
@@ -474,8 +475,8 @@ public final class Diagnostics {
if (props.size() == 0) {
out.println("All defined tasks are available");
} else {
out.println("A task being missing/unavailable should only "
+"matter if you are trying to use it");
out.println("A task being missing/unavailable should only "
+ "matter if you are trying to use it");
}
} catch (IOException e) {
out.println(e.getMessage());
@@ -491,8 +492,8 @@ public final class Diagnostics {
String parserName = getXmlParserName();
String parserLocation = getXMLParserLocation();
printParserInfo(out, "XML Parser", parserName, parserLocation);
printParserInfo(out, "Namespace-aware parser",
getNamespaceParserName(),
printParserInfo(out, "Namespace-aware parser",
getNamespaceParserName(),
getNamespaceParserLocation());
}
@@ -506,8 +507,8 @@ public final class Diagnostics {
if (parserLocation == null) {
parserLocation = "unknown";
}
out.println(parserType +" : " + parserName);
out.println(parserType +" Location: " + parserLocation);
out.println(parserType + " : " + parserName);
out.println(parserType + " Location: " + parserLocation);
}
/**
@@ -566,7 +567,7 @@ public final class Diagnostics {
/**
* Report locale information
* @param out stream to print to
* @param out stream to print to
*/
private static void doReportLocale(PrintStream out) {
//calendar stuff.
@@ -590,9 +591,9 @@ public final class Diagnostics {
* @param out stream to print on
* @param key property name
*/
private static void printProperty(PrintStream out,String key) {
String value= getProperty(key);
if(value!=null) {
private static void printProperty(PrintStream out, String key) {
String value = getProperty(key);
if (value != null) {
out.print(key);
out.print(" = ");
out.print('"');
@@ -603,12 +604,12 @@ public final class Diagnostics {
/**
* Report proxy information
*
*
* @param out stream to print to
* @since Ant1.7
*/
private static void doReportProxy(PrintStream out) {
printProperty(out,ProxySetup.HTTP_PROXY_HOST);
printProperty(out, ProxySetup.HTTP_PROXY_HOST);
printProperty(out, ProxySetup.HTTP_PROXY_PORT);
printProperty(out, ProxySetup.HTTP_PROXY_USERNAME);
printProperty(out, ProxySetup.HTTP_PROXY_PASSWORD);
@@ -632,7 +633,7 @@ public final class Diagnostics {
= "org.apache.tools.ant.util.java15.ProxyDiagnostics";
try {
Class proxyDiagClass = Class.forName(proxyDiagClassname);
Object instance =proxyDiagClass.newInstance();
Object instance = proxyDiagClass.newInstance();
out.println("Java1.5+ proxy settings:");
out.println(instance.toString());
} catch (ClassNotFoundException e) {