From: <isp...@rh...> - 2008-12-15 15:59:43
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } --></style> <title>[rhq-project.org rhq] [2396] replace use of Java 6+ API (Properties.load(Reader)) with Java 5 compatible API (Properties.load(InputStream))</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>2396</dd> <dt>Author</dt> <dd>ispringer</dd> <dt>Date</dt> <dd>2008-12-15 09:59:40 -0600 (Mon, 15 Dec 2008)</dd> </dl> <h3>Log Message</h3> <pre>replace use of Java 6+ API (Properties.load(Reader)) with Java 5 compatible API (Properties.load(InputStream))</pre> <h3>Modified Paths</h3> <ul> <li><a href="#rhqtrunkmodulesenterpriseserverjarsrcmainjavaorgrhqenterpriseservercorecommServerCommunicationsServicejava">rhq/trunk/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqtrunkmodulesenterpriseserverjarsrcmainjavaorgrhqenterpriseservercorecommServerCommunicationsServicejava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java (2395 => 2396)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java 2008-12-15 15:06:15 UTC (rev 2395) +++ rhq/trunk/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java 2008-12-15 15:59:40 UTC (rev 2396) </span><span class="lines">@@ -23,7 +23,6 @@ </span><span class="cx"> import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; </span><span class="rem">-import java.io.FileReader; </span><span class="cx"> import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; </span><span class="lines">@@ -591,23 +590,23 @@ </span><span class="cx"> } public Boolean getMaintenanceModeAtStartup() { </span><span class="rem">- FileReader reader = null; </span><span class="add">+ InputStream inputStream = null; </span><span class="cx"> Boolean flag; try { File file = getServerPropertiesFile(); Properties props = new Properties(); </span><span class="rem">- reader = new FileReader(file); - props.load(reader); </span><span class="add">+ inputStream = new FileInputStream(file); + props.load(inputStream); </span><span class="cx"> flag = Boolean.parseBoolean(props.getProperty(ServerManagerLocal.MAINTENANCE_MODE_ON_STARTUP_PROPERTY, "false")); } catch (Exception e) { LOG.error("Cannot read MM-on-startup property from file, will use the sysprop instead", e); flag = Boolean.getBoolean(ServerManagerLocal.MAINTENANCE_MODE_ON_STARTUP_PROPERTY); } finally { </span><span class="rem">- if (reader != null) { </span><span class="add">+ if (inputStream != null) { </span><span class="cx"> try { </span><span class="rem">- reader.close(); - } catch (Exception e) { </span><span class="add">+ inputStream.close(); + } catch (Exception ignored) { </span><span class="cx"> } } } </span> </pre> </div> </div> </body> </html> |