src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java

Print this page

        

*** 257,269 **** break; // We don't need to worry about these case METHOD_RETURN: case FIELD: break; - case UNKNOWN: - sb.append(", position UNKNOWN!"); - break; default: Assert.error("Unknown target type: " + type); } // Append location data for generics/arrays. --- 257,266 ----
*** 426,436 **** public static TypeAnnotationPosition methodReturn(final int pos) { return methodReturn(emptyPath, null, pos); } /** ! * Create a {@code TypeAnnotationPosition} for a method receiver. * * @param location The type path. * @param onLambda The lambda for this parameter. * @param pos The position from the associated tree node. */ --- 423,433 ---- public static TypeAnnotationPosition methodReturn(final int pos) { return methodReturn(emptyPath, null, pos); } /** ! * Create a {@code TypeAnnotationPosition} for a method receiver parameter. * * @param location The type path. * @param onLambda The lambda for this parameter. * @param pos The position from the associated tree node. */
*** 443,472 **** Integer.MIN_VALUE, Integer.MIN_VALUE, location); } /** ! * Create a {@code TypeAnnotationPosition} for a method receiver. * * @param location The type path. */ public static TypeAnnotationPosition methodReceiver(final List<TypePathEntry> location) { return methodReceiver(location, null, -1); } /** ! * Create a {@code TypeAnnotationPosition} for a method receiver. * * @param pos The position from the associated tree node. */ public static TypeAnnotationPosition methodReceiver(final int pos) { return methodReceiver(emptyPath, null, pos); } /** ! * Create a {@code TypeAnnotationPosition} for a method formal parameter. * * @param location The type path. * @param onLambda The lambda for this parameter. * @param index The index of the parameter. * @param pos The position from the associated tree node. --- 440,470 ---- Integer.MIN_VALUE, Integer.MIN_VALUE, location); } /** ! * Create a {@code TypeAnnotationPosition} for a method receiver parameter. * * @param location The type path. */ public static TypeAnnotationPosition methodReceiver(final List<TypePathEntry> location) { return methodReceiver(location, null, -1); } /** ! * Create a {@code TypeAnnotationPosition} for a method receiver parameter. * * @param pos The position from the associated tree node. */ public static TypeAnnotationPosition methodReceiver(final int pos) { return methodReceiver(emptyPath, null, pos); } /** ! * Create a {@code TypeAnnotationPosition} for a method formal ! * parameter parameter. * * @param location The type path. * @param onLambda The lambda for this parameter. * @param index The index of the parameter. * @param pos The position from the associated tree node.
*** 662,675 **** * @param pos The position from the associated tree node. */ public static TypeAnnotationPosition exceptionParameter(final List<TypePathEntry> location, final JCLambda onLambda, final int pos) { return new TypeAnnotationPosition(TargetType.EXCEPTION_PARAMETER, pos, Integer.MIN_VALUE, onLambda, ! Integer.MIN_VALUE, Integer.MIN_VALUE, location); } /** * Create a {@code TypeAnnotationPosition} for an exception parameter. --- 660,674 ---- * @param pos The position from the associated tree node. */ public static TypeAnnotationPosition exceptionParameter(final List<TypePathEntry> location, final JCLambda onLambda, + final int type_index, final int pos) { return new TypeAnnotationPosition(TargetType.EXCEPTION_PARAMETER, pos, Integer.MIN_VALUE, onLambda, ! type_index, Integer.MIN_VALUE, location); } /** * Create a {@code TypeAnnotationPosition} for an exception parameter.
*** 678,698 **** * @param pos The position from the associated tree node. */ public static TypeAnnotationPosition exceptionParameter(final JCLambda onLambda, final int pos) { ! return exceptionParameter(emptyPath, onLambda, pos); } /** * Create a {@code TypeAnnotationPosition} for an exception parameter. * * @param location The type path. */ public static TypeAnnotationPosition exceptionParameter(final List<TypePathEntry> location) { ! return exceptionParameter(location, null, -1); } /** * Create a {@code TypeAnnotationPosition} for a resource variable. --- 677,697 ---- * @param pos The position from the associated tree node. */ public static TypeAnnotationPosition exceptionParameter(final JCLambda onLambda, final int pos) { ! return exceptionParameter(emptyPath, onLambda, Integer.MIN_VALUE, pos); } /** * Create a {@code TypeAnnotationPosition} for an exception parameter. * * @param location The type path. */ public static TypeAnnotationPosition exceptionParameter(final List<TypePathEntry> location) { ! return exceptionParameter(location, null, Integer.MIN_VALUE, -1); } /** * Create a {@code TypeAnnotationPosition} for a resource variable.
*** 1202,1215 **** final int parameter_index, final int bound_index) { return methodTypeParameterBound(location, null, parameter_index, bound_index, -1); } - - // Consider this deprecated on arrival. We eventually want to get - // rid of this value altogether. Do not use it for anything new. - public static final TypeAnnotationPosition unknown = - new TypeAnnotationPosition(TargetType.UNKNOWN, -1, - Integer.MIN_VALUE, null, - Integer.MIN_VALUE, Integer.MIN_VALUE, - emptyPath); } --- 1201,1206 ----