@Override public final List<Node> getChildren() { final int size = _caseBlocks.size() + (_condition != null ? 1 : 0); final Node[] children = new Node[size]; int i = 0; if (_condition != null) { children[i++] = _condition; } for (final CaseBlock caseBlock : _caseBlocks) { children[i++] = caseBlock; } return ArrayUtilities.asUnmodifiableList(children); }
@Override public final List<Node> getChildren() { final int size = _caseBlocks.size() + (_condition != null ? 1 : 0); final Node[] children = new Node[size]; int i = 0; if (_condition != null) { children[i++] = _condition; } for (final CaseBlock caseBlock : _caseBlocks) { children[i++] = caseBlock; } return ArrayUtilities.asUnmodifiableList(children); }
public ExceptionsAttribute(final TypeReference... exceptionTypes) { super( AttributeNames.Exceptions, 2 * (1 + VerifyArgument.noNullElements(exceptionTypes, "exceptionTypes").length) ); _exceptionTypes = ArrayUtilities.asUnmodifiableList(exceptionTypes); }
protected final void setEnumConstants(final Enum... values) { VerifyArgument.notNull(values, "values"); _enumConstants = values.length == 0 ? null : ArrayUtilities.asUnmodifiableList(values); }
protected final void setEnumConstants(final Enum... values) { VerifyArgument.notNull(values, "values"); _enumConstants = values.length == 0 ? null : ArrayUtilities.asUnmodifiableList(values); }
public ExceptionsAttribute(final TypeReference... exceptionTypes) { super( AttributeNames.Exceptions, 2 * (1 + VerifyArgument.noNullElements(exceptionTypes, "exceptionTypes").length) ); _exceptionTypes = ArrayUtilities.asUnmodifiableList(exceptionTypes); }
public BootstrapMethodsAttribute(final BootstrapMethodsTableEntry... bootstrapMethods) { super(AttributeNames.BootstrapMethods, computeSize(bootstrapMethods)); _bootstrapMethods = ArrayUtilities.isNullOrEmpty(bootstrapMethods) ? Collections.<BootstrapMethodsTableEntry>emptyList() : ArrayUtilities.asUnmodifiableList(bootstrapMethods); }
public BootstrapMethodsTableEntry(final MethodHandle method, final Object... arguments) { _method = VerifyArgument.notNull(method, "method"); _arguments = ArrayUtilities.isNullOrEmpty(arguments) ? Collections.emptyList() : ArrayUtilities.asUnmodifiableList(arguments); }
public Frame(final FrameType frameType, final FrameValue[] localValues, final FrameValue[] stackValues) { _frameType = VerifyArgument.notNull(frameType, "frameType"); _localValues = ArrayUtilities.asUnmodifiableList(VerifyArgument.notNull(localValues, "localValues").clone()); _stackValues = ArrayUtilities.asUnmodifiableList(VerifyArgument.notNull(stackValues, "stackValues").clone()); }
public LineNumberTableAttribute(final LineNumberTableEntry[] entries) { super(AttributeNames.LineNumberTable, 2 + (VerifyArgument.notNull(entries, "entries").length * 4)); _entries = ArrayUtilities.asUnmodifiableList(entries.clone()); int max = Integer.MIN_VALUE; for (final LineNumberTableEntry entry : entries) { final int offset = entry.getOffset(); if (offset > max) { max = offset; } } _maxOffset = max; }
public final void setName(final String name) { if (name == null) { getChildrenByRole(Roles.IDENTIFIER).clear(); return; } final String[] parts = name.split("\\."); final Identifier[] identifiers = new Identifier[parts.length]; for (int i = 0; i < identifiers.length; i++) { identifiers[i] = Identifier.create(parts[i]); } getChildrenByRole(Roles.IDENTIFIER).replaceWith(ArrayUtilities.asUnmodifiableList(identifiers)); }
public final void setName(final String name) { if (name == null) { getChildrenByRole(Roles.IDENTIFIER).clear(); return; } final String[] parts = name.split("\\."); final Identifier[] identifiers = new Identifier[parts.length]; for (int i = 0; i < identifiers.length; i++) { identifiers[i] = Identifier.create(parts[i]); } getChildrenByRole(Roles.IDENTIFIER).replaceWith(ArrayUtilities.asUnmodifiableList(identifiers)); }
public static List<BytecodeAstLanguage> getDebugLanguages() { final AstOptimizationStep[] steps = AstOptimizationStep.values(); final BytecodeAstLanguage[] languages = new BytecodeAstLanguage[steps.length]; languages[0] = new BytecodeAstLanguage("Bytecode AST (Unoptimized)", false, steps[0]); String nextName = "Bytecode AST (Variable Splitting)"; for (int i = 1; i < languages.length; i++) { languages[i] = new BytecodeAstLanguage(nextName, true, steps[i - 1]); nextName = "Bytecode AST (After " + steps[i - 1].name() + ")"; } return ArrayUtilities.asUnmodifiableList(languages); } }
public static CustomAnnotation read(final IMetadataScope scope, final Buffer input) { final int typeToken = input.readUnsignedShort(); final int parameterCount = input.readUnsignedShort(); final TypeReference annotationType = scope.lookupType(typeToken); final AnnotationParameter[] parameters = new AnnotationParameter[parameterCount]; readParameters(parameters, scope, input, true); return new CustomAnnotation(annotationType, ArrayUtilities.asUnmodifiableList(parameters)); }
public static CustomAnnotation read(final IMetadataScope scope, final Buffer input) { final int typeToken = input.readUnsignedShort(); final int parameterCount = input.readUnsignedShort(); final TypeReference annotationType = scope.lookupType(typeToken); final AnnotationParameter[] parameters = new AnnotationParameter[parameterCount]; readParameters(parameters, scope, input, true); return new CustomAnnotation(annotationType, ArrayUtilities.asUnmodifiableList(parameters)); }
public static CustomAnnotation read(final IMetadataScope scope, final Buffer input) { final int typeToken = input.readUnsignedShort(); final int parameterCount = input.readUnsignedShort(); final TypeReference annotationType = scope.lookupType(typeToken); final AnnotationParameter[] parameters = new AnnotationParameter[parameterCount]; readParameters(parameters, scope, input, true); return new CustomAnnotation(annotationType, ArrayUtilities.asUnmodifiableList(parameters)); }
public static CustomAnnotation read(final IMetadataScope scope, final Buffer input) { final int typeToken = input.readUnsignedShort(); final int parameterCount = input.readUnsignedShort(); final TypeReference annotationType = scope.lookupType(typeToken); final AnnotationParameter[] parameters = new AnnotationParameter[parameterCount]; readParameters(parameters, scope, input, true); return new CustomAnnotation(annotationType, ArrayUtilities.asUnmodifiableList(parameters)); }
public static CustomAnnotation read(final IMetadataScope scope, final Buffer input) { final int typeToken = input.readUnsignedShort(); final int parameterCount = input.readUnsignedShort(); final TypeReference annotationType = scope.lookupType(typeToken); final AnnotationParameter[] parameters = new AnnotationParameter[parameterCount]; readParameters(parameters, scope, input, true); return new CustomAnnotation(annotationType, ArrayUtilities.asUnmodifiableList(parameters)); }
public ControlFlowGraph(final ControlFlowNode... nodes) { _nodes = ArrayUtilities.asUnmodifiableList(VerifyArgument.noNullElements(nodes, "nodes")); assert nodes.length >= 3; assert getEntryPoint().getNodeType() == ControlFlowNodeType.EntryPoint; assert getRegularExit().getNodeType() == ControlFlowNodeType.RegularExit; assert getExceptionalExit().getNodeType() == ControlFlowNodeType.ExceptionalExit; }
public ControlFlowGraph(final ControlFlowNode... nodes) { _nodes = ArrayUtilities.asUnmodifiableList(VerifyArgument.noNullElements(nodes, "nodes")); assert nodes.length >= 3; assert getEntryPoint().getNodeType() == ControlFlowNodeType.EntryPoint; assert getRegularExit().getNodeType() == ControlFlowNodeType.RegularExit; assert getExceptionalExit().getNodeType() == ControlFlowNodeType.ExceptionalExit; }