Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 215680
Collapse All | Expand All

(-)a/api.debugger.jpda/apichanges.xml (+15 lines)
 Lines 786-791    Link Here 
786
        <issue number="182439"/>
786
        <issue number="182439"/>
787
    </change>
787
    </change>
788
788
789
    <change>
790
        <api name="JPDADebuggerAPI"/>
791
        <summary>BreakpointsClassFilter provider introduced.</summary>
792
        <version major="2" minor="37"/>
793
        <date day="4" month="8" year="2012"/>
794
        <author login="mentlicher"/>
795
        <compatibility addition="yes" source="compatible" binary="compatible"/>
796
        <description>
797
            BreakpointsClassFilter introduced to provide a customized set of classes
798
            for breakpoints.
799
        </description>
800
        <class package="org.netbeans.spi.debugger.jpda" name="BreakpointsClassFilter" />
801
        <issue number="215680"/>
802
    </change>
803
789
804
790
</changes>
805
</changes>
791
806
(-)a/api.debugger.jpda/manifest.mf (-1 / +1 lines)
 Lines 1-6    Link Here 
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.api.debugger.jpda/2
2
OpenIDE-Module: org.netbeans.api.debugger.jpda/2
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/jpda/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/jpda/Bundle.properties
4
OpenIDE-Module-Specification-Version: 2.36
4
OpenIDE-Module-Specification-Version: 2.37
5
OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
5
OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
6
6
(-)a/api.debugger.jpda/src/org/netbeans/modules/debugger/jpda/apiregistry/DebuggerProcessor.java (-1 / +10 lines)
 Lines 64-69    Link Here 
64
64
65
import org.netbeans.api.debugger.jpda.JPDADebugger;
65
import org.netbeans.api.debugger.jpda.JPDADebugger;
66
import org.netbeans.spi.debugger.ContextProvider;
66
import org.netbeans.spi.debugger.ContextProvider;
67
import org.netbeans.spi.debugger.jpda.BreakpointsClassFilter;
67
import org.netbeans.spi.debugger.jpda.EditorContext;
68
import org.netbeans.spi.debugger.jpda.EditorContext;
68
import org.netbeans.spi.debugger.jpda.Evaluator;
69
import org.netbeans.spi.debugger.jpda.Evaluator;
69
import org.netbeans.spi.debugger.jpda.SmartSteppingCallback;
70
import org.netbeans.spi.debugger.jpda.SmartSteppingCallback;
 Lines 91-97    Link Here 
91
            SourcePathProvider.Registration.class.getCanonicalName(),
92
            SourcePathProvider.Registration.class.getCanonicalName(),
92
            EditorContext.Registration.class.getCanonicalName(),
93
            EditorContext.Registration.class.getCanonicalName(),
93
            VariablesFilter.Registration.class.getCanonicalName(),
94
            VariablesFilter.Registration.class.getCanonicalName(),
94
            Evaluator.Registration.class.getCanonicalName()
95
            Evaluator.Registration.class.getCanonicalName(),
96
            BreakpointsClassFilter.Registration.class.getCanonicalName()
95
        ));
97
        ));
96
    }
98
    }
97
99
 Lines 147-152    Link Here 
147
            handleEvaluatorRegistration(e, language);
149
            handleEvaluatorRegistration(e, language);
148
            cnt++;
150
            cnt++;
149
        }
151
        }
152
        for (Element e : env.getElementsAnnotatedWith(BreakpointsClassFilter.Registration.class)) {
153
            BreakpointsClassFilter.Registration reg = e.getAnnotation(BreakpointsClassFilter.Registration.class);
154
155
            final String path = reg.path();
156
            handleProviderRegistration(e, BreakpointsClassFilter.class, path);
157
            cnt++;
158
        }
150
        return cnt == annotations.size();
159
        return cnt == annotations.size();
151
    }
160
    }
152
161
(-)a/api.debugger.jpda/src/org/netbeans/spi/debugger/jpda/BreakpointsClassFilter.java (+161 lines)
Line 0    Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.spi.debugger.jpda;
43
44
import java.lang.annotation.ElementType;
45
import java.lang.annotation.Retention;
46
import java.lang.annotation.RetentionPolicy;
47
import java.lang.annotation.Target;
48
import java.util.Map;
49
import org.netbeans.api.debugger.jpda.JPDABreakpoint;
50
import org.netbeans.modules.debugger.jpda.apiregistry.DebuggerProcessor;
51
import org.netbeans.spi.debugger.ContextAwareService;
52
import org.netbeans.spi.debugger.ContextAwareSupport;
53
import org.netbeans.spi.debugger.ContextProvider;
54
55
/**
56
 * Filter of breakpoint class names.
57
 * Breakpoints have defined names of classes, which they are to be submitted for.
58
 * But there can be a need to customize the class names for a specific use.
59
 * For instance, add versioned classes for JRebel, etc.
60
 * 
61
 * @author Martin Entlicher
62
 * @since 2.37
63
 */
