aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/util/Optionally.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/Optionally.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/Optionally.java
index 3447f669ab..270b760562 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/Optionally.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/util/Optionally.java
@@ -53,24 +53,24 @@ public interface Optionally<T> {
/**
* The mutable optional object
*/
- protected T element;
+ protected Optional<T> optional;
/**
* @param element
* the mutable optional object
*/
public Hard(T element) {
- this.element = element;
+ optional = Optional.ofNullable(element);
}
@Override
public void clear() {
- element = null;
+ optional = Optional.empty();
}
@Override
public Optional<T> getOptional() {
- return Optional.ofNullable(element);
+ return optional;
}
}