File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
adapter/avro/src/main/java/org/apache/arrow/adapter/avro Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -457,12 +457,20 @@ private static boolean dictionaryIsValidEnum(Dictionary dictionary) {
457457 Set <String > symbols = new HashSet <>();
458458
459459 for (int i = 0 ; i < vector .getValueCount (); i ++) {
460- if (vector .isNull (i )) return false ;
460+ if (vector .isNull (i )) {
461+ return false ;
462+ }
461463 Text text = vector .getObject (i );
462- if (text == null ) return false ;
464+ if (text == null ) {
465+ return false ;
466+ }
463467 String symbol = text .toString ();
464- if (!ENUM_REGEX .matcher (symbol ).matches ()) return false ;
465- if (symbols .contains (symbol )) return false ;
468+ if (!ENUM_REGEX .matcher (symbol ).matches ()) {
469+ return false ;
470+ }
471+ if (symbols .contains (symbol )) {
472+ return false ;
473+ }
466474 symbols .add (symbol );
467475 }
468476
@@ -477,7 +485,9 @@ private static String[] dictionarySymbols(Dictionary dictionary) {
477485 for (int i = 0 ; i < vector .getValueCount (); i ++) {
478486 Text text = vector .getObject (i );
479487 // This should never happen if dictionaryIsValidEnum() succeeded
480- if (text == null ) throw new IllegalArgumentException ("Illegal null value in enum" );
488+ if (text == null ) {
489+ throw new IllegalArgumentException ("Illegal null value in enum" );
490+ }
481491 symbols [i ] = text .toString ();
482492 }
483493
You can’t perform that action at this time.
0 commit comments