}
private void consumeIfTypeParameter(JavadocScanner scanner, ArrayList<IrDocFragment> fragments) {
JavadocTokenStream stream = new DefaultJavadocTokenStream(scanner);
stream.mark();
JavadocToken first = stream.nextToken();
if (first.getKind() != JavadocTokenKind.LESS) {
stream.rewind();
return;
}
JavadocToken second = stream.nextToken();
if (second.getKind() != JavadocTokenKind.IDENTIFIER) {
stream.rewind();
return;
}
JavadocToken third = stream.nextToken();
if (third.getKind() != JavadocTokenKind.GREATER) {
stream.rewind();
return;
}
stream.discard();
IrDocText open = new IrDocText(first.getText());
open.setLocation(first.getLocation());
IrDocSimpleName name = new IrDocSimpleName(second.getText());
name.setLocation(second.getLocation());
IrDocText close = new IrDocText(third.getText());
close.setLocation(third.getLocation());
fragments.add(open);
fragments.add(name);
fragments.add(close);
}