×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Me Myself
Added: Nov 19, 2017 12:42 PM
Views: 5
Tags: no tags
Check if there are duplicates in one given Array
  1.             LabtimusArray lpa = new LabtimusArray();
  2.             if (lpa.duplicates(specFieldName)){
  3.                 StackTraceElement[] elements = Thread.currentThread().getStackTrace();
  4.                 diagnoses[0]= elements[1].getClassName() + "." + elements[1].getMethodName();
  5.                 diagnoses[1]= classVersion;
  6.                 diagnoses[2]= "Code Line " + String.valueOf(elements[1].getLineNumber());
  7.                 diagnoses[3]="FALSE";
  8.                 diagnoses[4]="ERROR:Fields duplicated";
  9.                 diagnoses[5]="Detected any field duplicated in FieldName, the values are:"+(char) 10 + specFieldName.toString();
  10.                 return diagnoses;
  11.             }
  12.