64
public abstract class BreakpointsClassFilter {
65
    
66
    /**
67
     * Provide a modified set of class names.
68
     * 
69
     * @param classNames The original set of class names that the breakpoint acts on
70
     * @param breakpoint The associated breakpoint
71
     * @return A modified set of class names, for which the breakpoint is to be submitted.
72
     */
73
    public abstract ClassNames filterClassNames(ClassNames classNames, JPDABreakpoint breakpoint);
74
    
75
    /**
76
     * The set of class names and excluded class names.
77
     */
78
    public static class ClassNames {
79
        
80
        private final String[] classNames;
81
        private final String[] excludedClassNames;
82
        
83
        /**
84
         * Create a new set of class names and excluded class names.
85
         * The names can start or end with '*' character.
86
         * @param classNames The (binary) class names
87
         * @param excludedClassNames The excluded (binary) class names
88
         */
89
        public ClassNames(String[] classNames, String[] excludedClassNames) {
90
            this.classNames = classNames;
91
            this.excludedClassNames = excludedClassNames;
92
        }
93
94
        /**
95
         * Get the list of class names
96
         * @return The array of (binary) class names
97
         */
98
        public String[] getClassNames() {
99
            return classNames;
100
        }
101
102
        /**
103
         * Get the list of excluded class names
104
         * @return The array of excluded (binary) class names
105
         */
106
        public String[] getExcludedClassNames() {
107
            return excludedClassNames;
108
        }
109
        
110
    }
111
    
112
    /**
113
     * Declarative registration of BreakpointsClassFilter implementation.
114
     * By marking the implementation class with this annotation,
115
     * you automatically register that implementation for use by debugger.
116
     * The class must be public and have a public constructor which takes
117
     * no arguments or takes {@link ContextProvider} as an argument.
118
     */
119
    @Retention(RetentionPolicy.SOURCE)
120
    @Target({ElementType.TYPE})
121
    public @interface Registration {
122
        
123
        /**
124
         * An optional path to register this implementation in.
125
         */
126
        String path() default "";
127
128
    }
129
130
    static class ContextAware extends BreakpointsClassFilter implements ContextAwareService<BreakpointsClassFilter> {
131
132
        private String serviceName;
133
134
        private ContextAware(String serviceName) {
135
            this.serviceName = serviceName;
136
        }
137
138
        @Override
139
        public BreakpointsClassFilter forContext(ContextProvider context) {
140
            return (BreakpointsClassFilter) ContextAwareSupport.createInstance(serviceName, context);
141
        }
142
143
        @Override
144
        public ClassNames filterClassNames(ClassNames classNames, JPDABreakpoint breakpoint) {
145
            return classNames;
146
        }
147
148
        /**
149
         * Creates instance of <code>ContextAwareService</code> based on layer.xml
150
         * attribute values
151
         *
152
         * @param attrs attributes loaded from layer.xml
153
         * @return new <code>ContextAwareService</code> instance
154
         */
155
        static ContextAwareService createService(Map attrs) throws ClassNotFoundException {
156
            String serviceName = (String) attrs.get(DebuggerProcessor.SERVICE_NAME);
157
            return new ContextAware(serviceName);
158
        }
159
160
    }
161
}
(-)a/debugger.jpda/nbproject/project.xml (+1 lines)
 Lines 64-69    Link Here 
64
                    <compile-dependency/>
64
                    <compile-dependency/>
65
                    <run-dependency>
65
                    <run-dependency>
66
                        <release-version>2</release-version>
66
                        <release-version>2</release-version>
67
                        <specification-version>2.37</specification-version>
67
                    </run-dependency>
68
                    </run-dependency>
68
                </dependency>
69
                </dependency>
69
                <dependency>
70
                <dependency>
(-)a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/breakpoints/ClassBasedBreakpoint.java (-21 / +44 lines)
 Lines 83-88    Link Here 
83
import org.netbeans.modules.debugger.jpda.jdi.request.ClassUnloadRequestWrapper;
83
import org.netbeans.modules.debugger.jpda.jdi.request.ClassUnloadRequestWrapper;
84
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
84
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
85
import org.netbeans.modules.debugger.jpda.util.JPDAUtils;
85
import org.netbeans.modules.debugger.jpda.util.JPDAUtils;
86
import org.netbeans.spi.debugger.jpda.BreakpointsClassFilter;
86
import org.netbeans.spi.debugger.jpda.SourcePathProvider;
87
import org.netbeans.spi.debugger.jpda.SourcePathProvider;
87
import org.openide.ErrorManager;
88
import org.openide.ErrorManager;
88
import org.openide.filesystems.FileUtil;
89
import org.openide.filesystems.FileUtil;
 Lines 101-106    Link Here 
101
    private final Object SOURCE_ROOT_LOCK = new Object();
102
    private final Object SOURCE_ROOT_LOCK = new Object();
102
    private SourceRootsChangedListener srChListener;
103
    private SourceRootsChangedListener srChListener;
103
    private PropertyChangeListener weakSrChListener;
