Skip to content
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
-->
<module name="NoWhitespaceAfter">
<property name="tokens" value="AT, INC, DEC, UNARY_MINUS, UNARY_PLUS, BNOT, LNOT, DOT, ARRAY_DECLARATOR,
INDEX_OP, METHOD_REF"/>
INDEX_OP, METHOD_REF, TYPECAST"/>
</module>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static void main(String[] args) throws IOException {
.withMaxIterations(1000)
.withEpsilon(1e-2);

ANNClassificationModel mdl = (ANNClassificationModel) trainer.fit(
ANNClassificationModel mdl = (ANNClassificationModel)trainer.fit(
ignite,
dataCache,
new DoubleArrayVectorizer<Integer>().labeled(Vectorizer.LabelCoordinate.FIRST)
Expand Down Expand Up @@ -142,7 +142,7 @@ private static double evaluateModel(IgniteCache<Integer, double[]> dataCache, NN

System.out.println(">>> ---------------------------------");

accuracy = 1 - amountOfErrors / (double) totalAmount;
accuracy = 1 - amountOfErrors / (double)totalAmount;

}
return accuracy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ private static double evaluateModel(IgniteCache<Integer, Vector> dataCache, Rand
}
}

return 1 - amountOfErrors / (double) totalAmount;
return 1 - amountOfErrors / (double)totalAmount;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private static <T extends Number> Double asDouble(Object obj) {
return null;

if (obj instanceof Number) {
Number num = (Number) obj;
Number num = (Number)obj;

return num.doubleValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class GridifyAspectJAspect {
@SuppressWarnings({"ProhibitedExceptionDeclared", "ProhibitedExceptionThrown", "unchecked"})
@Around("execution(@org.apache.ignite.compute.gridify.Gridify * *(..)) && !cflow(call(* org.apache.ignite.compute.ComputeJob.*(..)))")
public Object gridify(ProceedingJoinPoint joinPnt) throws Throwable {
Method mtd = ((MethodSignature) joinPnt.getSignature()).getMethod();
Method mtd = ((MethodSignature)joinPnt.getSignature()).getMethod();

Gridify ann = mtd.getAnnotation(Gridify.class);

Expand Down Expand Up @@ -112,7 +112,7 @@ public Object gridify(ProceedingJoinPoint joinPnt) throws Throwable {
return ignite.compute().withTimeout(ann.timeout()).execute(ann.taskName(), arg);
}
catch (Exception e) {
for (Class<?> ex : ((MethodSignature) joinPnt.getSignature()).getMethod().getExceptionTypes()) {
for (Class<?> ex : ((MethodSignature)joinPnt.getSignature()).getMethod().getExceptionTypes()) {
// Descend all levels down.
Throwable cause = e.getCause();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class GridifySetToSetAspectJAspect extends GridifySetToSetAbstractAspect
@Around("execution(@org.apache.ignite.compute.gridify.GridifySetToSet * *(..)) && " +
"!cflow(call(* org.apache.ignite.compute.ComputeJob.*(..)))")
public Object gridify(ProceedingJoinPoint joinPnt) throws Throwable {
Method mtd = ((MethodSignature) joinPnt.getSignature()).getMethod();
Method mtd = ((MethodSignature)joinPnt.getSignature()).getMethod();

GridifySetToSet ann = mtd.getAnnotation(GridifySetToSet.class);

Expand Down Expand Up @@ -124,7 +124,7 @@ public Object gridify(ProceedingJoinPoint joinPnt) throws Throwable {
ann.threshold(), ann.splitSize(), ann.timeout());
}
catch (Exception e) {
for (Class<?> ex : ((MethodSignature) joinPnt.getSignature()).getMethod().getExceptionTypes()) {
for (Class<?> ex : ((MethodSignature)joinPnt.getSignature()).getMethod().getExceptionTypes()) {
// Descend all levels down.
Throwable cause = e.getCause();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class GridifySetToValueAspectJAspect extends GridifySetToValueAbstractAsp
@Around("execution(@org.apache.ignite.compute.gridify.GridifySetToValue * *(..)) && " +
"!cflow(call(* org.apache.ignite.compute.ComputeJob.*(..)))")
public Object gridify(ProceedingJoinPoint joinPnt) throws Throwable {
Method mtd = ((MethodSignature) joinPnt.getSignature()).getMethod();
Method mtd = ((MethodSignature)joinPnt.getSignature()).getMethod();

GridifySetToValue ann = mtd.getAnnotation(GridifySetToValue.class);

Expand Down Expand Up @@ -124,7 +124,7 @@ public Object gridify(ProceedingJoinPoint joinPnt) throws Throwable {
ann.threshold(), ann.splitSize(), ann.timeout());
}
catch (Exception e) {
for (Class<?> ex : ((MethodSignature) joinPnt.getSignature()).getMethod().getExceptionTypes()) {
for (Class<?> ex : ((MethodSignature)joinPnt.getSignature()).getMethod().getExceptionTypes()) {
// Descend all levels down.
Throwable cause = e.getCause();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ private void checkDefault(DeploymentMode depMode) throws Exception {
if (targetObj instanceof TestAopTarget)
res = ((TestAopTarget)targetObj).gridifyDefault("1");
else
res = ((TestAopTargetInterface) targetObj).gridifyDefault("1");
res = ((TestAopTargetInterface)targetObj).gridifyDefault("1");

assert res == 1 : "Invalid gridifyDefault result: " + res;
}
Expand Down Expand Up @@ -426,7 +426,7 @@ private void checkDefaultWithUserClassLoader(DeploymentMode depMode) throws Exce

Method gridifyMtd = targetObj.getClass().getDeclaredMethod("gridifyDefault", String.class);

res = (Integer) gridifyMtd.invoke(targetObj, "1");
res = (Integer)gridifyMtd.invoke(targetObj, "1");

if (res != 1)
fail("Method gridifyDefault returned wrong value [result=" + res + ", expect=1]");
Expand Down Expand Up @@ -508,7 +508,7 @@ private void checkDefaultResourceWithUserClassLoader(DeploymentMode depMode) thr

Method gridifyMtd = targetObj.getClass().getDeclaredMethod("gridifyDefaultResource", String.class);

res = (Integer) gridifyMtd.invoke(targetObj, "2");
res = (Integer)gridifyMtd.invoke(targetObj, "2");

if (res != 2)
fail("Method gridifyDefaultResource returned wrong value [result=" + res + ", expect=2]");
Expand Down Expand Up @@ -542,9 +542,9 @@ private void checkNonDefaultClass(DeploymentMode depMode) throws Exception {
Object targetObj = target();

if (targetObj instanceof TestAopTarget)
res = ((TestAopTarget) targetObj).gridifyNonDefaultClass("1");
res = ((TestAopTarget)targetObj).gridifyNonDefaultClass("1");
else
res = ((TestAopTargetInterface) targetObj).gridifyNonDefaultClass("1");
res = ((TestAopTargetInterface)targetObj).gridifyNonDefaultClass("1");

if (res != 10)
fail("Method gridifyNonDefault returned wrong value [result=" + res + ", expect=10]");
Expand Down Expand Up @@ -575,9 +575,9 @@ private void checkNonDefaultName(DeploymentMode depMode) throws Exception {
Object targetObj = target();

if (targetObj instanceof TestAopTarget)
res = ((TestAopTarget) targetObj).gridifyNonDefaultName("2");
res = ((TestAopTarget)targetObj).gridifyNonDefaultName("2");
else
res = ((TestAopTargetInterface) targetObj).gridifyNonDefaultName("2");
res = ((TestAopTargetInterface)targetObj).gridifyNonDefaultName("2");

if (res != 20)
fail("Method gridifyNonDefault returned wrong value [result=" + res + ", expect=2]");
Expand Down Expand Up @@ -607,9 +607,9 @@ private void checkDefaultException(DeploymentMode depMode) throws Exception {

try {
if (targetObj instanceof TestAopTarget)
((TestAopTarget) targetObj).gridifyDefaultException("1");
((TestAopTarget)targetObj).gridifyDefaultException("1");
else
((TestAopTargetInterface) targetObj).gridifyDefaultException("1");
((TestAopTargetInterface)targetObj).gridifyDefaultException("1");
}
catch (TestGridifyException e) {
info("@Gridify method gridifyDefaultException(0) returns exception: " + e);
Expand Down Expand Up @@ -683,9 +683,9 @@ private void checkNonDefaultClassResource(DeploymentMode depMode) throws Excepti
Object targetObj = target();

if (targetObj instanceof TestAopTarget)
res = ((TestAopTarget) targetObj).gridifyNonDefaultClassResource("3");
res = ((TestAopTarget)targetObj).gridifyNonDefaultClassResource("3");
else
res = ((TestAopTargetInterface) targetObj).gridifyNonDefaultClassResource("3");
res = ((TestAopTargetInterface)targetObj).gridifyNonDefaultClassResource("3");

if (res != 30)
fail("Method gridifyNonDefaultClassResource returned wrong value [result=" + res + ", expect=3]");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static class Context {
/** */
@Setup
public void setup() {
new Random().ints(BUF_LEN, Byte.MIN_VALUE, Byte.MAX_VALUE).forEach(k -> bb.put((byte) k));
new Random().ints(BUF_LEN, Byte.MIN_VALUE, Byte.MAX_VALUE).forEach(k -> bb.put((byte)k));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ else if (obj instanceof String) {
String qry = ((String)obj).trim();

if (qry.toLowerCase().startsWith("select"))
task = new LoadCacheCustomQueryWorker<>(ses, (String) obj, controller, log, clo);
task = new LoadCacheCustomQueryWorker<>(ses, (String)obj, controller, log, clo);
}

if (task != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static boolean isTableAbsenceError(Throwable e) {
KEYSPACE_EXIST_ERROR2.matcher(e.getMessage()).matches()))
return true;

if (e instanceof NoHostAvailableException && ((NoHostAvailableException) e).getErrors() != null) {
if (e instanceof NoHostAvailableException && ((NoHostAvailableException)e).getErrors() != null) {
NoHostAvailableException ex = (NoHostAvailableException)e;

for (Map.Entry<InetSocketAddress, Throwable> entry : ex.getErrors().entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ private int bindValues(PersistenceStrategy stgy, Serializer serializer, List<? e
Object val = field.getValueFromObject(obj, serializer);

if (val instanceof byte[])
val = ByteBuffer.wrap((byte[]) val);
val = ByteBuffer.wrap((byte[])val);

values[offset] = val;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public Product(long id, String type, String title, String description, float pri

/** {@inheritDoc} */
@Override public boolean equals(Object obj) {
return obj instanceof Product && id == ((Product) obj).id;
return obj instanceof Product && id == ((Product)obj).id;
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public ProductOrder(long id, long productId, float productPrice, Instant date, i

/** {@inheritDoc} */
@Override public boolean equals(Object obj) {
return obj instanceof ProductOrder && id == ((ProductOrder) obj).id;
return obj instanceof ProductOrder && id == ((ProductOrder)obj).id;
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void newSession(@Nullable Transaction tx) {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Nullable @Override public <T> T attachment() {
return (T) attach;
return (T)attach;
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ private static float generateProductPrice(long productId) {
if (i % 2 != 0)
price = price / 2;
else
price = (float) Math.sqrt(price);
price = (float)Math.sqrt(price);

i++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static class Person implements Serializable {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

Person person = (Person) o;
Person person = (Person)o;

if (id != person.id) return false;
if (age != person.age) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class JdbcSpringSelfTest extends JdbcConnectionSelfTest {
/** {@inheritDoc} */
@Test
@Override public void testClientNodeId() throws Exception {
IgniteEx client = (IgniteEx) startGridWithSpringCtx(getTestIgniteInstanceName(), true, configURL());
IgniteEx client = (IgniteEx)startGridWithSpringCtx(getTestIgniteInstanceName(), true, configURL());

UUID clientId = client.localNode().id();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ public void testSpecialTypes() throws Exception {

Assert.assertEquals(now, client.get("dateKey"));

Assert.assertTrue(client.set("byteKey", 0, (byte) 1).get());
Assert.assertTrue(client.set("byteKey", 0, (byte)1).get());

Assert.assertEquals((byte) 1, client.get("byteKey"));
Assert.assertEquals((byte)1, client.get("byteKey"));

Assert.assertTrue(client.set("floatKey", 0, 1.1).get());

Expand All @@ -370,9 +370,9 @@ public void testSpecialTypes() throws Exception {

assertArrayEquals(arr, (byte[])client.get("arrKey"));

Assert.assertTrue(client.set("shortKey", 0, (short) 1).get());
Assert.assertTrue(client.set("shortKey", 0, (short)1).get());

Assert.assertEquals((short) 1, client.get("shortKey"));
Assert.assertEquals((short)1, client.get("shortKey"));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ private byte[] createPacket(
packet[0] = (byte)0x80;
packet[1] = cmd.operationCode();

U.shortToBytes((short) keyData.length(), packet, 2);
U.shortToBytes((short)keyData.length(), packet, 2);

packet[4] = (byte)(extrasLength);

Expand Down Expand Up @@ -649,17 +649,17 @@ else if (obj instanceof Boolean) {
flags |= BOOLEAN_FLAG;
}
else if (obj instanceof Integer) {
bytes = U.intToBytes((Integer) obj);
bytes = U.intToBytes((Integer)obj);

flags |= INT_FLAG;
}
else if (obj instanceof Long) {
bytes = U.longToBytes((Long) obj);
bytes = U.longToBytes((Long)obj);

flags |= LONG_FLAG;
}
else if (obj instanceof Date) {
bytes = U.longToBytes(((Date) obj).getTime());
bytes = U.longToBytes(((Date)obj).getTime());

flags |= DATE_FLAG;
}
Expand All @@ -669,12 +669,12 @@ else if (obj instanceof Byte) {
flags |= BYTE_FLAG;
}
else if (obj instanceof Float) {
bytes = U.intToBytes(Float.floatToIntBits((Float) obj));
bytes = U.intToBytes(Float.floatToIntBits((Float)obj));

flags |= FLOAT_FLAG;
}
else if (obj instanceof Double) {
bytes = U.longToBytes(Double.doubleToLongBits((Double) obj));
bytes = U.longToBytes(Double.doubleToLongBits((Double)obj));

flags |= DOUBLE_FLAG;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void testCustomMessages() throws Exception {

assertTrue(msg instanceof GridClientCacheRequest);

GridClientCacheRequest res = (GridClientCacheRequest) msg;
GridClientCacheRequest res = (GridClientCacheRequest)msg;

assertEquals("Invalid operation", req.operation(), res.operation());
assertEquals("Invalid clientId", req.clientId(), res.clientId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static class Person implements Serializable {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

Person person = (Person) o;
Person person = (Person)o;

if (id != person.id) return false;
if (age != person.age) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static class Person implements Serializable {
if (o == null || getClass() != o.getClass())
return false;

Person person = (Person) o;
Person person = (Person)o;

if (id != person.id)
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ private void checkBasicCacheOperations(Function converterToSqlExpVal, Serializab
Object sqlStrKey;

if (keyValEntry.getKey() instanceof SqlStrConvertedValHolder) {
originalKey = ((SqlStrConvertedValHolder) keyValEntry.getKey()).originalVal();
sqlStrKey = ((SqlStrConvertedValHolder) keyValEntry.getKey()).sqlStrVal();
originalKey = ((SqlStrConvertedValHolder)keyValEntry.getKey()).originalVal();
sqlStrKey = ((SqlStrConvertedValHolder)keyValEntry.getKey()).sqlStrVal();
}
else {
originalKey = keyValEntry.getKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private void validateRandomRow(IgniteCache<Object, Object> cache, String type, F
for (int i = 0; i < 2; i++) {
if ("Binary".equals(type))
assertTrue("Type=" + type + "; exp=" + val + "; act=" + row.get(i),
Arrays.equals((byte[]) val, (byte[]) row.get(i)));
Arrays.equals((byte[])val, (byte[])row.get(i)));
else
assertTrue("Type=" + type + "; exp=" + val + "; act=" + row.get(i), row.get(i).equals(getBaseValue(type, inc)));
}
Expand Down Expand Up @@ -242,7 +242,7 @@ private void validateRandomRange(IgniteCache<Object, Object> cache, String type,

if ("Binary".equals(type))
assertTrue("Type=" + type + "; exp=" + val + "; act=" + row.get(0),
Arrays.equals((byte[]) val, (byte[]) row.get(0)));
Arrays.equals((byte[])val, (byte[])row.get(0)));
else
assertTrue("Type=" + type + "; exp=" + val + "; act=" + row.get(0),
row.get(0).equals(val));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public EntityValue(int val) {

/** {@inheritDoc} */
@Override public boolean equals(Object other) {
return val == ((EntityValue) other).val;
return val == ((EntityValue)other).val;
}

/** Enable comparison of EntityValue objects by the {@link #val} field. */
Expand Down
Loading