Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. private static boolean cambiosRestricciones(String restricciones, List lista) {
  2. log.debug("-----------------CompareRestricciones---------------");
  3. log.debug("Restricciones: " + restricciones);
  4. String[] resArray = null;
  5. if (restricciones==null)
  6. {
  7. resArray = new String[0];
  8. }else {
  9. restricciones = restricciones.replace("[","");
  10. restricciones = restricciones.replace("]","");
  11. restricciones = restricciones.trim();
  12. resArray = restricciones.split(",");
  13. }
  14.  
  15. List resWS = Arrays.asList(resArray);
  16. Collections.sort(resWS);
  17.  
  18. List resHistoria = new ArrayList();
  19. for (Iterator it = lista.iterator(); it.hasNext();) {
  20. DictFinRestriccionWeb dw = (DictFinRestriccionWeb) it.next();
  21. resHistoria.add(dw.getRestriccion().getCodigoStr());
  22. log.debug("GetCodigoStr: " + dw.getRestriccion().getCodigoStr());
  23. }
  24. Collections.sort(resHistoria);
  25. int compare = -1;
  26.  
  27. log.debug("resWS: " + resWS);
  28. log.debug(resWS != null ? resWS.size() : 0);
  29. log.debug("resHistoria: " + resHistoria);
  30. log.debug(resHistoria != null ? resHistoria.size() : 0);
  31.  
  32. try {
  33. //compare = ExpenseComparator.compareLists(resWS, resHistoria);
  34. CompareRecords tc = new CompareRecords(resWS);
  35. compare = tc.compareTo(resHistoria);
  36. } catch (Exception e) {
  37. e.printStackTrace();
  38.  
  39. }
  40.  
  41. log.debug("Hay cambio de restricciones: "+ (compare != 0) );
  42. return compare != 0 ? true : false;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement