Browse Source

a bit o' checkstyling

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274816 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 22 years ago
parent
commit
ca4b596f4d
12 changed files with 76 additions and 63 deletions
  1. +1
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntTool.java
  2. +16
    -8
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java
  3. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java
  4. +13
    -13
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJExportServlet.java
  5. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImportServlet.java
  6. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoad.java
  7. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java
  8. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadServlet.java
  9. +20
    -16
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java
  10. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJProjectDescription.java
  11. +7
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJRemoteUtil.java
  12. +5
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJUtil.java

+ 1
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntTool.java View File

@@ -139,8 +139,7 @@ public class VAJAntTool {
String data = info.asDataString();
try {
ToolData td = new ToolData(TOOL_DATA_KEY, data);
VAJLocalUtil.getWorkspace().loadedProjectNamed(
info.getVAJProjectName()).setToolRepositoryData(td);
VAJLocalUtil.getWorkspace().loadedProjectNamed(info.getVAJProjectName()).setToolRepositoryData(td);
} catch (Throwable t) {
throw new BuildException("BuildInfo for Project "
+ info.getVAJProjectName() + " could not be saved", t);


+ 16
- 8
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJAntToolGUI.java View File

@@ -302,7 +302,9 @@ public class VAJAntToolGUI extends Frame {
/**
* Eventhandler to handle all AWT-events
*/
private class PrivateEventHandler implements ActionListener, ItemListener, TextListener, WindowListener, PropertyChangeListener {
private class PrivateEventHandler
implements ActionListener, ItemListener, TextListener,
WindowListener, PropertyChangeListener {
/**
* ActionListener method
*/
@@ -428,12 +430,18 @@ public class VAJAntToolGUI extends Frame {
handleException(exc);
}
}
public void windowActivated(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowOpened(WindowEvent e) {}
public void windowActivated(WindowEvent e) {
}
public void windowClosed(WindowEvent e) {
}
public void windowDeactivated(WindowEvent e) {
}
public void windowDeiconified(WindowEvent e) {
}
public void windowIconified(WindowEvent e) {
}
public void windowOpened(WindowEvent e) {
}
}

/**
@@ -850,7 +858,7 @@ public class VAJAntToolGUI extends Frame {
iCommandButtonPanelFlowLayout.setAlignment(FlowLayout.RIGHT);
} catch (Throwable iExc) {
handleException(iExc);
};
}
return iCommandButtonPanelFlowLayout;
}
/**


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJBuildInfo.java View File

@@ -192,7 +192,7 @@ class VAJBuildInfo implements Runnable {
private Vector projectTargets = new Vector();

// target selected for execution
private java.lang.String target = "";
private String target = "";

// log level
private int outputMessageLevel = Project.MSG_INFO;
@@ -224,7 +224,7 @@ class VAJBuildInfo implements Runnable {
/**
* Returns the BuildInfo information as String. The BuildInfo can
* be rebuilt from that String by calling parse().
* @return java.lang.String
* @return String
*/
public String asDataString() {
String result = getOutputMessageLevel() + "|" + getBuildFileName()
@@ -254,7 +254,7 @@ class VAJBuildInfo implements Runnable {
/**
* The firePropertyChange method was generated to support the propertyChange field.
*/
public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue) {
public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
getPropertyChange().firePropertyChange(propertyName, oldValue, newValue);
}

@@ -305,7 +305,7 @@ class VAJBuildInfo implements Runnable {
/**
* returns the selected target.
*/
public java.lang.String getTarget() {
public String getTarget() {
return target;
}

@@ -350,7 +350,7 @@ class VAJBuildInfo implements Runnable {
* outputMessageLevel'|'buildFileName'|'defaultTarget'|'(project target'|')*
*
* @return org.apache.tools.ant.taskdefs.optional.vaj.BuildInfo
* @param data java.lang.String
* @param data String
*/
public static VAJBuildInfo parse(String data) {
VAJBuildInfo result = new VAJBuildInfo();


+ 13
- 13
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJExportServlet.java View File

@@ -71,24 +71,24 @@ import java.io.File;
* <tr>
* <td>dir</td>
* <td>Any valid directory name on the server.</td>
* <td>The directory to export the files to on the machine
* where the servlet is being run. If the directory
* <td>The directory to export the files to on the machine
* where the servlet is being run. If the directory
* doesn't exist, it will be created.<p>
* Relative paths are relative to
* IBMVJava/ide/tools/com-ibm-ivj-toolserver,
* where IBMVJava is the VisualAge for Java installation
* Relative paths are relative to
* IBMVJava/ide/tools/com-ibm-ivj-toolserver,
* where IBMVJava is the VisualAge for Java installation
* directory.</td>
* </tr>
* <tr>
* <td>include</td>
* <td>See below.</td>
* <td>The pattern used to indicate which projects and
* <td>The pattern used to indicate which projects and
* packages to export.</td>
* </tr>
* <tr>
* <td>exclude</td>
* <td>See below</td>
* <td>The pattern used to indicate which projects and
* <td>The pattern used to indicate which projects and
* packages <em>not</em> to export.</td>
* </tr>
* <tr>
@@ -110,7 +110,7 @@ import java.io.File;
* <tr>
* <td>dex</td>
* <td>"yes" or "no" (without the quotes)</td>
* <td>Use the default exclusion patterns. Defaults to "yes".
* <td>Use the default exclusion patterns. Defaults to "yes".
* See below for an explanation of default excludes.</td>
* </tr>
* <tr>
@@ -120,11 +120,11 @@ import java.io.File;
* </tr>
* </table>
*
* <p>The vajexport servlet uses include and exclude parameters to form
* the criteria for selecting packages to export. The parameter is
* broken up into ProjectName/packageNameSegments, where ProjectName
* is what you expect, and packageNameSegments is a partial (or complete)
* package name, separated by forward slashes, rather than periods.
* <p>The vajexport servlet uses include and exclude parameters to form
* the criteria for selecting packages to export. The parameter is
* broken up into ProjectName/packageNameSegments, where ProjectName
* is what you expect, and packageNameSegments is a partial (or complete)
* package name, separated by forward slashes, rather than periods.
* Each packageNameSegment can have wildcard characters.</p>
*
* <table border="1">


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJImportServlet.java View File

@@ -94,10 +94,10 @@ public class VAJImportServlet extends VAJToolsServlet {
getBooleanParam(CLASSES_PARAM, false),
getBooleanParam(RESOURCES_PARAM, true),
getBooleanParam(SOURCES_PARAM, true),
false);
false);
// no default excludes, because they
// are already added on client side
// getBooleanParam(DEFAULT_EXCLUDES_PARAM, true)
}
}

+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoad.java View File

@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -66,7 +66,7 @@ import org.apache.tools.ant.BuildException;
* <li>* (loads the latest <b>versioned</b> edition)</li>
* <li>** (loads the latest edition, including open editions)</li>
* </ul>
* Example:
* Example:
* <blockquote>
* &lt;vajload&gt;
* &nbsp;&lt;project name=&quot;MyVAProject&quot; version=&quot;*&quot;/&gt;


+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadProjects.java View File

@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -75,7 +75,7 @@ public class VAJLoadProjects extends VAJLoad {








+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLoadServlet.java View File

@@ -58,7 +58,7 @@ import java.util.Vector;

/**
* A Remote Access to Tools Servlet to load a Project
* from the Repository into the Workbench. The following
* from the Repository into the Workbench. The following
* table describes the servlet parameters.
*
* <table>
@@ -77,7 +77,7 @@ import java.util.Vector;
* the Workbench.</td>
* </tr>
* </table>
*
*
* @author Wolf Siberski, based on servlets written by Glenn McAllister
*/
public class VAJLoadServlet extends VAJToolsServlet {


+ 20
- 16
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJLocalUtil.java View File

@@ -78,7 +78,7 @@ import org.apache.tools.ant.DirectoryScanner;
* @author Wolf Siberski, TUI Infotec GmbH
* @author Martin Landers, Beck et al. projects
*/
abstract class VAJLocalUtil implements VAJUtil{
abstract class VAJLocalUtil implements VAJUtil {
// singleton containing the VAJ workspace
private static Workspace workspace;

@@ -126,12 +126,11 @@ abstract class VAJLocalUtil implements VAJUtil{
/**
* export packages
*/
public void exportPackages(
File dest,
public void exportPackages(File dest,
String[] includePatterns, String[] excludePatterns,
boolean exportClasses, boolean exportDebugInfo,
boolean exportResources, boolean exportSources,
boolean useDefaultExcludes, boolean overwrite) {
boolean useDefaultExcludes, boolean overwrite) {
if (includePatterns == null || includePatterns.length == 0) {
log("You must specify at least one include attribute. "
+ "Not exporting", MSG_ERR);
@@ -197,16 +196,18 @@ abstract class VAJLocalUtil implements VAJUtil{
VAJProjectDescription d = (VAJProjectDescription) e.nextElement();

ProjectEdition pe;
if (d.getVersion().equals("*"))
if (d.getVersion().equals("*")) {
pe = findLatestProjectEdition(d.getName(), false);
else if (d.getVersion().equals("**"))
} else if (d.getVersion().equals("**")) {
pe = findLatestProjectEdition(d.getName(), true);
else
} else {
pe = findProjectEdition(d.getName(), d.getVersion());
}
try {
log("Loading '" + pe.getName() + "', Version '" +
((pe.getVersionName() != null)?pe.getVersionName():"("+pe.getVersionStamp()+ ")")+
"' into Workspace", MSG_VERBOSE);
log("Loading '" + pe.getName() + "', Version '"
+ ((pe.getVersionName() != null) ? pe.getVersionName()
: "("+pe.getVersionStamp()+ ")")
+ "' into Workspace", MSG_VERBOSE);
pe.loadIntoWorkspace();
} catch (IvjException ex) {
throw createBuildException("Project '" + d.getName()
@@ -231,8 +232,8 @@ abstract class VAJLocalUtil implements VAJUtil{
String pattern = d.getName();
if (VAJWorkspaceScanner.match(pattern, projectNames[i])) {
d.setProjectFound();
expandedDescs.addElement(new VAJProjectDescription(
projectNames[i], d.getVersion()));
expandedDescs.addElement(new VAJProjectDescription(projectNames[i],
d.getVersion()));
break;
}
}
@@ -298,10 +299,12 @@ abstract class VAJLocalUtil implements VAJUtil{

// find latest (versioned) project edition by date
ProjectEdition pe = null;
Date latestStamp = new Date(0); // Let's hope there are no projects older than the epoch ;-)
// Let's hope there are no projects older than the epoch ;-)
Date latestStamp = new Date(0);
for (int i = 0; i < editions.length; i++) {
if (!includeOpenEditions && !editions[i].isVersion())
if (!includeOpenEditions && !editions[i].isVersion()) {
continue;
}
if (latestStamp.before(editions[i].getVersionStamp())) {
latestStamp = editions[i].getVersionStamp();
pe = editions[i];
@@ -311,8 +314,9 @@ abstract class VAJLocalUtil implements VAJUtil{
if (pe == null) {
throw new BuildException("Can't determine latest edition for project " + name);
}
log("Using version " + ((pe.getVersionName() != null)?pe.getVersionName():"("+pe.getVersionStamp()+ ")") +
" of " + pe.getName(), MSG_INFO);
log("Using version " + ((pe.getVersionName() != null) ? pe.getVersionName()
: "("+pe.getVersionStamp()+ ")")
+ " of " + pe.getName(), MSG_INFO);
return pe;
} catch (IvjException e) {
throw createBuildException("VA Exception occured: ", e);


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJProjectDescription.java View File

@@ -108,7 +108,7 @@ public class VAJProjectDescription {

/**
* this may be a helper method, and is being ignored for now
* @ant.attribute ignore="true"
*/
public void setProjectFound() {


+ 7
- 5
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJRemoteUtil.java View File

@@ -74,7 +74,7 @@ import org.apache.tools.ant.Task;
* @author Wolf Siberski, TUI Infotec GmbH
* @author Martin Landers, Beck et al. projects
*/
class VAJRemoteUtil implements VAJUtil{
class VAJRemoteUtil implements VAJUtil {
// calling task
Task caller;

@@ -91,8 +91,9 @@ class VAJRemoteUtil implements VAJUtil{
*/
public void exportPackages(File destDir,
String[] includePatterns, String[] excludePatterns,
boolean exportClasses, boolean exportDebugInfo, boolean exportResources,
boolean exportSources, boolean useDefaultExcludes, boolean overwrite) {
boolean exportClasses, boolean exportDebugInfo,
boolean exportResources, boolean exportSources,
boolean useDefaultExcludes, boolean overwrite) {
try {
String request = "http://" + remoteServer + "/servlet/vajexport?"
+ VAJExportServlet.WITH_DEBUG_INFO + "=" + exportDebugInfo + "&"
@@ -148,13 +149,13 @@ class VAJRemoteUtil implements VAJUtil{
+ VAJToolsServlet.DEFAULT_EXCLUDES_PARAM + "=" + useDefaultExcludes;

if (includePatterns != null) {
for (int i = 0; i < includePatterns.length; i++){
for (int i = 0; i < includePatterns.length; i++) {
result = result + "&" + VAJExportServlet.INCLUDE_PARAM + "="
+ URLEncoder.encode(includePatterns[i]);
}
}
if (excludePatterns != null) {
for (int i = 0; i < excludePatterns.length; i++){
for (int i = 0; i < excludePatterns.length; i++) {
result = result + "&" + VAJExportServlet.EXCLUDE_PARAM + "="
+ URLEncoder.encode(excludePatterns[i]);
}
@@ -213,6 +214,7 @@ class VAJRemoteUtil implements VAJUtil{
is = connection.getInputStream();
break;
} catch (IOException ex) {
// ignore
}
}
if (is == null) {


+ 5
- 5
src/main/org/apache/tools/ant/taskdefs/optional/ide/VAJUtil.java View File

@@ -65,11 +65,11 @@ import java.util.Vector;
*/
interface VAJUtil {
// log levels
public static final int MSG_DEBUG = 4;
public static final int MSG_ERR = 0;
public static final int MSG_INFO = 2;
public static final int MSG_VERBOSE = 3;
public static final int MSG_WARN = 1;
static final int MSG_DEBUG = 4;
static final int MSG_ERR = 0;
static final int MSG_INFO = 2;
static final int MSG_VERBOSE = 3;
static final int MSG_WARN = 1;

/**
* export the array of Packages


Loading…
Cancel
Save