Skip to content

Commit

Permalink
Fixed Issue #3 , where empty (non null) args string to java agent was…
Browse files Browse the repository at this point in the history
… considered invalid.
  • Loading branch information
giltene committed Jan 10, 2014
1 parent 51e900a commit e5b96bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/jhiccup/HiccupMeter.java
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ public static HiccupMeter commonMain(final String[] args, boolean exitOnError) {
}

public static void agentmain(String argsString, java.lang.instrument.Instrumentation inst) {
final String[] args = (argsString != null) ? argsString.split("[ ,;]+") : new String[0];
final String[] args = ((argsString != null) && !argsString.equals("")) ? argsString.split("[ ,;]+") : new String[0];
final String avoidRecursion = System.getProperty("org.jhiccup.avoidRecursion");
if (avoidRecursion != null) {
return; // If this is a -c invocation, we do not want the agent to do anything...
Expand All @@ -776,7 +776,7 @@ public static void agentmain(String argsString, java.lang.instrument.Instrumenta
}

public static void premain(String argsString, java.lang.instrument.Instrumentation inst) {
final String[] args = (argsString != null) ? argsString.split("[ ,;]+") : new String[0];
final String[] args = ((argsString != null) && !argsString.equals("")) ? argsString.split("[ ,;]+") : new String[0];
final String avoidRecursion = System.getProperty("org.jhiccup.avoidRecursion");
if (avoidRecursion != null) {
return; // If this is a -c invocation, we do not want the agent to do anything...
Expand Down

0 comments on commit e5b96bc

Please sign in to comment.