104
    private PropertyChangeListener weakSrChListener;
105
    private BreakpointsClassFilter classFilter;
104
    
106
    
105
    private static final Logger logger = Logger.getLogger("org.netbeans.modules.debugger.jpda.breakpoints"); // NOI18N
107
    private static final Logger logger = Logger.getLogger("org.netbeans.modules.debugger.jpda.breakpoints"); // NOI18N
106
108
 Lines 109-115    Link Here 
109
        JPDADebuggerImpl debugger,
111
        JPDADebuggerImpl debugger,
110
        Session session
112
        Session session
111
    ) {
113
    ) {
112
        super (breakpoint, null, debugger, session);
114
        this (breakpoint, null, debugger, session);
113
    }
115
    }
114
    
116
    
115
    public ClassBasedBreakpoint (
117
    public ClassBasedBreakpoint (
 Lines 119-124    Link Here 
119
        Session session
121
        Session session
120
    ) {
122
    ) {
121
        super (breakpoint, reader, debugger, session);
123
        super (breakpoint, reader, debugger, session);
124
        classFilter = new CompoundClassFilter(session.lookup(null, BreakpointsClassFilter.class));
125
    }
126
    
127
    protected final BreakpointsClassFilter getClassFilter() {
128
        return classFilter;
122
    }
129
    }
123
    
130
    
124
    protected final void setSourceRoot(String sourceRoot) {
131
    protected final void setSourceRoot(String sourceRoot) {
 Lines 227-233    Link Here 
227
        return compareSourceRoots(sourceRoot, urlRoot);
234
        return compareSourceRoots(sourceRoot, urlRoot);
228
    }
235
    }
229
    
236
    
230
    protected void setClassRequests (
237
    protected final void setClassRequests (
231
        String[] classFilters,
238
        String[] classFilters,
232
        String[] classExclusionFilters,
239
        String[] classExclusionFilters,
233
        int breakpointType
240
        int breakpointType
 Lines 235-241    Link Here 
235
        setClassRequests(classFilters, classExclusionFilters, breakpointType, true);
242
        setClassRequests(classFilters, classExclusionFilters, breakpointType, true);
236
    }
243
    }
237
    
244
    
238
    protected void setClassRequests (
245
    protected final void setClassRequests (
239
        String[] classFilters,
246
        String[] classFilters,
240
        String[] classExclusionFilters,
247
        String[] classExclusionFilters,
241
        int breakpointType,
248
        int breakpointType,
 Lines 244-282    Link Here 
244
        try {
251
        try {
245
            if ((breakpointType & ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED) != 0
252
            if ((breakpointType & ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED) != 0
246
            ) {
253
            ) {
247
                ClassPrepareRequest cpr = EventRequestManagerWrapper.
248
                        createClassPrepareRequest (getEventRequestManager());
249
                int i, k = classFilters.length;
254
                int i, k = classFilters.length;
250
                for (i = 0; i < k; i++) {
255
                for (i = 0; i < k; i++) {
256
                    ClassPrepareRequest cpr = EventRequestManagerWrapper.
257
                            createClassPrepareRequest (getEventRequestManager());
251
                    ClassPrepareRequestWrapper.addClassFilter (cpr, classFilters [i]);
258
                    ClassPrepareRequestWrapper.addClassFilter (cpr, classFilters [i]);
252
                    if (logger.isLoggable(Level.FINE))
259
                    if (logger.isLoggable(Level.FINE))
253
                        logger.fine("Set class load request: " + classFilters [i]);
260
                        logger.fine("Set class load request: " + classFilters [i]);
261
                    for (String exclusionFilter : classExclusionFilters) {
262
                        ClassPrepareRequestWrapper.addClassExclusionFilter (cpr, exclusionFilter);
263
                        if (logger.isLoggable(Level.FINE))
264
                            logger.fine("Set class load exclusion request: " + exclusionFilter);
265
                    }
266
                    addEventRequest (cpr, ignoreHitCountOnClassLoad);
254
                }
267
                }
255
                k = classExclusionFilters.length;
256
                for (i = 0; i < k; i++) {
257
                    ClassPrepareRequestWrapper.addClassExclusionFilter (cpr, classExclusionFilters [i]);
258
                    if (logger.isLoggable(Level.FINE))
259
                        logger.fine("Set class load exclusion request: " + classExclusionFilters [i]);
260
                }
261
                addEventRequest (cpr, ignoreHitCountOnClassLoad);
262
            }
268
            }
263
            if ((breakpointType & ClassLoadUnloadBreakpoint.TYPE_CLASS_UNLOADED) != 0
269
            if ((breakpointType & ClassLoadUnloadBreakpoint.TYPE_CLASS_UNLOADED) != 0
264
            ) {
270
            ) {
265
                ClassUnloadRequest cur = EventRequestManagerWrapper.
266
                        createClassUnloadRequest (getEventRequestManager());
267
                int i, k = classFilters.length;
271
                int i, k = classFilters.length;
268
                for (i = 0; i < k; i++) {
272
                for (i = 0; i < k; i++) {
273
                    ClassUnloadRequest cur = EventRequestManagerWrapper.
274
                            createClassUnloadRequest (getEventRequestManager());
269
                    ClassUnloadRequestWrapper.addClassFilter (cur, classFilters [i]);
275
                    ClassUnloadRequestWrapper.addClassFilter (cur, classFilters [i]);
270
                    if (logger.isLoggable(Level.FINE))
276
                    if (logger.isLoggable(Level.FINE))
271
                        logger.fine("Set class unload request: " + classFilters [i]);
277
                        logger.fine("Set class unload request: " + classFilters [i]);
278
                    for (String exclusionFilter : classExclusionFilters) {
279
                        ClassUnloadRequestWrapper.addClassExclusionFilter (cur, exclusionFilter);
280
                        if (logger.isLoggable(Level.FINE))
281
                            logger.fine("Set class unload exclusion request: " + exclusionFilter);
282
                    }
283
                    addEventRequest (cur, false);
272
                }
284
                }
273
                k = classExclusionFilters.length;
274
                for (i = 0; i < k; i++) {
275
                    ClassUnloadRequestWrapper.addClassExclusionFilter (cur, classExclusionFilters [i]);
276
                    if (logger.isLoggable(Level.FINE))
277
                        logger.fine("Set class unload exclusion request: " + classExclusionFilters [i]);
278
                }
279
                addEventRequest (cur, false);
280
            }
285
            }
281
        } catch (VMDisconnectedExceptionWrapper e) {
286
        } catch (VMDisconnectedExceptionWrapper e) {
282
        } catch (InternalExceptionWrapper e) {
287
        } catch (InternalExceptionWrapper e) {
 Lines 404-408    Link Here 
404
        }
409
        }
405
        
410
        
406
    }
411
    }
