Skip to content

Commit 30de320

Browse files
turbanoffjonathan-gibbons
authored andcommittedDec 9, 2020
6882207: Convert javap to use diamond operator internally
Reviewed-by: jjg
1 parent d33a689 commit 30de320

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
 

‎src/jdk.jdeps/share/classes/com/sun/tools/javap/CodeWriter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@ public void writeInstr(Instruction instr) {
128128
}
129129
// where
130130
Instruction.KindVisitor<Void,Integer> instructionPrinter =
131-
new Instruction.KindVisitor<Void,Integer>() {
131+
new Instruction.KindVisitor<>() {
132132

133133
public Void visitNoOperands(Instruction instr, Integer indent) {
134134
return null;

‎src/jdk.jdeps/share/classes/com/sun/tools/javap/ConstantWriter.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@ protected void writeConstantPool() {
6060
}
6161

6262
protected void writeConstantPool(ConstantPool constant_pool) {
63-
ConstantPool.Visitor<Integer, Void> v = new ConstantPool.Visitor<Integer,Void>() {
63+
ConstantPool.Visitor<Integer, Void> v = new ConstantPool.Visitor<>() {
6464
public Integer visitClass(CONSTANT_Class_info info, Void p) {
6565
print("#" + info.name_index);
6666
tab();
@@ -545,6 +545,6 @@ private static String addEscapes(String name) {
545545
return buf.toString();
546546
}
547547

548-
private ClassWriter classWriter;
549-
private Options options;
548+
private final ClassWriter classWriter;
549+
private final Options options;
550550
}

‎src/jdk.jdeps/share/classes/com/sun/tools/javap/JavapTask.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ private void reportWarning(String key, Object... args) {
10241024

10251025
private Diagnostic<JavaFileObject> createDiagnostic(
10261026
final Diagnostic.Kind kind, final String key, final Object... args) {
1027-
return new Diagnostic<JavaFileObject>() {
1027+
return new Diagnostic<>() {
10281028
public Kind getKind() {
10291029
return kind;
10301030
}

0 commit comments

Comments
 (0)
Please sign in to comment.