InfoPublication infoPublication1 = (InfoPublication) o1; InfoPublication infoPublication2 = (InfoPublication) o2; int year1,year2;    year1 = Integer.parseInt(infoPublication1.getYear()); year2 = Integer.parseInt(infoPublication2.getYear());  if (year1 < year2) return 1; if (year1 == year2) return 0; return -1;  }
InfoPublication infoPublication1 = (InfoPublication) o1; InfoPublication infoPublication2 = (InfoPublication) o2; int year1, year2;  if (infoPublication1.getYear() != null && infoPublication2.getYear() != null && StringUtils.isNumeric(infoPublication1.getYear()) && StringUtils.isNumeric(infoPublication2.getYear())) { year1 = Integer.parseInt(infoPublication1.getYear()); year2 = Integer.parseInt(infoPublication2.getYear());  if (year1 < year2) return 1; if (year1 == year2) return 0; return -1; } return 0; }
		    public int compare(Object o1, Object o2) {		        InfoPublication infoPublication1 = (InfoPublication) o1;		        InfoPublication infoPublication2 = (InfoPublication) o2;		        int year1,year2;		        		        //date sorting rules for publications//		        try {		            year1 = Integer.parseInt(infoPublication1.getYear());		            year2 = Integer.parseInt(infoPublication2.getYear());		            		            if (year1 < year2)		                return 1;		            if (year1 == year2)		                return 0;                    return -1;/*		        } catch (NumberFormatException nfe) {         throw nfe;      }*/		    }