6386236: Please rename com.sun.tools.javac.util.ListBuffer.lb()
Summary: Static factory method ListBuffer.lb removed. Replaced by constructor calls.
Reviewed-by: jfranck, jjg
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java Mon Sep 23 10:42:38 2013 +0200
@@ -472,7 +472,7 @@
for (TypeElement item: classes)
set.add(item);
- ListBuffer<Env<AttrContext>> defer = ListBuffer.<Env<AttrContext>>lb();
+ ListBuffer<Env<AttrContext>> defer = new ListBuffer<>();
while (list.peek() != null) {
Env<AttrContext> env = list.remove();
ClassSymbol csym = env.enclClass.sym;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/DeferredLintHandler.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/DeferredLintHandler.java Mon Sep 23 10:42:38 2013 +0200
@@ -81,7 +81,7 @@
} else {
ListBuffer<LintLogger> loggers = loggersQueue.get(currentPos);
if (loggers == null) {
- loggersQueue.put(currentPos, loggers = ListBuffer.<LintLogger>lb());
+ loggersQueue.put(currentPos, loggers = new ListBuffer<>());
}
loggers.append(logger);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java Mon Sep 23 10:42:38 2013 +0200
@@ -103,7 +103,7 @@
* @return localized string representation
*/
public String visitTypes(List<Type> ts, Locale locale) {
- ListBuffer<String> sbuf = ListBuffer.lb();
+ ListBuffer<String> sbuf = new ListBuffer<>();
for (Type t : ts) {
sbuf.append(visit(t, locale));
}
@@ -118,7 +118,7 @@
* @return localized string representation
*/
public String visitSymbols(List<Symbol> ts, Locale locale) {
- ListBuffer<String> sbuf = ListBuffer.lb();
+ ListBuffer<String> sbuf = new ListBuffer<>();
for (Symbol t : ts) {
sbuf.append(visit(t, locale));
}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java Mon Sep 23 10:42:38 2013 +0200
@@ -614,7 +614,7 @@
}
public List<TypeVariableSymbol> getTypeParameters() {
- ListBuffer<TypeVariableSymbol> l = ListBuffer.lb();
+ ListBuffer<TypeVariableSymbol> l = new ListBuffer<>();
for (Type t : type.getTypeArguments()) {
Assert.check(t.tsym.getKind() == ElementKind.TYPE_PARAMETER);
l.append((TypeVariableSymbol)t.tsym);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java Mon Sep 23 10:42:38 2013 +0200
@@ -433,7 +433,7 @@
}
public static List<Type> filter(List<Type> ts, Filter<Type> tf) {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (Type t : ts) {
if (tf.accepts(t)) {
buf.append(t);
@@ -1496,7 +1496,7 @@
/** get all bounds of a given kind */
public List<Type> getBounds(InferenceBound... ibs) {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (InferenceBound ib : ibs) {
buf.appendList(bounds.get(ib));
}
@@ -1505,7 +1505,7 @@
/** get the list of declared (upper) bounds */
public List<Type> getDeclaredBounds() {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
int count = 0;
for (Type b : getBounds(InferenceBound.UPPER)) {
if (count++ == declaredCount) break;
@@ -1565,8 +1565,8 @@
for (Map.Entry<InferenceBound, List<Type>> _entry : bounds.entrySet()) {
InferenceBound ib = _entry.getKey();
List<Type> prevBounds = _entry.getValue();
- ListBuffer<Type> newBounds = ListBuffer.lb();
- ListBuffer<Type> deps = ListBuffer.lb();
+ ListBuffer<Type> newBounds = new ListBuffer<>();
+ ListBuffer<Type> deps = new ListBuffer<>();
//step 1 - re-add bounds that are not dependent on ivars
for (Type t : prevBounds) {
if (!t.containsAny(instVars)) {
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java Mon Sep 23 10:42:38 2013 +0200
@@ -304,7 +304,7 @@
* @param list The bytecode representation of the type path.
*/
public static List<TypePathEntry> getTypePathFromBinary(java.util.List<Integer> list) {
- ListBuffer<TypePathEntry> loc = ListBuffer.lb();
+ ListBuffer<TypePathEntry> loc = new ListBuffer<>();
Iterator<Integer> iter = list.iterator();
while (iter.hasNext()) {
Integer fst = iter.next();
@@ -316,7 +316,7 @@
}
public static List<Integer> getBinaryFromTypePath(java.util.List<TypePathEntry> locs) {
- ListBuffer<Integer> loc = ListBuffer.lb();
+ ListBuffer<Integer> loc = new ListBuffer<>();
for (TypePathEntry tpe : locs) {
loc = loc.append(tpe.tag.tag);
loc = loc.append(tpe.arg);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java Mon Sep 23 10:42:38 2013 +0200
@@ -233,7 +233,7 @@
* When traversing the AST we keep the "frames" of visited
* trees in order to determine the position of annotations.
*/
- private ListBuffer<JCTree> frames = ListBuffer.lb();
+ private ListBuffer<JCTree> frames = new ListBuffer<>();
protected void push(JCTree t) { frames = frames.prepend(t); }
protected JCTree pop() { return frames.next(); }
@@ -381,7 +381,7 @@
}
JCArrayTypeTree arTree = arrayTypeTree(typetree);
- ListBuffer<TypePathEntry> depth = ListBuffer.lb();
+ ListBuffer<TypePathEntry> depth = new ListBuffer<>();
depth = depth.append(TypePathEntry.ARRAY);
while (arType.elemtype.hasTag(TypeTag.ARRAY)) {
if (arType.elemtype.isAnnotated()) {
@@ -473,7 +473,7 @@
// the correct nesting.
// The genericLocation for the annotation.
- ListBuffer<TypePathEntry> depth = ListBuffer.lb();
+ ListBuffer<TypePathEntry> depth = new ListBuffer<>();
Type topTy = enclTy;
while (enclEl != null &&
@@ -793,7 +793,7 @@
}
case ARRAY_TYPE: {
- ListBuffer<TypePathEntry> index = ListBuffer.lb();
+ ListBuffer<TypePathEntry> index = new ListBuffer<>();
index = index.append(TypePathEntry.ARRAY);
List<JCTree> newPath = path.tail;
while (true) {
@@ -956,7 +956,7 @@
private static void locateNestedTypes(Type type, TypeAnnotationPosition p) {
// The number of "steps" to get from the full type to the
// left-most outer type.
- ListBuffer<TypePathEntry> depth = ListBuffer.lb();
+ ListBuffer<TypePathEntry> depth = new ListBuffer<>();
Type encl = type.getEnclosingType();
while (encl != null &&
@@ -1226,7 +1226,7 @@
public void visitNewArray(JCNewArray tree) {
findPosition(tree, tree, tree.annotations);
int dimAnnosCount = tree.dimAnnotations.size();
- ListBuffer<TypePathEntry> depth = ListBuffer.lb();
+ ListBuffer<TypePathEntry> depth = new ListBuffer<>();
// handle annotations associated with dimensions
for (int i = 0; i < dimAnnosCount; ++i) {
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Mon Sep 23 10:42:38 2013 +0200
@@ -51,7 +51,6 @@
import static com.sun.tools.javac.code.Type.*;
import static com.sun.tools.javac.code.TypeTag.*;
import static com.sun.tools.javac.jvm.ClassFile.externalize;
-import static com.sun.tools.javac.util.ListBuffer.lb;
/**
* Utility class containing various operations on types.
@@ -411,7 +410,7 @@
throw failure("not.a.functional.intf", origin);
}
- final ListBuffer<Symbol> abstracts = ListBuffer.lb();
+ final ListBuffer<Symbol> abstracts = new ListBuffer<>();
for (Symbol sym : membersCache.getElements(new DescriptorFilter(origin))) {
Type mtype = memberType(origin.type, sym);
if (abstracts.isEmpty() ||
@@ -434,7 +433,7 @@
FunctionDescriptor descRes = mergeDescriptors(origin, abstracts.toList());
if (descRes == null) {
//we can get here if the functional interface is ill-formed
- ListBuffer<JCDiagnostic> descriptors = ListBuffer.lb();
+ ListBuffer<JCDiagnostic> descriptors = new ListBuffer<>();
for (Symbol desc : abstracts) {
String key = desc.type.getThrownTypes().nonEmpty() ?
"descriptor.throws" : "descriptor";
@@ -596,7 +595,7 @@
Type capturedSite = capture(site);
if (capturedSite != site) {
Type formalInterface = site.tsym.type;
- ListBuffer<Type> typeargs = ListBuffer.lb();
+ ListBuffer<Type> typeargs = new ListBuffer<>();
List<Type> actualTypeargs = site.getTypeArguments();
List<Type> capturedTypeargs = capturedSite.getTypeArguments();
//simply replace the wildcards with its bound
@@ -662,7 +661,7 @@
Assert.check(isFunctionalInterface(origin));
Symbol descSym = findDescriptorSymbol(origin);
CompoundScope members = membersClosure(origin.type, false);
- ListBuffer<Symbol> overridden = ListBuffer.lb();
+ ListBuffer<Symbol> overridden = new ListBuffer<>();
outer: for (Symbol m2 : members.getElementsByName(descSym.name, bridgeFilter)) {
if (m2 == descSym) continue;
else if (descSym.overrides(m2, origin, Types.this, false)) {
@@ -885,12 +884,12 @@
private Type rewriteSupers(Type t) {
if (!t.isParameterized())
return t;
- ListBuffer<Type> from = lb();
- ListBuffer<Type> to = lb();
+ ListBuffer<Type> from = new ListBuffer<>();
+ ListBuffer<Type> to = new ListBuffer<>();
adaptSelf(t, from, to);
if (from.isEmpty())
return t;
- ListBuffer<Type> rewrite = lb();
+ ListBuffer<Type> rewrite = new ListBuffer<>();
boolean changed = false;
for (Type orig : to.toList()) {
Type s = rewriteSupers(orig);
@@ -2744,7 +2743,7 @@
}
public List<MethodSymbol> prune(List<MethodSymbol> methods) {
- ListBuffer<MethodSymbol> methodsMin = ListBuffer.lb();
+ ListBuffer<MethodSymbol> methodsMin = new ListBuffer<>();
for (MethodSymbol m1 : methods) {
boolean isMin_m1 = true;
for (MethodSymbol m2 : methods) {
@@ -3001,7 +3000,7 @@
List<Type> to) {
if (tvars.isEmpty())
return tvars;
- ListBuffer<Type> newBoundsBuf = lb();
+ ListBuffer<Type> newBoundsBuf = new ListBuffer<>();
boolean changed = false;
// calculate new bounds
for (Type t : tvars) {
@@ -3013,7 +3012,7 @@
}
if (!changed)
return tvars;
- ListBuffer<Type> newTvars = lb();
+ ListBuffer<Type> newTvars = new ListBuffer<>();
// create new type variables without bounds
for (Type t : tvars) {
newTvars.append(new TypeVar(t.tsym, null, syms.botType));
@@ -3440,15 +3439,15 @@
* compoundMin or glb.
*/
private List<Type> closureMin(List<Type> cl) {
- ListBuffer<Type> classes = lb();
- ListBuffer<Type> interfaces = lb();
+ ListBuffer<Type> classes = new ListBuffer<>();
+ ListBuffer<Type> interfaces = new ListBuffer<>();
while (!cl.isEmpty()) {
Type current = cl.head;
if (current.isInterface())
interfaces.append(current);
else
classes.append(current);
- ListBuffer<Type> candidates = lb();
+ ListBuffer<Type> candidates = new ListBuffer<>();
for (Type t : cl.tail) {
if (!isSubtypeNoCapture(current, t))
candidates.append(t);
@@ -3564,7 +3563,7 @@
}
// where
List<Type> erasedSupertypes(Type t) {
- ListBuffer<Type> buf = lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (Type sup : closure(t)) {
if (sup.hasTag(TYPEVAR)) {
buf.append(sup);
@@ -3914,7 +3913,7 @@
}
// where
public List<Type> freshTypeVariables(List<Type> types) {
- ListBuffer<Type> result = lb();
+ ListBuffer<Type> result = new ListBuffer<>();
for (Type t : types) {
if (t.hasTag(WILDCARD)) {
t = t.unannotatedType();
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java Mon Sep 23 10:42:38 2013 +0200
@@ -1724,7 +1724,7 @@
boolean isConstructorCall =
methName == names._this || methName == names._super;
- ListBuffer<Type> argtypesBuf = ListBuffer.lb();
+ ListBuffer<Type> argtypesBuf = new ListBuffer<>();
if (isConstructorCall) {
// We are seeing a ...this(...) or ...super(...) call.
// Check that this is the first statement in a constructor.
@@ -1989,7 +1989,7 @@
}
// Attribute constructor arguments.
- ListBuffer<Type> argtypesBuf = ListBuffer.lb();
+ ListBuffer<Type> argtypesBuf = new ListBuffer<>();
int pkind = attribArgs(tree.args, localEnv, argtypesBuf);
List<Type> argtypes = argtypesBuf.toList();
List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
@@ -2476,8 +2476,8 @@
}
private TypeSymbol makeNotionalInterface(IntersectionClassType ict) {
- ListBuffer<Type> targs = ListBuffer.lb();
- ListBuffer<Type> supertypes = ListBuffer.lb();
+ ListBuffer<Type> targs = new ListBuffer<>();
+ ListBuffer<Type> supertypes = new ListBuffer<>();
for (Type i : ict.interfaces_field) {
if (i.isParameterized()) {
targs.appendList(i.tsym.type.allparams());
@@ -2907,7 +2907,7 @@
}
});
} else {
- ListBuffer<Type> targets = ListBuffer.lb();
+ ListBuffer<Type> targets = new ListBuffer<>();
if (pt.hasTag(CLASS)) {
if (pt.isCompound()) {
targets.append(types.removeWildcards(primaryTarget)); //this goes first
@@ -3903,7 +3903,7 @@
}
public void visitTypeUnion(JCTypeUnion tree) {
- ListBuffer<Type> multicatchTypes = ListBuffer.lb();
+ ListBuffer<Type> multicatchTypes = new ListBuffer<>();
ListBuffer<Type> all_multicatchTypes = null; // lazy, only if needed
for (JCExpression typeTree : tree.alternatives) {
Type ctype = attribType(typeTree, env);
@@ -3930,7 +3930,7 @@
all_multicatchTypes.append(ctype);
} else {
if (all_multicatchTypes == null) {
- all_multicatchTypes = ListBuffer.lb();
+ all_multicatchTypes = new ListBuffer<>();
all_multicatchTypes.appendList(multicatchTypes);
}
all_multicatchTypes.append(ctype);
@@ -4085,7 +4085,7 @@
if (annotations.isEmpty())
return List.nil();
- ListBuffer<Attribute.TypeCompound> buf = ListBuffer.lb();
+ ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
for (JCAnnotation anno : annotations) {
if (anno.attribute != null) {
// TODO: this null-check is only needed for an obscure
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Mon Sep 23 10:42:38 2013 +0200
@@ -2452,8 +2452,8 @@
Assert.check(m.kind == MTH);
List<MethodSymbol> prov = types.interfaceCandidates(site, (MethodSymbol)m);
if (prov.size() > 1) {
- ListBuffer<Symbol> abstracts = ListBuffer.lb();
- ListBuffer<Symbol> defaults = ListBuffer.lb();
+ ListBuffer<Symbol> abstracts = new ListBuffer<>();
+ ListBuffer<Symbol> defaults = new ListBuffer<>();
for (MethodSymbol provSym : prov) {
if ((provSym.flags() & DEFAULT) != 0) {
defaults = defaults.append(provSym);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java Mon Sep 23 10:42:38 2013 +0200
@@ -637,7 +637,7 @@
Env<AttrContext> localEnv = env.dup(tree);
JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
attr.memberReferenceQualifierResult(tree));
- ListBuffer<Type> argtypes = ListBuffer.lb();
+ ListBuffer<Type> argtypes = new ListBuffer<>();
for (Type t : types.findDescriptorType(pt).getParameterTypes()) {
argtypes.append(Type.noType);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Mon Sep 23 10:42:38 2013 +0200
@@ -713,7 +713,7 @@
ListBuffer<PendingExit> prevPending = pendingExits;
boolean prevAlive = alive;
try {
- pendingExits = ListBuffer.lb();
+ pendingExits = new ListBuffer<>();
alive = true;
scanStat(tree.body);
tree.canCompleteNormally = alive;
@@ -1265,7 +1265,7 @@
List<Type> prevThrown = thrown;
ListBuffer<FlowPendingExit> prevPending = pendingExits;
try {
- pendingExits = ListBuffer.lb();
+ pendingExits = new ListBuffer<>();
caught = tree.getDescriptorType(types).getThrownTypes();
thrown = List.nil();
scan(tree.body);
@@ -1338,7 +1338,7 @@
ListBuffer<FlowPendingExit> prevPending = pendingExits;
inLambda = true;
try {
- pendingExits = ListBuffer.lb();
+ pendingExits = new ListBuffer<>();
caught = List.of(syms.throwableType);
thrown = List.nil();
scan(tree.body);
@@ -2030,7 +2030,7 @@
void reportWarning(Lint.LintCategory lc, DiagnosticPosition pos, String key, Object ... args) {}
public void visitTry(JCTry tree) {
- ListBuffer<JCVariableDecl> resourceVarDecls = ListBuffer.lb();
+ ListBuffer<JCVariableDecl> resourceVarDecls = new ListBuffer<>();
final Bits uninitsTryPrev = new Bits(uninitsTry);
ListBuffer<P> prevPendingExits = pendingExits;
pendingExits = new ListBuffer<>();
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java Mon Sep 23 10:42:38 2013 +0200
@@ -277,7 +277,7 @@
* Infer cyclic inference variables as described in 15.12.2.8.
*/
private void instantiateAsUninferredVars(List<Type> vars, InferenceContext inferenceContext) {
- ListBuffer<Type> todo = ListBuffer.lb();
+ ListBuffer<Type> todo = new ListBuffer<>();
//step 1 - create fresh tvars
for (Type t : vars) {
UndetVar uv = (UndetVar)inferenceContext.asFree(t);
@@ -1832,7 +1832,7 @@
}
private List<Type> filterVars(Filter<UndetVar> fu) {
- ListBuffer<Type> res = ListBuffer.lb();
+ ListBuffer<Type> res = new ListBuffer<>();
for (Type t : undetvars) {
UndetVar uv = (UndetVar)t;
if (fu.accepts(uv)) {
@@ -1860,7 +1860,7 @@
* Returns a list of free variables in a given type
*/
final List<Type> freeVarsIn(Type t) {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (Type iv : inferenceVars()) {
if (t.contains(iv)) {
buf.add(iv);
@@ -1870,11 +1870,11 @@
}
final List<Type> freeVarsIn(List<Type> ts) {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (Type t : ts) {
buf.appendList(freeVarsIn(t));
}
- ListBuffer<Type> buf2 = ListBuffer.lb();
+ ListBuffer<Type> buf2 = new ListBuffer<>();
for (Type t : buf) {
if (!buf2.contains(t)) {
buf2.add(t);
@@ -1893,7 +1893,7 @@
}
final List<Type> asFree(List<Type> ts) {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (Type t : ts) {
buf.append(asFree(t));
}
@@ -1901,7 +1901,7 @@
}
List<Type> instTypes() {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (Type t : undetvars) {
UndetVar uv = (UndetVar)t;
buf.append(uv.inst != null ? uv.inst : uv.qtype);
@@ -1919,7 +1919,7 @@
}
List<Type> asInstTypes(List<Type> ts) {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (Type t : ts) {
buf.append(asInstType(t));
}
@@ -1967,7 +1967,7 @@
* Save the state of this inference context
*/
List<Type> save() {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (Type t : undetvars) {
UndetVar uv = (UndetVar)t;
UndetVar uv2 = new UndetVar((TypeVar)uv.qtype, types);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java Mon Sep 23 10:42:38 2013 +0200
@@ -126,7 +126,7 @@
private final VarSymbol deserParamSym;
private KlassInfo(Symbol kSym) {
- appendedMethodList = ListBuffer.lb();
+ appendedMethodList = new ListBuffer<>();
deserializeCases = new HashMap<String, ListBuffer<JCStatement>>();
long flags = PRIVATE | STATIC | SYNTHETIC;
MethodType type = new MethodType(List.of(syms.serializedLambdaType), syms.objectType,
@@ -191,7 +191,7 @@
}
<T extends JCTree> List<T> translate(List<T> trees, TranslationContext<?> newContext) {
- ListBuffer<T> buf = ListBuffer.lb();
+ ListBuffer<T> buf = new ListBuffer<>();
for (T tree : trees) {
buf.append(translate(tree, newContext));
}
@@ -304,7 +304,7 @@
// * the "this" argument if it is an instance method
// * enclosing locals captured by the lambda expression
- ListBuffer<JCExpression> syntheticInits = ListBuffer.lb();
+ ListBuffer<JCExpression> syntheticInits = new ListBuffer<>();
if (!sym.isStatic()) {
syntheticInits.append(makeThis(
@@ -469,7 +469,7 @@
} else if (isLambda_void && isTarget_Void) {
//void to Void conversion:
// BODY; return null;
- ListBuffer<JCStatement> stats = ListBuffer.lb();
+ ListBuffer<JCStatement> stats = new ListBuffer<>();
stats.append(make.Exec(expr));
stats.append(make.Return(make.Literal(BOT, null).setType(syms.botType)));
return make.Block(0, stats.toList());
@@ -531,8 +531,8 @@
}
private JCMethodDecl makeDeserializeMethod(Symbol kSym) {
- ListBuffer<JCCase> cases = ListBuffer.lb();
- ListBuffer<JCBreak> breaks = ListBuffer.lb();
+ ListBuffer<JCCase> cases = new ListBuffer<>();
+ ListBuffer<JCBreak> breaks = new ListBuffer<>();
for (Map.Entry<String, ListBuffer<JCStatement>> entry : kInfo.deserializeCases.entrySet()) {
JCBreak br = make.Break(null);
breaks.add(br);
@@ -594,11 +594,11 @@
String implMethodSignature = methodSig(types.erasure(refSym.type));
JCExpression kindTest = eqTest(syms.intType, deserGetter("getImplMethodKind", syms.intType), make.Literal(implMethodKind));
- ListBuffer<JCExpression> serArgs = ListBuffer.lb();
+ ListBuffer<JCExpression> serArgs = new ListBuffer<>();
int i = 0;
for (Type t : indyType.getParameterTypes()) {
- List<JCExpression> indexAsArg = ListBuffer.<JCExpression>lb().append(make.Literal(i)).toList();
- List<Type> argTypes = ListBuffer.<Type>lb().append(syms.intType).toList();
+ List<JCExpression> indexAsArg = new ListBuffer<JCExpression>().append(make.Literal(i)).toList();
+ List<Type> argTypes = new ListBuffer<Type>().append(syms.intType).toList();
serArgs.add(make.TypeCast(types.erasure(t), deserGetter("getCapturedArg", syms.objectType, argTypes, indexAsArg)));
++i;
}
@@ -618,7 +618,7 @@
null);
ListBuffer<JCStatement> stmts = kInfo.deserializeCases.get(implMethodName);
if (stmts == null) {
- stmts = ListBuffer.lb();
+ stmts = new ListBuffer<>();
kInfo.deserializeCases.put(implMethodName, stmts);
}
/****
@@ -728,8 +728,8 @@
private final JCMemberReference tree;
private final ReferenceTranslationContext localContext;
- private final ListBuffer<JCExpression> args = ListBuffer.lb();
- private final ListBuffer<JCVariableDecl> params = ListBuffer.lb();
+ private final ListBuffer<JCExpression> args = new ListBuffer<>();
+ private final ListBuffer<JCVariableDecl> params = new ListBuffer<>();
MemberReferenceBridger(JCMemberReference tree, ReferenceTranslationContext localContext) {
this.tree = tree;
@@ -934,7 +934,7 @@
typeToMethodType(tree.getDescriptorType(types)));
//computed indy arg types
- ListBuffer<Type> indy_args_types = ListBuffer.lb();
+ ListBuffer<Type> indy_args_types = new ListBuffer<>();
for (JCExpression arg : indy_args) {
indy_args_types.append(arg.type);
}
@@ -949,7 +949,7 @@
names.altMetafactory : names.metafactory;
if (context.needsAltMetafactory()) {
- ListBuffer<Object> markers = ListBuffer.lb();
+ ListBuffer<Object> markers = new ListBuffer<>();
for (Type t : tree.targets.tail) {
if (t.tsym != syms.serializableType.tsym) {
markers.append(t.tsym);
@@ -1027,7 +1027,7 @@
}
//where
private List<Type> bsmStaticArgToTypes(List<Object> args) {
- ListBuffer<Type> argtypes = ListBuffer.lb();
+ ListBuffer<Type> argtypes = new ListBuffer<>();
for (Object arg : args) {
argtypes.append(bsmStaticArgToType(arg));
}
@@ -1851,7 +1851,7 @@
(thisReferenced? (inInterface? DEFAULT : 0) : STATIC);
//compute synthetic params
- ListBuffer<JCVariableDecl> params = ListBuffer.lb();
+ ListBuffer<JCVariableDecl> params = new ListBuffer<>();
// The signature of the method is augmented with the following
// synthetic parameters:
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java Mon Sep 23 10:42:38 2013 +0200
@@ -3725,7 +3725,7 @@
(JCVariableDecl)make.VarDef(dollar_tmp, make.Literal(INT, -1)).setType(dollar_tmp.type);
dollar_tmp_def.init.type = dollar_tmp.type = syms.intType;
stmtList.append(dollar_tmp_def);
- ListBuffer<JCCase> caseBuffer = ListBuffer.lb();
+ ListBuffer<JCCase> caseBuffer = new ListBuffer<>();
// hashCode will trigger nullcheck on original switch expression
JCMethodInvocation hashCodeCall = makeCall(make.Ident(dollar_s),
names.hashCode,
@@ -3749,7 +3749,7 @@
elsepart);
}
- ListBuffer<JCStatement> lb = ListBuffer.lb();
+ ListBuffer<JCStatement> lb = new ListBuffer<>();
JCBreak breakStmt = make.Break(null);
breakStmt.target = switch1;
lb.append(elsepart).append(breakStmt);
@@ -3764,7 +3764,7 @@
// with corresponding integer ones from the label to
// position map.
- ListBuffer<JCCase> lb = ListBuffer.lb();
+ ListBuffer<JCCase> lb = new ListBuffer<>();
JCSwitch switch2 = make.Switch(make.Ident(dollar_tmp), lb.toList());
for(JCCase oneCase : caseList ) {
// Rewire up old unlabeled break statements to the
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Mon Sep 23 10:42:38 2013 +0200
@@ -213,7 +213,7 @@
int pos = 0;
int mostSpecificPos = -1;
- ListBuffer<JCDiagnostic> subDiags = ListBuffer.lb();
+ ListBuffer<JCDiagnostic> subDiags = new ListBuffer<>();
for (Candidate c : currentResolutionContext.candidates) {
if (currentResolutionContext.step != c.step ||
(c.isApplicable() && !verboseResolutionMode.contains(VerboseResolutionMode.APPLICABLE)) ||
@@ -783,7 +783,7 @@
};
List<Type> dummyArgs(int length) {
- ListBuffer<Type> buf = ListBuffer.lb();
+ ListBuffer<Type> buf = new ListBuffer<>();
for (int i = 0 ; i < length ; i++) {
buf.append(Type.noType);
}
@@ -3173,7 +3173,7 @@
}
//where
private List<Type> pruneInterfaces(Type t) {
- ListBuffer<Type> result = ListBuffer.lb();
+ ListBuffer<Type> result = new ListBuffer<>();
for (Type t1 : types.interfaces(t)) {
boolean shouldAdd = true;
for (Type t2 : types.interfaces(t)) {
@@ -3286,7 +3286,7 @@
if (argtypes == null || argtypes.isEmpty()) {
return noArgs;
} else {
- ListBuffer<Object> diagArgs = ListBuffer.lb();
+ ListBuffer<Object> diagArgs = new ListBuffer<>();
for (Type t : argtypes) {
if (t.hasTag(DEFERRED)) {
diagArgs.append(((DeferredAttr.DeferredType)t).tree);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java Mon Sep 23 10:42:38 2013 +0200
@@ -887,7 +887,7 @@
private List<JCTree> addOverrideBridgesIfNeeded(DiagnosticPosition pos,
final ClassSymbol c) {
- ListBuffer<JCTree> buf = ListBuffer.lb();
+ ListBuffer<JCTree> buf = new ListBuffer<>();
if (c.isInterface() || !boundsRestricted(c))
return buf.toList();
Type t = types.supertype(c.type);
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Mon Sep 23 10:42:38 2013 +0200
@@ -1446,8 +1446,7 @@
void attachTypeAnnotations(final Symbol sym) {
int numAttributes = nextChar();
if (numAttributes != 0) {
- ListBuffer<TypeAnnotationProxy> proxies =
- ListBuffer.lb();
+ ListBuffer<TypeAnnotationProxy> proxies = new ListBuffer<>();
for (int i = 0; i < numAttributes; i++)
proxies.append(readTypeAnnotation());
annotate.normal(new TypeAnnotationCompleter(sym, proxies.toList()));
@@ -1596,7 +1595,7 @@
{ // See whether there is location info and read it
int len = nextByte();
- ListBuffer<Integer> loc = ListBuffer.lb();
+ ListBuffer<Integer> loc = new ListBuffer<>();
for (int i = 0; i < len * TypeAnnotationPosition.TypePathEntry.bytesPerEntry; ++i)
loc = loc.append(nextByte());
position.location = TypeAnnotationPosition.getTypePathFromBinary(loc.toList());
@@ -1946,7 +1945,7 @@
}
List<Attribute.TypeCompound> deproxyTypeCompoundList(List<TypeAnnotationProxy> proxies) {
- ListBuffer<Attribute.TypeCompound> buf = ListBuffer.lb();
+ ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
for (TypeAnnotationProxy proxy: proxies) {
Attribute.Compound compound = deproxyCompound(proxy.compound);
Attribute.TypeCompound typeCompound = new Attribute.TypeCompound(compound, proxy.position);
@@ -2033,7 +2032,7 @@
boolean isVarargs = (flags & VARARGS) != 0;
if (isVarargs) {
Type varargsElem = args.last();
- ListBuffer<Type> adjustedArgs = ListBuffer.lb();
+ ListBuffer<Type> adjustedArgs = new ListBuffer<>();
for (Type t : args) {
adjustedArgs.append(t != varargsElem ?
t :
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Mon Sep 23 10:42:38 2013 +0200
@@ -766,8 +766,8 @@
int writeTypeAnnotations(List<Attribute.TypeCompound> typeAnnos, boolean inCode) {
if (typeAnnos.isEmpty()) return 0;
- ListBuffer<Attribute.TypeCompound> visibles = ListBuffer.lb();
- ListBuffer<Attribute.TypeCompound> invisibles = ListBuffer.lb();
+ ListBuffer<Attribute.TypeCompound> visibles = new ListBuffer<>();
+ ListBuffer<Attribute.TypeCompound> invisibles = new ListBuffer<>();
for (Attribute.TypeCompound tc : typeAnnos) {
if (tc.hasUnknownPosition()) {
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java Mon Sep 23 10:42:38 2013 +0200
@@ -1595,7 +1595,7 @@
public void compressCatchTable() {
- ListBuffer<char[]> compressedCatchInfo = ListBuffer.lb();
+ ListBuffer<char[]> compressedCatchInfo = new ListBuffer<>();
List<Integer> handlerPcs = List.nil();
for (char[] catchEntry : catchInfo) {
handlerPcs = handlerPcs.prepend((int)catchEntry[2]);
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Mon Sep 23 10:42:38 2013 +0200
@@ -67,7 +67,6 @@
import static com.sun.tools.javac.code.TypeTag.CLASS;
import static com.sun.tools.javac.main.Option.*;
import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*;
-import static com.sun.tools.javac.util.ListBuffer.lb;
/** This class could be the main entry point for GJC when GJC is used as a
@@ -586,7 +585,7 @@
}
protected final <T> Queue<T> stopIfError(CompileState cs, Queue<T> queue) {
- return shouldStop(cs) ? ListBuffer.<T>lb() : queue;
+ return shouldStop(cs) ? new ListBuffer<T>() : queue;
}
protected final <T> List<T> stopIfError(CompileState cs, List<T> list) {
@@ -952,7 +951,7 @@
return List.nil();
//parse all files
- ListBuffer<JCCompilationUnit> trees = lb();
+ ListBuffer<JCCompilationUnit> trees = new ListBuffer<>();
Set<JavaFileObject> filesSoFar = new HashSet<JavaFileObject>();
for (JavaFileObject fileObject : fileObjects) {
if (!filesSoFar.contains(fileObject)) {
@@ -1002,7 +1001,7 @@
// then remember the classes declared in
// the original compilation units listed on the command line.
if (needRootClasses || sourceOutput || stubOutput) {
- ListBuffer<JCClassDecl> cdefs = lb();
+ ListBuffer<JCClassDecl> cdefs = new ListBuffer<>();
for (JCCompilationUnit unit : roots) {
for (List<JCTree> defs = unit.defs;
defs.nonEmpty();
@@ -1226,7 +1225,7 @@
* @returns a list of environments for attributd classes.
*/
public Queue<Env<AttrContext>> attribute(Queue<Env<AttrContext>> envs) {
- ListBuffer<Env<AttrContext>> results = lb();
+ ListBuffer<Env<AttrContext>> results = new ListBuffer<>();
while (!envs.isEmpty())
results.append(attribute(envs.remove()));
return stopIfError(CompileState.ATTR, results);
@@ -1291,7 +1290,7 @@
* @returns the list of attributed parse trees
*/
public Queue<Env<AttrContext>> flow(Queue<Env<AttrContext>> envs) {
- ListBuffer<Env<AttrContext>> results = lb();
+ ListBuffer<Env<AttrContext>> results = new ListBuffer<>();
for (Env<AttrContext> env: envs) {
flow(env, results);
}
@@ -1302,7 +1301,7 @@
* Perform dataflow checks on an attributed parse tree.
*/
public Queue<Env<AttrContext>> flow(Env<AttrContext> env) {
- ListBuffer<Env<AttrContext>> results = lb();
+ ListBuffer<Env<AttrContext>> results = new ListBuffer<>();
flow(env, results);
return stopIfError(CompileState.FLOW, results);
}
@@ -1356,7 +1355,7 @@
* @returns a list containing the classes to be generated
*/
public Queue<Pair<Env<AttrContext>, JCClassDecl>> desugar(Queue<Env<AttrContext>> envs) {
- ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = lb();
+ ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = new ListBuffer<>();
for (Env<AttrContext> env: envs)
desugar(env, results);
return stopIfError(CompileState.FLOW, results);
@@ -1605,7 +1604,7 @@
}
@Override
public void visitClassDef(JCClassDecl tree) {
- ListBuffer<JCTree> newdefs = lb();
+ ListBuffer<JCTree> newdefs = new ListBuffer<>();
for (List<JCTree> it = tree.defs; it.tail != null; it = it.tail) {
JCTree t = it.head;
switch (t.getTag()) {
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacAnnoConstructs.java Mon Sep 23 10:42:38 2013 +0200
@@ -207,7 +207,7 @@
Attribute[] contained0 = null;
if (container != null)
contained0 = unpackAttributes(container);
- ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
+ ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
if (contained0 != null) {
for (Attribute a : contained0)
if (a instanceof Attribute.Compound)
@@ -328,7 +328,7 @@
Attribute[] contained0 = null;
if (container != null)
contained0 = unpackAttributes(container);
- ListBuffer<Attribute.Compound> compounds = ListBuffer.lb();
+ ListBuffer<Attribute.Compound> compounds = new ListBuffer<>();
if (contained0 != null) {
for (Attribute a : contained0)
if (a instanceof Attribute.Compound)
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Mon Sep 23 10:42:38 2013 +0200
@@ -48,7 +48,6 @@
import static com.sun.tools.javac.parser.Tokens.TokenKind.IMPORT;
import static com.sun.tools.javac.parser.Tokens.TokenKind.LT;
import static com.sun.tools.javac.tree.JCTree.Tag.*;
-import static com.sun.tools.javac.util.ListBuffer.lb;
/** The parser maps a token sequence into an abstract syntax
* tree. It operates by recursive descent, with code derived
@@ -1767,7 +1766,7 @@
/** Arguments = "(" [Expression { COMMA Expression }] ")"
*/
List<JCExpression> arguments() {
- ListBuffer<JCExpression> args = lb();
+ ListBuffer<JCExpression> args = new ListBuffer<>();
if (token.kind == LPAREN) {
nextToken();
if (token.kind != RPAREN) {
@@ -1834,7 +1833,7 @@
nextToken();
return List.nil();
} else {
- ListBuffer<JCExpression> args = ListBuffer.lb();
+ ListBuffer<JCExpression> args = new ListBuffer<>();
args.append(((mode & EXPR) == 0) ? typeArgument() : parseType());
while (token.kind == COMMA) {
nextToken();
@@ -2175,7 +2174,7 @@
ListBuffer<JCExpression> dims = new ListBuffer<JCExpression>();
// maintain array dimension type annotations
- ListBuffer<List<JCAnnotation>> dimAnnotations = ListBuffer.lb();
+ ListBuffer<List<JCAnnotation>> dimAnnotations = new ListBuffer<>();
dimAnnotations.append(annos);
dims.append(parseExpression());
@@ -2626,7 +2625,7 @@
}
List<JCExpression> catchTypes() {
- ListBuffer<JCExpression> catchTypes = ListBuffer.lb();
+ ListBuffer<JCExpression> catchTypes = new ListBuffer<>();
catchTypes.add(parseType());
while (token.kind == BAR) {
checkMulticatch();
@@ -2708,7 +2707,7 @@
* | { FINAL | '@' Annotation } Type VariableDeclarators
*/
List<JCStatement> forInit() {
- ListBuffer<JCStatement> stats = lb();
+ ListBuffer<JCStatement> stats = new ListBuffer<>();
int pos = token.pos;
if (token.kind == FINAL || token.kind == MONKEYS_AT) {
return variableDeclarators(optFinal(0), parseType(), stats).toList();
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/Tokens.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/Tokens.java Mon Sep 23 10:42:38 2013 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -402,7 +402,7 @@
if (comments == null) {
return List.nil();
} else {
- ListBuffer<Comment> buf = ListBuffer.lb();
+ ListBuffer<Comment> buf = new ListBuffer<>();
for (Comment c : comments) {
if (c.getStyle() == style) {
buf.add(c);
--- a/langtools/src/share/classes/com/sun/tools/javac/util/GraphUtils.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/GraphUtils.java Mon Sep 23 10:42:38 2013 +0200
@@ -103,8 +103,8 @@
* directed graph in linear time. Works on TarjanNode.
*/
public static <D, N extends TarjanNode<D>> List<? extends List<? extends N>> tarjan(Iterable<? extends N> nodes) {
- ListBuffer<List<N>> cycles = ListBuffer.lb();
- ListBuffer<N> stack = ListBuffer.lb();
+ ListBuffer<List<N>> cycles = new ListBuffer<>();
+ ListBuffer<N> stack = new ListBuffer<>();
int index = 0;
for (N node: nodes) {
if (node.index == -1) {
@@ -132,7 +132,7 @@
}
if (v.lowlink == v.index) {
N n;
- ListBuffer<N> cycle = ListBuffer.lb();
+ ListBuffer<N> cycle = new ListBuffer<>();
do {
n = stack.remove();
n.active = false;
--- a/langtools/src/share/classes/com/sun/tools/javac/util/List.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/List.java Mon Sep 23 10:42:38 2013 +0200
@@ -97,7 +97,7 @@
}
public List<A> intersect(List<A> that) {
- ListBuffer<A> buf = ListBuffer.lb();
+ ListBuffer<A> buf = new ListBuffer<>();
for (A el : this) {
if (that.contains(el)) {
buf.append(el);
@@ -107,7 +107,7 @@
}
public List<A> diff(List<A> that) {
- ListBuffer<A> buf = ListBuffer.lb();
+ ListBuffer<A> buf = new ListBuffer<>();
for (A el : this) {
if (!that.contains(el)) {
buf.append(el);
@@ -120,7 +120,7 @@
* Create a new list from the first {@code n} elements of this list
*/
public List<A> take(int n) {
- ListBuffer<A> buf = ListBuffer.lb();
+ ListBuffer<A> buf = new ListBuffer<>();
int count = 0;
for (A el : this) {
if (count++ == n) break;
@@ -167,7 +167,7 @@
}
public static <A> List<A> from(Iterable<? extends A> coll) {
- ListBuffer<A> xs = ListBuffer.lb();
+ ListBuffer<A> xs = new ListBuffer<>();
for (A a : coll) {
xs.append(a);
}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java Mon Sep 23 10:42:38 2013 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,10 +40,6 @@
*/
public class ListBuffer<A> extends AbstractQueue<A> {
- public static <T> ListBuffer<T> lb() {
- return new ListBuffer<T>();
- }
-
public static <T> ListBuffer<T> of(T x) {
ListBuffer<T> lb = new ListBuffer<T>();
lb.add(x);
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Log.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Log.java Mon Sep 23 10:42:38 2013 +0200
@@ -123,7 +123,7 @@
* active diagnostic handler.
*/
public static class DeferredDiagnosticHandler extends DiagnosticHandler {
- private Queue<JCDiagnostic> deferred = ListBuffer.lb();
+ private Queue<JCDiagnostic> deferred = new ListBuffer<>();
private final Filter<JCDiagnostic> filter;
public DeferredDiagnosticHandler(Log log) {
--- a/langtools/test/tools/javac/cast/intersection/IntersectionTypeCastTest.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/test/tools/javac/cast/intersection/IntersectionTypeCastTest.java Mon Sep 23 10:42:38 2013 +0200
@@ -237,7 +237,7 @@
}
static List<CastInfo> allCastInfo() {
- ListBuffer<CastInfo> buf = ListBuffer.lb();
+ ListBuffer<CastInfo> buf = new ListBuffer<>();
for (CastKind kind : CastKind.values()) {
for (ClassKind clazz : ClassKind.values()) {
if (kind == CastKind.INTERFACE && clazz != ClassKind.OBJECT) {
--- a/langtools/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/test/tools/javac/lambda/intersection/IntersectionTargetTypeTest.java Mon Sep 23 10:42:38 2013 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -196,7 +196,7 @@
}
static List<CastInfo> allCastInfo() {
- ListBuffer<CastInfo> buf = ListBuffer.lb();
+ ListBuffer<CastInfo> buf = new ListBuffer<>();
for (CastKind kind : CastKind.values()) {
for (TypeKind b1 : TypeKind.values()) {
if (kind.nbounds == 1) {
--- a/langtools/test/tools/javac/scope/7017664/CompoundScopeTest.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/test/tools/javac/scope/7017664/CompoundScopeTest.java Mon Sep 23 10:42:38 2013 +0200
@@ -176,7 +176,7 @@
*/
void checkElems(CompoundScope cs, Filter<Symbol> sf) {
int count = 0;
- ListBuffer<Symbol> found = ListBuffer.lb();
+ ListBuffer<Symbol> found = new ListBuffer<>();
List<Symbol> allSymbols = sf == null ?
elems :
filter(elems, sf);
@@ -216,7 +216,7 @@
}
List<Symbol> filter(List<Symbol> elems, Filter<Symbol> sf) {
- ListBuffer<Symbol> res = ListBuffer.lb();
+ ListBuffer<Symbol> res = new ListBuffer<>();
for (Symbol s : elems) {
if (sf.accepts(s)) {
res.append(s);
--- a/langtools/test/tools/javac/types/TypeHarness.java Mon Sep 23 10:10:07 2013 +0200
+++ b/langtools/test/tools/javac/types/TypeHarness.java Mon Sep 23 10:42:38 2013 +0200
@@ -213,8 +213,8 @@
/** compute a type substitution on 't' given a list of type mappings */
public Type subst(Type t, Mapping... maps) {
- ListBuffer<Type> from = ListBuffer.lb();
- ListBuffer<Type> to = ListBuffer.lb();
+ ListBuffer<Type> from = new ListBuffer<>();
+ ListBuffer<Type> to = new ListBuffer<>();
for (Mapping tm : maps) {
from.append(tm.from);
to.append(tm.to);