Skip to content

Commit

Permalink
Merge pull request #25 from hazendaz/master
Browse files Browse the repository at this point in the history
Small language cleanups
  • Loading branch information
hazendaz committed Oct 11, 2015
2 parents 79528c3 + 769641a commit c1fbc6c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,23 @@ public AbstractEhcacheCache(final String id) {
/**
* {@inheritDoc}
*/
@Override
public void clear() {
cache.removeAll();
}

/**
* {@inheritDoc}
*/
@Override
public String getId() {
return id;
}

/**
* {@inheritDoc}
*/
@Override
public Object getObject(Object key) {
Element cachedElement = cache.get(key);
if (cachedElement == null) {
Expand All @@ -83,20 +86,23 @@ public Object getObject(Object key) {
/**
* {@inheritDoc}
*/
@Override
public int getSize() {
return cache.getSize();
}

/**
* {@inheritDoc}
*/
@Override
public void putObject(Object key, Object value) {
cache.put(new Element(key, value));
}

/**
* {@inheritDoc}
*/
@Override
public Object removeObject(Object key) {
Object obj = getObject(key);
cache.remove(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,44 @@ class DummyReadWriteLock implements ReadWriteLock {

private Lock lock = new DummyLock();

@Override
public Lock readLock() {
return lock;
}

@Override
public Lock writeLock() {
return lock;
}

static class DummyLock implements Lock {

@Override
public void lock() {
// Not implemented
}

@Override
public void lockInterruptibly() throws InterruptedException {
// Not implemented
}

@Override
public boolean tryLock() {
return true;
}

@Override
public boolean tryLock(long paramLong, TimeUnit paramTimeUnit) throws InterruptedException {
return true;
}

@Override
public void unlock() {
// Not implemented
}

@Override
public Condition newCondition() {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @author Simone Tripodi
* @deprecated Not needed with MyBatis 3.2.x
*/
@Deprecated
public final class LoggingEhcache extends EhcacheCache {

public LoggingEhcache(String id) {
Expand Down
5 changes: 0 additions & 5 deletions src/test/java/org/mybatis/caches/ehcache/EhcacheTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.CoreMatchers.instanceOf;

import java.util.concurrent.TimeUnit;

import org.junit.Before;
import org.junit.Test;

Expand Down

0 comments on commit c1fbc6c

Please sign in to comment.