asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Westmann (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: remove useless curly braces
Date Tue, 29 Nov 2016 02:11:49 GMT
Till Westmann has submitted this change and it was merged.

Change subject: remove useless curly braces
......................................................................


remove useless curly braces

Change-Id: If38738222513cfc89bef1b5e2ecb1bb2eda0454a
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1361
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <bamousaa@gmail.com>
---
M asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlADMPrinterFactoryProvider.java
M asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
M asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryTokenizerFactoryProvider.java
M asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCSVPrinterFactoryProvider.java
M asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java
M asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java
M asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
7 files changed, 70 insertions(+), 139 deletions(-)

Approvals:
  abdullah alamoudi: Looks good to me, approved
  Jenkins: Verified; No violations found; Verified



diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlADMPrinterFactoryProvider.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlADMPrinterFactoryProvider.java
index a1c1dc8..97808a1 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlADMPrinterFactoryProvider.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlADMPrinterFactoryProvider.java
@@ -123,16 +123,14 @@
                     return new AOrderedlistPrinterFactory((AOrderedListType) aqlType);
                 case UNORDEREDLIST:
                     return new AUnorderedlistPrinterFactory((AUnorderedListType) aqlType);
-                case UNION: {
+                case UNION:
                     if (((AUnionType) aqlType).isUnknownableType()) {
                         return new AOptionalFieldPrinterFactory((AUnionType) aqlType);
                     } else {
                         return new AUnionPrinterFactory((AUnionType) aqlType);
                     }
-                }
-                case UUID: {
+                case UUID:
                     return AUUIDPrinterFactory.INSTANCE;
-                }
                 case SHORTWITHOUTTYPEINFO:
                     return ShortWithoutTypeInfoPrinterFactory.INSTANCE;
                 case ANY:
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
index a8c6eea..7927e76 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
@@ -102,9 +102,9 @@
     public IBinaryComparatorFactory getBinaryComparatorFactory(ATypeTag type, boolean ascending)
{
         switch (type) {
             case ANY:
-            case UNION: { // we could do smth better for nullable fields
+            case UNION:
+                // we could do smth better for nullable fields
                 return anyBinaryComparatorFactory(ascending);
-            }
             case NULL:
             case MISSING:
                 return new IBinaryComparatorFactory() {
@@ -122,68 +122,49 @@
                         };
                     }
                 };
-            case BOOLEAN: {
+            case BOOLEAN:
                 return addOffset(BooleanBinaryComparatorFactory.INSTANCE, ascending);
-            }
-            case INT8: {
+            case INT8:
                 return addOffset(BYTE_POINTABLE_INSTANCE, ascending);
-            }
-            case INT16: {
+            case INT16:
                 return addOffset(SHORT_POINTABLE_INSTANCE, ascending);
-            }
             case DATE:
             case TIME:
             case YEARMONTHDURATION:
-            case INT32: {
+            case INT32:
                 return addOffset(INTEGER_POINTABLE_INSTANCE, ascending);
-            }
             case DATETIME:
             case DAYTIMEDURATION:
-            case INT64: {
+            case INT64:
                 return addOffset(LONG_POINTABLE_INSTANCE, ascending);
-            }
-            case FLOAT: {
+            case FLOAT:
                 return addOffset(FLOAT_POINTABLE_INSTANCE, ascending);
-            }
-            case DOUBLE: {
+            case DOUBLE:
                 return addOffset(DOUBLE_POINTABLE_INSTANCE, ascending);
-            }
-            case STRING: {
+            case STRING:
                 return addOffset(UTF8STRING_POINTABLE_INSTANCE, ascending);
-            }
-            case RECTANGLE: {
+            case RECTANGLE:
                 return addOffset(ARectanglePartialBinaryComparatorFactory.INSTANCE, ascending);
-            }
-            case CIRCLE: {
+            case CIRCLE:
                 return addOffset(ACirclePartialBinaryComparatorFactory.INSTANCE, ascending);
-            }
-            case POINT: {
+            case POINT:
                 return addOffset(APointPartialBinaryComparatorFactory.INSTANCE, ascending);
-            }
-            case POINT3D: {
+            case POINT3D:
                 return addOffset(APoint3DPartialBinaryComparatorFactory.INSTANCE, ascending);
-            }
-            case LINE: {
+            case LINE:
                 return addOffset(ALinePartialBinaryComparatorFactory.INSTANCE, ascending);
-            }
-            case POLYGON: {
+            case POLYGON:
                 return addOffset(APolygonPartialBinaryComparatorFactory.INSTANCE, ascending);
-            }
-            case DURATION: {
+            case DURATION:
                 return addOffset(ADurationPartialBinaryComparatorFactory.INSTANCE, ascending);
-            }
-            case INTERVAL: {
+            case INTERVAL:
                 return addOffset(intervalBinaryComparatorFactory(ascending), ascending);
-            }
-            case UUID: {
+            case UUID:
                 return addOffset(AUUIDPartialBinaryComparatorFactory.INSTANCE, ascending);
-            }
-            case BINARY: {
+            case BINARY:
                 return addOffset(BINARY_POINTABLE_INSTANCE, ascending);
-            }
-            default: {
+            default:
                 return addOffset(RawBinaryComparatorFactory.INSTANCE, ascending);
-            }
         }
     }
 
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryTokenizerFactoryProvider.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryTokenizerFactoryProvider.java
index 52248c8..db8d6b6 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryTokenizerFactoryProvider.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlBinaryTokenizerFactoryProvider.java
@@ -51,22 +51,14 @@
     @Override
     public IBinaryTokenizerFactory getWordTokenizerFactory(ATypeTag typeTag, boolean hashedTokens)
{
         switch (typeTag) {
-            case STRING: {
-                if (hashedTokens) {
-                    return aqlHashingStringTokenizer;
-                } else {
-                    return aqlStringTokenizer;
-                }
-            }
-            case ORDEREDLIST: {
+            case STRING:
+                return hashedTokens ? aqlHashingStringTokenizer : aqlStringTokenizer;
+            case ORDEREDLIST:
                 return orderedListTokenizer;
-            }
-            case UNORDEREDLIST: {
+            case UNORDEREDLIST:
                 return unorderedListTokenizer;
-            }
-            default: {
+            default:
                 return null;
-            }
         }
     }
 
