Skip to content

Commit 56c883d

Browse files
committed
[refactor] Java7: explicit type van be replaced by <>
1 parent 66432d2 commit 56c883d

File tree

11 files changed

+30
-28
lines changed

11 files changed

+30
-28
lines changed

exist-core/src/main/java/org/exist/config/Configurator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,8 @@ public AField findByAnnotationValue(final String value) {
14181418

14191419
@Override
14201420
public Iterator<AField> iterator() {
1421-
return new Iterator<AField>() {
1422-
1421+
return new Iterator<>() {
1422+
14231423
private final Iterator<AField<ConfigurationFieldAsAttribute>> itAttributes = attributes.iterator();
14241424
private final Iterator<AField<ConfigurationFieldAsElement>> itElements = elements.iterator();
14251425

@@ -1432,10 +1432,10 @@ public boolean hasNext() {
14321432
public AField next() {
14331433
if (itAttributes.hasNext()) {
14341434
return itAttributes.next();
1435-
1435+
14361436
} else if (itElements.hasNext()) {
14371437
return itElements.next();
1438-
1438+
14391439
} else {
14401440
throw new NoSuchElementException();
14411441
}

exist-core/src/main/java/org/exist/dom/persistent/NamedNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected NamedNode(final Expression expression, final NamedNode<T> other) {
7474
* Extracts just the details of the NamedNode
7575
*/
7676
public NamedNode<T> extract() {
77-
return new NamedNode<T>(getExpression(), this) {
77+
return new NamedNode<>(getExpression(), this) {
7878
};
7979
}
8080

exist-core/src/main/java/org/exist/dom/persistent/NodeProxy.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ public DocumentSet getDocumentSet() {
10731073

10741074
@Override
10751075
public Iterator<Collection> getCollectionIterator() {
1076-
return new Iterator<Collection>() {
1076+
return new Iterator<>() {
10771077
boolean hasNext = true;
10781078

10791079
@Override
@@ -1417,7 +1417,7 @@ public final void setPosition(final NodeProxy proxy) {
14171417

14181418
@Override
14191419
public Iterator<DocumentImpl> getDocumentIterator() {
1420-
return new Iterator<DocumentImpl>() {
1420+
return new Iterator<>() {
14211421

14221422
private boolean hasMore = true;
14231423

@@ -1428,7 +1428,7 @@ public final boolean hasNext() {
14281428

14291429
@Override
14301430
public final DocumentImpl next() {
1431-
if(!hasMore) {
1431+
if (!hasMore) {
14321432
throw new NoSuchElementException();
14331433
} else {
14341434
hasMore = false;

exist-core/src/main/java/org/exist/http/jaxb/Collection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class Collection {
9999
*/
100100
public List<Collection> getCollection() {
101101
if (collection == null) {
102-
collection = new ArrayList<Collection>();
102+
collection = new ArrayList<>();
103103
}
104104
return this.collection;
105105
}

exist-core/src/main/java/org/exist/http/jaxb/Query.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ public static class Properties {
506506
*/
507507
public List<Query.Properties.Property> getProperty() {
508508
if (property == null) {
509-
property = new ArrayList<Query.Properties.Property>();
509+
property = new ArrayList<>();
510510
}
511511
return this.property;
512512
}

exist-core/src/main/java/org/exist/http/jaxb/Result.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void setCollection(Collection value) {
136136
*/
137137
public List<Result.Value> getValue() {
138138
if (value == null) {
139-
value = new ArrayList<Result.Value>();
139+
value = new ArrayList<>();
140140
}
141141
return this.value;
142142
}
@@ -319,7 +319,7 @@ public static class Value {
319319
*/
320320
public List<Object> getContent() {
321321
if (content == null) {
322-
content = new ArrayList<Object>();
322+
content = new ArrayList<>();
323323
}
324324
return this.content;
325325
}

exist-core/src/main/java/org/exist/http/jaxb/Sequence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public class Sequence {
9696
*/
9797
public List<Sequence.Value> getValue() {
9898
if (value == null) {
99-
value = new ArrayList<Sequence.Value>();
99+
value = new ArrayList<>();
100100
}
101101
return this.value;
102102
}

exist-core/src/main/java/org/exist/http/servlets/XSLTServlet.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ public class XSLTServlet extends HttpServlet {
8686
private final static Logger LOG = LogManager.getLogger(XSLTServlet.class);
8787

8888
private final static XSLTErrorsListener<ServletException> errorListener =
89-
new XSLTErrorsListener<ServletException>(true, false) {
89+
new XSLTErrorsListener<>(true, false) {
9090

91-
@Override
92-
protected void raiseError(final String error, final TransformerException ex) throws ServletException {
93-
throw new ServletException(error, ex);
94-
}
95-
};
91+
@Override
92+
protected void raiseError(final String error, final TransformerException ex) throws ServletException {
93+
throw new ServletException(error, ex);
94+
}
95+
};
9696

9797
private BrokerPool pool;
9898

exist-core/src/main/java/org/exist/security/internal/RealmImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ protected RealmImpl(final DBBroker broker, final SecurityManagerImpl sm, final C
105105

106106
//guest group
107107
GROUP_GUEST = new GroupImpl(broker, this, GUEST_GROUP_ID, SecurityManager.GUEST_GROUP);
108-
GROUP_GUEST.setManagers(new ArrayList<Reference<SecurityManager, Account>>(){
109-
{ add(new ReferenceImpl<>(sm, "getAccount", SecurityManager.DBA_USER)); }
108+
GROUP_GUEST.setManagers(new ArrayList<>() {
109+
{
110+
add(new ReferenceImpl<>(sm, "getAccount", SecurityManager.DBA_USER));
111+
}
110112
});
111113
GROUP_GUEST.setMetadataValue(EXistSchemaType.DESCRIPTION, "Anonymous Users");
112114
sm.registerGroup(GROUP_GUEST);

exist-core/src/main/java/org/exist/xmldb/RemoteRestoreService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ private Path zipBackupDir(final Path dir, final RestoreServiceTaskListener resto
242242
final Path zipFile = Files.createTempFile("remote-restore-service", "zip");
243243
try (final OutputStream fos = new BufferedOutputStream(Files.newOutputStream(zipFile));
244244
final ZipOutputStream zos = new ZipOutputStream(fos)) {
245-
Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
245+
Files.walkFileTree(dir, new SimpleFileVisitor<>() {
246246
@Override
247247
public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException {
248248
final Path zipEntryPath = dir.relativize(file);

0 commit comments

Comments
 (0)