1 /** 2 @test 3 @summary Verifying that the language names starts with lowercase in spanish 4 @bug 6275682 5 */ 6 7 import java.util.Locale; 8 9 public class Bug6275682 { 10 11 public static void main (String[] args) throws Exception { 12 Locale es = new Locale ("es"); 13 String[] isoLangs = es.getISOLanguages (); 14 String error = ""; 15 16 for (int i = 0; i < isoLangs.length; i++) { 17 Locale current = new Locale (isoLangs[i]); 18 String localeString = current.getDisplayLanguage (es); 19 String startLetter = localeString.substring (0,1); 20 if (!startLetter.toLowerCase (es).equals (startLetter)){ 21 error = error + "\n\t"+ isoLangs[i] + " " + localeString; 22 } 23 } 24 25 if (error.length () > 0){ 26 throw new Exception ("\nFollowing language names starts with upper-case letter: " 27 + error + "\nLower-case expected!"); 28 } 29 30 } 31 }