@@ -74,7 +66,7 @@
     public IBinaryTokenizerFactory getNGramTokenizerFactory(ATypeTag typeTag, int gramLength,
boolean usePrePost,
             boolean hashedTokens) {
         switch (typeTag) {
-            case STRING: {
+            case STRING:
                 if (hashedTokens) {
                     return null;
                 } else {
@@ -82,16 +74,12 @@
                             new UTF8NGramTokenFactory(ATypeTag.SERIALIZED_STRING_TYPE_TAG,
                                     ATypeTag.SERIALIZED_INT32_TYPE_TAG));
                 }
-            }
-            case ORDEREDLIST: {
+            case ORDEREDLIST:
                 return orderedListTokenizer;
-            }
-            case UNORDEREDLIST: {
+            case UNORDEREDLIST:
                 return unorderedListTokenizer;
-            }
-            default: {
+            default:
                 return null;
-            }
         }
     }
 }
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCSVPrinterFactoryProvider.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCSVPrinterFactoryProvider.java
index eef4456..265024f 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCSVPrinterFactoryProvider.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCSVPrinterFactoryProvider.java
@@ -117,16 +117,14 @@
                     throw new NotImplementedException("'Orderedlist' type unsupported for
CSV output");
                 case UNORDEREDLIST:
                     throw new NotImplementedException("'Unorderedlist' type unsupported for
CSV output");
-                case UNION: {
+                case UNION:
                     if (((AUnionType) aqlType).isUnknownableType()) {
                         return new AOptionalFieldPrinterFactory((AUnionType) aqlType);
                     } else {
                         return new AUnionPrinterFactory((AUnionType) aqlType);
                     }
-                }
-                case UUID: {
+                case UUID:
                     return AUUIDPrinterFactory.INSTANCE;
-                }
                 case SHORTWITHOUTTYPEINFO:
                     return ShortWithoutTypeInfoPrinterFactory.INSTANCE;
                 case ANY:
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java
index a69adc6..a25a9e9 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java
@@ -123,16 +123,14 @@
                     return new AOrderedlistPrinterFactory((AOrderedListType) aqlType);
                 case UNORDEREDLIST:
                     return new AUnorderedlistPrinterFactory((AUnorderedListType) aqlType);
-                case UNION: {
+                case UNION:
                     if (((AUnionType) aqlType).isUnknownableType()) {
                         return new AOptionalFieldPrinterFactory((AUnionType) aqlType);
                     } else {
                         return new AUnionPrinterFactory((AUnionType) aqlType);
                     }
-                }
-                case UUID: {
+                case UUID:
                     return AUUIDPrinterFactory.INSTANCE;
-                }
                 case SHORTWITHOUTTYPEINFO:
                     return ShortWithoutTypeInfoPrinterFactory.INSTANCE;
                 case ANY:
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java
index eeb812b..3ec3801 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java
@@ -123,16 +123,14 @@
                     return new AOrderedlistPrinterFactory((AOrderedListType) aqlType);
                 case UNORDEREDLIST:
                     return new AUnorderedlistPrinterFactory((AUnorderedListType) aqlType);
-                case UNION: {
+                case UNION:
                     if (((AUnionType) aqlType).isUnknownableType()) {
                         return new AOptionalFieldPrinterFactory((AUnionType) aqlType);
                     } else {
                         return new AUnionPrinterFactory((AUnionType) aqlType);
                     }
-                }
-                case UUID: {
+                case UUID:
                     return AUUIDPrinterFactory.INSTANCE;
-                }
                 case SHORTWITHOUTTYPEINFO:
                     return ShortWithoutTypeInfoPrinterFactory.INSTANCE;
                 case ANY:
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
index 4f1f9a3..ae2dea6 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
@@ -93,108 +93,78 @@
         }
         switch (aqlType.getTypeTag()) {
             case ANY:
-            case UNION: { // we could do smth better for nullable fields
+            case UNION:
+                // we could do smth better for nullable fields
                 return AObjectSerializerDeserializer.INSTANCE;
-            }
-            default: {
+            default:
                 return addTag(getNonTaggedSerializerDeserializer(aqlType), aqlType.getTypeTag());
-            }
         }
     }
 
     @SuppressWarnings("rawtypes")
     public ISerializerDeserializer getNonTaggedSerializerDeserializer(IAType aqlType) {
         switch (aqlType.getTypeTag()) {
-            case CIRCLE: {
+            case CIRCLE:
                 return ACircleSerializerDeserializer.INSTANCE;
-            }
-            case DATE: {
+            case DATE:
                 return ADateSerializerDeserializer.INSTANCE;
-            }
-            case DATETIME: {
+            case DATETIME:
                 return ADateTimeSerializerDeserializer.INSTANCE;
-            }
-            case DOUBLE: {
+            case DOUBLE:
                 return ADoubleSerializerDeserializer.INSTANCE;
-            }
-            case FLOAT: {
+            case FLOAT:
                 return AFloatSerializerDeserializer.INSTANCE;
-            }
-            case BOOLEAN: {
+            case BOOLEAN:
                 return ABooleanSerializerDeserializer.INSTANCE;
-            }
-            case INT8: {
+            case INT8:
                 return AInt8SerializerDeserializer.INSTANCE;
-            }
-            case INT16: {
+            case INT16:
                 return AInt16SerializerDeserializer.INSTANCE;
-            }
-            case INT32: {
+            case INT32:
                 return AInt32SerializerDeserializer.INSTANCE;
-            }
-            case INT64: {
+            case INT64:
                 return AInt64SerializerDeserializer.INSTANCE;
-            }
-            case LINE: {
+            case LINE:
                 return ALineSerializerDeserializer.INSTANCE;
-            }
             case MISSING:
                 return AMissingSerializerDeserializer.INSTANCE;
-            case NULL: {
+            case NULL:
                 return ANullSerializerDeserializer.INSTANCE;
-            }
-            case STRING: {
+            case STRING:
                 return AStringSerializerDeserializer.INSTANCE;
-            }
-            case BINARY: {
+            case BINARY:
                 return ABinarySerializerDeserializer.INSTANCE;
-            }
-            case TIME: {
+            case TIME:
                 return ATimeSerializerDeserializer.INSTANCE;
-            }
-            case DURATION: {
+            case DURATION:
                 return ADurationSerializerDeserializer.INSTANCE;
-            }
-            case YEARMONTHDURATION: {
+            case YEARMONTHDURATION:
                 return AYearMonthDurationSerializerDeserializer.INSTANCE;
-            }
-            case DAYTIMEDURATION: {
+            case DAYTIMEDURATION:
                 return ADayTimeDurationSerializerDeserializer.INSTANCE;
-            }
-            case INTERVAL: {
+            case INTERVAL:
                 return AIntervalSerializerDeserializer.INSTANCE;
-            }
-            case ORDEREDLIST: {
+            case ORDEREDLIST:
                 return new AOrderedListSerializerDeserializer((AOrderedListType) aqlType);
-            }
-            case POINT: {
+            case POINT:
                 return APointSerializerDeserializer.INSTANCE;
-            }
-            case POINT3D: {
+            case POINT3D:
                 return APoint3DSerializerDeserializer.INSTANCE;
-            }
-            case RECTANGLE: {
+            case RECTANGLE:
                 return ARectangleSerializerDeserializer.INSTANCE;
-            }
-            case POLYGON: {
+            case POLYGON:
                 return APolygonSerializerDeserializer.INSTANCE;
-            }
-            case RECORD: {
+            case RECORD:
                 return new ARecordSerializerDeserializer((ARecordType) aqlType);
-            }
-            case UNORDEREDLIST: {
+            case UNORDEREDLIST:
                 return new AUnorderedListSerializerDeserializer((AUnorderedListType) aqlType);
-            }
-            case UUID: {
+            case UUID:
                 return AUUIDSerializerDeserializer.INSTANCE;
-            }
-            case SHORTWITHOUTTYPEINFO: {
+            case SHORTWITHOUTTYPEINFO:
                 return ShortSerializerDeserializer.INSTANCE;
-            }
-            default: {
+            default:
                 throw new NotImplementedException(
                         "No serializer/deserializer implemented for type " + aqlType.getTypeTag()
+ " .");
-            }
         }
     }
 

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1361
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If38738222513cfc89bef1b5e2ecb1bb2eda0454a
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Till Westmann <tillw@apache.org>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message