Permalink
Show file tree
Hide file tree
1 comment
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
8266027: The diamond finder does not find diamond candidates in field…
… initializers Reviewed-by: jfranck, vromero
- Loading branch information
Showing
3 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,29 @@ | ||
/** | ||
* @test /nodynamiccopyright/ | ||
* @bug 8266027 | ||
* @summary Verify the diamond finder works on fields with modifiers. | ||
* @compile/ref=DiamondFields.out -XDfind=diamond -XDrawDiagnostics DiamondFields.java | ||
*/ | ||
|
||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
public class DiamondFields { | ||
List<String> f1 = new LinkedList<String>(); | ||
private List<String> f2 = new LinkedList<String>(); | ||
static List<String> f3 = new LinkedList<String>(); | ||
@Deprecated List<String> f4 = new LinkedList<String>(); | ||
final List<String> f5 = new LinkedList<String>(); | ||
|
||
DiamondFields() { | ||
List<String> l1 = new LinkedList<String>(); | ||
final List<String> l2 = new LinkedList<String>(); | ||
@Deprecated List<String> l3 = new LinkedList<String>(); | ||
} | ||
|
||
void t() { | ||
List<String> l1 = new LinkedList<String>(); | ||
final List<String> l2 = new LinkedList<String>(); | ||
@Deprecated List<String> l3 = new LinkedList<String>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,12 @@ | ||
DiamondFields.java:12:49: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:13:49: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:14:49: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:15:49: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:16:49: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:19:41: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:20:47: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:21:53: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:25:41: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:26:47: compiler.warn.diamond.redundant.args | ||
DiamondFields.java:27:53: compiler.warn.diamond.redundant.args | ||
11 warnings |
f0f6b0d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Issues