412
    
413
    private class CompoundClassFilter extends BreakpointsClassFilter {
414
        
415
        private List<? extends BreakpointsClassFilter> filters;
416
        
417
        public CompoundClassFilter(List<? extends BreakpointsClassFilter> filters) {
418
            this.filters = filters;
419
        }
420
421
        @Override
422
        public ClassNames filterClassNames(ClassNames classNames, JPDABreakpoint breakpoint) {
423
            for (BreakpointsClassFilter f : filters) {
424
                classNames = f.filterClassNames(classNames, breakpoint);
425
            }
426
            return classNames;
427
        }
428
        
429
    }
407
}
430
}
408
431
(-)a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/breakpoints/ClassBreakpointImpl.java (-2 / +10 lines)
 Lines 64-69    Link Here 
64
import org.netbeans.modules.debugger.jpda.jdi.request.ClassPrepareRequestWrapper;
64
import org.netbeans.modules.debugger.jpda.jdi.request.ClassPrepareRequestWrapper;
65
import org.netbeans.modules.debugger.jpda.jdi.request.ClassUnloadRequestWrapper;
65
import org.netbeans.modules.debugger.jpda.jdi.request.ClassUnloadRequestWrapper;
66
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
66
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
67
import org.netbeans.spi.debugger.jpda.BreakpointsClassFilter.ClassNames;
67
68
68
/**
69
/**
69
* Implementation of breakpoint on method.
70
* Implementation of breakpoint on method.
 Lines 87-95    Link Here 
87
    
88
    
88
    @Override
89
    @Override
89
    protected void setRequests () {
90
    protected void setRequests () {
91
        ClassNames classNames = getClassFilter().filterClassNames(
92
                new ClassNames(
93
                    breakpoint.getClassFilters(),
94
                    breakpoint.getClassExclusionFilters()),
95
                breakpoint);
96
        String[] names = classNames.getClassNames();
97
        String[] excludedNames = classNames.getExcludedClassNames();
90
        setClassRequests (
98
        setClassRequests (
91
            breakpoint.getClassFilters (), 
99
            names,
92
            breakpoint.getClassExclusionFilters (), 
100
            excludedNames,
93
            breakpoint.getBreakpointType (),
101
            breakpoint.getBreakpointType (),
94
            false
102
            false
95
        );
103
        );
(-)a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/breakpoints/ExceptionBreakpointImpl.java (-3 / +15 lines)
 Lines 65-70    Link Here 
65
import org.netbeans.modules.debugger.jpda.jdi.event.LocatableEventWrapper;
65
import org.netbeans.modules.debugger.jpda.jdi.event.LocatableEventWrapper;
66
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
66
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
67
import org.netbeans.modules.debugger.jpda.jdi.request.ExceptionRequestWrapper;
67
import org.netbeans.modules.debugger.jpda.jdi.request.ExceptionRequestWrapper;
68
import org.netbeans.spi.debugger.jpda.BreakpointsClassFilter.ClassNames;
68
import org.openide.util.Exceptions;
69
import org.openide.util.Exceptions;
69
70
70
/**
71
/**
 Lines 86-97    Link Here 
86
    
87
    
87
    @Override
88
    @Override
88
    protected void setRequests () {
89
    protected void setRequests () {
90
        ClassNames classNames = getClassFilter().filterClassNames(
91
                new ClassNames(
92
                    new String[] {
93
                        breakpoint.getExceptionClassName()
94
                    },
95
                    new String [0]),
96
                breakpoint);
97
        String[] names = classNames.getClassNames();
98
        String[] excludedNames = classNames.getExcludedClassNames();
89
        setClassRequests (
99
        setClassRequests (
90
            new String[] {breakpoint.getExceptionClassName ()},
100
            names,
91
            new String[0],
101
            excludedNames,
92
            ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED
102
            ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED
93
        );
103
        );
94
        checkLoadedClasses (breakpoint.getExceptionClassName (), null);
104
        for (String cn : names) {
105
            checkLoadedClasses (cn, excludedNames);
106
        }
95
    }
107
    }
96
    
108
    
97
    @Override
109
    @Override
(-)a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/breakpoints/FieldBreakpointImpl.java (-3 / +16 lines)
 Lines 84-89    Link Here 
84
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
84
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
85
import org.netbeans.modules.debugger.jpda.jdi.request.WatchpointRequestWrapper;
85
import org.netbeans.modules.debugger.jpda.jdi.request.WatchpointRequestWrapper;
86
import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
86
import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
87
import org.netbeans.spi.debugger.jpda.BreakpointsClassFilter.ClassNames;
87
import org.openide.util.Exceptions;
88
import org.openide.util.Exceptions;
88
89
89
import org.openide.util.NbBundle;
90
import org.openide.util.NbBundle;
 Lines 107-112    Link Here 
107
    
108
    
108
    @Override
109
    @Override
109
    protected void setRequests () {
110
    protected void setRequests () {
111
        ClassNames classNames = getClassFilter().filterClassNames(
112
                new ClassNames(
113
                    new String[] {
114
                        breakpoint.getClassName()
115
                    },
116
                    new String [0]),
117
                breakpoint);
118
        String[] names = classNames.getClassNames();
119
        String[] excludedNames = classNames.getExcludedClassNames();
120
        
110
        boolean access = (breakpoint.getBreakpointType () & 
121
        boolean access = (breakpoint.getBreakpointType () & 
111
                          FieldBreakpoint.TYPE_ACCESS) != 0;
122
                          FieldBreakpoint.TYPE_ACCESS) != 0;
112
        try {
123
        try {
 Lines 123-133    Link Here 
123
                return ;
134
                return ;
124
            }
135
            }
125
            setClassRequests (
136
            setClassRequests (
126
                new String[] {breakpoint.getClassName ()},
137
                names,
127
                new String[0],
138
                excludedNames,
128
                ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED
139
                ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED
129
            );
140
            );
130
            checkLoadedClasses (breakpoint.getClassName (), null);
141
            for (String cn : names) {
142
                checkLoadedClasses (cn, excludedNames);
143
            }
131
        } catch (InternalExceptionWrapper e) {
144
        } catch (InternalExceptionWrapper e) {
132
        } catch (VMDisconnectedExceptionWrapper e) {
145
        } catch (VMDisconnectedExceptionWrapper e) {
133
        }
146
        }
(-)a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/breakpoints/LineBreakpointImpl.java (-5 / +15 lines)
 Lines 110-115    Link Here 
110
import org.netbeans.modules.debugger.jpda.jdi.request.BreakpointRequestWrapper;
110
import org.netbeans.modules.debugger.jpda.jdi.request.BreakpointRequestWrapper;
111
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
111
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
112
import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
112
import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
113
import org.netbeans.spi.debugger.jpda.BreakpointsClassFilter.ClassNames;
113
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
114
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
114
import org.openide.ErrorManager;
115
import org.openide.ErrorManager;
115
import org.openide.cookies.EditorCookie;
116
import org.openide.cookies.EditorCookie;
 Lines 267-280    Link Here 
267
            return ;
268
            return ;
268
        }
269
        }
269
        logger.fine("LineBreakpoint "+breakpoint+" - setting request for "+className);
270
        logger.fine("LineBreakpoint "+breakpoint+" - setting request for "+className);
271
        ClassNames classNames = getClassFilter().filterClassNames(
272
                new ClassNames(
273
                    new String[] {
274
                        className // The class name is correct even for inner classes now
275
                    },
276
                    new String [0]),
277
                breakpoint);
278
        String[] names = classNames.getClassNames();
279
        String[] excludedNames = classNames.getExcludedClassNames();
270
        setClassRequests (
280
        setClassRequests (
271
            new String[] {
281
            names,
272
                className // The class name is correct even for inner classes now
282
            excludedNames,
273
            }, 
274
            new String [0],
275
            ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED
283
            ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED
276
        );
284
        );
277
        checkLoadedClasses (className, null);
285
        for (String cn : names) {
286
            checkLoadedClasses (cn, excludedNames);
287
        }
278
    }
288
    }
279
289
280
    private void setInvalid(String reason) {
290
    private void setInvalid(String reason) {
(-)a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/breakpoints/MethodBreakpointImpl.java (-4 / +12 lines)
 Lines 94-99    Link Here 
94
import org.netbeans.modules.debugger.jpda.jdi.request.MethodEntryRequestWrapper;
94
import org.netbeans.modules.debugger.jpda.jdi.request.MethodEntryRequestWrapper;
95
import org.netbeans.modules.debugger.jpda.jdi.request.MethodExitRequestWrapper;
95
import org.netbeans.modules.debugger.jpda.jdi.request.MethodExitRequestWrapper;
96
import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
96
import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
97
import org.netbeans.spi.debugger.jpda.BreakpointsClassFilter.ClassNames;
97
import org.openide.util.Exceptions;
98
import org.openide.util.Exceptions;
98
import org.openide.util.NbBundle;
99
import org.openide.util.NbBundle;
99
100
 Lines 115-127    Link Here 
115
    
116
    
116
    @Override
117
    @Override
117
    protected void setRequests () {
118
    protected void setRequests () {
119
        ClassNames classNames = getClassFilter().filterClassNames(
120
                new ClassNames(
121
                    breakpoint.getClassFilters(),
122
                    breakpoint.getClassExclusionFilters()),
123
                breakpoint);
124
        String[] names = classNames.getClassNames();
125
        String[] excludedNames = classNames.getExcludedClassNames();
118
        setClassRequests (
126
        setClassRequests (
119
            breakpoint.getClassFilters (), 
127
            names,
120
            breakpoint.getClassExclusionFilters (), 
128
            excludedNames,
121
            ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED
129
            ClassLoadUnloadBreakpoint.TYPE_CLASS_LOADED
122
        );
130
        );
123
        for(String filter : breakpoint.getClassFilters()) {
131
        for(String filter : names) {
124
            checkLoadedClasses (filter, breakpoint.getClassExclusionFilters());
132
            checkLoadedClasses (filter, excludedNames);
125
        }
133
        }
126
    }
134
    }
127
    
135
    
(-)a/debugger.jpda/test/unit/src/org/netbeans/api/debugger/jpda/BreakpointsClassFilterTest.java (+237 lines)
Line 0    Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.api.debugger.jpda;
43
44
import java.util.ArrayList;
45
import java.util.Arrays;
46
import java.util.HashSet;
47
import java.util.List;
48
import java.util.Set;
49
import junit.framework.Test;
50
import org.netbeans.api.debugger.DebuggerManager;
51
import org.netbeans.api.debugger.jpda.event.JPDABreakpointEvent;
52
import org.netbeans.api.debugger.jpda.event.JPDABreakpointListener;
53
import org.netbeans.junit.NbTestCase;
54
import org.netbeans.spi.debugger.jpda.BreakpointsClassFilter;
55
56
/**
57
 * Test of {@link BreakpointsClassFilter}.
58
 * 
59
 * @author Martin Entlicher
60
 */
