Just a few fixes and flip the switch.
Change-Id: I83d8b9b4e959e03a912d2cbf4c3c26311af4fc0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
</dependency>
</dependencies>
- <!--
- Maven Site Configuration
-
- The following configuration is necessary for maven-site-plugin to
- correctly identify the correct deployment path for OpenDaylight Maven
- sites.
- -->
- <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
-
- <distributionManagement>
- <site>
- <id>opendaylight-site</id>
- <url>${nexus.site.url}/${project.artifactId}/</url>
- </site>
- </distributionManagement>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
</project>
InvocationsFinder finder = new InvocationsFinder();
List<Invocation> actualInvocations = finder.findInvocations(data.getAllInvocations(), data.getWanted());
if (actualInvocations.size() != 1) {
- throw new MockitoException("This verifier can only be used with 1 invocation, got " + actualInvocations.size());
+ throw new MockitoException("This verifier can only be used with 1 invocation, got "
+ + actualInvocations.size());
}
Invocation invocation = actualInvocations.get(0);
arguments = invocation.getArguments();
invocation.markVerified();
}
+
public Object[] getArguments() {
return arguments;
}
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+ </configuration>
+ </plugin>
</plugins>
</build>
- <!--
- Maven Site Configuration
+ <!--
+ Maven Site Configuration
- The following configuration is necessary for maven-site-plugin to
- correctly identify the correct deployment path for OpenDaylight Maven
- sites.
- -->
- <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
- <distributionManagement>
- <site>
- <id>opendaylight-site</id>
- <url>${nexus.site.url}/${project.artifactId}/</url>
- </site>
- </distributionManagement>
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
</project>
* indexes and spend some CPU cycles on walking the index to potentially
* end up with a reused object.
*
+ * <p>
* Note that the cached objects should really be semantically {@link Immutable}.
* This interface does not enforce that interface contract simply because
* there are third-party objects which fulfill this contract.
@GuardedBy("this")
private static synchronized IObjectCacheFactory initialize() {
// Double-check under lock
- IObjectCacheFactory f = factory;
- if (f != null) {
- return f;
+ IObjectCacheFactory fa = factory;
+ if (fa != null) {
+ return fa;
}
try {
- f = StaticObjectCacheBinder.getInstance().getProductCacheFactory();
- factory = f;
+ fa = StaticObjectCacheBinder.getInstance().getProductCacheFactory();
+ factory = fa;
} catch (NoClassDefFoundError e) {
- f = NoopObjectCacheBinder.INSTANCE.getProductCacheFactory();
+ fa = NoopObjectCacheBinder.INSTANCE.getProductCacheFactory();
}
- return f;
+ return fa;
}
public static synchronized void reset() {
* @return Object cache instance.
*/
public static ObjectCache getObjectCache(@Nonnull final Class<?> objClass) {
- IObjectCacheFactory f = factory;
- if (f == null) {
- f = initialize();
+ IObjectCacheFactory fa = factory;
+ if (fa == null) {
+ fa = initialize();
}
- return f.getObjectCache(Preconditions.checkNotNull(objClass));
+ return fa.getObjectCache(Preconditions.checkNotNull(objClass));
}
}
* Key used in the underlying map. It is essentially a soft reference, with
* slightly special properties.
*
+ * <p>
* It acts as a proxy for the object it refers to and essentially delegates
* to it. There are three exceptions here:
*
+ * <p>
* 1) This key needs to have a cached hash code. The requirement is that the
* key needs to be able to look itself up after the reference to the object
* has been cleared (and thus we can no longer look it up from there). One
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
+import com.google.common.base.FinalizableReferenceQueue;
+import com.google.common.cache.CacheBuilder;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yangtools.objcache.ObjectCache;
-import com.google.common.base.FinalizableReferenceQueue;
-import com.google.common.cache.CacheBuilder;
-
public class CacheTest {
private FinalizableReferenceQueue queue;
private ObjectCache oc;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
+import com.google.common.base.FinalizableReferenceQueue;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yangtools.objcache.spi.AbstractObjectCache.SoftKey;
-import com.google.common.base.FinalizableReferenceQueue;
-
public class SoftKeyTest {
private FinalizableReferenceQueue queue;
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+ </configuration>
+ </plugin>
</plugins>
</build>
- <!--
- Maven Site Configuration
+ <!--
+ Maven Site Configuration
- The following configuration is necessary for maven-site-plugin to
- correctly identify the correct deployment path for OpenDaylight Maven
- sites.
- -->
- <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
- <distributionManagement>
- <site>
- <id>opendaylight-site</id>
- <url>${nexus.site.url}/${project.artifactId}/</url>
- </site>
- </distributionManagement>
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
</project>
*/
package org.opendaylight.yangtools.objcache.guava;
-import org.opendaylight.yangtools.objcache.spi.AbstractObjectCache;
-
import com.google.common.base.FinalizableReferenceQueue;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheBuilderSpec;
+import org.opendaylight.yangtools.objcache.spi.AbstractObjectCache;
final class GuavaObjectCache extends AbstractObjectCache {
- public GuavaObjectCache(final FinalizableReferenceQueue queue) {
+ GuavaObjectCache(final FinalizableReferenceQueue queue) {
super(CacheBuilder.newBuilder().softValues().build(), queue);
}
- public GuavaObjectCache(final FinalizableReferenceQueue queue, final CacheBuilderSpec spec) {
+ GuavaObjectCache(final FinalizableReferenceQueue queue, final CacheBuilderSpec spec) {
super(CacheBuilder.from(spec).build(), queue);
}
}
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+ </configuration>
+ </plugin>
</plugins>
</build>
- <!--
- Maven Site Configuration
+ <!--
+ Maven Site Configuration
- The following configuration is necessary for maven-site-plugin to
- correctly identify the correct deployment path for OpenDaylight Maven
- sites.
- -->
- <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
- <distributionManagement>
- <site>
- <id>opendaylight-site</id>
- <url>${nexus.site.url}/${project.artifactId}/</url>
- </site>
- </distributionManagement>
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/${project.artifactId}/</url>
+ </site>
+ </distributionManagement>
</project>