Skip to content

Commit 36f9de0

Browse files
authored
Merge pull request #42 from hazendaz/master
House cleaning / jdk 11 support / drop jdk 7
2 parents f22a61d + 7309ca6 commit 36f9de0

File tree

12 files changed

+94
-68
lines changed

12 files changed

+94
-68
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
language: java
2-
sudo: false
32

43
jdk:
5-
- oraclejdk9
4+
- oraclejdk11
65
- oraclejdk8
7-
- openjdk8
8-
- openjdk7
96

107
after_success:
118
- chmod -R 777 ./travis/after_success.sh

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright 2012-2017 the original author or authors.
4+
Copyright 2012-2018 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.mybatis</groupId>
2525
<artifactId>mybatis-parent</artifactId>
26-
<version>30</version>
26+
<version>31-SNAPSHOT</version>
2727
<relativePath />
2828
</parent>
2929

@@ -73,7 +73,7 @@
7373
<dependency>
7474
<groupId>org.mybatis</groupId>
7575
<artifactId>mybatis</artifactId>
76-
<version>3.4.5</version>
76+
<version>3.4.6</version>
7777
<scope>provided</scope>
7878
</dependency>
7979

@@ -93,7 +93,7 @@
9393
<dependency>
9494
<groupId>org.junit.vintage</groupId>
9595
<artifactId>junit-vintage-engine</artifactId>
96-
<version>4.12.2</version>
96+
<version>5.3.2</version>
9797
<scope>test</scope>
9898
</dependency>
9999
</dependencies>

src/main/java/org/mybatis/caches/memcached/AbstractPropertySetter.java

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -25,16 +25,14 @@
2525
import java.util.Properties;
2626

