for (int i = 0; i < list.size(); i++) { SchObject interval = (SchObject) list.get(i); int start = ((Reusable.RInteger) interval.getField ("start")).intValue(); int end = ((Reusable.RInteger) interval.getField ("end")).intValue(); String color = getColor (interval); String text = activityText (interval); int insert = findInsertPosition (blocks, start); int overlap = findNumOverlapping (blocks, end, insert); try { blocks = combine2 (start, end, blocks, insert, overlap, color, text); } catch (RuntimeException re) { System.err.println ("SchedulingSpecs.resourceUnavailableTimes - ERROR - resource " + resource.getKey () + "\nstart " + start + "\nend " + end + "\nhad time block problem " + re.getMessage());  System.err.println ("Checking blocks ...");  for (int j = 0; j < list.size(); j++) { SchObject interval2 = (SchObject) list.get(j); int start2 = ((Reusable.RInteger) interval2.getField ("start")).intValue(); int end2 = ((Reusable.RInteger) interval2.getField ("end")).intValue(); if (start2 > end2) System.err.println ("SchedulingSpecs.resourceUnavailableTimes - ERROR - start after end interval " + interval2); }  break; } }
for (int i = 0; i < list.size(); i++) { SchObject interval = (SchObject) list.get(i); int start = ((Reusable.RInteger) interval.getField ("start")).intValue(); int end = ((Reusable.RInteger) interval.getField ("end")).intValue(); String color = getColor (interval); String text = activityText (interval); int insert = findInsertPosition (blocks, start); int overlap = findNumOverlapping (blocks, end, insert); blocks = combine2 (start, end, blocks, insert, overlap, color, text); }
  public TimeBlock[] resourceUnavailableTimes (Resource resource) {    TimeBlock[] blocks = new TimeBlock[0];    if (resourceUnavailableTimes == null)      return blocks;    data.put ("resource", resource);    Object obj = resourceUnavailableTimes.getResult (data);    data.remove ("resource");    reuse.resetObjects();    if (obj == null)      return blocks;    ArrayList list = (ArrayList) obj;	for (int i = 0; i < list.size(); i++) {	  SchObject interval = (SchObject) list.get(i);	  int start = ((Reusable.RInteger) interval.getField ("start")).intValue();	  int end = ((Reusable.RInteger) interval.getField ("end")).intValue();	  String color = getColor (interval);	  String text = activityText (interval);	  int insert = findInsertPosition (blocks, start);	  int overlap = findNumOverlapping (blocks, end, insert);	  try {		blocks = combine2 (start, end, blocks, insert, overlap, color, text);	  } catch (RuntimeException re) {		System.err.println ("SchedulingSpecs.resourceUnavailableTimes - ERROR - resource " + resource.getKey () +							"\nstart " + start +							"\nend " + end +							"\nhad time block problem " + re.getMessage());		System.err.println ("Checking blocks ...");				for (int j = 0; j < list.size(); j++) {		  SchObject interval2 = (SchObject) list.get(j);		  int start2 = ((Reusable.RInteger) interval2.getField ("start")).intValue();		  int end2 = ((Reusable.RInteger) interval2.getField ("end")).intValue();		  if (start2 > end2)			System.err.println ("SchedulingSpecs.resourceUnavailableTimes - ERROR - start after end interval " + 								interval2);		}				break;	  }	}	     return blocks;  }