Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General code quality fix-4 #46

Merged
merged 1 commit into from
Feb 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
*/
public class Semaphore {

private java.util.concurrent.Semaphore semaphore;
private java.util.concurrent.Semaphore semaphoreLock;

/**
* Standard constructor.
*/
public Semaphore() {
semaphore = new java.util.concurrent.Semaphore(0);
semaphoreLock = new java.util.concurrent.Semaphore(0);
}

/**
Expand All @@ -46,19 +46,19 @@ public Semaphore() {
*/
public void acquire() throws InterruptedException {
int take;
if (semaphore.availablePermits() < 1) {
if (semaphoreLock.availablePermits() < 1) {
take = 1;
} else {
take = semaphore.availablePermits();
take = semaphoreLock.availablePermits();
}
semaphore.acquire(take);
semaphoreLock.acquire(take);
}

/**
* @see java.util.concurrent.Semaphore#release()
* Releases a permit, returning it to the semaphore.
*/
public void release() {
semaphore.release();
semaphoreLock.release();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private boolean isSlave() {
if (computer == null) {
return false;
}
return (computer.getNode() instanceof Slave);
return computer.getNode() instanceof Slave;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public class FoundIndication {
*/
protected static final String FILE_ENCODING = System.getProperty("file.encoding");
private String matchingFile;
/**
* @deprecated, kept for backwards compatibility.
*/
@Deprecated
private transient Integer matchingLine;
private String pattern;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public Statistics(@JsonProperty("projectName") String projectName,
}

/**
* Deprecated, kept for backwards compatibility.
* @deprecated, kept for backwards compatibility.
* @param projectName the project name.
* @param buildNumber the build number.
* @param startingTime the starting time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class SemaphoreTest {
@Test(timeout = 20000)
public void testAcquireAndRelease() throws Exception {
Semaphore semaphore = new Semaphore();
java.util.concurrent.Semaphore innerSemaphore = Whitebox.getInternalState(semaphore, "semaphore");
java.util.concurrent.Semaphore innerSemaphore = Whitebox.getInternalState(semaphore, "semaphoreLock");
assertEquals("The semaphore should have no available permits to start with", 0,
innerSemaphore.availablePermits());
semaphore.release();
Expand Down