39 super(c); 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) constructor 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>Constructor</tt> object and creates a 60 * scope for it. 61 * @param m - A Constructor whose scope we want to obtain 62 * @return The type-variable scope for the constructor m 63 */ 64 public static ConstructorScope make(Constructor<?> c) { 65 return new ConstructorScope(c); 66 } 67 } | 39 super(c); 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) constructor 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 Constructor} object and creates a 60 * scope for it. 61 * @param c - A Constructor whose scope we want to obtain 62 * @return The type-variable scope for the constructor m 63 */ 64 public static ConstructorScope make(Constructor<?> c) { 65 return new ConstructorScope(c); 66 } 67 } |