if (numberOfDevices > 1) {
if ( !enableCompilerMode && numberOfDevices > 1) {
	public void execute() throws BuildException {		System.out.println("J2ME Polish " + VERSION );		if (!isActive()) {			return;		}		try {			if (!this.isInitialized) {				checkSettings();				initProject();				selectDevices();				this.isInitialized = true;			}			int numberOfDevices = this.devices.length;			if (this.buildSetting.isInCompilerMode()) {				System.out.println("Using J2ME Polish as compiler...");			} else if (numberOfDevices > 1) {				System.out.println("Processing [" + numberOfDevices + "] devices...");			}			boolean hasExtensions = (this.javaExtensions.length > 0);						int successCount = 0;			ArrayList failures = new ArrayList();			boolean abortOnError = this.buildSetting.abortOnError();						for ( int i=0; i < numberOfDevices; i++) {				Device device = this.devices[i];				if (numberOfDevices > 1) {					System.out.println("Building application for [" + device.getIdentifier() + "] (" + (i+1) + "/" + numberOfDevices + "):");				}				if (this.supportedLocales != null) {					for (int j = 0; j < this.supportedLocales.length; j++) {						Locale locale = this.supportedLocales[j];						System.out.println("Using locale [" + locale.toString() + "]...");						try {							execute(device, locale, hasExtensions);							successCount++;						} catch (BuildException e) {							if (abortOnError) {								throw e;							}							//e.printStackTrace();							failures.add( new FailureInfo( device, locale, e ) );						}						if (this.buildSetting.isInCompilerMode()) {							// return immediately in the compiler mode:							return;						}					}									} else {					try {						execute(device, null, hasExtensions);						successCount++;					} catch (BuildException e) {						if (abortOnError) {							throw e;						}						//e.printStackTrace();						failures.add( new FailureInfo( device, null, e ) );					}					if (this.buildSetting.isInCompilerMode()) {						// return immediately in the compiler mode:						return;					}				}				if (numberOfDevices > 1) {					// print an empty as a separator between different devices: 					System.out.println();				}			}			test();			deploy();			finishProject();						if (abortOnError || failures.size() == 0 ) {				if (numberOfDevices > 1 || successCount > 1 ) {					if ( successCount == numberOfDevices ) {						System.out.println("Successfully processed [" + numberOfDevices + "] devices.");					} else {						if ( numberOfDevices == 1 ) {							System.out.println("Successfully processed one device with [" + successCount + "] builds.");						} else {							System.out.println("Successfully processed [" + numberOfDevices + "] devices with [" + successCount + "] builds.");						}					}				}			} else {				StringBuffer buffer = new StringBuffer();				buffer.append("Processed [" ).append( numberOfDevices ).append( "] devices with [" )					.append( successCount ).append( "] successful builds and [" ).append( failures.size() ).append( "] errors:\n" );				FailureInfo[] infos  = (FailureInfo[]) failures.toArray( new FailureInfo[ failures.size() ] );				for (int i = 0; i < infos.length; i++) {					FailureInfo info = infos[i];					info.appendInfo( buffer );					buffer.append('\n');				}				String message = buffer.toString();				System.out.println( message );								Project antProject = getProject();				antProject.setProperty("j2mepolish.error", "true");				antProject.setProperty("j2mepolish.error.message",  message );								executeErrorTarget( this.buildSetting.getOnError(), null );			}		} catch (BuildException e) {			executeErrorTarget( this.buildSetting.getOnError(), e );			//e.printStackTrace();			throw e;		} catch (Exception e) {			e.printStackTrace();			executeErrorTarget( this.buildSetting.getOnError(), e );			throw new BuildException("Unable to execute J2ME Polish task: " + e.toString(), e );		}		if (this.runningEmulators != null) {			System.out.println("Waiting for emulators...");			while (this.runningEmulators.size() > 0) {				Emulator[] emulators = (Emulator[]) this.runningEmulators.toArray( new Emulator[ this.runningEmulators.size() ]);				for (int i = 0; i < emulators.length; i++) {					Emulator emulator = emulators[i];					if (emulator.isFinished()) {						this.runningEmulators.remove( emulator );					}									}				if (this.runningEmulators.size() > 0) {					try {						Thread.sleep( 2000 );					} catch (InterruptedException e1) {						// ignore					}				}			}		}	}