Skip to content

Commit

Permalink
IGNITE-12841: @OverRide must be on the same line as a method (apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-ostanin authored and kartiksomani committed Jun 10, 2020
1 parent 45cf9fb commit 451cd81
Show file tree
Hide file tree
Showing 66 changed files with 337 additions and 385 deletions.
3 changes: 3 additions & 0 deletions checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@
<property name="allowMultipleEmptyLines" value="false" />
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false" />
</module>

<!-- @Override annotations on the same line with a method declaration check. -->
<module name="org.apache.ignite.tools.checkstyle.OverrideAnnotationOnTheSameLineCheck"/>
</module>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ private MapPoint(Geometry coords) {
this.coords = coords;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public class HibernateL2CacheExample {

/** Caches' names. */
private static final String USER_CACHE_NAME = "org.apache.ignite.examples.datagrid.hibernate.User";

private static final String USER_POSTS_CACHE_NAME = "org.apache.ignite.examples.datagrid.hibernate.User.posts";

private static final String POST_CACHE_NAME = "org.apache.ignite.examples.datagrid.hibernate.Post";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
* <!-- Package description. -->
* Demonstrates usage of cron-based scheduler.
*/
package org.apache.ignite.examples.misc.schedule;
package org.apache.ignite.examples.misc.schedule;
Original file line number Diff line number Diff line change
Expand Up @@ -119,41 +119,34 @@ private class MyBatchExecutionAssistant implements BatchExecutionAssistant {

private Set<Integer> processed = new HashSet<>();

@Override
public void process(Row row, int seqNum) {
@Override public void process(Row row, int seqNum) {
if (processed.contains(seqNum))
return;

processed.add(seqNum);
}

@Override
public boolean alreadyProcessed(int seqNum) {
@Override public boolean alreadyProcessed(int seqNum) {
return processed.contains(seqNum);
}

@Override
public int processedCount() {
@Override public int processedCount() {
return processed.size();
}

@Override
public boolean tableExistenceRequired() {
@Override public boolean tableExistenceRequired() {
return false;
}

@Override
public String getTable() {
@Override public String getTable() {
return null;
}

@Override
public String getStatement() {
@Override public String getStatement() {
return null;
}

@Override
public BoundStatement bindStatement(PreparedStatement statement, Object obj) {
@Override public BoundStatement bindStatement(PreparedStatement statement, Object obj) {
if (statement instanceof WrappedPreparedStatement)
statement = ((WrappedPreparedStatement)statement).getWrappedStatement();

Expand All @@ -167,18 +160,15 @@ else if (statement == preparedStatement2) {
throw new RuntimeException("unexpected");
}

@Override
public KeyValuePersistenceSettings getPersistenceSettings() {
@Override public KeyValuePersistenceSettings getPersistenceSettings() {
return null;
}

@Override
public String operationName() {
@Override public String operationName() {
return null;
}

@Override
public Object processedData() {
@Override public Object processedData() {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,13 +893,11 @@ static class LogHandler extends Handler {
}

/** {@inheritDoc} */
@Override
public void close() {
@Override public void close() {
}

/** {@inheritDoc} */
@Override
public void flush() {
@Override public void flush() {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ protected FileIOFactory getFileIOFactory() {
/**
* @throws Exception If failed.
*/
@Override
protected void doTestPageCompression() throws Exception {
@Override protected void doTestPageCompression() throws Exception {
IgniteEx ignite = startGrid(0);

ignite.cluster().active(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ public class WalPageCompressionIntegrationTest extends AbstractPageCompressionIn
/**
* @throws Exception If failed.
*/
@Override
protected void doTestPageCompression() throws Exception {
@Override protected void doTestPageCompression() throws Exception {
// Ignite instance with compressed WAL page records.
IgniteEx ignite0 = startGrid(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,7 @@ public static boolean stop(@Nullable String name, boolean cancel, boolean stopNo

// Schedule delayed node killing if graceful stopping will be not finished within timeout.
executor.schedule(new Runnable() {
@Override
public void run() {
@Override public void run() {
if (state(name) == IgniteState.STARTED) {
U.error(null, "Unable to gracefully stop node within timeout " + timeoutMs +
" milliseconds. Killing node...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ public void checkHasClassName(String clsName, ClassLoader ldr, String fileName)
}

/** {@inheritDoc} */
@Override
public boolean registerClassName(byte platformId, int typeId, String clsName) throws IgniteCheckedException {
@Override public boolean registerClassName(byte platformId, int typeId, String clsName)
throws IgniteCheckedException {
return registerClassName(platformId, typeId, clsName, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2583,8 +2583,7 @@ static class CacheComparators {
* REVERSE comparator for cache descriptors (first user caches).
*/
static Comparator<DynamicCacheDescriptor> REVERSE = new Comparator<DynamicCacheDescriptor>() {
@Override
public int compare(DynamicCacheDescriptor o1, DynamicCacheDescriptor o2) {
@Override public int compare(DynamicCacheDescriptor o1, DynamicCacheDescriptor o2) {
return -DIRECT.compare(o1, o2);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ public LongRunningTxTimeDumpSettingsClosure(
}

/** {@inheritDoc} */
@Override
public void run() {
@Override public void run() {
IgniteTxManager tm = ((IgniteEx) ignite).context().cache().context().tm();

if (timeoutThreshold != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ public PartitionDefferedDeleteQueueCleanupTask(GridCacheSharedContext cctx, long
/** {@inheritDoc} */
@Override public void onTimeout() {
cctx.kernalContext().closure().runLocalSafe(new GridPlainRunnable() {
@Override
public void run() {
@Override public void run() {
try {
for (CacheGroupContext grp : cctx.cache().cacheGroups()) {
if (!grp.isLocal() && grp.affinityNode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,17 @@ public MetsatorageSearchRowImpl(String key, long link) {
}

/** {@inheritDoc} */
@Override
public String key() {
@Override public String key() {
return key;
}

/** {@inheritDoc} */
@Override
public long link() {
@Override public long link() {
return link;
}

/** {@inheritDoc} */
@Override
public int hash() {
@Override public int hash() {
return key.hashCode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ public List<FileDescriptor> resolveWalFiles(
if (file.isDirectory()) {
try {
walkFileTree(file.toPath(), new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) {
@Override public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) {
addFileDescriptor(path.toFile(), ioFactory, descriptors);

return FileVisitResult.CONTINUE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,11 @@ private void doClusterWideUpdate(DistributedChangeableProperty prop) {
return distributedMetastorage.writeAsync(toMetaStorageKey(key), newValue);
}

@Override
public GridFutureAdapter<?> casUpdate(String key, Serializable expectedValue, Serializable newValue)
throws IgniteCheckedException {
@Override public GridFutureAdapter<?> casUpdate(
String key,
Serializable expectedValue,
Serializable newValue
) throws IgniteCheckedException {
return distributedMetastorage.compareAndSetAsync(toMetaStorageKey(key), expectedValue, newValue);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,7 @@ private void addLocalCacheFuture(long idx, IgniteInternalFuture<byte[]> fut) {
pendingFuts.add(evictFut);

evictFut.listen(new IgniteInClosure<IgniteInternalFuture<byte[]>>() {
@Override
public void apply(IgniteInternalFuture<byte[]> t) {
@Override public void apply(IgniteInternalFuture<byte[]> t) {
pendingFuts.remove(evictFut);

pendingFutsLock.lock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,7 @@ public static BinaryMetadata readBinaryMetadata(BinaryRawReaderEx reader) {

Map<String, BinaryFieldMetadata> fields = readLinkedMap(reader,
new PlatformReaderBiClosure<String, BinaryFieldMetadata>() {
@Override
public IgniteBiTuple<String, BinaryFieldMetadata> read(BinaryRawReaderEx reader) {
@Override public IgniteBiTuple<String, BinaryFieldMetadata> read(BinaryRawReaderEx reader) {
String name = reader.readString();
int typeId = reader.readInt();
int fieldId = reader.readInt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,14 @@ public void setSqlSchema(String sqlSchema) {
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
@Override public int hashCode() {
return name != null ? name.hashCode() : 0;
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object obj) {
@Override public boolean equals(Object obj) {
if (this == obj)
return true;

Expand All @@ -132,8 +130,7 @@ public boolean equals(Object obj) {
/**
* {@inheritDoc}
*/
@Override
public String toString() {
@Override public String toString() {
return "GridClientCacheBean [name=" + name + ", mode=" + mode + ']';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ public GridTopologyCommandHandler(GridKernalContext ctx) {
}
else
node = F.find(ctx.discovery().allNodes(), null, new P1<ClusterNode>() {
@Override
public boolean apply(ClusterNode n) {
@Override public boolean apply(ClusterNode n) {
return containsIp(n.addresses(), ip);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,7 @@ public static int[] gridEvents(final int... excl) {
return GRID_EVTS;

List<Integer> evts = toIntList(GRID_EVTS, new P1<Integer>() {
@Override
public boolean apply(Integer i) {
@Override public boolean apply(Integer i) {
return !containsIntArray(excl, i);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,32 +175,27 @@ public ImmutableIntSet(Set<Integer> delegate) {
}

/** {@inheritDoc} */
@Override
public void forEach(Consumer<? super Integer> act) {
@Override public void forEach(Consumer<? super Integer> act) {
delegate.forEach(act);
}

/** {@inheritDoc} */
@Override
public boolean removeIf(Predicate<? super Integer> filter) {
@Override public boolean removeIf(Predicate<? super Integer> filter) {
throw new UnsupportedOperationException();
}

/** {@inheritDoc} */
@Override
public Spliterator<Integer> spliterator() {
@Override public Spliterator<Integer> spliterator() {
return delegate.spliterator();
}

/** {@inheritDoc} */
@Override
public Stream<Integer> stream() {
@Override public Stream<Integer> stream() {
return delegate.stream();
}

/** {@inheritDoc} */
@Override
public Stream<Integer> parallelStream() {
@Override public Stream<Integer> parallelStream() {
return delegate.parallelStream();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1556,8 +1556,7 @@ public boolean checkRegionMatches(String str, int strStartIndex, String search)
*
* @return a string describing the sensitivity
*/
@Override
public String toString() {
@Override public String toString() {
return name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public Long getSoftTimeout() {
}

/** {@inheritDoc} */
@Override
protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
@Override protected void readExternalData(byte protoVer, ObjectInput in)
throws IOException, ClassNotFoundException {
if (in.readBoolean())
enabled = in.readBoolean();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ else if (nextIdx == 2)
}

/** {@inheritDoc} */
@Nullable @Override
public V2 put(V1 key, V2 val) {
@Nullable @Override public V2 put(V1 key, V2 val) {
V2 old = containsKey(key) ? val2 : null;

set(key, val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,7 @@ private int removeExpiredCheckpoints(Connection conn) throws SQLException {
}

/** {@inheritDoc} */
@Override
public JdbcCheckpointSpi setName(String name) {
@Override public JdbcCheckpointSpi setName(String name) {
super.setName(name);

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1713,8 +1713,7 @@ static Unsafe unsafe() {
try {
return AccessController.doPrivileged
(new PrivilegedExceptionAction<Unsafe>() {
@Override
public Unsafe run() throws Exception {
@Override public Unsafe run() throws Exception {
Field f = Unsafe.class.getDeclaredField("theUnsafe");

f.setAccessible(true);
Expand Down
Loading

0 comments on commit 451cd81

Please sign in to comment.