summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2016-11-14 14:51:08 -0800
committerDavid Pursehouse <david.pursehouse@gmail.com>2016-11-14 15:46:28 -0800
commitca4ef2d24b7761fd366f8725c263d34965b3e76f (patch)
tree83f4be706d42c4c0bb02bbb208631f2c142dba3e /org.eclipse.jgit
parent8208da2f59ca13d93bd396e2f8189b0fefdb764d (diff)
downloadjgit-ca4ef2d24b7761fd366f8725c263d34965b3e76f.tar.gz
jgit-ca4ef2d24b7761fd366f8725c263d34965b3e76f.zip
Add missing @Override found by ErrorProne
Change-Id: I585242507815aad4aa0103fd55a6c369e342ab33
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java24
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java8
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java9
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java1
4 files changed, 25 insertions, 17 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
index ed1281bc6c..0388acbbaf 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
@@ -182,10 +182,12 @@ public class FileRepository extends Repository {
getFS());
else
systemConfig = new FileBasedConfig(null, FS.DETECTED) {
+ @Override
public void load() {
// empty, do not load
}
+ @Override
public boolean isOutdated() {
// regular class would bomb here
return false;
@@ -202,6 +204,7 @@ public class FileRepository extends Repository {
loadRepoConfig();
repoConfig.addChangeListener(new ConfigChangedListener() {
+ @Override
public void onConfigChanged(ConfigChangedEvent event) {
fireEvent(event);
}
@@ -284,6 +287,7 @@ public class FileRepository extends Repository {
* @throws IOException
* in case of IO problem
*/
+ @Override
public void create(boolean bare) throws IOException {
final FileBasedConfig cfg = getConfig();
if (cfg.getFile().exists()) {
@@ -381,21 +385,20 @@ public class FileRepository extends Repository {
return objectDatabase.getDirectory();
}
- /**
- * @return the object database which stores this repository's data.
- */
+ /** @return the object database storing this repository's data. */
+ @Override
public ObjectDirectory getObjectDatabase() {
return objectDatabase;
}
/** @return the reference database which stores the reference namespace. */
+ @Override
public RefDatabase getRefDatabase() {
return refs;
}
- /**
- * @return the configuration of this repository
- */
+ /** @return the configuration of this repository. */
+ @Override
public FileBasedConfig getConfig() {
if (systemConfig.isOutdated()) {
try {
@@ -484,6 +487,7 @@ public class FileRepository extends Repository {
*
* @return unmodifiable collection of other known objects.
*/
+ @Override
public Set<ObjectId> getAdditionalHaves() {
HashSet<ObjectId> r = new HashSet<ObjectId>();
for (AlternateHandle d : objectDatabase.myAlternates()) {
@@ -522,9 +526,7 @@ public class FileRepository extends Repository {
detectIndexChanges();
}
- /**
- * Detect index changes.
- */
+ /** Detect index changes. */
private void detectIndexChanges() {
if (isBare())
return;
@@ -548,6 +550,7 @@ public class FileRepository extends Repository {
* named ref does not exist.
* @throws IOException the ref could not be accessed.
*/
+ @Override
public ReflogReader getReflogReader(String refName) throws IOException {
Ref ref = findRef(refName);
if (ref != null)
@@ -585,6 +588,7 @@ public class FileRepository extends Repository {
globalAttributesNode = new GlobalAttributesNode(repo);
}
+ @Override
public AttributesNode getInfoAttributesNode() throws IOException {
if (infoAttributesNode instanceof InfoAttributesNode)
infoAttributesNode = ((InfoAttributesNode) infoAttributesNode)
@@ -592,6 +596,7 @@ public class FileRepository extends Repository {
return infoAttributesNode;
}
+ @Override
public AttributesNode getGlobalAttributesNode() throws IOException {
if (globalAttributesNode instanceof GlobalAttributesNode)
globalAttributesNode = ((GlobalAttributesNode) globalAttributesNode)
@@ -625,5 +630,4 @@ public class FileRepository extends Repository {
throw new JGitInternalException(JGitText.get().gcFailed, e);
}
}
-
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java
index f6613d5832..95cb976372 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdOwnerMap.java
@@ -143,6 +143,7 @@ public class ObjectIdOwnerMap<V extends ObjectIdOwnerMap.Entry>
* object to find.
* @return true if the mapping exists for this object; false otherwise.
*/
+ @Override
public boolean contains(final AnyObjectId toFind) {
return get(toFind) != null;
}
@@ -219,20 +220,20 @@ public class ObjectIdOwnerMap<V extends ObjectIdOwnerMap.Entry>
return size == 0;
}
+ @Override
public Iterator<V> iterator() {
return new Iterator<V>() {
private int found;
-
private int dirIdx;
-
private int tblIdx;
-
private V next;
+ @Override
public boolean hasNext() {
return found < size;
}
+ @Override
public V next() {
if (next != null)
return found(next);
@@ -261,6 +262,7 @@ public class ObjectIdOwnerMap<V extends ObjectIdOwnerMap.Entry>
return v;
}
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
index 5179696417..8b6b28d7c8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
@@ -107,8 +107,7 @@ import org.slf4j.LoggerFactory;
* This class is thread-safe.
*/
public abstract class Repository implements AutoCloseable {
- private static Logger LOG = LoggerFactory.getLogger(Repository.class);
-
+ private static final Logger LOG = LoggerFactory.getLogger(Repository.class);
private static final ListenerList globalListeners = new ListenerList();
/** @return the global listener list observing all events in this JVM. */
@@ -869,6 +868,7 @@ public abstract class Repository implements AutoCloseable {
}
/** Decrement the use count, and maybe close resources. */
+ @Override
public void close() {
int newCount = useCnt.decrementAndGet();
if (newCount == 0) {
@@ -902,8 +902,9 @@ public abstract class Repository implements AutoCloseable {
getRefDatabase().close();
}
- @NonNull
@SuppressWarnings("nls")
+ @Override
+ @NonNull
public String toString() {
String desc;
File directory = getDirectory();
@@ -1175,7 +1176,7 @@ public abstract class Repository implements AutoCloseable {
// we want DirCache to inform us so that we can inform registered
// listeners about index changes
IndexChangedListener l = new IndexChangedListener() {
-
+ @Override
public void onIndexChanged(IndexChangedEvent event) {
notifyIndexChanged();
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
index 543511609d..0a8bf62f95 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
@@ -430,6 +430,7 @@ public class RepositoryCache {
return path;
}
+ @Override
public Repository open(final boolean mustExist) throws IOException {
if (mustExist && !isGitRepository(path, fs))
throw new RepositoryNotFoundException(path);