~davewalker/ubuntu/maverick/eucalyptus/lp611144

« back to all changes in this revision

Viewing changes to clc/modules/msgs/src/main/java/com/eucalyptus/util/LogUtil.groovy

  • Committer: Dave Walker (Daviey)
  • Date: 2010-06-21 12:59:20 UTC
  • mfrom: (1048.1.14 ubuntu)
  • Revision ID: davewalker@ubuntu.com-20100621125920-60uhixwq174elnj1
* New major upstream version merge, 1.7 (r1200).
* debian/patches/:
  - 02-Makefile.patch: Updated to reflect new code layout.
  - 07-local_support_euca_conf-in.patch: Updated to reflect new code layout.
  - 08-ubuntu-default-networking.patch: Refreshed.
  - 09-small-128-192MB.patch: Updated to point to new location.
  - 10-disable-iscsi.patch: Refreshed.
  - 11-state-cleanup-memleakfix.patch: Refreshed.
  - 15-fix-default-ramdisk.patch: Updated to point to new location.
  - 16-kvm_libvirt_xml_default_use_kvm.patch: Updated to reflect changes.
  - 17-fix_walrus_OOM_errors.patch: Removed, fixed upstream.
  - 18-priv_security.patch: Updated to reflect upstream changes.
  - 20-brute-force-webui.patch: Updated to reflect upstream changes. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    LOG.info( LogUtil.subheader( message ) );
36
36
    return singleton;
37
37
  }
 
38
  public static String rangedIntegerList( Collection<Integer> intList ) {
 
39
    String shortList = "";
 
40
    if( intList.size() < 5 ) {
 
41
      shortList = intList.toString().replaceAll("\\s","");
 
42
    } else {         
 
43
      shortList = "[${intList.first( )}..";
 
44
      Integer last = intList.first( )-1;
 
45
      intList.subSet(intList.first(),intList.last()).each{ Integer it ->
 
46
        if( !last.equals( it-1 ) ) {
 
47
          shortList += "${last},${it}..";
 
48
        }            
 
49
        last = it;   
 
50
      }              
 
51
      shortList += (last+1 == intList.last())?"${intList.last()}]":"${last},${intList.last( )}]";
 
52
    }
 
53
    return shortList;
 
54
  }
38
55
}