return tableViewer;
}
- class FileNameValidator implements IInputValidator
+ static class FileNameValidator implements IInputValidator
{
@Override
public String isValid(String fileName)
@Override\r
public Boolean getResult()\r
{\r
- return !this.matcher.getResult();\r
+ Boolean b = this.matcher.getResult();\r
+ if ( null == b )\r
+ {\r
+ return true;\r
+ }\r
+ \r
+ return !b;\r
}\r
\r
/* (non-Javadoc)\r
this.timeOut = timeOut;\r
this.channel = SmartDevelopmentBridge.getBridge().openChannel();\r
this.channel.configureBlocking( true );\r
- \r
// target a specific device\r
initializeDevice( channel, this.entry.getDevice().getSerialNumber() );\r
\r
channel.close();\r
throw new SyncException( RESULT_CONNECTION_ERROR );\r
}\r
- \r
final byte[] remotePath = string2bytes( this.entry.getFullPath() );\r
try\r
{\r
// create the buffer used to read.\r
// we read max SYNC_DATA_MAX, but we need 2 4 bytes at the beginning.\r
System.arraycopy( ID_DATA, 0, buffer, 0, ID_DATA.length );\r
-\r
}\r
+ \r
/* (non-Javadoc)\r
* @see java.io.OutputStream#write(int)\r
*/\r
}\r
\r
SdbHelper.write( channel, createReq(ID_QUIT, 0) );\r
+ channel.close();\r
super.close();\r
}\r
}\r
catch ( final IOException e ) {
logger.info( "Ignore exception" );
}
- finally
- {
- tryClose( inputStream );
- }
return props;
}
public void test_getBufferedImage() throws Exception {
final URL virtualJPGPathUrl = new URL(JPG_TEST_URL);
InputStream input = virtualJPGPathUrl.openStream();
- BufferedImage image = ImageUtil.getBufferedImage(input);
- Assert.assertNotNull(image);
- image.flush();
- IOUtil.tryClose(input);
+ try
+ {
+ BufferedImage image = ImageUtil.getBufferedImage(input);
+ Assert.assertNotNull(image);
+ image.flush();
+ }
+ finally
+ {
+ IOUtil.tryClose(input);
+ }
final URL virtualPNGPathUrl = new URL(TEST_URL);
input = virtualPNGPathUrl.openStream();
- image = ImageUtil.getBufferedImage(input);
- Assert.assertNotNull(image);
- image.flush();
- IOUtil.tryClose(input);
+ try
+ {
+ BufferedImage image = ImageUtil.getBufferedImage(input);
+ Assert.assertNotNull(image);
+ image.flush();
+ }
+ finally
+ {
+
+ IOUtil.tryClose(input);
+ }
}
}