mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 12:15:00 +00:00
Pre-emptive fix for the anticipated removal of ListBuffer.lb() in javac8
This commit is contained in:
1 parent
f0cdc27a3f
commit
7fc6e70b36
14 files changed
+50
-47
No files matched your search
@@ -409,7 +409,7 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> {
|
||||
// Possibly integrate these 2 code paths.
|
||||
if (JAVAC7_DEFERRED_DIAGNOSTICS != null) {
|
||||
ListBuffer<?> deferredDiagnostics = (ListBuffer<?>) JAVAC7_DEFERRED_DIAGNOSTICS.get(log);
|
||||
ListBuffer<Object> newDeferredDiagnostics = ListBuffer.lb();
|
||||
ListBuffer<Object> newDeferredDiagnostics = new ListBuffer<Object>();
|
||||
for (Object diag : deferredDiagnostics) {
|
||||
if (!(diag instanceof JCDiagnostic)) {
|
||||
newDeferredDiagnostics.add(diag);
|
||||
|
||||
@@ -534,7 +534,7 @@ public class JavacResolution {
|
||||
|
||||
private static JCExpression genericsToJCTreeNodes(List<Type> generics, JavacAST ast, JCExpression rawTypeNode) throws TypeNotConvertibleException {
|
||||
if (generics != null && !generics.isEmpty()) {
|
||||
ListBuffer<JCExpression> args = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();
|
||||
for (Type t : generics) args.append(typeToJCTree(t, ast, true, false));
|
||||
return ast.getTreeMaker().TypeApply(rawTypeNode, args.toList());
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
|
||||
if (parent.get() instanceof JCClassDecl) {
|
||||
tdParent = parent;
|
||||
JCClassDecl td = (JCClassDecl) tdParent.get();
|
||||
ListBuffer<JavacNode> allFields = ListBuffer.lb();
|
||||
ListBuffer<JavacNode> allFields = new ListBuffer<JavacNode>();
|
||||
@SuppressWarnings("deprecation")
|
||||
boolean valuePresent = (hasAnnotation(lombok.Value.class, parent) || hasAnnotation(lombok.experimental.Value.class, parent));
|
||||
for (JavacNode fieldNode : HandleConstructor.findAllFields(tdParent)) {
|
||||
@@ -224,7 +224,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
|
||||
JCExpression call;
|
||||
JCStatement statement;
|
||||
|
||||
ListBuffer<JCExpression> args = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();
|
||||
for (Name n : fieldNames) {
|
||||
args.append(maker.Ident(n));
|
||||
}
|
||||
@@ -233,7 +233,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
|
||||
call = maker.NewClass(null, List.<JCExpression>nil(), returnType, args.toList(), null);
|
||||
statement = maker.Return(call);
|
||||
} else {
|
||||
ListBuffer<JCExpression> typeParams = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> typeParams = new ListBuffer<JCExpression>();
|
||||
for (JCTypeParameter tp : ((JCClassDecl) type.get()).typarams) {
|
||||
typeParams.append(maker.Ident(tp.name));
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> {
|
||||
private JCMethodDecl generateBuilderMethod(String builderMethodName, String builderClassName, JavacNode type, List<JCTypeParameter> typeParams) {
|
||||
JavacTreeMaker maker = type.getTreeMaker();
|
||||
|
||||
ListBuffer<JCExpression> typeArgs = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> typeArgs = new ListBuffer<JCExpression>();
|
||||
for (JCTypeParameter typeParam : typeParams) {
|
||||
typeArgs.append(maker.Ident(typeParam.name));
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ public class HandleCleanup extends JavacAnnotationHandler<Cleanup> {
|
||||
}
|
||||
|
||||
boolean seenDeclaration = false;
|
||||
ListBuffer<JCStatement> newStatements = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> tryBlock = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> newStatements = new ListBuffer<JCStatement>();
|
||||
ListBuffer<JCStatement> tryBlock = new ListBuffer<JCStatement>();
|
||||
for (JCStatement statement : statements) {
|
||||
if (!seenDeclaration) {
|
||||
if (statement == decl) seenDeclaration = true;
|
||||
|
||||
@@ -91,7 +91,7 @@ public class HandleConstructor {
|
||||
}
|
||||
|
||||
private static List<JavacNode> findRequiredFields(JavacNode typeNode) {
|
||||
ListBuffer<JavacNode> fields = ListBuffer.lb();
|
||||
ListBuffer<JavacNode> fields = new ListBuffer<JavacNode>();
|
||||
for (JavacNode child : typeNode.down()) {
|
||||
if (child.getKind() != Kind.FIELD) continue;
|
||||
JCVariableDecl fieldDecl = (JCVariableDecl) child.get();
|
||||
@@ -126,7 +126,7 @@ public class HandleConstructor {
|
||||
}
|
||||
|
||||
static List<JavacNode> findAllFields(JavacNode typeNode) {
|
||||
ListBuffer<JavacNode> fields = ListBuffer.lb();
|
||||
ListBuffer<JavacNode> fields = new ListBuffer<JavacNode>();
|
||||
for (JavacNode child : typeNode.down()) {
|
||||
if (child.getKind() != Kind.FIELD) continue;
|
||||
JCVariableDecl fieldDecl = (JCVariableDecl) child.get();
|
||||
@@ -209,7 +209,7 @@ public class HandleConstructor {
|
||||
if (fields.isEmpty()) return;
|
||||
JavacTreeMaker maker = node.getTreeMaker();
|
||||
JCExpression constructorPropertiesType = chainDots(node, "java", "beans", "ConstructorProperties");
|
||||
ListBuffer<JCExpression> fieldNames = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> fieldNames = new ListBuffer<JCExpression>();
|
||||
for (JavacNode field : fields) {
|
||||
Name fieldName = removePrefixFromField(field);
|
||||
fieldNames.append(maker.Literal(fieldName.toString()));
|
||||
@@ -225,9 +225,9 @@ public class HandleConstructor {
|
||||
boolean isEnum = (((JCClassDecl) typeNode.get()).mods.flags & Flags.ENUM) != 0;
|
||||
if (isEnum) level = AccessLevel.PRIVATE;
|
||||
|
||||
ListBuffer<JCStatement> nullChecks = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> assigns = ListBuffer.lb();
|
||||
ListBuffer<JCVariableDecl> params = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> nullChecks = new ListBuffer<JCStatement>();
|
||||
ListBuffer<JCStatement> assigns = new ListBuffer<JCStatement>();
|
||||
ListBuffer<JCVariableDecl> params = new ListBuffer<JCVariableDecl>();
|
||||
|
||||
for (JavacNode fieldNode : fields) {
|
||||
JCVariableDecl field = (JCVariableDecl) fieldNode.get();
|
||||
@@ -272,11 +272,11 @@ public class HandleConstructor {
|
||||
|
||||
JCExpression returnType, constructorType;
|
||||
|
||||
ListBuffer<JCTypeParameter> typeParams = ListBuffer.lb();
|
||||
ListBuffer<JCVariableDecl> params = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> typeArgs1 = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> typeArgs2 = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> args = ListBuffer.lb();
|
||||
ListBuffer<JCTypeParameter> typeParams = new ListBuffer<JCTypeParameter>();
|
||||
ListBuffer<JCVariableDecl> params = new ListBuffer<JCVariableDecl>();
|
||||
ListBuffer<JCExpression> typeArgs1 = new ListBuffer<JCExpression>();
|
||||
ListBuffer<JCExpression> typeArgs2 = new ListBuffer<JCExpression>();
|
||||
ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();
|
||||
|
||||
if (!type.typarams.isEmpty()) {
|
||||
for (JCTypeParameter param : type.typarams) {
|
||||
|
||||
@@ -154,7 +154,7 @@ public class HandleEqualsAndHashCode extends JavacAnnotationHandler<EqualsAndHas
|
||||
source.addWarning("Generating equals/hashCode implementation but without a call to superclass, even though this class does not extend java.lang.Object. If this is intentional, add '@EqualsAndHashCode(callSuper=false)' to your type.");
|
||||
}
|
||||
|
||||
ListBuffer<JavacNode> nodesForEquality = ListBuffer.lb();
|
||||
ListBuffer<JavacNode> nodesForEquality = new ListBuffer<JavacNode>();
|
||||
if (includes != null) {
|
||||
for (JavacNode child : typeNode.down()) {
|
||||
if (child.getKind() != Kind.FIELD) continue;
|
||||
@@ -224,7 +224,7 @@ public class HandleEqualsAndHashCode extends JavacAnnotationHandler<EqualsAndHas
|
||||
JCAnnotation overrideAnnotation = maker.Annotation(chainDots(typeNode, "java", "lang", "Override"), List.<JCExpression>nil());
|
||||
JCModifiers mods = maker.Modifiers(Flags.PUBLIC, List.of(overrideAnnotation));
|
||||
JCExpression returnType = maker.TypeIdent(CTC_INT);
|
||||
ListBuffer<JCStatement> statements = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
|
||||
|
||||
Name primeName = typeNode.toName(PRIME_NAME);
|
||||
Name resultName = typeNode.toName(RESULT_NAME);
|
||||
@@ -370,7 +370,7 @@ public class HandleEqualsAndHashCode extends JavacAnnotationHandler<EqualsAndHas
|
||||
JCExpression objectType = chainDots(typeNode, "java", "lang", "Object");
|
||||
JCExpression returnType = maker.TypeIdent(CTC_BOOLEAN);
|
||||
|
||||
ListBuffer<JCStatement> statements = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
|
||||
final List<JCVariableDecl> params = List.of(maker.VarDef(maker.Modifiers(Flags.FINAL | Flags.PARAMETER), oName, objectType, null));
|
||||
|
||||
/* if (o == this) return true; */ {
|
||||
@@ -387,8 +387,8 @@ public class HandleEqualsAndHashCode extends JavacAnnotationHandler<EqualsAndHas
|
||||
/* MyType<?> other = (MyType<?>) o; */ {
|
||||
if (!fields.isEmpty() || needsCanEqual) {
|
||||
final JCExpression selfType1, selfType2;
|
||||
ListBuffer<JCExpression> wildcards1 = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> wildcards2 = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> wildcards1 = new ListBuffer<JCExpression>();
|
||||
ListBuffer<JCExpression> wildcards2 = new ListBuffer<JCExpression>();
|
||||
for (int i = 0 ; i < type.typarams.length() ; i++) {
|
||||
wildcards1.append(maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null));
|
||||
wildcards2.append(maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null));
|
||||
|
||||
@@ -270,7 +270,7 @@ public class HandleGetter extends JavacAnnotationHandler<Getter> {
|
||||
}
|
||||
|
||||
if (!delegates.isEmpty()) {
|
||||
ListBuffer<JCAnnotation> withoutDelegates = ListBuffer.lb();
|
||||
ListBuffer<JCAnnotation> withoutDelegates = new ListBuffer<JCAnnotation>();
|
||||
for (JCAnnotation annotation : fieldNode.mods.annotations) {
|
||||
if (!delegates.contains(annotation)) {
|
||||
withoutDelegates.append(annotation);
|
||||
@@ -328,7 +328,7 @@ public class HandleGetter extends JavacAnnotationHandler<Getter> {
|
||||
[END IF]
|
||||
*/
|
||||
|
||||
ListBuffer<JCStatement> statements = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
|
||||
|
||||
JCVariableDecl field = (JCVariableDecl) fieldNode.get();
|
||||
JCExpression copyOfRawFieldType = copyType(maker, field);
|
||||
@@ -356,14 +356,14 @@ public class HandleGetter extends JavacAnnotationHandler<Getter> {
|
||||
/* if (value == null) { */ {
|
||||
JCSynchronized synchronizedStatement;
|
||||
/* synchronized (this.fieldName) { */ {
|
||||
ListBuffer<JCStatement> synchronizedStatements = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> synchronizedStatements = new ListBuffer<JCStatement>();
|
||||
/* value = this.fieldName.get(); */ {
|
||||
JCExpressionStatement newAssign = maker.Exec(maker.Assign(maker.Ident(valueName), callGet(fieldNode, createFieldAccessor(maker, fieldNode, FieldAccess.ALWAYS_FIELD))));
|
||||
synchronizedStatements.append(newAssign);
|
||||
}
|
||||
|
||||
/* if (value == null) { */ {
|
||||
ListBuffer<JCStatement> innerIfStatements = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> innerIfStatements = new ListBuffer<JCStatement>();
|
||||
/* final RawValueType actualValue = INITIALIZER_EXPRESSION; */ {
|
||||
innerIfStatements.append(maker.VarDef(maker.Modifiers(Flags.FINAL), actualValueName, copyOfRawFieldType, field.init));
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ public class HandleSetter extends JavacAnnotationHandler<Setter> {
|
||||
JCExpression fieldRef = createFieldAccessor(treeMaker, field, FieldAccess.ALWAYS_FIELD);
|
||||
JCAssign assign = treeMaker.Assign(fieldRef, treeMaker.Ident(fieldDecl.name));
|
||||
|
||||
ListBuffer<JCStatement> statements = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
|
||||
List<JCAnnotation> nonNulls = findAnnotations(field, TransformationsUtil.NON_NULL_PATTERN);
|
||||
List<JCAnnotation> nullables = findAnnotations(field, TransformationsUtil.NULLABLE_PATTERN);
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ public class HandleToString extends JavacAnnotationHandler<ToString> {
|
||||
return;
|
||||
}
|
||||
|
||||
ListBuffer<JavacNode> nodesForToString = ListBuffer.lb();
|
||||
ListBuffer<JavacNode> nodesForToString = new ListBuffer<JavacNode>();
|
||||
if (includes != null) {
|
||||
for (JavacNode child : typeNode.down()) {
|
||||
if (child.getKind() != Kind.FIELD) continue;
|
||||
|
||||
@@ -207,7 +207,7 @@ public class HandleWither extends JavacAnnotationHandler<Wither> {
|
||||
|
||||
JCVariableDecl fieldDecl = (JCVariableDecl) field.get();
|
||||
|
||||
ListBuffer<JCStatement> statements = ListBuffer.lb();
|
||||
ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
|
||||
List<JCAnnotation> nonNulls = findAnnotations(field, TransformationsUtil.NON_NULL_PATTERN);
|
||||
List<JCAnnotation> nullables = findAnnotations(field, TransformationsUtil.NULLABLE_PATTERN);
|
||||
|
||||
@@ -219,7 +219,7 @@ public class HandleWither extends JavacAnnotationHandler<Wither> {
|
||||
JCExpression selfType = cloneSelfType(field);
|
||||
if (selfType == null) return null;
|
||||
|
||||
ListBuffer<JCExpression> args = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> args = new ListBuffer<JCExpression>();
|
||||
for (JavacNode child : field.up().down()) {
|
||||
if (child.getKind() != Kind.FIELD) continue;
|
||||
JCVariableDecl childDecl = (JCVariableDecl) child.get();
|
||||
|
||||
@@ -338,7 +338,7 @@ public class JavacHandlerUtil {
|
||||
public static void deleteImportFromCompilationUnit(JavacNode node, String name) {
|
||||
if (inNetbeansEditor(node)) return;
|
||||
if (!node.shouldDeleteLombokAnnotations()) return;
|
||||
ListBuffer<JCTree> newDefs = ListBuffer.lb();
|
||||
ListBuffer<JCTree> newDefs = new ListBuffer<JCTree>();
|
||||
|
||||
JCCompilationUnit unit = (JCCompilationUnit) node.top().get();
|
||||
|
||||
@@ -354,7 +354,7 @@ public class JavacHandlerUtil {
|
||||
}
|
||||
|
||||
private static List<JCAnnotation> filterList(List<JCAnnotation> annotations, JCTree jcTree) {
|
||||
ListBuffer<JCAnnotation> newAnnotations = ListBuffer.lb();
|
||||
ListBuffer<JCAnnotation> newAnnotations = new ListBuffer<JCAnnotation>();
|
||||
for (JCAnnotation ann : annotations) {
|
||||
if (jcTree != ann) newAnnotations.append(ann);
|
||||
}
|
||||
@@ -437,7 +437,7 @@ public class JavacHandlerUtil {
|
||||
while (typeNode != null && typeNode.getKind() != Kind.TYPE) typeNode = typeNode.up();
|
||||
if (typeNode != null && typeNode.get() instanceof JCClassDecl) {
|
||||
JCClassDecl type = (JCClassDecl) typeNode.get();
|
||||
ListBuffer<JCExpression> typeArgs = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> typeArgs = new ListBuffer<JCExpression>();
|
||||
if (!type.typarams.isEmpty()) {
|
||||
for (JCTypeParameter tp : type.typarams) {
|
||||
typeArgs.append(maker.Ident(tp.name));
|
||||
@@ -885,7 +885,7 @@ public class JavacHandlerUtil {
|
||||
}
|
||||
|
||||
private static List<JCTree> addAllButOne(List<JCTree> defs, int idx) {
|
||||
ListBuffer<JCTree> out = ListBuffer.lb();
|
||||
ListBuffer<JCTree> out = new ListBuffer<JCTree>();
|
||||
int i = 0;
|
||||
for (JCTree def : defs) {
|
||||
if (i++ != idx) out.append(def);
|
||||
@@ -956,7 +956,7 @@ public class JavacHandlerUtil {
|
||||
* Only the simple name is checked - the package and any containing class are ignored.
|
||||
*/
|
||||
public static List<JCAnnotation> findAnnotations(JavacNode fieldNode, Pattern namePattern) {
|
||||
ListBuffer<JCAnnotation> result = ListBuffer.lb();
|
||||
ListBuffer<JCAnnotation> result = new ListBuffer<JCAnnotation>();
|
||||
for (JavacNode child : fieldNode.down()) {
|
||||
if (child.getKind() == Kind.ANNOTATION) {
|
||||
JCAnnotation annotation = (JCAnnotation) child.get();
|
||||
@@ -1006,7 +1006,7 @@ public class JavacHandlerUtil {
|
||||
if (idx > -1) matched[idx] = true;
|
||||
}
|
||||
|
||||
ListBuffer<Integer> problematic = ListBuffer.lb();
|
||||
ListBuffer<Integer> problematic = new ListBuffer<Integer>();
|
||||
for (int i = 0 ; i < list.size() ; i++) {
|
||||
if (!matched[i]) problematic.append(i);
|
||||
}
|
||||
@@ -1015,8 +1015,8 @@ public class JavacHandlerUtil {
|
||||
}
|
||||
|
||||
static List<JCAnnotation> unboxAndRemoveAnnotationParameter(JCAnnotation ast, String parameterName, String errorName, JavacNode errorNode) {
|
||||
ListBuffer<JCExpression> params = ListBuffer.lb();
|
||||
ListBuffer<JCAnnotation> result = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> params = new ListBuffer<JCExpression>();
|
||||
ListBuffer<JCAnnotation> result = new ListBuffer<JCAnnotation>();
|
||||
|
||||
errorNode.removeDeferredErrors();
|
||||
|
||||
@@ -1086,13 +1086,13 @@ public class JavacHandlerUtil {
|
||||
|
||||
public static List<JCTypeParameter> copyTypeParams(JavacTreeMaker maker, List<JCTypeParameter> params) {
|
||||
if (params == null || params.isEmpty()) return params;
|
||||
ListBuffer<JCTypeParameter> out = ListBuffer.lb();
|
||||
ListBuffer<JCTypeParameter> out = new ListBuffer<JCTypeParameter>();
|
||||
for (JCTypeParameter tp : params) out.append(maker.TypeParameter(tp.name, tp.bounds));
|
||||
return out.toList();
|
||||
}
|
||||
|
||||
public static JCExpression namePlusTypeParamsToTypeReference(JavacTreeMaker maker, Name typeName, List<JCTypeParameter> params) {
|
||||
ListBuffer<JCExpression> typeArgs = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> typeArgs = new ListBuffer<JCExpression>();
|
||||
|
||||
if (!params.isEmpty()) {
|
||||
for (JCTypeParameter param : params) {
|
||||
@@ -1128,7 +1128,7 @@ public class JavacHandlerUtil {
|
||||
}
|
||||
|
||||
static List<JCAnnotation> copyAnnotations(List<? extends JCExpression> in) {
|
||||
ListBuffer<JCAnnotation> out = ListBuffer.lb();
|
||||
ListBuffer<JCAnnotation> out = new ListBuffer<JCAnnotation>();
|
||||
for (JCExpression expr : in) {
|
||||
if (!(expr instanceof JCAnnotation)) continue;
|
||||
out.append((JCAnnotation) expr.clone());
|
||||
@@ -1197,7 +1197,7 @@ public class JavacHandlerUtil {
|
||||
|
||||
if (in instanceof JCTypeApply) {
|
||||
JCTypeApply ta = (JCTypeApply) in;
|
||||
ListBuffer<JCExpression> lb = ListBuffer.lb();
|
||||
ListBuffer<JCExpression> lb = new ListBuffer<JCExpression>();
|
||||
for (JCExpression typeArg : ta.arguments) {
|
||||
lb.append(cloneType0(maker, typeArg));
|
||||
}
|
||||
|
||||
@@ -28,11 +28,12 @@ import lombok.javac.CommentInfo.EndConnection;
|
||||
import lombok.javac.CommentInfo.StartConnection;
|
||||
|
||||
import com.sun.tools.javac.parser.Scanner;
|
||||
import com.sun.tools.javac.tree.JCTree.JCExpression;
|
||||
import com.sun.tools.javac.util.List;
|
||||
import com.sun.tools.javac.util.ListBuffer;
|
||||
|
||||
public class CommentCollectingScanner extends Scanner {
|
||||
private final ListBuffer<CommentInfo> comments = ListBuffer.lb();
|
||||
private final ListBuffer<CommentInfo> comments = new ListBuffer<CommentInfo>();
|
||||
private int endComment = 0;
|
||||
|
||||
public CommentCollectingScanner(CommentCollectingScannerFactory factory, CharBuffer charBuffer) {
|
||||
|
||||
@@ -28,11 +28,12 @@ import lombok.javac.CommentInfo.EndConnection;
|
||||
import lombok.javac.CommentInfo.StartConnection;
|
||||
|
||||
import com.sun.tools.javac.parser.Scanner;
|
||||
import com.sun.tools.javac.tree.JCTree.JCExpression;
|
||||
import com.sun.tools.javac.util.List;
|
||||
import com.sun.tools.javac.util.ListBuffer;
|
||||
|
||||
public class CommentCollectingScanner extends Scanner {
|
||||
private final ListBuffer<CommentInfo> comments = ListBuffer.lb();
|
||||
private final ListBuffer<CommentInfo> comments = new ListBuffer<CommentInfo>();
|
||||
private int endComment = 0;
|
||||
|
||||
public CommentCollectingScanner(CommentCollectingScannerFactory factory, CharBuffer charBuffer) {
|
||||
|
||||
@@ -12,12 +12,13 @@ import com.sun.tools.javac.parser.Tokens.Comment;
|
||||
import com.sun.tools.javac.parser.Tokens.Token;
|
||||
import com.sun.tools.javac.parser.Tokens.Comment.CommentStyle;
|
||||
import com.sun.tools.javac.parser.UnicodeReader;
|
||||
import com.sun.tools.javac.tree.JCTree.JCExpression;
|
||||
import com.sun.tools.javac.util.List;
|
||||
import com.sun.tools.javac.util.ListBuffer;
|
||||
|
||||
class CommentCollectingTokenizer extends JavaTokenizer {
|
||||
private int prevEndPosition = 0;
|
||||
private final ListBuffer<CommentInfo> comments = ListBuffer.lb();
|
||||
private final ListBuffer<CommentInfo> comments = new ListBuffer<CommentInfo>();
|
||||
private int endComment = 0;
|
||||
|
||||
CommentCollectingTokenizer(ScannerFactory fac, char[] buf, int inputLength) {
|
||||
|
||||
Reference in new issue
Block a user