Skip to content

Commit 673fc6c

Browse files
authored
Merge pull request #1248 from kazuki43zoo/support-default-method
Support default method
2 parents c42af0b + 27bf1d8 commit 673fc6c

28 files changed

+89
-152
lines changed

src/main/java/org/apache/ibatis/cache/Cache.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ public interface Cache {
9393
*
9494
* @return A ReadWriteLock
9595
*/
96-
ReadWriteLock getReadWriteLock();
96+
default ReadWriteLock getReadWriteLock() {
97+
return null;
98+
}
9799

98100
}

src/main/java/org/apache/ibatis/cache/decorators/BlockingCache.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2018 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@
1818
import java.util.concurrent.ConcurrentHashMap;
1919
import java.util.concurrent.TimeUnit;
2020
import java.util.concurrent.locks.Lock;
21-
import java.util.concurrent.locks.ReadWriteLock;
2221
import java.util.concurrent.locks.ReentrantLock;
2322

2423
import org.apache.ibatis.cache.Cache;
@@ -86,11 +85,6 @@ public void clear() {
8685
delegate.clear();
8786
}
8887

89-
@Override
90-
public ReadWriteLock getReadWriteLock() {
91-
return null;
92-
}
93-
9488
private ReentrantLock getLockForKey(Object key) {
9589
return locks.computeIfAbsent(key, k -> new ReentrantLock());
9690
}

src/main/java/org/apache/ibatis/cache/decorators/FifoCache.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import java.util.Deque;
1919
import java.util.LinkedList;
20-
import java.util.concurrent.locks.ReadWriteLock;
2120

2221
import org.apache.ibatis.cache.Cache;
2322

@@ -74,11 +73,6 @@ public void clear() {
7473
keyList.clear();
7574
}
7675

77-
@Override
78-
public ReadWriteLock getReadWriteLock() {
79-
return null;
80-
}
81-
8276
private void cycleKeyList(Object key) {
8377
keyList.addLast(key);
8478
if (keyList.size() > size) {

src/main/java/org/apache/ibatis/cache/decorators/LoggingCache.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2017 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,8 +15,6 @@
1515
*/
1616
package org.apache.ibatis.cache.decorators;
1717

18-
import java.util.concurrent.locks.ReadWriteLock;
19-
2018
import org.apache.ibatis.cache.Cache;
2119
import org.apache.ibatis.logging.Log;
2220
import org.apache.ibatis.logging.LogFactory;
@@ -74,11 +72,6 @@ public void clear() {
7472
delegate.clear();
7573
}
7674

77-
@Override
78-
public ReadWriteLock getReadWriteLock() {
79-
return null;
80-
}
81-
8275
@Override
8376
public int hashCode() {
8477
return delegate.hashCode();

src/main/java/org/apache/ibatis/cache/decorators/LruCache.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import java.util.LinkedHashMap;
1919
import java.util.Map;
20-
import java.util.concurrent.locks.ReadWriteLock;
2120

2221
import org.apache.ibatis.cache.Cache;
2322

@@ -85,11 +84,6 @@ public void clear() {
8584
keyMap.clear();
8685
}
8786

88-
@Override
89-
public ReadWriteLock getReadWriteLock() {
90-
return null;
91-
}
92-
9387
private void cycleKeyList(Object key) {
9488
keyMap.put(key, key);
9589
if (eldestKey != null) {

src/main/java/org/apache/ibatis/cache/decorators/ScheduledCache.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2017 the original author or authors.
2+
* Copyright 2009-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,8 +15,6 @@
1515
*/
1616
package org.apache.ibatis.cache.decorators;
1717

18-
import java.util.concurrent.locks.ReadWriteLock;
19-
2018
import org.apache.ibatis.cache.Cache;
2119

2220
/**
@@ -72,11 +70,6 @@ public void clear() {
7270
delegate.clear();
7371
}
7472

75-
@Override
76-
public ReadWriteLock getReadWriteLock() {
77-
return null;
78-
}
79-
8073
@Override
8174
public int hashCode() {
8275
return delegate.hashCode();

src/main/java/org/apache/ibatis/cache/decorators/SerializedCache.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.io.ObjectOutputStream;
2424
import java.io.ObjectStreamClass;
2525
import java.io.Serializable;
26-
import java.util.concurrent.locks.ReadWriteLock;
2726

2827
import org.apache.ibatis.cache.Cache;
2928
import org.apache.ibatis.cache.CacheException;
@@ -75,11 +74,6 @@ public void clear() {
7574
delegate.clear();
7675
}
7776

78-
@Override
79-
public ReadWriteLock getReadWriteLock() {
80-
return null;
81-
}
82-
8377
@Override
8478
public int hashCode() {
8579
return delegate.hashCode();

src/main/java/org/apache/ibatis/cache/decorators/SoftCache.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.lang.ref.SoftReference;
2020
import java.util.Deque;
2121
import java.util.LinkedList;
22-
import java.util.concurrent.locks.ReadWriteLock;
2322

2423
import org.apache.ibatis.cache.Cache;
2524

@@ -101,11 +100,6 @@ public void clear() {
101100
delegate.clear();
102101
}
103102

104-
@Override
105-
public ReadWriteLock getReadWriteLock() {
106-
return null;
107-
}
108-
109103
private void removeGarbageCollectedItems() {
110104
SoftEntry sv;
111105
while ((sv = (SoftEntry) queueOfGarbageCollectedEntries.poll()) != null) {

src/main/java/org/apache/ibatis/cache/decorators/SynchronizedCache.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
package org.apache.ibatis.cache.decorators;
1717

18-
import java.util.concurrent.locks.ReadWriteLock;
19-
2018
import org.apache.ibatis.cache.Cache;
2119

2220
/**
@@ -70,9 +68,4 @@ public boolean equals(Object obj) {
7068
return delegate.equals(obj);
7169
}
7270

73-
@Override
74-
public ReadWriteLock getReadWriteLock() {
75-
return null;
76-
}
77-
7871
}

src/main/java/org/apache/ibatis/cache/decorators/TransactionalCache.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.util.HashSet;
2020
import java.util.Map;
2121
import java.util.Set;
22-
import java.util.concurrent.locks.ReadWriteLock;
2322

2423
import org.apache.ibatis.cache.Cache;
2524
import org.apache.ibatis.logging.Log;
@@ -77,11 +76,6 @@ public Object getObject(Object key) {
7776
}
7877
}
7978

80-
@Override
81-
public ReadWriteLock getReadWriteLock() {
82-
return null;
83-
}
84-
8579
@Override
8680
public void putObject(Object key, Object object) {
8781
entriesToAddOnCommit.put(key, object);

0 commit comments

Comments
 (0)