2727
/**
28-
* Converts a keyed property string in the Config to a proper Java
29-
* object representation.
28+
* Converts a keyed property string in the Config to a proper Java object representation.
3029
*
3130
* @author Simone Tripodi
3231
*/
3332
abstract class AbstractPropertySetter<T> {
3433

3534
/**
36-
* 'propertyName'='writermethod' index of {@link MemcachedConfiguration}
37-
* properties.
35+
* 'propertyName'='writermethod' index of {@link MemcachedConfiguration} properties.
3836
*/
3937
private static Map<String, Method> WRITERS = new HashMap<String, Method>();
4038

@@ -65,17 +63,19 @@ abstract class AbstractPropertySetter<T> {
6563
private final Method propertyWriterMethod;
6664

6765
/**
68-
* The default value used if something goes wrong during the conversion or
69-
* the property is not set in the config.
66+
* The default value used if something goes wrong during the conversion or the property is not set in the config.
7067
*/
7168
private final T defaultValue;
7269

7370
/**
7471
* Build a new property setter.
7572
*
76-
* @param propertyKey the Config property key.
77-
* @param propertyName the {@link MemcachedConfiguration} property name.
78-
* @param defaultValue the property default value.
73+
* @param propertyKey
74+
* the Config property key.
75+
* @param propertyName
76+
* the {@link MemcachedConfiguration} property name.
77+
* @param defaultValue
78+
* the property default value.
7979
*/
8080
public AbstractPropertySetter(final String propertyKey, final String propertyName, final T defaultValue) {
8181
this.propertyKey = propertyKey;
@@ -91,11 +91,12 @@ public AbstractPropertySetter(final String propertyKey, final String propertyNam
9191
}
9292

9393
/**
94-
* Extract a property from the, converts and puts it to the
95-
* {@link MemcachedConfiguration}.
94+
* Extract a property from the, converts and puts it to the {@link MemcachedConfiguration}.
9695
*
97-
* @param config the Config
98-
* @param memcachedConfiguration the {@link MemcachedConfiguration}
96+
* @param config
97+
* the Config
98+
* @param memcachedConfiguration
99+
* the {@link MemcachedConfiguration}
99100
*/
100101
public final void set(Properties config, MemcachedConfiguration memcachedConfiguration) {
101102
String propertyValue = config.getProperty(propertyKey);
@@ -121,9 +122,11 @@ public final void set(Properties config, MemcachedConfiguration memcachedConfigu
121122
/**
122123
* Convert a string representation to a proper Java Object.
123124
*
124-
* @param value the value has to be converted.
125+
* @param value
126+
* the value has to be converted.
125127
* @return the converted value.
126-
* @throws Exception if any error occurs.
128+
* @throws Exception
129+
* if any error occurs.
127130
*/
128131
protected abstract T convert(String value) throws Exception;
129132

src/main/java/org/mybatis/caches/memcached/BooleanPropertySetter.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -25,9 +25,12 @@ final class BooleanPropertySetter extends AbstractPropertySetter<Boolean> {
2525
/**
2626
* Instantiates a String to Boolean setter.
2727
*
28-
* @param propertyKey the OSCache Config property key.
29-
* @param propertyName the {@link MemcachedConfiguration} property name.
30-
* @param defaultValue the property default value.
28+
* @param propertyKey
29+
* the OSCache Config property key.
30+
* @param propertyName
31+
* the {@link MemcachedConfiguration} property name.
32+
* @param defaultValue
33+
* the property default value.
3134
*/
3235
public BooleanPropertySetter(final String propertyKey, final String propertyName, final Boolean defaultValue) {
3336
super(propertyKey, propertyName, defaultValue);

src/main/java/org/mybatis/caches/memcached/CompressorTranscoder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -31,8 +31,7 @@
3131
import org.apache.ibatis.cache.CacheException;
3232

3333
/**
34-
* The Transcoder that compress and decompress the stored objects using the
35-
* GZIP compression algorithm.
34+
* The Transcoder that compress and decompress the stored objects using the GZIP compression algorithm.
3635
*
3736
* @author Simone Tripodi
3837
*/
@@ -113,7 +112,8 @@ public int getMaxSize() {
113112
/**
114113
* Unconditionally close an {@link InputStream}.
115114
*
116-
* @param closeable the InputStream to close, may be null or already closed.
115+
* @param closeable
116+
* the InputStream to close, may be null or already closed.
117117
*/
118118
private static void closeQuietly(final Closeable closeable) {
119119
if (closeable != null) {

src/main/java/org/mybatis/caches/memcached/IntegerPropertySetter.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -25,9 +25,12 @@ final class IntegerPropertySetter extends AbstractPropertySetter<Integer> {
2525
/**
2626
* Instantiates a String to Integer setter.
2727
*
28-
* @param propertyKey the Config property key.
29-
* @param propertyName the {@link MemcachedConfiguration} property name.
30-
* @param defaultValue the property default value.
28+
* @param propertyKey
29+
* the Config property key.
30+
* @param propertyName
31+
* the {@link MemcachedConfiguration} property name.
32+
* @param defaultValue
33+
* the property default value.
3134
*/
3235
public IntegerPropertySetter(final String propertyKey, final String propertyName, final Integer defaultValue) {
3336
super(propertyKey, propertyName, defaultValue);

src/main/java/org/mybatis/caches/memcached/MemcachedCache.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -41,7 +41,8 @@ public final class MemcachedCache implements Cache {
4141
/**
4242
* Builds a new Memcached-based Cache.
4343
*
44-
* @param id the Mapper id.
44+
* @param id
45+
* the Mapper id.
4546
*/
4647
public MemcachedCache(final String id) {
4748
this.id = id;

src/main/java/org/mybatis/caches/memcached/MemcachedClientWrapper.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -96,7 +96,8 @@ public MemcachedClientWrapper() {
9696
/**
9797
* Converts the MyBatis object key in the proper string representation.
9898
*
99-
* @param key the MyBatis object key.
99+
* @param key
100+
* the MyBatis object key.
100101
* @return the proper string representation.
101102
*/
102103
private String toKeyString(final Object key) {
@@ -128,7 +129,7 @@ public Object getObject(Object key) {
128129
* Return the stored group in Memcached identified by the specified key.
129130
*
130131
* @param groupKey
131-
* the group key.
132+
* the group key.
132133
* @return the group if was previously stored, null otherwise.
133134
*/
134135
private ObjectWithCas getGroup(String groupKey) {
@@ -271,8 +272,10 @@ public void putObject(Object key, Object value, String id) {
271272
/**
272273
* Stores an object identified by a key in Memcached.
273274
*
274-
* @param keyString the object key
275-
* @param value the object has to be stored.
275+
* @param keyString
276+
* the object key
277+
* @param value
278+
* the object has to be stored.
276279
*/
277280
private void storeInMemcached(String keyString, Object value) {
278281
if (value != null && !Serializable.class.isAssignableFrom(value.getClass())) {

src/main/java/org/mybatis/caches/memcached/MemcachedConfiguration.java

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 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.
@@ -36,8 +36,7 @@ final class MemcachedConfiguration {
3636
private String keyPrefix;
3737

3838
/**
39-
* The Connection Factory used to establish the connection to Memcached
40-
* server(s).
39+
* The Connection Factory used to establish the connection to Memcached server(s).
4140
*/
4241
private ConnectionFactory connectionFactory;
4342

@@ -79,7 +78,8 @@ public String getKeyPrefix() {
7978
}
8079

8180
/**
82-
* @param keyPrefix the keyPrefix to set
81+
* @param keyPrefix
82+
* the keyPrefix to set
8383
*/
8484
public void setKeyPrefix(String keyPrefix) {
8585
this.keyPrefix = keyPrefix;
@@ -93,7 +93,8 @@ public ConnectionFactory getConnectionFactory() {
9393
}
9494

9595
/**
96-
* @param connectionFactory the connectionFactory to set
96+
* @param connectionFactory
97+
* the connectionFactory to set
9798
*/
9899
public void setConnectionFactory(ConnectionFactory connectionFactory) {
99100
this.connectionFactory = connectionFactory;
@@ -107,7 +108,8 @@ public List<InetSocketAddress> getAddresses() {
107108
}
108109

109110
/**
110-
* @param addresses the addresses to set
111+
* @param addresses
112+
* the addresses to set
111113
*/
112114
public void setAddresses(List<InetSocketAddress> addresses) {
113115
this.addresses = addresses;
@@ -121,7 +123,8 @@ public boolean isUsingAsyncGet() {
121123
}
122124

123125
/**
124-
* @param usingAsyncGet the usingAsyncGet to set
126+
* @param usingAsyncGet
127+
* the usingAsyncGet to set
125128
*/
126129
public void setUsingAsyncGet(boolean usingAsyncGet) {
127130
this.usingAsyncGet = usingAsyncGet;
@@ -135,7 +138,8 @@ public boolean isCompressionEnabled() {
135138
}
136139

137140
/**
138-
* @param compressionEnabled the compressionEnabled to set
141+
* @param compressionEnabled
142+
* the compressionEnabled to set
139143
*/
140144
public void setCompressionEnabled(boolean compressionEnabled) {
141145
this.compressionEnabled = compressionEnabled;
@@ -149,7 +153,8 @@ public int getExpiration() {
149153
}
150154

151155
/**
152-
* @param expiration the expiration to set
156+
* @param expiration
157+
* the expiration to set
153158
*/
154159
public void setExpiration(int expiration) {
155160
this.expiration = expiration;
@@ -163,7 +168,8 @@ public int getTimeout() {
163168
}
164169

165170
/**
166-
* @param timeout the timeout to set
171+
* @param timeout
172+
* the timeout to set
167173
*/
168174
public void setTimeout(int timeout) {
169175
this.timeout = timeout;
@@ -177,7 +183,8 @@ public TimeUnit getTimeUnit() {
177183
}
178184

179185
/**
180-
* @param timeUnit the timeUnit to set
186+
* @param timeUnit
187+
* the timeUnit to set
181188
*/
182189
public void setTimeUnit(TimeUnit timeUnit) {
183190
this.timeUnit = timeUnit;
@@ -195,9 +202,12 @@ public int hashCode() {
195202
/**
196203
* Computes a hashCode given the input objects.
197204
*
198-
* @param initialNonZeroOddNumber a non-zero, odd number used as the initial value.
199-
* @param multiplierNonZeroOddNumber a non-zero, odd number used as the multiplier.
200-
* @param objs the objects to compute hash code.
205+
* @param initialNonZeroOddNumber
206+
* a non-zero, odd number used as the initial value.
207+
* @param multiplierNonZeroOddNumber
208+
* a non-zero, odd number used as the multiplier.
209+
* @param objs
210+
* the objects to compute hash code.
201211
* @return the computed hashCode.
202212
*/
203213
public static int hash(int initialNonZeroOddNumber, int multiplierNonZeroOddNumber, Object... objs) {
@@ -230,8 +240,10 @@ && eq(keyPrefix, other.keyPrefix) && eq(timeUnit, other.timeUnit) && eq(timeout,
230240
/**
231241
* Verifies input objects are equal.
232242
*
233-
* @param o1 the first argument to compare
234-
* @param o2 the second argument to compare
243+
* @param o1
244+
* the first argument to compare
245+
* @param o2
246+
* the second argument to compare
235247
* @return true, if the input arguments are equal, false otherwise.
236248
*/
237249
private static <O> boolean eq(O o1, O o2) {

0 commit comments

Comments
 (0)