Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
TRAVIS_JOB_NUMBER=3945.1
TRAVIS_COMMIT_RANGE=f6c43c63b616...1a690ed
  • Loading branch information
pmd-bot committed Jul 1, 2019
1 parent 1a690ed commit 85186f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/pages/pmd/rules/java/bestpractices.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,12 @@ accessible from outside the anonymous class, and those legit cases should be sup

``` java
// this is double-brace initialization
return new ArrayList<String>(){{addAll("a","b","c");}};
return new ArrayList<String>(){%raw%}{{ addAll("a","b","c"); }};{%endraw%}

// the better way is to not create an anonymous class:
List<String> a=new ArrayList<>();
a.addAll("a","b","c");
return a;
// the better way is to not create an anonymous class:
List<String> a = new ArrayList<>();
a.addAll("a","b","c");
return a;
```

**Use this rule by referencing it:**
Expand Down

0 comments on commit 85186f4

Please sign in to comment.