RFR: 8208157: requires.VMProps throws NPE for missing properties in "release" file
Hi, Could you please tale a quick look on this simple fix? diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -432,7 +432,8 @@ System.getProperty("java.home") + "/release"))) { Properties properties = new Properties(); properties.load(in); - return properties.getProperty("IMPLEMENTOR").replace("\"", ""); + String implementorProperty = properties.getProperty("IMPLEMENTOR"); + return (implementorProperty == null) ? "null" : implementorProperty.replace("\"", ""); } catch (IOException e) { e.printStackTrace(); } Thank you. Shura
looks good to me. -- Igor
On Jul 24, 2018, at 3:48 PM, Alexandre (Shura) Iline <alexandre.iline@oracle.com> wrote:
Hi,
Could you please tale a quick look on this simple fix?
diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -432,7 +432,8 @@ System.getProperty("java.home") + "/release"))) { Properties properties = new Properties(); properties.load(in); - return properties.getProperty("IMPLEMENTOR").replace("\"", ""); + String implementorProperty = properties.getProperty("IMPLEMENTOR"); + return (implementorProperty == null) ? "null" : implementorProperty.replace("\"", ""); } catch (IOException e) { e.printStackTrace(); }
Thank you.
Shura
Looks fine shura
On Jul 24, 2018, at 6:48 PM, Alexandre (Shura) Iline <alexandre.iline@oracle.com> wrote:
Hi,
Could you please tale a quick look on this simple fix?
diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -432,7 +432,8 @@ System.getProperty("java.home") + "/release"))) { Properties properties = new Properties(); properties.load(in); - return properties.getProperty("IMPLEMENTOR").replace("\"", ""); + String implementorProperty = properties.getProperty("IMPLEMENTOR"); + return (implementorProperty == null) ? "null" : implementorProperty.replace("\"", ""); } catch (IOException e) { e.printStackTrace(); }
Thank you.
Shura
<http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen@oracle.com <mailto:Lance.Andersen@oracle.com>
Looks good. /Erik On 2018-07-24 15:48, Alexandre (Shura) Iline wrote:
Hi,
Could you please tale a quick look on this simple fix?
diff --git a/test/jtreg-ext/requires/VMProps.java b/test/jtreg-ext/requires/VMProps.java --- a/test/jtreg-ext/requires/VMProps.java +++ b/test/jtreg-ext/requires/VMProps.java @@ -432,7 +432,8 @@ System.getProperty("java.home") + "/release"))) { Properties properties = new Properties(); properties.load(in); - return properties.getProperty("IMPLEMENTOR").replace("\"", ""); + String implementorProperty = properties.getProperty("IMPLEMENTOR"); + return (implementorProperty == null) ? "null" : implementorProperty.replace("\"", ""); } catch (IOException e) { e.printStackTrace(); }
Thank you.
Shura
participants (4)
-
Alexandre (Shura) Iline
-
Erik Joelsson
-
Igor Ignatyev
-
Lance Andersen