Skip to content

Commit

Permalink
#779 DiamondOperator complains when instantiating/assigning inner typ…
Browse files Browse the repository at this point in the history
…es (fix remarks)
  • Loading branch information
dskalenko committed Jul 27, 2016
1 parent d9ab374 commit ccd0423
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public static void innerClassUsage() {
interface SimpleInterface {

/**
* Inner class with generic parament.
* @param <E> generic parament
* Inner class with generic parameter.
* @param <E> generic parameter
*/
final class InnerClass<E> implements SimpleInterface {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ public List<String> firstTen(final String... args) {
}

/**
* Correct diamonds usage when instantiate an inner class type,
* because there is no way that the diamond operator can be applied.
* Correct diamonds usage when instantiate an inner class type.
*/
public static void innerClassUsage() {
final SimpleInterface.InnerClass inner =
new SimpleInterface.InnerClass();
final SimpleInterface.InnerClass<String> inner =
new SimpleInterface.InnerClass<>();
}

/**
Expand All @@ -42,9 +41,10 @@ public static void innerClassUsage() {
interface SimpleInterface {

/**
* Inner class.
* Inner class with generic parameter.
* @param <E> generic parameter
*/
final class InnerClass implements SimpleInterface {
final class InnerClass<E> implements SimpleInterface {

}
}
Expand Down

0 comments on commit ccd0423

Please sign in to comment.