Skip to content

Commit 1dd8dcc

Browse files
committed
Polish "Polish JarFile to extra anonymous inner class"
See gh-20882
1 parent e0d1cf0 commit 1dd8dcc

File tree

1 file changed

+10
-17
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar

1 file changed

+10
-17
lines changed

spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -191,8 +191,7 @@ public Manifest getManifest() throws IOException {
191191

192192
@Override
193193
public Enumeration<java.util.jar.JarEntry> entries() {
194-
final Iterator<JarEntry> iterator = this.entries.iterator();
195-
return new EnumerationJarEntry(iterator);
194+
return new JarEntryEnumeration(this.entries.iterator());
196195
}
197196

198197
public JarEntry getJarEntry(CharSequence name) {
@@ -410,21 +409,13 @@ enum JarFileType {
410409
}
411410

412411
/**
413-
* The type Enumeration jar entry.
412+
* An {@link Enumeration} on {@linkplain java.util.jar.JarEntry jar entries}.
414413
*/
415-
static class EnumerationJarEntry implements Enumeration<java.util.jar.JarEntry> {
416-
417-
/**
418-
* The Iterator.
419-
*/
420-
Iterator<JarEntry> iterator;
421-
422-
/**
423-
* Instantiates a new Enumeration jar entry.
424-
*
425-
* @param iterator the iterator
426-
*/
427-
EnumerationJarEntry(Iterator<JarEntry> iterator) {
414+
private static class JarEntryEnumeration implements Enumeration<java.util.jar.JarEntry> {
415+
416+
private final Iterator<JarEntry> iterator;
417+
418+
JarEntryEnumeration(Iterator<JarEntry> iterator) {
428419
this.iterator = iterator;
429420
}
430421

@@ -437,5 +428,7 @@ public boolean hasMoreElements() {
437428
public java.util.jar.JarEntry nextElement() {
438429
return this.iterator.next();
439430
}
431+
440432
}
433+
441434
}

0 commit comments

Comments
 (0)