Skip to main content
summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorBrian Vosburgh2015-10-15 19:31:34 +0000
committerBrian Vosburgh2015-10-16 21:01:01 +0000
commit53d35f0e43dc9105109d0dfc8708c44733c48a04 (patch)
tree5fba30f19c48008eb28208e92305690f5b6917ef /common
parentc372dec6210c2af17a17480ea5bcc273e154b65e (diff)
downloadwebtools.dali-53d35f0e43dc9105109d0dfc8708c44733c48a04.tar.gz
webtools.dali-53d35f0e43dc9105109d0dfc8708c44733c48a04.tar.xz
webtools.dali-53d35f0e43dc9105109d0dfc8708c44733c48a04.zip
remove various SynchronizedBoolean Command methods
Diffstat (limited to 'common')
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/SynchronizedBoolean.java112
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/reference/SynchronizedBooleanTests.java108
2 files changed, 0 insertions, 220 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/SynchronizedBoolean.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/SynchronizedBoolean.java
index 931479ed0b..4da99779ca 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/SynchronizedBoolean.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/reference/SynchronizedBoolean.java
@@ -378,51 +378,6 @@ public class SynchronizedBoolean
this.waitToSetValue(false);
}
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to the specified value,
- * then execute the specified command.
- * If the <code>boolean</code> value is already equal to the specified
- * value, execute the specified command immediately.
- */
- public void whenValueIs(boolean b, InterruptibleCommand command) throws InterruptedException {
- this.waitUntilValueIs(b);
- command.execute();
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to the NOT of the specified value,
- * then execute the specified command.
- * If the <code>boolean</code> value is already the NOT of the specified
- * value, execute the specified command immediately.
- */
- public void whenValueIsNot(boolean b, InterruptibleCommand command) throws InterruptedException {
- this.whenValueIs( ! b, command);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to <code>true</code>,
- * then execute the specified command.
- * If the <code>boolean</code> value is already <code>true</code>,
- * execute the specified command immediately.
- */
- public void whenTrueExecute(InterruptibleCommand command) throws InterruptedException {
- this.whenValueIs(true, command);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to <code>false</code>,
- * then execute the specified command.
- * If the <code>boolean</code> value is already <code>false</code>,
- * execute the specified command immediately.
- */
- public void whenFalseExecute(InterruptibleCommand command) throws InterruptedException {
- this.whenValueIs(false, command);
- }
-
// ********** timed waits **********
@@ -578,73 +533,6 @@ public class SynchronizedBoolean
return this.waitToSetValue(false, timeout);
}
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to the specified value or the specified time-out occurs;
- * then, if a time-out did not occur, execute the specified command.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the command was executed;
- * return <code>false</code> if a time-out occurred.
- * If the <code>boolean</code> value is already the specified value,
- * execute the specified command immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean whenValueIs(boolean b, InterruptibleCommand command, long timeout) throws InterruptedException {
- boolean success = false;
- synchronized (this.mutex) {
- success = this.waitUntilValueIs_(b, timeout);
- }
- if (success) {
- command.execute();
- }
- return success;
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to the NOT of the specified value or the specified time-out occurs;
- * then, if a time-out did not occur, execute the specified command.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the command was executed;
- * return <code>false</code> if a time-out occurred.
- * If the <code>boolean</code> value is already the NOT of the specified value,
- * execute the specified command immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean whenValueIsNot(boolean b, InterruptibleCommand command, long timeout) throws InterruptedException {
- return this.whenValueIs( ! b, command, timeout);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to <code>true</code> or the specified time-out occurs;
- * then, if a time-out did not occur, execute the specified command.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the command was executed;
- * return <code>false</code> if a time-out occurred.
- * If the <code>boolean</code> value is already <code>true</code>,
- * execute the specified command immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean whenTrueExecute(InterruptibleCommand command, long timeout) throws InterruptedException {
- return this.whenValueIs(true, command, timeout);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to <code>false</code> or the specified time-out occurs;
- * then, if a time-out did not occur, execute the specified command.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the command was executed;
- * return <code>false</code> if a time-out occurred.
- * If the <code>boolean</code> value is already <code>false</code>,
- * execute the specified command immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean whenFalseExecute(InterruptibleCommand command, long timeout) throws InterruptedException {
- return this.whenValueIs(false, command, timeout);
- }
-
// ********** synchronized behavior **********
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/reference/SynchronizedBooleanTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/reference/SynchronizedBooleanTests.java
index 16f8d03c73..0a31ad2244 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/reference/SynchronizedBooleanTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/reference/SynchronizedBooleanTests.java
@@ -610,114 +610,6 @@ public class SynchronizedBooleanTests
assertFalse(this.sb.getValue());
}
- public void testWhenTrueExecute() throws Exception {
- this.sb.setTrue();
- final ModifiableBooleanReference done = new SimpleBooleanReference(false);
- this.sb.whenTrueExecute(new InterruptibleCommandAdapter() {
- @Override
- public void execute() throws InterruptedException {
- done.setTrue();
- }
- });
- assertTrue(done.getValue());
- }
-
- public void testWhenFalseExecute() throws Exception {
- this.sb.setFalse();
- final ModifiableBooleanReference done = new SimpleBooleanReference(false);
- this.sb.whenFalseExecute(new InterruptibleCommandAdapter() {
- @Override
- public void execute() throws InterruptedException {
- done.setTrue();
- }
- });
- assertTrue(done.getValue());
- }
-
- public void testWhenValueIsNotTrue() throws Exception {
- this.sb.setFalse();
- final ModifiableBooleanReference done = new SimpleBooleanReference(false);
- this.sb.whenValueIsNot(true, new InterruptibleCommandAdapter() {
- @Override
- public void execute() throws InterruptedException {
- done.setTrue();
- }
- });
- assertTrue(done.getValue());
- }
-
- public void testWhenValueIsNotFalse() throws Exception {
- this.sb.setTrue();
- final ModifiableBooleanReference done = new SimpleBooleanReference(false);
- this.sb.whenValueIsNot(false, new InterruptibleCommandAdapter() {
- @Override
- public void execute() throws InterruptedException {
- done.setTrue();
- }
- });
- assertTrue(done.getValue());
- }
-
- public void testWhenTrueExecuteTimeout() throws Exception {
- this.sb.setTrue();
- final ModifiableBooleanReference done = new SimpleBooleanReference(false);
- this.sb.whenTrueExecute(new InterruptibleCommandAdapter() {
- @Override
- public void execute() throws InterruptedException {
- done.setTrue();
- }
- }, 500);
- assertTrue(done.getValue());
- }
-
- public void testWhenFalseExecuteTimeout() throws Exception {
- this.sb.setFalse();
- final ModifiableBooleanReference done = new SimpleBooleanReference(false);
- this.sb.whenFalseExecute(new InterruptibleCommandAdapter() {
- @Override
- public void execute() throws InterruptedException {
- done.setTrue();
- }
- }, 500);
- assertTrue(done.getValue());
- }
-
- public void testWhenValueIsNotTrueTimeout() throws Exception {
- this.sb.setFalse();
- final ModifiableBooleanReference done = new SimpleBooleanReference(false);
- this.sb.whenValueIsNot(true, new InterruptibleCommandAdapter() {
- @Override
- public void execute() throws InterruptedException {
- done.setTrue();
- }
- }, 500);
- assertTrue(done.getValue());
- }
-
- public void testWhenValueIsNotFalseTimeout() throws Exception {
- this.sb.setTrue();
- final ModifiableBooleanReference done = new SimpleBooleanReference(false);
- this.sb.whenValueIsNot(false, new InterruptibleCommandAdapter() {
- @Override
- public void execute() throws InterruptedException {
- done.setTrue();
- }
- }, 500);
- assertTrue(done.getValue());
- }
-
- public void testWhenValueIsNotFalseTimeout2() throws Exception {
- this.sb.setFalse();
- final ModifiableBooleanReference done = new SimpleBooleanReference(false);
- this.sb.whenValueIsNot(false, new InterruptibleCommandAdapter() {
- @Override
- public void execute() throws InterruptedException {
- done.setTrue();
- }
- }, 500);
- assertFalse(done.getValue()); // timeout
- }
-
public void testExecute() throws Exception {
final ModifiableBooleanReference done = new SimpleBooleanReference(false);
this.sb.execute(new InterruptibleCommandAdapter() {

Back to the top