diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
index 6bec18e1f..ed29bf88d 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/CSharp.java
@@ -54,10 +54,10 @@
/* build notes
- -The reference CD to listen to while editing this file is
+ -The reference CD to listen to while editing this file is
nap: Underworld - Everything, Everything
-variable naming policy from Fowler's refactoring book.
- -tested against the PDC pre-beta of csc.exe; future versions will
+ -tested against the PDC pre-beta of csc.exe; future versions will
inevitably change things
*/
@@ -72,32 +72,34 @@ package org.apache.tools.ant.taskdefs.optional.dotnet;
// imports
// ====================================================================
+import java.io.File;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
-
+import org.apache.tools.ant.taskdefs.MatchingTask;
import org.apache.tools.ant.types.Path;
-import java.io.File;
// ====================================================================
+
/**
This task compiles CSharp source into executables or modules.
-The task will only work on win2K until other platforms support csc.exe or
+The task will only work on win2K until other platforms support csc.exe or
an equivalent. CSC.exe must be on the execute path too.
All parameters are optional: <csc/> should suffice to produce a debug
-build of all *.cs files. References to external files do require explicit
-enumeration, so are one of the first attributes to consider adding.
+build of all *.cs files. References to external files do require explicit
+enumeration, so are one of the first attributes to consider adding.
-The task is a directory based task, so attributes like includes="*.cs" and
-excludes="broken.cs" can be used to control the files pulled in. By default,
-all *.cs files from the project folder down are included in the command.
+The task is a directory based task, so attributes like includes="*.cs" and
+excludes="broken.cs" can be used to control the files pulled in. By default,
+all *.cs files from the project folder down are included in the command.
When this happens the output file -if not specified-
is taken as the first file in the list, which may be somewhat hard to control.
-Specifying the output file with 'outfile' seems prudent.
+Specifying the output file with 'outfile' seems prudent.
@@ -105,129 +107,129 @@ Specifying the output file with 'outfile' seems prudent.
TODO
- - is incremental build still broken in beta-1?
-
- is Win32Icon broken?
-
- all the missing options
+
- is incremental build still broken in beta-1?
+
- is Win32Icon broken?
+
- all the missing options
History
-
- 0.3 |
- Beta 1 edition |
- To avoid having to remember which assemblies to include,
- the task automatically refers to the main dotnet libraries in Beta1.
-
- |
0.2 |
- Slightly different |
- Split command execution to a separate class;
- |
- 0.1 |
- "I can't believe it's so rudimentary" |
- First pass; minimal builds only support;
- |
-
-
-@version 0.3
-@author Steve Loughran steve_l@iseran.com
+
+ 0.3 |
+ Beta 1 edition |
+ To avoid having to remember which assemblies to include,
+ the task automatically refers to the main dotnet libraries in Beta1.
+
+ |
0.2 |
+ Slightly different |
+ Split command execution to a separate class;
+ |
+ 0.1 |
+ "I can't believe it's so rudimentary" |
+ First pass; minimal builds only support;
+ |
+
+
+ @version 0.3
+ @author Steve Loughran steve_l@iseran.com
*/
-public class CSharp
- extends org.apache.tools.ant.taskdefs.MatchingTask {
+public class CSharp
+ extends MatchingTask {
/** constructor inits everything and set up the search pattern
- */
-
- public CSharp () {
+ */
+
+ public CSharp() {
Clear();
setIncludes(csc_file_pattern);
}
-
- /** name of the executable. the .exe suffix is deliberately not included
+
+ /** name of the executable. the .exe suffix is deliberately not included
* in anticipation of the unix version
*/
- protected final static String csc_exe_name="csc";
-
+ protected final static String csc_exe_name = "csc";
+
/** what is the file extension we search on?
*/
- protected final static String csc_file_ext="cs";
-
- /** derive the search pattern from the extension
+ protected final static String csc_file_ext = "cs";
+
+ /** derive the search pattern from the extension
*/
- protected final static String csc_file_pattern="**/*."+csc_file_ext;
-
+ protected final static String csc_file_pattern = "**/*." + csc_file_ext;
+
/** list of reference classes. (pretty much a classpath equivalent)
*/
- protected String _references;
-
+ protected String _references;
+
/**
- * Set the reference list to be used for this compilation.
+ * Set the reference list to be used for this compilation.
*
- * @param s The new References value
+ * @param s The new References value
*/
public void setReferences(String s) {
- _references=s;
+ _references = s;
}
-
+
/**
- * get the reference string or null for no argument needed
+ * get the reference string or null for no argument needed
*
- * @return The References Parameter to CSC
+ * @return The References Parameter to CSC
*/
protected String getReferencesParameter() {
//bail on no references
- if (notEmpty(_references)) {
- return "/reference:"+_references;
+ if (notEmpty(_references)) {
+ return "/reference:" + _references;
} else {
return null;
}
}
-
+
/**
using the path approach didnt work as it could not handle the implicit
execution path. Perhaps that could be extracted from the runtime and then
the path approach would be viable
- */
- protected Path _referenceFiles;
-
+ */
+ protected Path _referenceFiles;
+
/**
* add another path to the reference file path list
* @param path another path to append
*/
public void setReferenceFiles(Path path) {
//demand create pathlist
- if(_referenceFiles==null) {
- _referenceFiles=new Path(this.project);
+ if (_referenceFiles == null) {
+ _referenceFiles = new Path(this.project);
}
_referenceFiles.append(path);
}
-
+
/**
turn the path list into a list of files and a /references argument
@return null or a string of references.
- */
+ */
protected String getReferenceFilesParameter() {
//bail on no references
- if (_references==null) {
+ if (_references == null) {
return null;
}
//iterate through the ref list & generate an entry for each
//or just rely on the fact that the toString operator does this, but
//noting that the separator is ';' on windows, ':' on unix
- String refpath=_references.toString();
-
+ String refpath = _references.toString();
+
//bail on no references listed
- if (refpath.length()==0) {
+ if (refpath.length() == 0) {
return null;
}
-
- StringBuffer s=new StringBuffer("/reference:");
+
+ StringBuffer s = new StringBuffer("/reference:");
s.append(refpath);
return new String(s);
- }
-
- /**
- * Fix C# reference inclusion.
+ }
+
+ /**
+ * Fix C# reference inclusion.
* C# is really dumb in how it handles inclusion. You have to list
* every 'assembly' -read DLL that is imported. So already you are
* making a platform assumption -shared libraries have a .dll;"+ extension
@@ -235,489 +237,495 @@ public class CSharp
* why the compiler cant find classes on the path or in a directory,
* is a mystery.
*
- * To reduce the need to be explicit, here is a long list of
+ * To reduce the need to be explicit, here is a long list of
* the core libraries used in Beta-1 of .NET
* ommitting the blatantly non portable (MS.win32.interop)
* and the .designer libraries. (ripping out Com was tempting)
* Casing is chosen to match that of the file system exactly
- * so may work on a unix box too.
- */
-
- protected final static String DEFAULT_REFERENCE_LIST=
- "Accessibility.dll;"+
- "cscompmgd.dll;"+
- "CustomMarshalers.dll;"+
- "IEExecRemote.dll;"+
- "IEHost.dll;"+
- "IIEHost.dll;"+
- "ISymWrapper.dll;"+
- "Microsoft.JScript.dll;"+
- "Microsoft.VisualBasic.dll;"+
- "Microsoft.VisualC.dll;"+
- "Microsoft.Vsa.dll;"+
- "Mscorcfg.dll;"+
- "RegCode.dll;"+
- "System.Configuration.Install.dll;"+
- "System.Data.dll;"+
- "System.Design.dll;"+
- "System.DirectoryServices.dll;"+
- "System.EnterpriseServices.dll;"+
- "System.dll;"+
- "System.Drawing.Design.dll;"+
- "System.Drawing.dll;"+
- "System.Management.dll;"+
- "System.Messaging.dll;"+
- "System.Runtime.Remoting.dll;"+
- "System.Runtime.Serialization.Formatters.Soap.dll;"+
- "System.Security.dll;"+
- "System.ServiceProcess.dll;"+
- "System.Web.dll;"+
- "System.Web.RegularExpressions.dll;"+
- "System.Web.Services.dll;"+
- "System.Windows.Forms.dll;"+
+ * so may work on a unix box too.
+ */
+
+ protected final static String DEFAULT_REFERENCE_LIST =
+ "Accessibility.dll;" +
+ "cscompmgd.dll;" +
+ "CustomMarshalers.dll;" +
+ "IEExecRemote.dll;" +
+ "IEHost.dll;" +
+ "IIEHost.dll;" +
+ "ISymWrapper.dll;" +
+ "Microsoft.JScript.dll;" +
+ "Microsoft.VisualBasic.dll;" +
+ "Microsoft.VisualC.dll;" +
+ "Microsoft.Vsa.dll;" +
+ "Mscorcfg.dll;" +
+ "RegCode.dll;" +
+ "System.Configuration.Install.dll;" +
+ "System.Data.dll;" +
+ "System.Design.dll;" +
+ "System.DirectoryServices.dll;" +
+ "System.EnterpriseServices.dll;" +
+ "System.dll;" +
+ "System.Drawing.Design.dll;" +
+ "System.Drawing.dll;" +
+ "System.Management.dll;" +
+ "System.Messaging.dll;" +
+ "System.Runtime.Remoting.dll;" +
+ "System.Runtime.Serialization.Formatters.Soap.dll;" +
+ "System.Security.dll;" +
+ "System.ServiceProcess.dll;" +
+ "System.Web.dll;" +
+ "System.Web.RegularExpressions.dll;" +
+ "System.Web.Services.dll;" +
+ "System.Windows.Forms.dll;" +
"System.XML.dll;";
-
- /**
+ /**
* get default reference list
* @return null or a string of references.
- */
+ */
protected String getDefaultReferenceParameter() {
- if(_includeDefaultReferences) {
- StringBuffer s=new StringBuffer("/reference:");
+ if (_includeDefaultReferences) {
+ StringBuffer s = new StringBuffer("/reference:");
s.append(DEFAULT_REFERENCE_LIST);
return new String(s);
- }
- else {
+ } else {
return null;
- }
+ }
}
-
- /** flag to enable automatic reference inclusion
- *
+
+ /** flag to enable automatic reference inclusion
+ *
*/
- protected boolean _includeDefaultReferences;
+ protected boolean _includeDefaultReferences;
/** set the automatic reference inclusion flag on or off
- * this flag controls the string of references and the
+ * this flag controls the string of references and the
* /nostdlib option in CSC
- @param f on/off flag
- */
+ @param f on/off flag
+ */
public void setIncludeDefaultReferences(boolean f) {
- _includeDefaultReferences=f;
+ _includeDefaultReferences = f;
}
-
+
/** query the optimise flag
- @return true if optimise is turned on
+ @return true if optimise is turned on
*/
public boolean getIncludeDefaultReferences() {
return _includeDefaultReferences;
}
-
+
/**
- * get the include default references flag or null for no argument needed
+ * get the include default references flag or null for no argument needed
*
- * @return The Parameter to CSC
+ * @return The Parameter to CSC
*/
protected String getIncludeDefaultReferencesParameter() {
- return "/nostdlib"+(_includeDefaultReferences?"-":"+");
- }
-
+ return "/nostdlib" + (_includeDefaultReferences?"-":"+");
+ }
+
/** optimise flag
*/
protected boolean _optimize;
-
+
/** set the optimise flag on or off
- @param f on/off flag
- */
+ @param f on/off flag
+ */
public void setOptimize(boolean f) {
- _optimize=f;
+ _optimize = f;
}
-
+
/** query the optimise flag
- @return true if optimise is turned on
+ @return true if optimise is turned on
*/
public boolean getOptimize() {
return _optimize;
}
-
+
/**
- * get the optimise flag or null for no argument needed
+ * get the optimise flag or null for no argument needed
*
- * @return The Optimize Parameter to CSC
+ * @return The Optimize Parameter to CSC
*/
protected String getOptimizeParameter() {
- return "/optimize"+(_optimize?"+":"-");
- }
-
+ return "/optimize" + (_optimize?"+":"-");
+ }
+
/** incremental build flag */
protected boolean _incremental;
-
+
/** set the incremental compilation flag on or off
* @param f on/off flag
*/
- public void setIncremental(boolean f){
- _incremental=f;
+ public void setIncremental(boolean f) {
+ _incremental = f;
}
-
+
/** query the incrementalflag
* @return true iff incremental compilation is turned on
*/
public boolean getIncremental() {
return _incremental;
}
-
+
/**
* get the incremental build argument
*
- * @return The Incremental Parameter to CSC
+ * @return The Incremental Parameter to CSC
*/
protected String getIncrementalParameter() {
- return "/incremental"+(_incremental?"+":"-");
- }
-
- /** debug flag. Controls generation of debug information.
+ return "/incremental" + (_incremental?"+":"-");
+ }
+
+ /** debug flag. Controls generation of debug information.
*/
protected boolean _debug;
-
+
/** set the debug flag on or off
* @param f on/off flag
*/
public void setDebug(boolean f) {
- _debug=f;
+ _debug = f;
}
-
+
/** query the debug flag
* @return true if debug is turned on
*/
public boolean getDebug() {
return _debug;
}
-
+
/**
- * get the debug switch argument
+ * get the debug switch argument
*
- * @return The Debug Parameter to CSC
+ * @return The Debug Parameter to CSC
*/
protected String getDebugParameter() {
- return "/debug"+(_debug?"+":"-");
- }
-
+ return "/debug" + (_debug?"+":"-");
+ }
+
/** output XML documentation flag
- */
+ */
protected File _docFile;
-
+
/** file for generated XML documentation
* @param f output file
*/
public void setDocFile(File f) {
_docFile = f;
}
-
+
/** get the argument or null for no argument needed
- * @return The DocFile Parameter to CSC
+ * @return The DocFile Parameter to CSC
*/
protected String getDocFileParameter() {
- if (_docFile!=null) {
- return "/doc:"+_docFile.toString();
+ if (_docFile != null) {
+ return "/doc:" + _docFile.toString();
} else {
return null;
}
- }
-
+ }
+
/** warning level: 0-4, with 4 being most verbose
- */
+ */
private int _warnLevel;
-
+
/** set warn level (no range checking)
* @param warnLevel warn level -see .net docs for valid range (probably 0-4)
- */
- public void setWarnLevel(int warnLevel)
- {this._warnLevel=warnLevel;}
-
+ */
+ public void setWarnLevel(int warnLevel) {
+ this._warnLevel = warnLevel;
+ }
+
/** query warn level
* @return current value
- */
- public int getWarnLevel()
- {return _warnLevel;}
-
+ */
+ public int getWarnLevel() {
+ return _warnLevel;
+ }
+
/**
- * get the warn level switch
+ * get the warn level switch
*
- * @return The WarnLevel Parameter to CSC
+ * @return The WarnLevel Parameter to CSC
*/
protected String getWarnLevelParameter() {
- return "/warn:"+_warnLevel;
- }
-
+ return "/warn:" + _warnLevel;
+ }
+
/** enable unsafe code flag. Clearly set to false by default
*/
protected boolean _unsafe;
-
+
/**
- * Sets the Unsafe attribute
+ * Sets the Unsafe attribute
*
- * @param unsafe The new Unsafe value
+ * @param unsafe The new Unsafe value
*/
- public void setUnsafe(boolean unsafe)
- {this._unsafe=unsafe;}
-
+ public void setUnsafe(boolean unsafe) {
+ this._unsafe = unsafe;
+ }
+
/**
- * query the Unsafe attribute
+ * query the Unsafe attribute
*
- * @return The Unsafe value
+ * @return The Unsafe value
*/
- public boolean getUnsafe()
- {return this._unsafe;}
-
+ public boolean getUnsafe() {
+ return this._unsafe;
+ }
+
/** get the argument or null for no argument needed
- * @return The Unsafe Parameter to CSC
- */
- protected String getUnsafeParameter(){
+ * @return The Unsafe Parameter to CSC
+ */
+ protected String getUnsafeParameter() {
return _unsafe?"/unsafe":null;
- }
-
+ }
+
/** main class (or null for automatic choice)
*/
protected String _mainClass;
-
+
/**
* Sets the MainClass attribute
*
- * @param mainClass The new MainClass value
+ * @param mainClass The new MainClass value
*/
- public void setMainClass(String mainClass)
- {this._mainClass=mainClass;}
-
+ public void setMainClass(String mainClass) {
+ this._mainClass = mainClass;
+ }
+
/**
- * Gets the MainClass attribute
+ * Gets the MainClass attribute
*
- * @return The MainClass value
+ * @return The MainClass value
*/
- public String getMainClass()
- {return this._mainClass;}
-
+ public String getMainClass() {
+ return this._mainClass;
+ }
+
/**
- * get the /main argument or null for no argument needed
+ * get the /main argument or null for no argument needed
*
- * @return The MainClass Parameter to CSC
+ * @return The MainClass Parameter to CSC
*/
- protected String getMainClassParameter(){
- if (_mainClass!=null && _mainClass.length()!=0) {
- return "/main:"+_mainClass;
+ protected String getMainClassParameter() {
+ if (_mainClass != null && _mainClass.length() != 0) {
+ return "/main:" + _mainClass;
} else {
return null;
}
- }
-
+ }
+
/** any extra command options?
*/
protected String _extraOptions;
-
+
/**
* Sets the ExtraOptions attribute
*
- * @param extraOptions The new ExtraOptions value
+ * @param extraOptions The new ExtraOptions value
*/
- public void setExtraOptions(String extraOptions)
- {this._extraOptions=extraOptions;}
-
+ public void setExtraOptions(String extraOptions) {
+ this._extraOptions = extraOptions;
+ }
+
/**
- * Gets the ExtraOptions attribute
+ * Gets the ExtraOptions attribute
*
- * @return The ExtraOptions value
+ * @return The ExtraOptions value
*/
- public String getExtraOptions()
- {return this._extraOptions;}
-
+ public String getExtraOptions() {
+ return this._extraOptions;
+ }
+
/**
- * get any extra options or null for no argument needed
+ * get any extra options or null for no argument needed
*
- * @return The ExtraOptions Parameter to CSC
+ * @return The ExtraOptions Parameter to CSC
*/
protected String getExtraOptionsParameter() {
- if (_extraOptions!=null && _extraOptions.length()!=0) {
+ if (_extraOptions != null && _extraOptions.length() != 0) {
return _extraOptions;
} else {
return null;
}
- }
-
+ }
+
/** source directory upon which the search pattern is applied
*/
private File _srcDir;
-
+
/**
* Set the source dir to find the files to be compiled
- * @param srcDirName The new SrcDir value
+ * @param srcDirName The new SrcDir value
*/
- public void setSrcDir(File srcDirName){
+ public void setSrcDir(File srcDirName) {
_srcDir = srcDirName;
}
-
+
/** destination directory (null means use the source directory)
- * NB: this is currently not used
- */
+ * NB: this is currently not used
+ */
private File _destDir;
-
+
/**
* Set the destination dir to find the files to be compiled
- * @param dirName The new DestDir value
+ * @param dirName The new DestDir value
*/
public void setDestDir(File dirName) {
_destDir = dirName;
}
-
+
/** type of target. Should be one of exe|library|module|winexe|(null)
- default is exe; the actual value (if not null) is fed to the command line.
-
See /target
+ default is exe; the actual value (if not null) is fed to the command line.
+
See /target
*/
protected String _targetType;
-
+
/** define the target
- * @param targetType The new TargetType value
- * @exception BuildException if target is not one of exe|library|module|winexe
+ * @param targetType The new TargetType value
+ * @exception BuildException if target is not one of exe|library|module|winexe
*/
public void setTargetType(String targetType)
- throws BuildException {
- targetType=targetType.toLowerCase();
- if(targetType.equals("exe") || targetType.equals("library") ||
- targetType.equals("module") ||targetType.equals("winexe") ) {
- _targetType=targetType;
- }
- else {
- throw new BuildException("targetType " +targetType+" is not a valid type");
+ throws BuildException {
+ targetType = targetType.toLowerCase();
+ if (targetType.equals("exe") || targetType.equals("library") ||
+ targetType.equals("module") || targetType.equals("winexe")) {
+ _targetType = targetType;
+ } else {
+ throw new BuildException("targetType " + targetType + " is not a valid type");
}
}
-
+
/**
- * Gets the TargetType attribute
+ * Gets the TargetType attribute
*
- * @return The TargetType value
+ * @return The TargetType value
*/
- public String getTargetType() {
- return _targetType;
- }
-
+ public String getTargetType() {
+ return _targetType;
+ }
+
/**
- * get the argument or null for no argument needed
+ * get the argument or null for no argument needed
*
- * @return The TargetType Parameter to CSC
+ * @return The TargetType Parameter to CSC
*/
protected String getTargetTypeParameter() {
- if (notEmpty(_targetType)) {
- return "/target:"+_targetType;
+ if (notEmpty(_targetType)) {
+ return "/target:" + _targetType;
} else {
return null;
}
- }
-
+ }
+
/** icon for incorporation into apps
- */
- protected File _win32icon;
-
+ */
+ protected File _win32icon;
+
/**
- * Set the win32 icon
+ * Set the win32 icon
* @param fileName path to the file. Can be relative, absolute, whatever.
*/
public void setWin32Icon(File fileName) {
_win32icon = fileName;
}
-
+
/**
- * get the argument or null for no argument needed
+ * get the argument or null for no argument needed
*
- * @return The Win32Icon Parameter to CSC
+ * @return The Win32Icon Parameter to CSC
*/
protected String getWin32IconParameter() {
- if (_win32icon!=null) {
- return "/win32icon:"+_win32icon.toString();
+ if (_win32icon != null) {
+ return "/win32icon:" + _win32icon.toString();
} else {
return null;
}
}
+
/** icon for incorporation into apps
- */
- protected File _win32res;
-
+ */
+ protected File _win32res;
+
/**
- * Set the win32 icon
+ * Set the win32 icon
* @param fileName path to the file. Can be relative, absolute, whatever.
*/
public void setWin32Res(File fileName) {
_win32res = fileName;
}
-
+
/**
- * get the argument or null for no argument needed
+ * get the argument or null for no argument needed
*
- * @return The Win32Icon Parameter to CSC
+ * @return The Win32Icon Parameter to CSC
*/
protected String getWin32ResParameter() {
- if (_win32res!=null) {
- return "/win32res:"+_win32res.toString();
+ if (_win32res != null) {
+ return "/win32res:" + _win32res.toString();
} else {
return null;
}
- }
-
- /**
+ }
+
+ /**
* utf out flag
*/
-
- protected boolean _utf8output=false;
-
+
+ protected boolean _utf8output = false;
+
/**
- * enable generation of utf8 output from the compiler.
+ * enable generation of utf8 output from the compiler.
*/
public void setUtf8Output(boolean enabled) {
- _utf8output=enabled;
+ _utf8output = enabled;
}
-
+
protected String getUtf8OutpuParameter() {
return _utf8output?"/utf8output":null;
}
-
- protected boolean _noconfig=false;
-
+
+ protected boolean _noconfig = false;
+
protected void setNoConfig(boolean enabled) {
- _noconfig=enabled;
+ _noconfig = enabled;
}
-
+
protected String getNoConfigParameter() {
return _noconfig?"/noconfig":null;
}
-
+
// /fullpaths
- protected boolean _fullpaths=false;
-
+ protected boolean _fullpaths = false;
+
public void setFullPaths(boolean enabled) {
- _fullpaths=enabled;
+ _fullpaths = enabled;
}
-
+
protected String getFullPathsParameter() {
return _fullpaths?"/fullpaths":null;
}
-
+
/** defines list
- * something like 'RELEASE;WIN32;NO_SANITY_CHECKS;;SOMETHING_ELSE'
- */
+ * something like 'RELEASE;WIN32;NO_SANITY_CHECKS;;SOMETHING_ELSE'
+ */
String _definitions;
-
+
/**
* Set the definitions
* @param list of definitions split by ; or , or even :
*/
public void setDefinitions(String params) {
- _definitions=params;
+ _definitions = params;
}
-
+
/**
- * get the argument or null for no argument needed
- *
- * @return The Definitions Parameter to CSC
- */
+ * get the argument or null for no argument needed
+ *
+ * @return The Definitions Parameter to CSC
+ */
protected String getDefinitionsParameter() {
if (notEmpty(_definitions)) {
return "/define:" + _definitions;
@@ -725,36 +733,36 @@ public class CSharp
return null;
}
}
-
- /** list of extra modules to refer to
+
+ /** list of extra modules to refer to
*
- */
+ */
String _additionalModules;
-
+
/**
* Set the definitions
* @param list of definitions split by ; or , or even :
*/
public void setAdditionalModules(String params) {
- _additionalModules=params;
+ _additionalModules = params;
}
-
+
/** get the argument or null for no argument needed
- * @return The AdditionalModules Parameter to CSC
+ * @return The AdditionalModules Parameter to CSC
*/
protected String getAdditionalModulesParameter() {
- if (notEmpty(_additionalModules)) {
+ if (notEmpty(_additionalModules)) {
return "/addmodule:" + _additionalModules;
- } else {
+ } else {
return null;
}
}
-
+
/** output file. If not supplied this is derived from the
* source file
- */
+ */
protected File _outputFile;
-
+
/**
* Set the definitions
* @param list of definitions split by ; or , or even :
@@ -762,80 +770,79 @@ public class CSharp
public void setOutputFile(File params) {
_outputFile = params;
}
-
+
/** get the argument or null for no argument needed
- * @return The OutputFile Parameter to CSC
- */
+ * @return The OutputFile Parameter to CSC
+ */
protected String getOutputFileParameter() {
if (_outputFile != null) {
File f = _outputFile;
- return "/out:"+f.toString();
- }
- else {
+ return "/out:" + f.toString();
+ } else {
return null;
}
}
-
+
/** flag to control action on execution trouble
- */
+ */
protected boolean _failOnError;
-
+
/**set fail on error flag
- * @param b The new FailOnError value
- */
- public void setFailOnError(boolean b){
- _failOnError=b;
+ * @param b The new FailOnError value
+ */
+ public void setFailOnError(boolean b) {
+ _failOnError = b;
}
-
+
/** query fail on error flag
- * @return The FailFailOnError value
- */
+ * @return The FailFailOnError value
+ */
public boolean getFailFailOnError() {
- return _failOnError;
+ return _failOnError;
}
-
- /** reset all contents.
- */
+
+ /** reset all contents.
+ */
public void Clear() {
- _targetType=null;
- _win32icon=null;
- _srcDir=null;
- _destDir=null;
- _mainClass=null;
- _unsafe=false;
- _warnLevel=3;
+ _targetType = null;
+ _win32icon = null;
+ _srcDir = null;
+ _destDir = null;
+ _mainClass = null;
+ _unsafe = false;
+ _warnLevel = 3;
_docFile = null;
- _incremental=false;
- _optimize=false;
- _debug=true;
- _references=null;
- _failOnError=true;
- _definitions=null;
- _additionalModules=null;
- _includeDefaultReferences=true;
- _extraOptions=null;
- _fullpaths=true;
- }
-
- /**
- * test for a string containing something useful
+ _incremental = false;
+ _optimize = false;
+ _debug = true;
+ _references = null;
+ _failOnError = true;
+ _definitions = null;
+ _additionalModules = null;
+ _includeDefaultReferences = true;
+ _extraOptions = null;
+ _fullpaths = true;
+ }
+
+ /**
+ * test for a string containing something useful
*
- * @param s string in
- * @return true if the argument is not null or empty
+ * @param s string in
+ * @return true if the argument is not null or empty
*/
protected boolean notEmpty(String s) {
return s != null && s.length() != 0;
}
-
+
/** do the work by building the command line and then calling it
- */
- public void execute()
- throws BuildException {
+ */
+ public void execute()
+ throws BuildException {
if (_srcDir == null) {
- _srcDir=project.resolveFile(".");
+ _srcDir = project.resolveFile(".");
}
-
- NetCommand command=new NetCommand(this,"CSC",csc_exe_name);
+
+ NetCommand command = new NetCommand(this, "CSC", csc_exe_name);
command.setFailOnError(getFailFailOnError());
//DEBUG helper
command.setTraceCommandLine(true);
@@ -853,7 +860,7 @@ public class CSharp
command.addArgument(getUnsafeParameter());
command.addArgument(getWarnLevelParameter());
command.addArgument(getWin32IconParameter());
- command.addArgument(getOutputFileParameter());
+ command.addArgument(getOutputFileParameter());
command.addArgument(getIncludeDefaultReferencesParameter());
command.addArgument(getDefaultReferenceParameter());
command.addArgument(getWin32ResParameter());
@@ -861,21 +868,21 @@ public class CSharp
command.addArgument(getNoConfigParameter());
command.addArgument(getFullPathsParameter());
command.addArgument(getExtraOptionsParameter());
-
- //get dependencies list.
+
+ //get dependencies list.
DirectoryScanner scanner = super.getDirectoryScanner(_srcDir);
String[] dependencies = scanner.getIncludedFiles();
- log("compiling "+dependencies.length+" file"+((dependencies.length==1)?"":"s"));
- String baseDir=scanner.getBasedir().toString();
+ log("compiling " + dependencies.length + " file" + ((dependencies.length == 1)?"":"s"));
+ String baseDir = scanner.getBasedir().toString();
//add to the command
for (int i = 0; i < dependencies.length; i++) {
- String targetFile=dependencies[i];
- targetFile=baseDir+File.separator+targetFile;
+ String targetFile = dependencies[i];
+ targetFile = baseDir + File.separator + targetFile;
command.addArgument(targetFile);
}
-
+
//now run the command of exe + settings + files
command.runCommand();
} // end execute
-
+
} //end class
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java
index cb6c14084..53e12b1cf 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/Ilasm.java
@@ -54,10 +54,10 @@
/* build notes
- -The reference CD to listen to while editing this file is
+ -The reference CD to listen to while editing this file is
nap: Underworld - Everything, Everything
-variable naming policy from Fowler's refactoring book.
- -tested against the PDC pre-beta of csc.exe; future versions will
+ -tested against the PDC pre-beta of csc.exe; future versions will
inevitably change things
*/
@@ -74,16 +74,15 @@ package org.apache.tools.ant.taskdefs.optional.dotnet;
import java.io.File;
-
import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
import org.apache.tools.ant.DirectoryScanner;
-
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.MatchingTask;
/**
Task to assemble .net 'Intermediate Language' files.
-The task will only work on win2K until other platforms support csc.exe or
+The task will only work on win2K until other platforms support csc.exe or
an equivalent. ilasm.exe must be on the execute path too.
@@ -95,95 +94,94 @@ even though the command line options are only vaguely
equivalent. [The low level commands take things like /OUT=file,
csc wants /out:file ... /verbose is used some places; /quiet here in
ildasm... etc.] It would be nice if someone made all the command line
-tools consistent (and not as brittle as the java cmdline tools)
+tools consistent (and not as brittle as the java cmdline tools)
-The task is a directory based task, so attributes like includes="*.il" and
-excludes="broken.il" can be used to control the files pulled in.
+The task is a directory based task, so attributes like includes="*.il" and
+excludes="broken.il" can be used to control the files pulled in.
Each file is built on its own, producing an appropriately named output file unless
manually specified with outfile
-@author Steve Loughran steve_l@iseran.com
-@version 0.2
+ @author Steve Loughran steve_l@iseran.com
+ @version 0.2
*/
public class Ilasm
- extends org.apache.tools.ant.taskdefs.MatchingTask {
+ extends MatchingTask {
/** constructor inits everything and set up the search pattern
- */
- public Ilasm () {
+ */
+ public Ilasm() {
Clear();
setIncludes(file_pattern);
}
- /** name of the executable. the .exe suffix is deliberately not included
+ /** name of the executable. the .exe suffix is deliberately not included
* in anticipation of the unix version
*/
- protected final static String exe_name="ilasm";
-
+ protected final static String exe_name = "ilasm";
+
/** what is the file extension we search on?
*/
- protected final static String file_ext="il";
-
- /** and now derive the search pattern from the extension
+ protected final static String file_ext = "il";
+
+ /** and now derive the search pattern from the extension
*/
- protected final static String file_pattern="**/*."+file_ext;
-
+ protected final static String file_pattern = "**/*." + file_ext;
+
/** title of task for external presentation
*/
- protected final static String exe_title="ilasm";
-
- /** reset all contents.
- */
+ protected final static String exe_title = "ilasm";
+
+ /** reset all contents.
+ */
public void Clear() {
- _targetType=null;
- _srcDir=null;
+ _targetType = null;
+ _srcDir = null;
_listing = false;
- _verbose=false;
- _debug=true;
- _outputFile=null;
- _failOnError=true;
- _resourceFile=null;
- _extraOptions=null;
+ _verbose = false;
+ _debug = true;
+ _outputFile = null;
+ _failOnError = true;
+ _resourceFile = null;
+ _extraOptions = null;
}
/** source directory upon which the search pattern is applied
*/
private File _srcDir;
-
+
/**
* Set the source dir to find the files to be compiled
- * @param srcDirName The new SrcDir value
+ * @param srcDirName The new SrcDir value
*/
- public void setSrcDir(File srcDirName){
+ public void setSrcDir(File srcDirName) {
_srcDir = srcDirName;
}
-
+
/** type of target. Should be one of exe|library|module|winexe|(null)
- default is exe; the actual value (if not null) is fed to the command line.
-
See /target
+ default is exe; the actual value (if not null) is fed to the command line.
+
See /target
*/
protected String _targetType;
-
+
/** define the target
* @param targetType one of exe|library|
- * @exception BuildException if target is not one of exe|library|module|winexe
+ * @exception BuildException if target is not one of exe|library|module|winexe
*/
-
+
public void setTargetType(String targetType)
- throws BuildException {
- targetType=targetType.toLowerCase();
- if(targetType.equals("exe") || targetType.equals("library")) {
- _targetType=targetType;
- }
- else {
- throw new BuildException("targetType " +targetType+" is not a valid type");
+ throws BuildException {
+ targetType = targetType.toLowerCase();
+ if (targetType.equals("exe") || targetType.equals("library")) {
+ _targetType = targetType;
+ } else {
+ throw new BuildException("targetType " + targetType + " is not a valid type");
}
}
@@ -191,97 +189,97 @@ public class Ilasm
* accessor method for target type
* @return the current target option
*/
- public String getTargetType() {
+ public String getTargetType() {
return _targetType;
- }
-
+ }
+
/** g
- * get the target type or null for no argument needed
+ * get the target type or null for no argument needed
*
- * @return The TargetTypeParameter value
- */
+ * @return The TargetTypeParameter value
+ */
protected String getTargetTypeParameter() {
- if(!notEmpty(_targetType)) {
+ if (!notEmpty(_targetType)) {
return null;
}
if (_targetType.equals("exe")) {
return "/exe";
- } else
- if (_targetType.equals("library")) {
+ } else if (_targetType.equals("library")) {
return "/dll";
} else {
return null;
}
- }
-
-
+ }
+
+
/**
- * Sets the Owner attribute
+ * Sets the Owner attribute
*
- * @param s The new Owner value
+ * @param s The new Owner value
*/
-
+
public void setOwner(String s) {
- log("This option is not supported by ILASM as of Beta-2, and will be ignored",Project.MSG_WARN);
- }
-
+ log("This option is not supported by ILASM as of Beta-2, and will be ignored", Project.MSG_WARN);
+ }
+
/** test for a string containing something useful
* @param string to test
* @returns true if the argument is not null or empty
- */
- protected boolean notEmpty(String s)
- {return s!=null && s.length()!=0;}
-
+ */
+ protected boolean notEmpty(String s) {
+ return s != null && s.length() != 0;
+ }
+
/** verbose flag
*/
protected boolean _verbose;
- /**
+ /**
* enable/disable verbose ILASM output
* @param b flag set to true for verbose on
*/
public void setVerbose(boolean b) {
- _verbose=b;
+ _verbose = b;
}
-
- /**
+
+ /**
* turn the verbose flag into a parameter for ILASM
* @return null or the appropriate command line string
*/
protected String getVerboseParameter() {
return _verbose?null:"/quiet";
- }
-
-
+ }
+
+
/** listing flag
*/
-
+
protected boolean _listing;
- /**
+ /**
* enable/disable listing
* @param b flag set to true for listing on
*/
public void setListing(boolean b) {
- _listing=b;
+ _listing = b;
}
-
- /**
+
+ /**
* turn the listing flag into a parameter for ILASM
* @return the appropriate string from the state of the listing flag
*/
protected String getListingParameter() {
return _listing?"/listing":"/nolisting";
}
-
-
+
+
/**
* output file. If not supplied this is derived from the
* source file
*/
protected File _outputFile;
-
+
/**
* Set the definitions
* @param list of definitions split by ; or , or even :
@@ -289,164 +287,167 @@ public class Ilasm
public void setOutputFile(File params) {
_outputFile = params;
}
-
+
/**
- * get the output file
+ * get the output file
* @return the argument string or null for no argument
- */
+ */
protected String getOutputFileParameter() {
- if (_outputFile==null || _outputFile.length()==0) {
+ if (_outputFile == null || _outputFile.length() == 0) {
return null;
}
File f = _outputFile;
- return "/output="+f.toString();
+ return "/output=" + f.toString();
}
-
- /** resource file (.res format) to include in the app.
+
+ /** resource file (.res format) to include in the app.
*/
protected File _resourceFile;
-
+
/**
- * Set the resource file
+ * Set the resource file
* @param fileName path to the file. Can be relative, absolute, whatever.
- */public void setResourceFile(File fileName) {
+ */
+ public void setResourceFile(File fileName) {
_resourceFile = fileName;
}
-
+
protected String getResourceFileParameter() {
- if(_resourceFile!=null) {
- return "/resource="+_resourceFile.toString();
- }
- else {
+ if (_resourceFile != null) {
+ return "/resource=" + _resourceFile.toString();
+ } else {
return null;
}
}
-
+
/** flag to control action on execution trouble
- */
+ */
protected boolean _failOnError;
-
+
/**set fail on error flag
- */
- public void setFailOnError(boolean b){
- _failOnError=b;
+ */
+ public void setFailOnError(boolean b) {
+ _failOnError = b;
}
-
+
/** query fail on error flag
- */
+ */
public boolean getFailFailOnError() {
return _failOnError;
}
-
- /** debug flag. Controls generation of debug information.
+
+ /** debug flag. Controls generation of debug information.
*/
protected boolean _debug;
-
+
/** set the debug flag on or off
* @param f on/off flag
*/
- public void setDebug(boolean f)
- {_debug=f;}
-
+ public void setDebug(boolean f) {
+ _debug = f;
+ }
+
/** query the debug flag
* @return true if debug is turned on
*/
public boolean getDebug() {
return _debug;
}
-
+
/** get the argument or null for no argument needed
- */
+ */
protected String getDebugParameter() {
return _debug?"/debug":null;
- }
+ }
/** file containing private key
- */
-
+ */
+
private File _keyfile;
-
+
public void setKeyfile(File keyfile) {
- this._keyfile=keyfile;
+ this._keyfile = keyfile;
}
/** get the argument or null for no argument needed
- */
+ */
protected String getKeyfileParameter() {
- if(_keyfile!=null) {
- return "/keyfile:"+_keyfile.toString();
+ if (_keyfile != null) {
+ return "/keyfile:" + _keyfile.toString();
} else {
- return null;
+ return null;
}
- }
-
+ }
+
/** any extra command options?
*/
protected String _extraOptions;
-
+
/**
* Sets the ExtraOptions attribute
*
- * @param extraOptions The new ExtraOptions value
+ * @param extraOptions The new ExtraOptions value
*/
- public void setExtraOptions(String extraOptions)
- {this._extraOptions=extraOptions;}
-
+ public void setExtraOptions(String extraOptions) {
+ this._extraOptions = extraOptions;
+ }
+
/**
- * Gets the ExtraOptions attribute
+ * Gets the ExtraOptions attribute
*
- * @return The ExtraOptions value
+ * @return The ExtraOptions value
*/
- public String getExtraOptions()
- {return this._extraOptions;}
-
+ public String getExtraOptions() {
+ return this._extraOptions;
+ }
+
/**
- * get any extra options or null for no argument needed
+ * get any extra options or null for no argument needed
*
- * @return The ExtraOptions Parameter to CSC
+ * @return The ExtraOptions Parameter to CSC
*/
protected String getExtraOptionsParameter() {
- if (_extraOptions!=null && _extraOptions.length()!=0) {
+ if (_extraOptions != null && _extraOptions.length() != 0) {
return _extraOptions;
} else {
return null;
}
- }
+ }
+
-
/** This is the execution entry point. Build a list of files and
* call ilasm on each of them.
* @throws BuildException if the assembly failed and FailOnError is true
*/
- public void execute()
- throws BuildException {
+ public void execute()
+ throws BuildException {
if (_srcDir == null) {
- _srcDir=project.resolveFile(".");
+ _srcDir = project.resolveFile(".");
}
-
- //get dependencies list.
+
+ //get dependencies list.
DirectoryScanner scanner = super.getDirectoryScanner(_srcDir);
String[] dependencies = scanner.getIncludedFiles();
- log("assembling "+dependencies.length+" file"+((dependencies.length==1)?"":"s"));
- String baseDir=scanner.getBasedir().toString();
+ log("assembling " + dependencies.length + " file" + ((dependencies.length == 1)?"":"s"));
+ String baseDir = scanner.getBasedir().toString();
//add to the command
for (int i = 0; i < dependencies.length; i++) {
- String targetFile=dependencies[i];
- targetFile=baseDir+File.separator+targetFile;
+ String targetFile = dependencies[i];
+ targetFile = baseDir + File.separator + targetFile;
executeOneFile(targetFile);
}
-
+
} // end execute
-
-
+
+
/**
* do the work for one file by building the command line then calling it
* @param targetFile name of the the file to assemble
* @throws BuildException if the assembly failed and FailOnError is true
*/
- public void executeOneFile(String targetFile)
- throws BuildException {
- NetCommand command=new NetCommand(this,exe_title,exe_name);
+ public void executeOneFile(String targetFile)
+ throws BuildException {
+ NetCommand command = new NetCommand(this, exe_title, exe_name);
command.setFailOnError(getFailFailOnError());
//DEBUG helper
command.setTraceCommandLine(true);
@@ -454,18 +455,18 @@ public class Ilasm
command.addArgument(getDebugParameter());
command.addArgument(getTargetTypeParameter());
command.addArgument(getListingParameter());
- command.addArgument(getOutputFileParameter());
+ command.addArgument(getOutputFileParameter());
command.addArgument(getResourceFileParameter());
command.addArgument(getVerboseParameter());
command.addArgument(getKeyfileParameter());
command.addArgument(getExtraOptionsParameter());
-
+
/* space for more argumentativeness
command.addArgument();
command.addArgument();
*/
-
+
command.addArgument(targetFile);
//now run the command of exe + settings + file
command.runCommand();
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
index 5e23fdbe7..94614c86a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/dotnet/NetCommand.java
@@ -68,10 +68,9 @@ package org.apache.tools.ant.taskdefs.optional.dotnet;
import java.io.File;
import java.io.IOException;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Execute;
import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
import org.apache.tools.ant.taskdefs.LogStreamHandler;
@@ -79,136 +78,135 @@ import org.apache.tools.ant.types.Commandline;
/**
-This is a helper class to spawn net commands out.
+This is a helper class to spawn net commands out.
In its initial form it contains no .net specifics, just contains
all the command line/exe construction stuff. However, it may be handy in future
to have a means of setting the path to point to the dotnet bin directory; in which
case the shared code should go in here.
-@author Steve Loughran steve_l@iseran.com
-@created 2000-11-01
-@version 0.3
+ @author Steve Loughran steve_l@iseran.com
+ @created 2000-11-01
+ @version 0.3
*/
public class NetCommand {
-
+
/** constructor
- @param owning task
- @param title (for logging/errors)
- @param executable. Leave off the '.exe. for future portability
- */
-
+ @param owning task
+ @param title (for logging/errors)
+ @param executable. Leave off the '.exe. for future portability
+ */
+
public NetCommand(Task owner, String title, String program) {
- _owner=owner;
- _title=title;
- _program=program;
- _commandLine=new Commandline();
+ _owner = owner;
+ _title = title;
+ _program = program;
+ _commandLine = new Commandline();
_commandLine.setExecutable(_program);
prepareExecutor();
- }
-
+ }
+
/** owner project
*/
protected Task _owner;
-
+
/** executabe
*/
protected Execute _exe;
-
+
/** what is the command line
*/
protected Commandline _commandLine;
-
+
/** title of the command
*/
protected String _title;
-
+
/** actual program to invoke
*/
protected String _program;
-
+
/** trace flag
*/
- protected boolean _traceCommandLine=false;
-
+ protected boolean _traceCommandLine = false;
+
/**
* turn tracing on or off
* @param b trace flag
*/
- public void setTraceCommandLine(boolean b){
- _traceCommandLine=b;
+ public void setTraceCommandLine(boolean b) {
+ _traceCommandLine = b;
}
-
+
/** flag to control action on execution trouble
- */
+ */
protected boolean _failOnError;
-
+
/**
* set fail on error flag
* @param b fail flag -set to true to cause an exception to be raised if
* the return value != 0
*/
- public void setFailOnError(boolean b){
- _failOnError=b;
+ public void setFailOnError(boolean b) {
+ _failOnError = b;
}
-
+
/** query fail on error flag
- */
+ */
public boolean getFailFailOnError() {
return _failOnError;
}
-
- /**
+
+ /**
* verbose text log
* @param msg string to add to log iff verbose is defined for the build
*/
- protected void logVerbose(String msg){
- _owner.getProject().log(msg,Project.MSG_VERBOSE);
- }
-
-
+ protected void logVerbose(String msg) {
+ _owner.getProject().log(msg, Project.MSG_VERBOSE);
+ }
+
+
/**
* error text log
* @param msg message to display as an error
*/
protected void logError(String msg) {
- _owner.getProject().log(msg,Project.MSG_ERR);
+ _owner.getProject().log(msg, Project.MSG_ERR);
}
-
+
/**
* add an argument to a command line; do nothing if the arg is null or empty string
- * @param argument The feature to be added to the Argument attribute
+ * @param argument The feature to be added to the Argument attribute
*/
- public void addArgument(String argument){
- if(argument!=null && argument.length()!=0) {
+ public void addArgument(String argument) {
+ if (argument != null && argument.length() != 0) {
_commandLine.createArgument().setValue(argument);
}
}
-
+
/**
* set up the command sequence..
*/
protected void prepareExecutor() {
// default directory to the project's base directory
File dir = _owner.getProject().getBaseDir();
- ExecuteStreamHandler handler=new LogStreamHandler(_owner,
- Project.MSG_INFO, Project.MSG_WARN);
+ ExecuteStreamHandler handler = new LogStreamHandler(_owner,
+ Project.MSG_INFO, Project.MSG_WARN);
_exe = new Execute(handler, null);
_exe.setAntRun(_owner.getProject());
_exe.setWorkingDirectory(dir);
}
-
+
/**
* Run the command using the given Execute instance.
* @throws an exception of something goes wrong and the failOnError flag is true
*/
public void runCommand()
- throws BuildException {
+ throws BuildException {
int err = -1; // assume the worst
try {
- if(_traceCommandLine) {
+ if (_traceCommandLine) {
_owner.log(_commandLine.toString());
- }
- else {
+ } else {
//in verbose mode we always log stuff
logVerbose(_commandLine.toString());
}
@@ -216,13 +214,13 @@ public class NetCommand {
err = _exe.execute();
if (err != 0) {
if (_failOnError) {
- throw new BuildException(_title+" returned: "+err, _owner.getLocation());
+ throw new BuildException(_title + " returned: " + err, _owner.getLocation());
} else {
- _owner.log(_title+" Result: " + err, Project.MSG_ERR);
+ _owner.log(_title + " Result: " + err, Project.MSG_ERR);
}
}
} catch (IOException e) {
- throw new BuildException(_title+" failed: " + e, e, _owner.getLocation());
+ throw new BuildException(_title + " failed: " + e, e, _owner.getLocation());
}
}
} //class
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
index 3969f9f98..a8dfdb15a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
@@ -65,6 +65,8 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import org.w3c.dom.Document;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -73,7 +75,6 @@ import org.apache.tools.ant.taskdefs.LogStreamHandler;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.types.Path;
-import org.w3c.dom.Document;
/**
@@ -131,7 +132,7 @@ public class CovReport extends Task {
/*
/** coverage home, mandatory */
- private File home = null;
+ private File home = null;
/** format of generated report, optional */
private String format = null;
@@ -227,7 +228,7 @@ public class CovReport extends Task {
}
//@todo to remove
- public Path createCoveragepath() {
+ public Path createCoveragepath() {
if (coveragePath == null) {
coveragePath = new Path(project);
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Triggers.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Triggers.java
index b9b9764f6..140963694 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Triggers.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Triggers.java
@@ -77,7 +77,7 @@ public class Triggers {
}
// -jp_trigger=ClassName.*():E:S,ClassName.MethodName():X:X
- public String toString() {
+ public String toString() {
StringBuffer buf = new StringBuffer();
final int size = triggers.size();
for (int i = 0; i < size; i++) {
@@ -119,7 +119,7 @@ public class Triggers {
}
// return ::[:param]
- public String toString() {
+ public String toString() {
StringBuffer buf = new StringBuffer();
buf.append(name).append(":"); //@todo name must not be null, check for it
buf.append(eventMap.get(event)).append(":");
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java
index f5e537262..c0d0663ec 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java
@@ -62,17 +62,18 @@ import java.util.Vector;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.ClassFile;
import org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.ClassPathLoader;
import org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.MethodInfo;
import org.apache.tools.ant.taskdefs.optional.sitraka.bytecode.Utils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
/**
* Little hack to process XML report from JProbe. It will fix
@@ -325,7 +326,7 @@ public class XMLReport {
Element classElem = report.createElement("class");
classElem.setAttribute("name", classFile.getName());
// source file possibly does not exist in the bytecode
- if ( null != classFile.getSourceFile() ){
+ if (null != classFile.getSourceFile()) {
classElem.setAttribute("source", classFile.getSourceFile());
}
// create the cov.data elem
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java
index 919a15747..0c7bd9cd0 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java
@@ -53,21 +53,21 @@
*/
package org.apache.tools.ant.taskdefs.optional.sitraka.bytecode;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
import java.io.BufferedInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
-import java.io.FilenameFilter;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
import java.io.FileInputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
import java.util.Enumeration;
-import java.util.StringTokenizer;
-import java.util.Vector;
import java.util.Hashtable;
import java.util.NoSuchElementException;
-import java.util.zip.ZipFile;
+import java.util.StringTokenizer;
+import java.util.Vector;
import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
/**
* Core of the bytecode analyzer. It loads classes from a given classpath.
@@ -86,10 +86,10 @@ public class ClassPathLoader {
* separated by the platform specific path separator.
* @param classPath the classpath to load all the classes from.
*/
- public ClassPathLoader(String classPath){
+ public ClassPathLoader(String classPath) {
StringTokenizer st = new StringTokenizer(classPath, File.pathSeparator);
Vector entries = new Vector();
- while (st.hasMoreTokens()){
+ while (st.hasMoreTokens()) {
File file = new File(st.nextToken());
entries.addElement(file);
}
@@ -101,9 +101,9 @@ public class ClassPathLoader {
* create a new instance with a given set of urls.
* @param entries valid file urls (either .jar, .zip or directory)
*/
- public ClassPathLoader(String[] entries){
+ public ClassPathLoader(String[] entries) {
files = new File[entries.length];
- for (int i = 0; i < entries.length; i++){
+ for (int i = 0; i < entries.length; i++) {
files[i] = new File(entries[i]);
}
}
@@ -112,7 +112,7 @@ public class ClassPathLoader {
* create a new instance with a given set of urls
* @param entries file urls to look for classes (.jar, .zip or directory)
*/
- public ClassPathLoader(File[] entries){
+ public ClassPathLoader(File[] entries) {
files = entries;
}
@@ -120,6 +120,7 @@ public class ClassPathLoader {
public interface FileLoader {
/** the file url that is looked for .class files */
public File getFile();
+
/** return the set of classes found in the file */
public ClassFile[] getClasses() throws IOException;
}
@@ -127,7 +128,7 @@ public class ClassPathLoader {
/**
* @return the set of FileLoader loaders matching the given classpath.
*/
- public Enumeration loaders(){
+ public Enumeration loaders() {
return new LoaderEnumeration();
}
@@ -145,18 +146,18 @@ public class ClassPathLoader {
public Hashtable getClasses() throws IOException {
Hashtable map = new Hashtable();
Enumeration enum = loaders();
- while ( enum.hasMoreElements() ){
- FileLoader loader = (FileLoader)enum.nextElement();
+ while (enum.hasMoreElements()) {
+ FileLoader loader = (FileLoader) enum.nextElement();
System.out.println("Processing " + loader.getFile());
long t0 = System.currentTimeMillis();
ClassFile[] classes = loader.getClasses();
long dt = System.currentTimeMillis() - t0;
System.out.println("" + classes.length + " classes loaded in " + dt + "ms");
- for (int j = 0; j < classes.length; j++){
+ for (int j = 0; j < classes.length; j++) {
String name = classes[j].getFullName();
// do not allow duplicates entries to preserve 'classpath' behavior
// first class in wins
- if ( !map.containsKey(name) ){
+ if (!map.containsKey(name)) {
map.put(name, classes[j]);
}
}
@@ -167,21 +168,23 @@ public class ClassPathLoader {
/** the loader enumeration that will return loaders */
protected class LoaderEnumeration implements Enumeration {
protected int index = 0;
- public boolean hasMoreElements(){
+
+ public boolean hasMoreElements() {
return index < files.length;
}
- public Object nextElement(){
- if (index >= files.length){
+
+ public Object nextElement() {
+ if (index >= files.length) {
throw new NoSuchElementException();
}
File file = files[index++];
- if ( !file.exists() ){
+ if (!file.exists()) {
return new NullLoader(file);
}
- if ( file.isDirectory() ){
+ if (file.isDirectory()) {
// it's a directory
return new DirectoryLoader(file);
- } else if ( file.getName().endsWith(".zip") || file.getName().endsWith(".jar") ){
+ } else if (file.getName().endsWith(".zip") || file.getName().endsWith(".jar")) {
// it's a jar/zip file
return new JarLoader(file);
}
@@ -212,15 +215,19 @@ public class ClassPathLoader {
/** a null loader to return when the file is not valid */
class NullLoader implements ClassPathLoader.FileLoader {
private File file;
- NullLoader(){
+
+ NullLoader() {
this(null);
}
- NullLoader(File file){
+
+ NullLoader(File file) {
this.file = file;
}
- public File getFile(){
+
+ public File getFile() {
return file;
}
+
public ClassFile[] getClasses() throws IOException {
return new ClassFile[0];
}
@@ -233,19 +240,22 @@ class NullLoader implements ClassPathLoader.FileLoader {
*/
class JarLoader implements ClassPathLoader.FileLoader {
private File file;
- JarLoader(File file){
+
+ JarLoader(File file) {
this.file = file;
}
- public File getFile(){
+
+ public File getFile() {
return file;
}
+
public ClassFile[] getClasses() throws IOException {
ZipFile zipFile = new ZipFile(file);
Vector v = new Vector();
Enumeration entries = zipFile.entries();
- while (entries.hasMoreElements()){
- ZipEntry entry = (ZipEntry)entries.nextElement();
- if (entry.getName().endsWith(".class")){
+ while (entries.hasMoreElements()) {
+ ZipEntry entry = (ZipEntry) entries.nextElement();
+ if (entry.getName().endsWith(".class")) {
InputStream is = ClassPathLoader.getCachedStream(zipFile.getInputStream(entry));
ClassFile classFile = new ClassFile(is);
is.close();
@@ -266,17 +276,19 @@ class JarLoader implements ClassPathLoader.FileLoader {
class DirectoryLoader implements ClassPathLoader.FileLoader {
private File directory;
- DirectoryLoader(File dir){
+ DirectoryLoader(File dir) {
directory = dir;
}
- public File getFile(){
+
+ public File getFile() {
return directory;
}
+
public ClassFile[] getClasses() throws IOException {
Vector v = new Vector();
- Vector files = listFiles( directory, new ClassFilter(), true);
- for (int i = 0; i < files.size(); i++){
- File file = (File)files.elementAt(i);
+ Vector files = listFiles(directory, new ClassFilter(), true);
+ for (int i = 0; i < files.size(); i++) {
+ File file = (File) files.elementAt(i);
InputStream is = null;
try {
is = ClassPathLoader.getCachedStream(new FileInputStream(file));
@@ -285,10 +297,11 @@ class DirectoryLoader implements ClassPathLoader.FileLoader {
is = null;
v.addElement(classFile);
} finally {
- if (is != null){
+ if (is != null) {
try {
is.close();
- } catch (IOException ignored){}
+ } catch (IOException ignored) {
+ }
}
}
}
@@ -306,9 +319,9 @@ class DirectoryLoader implements ClassPathLoader.FileLoader {
* @return the list of File objects that applies to the given
* filter.
*/
- public static Vector listFiles(File directory, FilenameFilter filter, boolean recurse){
- if (!directory.isDirectory()){
- throw new IllegalArgumentException(directory + " is not a directory");
+ public static Vector listFiles(File directory, FilenameFilter filter, boolean recurse) {
+ if (!directory.isDirectory()) {
+ throw new IllegalArgumentException(directory + " is not a directory");
}
Vector list = new Vector();
listFilesTo(list, directory, filter, recurse);
@@ -324,15 +337,15 @@ class DirectoryLoader implements ClassPathLoader.FileLoader {
* @param recurse tells whether or not the listing is recursive.
* @return the list instance that was passed as the list argument.
*/
- private static Vector listFilesTo(Vector list, File directory, FilenameFilter filter, boolean recurse){
+ private static Vector listFilesTo(Vector list, File directory, FilenameFilter filter, boolean recurse) {
String[] files = directory.list(filter);
- for (int i = 0; i < files.length; i++){
- list.addElement( new File(directory, files[i]) );
+ for (int i = 0; i < files.length; i++) {
+ list.addElement(new File(directory, files[i]));
}
files = null; // we don't need it anymore
- if (recurse){
- String[] subdirs = directory.list( new DirectoryFilter() );
- for (int i = 0; i < subdirs.length; i++){
+ if (recurse) {
+ String[] subdirs = directory.list(new DirectoryFilter());
+ for (int i = 0; i < subdirs.length; i++) {
listFilesTo(list, new File(directory, subdirs[i]), filter, recurse);
}
}
@@ -343,14 +356,15 @@ class DirectoryLoader implements ClassPathLoader.FileLoader {
/** Convenient filter that accepts only directory File */
class DirectoryFilter implements FilenameFilter {
- public boolean accept(File directory, String name){
+ public boolean accept(File directory, String name) {
File pathname = new File(directory, name);
return pathname.isDirectory();
}
}
+
/** convenient filter to accept only .class files */
class ClassFilter implements FilenameFilter {
- public boolean accept(File dir, String name){
+ public boolean accept(File dir, String name) {
return name.endsWith(".class");
}
}
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/MethodInfo.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/MethodInfo.java
index d822e33aa..c128c3166 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/MethodInfo.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/MethodInfo.java
@@ -78,7 +78,7 @@ public final class MethodInfo {
access_flags = dis.readShort();
int name_index = dis.readShort();
- name = Utils.getUTF8Value(constantPool, name_index);
+ name = Utils.getUTF8Value(constantPool, name_index);
int descriptor_index = dis.readShort();
descriptor = Utils.getUTF8Value(constantPool, descriptor_index);
@@ -99,7 +99,7 @@ public final class MethodInfo {
protected void readCode(ConstantPool constantPool, DataInputStream dis) throws IOException {
// skip max_stack (short), max_local (short)
- dis.skipBytes(2*2);
+ dis.skipBytes(2 * 2);
// skip bytecode...
int bytecode_len = dis.readInt();
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java
index be6f6d049..9d428901a 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/Utils.java
@@ -54,9 +54,10 @@
package org.apache.tools.ant.taskdefs.optional.sitraka.bytecode;
+import java.util.Vector;
+
import org.apache.tools.ant.taskdefs.optional.depend.constantpool.ConstantPool;
import org.apache.tools.ant.taskdefs.optional.depend.constantpool.Utf8CPInfo;
-import java.util.Vector;
/**
* Utilities mostly to manipulate methods and access flags.
@@ -92,7 +93,7 @@ public class Utils {
public final static short ACC_STRICT = 2048;
/** private constructor */
- private Utils(){
+ private Utils() {
}
/**
@@ -102,8 +103,8 @@ public class Utils {
* @return the value of the string if it exists
* @throws ClassCastException if the index is not an UTF8 constant.
*/
- public static String getUTF8Value(ConstantPool pool, int index){
- return ((Utf8CPInfo)pool.getEntry(index)).getValue();
+ public static String getUTF8Value(ConstantPool pool, int index) {
+ return ((Utf8CPInfo) pool.getEntry(index)).getValue();
}
/**
@@ -113,18 +114,18 @@ public class Utils {
* represent a java object with its fully qualified classname or the
* primitive name such as int, long, ...
*/
- public static String[] getMethodParams(String descriptor){
+ public static String[] getMethodParams(String descriptor) {
int i = 0;
- if (descriptor.charAt(i) != '('){
+ if (descriptor.charAt(i) != '(') {
throw new IllegalArgumentException("Method descriptor should start with a '('");
}
Vector params = new Vector();
StringBuffer param = new StringBuffer();
i++;
- while ( (i = descriptor2java(descriptor, i, param)) < descriptor.length() ){
+ while ((i = descriptor2java(descriptor, i, param)) < descriptor.length()) {
params.add(param.toString());
param.setLength(0); // reset
- if (descriptor.charAt(i) == ')'){
+ if (descriptor.charAt(i) == ')') {
i++;
break;
}
@@ -139,7 +140,7 @@ public class Utils {
* @param descriptor
* @return get the return type objet of a given descriptor
*/
- public static String getMethodReturnType(String descriptor){
+ public static String getMethodReturnType(String descriptor) {
int pos = descriptor.indexOf(')');
StringBuffer rettype = new StringBuffer();
descriptor2java(descriptor, pos + 1, rettype);
@@ -153,23 +154,41 @@ public class Utils {
* @param sb the stringbuffer to return the java equivalent of the symbol
* @return the index after the descriptor symbol
*/
- public static int descriptor2java(String descriptor, int i, StringBuffer sb){
+ public static int descriptor2java(String descriptor, int i, StringBuffer sb) {
// get the dimension
StringBuffer dim = new StringBuffer();
- for (;descriptor.charAt(i) == '['; i++){
+ for (; descriptor.charAt(i) == '['; i++) {
dim.append("[]");
}
// now get the type
- switch (descriptor.charAt(i)){
- case 'B': sb.append("byte"); break;
- case 'C': sb.append("char"); break;
- case 'D': sb.append("double"); break;
- case 'F': sb.append("float"); break;
- case 'I': sb.append("int"); break;
- case 'J': sb.append("long"); break;
- case 'S': sb.append("short"); break;
- case 'Z': sb.append("boolean"); break;
- case 'V': sb.append("void"); break;
+ switch (descriptor.charAt(i)) {
+ case 'B':
+ sb.append("byte");
+ break;
+ case 'C':
+ sb.append("char");
+ break;
+ case 'D':
+ sb.append("double");
+ break;
+ case 'F':
+ sb.append("float");
+ break;
+ case 'I':
+ sb.append("int");
+ break;
+ case 'J':
+ sb.append("long");
+ break;
+ case 'S':
+ sb.append("short");
+ break;
+ case 'Z':
+ sb.append("boolean");
+ break;
+ case 'V':
+ sb.append("void");
+ break;
case 'L':
// it is a class
int pos = descriptor.indexOf(';', i + 1);
@@ -196,6 +215,7 @@ public class Utils {
public static boolean isAbstract(int access_flags) {
return (access_flags & ACC_ABSTRACT) != 0;
}
+
/**
* check for public access
* @param access_flags access flags
@@ -203,6 +223,7 @@ public class Utils {
public static boolean isPublic(int access_flags) {
return (access_flags & ACC_PUBLIC) != 0;
}
+
/**
* check for a static access
* @param access_flags access flags
@@ -210,6 +231,7 @@ public class Utils {
public static boolean isStatic(int access_flags) {
return (access_flags & ACC_STATIC) != 0;
}
+
/**
* check for native access
* @param access_flags access flags
@@ -217,6 +239,7 @@ public class Utils {
public static boolean isNative(int access_flags) {
return (access_flags & ACC_NATIVE) != 0;
}
+
/**
* check for class access
* @param access_flags access flags
@@ -224,6 +247,7 @@ public class Utils {
public static boolean isClass(int access_flags) {
return !isInterface(access_flags);
}
+
/**
* check for strict access
* @param access_flags access flags
@@ -231,6 +255,7 @@ public class Utils {
public static boolean isStrict(int access_flags) {
return (access_flags & ACC_STRICT) != 0;
}
+
/**
* check for interface access
* @param access_flags access flags
@@ -238,6 +263,7 @@ public class Utils {
public static boolean isInterface(int access_flags) {
return (access_flags & ACC_INTERFACE) != 0;
}
+
/**
* check for private access
* @param access_flags access flags
@@ -245,6 +271,7 @@ public class Utils {
public static boolean isPrivate(int access_flags) {
return (access_flags & ACC_PRIVATE) != 0;
}
+
/**
* check for transient flag
* @param access_flags access flags
@@ -252,13 +279,15 @@ public class Utils {
public static boolean isTransient(int access_flags) {
return (access_flags & ACC_TRANSIENT) != 0;
}
+
/**
* check for volatile flag
* @param access_flags access flags
*/
- public static boolean isVolatile(int access_flags){
+ public static boolean isVolatile(int access_flags) {
return (access_flags & ACC_VOLATILE) != 0;
}
+
/**
* check for super flag
* @param access_flags access flag
@@ -266,6 +295,7 @@ public class Utils {
public static boolean isSuper(int access_flags) {
return (access_flags & ACC_SUPER) != 0;
}
+
/**
* check for protected flag
* @param access_flags access flags
@@ -273,6 +303,7 @@ public class Utils {
public static boolean isProtected(int access_flags) {
return (access_flags & ACC_PROTECTED) != 0;
}
+
/**
* chck for final flag
* @param access_flags access flags
@@ -280,6 +311,7 @@ public class Utils {
public static boolean isFinal(int access_flags) {
return (access_flags & ACC_FINAL) != 0;
}
+
/**
* check for synchronized flag
* @param access_flags access flags
@@ -295,26 +327,26 @@ public class Utils {
*/
public static String getMethodAccess(int access_flags) {
StringBuffer sb = new StringBuffer();
- if(isPublic(access_flags)){
+ if (isPublic(access_flags)) {
sb.append("public ");
- } else if(isPrivate(access_flags)){
+ } else if (isPrivate(access_flags)) {
sb.append("private ");
- } else if(isProtected(access_flags)){
+ } else if (isProtected(access_flags)) {
sb.append("protected ");
}
- if(isFinal(access_flags)){
+ if (isFinal(access_flags)) {
sb.append("final ");
}
- if(isStatic(access_flags)){
+ if (isStatic(access_flags)) {
sb.append("static ");
}
- if(isSynchronized(access_flags)){
+ if (isSynchronized(access_flags)) {
sb.append("synchronized ");
}
- if(isNative(access_flags)){
+ if (isNative(access_flags)) {
sb.append("native ");
}
- if(isAbstract(access_flags)){
+ if (isAbstract(access_flags)) {
sb.append("abstract ");
}
return sb.toString().trim();
@@ -327,23 +359,23 @@ public class Utils {
*/
public static String getFieldAccess(int access_flags) {
StringBuffer sb = new StringBuffer();
- if(isPublic(access_flags)){
+ if (isPublic(access_flags)) {
sb.append("public ");
- } else if(isPrivate(access_flags)){
+ } else if (isPrivate(access_flags)) {
sb.append("private ");
- } else if (isProtected(access_flags)){
+ } else if (isProtected(access_flags)) {
sb.append("protected ");
}
- if(isFinal(access_flags)){
+ if (isFinal(access_flags)) {
sb.append("final ");
}
- if(isStatic(access_flags)){
+ if (isStatic(access_flags)) {
sb.append("static ");
}
- if(isVolatile(access_flags)){
+ if (isVolatile(access_flags)) {
sb.append("volatile ");
}
- if(isTransient(access_flags)){
+ if (isTransient(access_flags)) {
sb.append("transient ");
}
return sb.toString().trim();
@@ -356,26 +388,26 @@ public class Utils {
*/
public static String getClassAccess(int access_flags) {
StringBuffer sb = new StringBuffer();
- if(isPublic(access_flags)){
+ if (isPublic(access_flags)) {
sb.append("public ");
- } else if (isProtected(access_flags)){
+ } else if (isProtected(access_flags)) {
sb.append("protected ");
- } else if (isPrivate(access_flags)){
+ } else if (isPrivate(access_flags)) {
sb.append("private ");
}
- if(isFinal(access_flags)){
+ if (isFinal(access_flags)) {
sb.append("final ");
}
- if(isSuper(access_flags)){
+ if (isSuper(access_flags)) {
sb.append("/*super*/ ");
}
- if(isInterface(access_flags)){
+ if (isInterface(access_flags)) {
sb.append("interface ");
}
- if(isAbstract(access_flags)){
+ if (isAbstract(access_flags)) {
sb.append("abstract ");
}
- if(isClass(access_flags)){
+ if (isClass(access_flags)) {
sb.append("class ");
}
return sb.toString().trim();