Skip to content
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
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
language: java
sudo: false

jdk:
- oraclejdk9
- oraclejdk11
- oraclejdk8
- openjdk8
- openjdk7

after_success:
- chmod -R 777 ./travis/after_success.sh
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright 2012-2017 the original author or authors.
Copyright 2012-2018 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
<parent>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-parent</artifactId>
<version>30</version>
<version>31-SNAPSHOT</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -73,7 +73,7 @@
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.5</version>
<version>3.4.6</version>
<scope>provided</scope>
</dependency>

Expand All @@ -93,7 +93,7 @@
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>4.12.2</version>
<version>5.3.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,16 +25,14 @@
import java.util.Properties;

/**
* Converts a keyed property string in the Config to a proper Java
* object representation.
* Converts a keyed property string in the Config to a proper Java object representation.
*
* @author Simone Tripodi
*/
abstract class AbstractPropertySetter<T> {

/**
* 'propertyName'='writermethod' index of {@link MemcachedConfiguration}
* properties.
* 'propertyName'='writermethod' index of {@link MemcachedConfiguration} properties.
*/
private static Map<String, Method> WRITERS = new HashMap<String, Method>();

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

/**
* The default value used if something goes wrong during the conversion or
* the property is not set in the config.
* The default value used if something goes wrong during the conversion or the property is not set in the config.
*/
private final T defaultValue;

/**
* Build a new property setter.
*
* @param propertyKey the Config property key.
* @param propertyName the {@link MemcachedConfiguration} property name.
* @param defaultValue the property default value.
* @param propertyKey
* the Config property key.
* @param propertyName
* the {@link MemcachedConfiguration} property name.
* @param defaultValue
* the property default value.
*/
public AbstractPropertySetter(final String propertyKey, final String propertyName, final T defaultValue) {
this.propertyKey = propertyKey;
Expand All @@ -91,11 +91,12 @@ public AbstractPropertySetter(final String propertyKey, final String propertyNam
}

/**
* Extract a property from the, converts and puts it to the
* {@link MemcachedConfiguration}.
* Extract a property from the, converts and puts it to the {@link MemcachedConfiguration}.
*
* @param config the Config
* @param memcachedConfiguration the {@link MemcachedConfiguration}
* @param config
* the Config
* @param memcachedConfiguration
* the {@link MemcachedConfiguration}
*/
public final void set(Properties config, MemcachedConfiguration memcachedConfiguration) {
String propertyValue = config.getProperty(propertyKey);
Expand All @@ -121,9 +122,11 @@ public final void set(Properties config, MemcachedConfiguration memcachedConfigu
/**
* Convert a string representation to a proper Java Object.
*
* @param value the value has to be converted.
* @param value
* the value has to be converted.
* @return the converted value.
* @throws Exception if any error occurs.
* @throws Exception
* if any error occurs.
*/
protected abstract T convert(String value) throws Exception;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,9 +25,12 @@ final class BooleanPropertySetter extends AbstractPropertySetter<Boolean> {
/**
* Instantiates a String to Boolean setter.
*
* @param propertyKey the OSCache Config property key.
* @param propertyName the {@link MemcachedConfiguration} property name.
* @param defaultValue the property default value.
* @param propertyKey
* the OSCache Config property key.
* @param propertyName
* the {@link MemcachedConfiguration} property name.
* @param defaultValue
* the property default value.
*/
public BooleanPropertySetter(final String propertyKey, final String propertyName, final Boolean defaultValue) {
super(propertyKey, propertyName, defaultValue);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,8 +31,7 @@
import org.apache.ibatis.cache.CacheException;

/**
* The Transcoder that compress and decompress the stored objects using the
* GZIP compression algorithm.
* The Transcoder that compress and decompress the stored objects using the GZIP compression algorithm.
*
* @author Simone Tripodi
*/
Expand Down Expand Up @@ -113,7 +112,8 @@ public int getMaxSize() {
/**
* Unconditionally close an {@link InputStream}.
*
* @param closeable the InputStream to close, may be null or already closed.
* @param closeable
* the InputStream to close, may be null or already closed.
*/
private static void closeQuietly(final Closeable closeable) {
if (closeable != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,9 +25,12 @@ final class IntegerPropertySetter extends AbstractPropertySetter<Integer> {
/**
* Instantiates a String to Integer setter.
*
* @param propertyKey the Config property key.
* @param propertyName the {@link MemcachedConfiguration} property name.
* @param defaultValue the property default value.
* @param propertyKey
* the Config property key.
* @param propertyName
* the {@link MemcachedConfiguration} property name.
* @param defaultValue
* the property default value.
*/
public IntegerPropertySetter(final String propertyKey, final String propertyName, final Integer defaultValue) {
super(propertyKey, propertyName, defaultValue);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,7 +41,8 @@ public final class MemcachedCache implements Cache {
/**
* Builds a new Memcached-based Cache.
*
* @param id the Mapper id.
* @param id
* the Mapper id.
*/
public MemcachedCache(final String id) {
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -96,7 +96,8 @@ public MemcachedClientWrapper() {
/**
* Converts the MyBatis object key in the proper string representation.
*
* @param key the MyBatis object key.
* @param key
* the MyBatis object key.
* @return the proper string representation.
*/
private String toKeyString(final Object key) {
Expand Down Expand Up @@ -128,7 +129,7 @@ public Object getObject(Object key) {
* Return the stored group in Memcached identified by the specified key.
*
* @param groupKey
* the group key.
* the group key.
* @return the group if was previously stored, null otherwise.
*/
private ObjectWithCas getGroup(String groupKey) {
Expand Down Expand Up @@ -271,8 +272,10 @@ public void putObject(Object key, Object value, String id) {
/**
* Stores an object identified by a key in Memcached.
*
* @param keyString the object key
* @param value the object has to be stored.
* @param keyString
* the object key
* @param value
* the object has to be stored.
*/
private void storeInMemcached(String keyString, Object value) {
if (value != null && !Serializable.class.isAssignableFrom(value.getClass())) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,8 +36,7 @@ final class MemcachedConfiguration {
private String keyPrefix;

/**
* The Connection Factory used to establish the connection to Memcached
* server(s).
* The Connection Factory used to establish the connection to Memcached server(s).
*/
private ConnectionFactory connectionFactory;

Expand Down Expand Up @@ -79,7 +78,8 @@ public String getKeyPrefix() {
}

/**
* @param keyPrefix the keyPrefix to set
* @param keyPrefix
* the keyPrefix to set
*/
public void setKeyPrefix(String keyPrefix) {
this.keyPrefix = keyPrefix;
Expand All @@ -93,7 +93,8 @@ public ConnectionFactory getConnectionFactory() {
}

/**
* @param connectionFactory the connectionFactory to set
* @param connectionFactory
* the connectionFactory to set
*/
public void setConnectionFactory(ConnectionFactory connectionFactory) {
this.connectionFactory = connectionFactory;
Expand All @@ -107,7 +108,8 @@ public List<InetSocketAddress> getAddresses() {
}

/**
* @param addresses the addresses to set
* @param addresses
* the addresses to set
*/
public void setAddresses(List<InetSocketAddress> addresses) {
this.addresses = addresses;
Expand All @@ -121,7 +123,8 @@ public boolean isUsingAsyncGet() {
}

/**
* @param usingAsyncGet the usingAsyncGet to set
* @param usingAsyncGet
* the usingAsyncGet to set
*/
public void setUsingAsyncGet(boolean usingAsyncGet) {
this.usingAsyncGet = usingAsyncGet;
Expand All @@ -135,7 +138,8 @@ public boolean isCompressionEnabled() {
}

/**
* @param compressionEnabled the compressionEnabled to set
* @param compressionEnabled
* the compressionEnabled to set
*/
public void setCompressionEnabled(boolean compressionEnabled) {
this.compressionEnabled = compressionEnabled;
Expand All @@ -149,7 +153,8 @@ public int getExpiration() {
}

/**
* @param expiration the expiration to set
* @param expiration
* the expiration to set
*/
public void setExpiration(int expiration) {
this.expiration = expiration;
Expand All @@ -163,7 +168,8 @@ public int getTimeout() {
}

/**
* @param timeout the timeout to set
* @param timeout
* the timeout to set
*/
public void setTimeout(int timeout) {
this.timeout = timeout;
Expand All @@ -177,7 +183,8 @@ public TimeUnit getTimeUnit() {
}

/**
* @param timeUnit the timeUnit to set
* @param timeUnit
* the timeUnit to set
*/
public void setTimeUnit(TimeUnit timeUnit) {
this.timeUnit = timeUnit;
Expand All @@ -195,9 +202,12 @@ public int hashCode() {
/**
* Computes a hashCode given the input objects.
*
* @param initialNonZeroOddNumber a non-zero, odd number used as the initial value.
* @param multiplierNonZeroOddNumber a non-zero, odd number used as the multiplier.
* @param objs the objects to compute hash code.
* @param initialNonZeroOddNumber
* a non-zero, odd number used as the initial value.
* @param multiplierNonZeroOddNumber
* a non-zero, odd number used as the multiplier.
* @param objs
* the objects to compute hash code.
* @return the computed hashCode.
*/
public static int hash(int initialNonZeroOddNumber, int multiplierNonZeroOddNumber, Object... objs) {
Expand Down Expand Up @@ -230,8 +240,10 @@ && eq(keyPrefix, other.keyPrefix) && eq(timeUnit, other.timeUnit) && eq(timeout,
/**
* Verifies input objects are equal.
*
* @param o1 the first argument to compare
* @param o2 the second argument to compare
* @param o1
* the first argument to compare
* @param o2
* the second argument to compare
* @return true, if the input arguments are equal, false otherwise.
*/
private static <O> boolean eq(O o1, O o2) {
Expand Down
Loading