Skip to content

Commit e874d26

Browse files
tristantarrantryanemerson
authored andcommitted
[infinispan#16793] Add Spotless Maven Plugin for auto-formatting
Configure spotless-maven-plugin in pluginManagement using the Eclipse JDT formatter backed by the project .editorconfig. Includes import ordering, unused import removal, trailing whitespace trimming, and end-with-newline enforcement.
1 parent f913fc5 commit e874d26

File tree

144 files changed

+10437
-10520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+10437
-10520
lines changed

build/bom/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<version.maven.gpg>3.2.8</version.maven.gpg>
4747
<version.maven.javadoc>3.12.0</version.maven.javadoc>
4848
<version.maven.sonatype.central>0.10.0</version.maven.sonatype.central>
49+
<version.maven.spotless>3.2.1</version.maven.spotless>
4950
</properties>
5051

5152
<dependencyManagement>
@@ -409,6 +410,31 @@
409410
</dependencies>
410411
</dependencyManagement>
411412

413+
<build>
414+
<plugins>
415+
<plugin>
416+
<groupId>com.diffplug.spotless</groupId>
417+
<artifactId>spotless-maven-plugin</artifactId>
418+
<version>${version.maven.spotless}</version>
419+
<configuration>
420+
<java>
421+
<importOrder>
422+
<order>\#,java,javax,org,com,</order>
423+
</importOrder>
424+
<indent>
425+
<spaces>true</spaces>
426+
<spacesPerTab>3</spacesPerTab>
427+
</indent>
428+
<removeUnusedImports/>
429+
<trimTrailingWhitespace/>
430+
<endWithNewline/>
431+
<toggleOffOn/>
432+
</java>
433+
</configuration>
434+
</plugin>
435+
</plugins>
436+
</build>
437+
412438
<profiles>
413439
<profile>
414440
<id>community-release</id>

build/component-processor/src/main/java/org/infinispan/component/processor/AnnotationTypeValuesExtractor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.ArrayList;
44
import java.util.List;
55
import java.util.Map;
6+
67
import javax.lang.model.element.AnnotationMirror;
78
import javax.lang.model.element.AnnotationValue;
89
import javax.lang.model.element.ExecutableElement;

build/logging-annotations/src/main/java/org/infinispan/logging/annotations/Description.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/**
1111
* Description.
12-
*
12+
*
1313
* @author Durgesh Anaokar
1414
* @since 13.0
1515
*/
@@ -19,9 +19,9 @@
1919
public @interface Description {
2020

2121
/**
22-
*
22+
*
2323
* Return the Description for the log message.
24-
*
24+
*
2525
* @return String
2626
*/
2727
String value();

hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/DataType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public enum DataType {
1212
COLLECTION(InfinispanProperties.COLLECTION, InfinispanProperties.DEF_ENTITY_RESOURCE, DataType::noValidation),
1313
IMMUTABLE_ENTITY(InfinispanProperties.IMMUTABLE_ENTITY, InfinispanProperties.DEF_ENTITY_RESOURCE, DataType::noValidation),
1414
TIMESTAMPS(InfinispanProperties.TIMESTAMPS, InfinispanProperties.DEF_TIMESTAMPS_RESOURCE, c -> {
15-
if ( c.clustering().cacheMode().isInvalidation() ) {
15+
if (c.clustering().cacheMode().isInvalidation()) {
1616
throw log().timestampsMustNotUseInvalidation();
1717
}
1818
if (c.memory().isEvictionEnabled()) {

hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/DefaultCacheManagerProvider.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ private static ConfigurationBuilderHolder parse(InputStream input, ClassLoader c
9595
// Workaround Infinispan's ClassLoader strategies to bend to our will:
9696
builderHolder.getGlobalConfigurationBuilder().classLoader(classLoader);
9797
return builderHolder;
98-
}
99-
finally {
98+
} finally {
10099
currentThread.setContextClassLoader(originalClassLoader);
101100
}
102101
}

hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/JndiCacheManagerProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
@MetaInfServices(EmbeddedCacheManagerProvider.class)
1818
public class JndiCacheManagerProvider implements EmbeddedCacheManagerProvider {
19-
private static final InfinispanMessageLogger log = InfinispanMessageLogger.Provider.getLog( JndiCacheManagerProvider.class );
19+
private static final InfinispanMessageLogger log = InfinispanMessageLogger.Provider.getLog(JndiCacheManagerProvider.class);
2020

2121
@Override
2222
public EmbeddedCacheManager getEmbeddedCacheManager(Properties properties) {

hibernate/cache-commons/src/main/java/org/infinispan/hibernate/cache/commons/access/AccessDelegate.java

Lines changed: 134 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -9,152 +9,151 @@
99
* @author Radim Vansa &lt;rvansa@redhat.com&gt;
1010
*/
1111
public interface AccessDelegate {
12-
Object get(Object session, Object key, long txTimestamp) throws CacheException;
12+
Object get(Object session, Object key, long txTimestamp) throws CacheException;
1313

14-
/**
15-
* Attempt to cache an object, after loading from the database.
16-
*
17-
* @param session Current session
18-
* @param key The item key
19-
* @param value The item
20-
* @param txTimestamp a timestamp prior to the transaction start time
21-
* @param version the item version number
22-
* @return <code>true</code> if the object was successfully cached
23-
*/
24-
boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version);
14+
/**
15+
* Attempt to cache an object, after loading from the database.
16+
*
17+
* @param session Current session
18+
* @param key The item key
19+
* @param value The item
20+
* @param txTimestamp a timestamp prior to the transaction start time
21+
* @param version the item version number
22+
* @return <code>true</code> if the object was successfully cached
23+
*/
24+
boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version);
2525

26-
/**
27-
* Attempt to cache an object, after loading from the database, explicitly
28-
* specifying the minimalPut behavior.
29-
*
30-
* @param session Current session.
31-
* @param key The item key
32-
* @param value The item
33-
* @param txTimestamp a timestamp prior to the transaction start time
34-
* @param version the item version number
35-
* @param minimalPutOverride Explicit minimalPut flag
36-
* @return <code>true</code> if the object was successfully cached
37-
* @throws org.hibernate.cache.CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region}
38-
*/
39-
boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
40-
throws CacheException;
26+
/**
27+
* Attempt to cache an object, after loading from the database, explicitly
28+
* specifying the minimalPut behavior.
29+
*
30+
* @param session Current session.
31+
* @param key The item key
32+
* @param value The item
33+
* @param txTimestamp a timestamp prior to the transaction start time
34+
* @param version the item version number
35+
* @param minimalPutOverride Explicit minimalPut flag
36+
* @return <code>true</code> if the object was successfully cached
37+
* @throws org.hibernate.cache.CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region}
38+
*/
39+
boolean putFromLoad(Object session, Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
40+
throws CacheException;
4141

42-
/**
43-
* Called after an item has been inserted (before the transaction completes),
44-
* instead of calling evict().
45-
*
46-
* @param session Current session
47-
* @param key The item key
48-
* @param value The item
49-
* @param version The item's version value
50-
* @return Were the contents of the cache actual changed by this operation?
51-
* @throws CacheException if the insert fails
52-
*/
53-
boolean insert(Object session, Object key, Object value, Object version) throws CacheException;
42+
/**
43+
* Called after an item has been inserted (before the transaction completes),
44+
* instead of calling evict().
45+
*
46+
* @param session Current session
47+
* @param key The item key
48+
* @param value The item
49+
* @param version The item's version value
50+
* @return Were the contents of the cache actual changed by this operation?
51+
* @throws CacheException if the insert fails
52+
*/
53+
boolean insert(Object session, Object key, Object value, Object version) throws CacheException;
5454

55-
/**
56-
* Called after an item has been updated (before the transaction completes),
57-
* instead of calling evict().
58-
*
59-
* @param session Current session
60-
* @param key The item key
61-
* @param value The item
62-
* @param currentVersion The item's current version value
63-
* @param previousVersion The item's previous version value
64-
* @return Whether the contents of the cache actual changed by this operation
65-
* @throws CacheException if the update fails
66-
*/
67-
boolean update(Object session, Object key, Object value, Object currentVersion, Object previousVersion)
68-
throws CacheException;
55+
/**
56+
* Called after an item has been updated (before the transaction completes),
57+
* instead of calling evict().
58+
*
59+
* @param session Current session
60+
* @param key The item key
61+
* @param value The item
62+
* @param currentVersion The item's current version value
63+
* @param previousVersion The item's previous version value
64+
* @return Whether the contents of the cache actual changed by this operation
65+
* @throws CacheException if the update fails
66+
*/
67+
boolean update(Object session, Object key, Object value, Object currentVersion, Object previousVersion)
68+
throws CacheException;
6969

70-
/**
71-
* Called after an item has become stale (before the transaction completes).
72-
*
73-
* @param session Current session
74-
* @param key The key of the item to remove
75-
* @throws CacheException if removing the cached item fails
76-
*/
77-
void remove(Object session, Object key) throws CacheException;
70+
/**
71+
* Called after an item has become stale (before the transaction completes).
72+
*
73+
* @param session Current session
74+
* @param key The key of the item to remove
75+
* @throws CacheException if removing the cached item fails
76+
*/
77+
void remove(Object session, Object key) throws CacheException;
7878

79-
/**
80-
* Called just before the delegate will have all entries removed. Any work to prevent concurrent modifications
81-
* while this occurs should happen here
82-
* @throws CacheException if locking had an issue
83-
*/
84-
void lockAll() throws CacheException;
79+
/**
80+
* Called just before the delegate will have all entries removed. Any work to prevent concurrent modifications
81+
* while this occurs should happen here
82+
*
83+
* @throws CacheException if locking had an issue
84+
*/
85+
void lockAll() throws CacheException;
8586

86-
/**
87-
* Called just after the delegate had all entries removed via {@link #removeAll()}. Any work required to allow
88-
* for new modifications to happen should be done here
89-
* @throws CacheException if unlocking had an issue
90-
*/
91-
void unlockAll() throws CacheException;
87+
/**
88+
* Called just after the delegate had all entries removed via {@link #removeAll()}. Any work required to allow
89+
* for new modifications to happen should be done here
90+
*
91+
* @throws CacheException if unlocking had an issue
92+
*/
93+
void unlockAll() throws CacheException;
9294

93-
/**
94-
* Called to evict data from the entire region
95-
*
96-
* @throws CacheException if eviction the region fails
97-
*/
98-
void removeAll() throws CacheException;
95+
/**
96+
* Called to evict data from the entire region
97+
*
98+
* @throws CacheException if eviction the region fails
99+
*/
100+
void removeAll() throws CacheException;
99101

100-
/**
101-
* Forcibly evict an item from the cache immediately without regard for transaction
102-
* isolation.
103-
*
104-
* @param key The key of the item to remove
105-
* @throws CacheException if evicting the item fails
106-
*/
107-
void evict(Object key) throws CacheException;
102+
/**
103+
* Forcibly evict an item from the cache immediately without regard for transaction
104+
* isolation.
105+
*
106+
* @param key The key of the item to remove
107+
* @throws CacheException if evicting the item fails
108+
*/
109+
void evict(Object key) throws CacheException;
108110

109-
/**
110-
* Forcibly evict all items from the cache immediately without regard for transaction
111-
* isolation.
112-
*
113-
* @throws CacheException if evicting items fails
114-
*/
115-
void evictAll() throws CacheException;
111+
/**
112+
* Forcibly evict all items from the cache immediately without regard for transaction
113+
* isolation.
114+
*
115+
* @throws CacheException if evicting items fails
116+
*/
117+
void evictAll() throws CacheException;
116118

117-
/**
118-
* Called when we have finished the attempted update/delete (which may or
119-
* may not have been successful), after transaction completion. This method
120-
* is used by "asynchronous" concurrency strategies.
121-
*
122-
*
123-
* @param session
124-
* @param key The item key
125-
* @throws org.hibernate.cache.CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region}
126-
*/
127-
void unlockItem(Object session, Object key) throws CacheException;
119+
/**
120+
* Called when we have finished the attempted update/delete (which may or
121+
* may not have been successful), after transaction completion. This method
122+
* is used by "asynchronous" concurrency strategies.
123+
*
124+
* @param session
125+
* @param key The item key
126+
* @throws org.hibernate.cache.CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region}
127+
*/
128+
void unlockItem(Object session, Object key) throws CacheException;
128129

129-
/**
130-
* Called after an item has been inserted (after the transaction completes),
131-
* instead of calling release().
132-
* This method is used by "asynchronous" concurrency strategies.
133-
*
134-
*
135-
* @param session
136-
* @param key The item key
137-
* @param value The item
138-
* @param version The item's version value
139-
* @return Were the contents of the cache actual changed by this operation?
140-
* @throws CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region}
141-
*/
142-
boolean afterInsert(Object session, Object key, Object value, Object version);
130+
/**
131+
* Called after an item has been inserted (after the transaction completes),
132+
* instead of calling release().
133+
* This method is used by "asynchronous" concurrency strategies.
134+
*
135+
* @param session
136+
* @param key The item key
137+
* @param value The item
138+
* @param version The item's version value
139+
* @return Were the contents of the cache actual changed by this operation?
140+
* @throws CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region}
141+
*/
142+
boolean afterInsert(Object session, Object key, Object value, Object version);
143143

144-
/**
145-
* Called after an item has been updated (after the transaction completes),
146-
* instead of calling release(). This method is used by "asynchronous"
147-
* concurrency strategies.
148-
*
149-
*
150-
* @param session
151-
* @param key The item key
152-
* @param value The item
153-
* @param currentVersion The item's current version value
154-
* @param previousVersion The item's previous version value
155-
* @param lock The lock
156-
* @return Were the contents of the cache actual changed by this operation?
157-
* @throws CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region}
158-
*/
159-
boolean afterUpdate(Object session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock);
144+
/**
145+
* Called after an item has been updated (after the transaction completes),
146+
* instead of calling release(). This method is used by "asynchronous"
147+
* concurrency strategies.
148+
*
149+
* @param session
150+
* @param key The item key
151+
* @param value The item
152+
* @param currentVersion The item's current version value
153+
* @param previousVersion The item's previous version value
154+
* @param lock The lock
155+
* @return Were the contents of the cache actual changed by this operation?
156+
* @throws CacheException Propagated from underlying {@link org.hibernate.cache.spi.Region}
157+
*/
158+
boolean afterUpdate(Object session, Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock);
160159
}

0 commit comments

Comments
 (0)