Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/main/java/org/eolang/lints/LtAsciiOnly.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@
* For now we just reusing object line number (via @line), which is not correct
* for specifying on which line of the program comment is located. This issue
* can be solved after <a href="https://github.com/objectionary/eo/issues/3536">this one</a>.
* @todo #402:15min Replace the creation of new ArrayList<>(0) with the creation of
* ArrayList<>() without a constructor argument in whole project. Add ignore warning
* ConditionalRegexpMultilineCheck from Checkstyle (it doesn't seem to be possible at the moment
* <a href="https://github.com/yegor256/qulice/issues/1328">issue 1328</a>)
* @checkstyle StringLiteralsConcatenationCheck (30 lines)
*/
final class LtAsciiOnly implements Lint {

@Override
public Collection<Defect> defects(final XML xmir) throws IOException {
final Collection<Defect> defects = new ArrayList<>(0);
final Collection<Defect> defects = new ArrayList<>();
final Xnav xml = new Xnav(xmir.inner());
final List<Xnav> comments = xml.path("/object/comments/comment")
.collect(Collectors.toList());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/eolang/lints/LtByXsl.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public String name() {

@Override
public Collection<Defect> defects(final XML xmir) {
final Collection<Defect> defects = new ArrayList<>(0);
final Collection<Defect> defects = new ArrayList<>();
for (final XML defect : LtByXsl.findDefects(this.sheet.value().transform(xmir))) {
final Xnav xml = new Xnav(defect.inner());
final Optional<String> sever = xml.attribute("severity").text();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/eolang/lints/LtUnlint.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public String name() {

@Override
public Collection<Defect> defects(final XML xmir) throws IOException {
final Collection<Defect> defects = new ArrayList<>(0);
final Collection<Defect> defects = new ArrayList<>();
final String lname = this.origin.name();
final Collection<Defect> found = this.origin.defects(xmir);
final List<Integer> problematic = found.stream()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/eolang/lints/Source.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Source without(final String... names) {
*/
public Collection<Defect> defects() {
try {
final Collection<Defect> messages = new ArrayList<>(0);
final Collection<Defect> messages = new ArrayList<>();
for (final Lint lint : this.lints) {
messages.addAll(new ScopedDefects(lint.defects(this.xmir), "S"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/matchers/DefectMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class DefectMatcher extends BaseMatcher<Defect> {
/**
* Synthetic matcher that is built when input arrives.
*/
private final List<Matcher<?>> matchers = new ArrayList<>(0);
private final List<Matcher<?>> matchers = new ArrayList<>();

@Override
public boolean matches(final Object input) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/matchers/DefectsMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class DefectsMatcher extends BaseMatcher<XML> {

@Override
public boolean matches(final Object xml) {
final Collection<Defect> defects = new ArrayList<>(0);
final Collection<Defect> defects = new ArrayList<>();
for (final XML defect : ((XML) xml).nodes("/defects/defect")) {
defects.add(
new Defect.Default(
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/eolang/lints/SourceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ private static boolean lineCountWithinBounds(final SourceSize src) {
* @return Benchmark results
*/
private static Map<Map<SourceSize, Collection<Defect>>, String> benchmarkResults() {
final List<Map<SourceSize, Collection<Defect>>> results = new ArrayList<>(0);
final List<Map<SourceSize, Collection<Defect>>> results = new ArrayList<>();
final StringBuilder sum = new StringBuilder();
for (final SourceSize source : SourceSize.values()) {
final long before = System.currentTimeMillis();
Expand Down Expand Up @@ -617,7 +617,7 @@ private static final class BcSource {
*/
Collection<Defect> defects() {
try {
final Collection<Defect> messages = new ArrayList<>(0);
final Collection<Defect> messages = new ArrayList<>();
for (final Lint lint : this.lints) {
messages.addAll(this.timed(lint));
}
Expand Down
Loading