Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static boolean cambiosRestricciones(String restricciones, List lista) {
- log.debug("-----------------CompareRestricciones---------------");
- log.debug("Restricciones: " + restricciones);
- String[] resArray = null;
- if (restricciones==null)
- {
- resArray = new String[0];
- }else {
- restricciones = restricciones.replace("[","");
- restricciones = restricciones.replace("]","");
- restricciones = restricciones.trim();
- resArray = restricciones.split(",");
- }
- List resWS = Arrays.asList(resArray);
- Collections.sort(resWS);
- List resHistoria = new ArrayList();
- for (Iterator it = lista.iterator(); it.hasNext();) {
- DictFinRestriccionWeb dw = (DictFinRestriccionWeb) it.next();
- resHistoria.add(dw.getRestriccion().getCodigoStr());
- log.debug("GetCodigoStr: " + dw.getRestriccion().getCodigoStr());
- }
- Collections.sort(resHistoria);
- int compare = -1;
- log.debug("resWS: " + resWS);
- log.debug(resWS != null ? resWS.size() : 0);
- log.debug("resHistoria: " + resHistoria);
- log.debug(resHistoria != null ? resHistoria.size() : 0);
- try {
- //compare = ExpenseComparator.compareLists(resWS, resHistoria);
- CompareRecords tc = new CompareRecords(resWS);
- compare = tc.compareTo(resHistoria);
- } catch (Exception e) {
- e.printStackTrace();
- }
- log.debug("Hay cambio de restricciones: "+ (compare != 0) );
- return compare != 0 ? true : false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement