diff --git a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java index 78726be196d7..56c5bbb08a36 100644 --- a/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java +++ b/java/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java @@ -24,6 +24,7 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.util.Arrays; import java.util.Collection; import java.util.Map; import java.util.WeakHashMap; @@ -67,6 +68,8 @@ public class LineBreakpoint extends JPDABreakpoint { /** Property name constant */ public static final String PROP_LINE_NUMBER = "lineNumber"; // NOI18N /** Property name constant */ + public static final String PROP_LAMBDA_INDEX = "lambdaIndex"; // NOI18N + /** Property name constant */ public static final String PROP_URL = "url"; // NOI18N /** Property name constant. */ public static final String PROP_CONDITION = "condition"; // NOI18N @@ -83,6 +86,9 @@ public class LineBreakpoint extends JPDABreakpoint { /** Property name constant */ public static final String PROP_THREAD_FILTERS = "threadFilters"; // NOI18N + /**Lambda index value meaning the debugger should stop at locations outside of any lambda.*/ + public static final int LAMBDA_INDEX_STOP_OUTSIDE = -1; + private static final Logger LOG = Logger.getLogger(LineBreakpoint.class.getName()); private String url = ""; // NOI18N @@ -94,6 +100,7 @@ public class LineBreakpoint extends JPDABreakpoint { private String className = null; private Map instanceFilters; private Map threadFilters; + private int[] lambdaIndexes = new int[0]; private LineBreakpoint (String url) { @@ -182,6 +189,29 @@ public void setLineNumber (int ln) { Integer.valueOf(ln) ); } + + public int[] getLambdaIndexes() { + return lambdaIndexes.clone(); + } + + public void setLambdaIndexes(int[] li) { + int[] old; + + li = li.clone(); + + synchronized (this) { + if (li == lambdaIndexes) { + return; + } + old = lambdaIndexes; + lambdaIndexes = li; + } + firePropertyChange ( + PROP_LAMBDA_INDEX, + old, + li + ); + } /** * Get the instance filter for a specific debugger session. @@ -423,7 +453,7 @@ public String toString () { if (fileName == null) { fileName = url; } - return "LineBreakpoint " + fileName + " : " + lineNumber; + return "LineBreakpoint " + fileName + " : " + lineNumber + (lambdaIndexes.length > 0 ? " lambda indices: " + Arrays.toString(lambdaIndexes) : ""); } private static class LineBreakpointImpl extends LineBreakpoint diff --git a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle.properties b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle.properties index fe41db22e26f..f5102fb01e63 100644 --- a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle.properties +++ b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle.properties @@ -229,6 +229,11 @@ ACSD_TF_Line_Breakpoint_Line_Number=Line number TTT_TF_Line_Breakpoint_Line_Number=Line number to stop at + L_Line_Breakpoint_Lambda_Index=Lambda &Indexes\: + ACSD_L_Line_Breakpoint_Lambda_Index=Lambda Indexes + ACSD_TF_Line_Breakpoint_Lambda_Index=Lambda Indexes + TTT_TF_Line_Breakpoint_Lambda_Index=Comma seperated lambda indexes to stop at\nempty: all locations\n-1: stop outside of lambda\n0-based index: break in that lambda expression + L_Line_Breakpoint_Condition=Co&ndition: ACSD_L_Line_Breakpoint_Condition=Condition ACSD_TF_Line_Breakpoint_Condition=Condition @@ -242,6 +247,7 @@ MSG_No_Line_Number_Spec=Line number should be specified. MSG_TooBig_Line_Number_Spec=The line number {0} is too big. Maximum line number is {1}. MSG_NonPositive_Line_Number_Spec=A positive line number should be specified. + MSG_Invalid_Lambda_Index=Lambda index {0} is not a number. MSG_Bad_Hit_Count_Filter_Spec=Wrong value of hit count filter: ''{0}''. MSG_NonPositive_Hit_Count_Filter_Spec=A positive hit count filter should be specified. @@ -317,3 +323,4 @@ ACSN_LineBreakpoint=Line Breakpoint properties ACSN_FieldBreakpoint=Field Breakpoint properties ACSN_ExceptionBreakpoint=Exception Breakpoint properties TTT_ExceptionClassName=The class name representing the exception. +ACSN_TF_Line_Breakpoint_Lambda_Index=Lambda index diff --git a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/LineBreakpointPanel.form b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/LineBreakpointPanel.form index 5ea1b1c1ff72..ff40b6edfef9 100644 --- a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/LineBreakpointPanel.form +++ b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/LineBreakpointPanel.form @@ -1,4 +1,4 @@ - +