@@ -253,8 +253,7 @@ protected void addBuildListeners(Project project, boolean log) {
253
253
}
254
254
}
255
255
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 );
258
257
if (log ) {
259
258
logMessage (null , message , Project .MSG_ERR );
260
259
}
@@ -281,8 +280,9 @@ private void setProperties(Project project, boolean substituteVariables) {
281
280
// do nothing
282
281
}
283
282
}
284
- if (value != null )
283
+ if (value != null ) {
285
284
project .setUserProperty (entry .getKey (), value );
285
+ }
286
286
}
287
287
// may have properties set (always have the Ant process ID)
288
288
// using the Arguments and not the Properties page
@@ -337,17 +337,15 @@ private void setTasks(Project project) {
337
337
project .checkTaskClass (taskClass );
338
338
}
339
339
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 );
342
341
AntCorePlugin .getPlugin ().getLog ().log (status );
343
342
continue ;
344
343
}
345
344
}
346
345
project .addTaskDefinition (task .getTaskName (), taskClass );
347
346
}
348
347
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 );
351
349
AntCorePlugin .getPlugin ().getLog ().log (status );
352
350
}
353
351
}
@@ -369,8 +367,7 @@ private void setTypes(Project project) {
369
367
project .addDataTypeDefinition (type .getTypeName (), typeClass );
370
368
}
371
369
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 );
374
371
AntCorePlugin .getPlugin ().getLog ().log (status );
375
372
}
376
373
}
@@ -386,12 +383,10 @@ private void setTypes(Project project) {
386
383
protected void parseBuildFile (Project project ) {
387
384
File buildFile = new File (getBuildFileLocation ());
388
385
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 ()));
391
387
}
392
388
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 ()));
395
390
}
396
391
397
392
if (!isVersionCompatible ("1.5" )) { //$NON-NLS-1$
@@ -463,8 +458,8 @@ public List<TargetInfo> getTargets() {
463
458
}
464
459
if (!defaultFound ) {
465
460
// 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$
468
463
}
469
464
return infos ;
470
465
}
@@ -551,7 +546,7 @@ private void printArguments(Project project) {
551
546
sb .append (extraArgument );
552
547
sb .append (' ' );
553
548
}
554
- project .log (MessageFormat .format (InternalAntMessages .InternalAntRunner_Arguments , new Object [] { sb .toString ().trim () } ));
549
+ project .log (MessageFormat .format (InternalAntMessages .InternalAntRunner_Arguments , sb .toString ().trim ()));
555
550
}
556
551
557
552
private void createMonitorBuildListener (Project project ) {
@@ -680,8 +675,7 @@ private void run(List<String> argList) {
680
675
}
681
676
682
677
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 );
685
679
686
680
setTasks (getCurrentProject ());
687
681
setTypes (getCurrentProject ());
@@ -814,14 +808,12 @@ protected BuildLogger createLogger() {
814
808
buildLogger = (BuildLogger ) (Class .forName (loggerClassname ).getConstructor ().newInstance ());
815
809
}
816
810
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 );
819
812
logMessage (null , message , Project .MSG_ERR );
820
813
throw new BuildException (message , e );
821
814
}
822
815
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 );
825
817
logMessage (null , message , Project .MSG_ERR );
826
818
throw new BuildException (message , e );
827
819
}
@@ -1011,12 +1003,10 @@ protected String getAntVersionNumber() throws BuildException {
1011
1003
antVersionNumber = versionNumber ;
1012
1004
}
1013
1005
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 );
1016
1007
}
1017
1008
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 );
1020
1010
}
1021
1011
}
1022
1012
return antVersionNumber ;
@@ -1185,8 +1175,7 @@ private boolean processCommandLine(List<String> commands) {
1185
1175
}
1186
1176
catch (IOException e ) {
1187
1177
// 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 );
1190
1179
return false ;
1191
1180
}
1192
1181
@@ -1262,7 +1251,7 @@ private void processUnrecognizedTargets(List<String> commands) {
1262
1251
String target = iterator .next ();
1263
1252
if (!names .contains (target )) {
1264
1253
iterator .remove ();
1265
- String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_unknown_target , new Object [] { target } );
1254
+ String message = MessageFormat .format (InternalAntMessages .InternalAntRunner_unknown_target , target );
1266
1255
logMessage (currentProject , message , Project .MSG_WARN );
1267
1256
unknownTargetsFound = true ;
1268
1257
}
@@ -1296,7 +1285,7 @@ protected void processUnrecognizedCommands(List<String> commands) {
1296
1285
}
1297
1286
1298
1287
// 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 ));
1300
1289
logMessage (currentProject , message , Project .MSG_WARN );
1301
1290
}
1302
1291
@@ -1321,8 +1310,7 @@ protected void createLogFile(String fileName) throws FileNotFoundException, IOEx
1321
1310
// this stream is closed in the finally block of run(list)
1322
1311
out = new PrintStream (new FileOutputStream (logFile ));
1323
1312
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 );
1326
1314
if (buildLogger != null ) {
1327
1315
buildLogger .setErrorPrintStream (err );
1328
1316
buildLogger .setOutputPrintStream (out );
@@ -1456,8 +1444,7 @@ protected void loadPropertyFiles() {
1456
1444
}
1457
1445
}
1458
1446
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 ());
1461
1448
}
1462
1449
}
1463
1450
0 commit comments