Remove unnecessary method.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / WebOfTrustUpdater.java
index 4d0528b..67bf3ac 100644 (file)
@@ -102,18 +102,6 @@ public class WebOfTrustUpdater extends AbstractService {
        }
 
        /**
-        * Adds the given context to the given own identity.
-        *
-        * @param ownIdentity
-        *              The own identity to add the context to
-        * @param context
-        *              The context to add
-        */
-       public void addContext(OwnIdentity ownIdentity, String context) {
-               addContextWait(ownIdentity, context, false);
-       }
-
-       /**
         * Adds the given context to the given own identity, waiting for completion of
         * the operation.
         *
@@ -125,25 +113,6 @@ public class WebOfTrustUpdater extends AbstractService {
         *         otherwise
         */
        public boolean addContextWait(OwnIdentity ownIdentity, String context) {
-               return addContextWait(ownIdentity, context, true);
-       }
-
-       /**
-        * Adds the given context to the given own identity, waiting for completion of
-        * the operation.
-        *
-        * @param ownIdentity
-        *              The own identity to add the context to
-        * @param context
-        *              The context to add
-        * @param wait
-        *              {@code true} to wait for the end of the operation, {@code false} to return
-        *              immediately
-        * @return {@code true} if the context was added successfully, {@code false} if
-        *         the context was not added successfully, or if the job should not
-        *         wait for completion
-        */
-       private boolean addContextWait(OwnIdentity ownIdentity, String context, boolean wait) {
                AddContextJob addContextJob = new AddContextJob(ownIdentity, context);
                if (!updateJobs.contains(addContextJob)) {
                        logger.log(Level.FINER, "Adding Context Job: " + addContextJob);
@@ -152,10 +121,8 @@ public class WebOfTrustUpdater extends AbstractService {
                        } catch (InterruptedException ie1) {
                                /* the queue is unbounded so it should never block. */
                        }
-                       if (wait) {
-                               return addContextJob.waitForCompletion();
-                       }
-               } else if (wait) {
+                       return addContextJob.waitForCompletion();
+               } else {
                        for (WebOfTrustUpdateJob updateJob : updateJobs) {
                                if (updateJob.equals(addContextJob)) {
                                        return updateJob.waitForCompletion();
@@ -230,7 +197,7 @@ public class WebOfTrustUpdater extends AbstractService {
                while (!shouldStop()) {
                        try {
                                WebOfTrustUpdateJob updateJob = updateJobs.take();
-                               if (shouldStop() || (updateJob == stopJob)) {
+                               if (shouldStop()) {
                                        break;
                                }
                                logger.log(Level.FINE, "Running Trust Update Job: " + updateJob);
@@ -332,7 +299,8 @@ public class WebOfTrustUpdater extends AbstractService {
         *
         * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
         */
-       private class SetTrustJob extends WebOfTrustUpdateJob {
+       @VisibleForTesting
+       class SetTrustJob extends WebOfTrustUpdateJob {
 
                /** The identity giving the trust. */
                private final OwnIdentity truster;