61
public class BreakpointsClassFilterTest extends NbTestCase {
62
    
63
    private static final String TEST_APP_PATH = System.getProperty ("test.dir.src") + 
64
        "org/netbeans/api/debugger/jpda/testapps/BreakpointsClassFilterApp.java";
65
    private static final String FILTER_GROUP_NAME = "filtered";
66
    private static final String APP_CLASS_NAME = "org.netbeans.api.debugger.jpda.testapps.BreakpointsClassFilterApp";
67
    private static final String APP2_CLASS_NAME = APP_CLASS_NAME + "2";
68
    
69
    private JPDASupport support;
70
    
71
    /*
72
    public static Test suite() {
73
        return JPDASupport.createTestSuite(BreakpointsClassFilterTest.class);
74
    }
75
    */
76
77
    public BreakpointsClassFilterTest(String s) {
78
        super(s);
79
    }
80
81
    /**
82
     * Two breakpoints of each kind are submitted,
83
     * the first is hit in BreakpointsClassFilterApp class only,
84
     * but the second is hit also in BreakpointsClassFilterApp2 class.
85
     * The latter has {@link #FILTER_GROUP_NAME} set as a group name to
86
     * distinguish the filtered breakpoints.
87
     * Hits in the two application classes are checked by TestBreakpointListener.
88
     * 
89
     * @throws Exception 
90
     */
91
    public void testFilteredBreakpoints() throws Exception {
92
        JPDASupport.removeAllBreakpoints ();
93
        List<JPDABreakpoint> breakpoints = new ArrayList<JPDABreakpoint>();
94
        Utils.BreakPositions bp = Utils.getBreakPositions(TEST_APP_PATH);
95
        List<LineBreakpoint> lineBreakpoints = bp.getLineBreakpoints();
96
        lineBreakpoints.get(1).setGroupName(FILTER_GROUP_NAME);
97
        
98
        MethodBreakpoint mb1 = MethodBreakpoint.create(APP_CLASS_NAME, "test");
99
        mb1.setBreakpointType(MethodBreakpoint.TYPE_METHOD_ENTRY);
100
        
101
        FieldBreakpoint fb1 = FieldBreakpoint.create(APP_CLASS_NAME, "field", FieldBreakpoint.TYPE_ACCESS);
102
        FieldBreakpoint fb2 = FieldBreakpoint.create(APP_CLASS_NAME, "field2", FieldBreakpoint.TYPE_ACCESS);
103
        fb2.setGroupName(FILTER_GROUP_NAME);
104
        
105
        ExceptionBreakpoint eb1 = ExceptionBreakpoint.create(NegativeArraySizeException.class.getName(), ExceptionBreakpoint.TYPE_EXCEPTION_CATCHED_UNCATCHED);
106
        ExceptionBreakpoint eb2 = ExceptionBreakpoint.create(ArithmeticException.class.getName(), ExceptionBreakpoint.TYPE_EXCEPTION_CATCHED_UNCATCHED);
107
        eb2.setGroupName(FILTER_GROUP_NAME);
108
        
109
        MethodBreakpoint mb2 = MethodBreakpoint.create(APP_CLASS_NAME, "test");
110
        mb2.setBreakpointType(MethodBreakpoint.TYPE_METHOD_EXIT);
111
        mb2.setGroupName(FILTER_GROUP_NAME);
112
        
113
        breakpoints.add(lineBreakpoints.get(0));
114
        breakpoints.add(mb1);
115
        breakpoints.add(fb1);
116
        breakpoints.add(eb1);
117
        breakpoints.add(lineBreakpoints.get(1));
118
        breakpoints.add(mb2);
119
        breakpoints.add(fb2);
120
        breakpoints.add(eb2);
121
        
122
        List<TestBreakpointListener> listeners = new ArrayList<TestBreakpointListener>();
123
        for (JPDABreakpoint b : breakpoints) {
124
            TestBreakpointListener tbl = new TestBreakpointListener 
125
                (b, FILTER_GROUP_NAME.equals(b.getGroupName()), breakpoints);
126
            b.addJPDABreakpointListener(tbl);
127
            DebuggerManager.getDebuggerManager ().addBreakpoint (b);
128
            listeners.add(tbl);
129
        }
130
131
        support = JPDASupport.attach (
132
            APP_CLASS_NAME
133
        );
134
        support.waitState(JPDADebugger.STATE_DISCONNECTED);
135
        assertTrue(Arrays.toString(breakpoints.toArray()), breakpoints.isEmpty());
136
        for (TestBreakpointListener l : listeners) {
137
            assertTrue(l.getMessage(), l.isOK());
138
        }
139
    }
140
    
141
    private class TestBreakpointListener implements JPDABreakpointListener {
142
        
143
        private final JPDABreakpoint breakpoint;
144
        private final boolean isFiltered;
145
        private final List<JPDABreakpoint> allBreakpoints;
146
        private Boolean ok = null;
147
        private String message = "Not hit yet.";
148
        private final Set<String> toBeHitIn;
149
        
150
        public TestBreakpointListener(JPDABreakpoint breakpoint, boolean isFiltered,
151
                                      List<JPDABreakpoint> allBreakpoints) {
152
            this.breakpoint = breakpoint;
153
            this.isFiltered = isFiltered;
154
            this.allBreakpoints = allBreakpoints;
155
            if (isFiltered) {
156
                toBeHitIn = new HashSet<String>();
157
                toBeHitIn.add(APP_CLASS_NAME);
158
                toBeHitIn.add(APP2_CLASS_NAME);
159
            } else {
160
                toBeHitIn = null;
161
            }
162
        }
163
164
        @Override
165
        public void breakpointReached(JPDABreakpointEvent event) {
166
            //System.err.println("breakpointReached("+event+", isFiltered = "+isFiltered+"), referenceType = "+event.getReferenceType());
167
            if (!isFiltered) {
168
                boolean removed = allBreakpoints.remove(breakpoint);
169
                if (ok == null && removed) {
170
                    ok = Boolean.TRUE;
171
                    message = "O.K.";
172
                } else {
173
                    if (ok != null) {
174
                        message += "Hit again at "+event.getReferenceType()+" ";
175
                        ok = Boolean.FALSE;
176
                    } else if (!removed) {
177
                        message += "BP not in list. ";
178
                        ok = Boolean.FALSE;
179
                    }
180
                }
181
            } else { // Filtered, expected to hit twice (in APP_CLASS_NAME and APP2_CLASS_NAME)
182
                //System.err.println("breakpointReached("+event+", isFiltered = "+isFiltered+"), referenceType = "+event.getReferenceType());
183
                String className = event.getReferenceType().name();//event.getThread().getClassName();
184
                boolean removed = toBeHitIn.remove(className);
185
                if (ok == null && removed && toBeHitIn.isEmpty()) {
186
                    allBreakpoints.remove(breakpoint);
187
                    ok = Boolean.TRUE;
188
                    message = "O.K.";
189
                } else {
190
                    if (!removed) {
191
                        message += "Hit again at "+className+" ";
192
                        ok = Boolean.FALSE;
193
                    }
194
                }
195
            }
196
            event.resume();
197
        }
198
        
199
        public boolean isOK() {
200
            return Boolean.TRUE.equals(ok);
201
        }
202
        
203
        public String getMessage() {
204
            return message + " " + breakpoint+" with group "+breakpoint.getGroupName();
205
        }
206
    
207
    }
208
    
209
    @BreakpointsClassFilter.Registration(path="netbeans-JPDASession")
210
    public static class TestBreakpointsClassFilter extends BreakpointsClassFilter {
211
        
212
        public TestBreakpointsClassFilter() {
213
            //System.err.println("NEW TestBreakpointsClassFilter()");
214
        }
215
216
        @Override
217
        public ClassNames filterClassNames(ClassNames classNames, JPDABreakpoint breakpoint) {
218
            //System.err.println("filterClassNames("+Arrays.toString(classNames.getClassNames()));
219
            String groupName = breakpoint.getGroupName();
220
            if (FILTER_GROUP_NAME.equals(groupName)) {
221
                String[] classes = classNames.getClassNames();
222
                String[] newClasses = new String[classes.length + 1];
223
                System.arraycopy(classes, 0, newClasses, 0, classes.length);
224
                if (breakpoint instanceof ExceptionBreakpoint) {
225
                    newClasses[classes.length] = NullPointerException.class.getName();
226
                } else {
227
                    newClasses[classes.length] = APP2_CLASS_NAME;
228
                }
229
                return new ClassNames(newClasses, classNames.getExcludedClassNames());
230
            } else {
231
                return classNames;
232
            }
233
        }
234
        
235
    }
236
    
237
}
(-)a/debugger.jpda/test/unit/src/org/netbeans/api/debugger/jpda/testapps/BreakpointsClassFilterApp.java (+89 lines)
Line 0    Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.api.debugger.jpda.testapps;
43
44
import java.util.Random;
45
46
/**
47
 * Test app for breakpoints class filters.
48
 * Some breakpoints stop in this class only, some get filter class names,
49
 * that add BreakpointsClassFilterApp2 as well.
50
 * 
51
 * @author Martin Entlicher
52
 */
