Skip to content

Commit

Permalink
Merge pull request #10 from Roenke/fix-compile-issues-on-idea
Browse files Browse the repository at this point in the history
Fix compile issues on idea project
  • Loading branch information
bibaev authored Apr 5, 2017
2 parents 4050c86 + e4d38cd commit 1630f78
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ apply plugin: 'java'
apply plugin: "kotlin"

group 'com.intellij.debugger.stream'
version '0.0.5'
version '0.0.6'

intellij {
type = 'IC'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ public class TraceExpressionBuilderImpl implements TraceExpressionBuilder {
private static final Logger LOG = Logger.getInstance(TraceExpressionBuilderImpl.class);

public static final String LINE_SEPARATOR = "\n";
private static final String RETURN_EXPRESSION = "new java.lang.Object[]{ info, streamResult, elapsedTime };" + LINE_SEPARATOR;

private static final String RESULT_VARIABLE_NAME = "myRes";
private static final String RESULT_VARIABLE_DECLARATION = "Object " + RESULT_VARIABLE_NAME + " = null;" + LINE_SEPARATOR;
private static final String RESULT_EXPRESSION =
RESULT_VARIABLE_NAME + " = new java.lang.Object[]{ info, streamResult, elapsedTime };" + LINE_SEPARATOR;

@NotNull
@Override
Expand All @@ -40,7 +44,9 @@ public String createTraceExpression(@NotNull StreamChain chain) {

final String tracingCall = buildStreamExpression(traceChain);

final String result = declarations + tracingCall + fillingInfoArray;
final String result = RESULT_VARIABLE_DECLARATION +
String.format("{" + LINE_SEPARATOR + "%s" + LINE_SEPARATOR + " }" + LINE_SEPARATOR + RESULT_VARIABLE_NAME,
declarations + tracingCall + fillingInfoArray);
LOG.info("stream expression to trace:" + LINE_SEPARATOR + result);
return result;
}
Expand Down Expand Up @@ -129,7 +135,7 @@ private static String buildFillInfo(StreamCallTraceHandler producerHandler,
}

builder.append("final long[] elapsedTime = new long[]{ java.lang.System.nanoTime() - startTime };" + LINE_SEPARATOR);
builder.append(RETURN_EXPRESSION);
builder.append(RESULT_EXPRESSION);

return builder.toString();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin>
<id>org.jetbrains.debugger.streams</id>
<name>Java Streams Debugger</name>
<version>0.0.5</version>
<version>0.0.6</version>
<vendor url="https://www.jetbrains.com">JetBrains</vendor>

<description><![CDATA[
Expand Down

0 comments on commit 1630f78

Please sign in to comment.