39 super(m);
40 }
41
42 // utility method; computes enclosing class, from which we can
43 // derive enclosing scope.
44 private Class<?> getEnclosingClass(){
45 return getRecvr().getDeclaringClass();
46 }
47
48 /**
49 * Overrides the abstract method in the superclass.
50 * @return the enclosing scope
51 */
52 protected Scope computeEnclosingScope() {
53 // the enclosing scope of a (generic) method is the scope of the
54 // class in which it was declared.
55 return ClassScope.make(getEnclosingClass());
56 }
57
58 /**
59 * Factory method. Takes a <tt>Method</tt> object and creates a
60 * scope for it.
61 * @param m - A Method whose scope we want to obtain
62 * @return The type-variable scope for the method m
63 */
64 public static MethodScope make(Method m) {
65 return new MethodScope(m);
66 }
67 }
|
39 super(m);
40 }
41
42 // utility method; computes enclosing class, from which we can
43 // derive enclosing scope.
44 private Class<?> getEnclosingClass(){
45 return getRecvr().getDeclaringClass();
46 }
47
48 /**
49 * Overrides the abstract method in the superclass.
50 * @return the enclosing scope
51 */
52 protected Scope computeEnclosingScope() {
53 // the enclosing scope of a (generic) method is the scope of the
54 // class in which it was declared.
55 return ClassScope.make(getEnclosingClass());
56 }
57
58 /**
59 * Factory method. Takes a {@code Method} object and creates a
60 * scope for it.
61 * @param m - A Method whose scope we want to obtain
62 * @return The type-variable scope for the method m
63 */
64 public static MethodScope make(Method m) {
65 return new MethodScope(m);
66 }
67 }
|