53
public class BreakpointsClassFilterApp {
54
    
55
    private double field = 111.111;
56
    private double field2 = 111.111;
57
58
    /**
59
     * @param args the command line arguments
60
     */
61
    public static void main(final String[] args) {
62
        Thread t = new Thread(BreakpointsClassFilterApp2.class.getName()) {
63
            @Override public void run() {
64
                BreakpointsClassFilterApp2.main(args);
65
            }
66
        }; t.start();
67
        new BreakpointsClassFilterApp().test(t);
68
    }
69
    
70
    public double test(Thread t) {
71
        double d = 0;                                                   // LBREAKPOINT
72
        int n = new Random(Math.round(field)).nextInt();
73
        n = n - n;
74
        try {
75
            n += new Double[-10].length;
76
        } catch (NegativeArraySizeException nasex) {
77
        }
78
        d = d + field2 + Math.atan(n) + Math.PI + Math.E;                // LBREAKPOINT
79
        try {
80
            d += 1/n;
81
        } catch (ArithmeticException aex) {
82
        }
83
        try {
84
            t.join();
85
        } catch (InterruptedException ex) {
86
        }
87
        return d;
88
    }
89
}
(-)a/debugger.jpda/test/unit/src/org/netbeans/api/debugger/jpda/testapps/BreakpointsClassFilterApp2.java (+85 lines)
Line 0    Link Here 
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.api.debugger.jpda.testapps;
43
44
import java.util.Random;
45
46
/**
47
 * Test app for breakpoints class filters.
48
 * Some breakpoints get this in filter class names, causing pauses in here
49
 * even when submitted for BreakpointsClassFilterApp only.
50
 * 
51
 * @author Martin Entlicher
52
 */
53
public class BreakpointsClassFilterApp2 {
54
    
55
    private double field = 111.111;
56
    private double field2 = 111.111;
57
58
    /**
59
     * @param args the command line arguments
60
     */
61
    public static void main(String[] args) {
62
        // TODO code application logic here
63
        // Keep the identical line numbers with BreakpointsClassFilterApp
64
        
65
        
66
        
67
        new BreakpointsClassFilterApp2().test();
68
    }
69
    
70
    public double test() {
71
        double d = 0;
72
        int n = new Random(Math.round(field)).nextInt();
73
        n = n - n;
74
        try {
75
            throw new IllegalStateException("TEST");
76
        } catch (IllegalStateException nasex) {
77
        }
78
        d = d + field2 + Math.atan(n) + Math.PI + Math.E;
79
        try {
80
            Double dbl = null; d += dbl;
81
        } catch (NullPointerException npex) {
82
        }
83
        return d;
84
    }
85
}

Return to bug 215680
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo