@@ -133,7 +133,7 @@ public static boolean hasdata(Object[] parsedcsvline) {
133
133
public static String buildExceptionMessage (Throwable t ) {
134
134
if (t == null )
135
135
return "Null Exception (this is not normal)" ;
136
- return "Error: " + t .getClass (). getName () + " - " + t .getMessage () + " @ " + t .getStackTrace ()[0 ];
136
+ return "Error: " + ( t .getClass ()!= null ? t . getClass (). getName (): "Null Class" ) + " - " + t .getMessage () + " @ " + ( t .getStackTrace ()!= null ?( t . getStackTrace (). length > 0 ? t . getStackTrace () [0 ]: "No element stack trace" ): "Null Stack Trace" ) ;
137
137
}
138
138
139
139
private FlatFileLoaderReport load (
@@ -156,8 +156,8 @@ private FlatFileLoaderReport load(
156
156
ArrayList <FlatFileLoaderColumn <E >> loadercolumns = new ArrayList <FlatFileLoaderColumn <E >>();
157
157
// custom loader helpers sorted by classname.
158
158
HashMap <
159
- String ,
160
- CustomloaderHelper <E >> activecustomloaderhelper = new HashMap <String , CustomloaderHelper <E >>();
159
+ String ,
160
+ CustomloaderHelper <E >> activecustomloaderhelper = new HashMap <String , CustomloaderHelper <E >>();
161
161
// line preparator is the column used to define if insert or update. There can
162
162
// be zero or 1 column like that
163
163
int linepreparatorindex = -1 ;
@@ -192,7 +192,7 @@ private FlatFileLoaderReport load(
192
192
logger .severe (" " +thisalias +" - " +aliassolved );
193
193
}
194
194
logger .severe ("-------------------------------------------------------------------------" );
195
-
195
+
196
196
throw new RuntimeException ("Did not find any element for column '" + headlineelement + "' "
197
197
+ (alias != null ? "(Alias '" + alias + "')" : "" ));
198
198
}
@@ -232,9 +232,9 @@ private FlatFileLoaderReport load(
232
232
logger .info (
233
233
" --- starting static preprocessing for object '" + objectdefinition .getName () + "' - " );
234
234
ArrayList <
235
- HashMap <
236
- String ,
237
- String >> uniquevaluesforstaticprocessing = new ArrayList <HashMap <String , String >>();
235
+ HashMap <
236
+ String ,
237
+ String >> uniquevaluesforstaticprocessing = new ArrayList <HashMap <String , String >>();
238
238
for (int i = 0 ; i < columnswithstaticprocessing .size (); i ++)
239
239
uniquevaluesforstaticprocessing .add (new HashMap <String , String >());
240
240
Object [] data = parser .parseOneLine ();
@@ -275,7 +275,7 @@ private FlatFileLoaderReport load(
275
275
}
276
276
}
277
277
logger .info (" --- finished static preprocessing for for object '" + objectdefinition .getName ()
278
- + "' - , read " + firstpass + " lines in file" );
278
+ + "' - , read " + firstpass + " lines in file" );
279
279
}
280
280
Object [] dataforloading = parser .parseOneLine ();
281
281
// ---- loop on data
@@ -298,9 +298,9 @@ private FlatFileLoaderReport load(
298
298
boolean contentupdated = false ;
299
299
// adds criteria for selection
300
300
ArrayList <
301
- FlatFileLoaderColumn .LinePreparationExtra <
302
- E >> linepreparatorextracriterias = new ArrayList <
303
- FlatFileLoaderColumn .LinePreparationExtra <E >>();
301
+ FlatFileLoaderColumn .LinePreparationExtra <
302
+ E >> linepreparatorextracriterias = new ArrayList <
303
+ FlatFileLoaderColumn .LinePreparationExtra <E >>();
304
304
for (int i = 0 ; i < linepreparatorextraindex .size (); i ++) {
305
305
FlatFileLoaderColumn <E > thiscolumn = loadercolumns .get (linepreparatorextraindex .get (i ));
306
306
linepreparatorextracriterias .add (thiscolumn
@@ -317,7 +317,7 @@ private FlatFileLoaderReport load(
317
317
if (dataforloading .length <= linepreparatorindex )
318
318
throw new RuntimeException (
319
319
"loooking for line preparator index at index = " + linepreparatorindex
320
- + " but line only has length = " + dataforloading .length );
320
+ + " but line only has length = " + dataforloading .length );
321
321
FlatFileLoaderColumn <E > thiscolumn = loadercolumns .get (linepreparatorindex );
322
322
LinePreparation <E > thislineprep = thiscolumn .LinePreparation (
323
323
dataforloading [linepreparatorindex ], linepreparatorextracriterias );
@@ -386,7 +386,7 @@ private FlatFileLoaderReport load(
386
386
387
387
// ---------- runs multi-field checks and constraints
388
388
objectforprocessing .getDefinitionFromObject ()
389
- .checkMultiFieldConstraints (objectforprocessing );
389
+ .checkMultiFieldConstraints (objectforprocessing );
390
390
391
391
if (thislineupdate )
392
392
if (contentupdated ) {
@@ -709,7 +709,7 @@ public static String parseObject(Object object, String context) {
709
709
return value ;
710
710
}
711
711
throw new RuntimeException ("For " + context + ", received an object of unsupported type = " + object .getClass ()
712
- + " value = " + object );
712
+ + " value = " + object );
713
713
714
714
}
715
715
@@ -728,7 +728,7 @@ public static String parseStringStrict(Object object, String context) {
728
728
return value ;
729
729
}
730
730
throw new RuntimeException ("For " + context + ", received an object of unsupported type = " + value .getClass ()
731
- + " value = " + value );
731
+ + " value = " + value );
732
732
733
733
}
734
734
@@ -776,7 +776,7 @@ public static Date parseDate(Object object, String context, boolean timeedit, Da
776
776
777
777
}
778
778
throw new RuntimeException ("For " + context + ", received an object of unsupported type = " + object .getClass ()
779
- + " value = " + object );
779
+ + " value = " + object );
780
780
781
781
}
782
782
@@ -806,7 +806,7 @@ public static Integer parseInteger(Object object, String context) {
806
806
}
807
807
// --------------------- Else return error
808
808
throw new RuntimeException ("For " + context + ", received an object of unsupported type = " + object .getClass ()
809
- + " value = " + object );
809
+ + " value = " + object );
810
810
}
811
811
812
812
/**
@@ -847,7 +847,7 @@ public static BigDecimal parseDecimal(
847
847
if (parsedbigdecimal .precision () > precision )
848
848
throw new RuntimeException (
849
849
"Trying to load a number with a precision too big " + parsedbigdecimal .precision ()
850
- + ", authorized precision = " + precision + ", number = " + parsedbigdecimal );
850
+ + ", authorized precision = " + precision + ", number = " + parsedbigdecimal );
851
851
return parsedbigdecimal ;
852
852
}
853
853
if (object instanceof String ) {
@@ -864,7 +864,7 @@ public static BigDecimal parseDecimal(
864
864
return parsedbigdecimal ;
865
865
}
866
866
throw new RuntimeException ("For " + context + ", received an object of unsupported type = " + object .getClass ()
867
- + " value = " + object );
867
+ + " value = " + object );
868
868
}
869
869
870
870
/**
0 commit comments