@@ -253,8 +253,7 @@ protected void addBuildListeners(Project project, boolean log) {
253253 }
254254 }
255255 catch (ClassCastException e ) {
256- String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_not_an_instance_of_apache_ant_BuildListener , new Object [] {
257- className });
256+ String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_not_an_instance_of_apache_ant_BuildListener , className );
258257 if (log ) {
259258 logMessage (null , message , Project .MSG_ERR );
260259 }
@@ -281,8 +280,9 @@ private void setProperties(Project project, boolean substituteVariables) {
281280 // do nothing
282281 }
283282 }
284- if (value != null )
283+ if (value != null ) {
285284 project .setUserProperty (entry .getKey (), value );
285+ }
286286 }
287287 // may have properties set (always have the Ant process ID)
288288 // using the Arguments and not the Properties page
@@ -337,17 +337,15 @@ private void setTasks(Project project) {
337337 project .checkTaskClass (taskClass );
338338 }
339339 catch (BuildException e ) {
340- IStatus status = new Status (IStatus .ERROR , AntCorePlugin .PI_ANTCORE , AntCorePlugin .ERROR_RUNNING_BUILD , MessageFormat .format (InternalAntMessages .InternalAntRunner_Error_setting_Ant_task , new Object [] {
341- task .getTaskName () }), e );
340+ IStatus status = new Status (IStatus .ERROR , AntCorePlugin .PI_ANTCORE , AntCorePlugin .ERROR_RUNNING_BUILD , MessageFormat .format (InternalAntMessages .InternalAntRunner_Error_setting_Ant_task , task .getTaskName ()), e );
342341 AntCorePlugin .getPlugin ().getLog ().log (status );
343342 continue ;
344343 }
345344 }
346345 project .addTaskDefinition (task .getTaskName (), taskClass );
347346 }
348347 catch (ClassNotFoundException e ) {
349- IStatus status = new Status (IStatus .ERROR , AntCorePlugin .PI_ANTCORE , AntCorePlugin .ERROR_RUNNING_BUILD , MessageFormat .format (InternalAntMessages .InternalAntRunner_Class_not_found_for_task , new Object [] {
350- task .getClassName (), task .getTaskName () }), e );
348+ IStatus status = new Status (IStatus .ERROR , AntCorePlugin .PI_ANTCORE , AntCorePlugin .ERROR_RUNNING_BUILD , MessageFormat .format (InternalAntMessages .InternalAntRunner_Class_not_found_for_task , task .getClassName (), task .getTaskName ()), e );
351349 AntCorePlugin .getPlugin ().getLog ().log (status );
352350 }
353351 }
@@ -369,8 +367,7 @@ private void setTypes(Project project) {
369367 project .addDataTypeDefinition (type .getTypeName (), typeClass );
370368 }
371369 catch (ClassNotFoundException e ) {
372- IStatus status = new Status (IStatus .ERROR , AntCorePlugin .PI_ANTCORE , AntCorePlugin .ERROR_RUNNING_BUILD , MessageFormat .format (InternalAntMessages .InternalAntRunner_Class_not_found_for_type , new Object [] {
373- type .getClassName (), type .getTypeName () }), e );
370+ IStatus status = new Status (IStatus .ERROR , AntCorePlugin .PI_ANTCORE , AntCorePlugin .ERROR_RUNNING_BUILD , MessageFormat .format (InternalAntMessages .InternalAntRunner_Class_not_found_for_type , type .getClassName (), type .getTypeName ()), e );
374371 AntCorePlugin .getPlugin ().getLog ().log (status );
375372 }
376373 }
@@ -386,12 +383,10 @@ private void setTypes(Project project) {
386383 protected void parseBuildFile (Project project ) {
387384 File buildFile = new File (getBuildFileLocation ());
388385 if (!buildFile .exists ()) {
389- throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Buildfile_does_not_exist , new Object [] {
390- buildFile .getAbsolutePath () }));
386+ throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Buildfile_does_not_exist , buildFile .getAbsolutePath ()));
391387 }
392388 if (!buildFile .isFile ()) {
393- throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Buildfile_is_not_a_file , new Object [] {
394- buildFile .getAbsolutePath () }));
389+ throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Buildfile_is_not_a_file , buildFile .getAbsolutePath ()));
395390 }
396391
397392 if (!isVersionCompatible ("1.5" )) { //$NON-NLS-1$
@@ -463,8 +458,8 @@ public List<TargetInfo> getTargets() {
463458 }
464459 if (!defaultFound ) {
465460 // default target must exist
466- throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Default_target_does_not_exist , new Object [] { "'" , //$NON-NLS-1$
467- defaultTarget , "'" } )); //$NON-NLS-1$
461+ throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Default_target_does_not_exist , "'" , //$NON-NLS-1$
462+ defaultTarget , "'" )); //$NON-NLS-1$
468463 }
469464 return infos ;
470465 }
@@ -551,7 +546,7 @@ private void printArguments(Project project) {
551546 sb .append (extraArgument );
552547 sb .append (' ' );
553548 }
554- project .log (MessageFormat .format (InternalAntMessages .InternalAntRunner_Arguments , new Object [] { sb .toString ().trim () } ));
549+ project .log (MessageFormat .format (InternalAntMessages .InternalAntRunner_Arguments , sb .toString ().trim ()));
555550 }
556551
557552 private void createMonitorBuildListener (Project project ) {
@@ -680,8 +675,7 @@ private void run(List<String> argList) {
680675 }
681676
682677 if (!projectHelp ) {
683- logMessage (currentProject , MessageFormat .format (InternalAntMessages .InternalAntRunner_Build_file , new Object [] {
684- getBuildFileLocation () }), Project .MSG_INFO );
678+ logMessage (currentProject , MessageFormat .format (InternalAntMessages .InternalAntRunner_Build_file , getBuildFileLocation ()), Project .MSG_INFO );
685679
686680 setTasks (getCurrentProject ());
687681 setTypes (getCurrentProject ());
@@ -814,14 +808,12 @@ protected BuildLogger createLogger() {
814808 buildLogger = (BuildLogger ) (Class .forName (loggerClassname ).getConstructor ().newInstance ());
815809 }
816810 catch (ClassCastException e ) {
817- String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_not_an_instance_of_apache_ant_BuildLogger , new Object [] {
818- loggerClassname });
811+ String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_not_an_instance_of_apache_ant_BuildLogger , loggerClassname );
819812 logMessage (null , message , Project .MSG_ERR );
820813 throw new BuildException (message , e );
821814 }
822815 catch (Exception e ) {
823- String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_Unable_to_instantiate_logger , new Object [] {
824- loggerClassname });
816+ String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_Unable_to_instantiate_logger , loggerClassname );
825817 logMessage (null , message , Project .MSG_ERR );
826818 throw new BuildException (message , e );
827819 }
@@ -1011,12 +1003,10 @@ protected String getAntVersionNumber() throws BuildException {
10111003 antVersionNumber = versionNumber ;
10121004 }
10131005 catch (IOException ioe ) {
1014- throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Could_not_load_the_version_information , new Object [] {
1015- ioe .getMessage () }), ioe );
1006+ throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Could_not_load_the_version_information , ioe .getMessage ()), ioe );
10161007 }
10171008 catch (NullPointerException npe ) {
1018- throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Could_not_load_the_version_information , new Object [] {
1019- npe .getMessage () }), npe );
1009+ throw new BuildException (MessageFormat .format (InternalAntMessages .InternalAntRunner_Could_not_load_the_version_information , npe .getMessage ()), npe );
10201010 }
10211011 }
10221012 return antVersionNumber ;
@@ -1185,8 +1175,7 @@ private boolean processCommandLine(List<String> commands) {
11851175 }
11861176 catch (IOException e ) {
11871177 // just log message and ignore exception
1188- logMessage (currentProject , MessageFormat .format (InternalAntMessages .InternalAntRunner_Could_not_write_to_log_file , new Object [] {
1189- arg }), Project .MSG_ERR );
1178+ logMessage (currentProject , MessageFormat .format (InternalAntMessages .InternalAntRunner_Could_not_write_to_log_file , arg ), Project .MSG_ERR );
11901179 return false ;
11911180 }
11921181
@@ -1262,7 +1251,7 @@ private void processUnrecognizedTargets(List<String> commands) {
12621251 String target = iterator .next ();
12631252 if (!names .contains (target )) {
12641253 iterator .remove ();
1265- String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_unknown_target , new Object [] { target } );
1254+ String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_unknown_target , target );
12661255 logMessage (currentProject , message , Project .MSG_WARN );
12671256 unknownTargetsFound = true ;
12681257 }
@@ -1296,7 +1285,7 @@ protected void processUnrecognizedCommands(List<String> commands) {
12961285 }
12971286
12981287 // warn of ignored commands
1299- String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_Unknown_argument , new Object [] { s .substring (1 ) } );
1288+ String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_Unknown_argument , s .substring (1 ));
13001289 logMessage (currentProject , message , Project .MSG_WARN );
13011290 }
13021291
@@ -1321,8 +1310,7 @@ protected void createLogFile(String fileName) throws FileNotFoundException, IOEx
13211310 // this stream is closed in the finally block of run(list)
13221311 out = new PrintStream (new FileOutputStream (logFile ));
13231312 err = out ;
1324- logMessage (currentProject , MessageFormat .format (InternalAntMessages .InternalAntRunner_Using_file_as_build_log , new Object [] {
1325- logFile .getCanonicalPath () }), Project .MSG_INFO );
1313+ logMessage (currentProject , MessageFormat .format (InternalAntMessages .InternalAntRunner_Using_file_as_build_log , logFile .getCanonicalPath ()), Project .MSG_INFO );
13261314 if (buildLogger != null ) {
13271315 buildLogger .setErrorPrintStream (err );
13281316 buildLogger .setOutputPrintStream (out );
@@ -1456,8 +1444,7 @@ protected void loadPropertyFiles() {
14561444 }
14571445 }
14581446 catch (IOException e ) {
1459- fEarlyErrorMessage = MessageFormat .format (InternalAntMessages .InternalAntRunner_could_not_load_property_file , new Object [] {
1460- e .getMessage () });
1447+ fEarlyErrorMessage = MessageFormat .format (InternalAntMessages .InternalAntRunner_could_not_load_property_file , e .getMessage ());
14611448 }
14621449 }
14631450
0 commit comments