private static MethodDescriptor handleNonePrefix(final MethodDescriptor descriptor) { return new MethodDescriptor( descriptor.getParamTypes().stream() .map(Processor::handleNonePrefix) .collect(Collectors.toList()), handleNonePrefix(descriptor.getReturnType()) ); }
/** * Reads the next {@link MethodDescriptor} from source. * * @return The type * @throws IllegalStateException If the descriptor is invalid */ public MethodDescriptor read() { final List<FieldType> params = new ArrayList<>(); if (this.peek() != '(') throw new IllegalStateException("Invalid descriptor provided!"); this.advance(); while (this.hasNext() && this.peek() != ')') { params.add(this.readFieldType()); } if (this.peek() != ')') throw new IllegalStateException("Invalid descriptor provided!"); this.advance(); return new MethodDescriptor(params, this.readType()); }