@@ -599,32 +599,44 @@ public synchronized boolean isCached() {
599599 }
600600
601601 protected String computeCacheSignature () throws IOException {
602- StringBuilder b = new StringBuilder (1024 );
602+ StringBuilder b = new StringBuilder (16 * 1024 );
603+ getContext ().getPlatform ().toString (b );
604+ b .append ('\n' );
603605 for (CLDevice device : getDevices ())
604- b .append (device ).append (" \n " );
606+ b .append (device ).append ('\n' );
605607
606608 b .append (getOptionsString ()).append ('\n' );
607- if (macros != null )
609+ if (macros != null && ! macros . isEmpty () )
608610 for (Map .Entry <String , Object > m : macros .entrySet ())
609- b .append ("-D" ).append (m .getKey ()).append ("=" ).append (m .getValue ()).append ('\n' );
611+ b .append ("-D" ).append (m .getKey ()).append ('=' ).append (m .getValue ()).append ('\n' );
610612
611- if (includes != null )
613+ if (includes != null && ! includes . isEmpty () )
612614 for (String path : includes )
613615 b .append ("-I" ).append (path ).append ('\n' );
614616
615- if (sources != null )
617+ if (sources != null && ! sources . isEmpty () )
616618 for (String source : sources )
617- b .append (source ).append (" \n " );
619+ b .append (source ).append ('\n' );
618620
619621 Map <String , URL > inclusions = resolveInclusions ();
620- for (Map .Entry <String , URL > e : inclusions .entrySet ()) {
621- URLConnection con = e .getValue ().openConnection ();
622- InputStream in = con .getInputStream ();
623- b .append ('#' ).append (e .getKey ()).append (con .getLastModified ()).append ('\n' );
624- in .close ();
625- }
622+ if (inclusions != null && !inclusions .isEmpty ())
623+ for (Map .Entry <String , URL > e : inclusions .entrySet ()) {
624+ URLConnection con = e .getValue ().openConnection ();
625+ InputStream in = con .getInputStream ();
626+ b .append ('#' ).append (e .getKey ()).append (con .getLastModified ()).append ('\n' );
627+ in .close ();
628+ }
629+
630+ for (String name : propsToIncludeInSignature )
631+ b .append (name ).append ('=' ).append (System .getProperty (name )).append ('\n' );
632+
626633 return b .toString ();
627634 }
635+ private final String [] propsToIncludeInSignature = new String [] {
636+ //"java.vm.version", // probably superfluous...
637+ "os.version" ,
638+ "os.name"
639+ };
628640
629641 boolean built ;
630642 /**
0 commit comments