< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java

Print this page

198             Method method = findMatchingMethod(refType);
199             location = method.location();
200         } else {
201             // let AbsentInformationException be thrown
202             List<Location> locs = refType.locationsOfLine(lineNumber());
203             if (locs.size() == 0) {
204                 throw new LineNotFoundException();
205             }
206             // TO DO: handle multiple locations
207             location = locs.get(0);
208             if (location.method() == null) {
209                 throw new LineNotFoundException();
210             }
211         }
212         return location;
213     }
214 
215     private boolean isValidMethodName(String s) {
216         return isJavaIdentifier(s) ||
217                s.equals("<init>") ||

218                s.equals("<clinit>");
219     }
220 
221     /*
222      * Compare a method's argument types with a Vector of type names.
223      * Return true if each argument type has a name identical to the
224      * corresponding string in the vector (allowing for varars)
225      * and if the number of arguments in the method matches the
226      * number of names passed
227      */
228     private boolean compareArgTypes(Method method, List<String> nameList) {
229         List<String> argTypeNames = method.argumentTypeNames();
230 
231         // If argument counts differ, we can stop here
232         if (argTypeNames.size() != nameList.size()) {
233             return false;
234         }
235 
236         // Compare each argument type's name
237         int nTypes = argTypeNames.size();

198             Method method = findMatchingMethod(refType);
199             location = method.location();
200         } else {
201             // let AbsentInformationException be thrown
202             List<Location> locs = refType.locationsOfLine(lineNumber());
203             if (locs.size() == 0) {
204                 throw new LineNotFoundException();
205             }
206             // TO DO: handle multiple locations
207             location = locs.get(0);
208             if (location.method() == null) {
209                 throw new LineNotFoundException();
210             }
211         }
212         return location;
213     }
214 
215     private boolean isValidMethodName(String s) {
216         return isJavaIdentifier(s) ||
217                s.equals("<init>") ||
218                s.equals("<vnew>") ||
219                s.equals("<clinit>");
220     }
221 
222     /*
223      * Compare a method's argument types with a Vector of type names.
224      * Return true if each argument type has a name identical to the
225      * corresponding string in the vector (allowing for varars)
226      * and if the number of arguments in the method matches the
227      * number of names passed
228      */
229     private boolean compareArgTypes(Method method, List<String> nameList) {
230         List<String> argTypeNames = method.argumentTypeNames();
231 
232         // If argument counts differ, we can stop here
233         if (argTypeNames.size() != nameList.size()) {
234             return false;
235         }
236 
237         // Compare each argument type's name
238         int nTypes = argTypeNames.size();
< prev index next >