commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r889932 [6/33] - in /websites/production/commons/content/proper/commons-codec: ./ apidocs/ apidocs/org/apache/commons/codec/ apidocs/org/apache/commons/codec/binary/ apidocs/org/apache/commons/codec/binary/class-use/ apidocs/org/apache/comm...
Date Wed, 11 Dec 2013 04:34:52 GMT
Modified: websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Lang.html
==============================================================================
--- websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Lang.html (original)
+++ websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Lang.html Wed Dec 11 04:34:40 2013
@@ -74,7 +74,7 @@
 <span class="sourceLineNo">066</span> * Port of lang.php<a name="line.66"></a>
 <span class="sourceLineNo">067</span> *<a name="line.67"></a>
 <span class="sourceLineNo">068</span> * @since 1.6<a name="line.68"></a>
-<span class="sourceLineNo">069</span> * @version $Id: Lang.java 1429868 2013-01-07 16:08:05Z ggregory $<a name="line.69"></a>
+<span class="sourceLineNo">069</span> * @version $Id: Lang.java 1542813 2013-11-17 20:52:32Z tn $<a name="line.69"></a>
 <span class="sourceLineNo">070</span> */<a name="line.70"></a>
 <span class="sourceLineNo">071</span>public class Lang {<a name="line.71"></a>
 <span class="sourceLineNo">072</span>    // Implementation note: This class is divided into two sections. The first part is a static factory interface that<a name="line.72"></a>
@@ -143,98 +143,100 @@
 <span class="sourceLineNo">135</span>        }<a name="line.135"></a>
 <span class="sourceLineNo">136</span><a name="line.136"></a>
 <span class="sourceLineNo">137</span>        final Scanner scanner = new Scanner(lRulesIS, ResourceConstants.ENCODING);<a name="line.137"></a>
-<span class="sourceLineNo">138</span>        boolean inExtendedComment = false;<a name="line.138"></a>
-<span class="sourceLineNo">139</span>        while (scanner.hasNextLine()) {<a name="line.139"></a>
-<span class="sourceLineNo">140</span>            final String rawLine = scanner.nextLine();<a name="line.140"></a>
-<span class="sourceLineNo">141</span>            String line = rawLine;<a name="line.141"></a>
-<span class="sourceLineNo">142</span><a name="line.142"></a>
-<span class="sourceLineNo">143</span>            if (inExtendedComment) {<a name="line.143"></a>
-<span class="sourceLineNo">144</span>                // check for closing comment marker, otherwise discard doc comment line<a name="line.144"></a>
-<span class="sourceLineNo">145</span>                if (line.endsWith(ResourceConstants.EXT_CMT_END)) {<a name="line.145"></a>
-<span class="sourceLineNo">146</span>                    inExtendedComment = false;<a name="line.146"></a>
-<span class="sourceLineNo">147</span>                }<a name="line.147"></a>
-<span class="sourceLineNo">148</span>            } else {<a name="line.148"></a>
-<span class="sourceLineNo">149</span>                if (line.startsWith(ResourceConstants.EXT_CMT_START)) {<a name="line.149"></a>
-<span class="sourceLineNo">150</span>                    inExtendedComment = true;<a name="line.150"></a>
-<span class="sourceLineNo">151</span>                } else {<a name="line.151"></a>
-<span class="sourceLineNo">152</span>                    // discard comments<a name="line.152"></a>
-<span class="sourceLineNo">153</span>                    final int cmtI = line.indexOf(ResourceConstants.CMT);<a name="line.153"></a>
-<span class="sourceLineNo">154</span>                    if (cmtI &gt;= 0) {<a name="line.154"></a>
-<span class="sourceLineNo">155</span>                        line = line.substring(0, cmtI);<a name="line.155"></a>
-<span class="sourceLineNo">156</span>                    }<a name="line.156"></a>
+<span class="sourceLineNo">138</span>        try {<a name="line.138"></a>
+<span class="sourceLineNo">139</span>            boolean inExtendedComment = false;<a name="line.139"></a>
+<span class="sourceLineNo">140</span>            while (scanner.hasNextLine()) {<a name="line.140"></a>
+<span class="sourceLineNo">141</span>                final String rawLine = scanner.nextLine();<a name="line.141"></a>
+<span class="sourceLineNo">142</span>                String line = rawLine;<a name="line.142"></a>
+<span class="sourceLineNo">143</span>                if (inExtendedComment) {<a name="line.143"></a>
+<span class="sourceLineNo">144</span>                    // check for closing comment marker, otherwise discard doc comment line<a name="line.144"></a>
+<span class="sourceLineNo">145</span>                    if (line.endsWith(ResourceConstants.EXT_CMT_END)) {<a name="line.145"></a>
+<span class="sourceLineNo">146</span>                        inExtendedComment = false;<a name="line.146"></a>
+<span class="sourceLineNo">147</span>                    }<a name="line.147"></a>
+<span class="sourceLineNo">148</span>                } else {<a name="line.148"></a>
+<span class="sourceLineNo">149</span>                    if (line.startsWith(ResourceConstants.EXT_CMT_START)) {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>                        inExtendedComment = true;<a name="line.150"></a>
+<span class="sourceLineNo">151</span>                    } else {<a name="line.151"></a>
+<span class="sourceLineNo">152</span>                        // discard comments<a name="line.152"></a>
+<span class="sourceLineNo">153</span>                        final int cmtI = line.indexOf(ResourceConstants.CMT);<a name="line.153"></a>
+<span class="sourceLineNo">154</span>                        if (cmtI &gt;= 0) {<a name="line.154"></a>
+<span class="sourceLineNo">155</span>                            line = line.substring(0, cmtI);<a name="line.155"></a>
+<span class="sourceLineNo">156</span>                        }<a name="line.156"></a>
 <span class="sourceLineNo">157</span><a name="line.157"></a>
-<span class="sourceLineNo">158</span>                    // trim leading-trailing whitespace<a name="line.158"></a>
-<span class="sourceLineNo">159</span>                    line = line.trim();<a name="line.159"></a>
+<span class="sourceLineNo">158</span>                        // trim leading-trailing whitespace<a name="line.158"></a>
+<span class="sourceLineNo">159</span>                        line = line.trim();<a name="line.159"></a>
 <span class="sourceLineNo">160</span><a name="line.160"></a>
-<span class="sourceLineNo">161</span>                    if (line.length() == 0) {<a name="line.161"></a>
-<span class="sourceLineNo">162</span>                        continue; // empty lines can be safely skipped<a name="line.162"></a>
-<span class="sourceLineNo">163</span>                    }<a name="line.163"></a>
+<span class="sourceLineNo">161</span>                        if (line.length() == 0) {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>                            continue; // empty lines can be safely skipped<a name="line.162"></a>
+<span class="sourceLineNo">163</span>                        }<a name="line.163"></a>
 <span class="sourceLineNo">164</span><a name="line.164"></a>
-<span class="sourceLineNo">165</span>                    // split it up<a name="line.165"></a>
-<span class="sourceLineNo">166</span>                    final String[] parts = line.split("\\s+");<a name="line.166"></a>
+<span class="sourceLineNo">165</span>                        // split it up<a name="line.165"></a>
+<span class="sourceLineNo">166</span>                        final String[] parts = line.split("\\s+");<a name="line.166"></a>
 <span class="sourceLineNo">167</span><a name="line.167"></a>
-<span class="sourceLineNo">168</span>                    if (parts.length != 3) {<a name="line.168"></a>
-<span class="sourceLineNo">169</span>                        throw new IllegalArgumentException("Malformed line '" + rawLine + "' in language resource '" +<a name="line.169"></a>
-<span class="sourceLineNo">170</span>                                                           languageRulesResourceName + "'");<a name="line.170"></a>
-<span class="sourceLineNo">171</span>                    }<a name="line.171"></a>
+<span class="sourceLineNo">168</span>                        if (parts.length != 3) {<a name="line.168"></a>
+<span class="sourceLineNo">169</span>                            throw new IllegalArgumentException("Malformed line '" + rawLine +<a name="line.169"></a>
+<span class="sourceLineNo">170</span>                                    "' in language resource '" + languageRulesResourceName + "'");<a name="line.170"></a>
+<span class="sourceLineNo">171</span>                        }<a name="line.171"></a>
 <span class="sourceLineNo">172</span><a name="line.172"></a>
-<span class="sourceLineNo">173</span>                    final Pattern pattern = Pattern.compile(parts[0]);<a name="line.173"></a>
-<span class="sourceLineNo">174</span>                    final String[] langs = parts[1].split("\\+");<a name="line.174"></a>
-<span class="sourceLineNo">175</span>                    final boolean accept = parts[2].equals("true");<a name="line.175"></a>
+<span class="sourceLineNo">173</span>                        final Pattern pattern = Pattern.compile(parts[0]);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>                        final String[] langs = parts[1].split("\\+");<a name="line.174"></a>
+<span class="sourceLineNo">175</span>                        final boolean accept = parts[2].equals("true");<a name="line.175"></a>
 <span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>                    rules.add(new LangRule(pattern, new HashSet&lt;String&gt;(Arrays.asList(langs)), accept));<a name="line.177"></a>
-<span class="sourceLineNo">178</span>                }<a name="line.178"></a>
-<span class="sourceLineNo">179</span>            }<a name="line.179"></a>
-<span class="sourceLineNo">180</span>        }<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>        return new Lang(rules, languages);<a name="line.182"></a>
-<span class="sourceLineNo">183</span>    }<a name="line.183"></a>
-<span class="sourceLineNo">184</span><a name="line.184"></a>
-<span class="sourceLineNo">185</span>    private final Languages languages;<a name="line.185"></a>
-<span class="sourceLineNo">186</span>    private final List&lt;LangRule&gt; rules;<a name="line.186"></a>
-<span class="sourceLineNo">187</span><a name="line.187"></a>
-<span class="sourceLineNo">188</span>    private Lang(final List&lt;LangRule&gt; rules, final Languages languages) {<a name="line.188"></a>
-<span class="sourceLineNo">189</span>        this.rules = Collections.unmodifiableList(rules);<a name="line.189"></a>
-<span class="sourceLineNo">190</span>        this.languages = languages;<a name="line.190"></a>
-<span class="sourceLineNo">191</span>    }<a name="line.191"></a>
-<span class="sourceLineNo">192</span><a name="line.192"></a>
-<span class="sourceLineNo">193</span>    /**<a name="line.193"></a>
-<span class="sourceLineNo">194</span>     * Guesses the language of a word.<a name="line.194"></a>
-<span class="sourceLineNo">195</span>     *<a name="line.195"></a>
-<span class="sourceLineNo">196</span>     * @param text<a name="line.196"></a>
-<span class="sourceLineNo">197</span>     *            the word<a name="line.197"></a>
-<span class="sourceLineNo">198</span>     * @return the language that the word originates from or {@link Languages#ANY} if there was no unique match<a name="line.198"></a>
-<span class="sourceLineNo">199</span>     */<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    public String guessLanguage(final String text) {<a name="line.200"></a>
-<span class="sourceLineNo">201</span>        final Languages.LanguageSet ls = guessLanguages(text);<a name="line.201"></a>
-<span class="sourceLineNo">202</span>        return ls.isSingleton() ? ls.getAny() : Languages.ANY;<a name="line.202"></a>
-<span class="sourceLineNo">203</span>    }<a name="line.203"></a>
-<span class="sourceLineNo">204</span><a name="line.204"></a>
-<span class="sourceLineNo">205</span>    /**<a name="line.205"></a>
-<span class="sourceLineNo">206</span>     * Guesses the languages of a word.<a name="line.206"></a>
-<span class="sourceLineNo">207</span>     *<a name="line.207"></a>
-<span class="sourceLineNo">208</span>     * @param input<a name="line.208"></a>
-<span class="sourceLineNo">209</span>     *            the word<a name="line.209"></a>
-<span class="sourceLineNo">210</span>     * @return a Set of Strings of language names that are potential matches for the input word<a name="line.210"></a>
-<span class="sourceLineNo">211</span>     */<a name="line.211"></a>
-<span class="sourceLineNo">212</span>    public Languages.LanguageSet guessLanguages(final String input) {<a name="line.212"></a>
-<span class="sourceLineNo">213</span>        final String text = input.toLowerCase(Locale.ENGLISH);<a name="line.213"></a>
-<span class="sourceLineNo">214</span><a name="line.214"></a>
-<span class="sourceLineNo">215</span>        final Set&lt;String&gt; langs = new HashSet&lt;String&gt;(this.languages.getLanguages());<a name="line.215"></a>
-<span class="sourceLineNo">216</span>        for (final LangRule rule : this.rules) {<a name="line.216"></a>
-<span class="sourceLineNo">217</span>            if (rule.matches(text)) {<a name="line.217"></a>
-<span class="sourceLineNo">218</span>                if (rule.acceptOnMatch) {<a name="line.218"></a>
-<span class="sourceLineNo">219</span>                    langs.retainAll(rule.languages);<a name="line.219"></a>
-<span class="sourceLineNo">220</span>                } else {<a name="line.220"></a>
-<span class="sourceLineNo">221</span>                    langs.removeAll(rule.languages);<a name="line.221"></a>
-<span class="sourceLineNo">222</span>                }<a name="line.222"></a>
-<span class="sourceLineNo">223</span>            }<a name="line.223"></a>
-<span class="sourceLineNo">224</span>        }<a name="line.224"></a>
-<span class="sourceLineNo">225</span><a name="line.225"></a>
-<span class="sourceLineNo">226</span>        final Languages.LanguageSet ls = Languages.LanguageSet.from(langs);<a name="line.226"></a>
-<span class="sourceLineNo">227</span>        return ls.equals(Languages.NO_LANGUAGES) ? Languages.ANY_LANGUAGE : ls;<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    }<a name="line.228"></a>
-<span class="sourceLineNo">229</span>}<a name="line.229"></a>
+<span class="sourceLineNo">177</span>                        rules.add(new LangRule(pattern, new HashSet&lt;String&gt;(Arrays.asList(langs)), accept));<a name="line.177"></a>
+<span class="sourceLineNo">178</span>                    }<a name="line.178"></a>
+<span class="sourceLineNo">179</span>                }<a name="line.179"></a>
+<span class="sourceLineNo">180</span>            }<a name="line.180"></a>
+<span class="sourceLineNo">181</span>        } finally {<a name="line.181"></a>
+<span class="sourceLineNo">182</span>            scanner.close();<a name="line.182"></a>
+<span class="sourceLineNo">183</span>        }<a name="line.183"></a>
+<span class="sourceLineNo">184</span>        return new Lang(rules, languages);<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    }<a name="line.185"></a>
+<span class="sourceLineNo">186</span><a name="line.186"></a>
+<span class="sourceLineNo">187</span>    private final Languages languages;<a name="line.187"></a>
+<span class="sourceLineNo">188</span>    private final List&lt;LangRule&gt; rules;<a name="line.188"></a>
+<span class="sourceLineNo">189</span><a name="line.189"></a>
+<span class="sourceLineNo">190</span>    private Lang(final List&lt;LangRule&gt; rules, final Languages languages) {<a name="line.190"></a>
+<span class="sourceLineNo">191</span>        this.rules = Collections.unmodifiableList(rules);<a name="line.191"></a>
+<span class="sourceLineNo">192</span>        this.languages = languages;<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    }<a name="line.193"></a>
+<span class="sourceLineNo">194</span><a name="line.194"></a>
+<span class="sourceLineNo">195</span>    /**<a name="line.195"></a>
+<span class="sourceLineNo">196</span>     * Guesses the language of a word.<a name="line.196"></a>
+<span class="sourceLineNo">197</span>     *<a name="line.197"></a>
+<span class="sourceLineNo">198</span>     * @param text<a name="line.198"></a>
+<span class="sourceLineNo">199</span>     *            the word<a name="line.199"></a>
+<span class="sourceLineNo">200</span>     * @return the language that the word originates from or {@link Languages#ANY} if there was no unique match<a name="line.200"></a>
+<span class="sourceLineNo">201</span>     */<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    public String guessLanguage(final String text) {<a name="line.202"></a>
+<span class="sourceLineNo">203</span>        final Languages.LanguageSet ls = guessLanguages(text);<a name="line.203"></a>
+<span class="sourceLineNo">204</span>        return ls.isSingleton() ? ls.getAny() : Languages.ANY;<a name="line.204"></a>
+<span class="sourceLineNo">205</span>    }<a name="line.205"></a>
+<span class="sourceLineNo">206</span><a name="line.206"></a>
+<span class="sourceLineNo">207</span>    /**<a name="line.207"></a>
+<span class="sourceLineNo">208</span>     * Guesses the languages of a word.<a name="line.208"></a>
+<span class="sourceLineNo">209</span>     *<a name="line.209"></a>
+<span class="sourceLineNo">210</span>     * @param input<a name="line.210"></a>
+<span class="sourceLineNo">211</span>     *            the word<a name="line.211"></a>
+<span class="sourceLineNo">212</span>     * @return a Set of Strings of language names that are potential matches for the input word<a name="line.212"></a>
+<span class="sourceLineNo">213</span>     */<a name="line.213"></a>
+<span class="sourceLineNo">214</span>    public Languages.LanguageSet guessLanguages(final String input) {<a name="line.214"></a>
+<span class="sourceLineNo">215</span>        final String text = input.toLowerCase(Locale.ENGLISH);<a name="line.215"></a>
+<span class="sourceLineNo">216</span><a name="line.216"></a>
+<span class="sourceLineNo">217</span>        final Set&lt;String&gt; langs = new HashSet&lt;String&gt;(this.languages.getLanguages());<a name="line.217"></a>
+<span class="sourceLineNo">218</span>        for (final LangRule rule : this.rules) {<a name="line.218"></a>
+<span class="sourceLineNo">219</span>            if (rule.matches(text)) {<a name="line.219"></a>
+<span class="sourceLineNo">220</span>                if (rule.acceptOnMatch) {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>                    langs.retainAll(rule.languages);<a name="line.221"></a>
+<span class="sourceLineNo">222</span>                } else {<a name="line.222"></a>
+<span class="sourceLineNo">223</span>                    langs.removeAll(rule.languages);<a name="line.223"></a>
+<span class="sourceLineNo">224</span>                }<a name="line.224"></a>
+<span class="sourceLineNo">225</span>            }<a name="line.225"></a>
+<span class="sourceLineNo">226</span>        }<a name="line.226"></a>
+<span class="sourceLineNo">227</span><a name="line.227"></a>
+<span class="sourceLineNo">228</span>        final Languages.LanguageSet ls = Languages.LanguageSet.from(langs);<a name="line.228"></a>
+<span class="sourceLineNo">229</span>        return ls.equals(Languages.NO_LANGUAGES) ? Languages.ANY_LANGUAGE : ls;<a name="line.229"></a>
+<span class="sourceLineNo">230</span>    }<a name="line.230"></a>
+<span class="sourceLineNo">231</span>}<a name="line.231"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Languages.LanguageSet.html
==============================================================================
--- websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Languages.LanguageSet.html (original)
+++ websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Languages.LanguageSet.html Wed Dec 11 04:34:40 2013
@@ -56,7 +56,7 @@
 <span class="sourceLineNo">048</span> * This class is immutable and thread-safe.<a name="line.48"></a>
 <span class="sourceLineNo">049</span> *<a name="line.49"></a>
 <span class="sourceLineNo">050</span> * @since 1.6<a name="line.50"></a>
-<span class="sourceLineNo">051</span> * @version $Id: Languages.java 1429868 2013-01-07 16:08:05Z ggregory $<a name="line.51"></a>
+<span class="sourceLineNo">051</span> * @version $Id: Languages.java 1541239 2013-11-12 21:20:05Z ggregory $<a name="line.51"></a>
 <span class="sourceLineNo">052</span> */<a name="line.52"></a>
 <span class="sourceLineNo">053</span>public class Languages {<a name="line.53"></a>
 <span class="sourceLineNo">054</span>    // Iimplementation note: This class is divided into two sections. The first part is a static factory interface that<a name="line.54"></a>
@@ -125,13 +125,13 @@
 <span class="sourceLineNo">117</span>                return this;<a name="line.117"></a>
 <span class="sourceLineNo">118</span>            } else {<a name="line.118"></a>
 <span class="sourceLineNo">119</span>                final SomeLanguages sl = (SomeLanguages) other;<a name="line.119"></a>
-<span class="sourceLineNo">120</span>                if (sl.languages.containsAll(languages)) {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>                    return this;<a name="line.121"></a>
-<span class="sourceLineNo">122</span>                } else {<a name="line.122"></a>
-<span class="sourceLineNo">123</span>                    final Set&lt;String&gt; ls = new HashSet&lt;String&gt;(this.languages);<a name="line.123"></a>
-<span class="sourceLineNo">124</span>                    ls.retainAll(sl.languages);<a name="line.124"></a>
-<span class="sourceLineNo">125</span>                    return from(ls);<a name="line.125"></a>
-<span class="sourceLineNo">126</span>                }<a name="line.126"></a>
+<span class="sourceLineNo">120</span>                final Set&lt;String&gt; ls = new HashSet&lt;String&gt;(Math.min(languages.size(), sl.languages.size()));<a name="line.120"></a>
+<span class="sourceLineNo">121</span>                for (String lang : languages) {<a name="line.121"></a>
+<span class="sourceLineNo">122</span>                    if (sl.languages.contains(lang)) {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>                        ls.add(lang);<a name="line.123"></a>
+<span class="sourceLineNo">124</span>                    }<a name="line.124"></a>
+<span class="sourceLineNo">125</span>                }<a name="line.125"></a>
+<span class="sourceLineNo">126</span>                return from(ls);<a name="line.126"></a>
 <span class="sourceLineNo">127</span>            }<a name="line.127"></a>
 <span class="sourceLineNo">128</span>        }<a name="line.128"></a>
 <span class="sourceLineNo">129</span><a name="line.129"></a>
@@ -166,109 +166,113 @@
 <span class="sourceLineNo">158</span>        }<a name="line.158"></a>
 <span class="sourceLineNo">159</span><a name="line.159"></a>
 <span class="sourceLineNo">160</span>        final Scanner lsScanner = new Scanner(langIS, ResourceConstants.ENCODING);<a name="line.160"></a>
-<span class="sourceLineNo">161</span>        boolean inExtendedComment = false;<a name="line.161"></a>
-<span class="sourceLineNo">162</span>        while (lsScanner.hasNextLine()) {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>            final String line = lsScanner.nextLine().trim();<a name="line.163"></a>
-<span class="sourceLineNo">164</span>            if (inExtendedComment) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>                if (line.endsWith(ResourceConstants.EXT_CMT_END)) {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>                    inExtendedComment = false;<a name="line.166"></a>
-<span class="sourceLineNo">167</span>                }<a name="line.167"></a>
-<span class="sourceLineNo">168</span>            } else {<a name="line.168"></a>
-<span class="sourceLineNo">169</span>                if (line.startsWith(ResourceConstants.EXT_CMT_START)) {<a name="line.169"></a>
-<span class="sourceLineNo">170</span>                    inExtendedComment = true;<a name="line.170"></a>
-<span class="sourceLineNo">171</span>                } else if (line.length() &gt; 0) {<a name="line.171"></a>
-<span class="sourceLineNo">172</span>                    ls.add(line);<a name="line.172"></a>
-<span class="sourceLineNo">173</span>                }<a name="line.173"></a>
-<span class="sourceLineNo">174</span>            }<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        }<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>        return new Languages(Collections.unmodifiableSet(ls));<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    }<a name="line.178"></a>
-<span class="sourceLineNo">179</span><a name="line.179"></a>
-<span class="sourceLineNo">180</span>    private static String langResourceName(final NameType nameType) {<a name="line.180"></a>
-<span class="sourceLineNo">181</span>        return String.format("org/apache/commons/codec/language/bm/%s_languages.txt", nameType.getName());<a name="line.181"></a>
+<span class="sourceLineNo">161</span>        try {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>            boolean inExtendedComment = false;<a name="line.162"></a>
+<span class="sourceLineNo">163</span>            while (lsScanner.hasNextLine()) {<a name="line.163"></a>
+<span class="sourceLineNo">164</span>                final String line = lsScanner.nextLine().trim();<a name="line.164"></a>
+<span class="sourceLineNo">165</span>                if (inExtendedComment) {<a name="line.165"></a>
+<span class="sourceLineNo">166</span>                    if (line.endsWith(ResourceConstants.EXT_CMT_END)) {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>                        inExtendedComment = false;<a name="line.167"></a>
+<span class="sourceLineNo">168</span>                    }<a name="line.168"></a>
+<span class="sourceLineNo">169</span>                } else {<a name="line.169"></a>
+<span class="sourceLineNo">170</span>                    if (line.startsWith(ResourceConstants.EXT_CMT_START)) {<a name="line.170"></a>
+<span class="sourceLineNo">171</span>                        inExtendedComment = true;<a name="line.171"></a>
+<span class="sourceLineNo">172</span>                    } else if (line.length() &gt; 0) {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>                        ls.add(line);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>                    }<a name="line.174"></a>
+<span class="sourceLineNo">175</span>                }<a name="line.175"></a>
+<span class="sourceLineNo">176</span>            }<a name="line.176"></a>
+<span class="sourceLineNo">177</span>        } finally {<a name="line.177"></a>
+<span class="sourceLineNo">178</span>            lsScanner.close();<a name="line.178"></a>
+<span class="sourceLineNo">179</span>        }<a name="line.179"></a>
+<span class="sourceLineNo">180</span><a name="line.180"></a>
+<span class="sourceLineNo">181</span>        return new Languages(Collections.unmodifiableSet(ls));<a name="line.181"></a>
 <span class="sourceLineNo">182</span>    }<a name="line.182"></a>
 <span class="sourceLineNo">183</span><a name="line.183"></a>
-<span class="sourceLineNo">184</span>    private final Set&lt;String&gt; languages;<a name="line.184"></a>
-<span class="sourceLineNo">185</span><a name="line.185"></a>
-<span class="sourceLineNo">186</span>    /**<a name="line.186"></a>
-<span class="sourceLineNo">187</span>     * No languages at all.<a name="line.187"></a>
-<span class="sourceLineNo">188</span>     */<a name="line.188"></a>
-<span class="sourceLineNo">189</span>    public static final LanguageSet NO_LANGUAGES = new LanguageSet() {<a name="line.189"></a>
-<span class="sourceLineNo">190</span>        @Override<a name="line.190"></a>
-<span class="sourceLineNo">191</span>        public boolean contains(final String language) {<a name="line.191"></a>
-<span class="sourceLineNo">192</span>            return false;<a name="line.192"></a>
-<span class="sourceLineNo">193</span>        }<a name="line.193"></a>
-<span class="sourceLineNo">194</span><a name="line.194"></a>
-<span class="sourceLineNo">195</span>        @Override<a name="line.195"></a>
-<span class="sourceLineNo">196</span>        public String getAny() {<a name="line.196"></a>
-<span class="sourceLineNo">197</span>            throw new NoSuchElementException("Can't fetch any language from the empty language set.");<a name="line.197"></a>
-<span class="sourceLineNo">198</span>        }<a name="line.198"></a>
-<span class="sourceLineNo">199</span><a name="line.199"></a>
-<span class="sourceLineNo">200</span>        @Override<a name="line.200"></a>
-<span class="sourceLineNo">201</span>        public boolean isEmpty() {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>            return true;<a name="line.202"></a>
-<span class="sourceLineNo">203</span>        }<a name="line.203"></a>
-<span class="sourceLineNo">204</span><a name="line.204"></a>
-<span class="sourceLineNo">205</span>        @Override<a name="line.205"></a>
-<span class="sourceLineNo">206</span>        public boolean isSingleton() {<a name="line.206"></a>
-<span class="sourceLineNo">207</span>            return false;<a name="line.207"></a>
-<span class="sourceLineNo">208</span>        }<a name="line.208"></a>
-<span class="sourceLineNo">209</span><a name="line.209"></a>
-<span class="sourceLineNo">210</span>        @Override<a name="line.210"></a>
-<span class="sourceLineNo">211</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.211"></a>
-<span class="sourceLineNo">212</span>            return this;<a name="line.212"></a>
-<span class="sourceLineNo">213</span>        }<a name="line.213"></a>
-<span class="sourceLineNo">214</span><a name="line.214"></a>
-<span class="sourceLineNo">215</span>        @Override<a name="line.215"></a>
-<span class="sourceLineNo">216</span>        public String toString() {<a name="line.216"></a>
-<span class="sourceLineNo">217</span>            return "NO_LANGUAGES";<a name="line.217"></a>
-<span class="sourceLineNo">218</span>        }<a name="line.218"></a>
-<span class="sourceLineNo">219</span>    };<a name="line.219"></a>
-<span class="sourceLineNo">220</span><a name="line.220"></a>
-<span class="sourceLineNo">221</span>    /**<a name="line.221"></a>
-<span class="sourceLineNo">222</span>     * Any/all languages.<a name="line.222"></a>
-<span class="sourceLineNo">223</span>     */<a name="line.223"></a>
-<span class="sourceLineNo">224</span>    public static final LanguageSet ANY_LANGUAGE = new LanguageSet() {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>        @Override<a name="line.225"></a>
-<span class="sourceLineNo">226</span>        public boolean contains(final String language) {<a name="line.226"></a>
-<span class="sourceLineNo">227</span>            return true;<a name="line.227"></a>
-<span class="sourceLineNo">228</span>        }<a name="line.228"></a>
-<span class="sourceLineNo">229</span><a name="line.229"></a>
-<span class="sourceLineNo">230</span>        @Override<a name="line.230"></a>
-<span class="sourceLineNo">231</span>        public String getAny() {<a name="line.231"></a>
-<span class="sourceLineNo">232</span>            throw new NoSuchElementException("Can't fetch any language from the any language set.");<a name="line.232"></a>
-<span class="sourceLineNo">233</span>        }<a name="line.233"></a>
-<span class="sourceLineNo">234</span><a name="line.234"></a>
-<span class="sourceLineNo">235</span>        @Override<a name="line.235"></a>
-<span class="sourceLineNo">236</span>        public boolean isEmpty() {<a name="line.236"></a>
-<span class="sourceLineNo">237</span>            return false;<a name="line.237"></a>
-<span class="sourceLineNo">238</span>        }<a name="line.238"></a>
-<span class="sourceLineNo">239</span><a name="line.239"></a>
-<span class="sourceLineNo">240</span>        @Override<a name="line.240"></a>
-<span class="sourceLineNo">241</span>        public boolean isSingleton() {<a name="line.241"></a>
-<span class="sourceLineNo">242</span>            return false;<a name="line.242"></a>
-<span class="sourceLineNo">243</span>        }<a name="line.243"></a>
-<span class="sourceLineNo">244</span><a name="line.244"></a>
-<span class="sourceLineNo">245</span>        @Override<a name="line.245"></a>
-<span class="sourceLineNo">246</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.246"></a>
-<span class="sourceLineNo">247</span>            return other;<a name="line.247"></a>
-<span class="sourceLineNo">248</span>        }<a name="line.248"></a>
-<span class="sourceLineNo">249</span><a name="line.249"></a>
-<span class="sourceLineNo">250</span>        @Override<a name="line.250"></a>
-<span class="sourceLineNo">251</span>        public String toString() {<a name="line.251"></a>
-<span class="sourceLineNo">252</span>            return "ANY_LANGUAGE";<a name="line.252"></a>
-<span class="sourceLineNo">253</span>        }<a name="line.253"></a>
-<span class="sourceLineNo">254</span>    };<a name="line.254"></a>
-<span class="sourceLineNo">255</span><a name="line.255"></a>
-<span class="sourceLineNo">256</span>    private Languages(final Set&lt;String&gt; languages) {<a name="line.256"></a>
-<span class="sourceLineNo">257</span>        this.languages = languages;<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    }<a name="line.258"></a>
+<span class="sourceLineNo">184</span>    private static String langResourceName(final NameType nameType) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>        return String.format("org/apache/commons/codec/language/bm/%s_languages.txt", nameType.getName());<a name="line.185"></a>
+<span class="sourceLineNo">186</span>    }<a name="line.186"></a>
+<span class="sourceLineNo">187</span><a name="line.187"></a>
+<span class="sourceLineNo">188</span>    private final Set&lt;String&gt; languages;<a name="line.188"></a>
+<span class="sourceLineNo">189</span><a name="line.189"></a>
+<span class="sourceLineNo">190</span>    /**<a name="line.190"></a>
+<span class="sourceLineNo">191</span>     * No languages at all.<a name="line.191"></a>
+<span class="sourceLineNo">192</span>     */<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    public static final LanguageSet NO_LANGUAGES = new LanguageSet() {<a name="line.193"></a>
+<span class="sourceLineNo">194</span>        @Override<a name="line.194"></a>
+<span class="sourceLineNo">195</span>        public boolean contains(final String language) {<a name="line.195"></a>
+<span class="sourceLineNo">196</span>            return false;<a name="line.196"></a>
+<span class="sourceLineNo">197</span>        }<a name="line.197"></a>
+<span class="sourceLineNo">198</span><a name="line.198"></a>
+<span class="sourceLineNo">199</span>        @Override<a name="line.199"></a>
+<span class="sourceLineNo">200</span>        public String getAny() {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>            throw new NoSuchElementException("Can't fetch any language from the empty language set.");<a name="line.201"></a>
+<span class="sourceLineNo">202</span>        }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>        @Override<a name="line.204"></a>
+<span class="sourceLineNo">205</span>        public boolean isEmpty() {<a name="line.205"></a>
+<span class="sourceLineNo">206</span>            return true;<a name="line.206"></a>
+<span class="sourceLineNo">207</span>        }<a name="line.207"></a>
+<span class="sourceLineNo">208</span><a name="line.208"></a>
+<span class="sourceLineNo">209</span>        @Override<a name="line.209"></a>
+<span class="sourceLineNo">210</span>        public boolean isSingleton() {<a name="line.210"></a>
+<span class="sourceLineNo">211</span>            return false;<a name="line.211"></a>
+<span class="sourceLineNo">212</span>        }<a name="line.212"></a>
+<span class="sourceLineNo">213</span><a name="line.213"></a>
+<span class="sourceLineNo">214</span>        @Override<a name="line.214"></a>
+<span class="sourceLineNo">215</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.215"></a>
+<span class="sourceLineNo">216</span>            return this;<a name="line.216"></a>
+<span class="sourceLineNo">217</span>        }<a name="line.217"></a>
+<span class="sourceLineNo">218</span><a name="line.218"></a>
+<span class="sourceLineNo">219</span>        @Override<a name="line.219"></a>
+<span class="sourceLineNo">220</span>        public String toString() {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>            return "NO_LANGUAGES";<a name="line.221"></a>
+<span class="sourceLineNo">222</span>        }<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    };<a name="line.223"></a>
+<span class="sourceLineNo">224</span><a name="line.224"></a>
+<span class="sourceLineNo">225</span>    /**<a name="line.225"></a>
+<span class="sourceLineNo">226</span>     * Any/all languages.<a name="line.226"></a>
+<span class="sourceLineNo">227</span>     */<a name="line.227"></a>
+<span class="sourceLineNo">228</span>    public static final LanguageSet ANY_LANGUAGE = new LanguageSet() {<a name="line.228"></a>
+<span class="sourceLineNo">229</span>        @Override<a name="line.229"></a>
+<span class="sourceLineNo">230</span>        public boolean contains(final String language) {<a name="line.230"></a>
+<span class="sourceLineNo">231</span>            return true;<a name="line.231"></a>
+<span class="sourceLineNo">232</span>        }<a name="line.232"></a>
+<span class="sourceLineNo">233</span><a name="line.233"></a>
+<span class="sourceLineNo">234</span>        @Override<a name="line.234"></a>
+<span class="sourceLineNo">235</span>        public String getAny() {<a name="line.235"></a>
+<span class="sourceLineNo">236</span>            throw new NoSuchElementException("Can't fetch any language from the any language set.");<a name="line.236"></a>
+<span class="sourceLineNo">237</span>        }<a name="line.237"></a>
+<span class="sourceLineNo">238</span><a name="line.238"></a>
+<span class="sourceLineNo">239</span>        @Override<a name="line.239"></a>
+<span class="sourceLineNo">240</span>        public boolean isEmpty() {<a name="line.240"></a>
+<span class="sourceLineNo">241</span>            return false;<a name="line.241"></a>
+<span class="sourceLineNo">242</span>        }<a name="line.242"></a>
+<span class="sourceLineNo">243</span><a name="line.243"></a>
+<span class="sourceLineNo">244</span>        @Override<a name="line.244"></a>
+<span class="sourceLineNo">245</span>        public boolean isSingleton() {<a name="line.245"></a>
+<span class="sourceLineNo">246</span>            return false;<a name="line.246"></a>
+<span class="sourceLineNo">247</span>        }<a name="line.247"></a>
+<span class="sourceLineNo">248</span><a name="line.248"></a>
+<span class="sourceLineNo">249</span>        @Override<a name="line.249"></a>
+<span class="sourceLineNo">250</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.250"></a>
+<span class="sourceLineNo">251</span>            return other;<a name="line.251"></a>
+<span class="sourceLineNo">252</span>        }<a name="line.252"></a>
+<span class="sourceLineNo">253</span><a name="line.253"></a>
+<span class="sourceLineNo">254</span>        @Override<a name="line.254"></a>
+<span class="sourceLineNo">255</span>        public String toString() {<a name="line.255"></a>
+<span class="sourceLineNo">256</span>            return "ANY_LANGUAGE";<a name="line.256"></a>
+<span class="sourceLineNo">257</span>        }<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    };<a name="line.258"></a>
 <span class="sourceLineNo">259</span><a name="line.259"></a>
-<span class="sourceLineNo">260</span>    public Set&lt;String&gt; getLanguages() {<a name="line.260"></a>
-<span class="sourceLineNo">261</span>        return this.languages;<a name="line.261"></a>
+<span class="sourceLineNo">260</span>    private Languages(final Set&lt;String&gt; languages) {<a name="line.260"></a>
+<span class="sourceLineNo">261</span>        this.languages = languages;<a name="line.261"></a>
 <span class="sourceLineNo">262</span>    }<a name="line.262"></a>
-<span class="sourceLineNo">263</span>}<a name="line.263"></a>
+<span class="sourceLineNo">263</span><a name="line.263"></a>
+<span class="sourceLineNo">264</span>    public Set&lt;String&gt; getLanguages() {<a name="line.264"></a>
+<span class="sourceLineNo">265</span>        return this.languages;<a name="line.265"></a>
+<span class="sourceLineNo">266</span>    }<a name="line.266"></a>
+<span class="sourceLineNo">267</span>}<a name="line.267"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Languages.SomeLanguages.html
==============================================================================
--- websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Languages.SomeLanguages.html (original)
+++ websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Languages.SomeLanguages.html Wed Dec 11 04:34:40 2013
@@ -56,7 +56,7 @@
 <span class="sourceLineNo">048</span> * This class is immutable and thread-safe.<a name="line.48"></a>
 <span class="sourceLineNo">049</span> *<a name="line.49"></a>
 <span class="sourceLineNo">050</span> * @since 1.6<a name="line.50"></a>
-<span class="sourceLineNo">051</span> * @version $Id: Languages.java 1429868 2013-01-07 16:08:05Z ggregory $<a name="line.51"></a>
+<span class="sourceLineNo">051</span> * @version $Id: Languages.java 1541239 2013-11-12 21:20:05Z ggregory $<a name="line.51"></a>
 <span class="sourceLineNo">052</span> */<a name="line.52"></a>
 <span class="sourceLineNo">053</span>public class Languages {<a name="line.53"></a>
 <span class="sourceLineNo">054</span>    // Iimplementation note: This class is divided into two sections. The first part is a static factory interface that<a name="line.54"></a>
@@ -125,13 +125,13 @@
 <span class="sourceLineNo">117</span>                return this;<a name="line.117"></a>
 <span class="sourceLineNo">118</span>            } else {<a name="line.118"></a>
 <span class="sourceLineNo">119</span>                final SomeLanguages sl = (SomeLanguages) other;<a name="line.119"></a>
-<span class="sourceLineNo">120</span>                if (sl.languages.containsAll(languages)) {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>                    return this;<a name="line.121"></a>
-<span class="sourceLineNo">122</span>                } else {<a name="line.122"></a>
-<span class="sourceLineNo">123</span>                    final Set&lt;String&gt; ls = new HashSet&lt;String&gt;(this.languages);<a name="line.123"></a>
-<span class="sourceLineNo">124</span>                    ls.retainAll(sl.languages);<a name="line.124"></a>
-<span class="sourceLineNo">125</span>                    return from(ls);<a name="line.125"></a>
-<span class="sourceLineNo">126</span>                }<a name="line.126"></a>
+<span class="sourceLineNo">120</span>                final Set&lt;String&gt; ls = new HashSet&lt;String&gt;(Math.min(languages.size(), sl.languages.size()));<a name="line.120"></a>
+<span class="sourceLineNo">121</span>                for (String lang : languages) {<a name="line.121"></a>
+<span class="sourceLineNo">122</span>                    if (sl.languages.contains(lang)) {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>                        ls.add(lang);<a name="line.123"></a>
+<span class="sourceLineNo">124</span>                    }<a name="line.124"></a>
+<span class="sourceLineNo">125</span>                }<a name="line.125"></a>
+<span class="sourceLineNo">126</span>                return from(ls);<a name="line.126"></a>
 <span class="sourceLineNo">127</span>            }<a name="line.127"></a>
 <span class="sourceLineNo">128</span>        }<a name="line.128"></a>
 <span class="sourceLineNo">129</span><a name="line.129"></a>
@@ -166,109 +166,113 @@
 <span class="sourceLineNo">158</span>        }<a name="line.158"></a>
 <span class="sourceLineNo">159</span><a name="line.159"></a>
 <span class="sourceLineNo">160</span>        final Scanner lsScanner = new Scanner(langIS, ResourceConstants.ENCODING);<a name="line.160"></a>
-<span class="sourceLineNo">161</span>        boolean inExtendedComment = false;<a name="line.161"></a>
-<span class="sourceLineNo">162</span>        while (lsScanner.hasNextLine()) {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>            final String line = lsScanner.nextLine().trim();<a name="line.163"></a>
-<span class="sourceLineNo">164</span>            if (inExtendedComment) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>                if (line.endsWith(ResourceConstants.EXT_CMT_END)) {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>                    inExtendedComment = false;<a name="line.166"></a>
-<span class="sourceLineNo">167</span>                }<a name="line.167"></a>
-<span class="sourceLineNo">168</span>            } else {<a name="line.168"></a>
-<span class="sourceLineNo">169</span>                if (line.startsWith(ResourceConstants.EXT_CMT_START)) {<a name="line.169"></a>
-<span class="sourceLineNo">170</span>                    inExtendedComment = true;<a name="line.170"></a>
-<span class="sourceLineNo">171</span>                } else if (line.length() &gt; 0) {<a name="line.171"></a>
-<span class="sourceLineNo">172</span>                    ls.add(line);<a name="line.172"></a>
-<span class="sourceLineNo">173</span>                }<a name="line.173"></a>
-<span class="sourceLineNo">174</span>            }<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        }<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>        return new Languages(Collections.unmodifiableSet(ls));<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    }<a name="line.178"></a>
-<span class="sourceLineNo">179</span><a name="line.179"></a>
-<span class="sourceLineNo">180</span>    private static String langResourceName(final NameType nameType) {<a name="line.180"></a>
-<span class="sourceLineNo">181</span>        return String.format("org/apache/commons/codec/language/bm/%s_languages.txt", nameType.getName());<a name="line.181"></a>
+<span class="sourceLineNo">161</span>        try {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>            boolean inExtendedComment = false;<a name="line.162"></a>
+<span class="sourceLineNo">163</span>            while (lsScanner.hasNextLine()) {<a name="line.163"></a>
+<span class="sourceLineNo">164</span>                final String line = lsScanner.nextLine().trim();<a name="line.164"></a>
+<span class="sourceLineNo">165</span>                if (inExtendedComment) {<a name="line.165"></a>
+<span class="sourceLineNo">166</span>                    if (line.endsWith(ResourceConstants.EXT_CMT_END)) {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>                        inExtendedComment = false;<a name="line.167"></a>
+<span class="sourceLineNo">168</span>                    }<a name="line.168"></a>
+<span class="sourceLineNo">169</span>                } else {<a name="line.169"></a>
+<span class="sourceLineNo">170</span>                    if (line.startsWith(ResourceConstants.EXT_CMT_START)) {<a name="line.170"></a>
+<span class="sourceLineNo">171</span>                        inExtendedComment = true;<a name="line.171"></a>
+<span class="sourceLineNo">172</span>                    } else if (line.length() &gt; 0) {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>                        ls.add(line);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>                    }<a name="line.174"></a>
+<span class="sourceLineNo">175</span>                }<a name="line.175"></a>
+<span class="sourceLineNo">176</span>            }<a name="line.176"></a>
+<span class="sourceLineNo">177</span>        } finally {<a name="line.177"></a>
+<span class="sourceLineNo">178</span>            lsScanner.close();<a name="line.178"></a>
+<span class="sourceLineNo">179</span>        }<a name="line.179"></a>
+<span class="sourceLineNo">180</span><a name="line.180"></a>
+<span class="sourceLineNo">181</span>        return new Languages(Collections.unmodifiableSet(ls));<a name="line.181"></a>
 <span class="sourceLineNo">182</span>    }<a name="line.182"></a>
 <span class="sourceLineNo">183</span><a name="line.183"></a>
-<span class="sourceLineNo">184</span>    private final Set&lt;String&gt; languages;<a name="line.184"></a>
-<span class="sourceLineNo">185</span><a name="line.185"></a>
-<span class="sourceLineNo">186</span>    /**<a name="line.186"></a>
-<span class="sourceLineNo">187</span>     * No languages at all.<a name="line.187"></a>
-<span class="sourceLineNo">188</span>     */<a name="line.188"></a>
-<span class="sourceLineNo">189</span>    public static final LanguageSet NO_LANGUAGES = new LanguageSet() {<a name="line.189"></a>
-<span class="sourceLineNo">190</span>        @Override<a name="line.190"></a>
-<span class="sourceLineNo">191</span>        public boolean contains(final String language) {<a name="line.191"></a>
-<span class="sourceLineNo">192</span>            return false;<a name="line.192"></a>
-<span class="sourceLineNo">193</span>        }<a name="line.193"></a>
-<span class="sourceLineNo">194</span><a name="line.194"></a>
-<span class="sourceLineNo">195</span>        @Override<a name="line.195"></a>
-<span class="sourceLineNo">196</span>        public String getAny() {<a name="line.196"></a>
-<span class="sourceLineNo">197</span>            throw new NoSuchElementException("Can't fetch any language from the empty language set.");<a name="line.197"></a>
-<span class="sourceLineNo">198</span>        }<a name="line.198"></a>
-<span class="sourceLineNo">199</span><a name="line.199"></a>
-<span class="sourceLineNo">200</span>        @Override<a name="line.200"></a>
-<span class="sourceLineNo">201</span>        public boolean isEmpty() {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>            return true;<a name="line.202"></a>
-<span class="sourceLineNo">203</span>        }<a name="line.203"></a>
-<span class="sourceLineNo">204</span><a name="line.204"></a>
-<span class="sourceLineNo">205</span>        @Override<a name="line.205"></a>
-<span class="sourceLineNo">206</span>        public boolean isSingleton() {<a name="line.206"></a>
-<span class="sourceLineNo">207</span>            return false;<a name="line.207"></a>
-<span class="sourceLineNo">208</span>        }<a name="line.208"></a>
-<span class="sourceLineNo">209</span><a name="line.209"></a>
-<span class="sourceLineNo">210</span>        @Override<a name="line.210"></a>
-<span class="sourceLineNo">211</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.211"></a>
-<span class="sourceLineNo">212</span>            return this;<a name="line.212"></a>
-<span class="sourceLineNo">213</span>        }<a name="line.213"></a>
-<span class="sourceLineNo">214</span><a name="line.214"></a>
-<span class="sourceLineNo">215</span>        @Override<a name="line.215"></a>
-<span class="sourceLineNo">216</span>        public String toString() {<a name="line.216"></a>
-<span class="sourceLineNo">217</span>            return "NO_LANGUAGES";<a name="line.217"></a>
-<span class="sourceLineNo">218</span>        }<a name="line.218"></a>
-<span class="sourceLineNo">219</span>    };<a name="line.219"></a>
-<span class="sourceLineNo">220</span><a name="line.220"></a>
-<span class="sourceLineNo">221</span>    /**<a name="line.221"></a>
-<span class="sourceLineNo">222</span>     * Any/all languages.<a name="line.222"></a>
-<span class="sourceLineNo">223</span>     */<a name="line.223"></a>
-<span class="sourceLineNo">224</span>    public static final LanguageSet ANY_LANGUAGE = new LanguageSet() {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>        @Override<a name="line.225"></a>
-<span class="sourceLineNo">226</span>        public boolean contains(final String language) {<a name="line.226"></a>
-<span class="sourceLineNo">227</span>            return true;<a name="line.227"></a>
-<span class="sourceLineNo">228</span>        }<a name="line.228"></a>
-<span class="sourceLineNo">229</span><a name="line.229"></a>
-<span class="sourceLineNo">230</span>        @Override<a name="line.230"></a>
-<span class="sourceLineNo">231</span>        public String getAny() {<a name="line.231"></a>
-<span class="sourceLineNo">232</span>            throw new NoSuchElementException("Can't fetch any language from the any language set.");<a name="line.232"></a>
-<span class="sourceLineNo">233</span>        }<a name="line.233"></a>
-<span class="sourceLineNo">234</span><a name="line.234"></a>
-<span class="sourceLineNo">235</span>        @Override<a name="line.235"></a>
-<span class="sourceLineNo">236</span>        public boolean isEmpty() {<a name="line.236"></a>
-<span class="sourceLineNo">237</span>            return false;<a name="line.237"></a>
-<span class="sourceLineNo">238</span>        }<a name="line.238"></a>
-<span class="sourceLineNo">239</span><a name="line.239"></a>
-<span class="sourceLineNo">240</span>        @Override<a name="line.240"></a>
-<span class="sourceLineNo">241</span>        public boolean isSingleton() {<a name="line.241"></a>
-<span class="sourceLineNo">242</span>            return false;<a name="line.242"></a>
-<span class="sourceLineNo">243</span>        }<a name="line.243"></a>
-<span class="sourceLineNo">244</span><a name="line.244"></a>
-<span class="sourceLineNo">245</span>        @Override<a name="line.245"></a>
-<span class="sourceLineNo">246</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.246"></a>
-<span class="sourceLineNo">247</span>            return other;<a name="line.247"></a>
-<span class="sourceLineNo">248</span>        }<a name="line.248"></a>
-<span class="sourceLineNo">249</span><a name="line.249"></a>
-<span class="sourceLineNo">250</span>        @Override<a name="line.250"></a>
-<span class="sourceLineNo">251</span>        public String toString() {<a name="line.251"></a>
-<span class="sourceLineNo">252</span>            return "ANY_LANGUAGE";<a name="line.252"></a>
-<span class="sourceLineNo">253</span>        }<a name="line.253"></a>
-<span class="sourceLineNo">254</span>    };<a name="line.254"></a>
-<span class="sourceLineNo">255</span><a name="line.255"></a>
-<span class="sourceLineNo">256</span>    private Languages(final Set&lt;String&gt; languages) {<a name="line.256"></a>
-<span class="sourceLineNo">257</span>        this.languages = languages;<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    }<a name="line.258"></a>
+<span class="sourceLineNo">184</span>    private static String langResourceName(final NameType nameType) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>        return String.format("org/apache/commons/codec/language/bm/%s_languages.txt", nameType.getName());<a name="line.185"></a>
+<span class="sourceLineNo">186</span>    }<a name="line.186"></a>
+<span class="sourceLineNo">187</span><a name="line.187"></a>
+<span class="sourceLineNo">188</span>    private final Set&lt;String&gt; languages;<a name="line.188"></a>
+<span class="sourceLineNo">189</span><a name="line.189"></a>
+<span class="sourceLineNo">190</span>    /**<a name="line.190"></a>
+<span class="sourceLineNo">191</span>     * No languages at all.<a name="line.191"></a>
+<span class="sourceLineNo">192</span>     */<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    public static final LanguageSet NO_LANGUAGES = new LanguageSet() {<a name="line.193"></a>
+<span class="sourceLineNo">194</span>        @Override<a name="line.194"></a>
+<span class="sourceLineNo">195</span>        public boolean contains(final String language) {<a name="line.195"></a>
+<span class="sourceLineNo">196</span>            return false;<a name="line.196"></a>
+<span class="sourceLineNo">197</span>        }<a name="line.197"></a>
+<span class="sourceLineNo">198</span><a name="line.198"></a>
+<span class="sourceLineNo">199</span>        @Override<a name="line.199"></a>
+<span class="sourceLineNo">200</span>        public String getAny() {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>            throw new NoSuchElementException("Can't fetch any language from the empty language set.");<a name="line.201"></a>
+<span class="sourceLineNo">202</span>        }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>        @Override<a name="line.204"></a>
+<span class="sourceLineNo">205</span>        public boolean isEmpty() {<a name="line.205"></a>
+<span class="sourceLineNo">206</span>            return true;<a name="line.206"></a>
+<span class="sourceLineNo">207</span>        }<a name="line.207"></a>
+<span class="sourceLineNo">208</span><a name="line.208"></a>
+<span class="sourceLineNo">209</span>        @Override<a name="line.209"></a>
+<span class="sourceLineNo">210</span>        public boolean isSingleton() {<a name="line.210"></a>
+<span class="sourceLineNo">211</span>            return false;<a name="line.211"></a>
+<span class="sourceLineNo">212</span>        }<a name="line.212"></a>
+<span class="sourceLineNo">213</span><a name="line.213"></a>
+<span class="sourceLineNo">214</span>        @Override<a name="line.214"></a>
+<span class="sourceLineNo">215</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.215"></a>
+<span class="sourceLineNo">216</span>            return this;<a name="line.216"></a>
+<span class="sourceLineNo">217</span>        }<a name="line.217"></a>
+<span class="sourceLineNo">218</span><a name="line.218"></a>
+<span class="sourceLineNo">219</span>        @Override<a name="line.219"></a>
+<span class="sourceLineNo">220</span>        public String toString() {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>            return "NO_LANGUAGES";<a name="line.221"></a>
+<span class="sourceLineNo">222</span>        }<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    };<a name="line.223"></a>
+<span class="sourceLineNo">224</span><a name="line.224"></a>
+<span class="sourceLineNo">225</span>    /**<a name="line.225"></a>
+<span class="sourceLineNo">226</span>     * Any/all languages.<a name="line.226"></a>
+<span class="sourceLineNo">227</span>     */<a name="line.227"></a>
+<span class="sourceLineNo">228</span>    public static final LanguageSet ANY_LANGUAGE = new LanguageSet() {<a name="line.228"></a>
+<span class="sourceLineNo">229</span>        @Override<a name="line.229"></a>
+<span class="sourceLineNo">230</span>        public boolean contains(final String language) {<a name="line.230"></a>
+<span class="sourceLineNo">231</span>            return true;<a name="line.231"></a>
+<span class="sourceLineNo">232</span>        }<a name="line.232"></a>
+<span class="sourceLineNo">233</span><a name="line.233"></a>
+<span class="sourceLineNo">234</span>        @Override<a name="line.234"></a>
+<span class="sourceLineNo">235</span>        public String getAny() {<a name="line.235"></a>
+<span class="sourceLineNo">236</span>            throw new NoSuchElementException("Can't fetch any language from the any language set.");<a name="line.236"></a>
+<span class="sourceLineNo">237</span>        }<a name="line.237"></a>
+<span class="sourceLineNo">238</span><a name="line.238"></a>
+<span class="sourceLineNo">239</span>        @Override<a name="line.239"></a>
+<span class="sourceLineNo">240</span>        public boolean isEmpty() {<a name="line.240"></a>
+<span class="sourceLineNo">241</span>            return false;<a name="line.241"></a>
+<span class="sourceLineNo">242</span>        }<a name="line.242"></a>
+<span class="sourceLineNo">243</span><a name="line.243"></a>
+<span class="sourceLineNo">244</span>        @Override<a name="line.244"></a>
+<span class="sourceLineNo">245</span>        public boolean isSingleton() {<a name="line.245"></a>
+<span class="sourceLineNo">246</span>            return false;<a name="line.246"></a>
+<span class="sourceLineNo">247</span>        }<a name="line.247"></a>
+<span class="sourceLineNo">248</span><a name="line.248"></a>
+<span class="sourceLineNo">249</span>        @Override<a name="line.249"></a>
+<span class="sourceLineNo">250</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.250"></a>
+<span class="sourceLineNo">251</span>            return other;<a name="line.251"></a>
+<span class="sourceLineNo">252</span>        }<a name="line.252"></a>
+<span class="sourceLineNo">253</span><a name="line.253"></a>
+<span class="sourceLineNo">254</span>        @Override<a name="line.254"></a>
+<span class="sourceLineNo">255</span>        public String toString() {<a name="line.255"></a>
+<span class="sourceLineNo">256</span>            return "ANY_LANGUAGE";<a name="line.256"></a>
+<span class="sourceLineNo">257</span>        }<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    };<a name="line.258"></a>
 <span class="sourceLineNo">259</span><a name="line.259"></a>
-<span class="sourceLineNo">260</span>    public Set&lt;String&gt; getLanguages() {<a name="line.260"></a>
-<span class="sourceLineNo">261</span>        return this.languages;<a name="line.261"></a>
+<span class="sourceLineNo">260</span>    private Languages(final Set&lt;String&gt; languages) {<a name="line.260"></a>
+<span class="sourceLineNo">261</span>        this.languages = languages;<a name="line.261"></a>
 <span class="sourceLineNo">262</span>    }<a name="line.262"></a>
-<span class="sourceLineNo">263</span>}<a name="line.263"></a>
+<span class="sourceLineNo">263</span><a name="line.263"></a>
+<span class="sourceLineNo">264</span>    public Set&lt;String&gt; getLanguages() {<a name="line.264"></a>
+<span class="sourceLineNo">265</span>        return this.languages;<a name="line.265"></a>
+<span class="sourceLineNo">266</span>    }<a name="line.266"></a>
+<span class="sourceLineNo">267</span>}<a name="line.267"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Languages.html
==============================================================================
--- websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Languages.html (original)
+++ websites/production/commons/content/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/language/bm/Languages.html Wed Dec 11 04:34:40 2013
@@ -56,7 +56,7 @@
 <span class="sourceLineNo">048</span> * This class is immutable and thread-safe.<a name="line.48"></a>
 <span class="sourceLineNo">049</span> *<a name="line.49"></a>
 <span class="sourceLineNo">050</span> * @since 1.6<a name="line.50"></a>
-<span class="sourceLineNo">051</span> * @version $Id: Languages.java 1429868 2013-01-07 16:08:05Z ggregory $<a name="line.51"></a>
+<span class="sourceLineNo">051</span> * @version $Id: Languages.java 1541239 2013-11-12 21:20:05Z ggregory $<a name="line.51"></a>
 <span class="sourceLineNo">052</span> */<a name="line.52"></a>
 <span class="sourceLineNo">053</span>public class Languages {<a name="line.53"></a>
 <span class="sourceLineNo">054</span>    // Iimplementation note: This class is divided into two sections. The first part is a static factory interface that<a name="line.54"></a>
@@ -125,13 +125,13 @@
 <span class="sourceLineNo">117</span>                return this;<a name="line.117"></a>
 <span class="sourceLineNo">118</span>            } else {<a name="line.118"></a>
 <span class="sourceLineNo">119</span>                final SomeLanguages sl = (SomeLanguages) other;<a name="line.119"></a>
-<span class="sourceLineNo">120</span>                if (sl.languages.containsAll(languages)) {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>                    return this;<a name="line.121"></a>
-<span class="sourceLineNo">122</span>                } else {<a name="line.122"></a>
-<span class="sourceLineNo">123</span>                    final Set&lt;String&gt; ls = new HashSet&lt;String&gt;(this.languages);<a name="line.123"></a>
-<span class="sourceLineNo">124</span>                    ls.retainAll(sl.languages);<a name="line.124"></a>
-<span class="sourceLineNo">125</span>                    return from(ls);<a name="line.125"></a>
-<span class="sourceLineNo">126</span>                }<a name="line.126"></a>
+<span class="sourceLineNo">120</span>                final Set&lt;String&gt; ls = new HashSet&lt;String&gt;(Math.min(languages.size(), sl.languages.size()));<a name="line.120"></a>
+<span class="sourceLineNo">121</span>                for (String lang : languages) {<a name="line.121"></a>
+<span class="sourceLineNo">122</span>                    if (sl.languages.contains(lang)) {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>                        ls.add(lang);<a name="line.123"></a>
+<span class="sourceLineNo">124</span>                    }<a name="line.124"></a>
+<span class="sourceLineNo">125</span>                }<a name="line.125"></a>
+<span class="sourceLineNo">126</span>                return from(ls);<a name="line.126"></a>
 <span class="sourceLineNo">127</span>            }<a name="line.127"></a>
 <span class="sourceLineNo">128</span>        }<a name="line.128"></a>
 <span class="sourceLineNo">129</span><a name="line.129"></a>
@@ -166,109 +166,113 @@
 <span class="sourceLineNo">158</span>        }<a name="line.158"></a>
 <span class="sourceLineNo">159</span><a name="line.159"></a>
 <span class="sourceLineNo">160</span>        final Scanner lsScanner = new Scanner(langIS, ResourceConstants.ENCODING);<a name="line.160"></a>
-<span class="sourceLineNo">161</span>        boolean inExtendedComment = false;<a name="line.161"></a>
-<span class="sourceLineNo">162</span>        while (lsScanner.hasNextLine()) {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>            final String line = lsScanner.nextLine().trim();<a name="line.163"></a>
-<span class="sourceLineNo">164</span>            if (inExtendedComment) {<a name="line.164"></a>
-<span class="sourceLineNo">165</span>                if (line.endsWith(ResourceConstants.EXT_CMT_END)) {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>                    inExtendedComment = false;<a name="line.166"></a>
-<span class="sourceLineNo">167</span>                }<a name="line.167"></a>
-<span class="sourceLineNo">168</span>            } else {<a name="line.168"></a>
-<span class="sourceLineNo">169</span>                if (line.startsWith(ResourceConstants.EXT_CMT_START)) {<a name="line.169"></a>
-<span class="sourceLineNo">170</span>                    inExtendedComment = true;<a name="line.170"></a>
-<span class="sourceLineNo">171</span>                } else if (line.length() &gt; 0) {<a name="line.171"></a>
-<span class="sourceLineNo">172</span>                    ls.add(line);<a name="line.172"></a>
-<span class="sourceLineNo">173</span>                }<a name="line.173"></a>
-<span class="sourceLineNo">174</span>            }<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        }<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>        return new Languages(Collections.unmodifiableSet(ls));<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    }<a name="line.178"></a>
-<span class="sourceLineNo">179</span><a name="line.179"></a>
-<span class="sourceLineNo">180</span>    private static String langResourceName(final NameType nameType) {<a name="line.180"></a>
-<span class="sourceLineNo">181</span>        return String.format("org/apache/commons/codec/language/bm/%s_languages.txt", nameType.getName());<a name="line.181"></a>
+<span class="sourceLineNo">161</span>        try {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>            boolean inExtendedComment = false;<a name="line.162"></a>
+<span class="sourceLineNo">163</span>            while (lsScanner.hasNextLine()) {<a name="line.163"></a>
+<span class="sourceLineNo">164</span>                final String line = lsScanner.nextLine().trim();<a name="line.164"></a>
+<span class="sourceLineNo">165</span>                if (inExtendedComment) {<a name="line.165"></a>
+<span class="sourceLineNo">166</span>                    if (line.endsWith(ResourceConstants.EXT_CMT_END)) {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>                        inExtendedComment = false;<a name="line.167"></a>
+<span class="sourceLineNo">168</span>                    }<a name="line.168"></a>
+<span class="sourceLineNo">169</span>                } else {<a name="line.169"></a>
+<span class="sourceLineNo">170</span>                    if (line.startsWith(ResourceConstants.EXT_CMT_START)) {<a name="line.170"></a>
+<span class="sourceLineNo">171</span>                        inExtendedComment = true;<a name="line.171"></a>
+<span class="sourceLineNo">172</span>                    } else if (line.length() &gt; 0) {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>                        ls.add(line);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>                    }<a name="line.174"></a>
+<span class="sourceLineNo">175</span>                }<a name="line.175"></a>
+<span class="sourceLineNo">176</span>            }<a name="line.176"></a>
+<span class="sourceLineNo">177</span>        } finally {<a name="line.177"></a>
+<span class="sourceLineNo">178</span>            lsScanner.close();<a name="line.178"></a>
+<span class="sourceLineNo">179</span>        }<a name="line.179"></a>
+<span class="sourceLineNo">180</span><a name="line.180"></a>
+<span class="sourceLineNo">181</span>        return new Languages(Collections.unmodifiableSet(ls));<a name="line.181"></a>
 <span class="sourceLineNo">182</span>    }<a name="line.182"></a>
 <span class="sourceLineNo">183</span><a name="line.183"></a>
-<span class="sourceLineNo">184</span>    private final Set&lt;String&gt; languages;<a name="line.184"></a>
-<span class="sourceLineNo">185</span><a name="line.185"></a>
-<span class="sourceLineNo">186</span>    /**<a name="line.186"></a>
-<span class="sourceLineNo">187</span>     * No languages at all.<a name="line.187"></a>
-<span class="sourceLineNo">188</span>     */<a name="line.188"></a>
-<span class="sourceLineNo">189</span>    public static final LanguageSet NO_LANGUAGES = new LanguageSet() {<a name="line.189"></a>
-<span class="sourceLineNo">190</span>        @Override<a name="line.190"></a>
-<span class="sourceLineNo">191</span>        public boolean contains(final String language) {<a name="line.191"></a>
-<span class="sourceLineNo">192</span>            return false;<a name="line.192"></a>
-<span class="sourceLineNo">193</span>        }<a name="line.193"></a>
-<span class="sourceLineNo">194</span><a name="line.194"></a>
-<span class="sourceLineNo">195</span>        @Override<a name="line.195"></a>
-<span class="sourceLineNo">196</span>        public String getAny() {<a name="line.196"></a>
-<span class="sourceLineNo">197</span>            throw new NoSuchElementException("Can't fetch any language from the empty language set.");<a name="line.197"></a>
-<span class="sourceLineNo">198</span>        }<a name="line.198"></a>
-<span class="sourceLineNo">199</span><a name="line.199"></a>
-<span class="sourceLineNo">200</span>        @Override<a name="line.200"></a>
-<span class="sourceLineNo">201</span>        public boolean isEmpty() {<a name="line.201"></a>
-<span class="sourceLineNo">202</span>            return true;<a name="line.202"></a>
-<span class="sourceLineNo">203</span>        }<a name="line.203"></a>
-<span class="sourceLineNo">204</span><a name="line.204"></a>
-<span class="sourceLineNo">205</span>        @Override<a name="line.205"></a>
-<span class="sourceLineNo">206</span>        public boolean isSingleton() {<a name="line.206"></a>
-<span class="sourceLineNo">207</span>            return false;<a name="line.207"></a>
-<span class="sourceLineNo">208</span>        }<a name="line.208"></a>
-<span class="sourceLineNo">209</span><a name="line.209"></a>
-<span class="sourceLineNo">210</span>        @Override<a name="line.210"></a>
-<span class="sourceLineNo">211</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.211"></a>
-<span class="sourceLineNo">212</span>            return this;<a name="line.212"></a>
-<span class="sourceLineNo">213</span>        }<a name="line.213"></a>
-<span class="sourceLineNo">214</span><a name="line.214"></a>
-<span class="sourceLineNo">215</span>        @Override<a name="line.215"></a>
-<span class="sourceLineNo">216</span>        public String toString() {<a name="line.216"></a>
-<span class="sourceLineNo">217</span>            return "NO_LANGUAGES";<a name="line.217"></a>
-<span class="sourceLineNo">218</span>        }<a name="line.218"></a>
-<span class="sourceLineNo">219</span>    };<a name="line.219"></a>
-<span class="sourceLineNo">220</span><a name="line.220"></a>
-<span class="sourceLineNo">221</span>    /**<a name="line.221"></a>
-<span class="sourceLineNo">222</span>     * Any/all languages.<a name="line.222"></a>
-<span class="sourceLineNo">223</span>     */<a name="line.223"></a>
-<span class="sourceLineNo">224</span>    public static final LanguageSet ANY_LANGUAGE = new LanguageSet() {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>        @Override<a name="line.225"></a>
-<span class="sourceLineNo">226</span>        public boolean contains(final String language) {<a name="line.226"></a>
-<span class="sourceLineNo">227</span>            return true;<a name="line.227"></a>
-<span class="sourceLineNo">228</span>        }<a name="line.228"></a>
-<span class="sourceLineNo">229</span><a name="line.229"></a>
-<span class="sourceLineNo">230</span>        @Override<a name="line.230"></a>
-<span class="sourceLineNo">231</span>        public String getAny() {<a name="line.231"></a>
-<span class="sourceLineNo">232</span>            throw new NoSuchElementException("Can't fetch any language from the any language set.");<a name="line.232"></a>
-<span class="sourceLineNo">233</span>        }<a name="line.233"></a>
-<span class="sourceLineNo">234</span><a name="line.234"></a>
-<span class="sourceLineNo">235</span>        @Override<a name="line.235"></a>
-<span class="sourceLineNo">236</span>        public boolean isEmpty() {<a name="line.236"></a>
-<span class="sourceLineNo">237</span>            return false;<a name="line.237"></a>
-<span class="sourceLineNo">238</span>        }<a name="line.238"></a>
-<span class="sourceLineNo">239</span><a name="line.239"></a>
-<span class="sourceLineNo">240</span>        @Override<a name="line.240"></a>
-<span class="sourceLineNo">241</span>        public boolean isSingleton() {<a name="line.241"></a>
-<span class="sourceLineNo">242</span>            return false;<a name="line.242"></a>
-<span class="sourceLineNo">243</span>        }<a name="line.243"></a>
-<span class="sourceLineNo">244</span><a name="line.244"></a>
-<span class="sourceLineNo">245</span>        @Override<a name="line.245"></a>
-<span class="sourceLineNo">246</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.246"></a>
-<span class="sourceLineNo">247</span>            return other;<a name="line.247"></a>
-<span class="sourceLineNo">248</span>        }<a name="line.248"></a>
-<span class="sourceLineNo">249</span><a name="line.249"></a>
-<span class="sourceLineNo">250</span>        @Override<a name="line.250"></a>
-<span class="sourceLineNo">251</span>        public String toString() {<a name="line.251"></a>
-<span class="sourceLineNo">252</span>            return "ANY_LANGUAGE";<a name="line.252"></a>
-<span class="sourceLineNo">253</span>        }<a name="line.253"></a>
-<span class="sourceLineNo">254</span>    };<a name="line.254"></a>
-<span class="sourceLineNo">255</span><a name="line.255"></a>
-<span class="sourceLineNo">256</span>    private Languages(final Set&lt;String&gt; languages) {<a name="line.256"></a>
-<span class="sourceLineNo">257</span>        this.languages = languages;<a name="line.257"></a>
-<span class="sourceLineNo">258</span>    }<a name="line.258"></a>
+<span class="sourceLineNo">184</span>    private static String langResourceName(final NameType nameType) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>        return String.format("org/apache/commons/codec/language/bm/%s_languages.txt", nameType.getName());<a name="line.185"></a>
+<span class="sourceLineNo">186</span>    }<a name="line.186"></a>
+<span class="sourceLineNo">187</span><a name="line.187"></a>
+<span class="sourceLineNo">188</span>    private final Set&lt;String&gt; languages;<a name="line.188"></a>
+<span class="sourceLineNo">189</span><a name="line.189"></a>
+<span class="sourceLineNo">190</span>    /**<a name="line.190"></a>
+<span class="sourceLineNo">191</span>     * No languages at all.<a name="line.191"></a>
+<span class="sourceLineNo">192</span>     */<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    public static final LanguageSet NO_LANGUAGES = new LanguageSet() {<a name="line.193"></a>
+<span class="sourceLineNo">194</span>        @Override<a name="line.194"></a>
+<span class="sourceLineNo">195</span>        public boolean contains(final String language) {<a name="line.195"></a>
+<span class="sourceLineNo">196</span>            return false;<a name="line.196"></a>
+<span class="sourceLineNo">197</span>        }<a name="line.197"></a>
+<span class="sourceLineNo">198</span><a name="line.198"></a>
+<span class="sourceLineNo">199</span>        @Override<a name="line.199"></a>
+<span class="sourceLineNo">200</span>        public String getAny() {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>            throw new NoSuchElementException("Can't fetch any language from the empty language set.");<a name="line.201"></a>
+<span class="sourceLineNo">202</span>        }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>        @Override<a name="line.204"></a>
+<span class="sourceLineNo">205</span>        public boolean isEmpty() {<a name="line.205"></a>
+<span class="sourceLineNo">206</span>            return true;<a name="line.206"></a>
+<span class="sourceLineNo">207</span>        }<a name="line.207"></a>
+<span class="sourceLineNo">208</span><a name="line.208"></a>
+<span class="sourceLineNo">209</span>        @Override<a name="line.209"></a>
+<span class="sourceLineNo">210</span>        public boolean isSingleton() {<a name="line.210"></a>
+<span class="sourceLineNo">211</span>            return false;<a name="line.211"></a>
+<span class="sourceLineNo">212</span>        }<a name="line.212"></a>
+<span class="sourceLineNo">213</span><a name="line.213"></a>
+<span class="sourceLineNo">214</span>        @Override<a name="line.214"></a>
+<span class="sourceLineNo">215</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.215"></a>
+<span class="sourceLineNo">216</span>            return this;<a name="line.216"></a>
+<span class="sourceLineNo">217</span>        }<a name="line.217"></a>
+<span class="sourceLineNo">218</span><a name="line.218"></a>
+<span class="sourceLineNo">219</span>        @Override<a name="line.219"></a>
+<span class="sourceLineNo">220</span>        public String toString() {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>            return "NO_LANGUAGES";<a name="line.221"></a>
+<span class="sourceLineNo">222</span>        }<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    };<a name="line.223"></a>
+<span class="sourceLineNo">224</span><a name="line.224"></a>
+<span class="sourceLineNo">225</span>    /**<a name="line.225"></a>
+<span class="sourceLineNo">226</span>     * Any/all languages.<a name="line.226"></a>
+<span class="sourceLineNo">227</span>     */<a name="line.227"></a>
+<span class="sourceLineNo">228</span>    public static final LanguageSet ANY_LANGUAGE = new LanguageSet() {<a name="line.228"></a>
+<span class="sourceLineNo">229</span>        @Override<a name="line.229"></a>
+<span class="sourceLineNo">230</span>        public boolean contains(final String language) {<a name="line.230"></a>
+<span class="sourceLineNo">231</span>            return true;<a name="line.231"></a>
+<span class="sourceLineNo">232</span>        }<a name="line.232"></a>
+<span class="sourceLineNo">233</span><a name="line.233"></a>
+<span class="sourceLineNo">234</span>        @Override<a name="line.234"></a>
+<span class="sourceLineNo">235</span>        public String getAny() {<a name="line.235"></a>
+<span class="sourceLineNo">236</span>            throw new NoSuchElementException("Can't fetch any language from the any language set.");<a name="line.236"></a>
+<span class="sourceLineNo">237</span>        }<a name="line.237"></a>
+<span class="sourceLineNo">238</span><a name="line.238"></a>
+<span class="sourceLineNo">239</span>        @Override<a name="line.239"></a>
+<span class="sourceLineNo">240</span>        public boolean isEmpty() {<a name="line.240"></a>
+<span class="sourceLineNo">241</span>            return false;<a name="line.241"></a>
+<span class="sourceLineNo">242</span>        }<a name="line.242"></a>
+<span class="sourceLineNo">243</span><a name="line.243"></a>
+<span class="sourceLineNo">244</span>        @Override<a name="line.244"></a>
+<span class="sourceLineNo">245</span>        public boolean isSingleton() {<a name="line.245"></a>
+<span class="sourceLineNo">246</span>            return false;<a name="line.246"></a>
+<span class="sourceLineNo">247</span>        }<a name="line.247"></a>
+<span class="sourceLineNo">248</span><a name="line.248"></a>
+<span class="sourceLineNo">249</span>        @Override<a name="line.249"></a>
+<span class="sourceLineNo">250</span>        public LanguageSet restrictTo(final LanguageSet other) {<a name="line.250"></a>
+<span class="sourceLineNo">251</span>            return other;<a name="line.251"></a>
+<span class="sourceLineNo">252</span>        }<a name="line.252"></a>
+<span class="sourceLineNo">253</span><a name="line.253"></a>
+<span class="sourceLineNo">254</span>        @Override<a name="line.254"></a>
+<span class="sourceLineNo">255</span>        public String toString() {<a name="line.255"></a>
+<span class="sourceLineNo">256</span>            return "ANY_LANGUAGE";<a name="line.256"></a>
+<span class="sourceLineNo">257</span>        }<a name="line.257"></a>
+<span class="sourceLineNo">258</span>    };<a name="line.258"></a>
 <span class="sourceLineNo">259</span><a name="line.259"></a>
-<span class="sourceLineNo">260</span>    public Set&lt;String&gt; getLanguages() {<a name="line.260"></a>
-<span class="sourceLineNo">261</span>        return this.languages;<a name="line.261"></a>
+<span class="sourceLineNo">260</span>    private Languages(final Set&lt;String&gt; languages) {<a name="line.260"></a>
+<span class="sourceLineNo">261</span>        this.languages = languages;<a name="line.261"></a>
 <span class="sourceLineNo">262</span>    }<a name="line.262"></a>
-<span class="sourceLineNo">263</span>}<a name="line.263"></a>
+<span class="sourceLineNo">263</span><a name="line.263"></a>
+<span class="sourceLineNo">264</span>    public Set&lt;String&gt; getLanguages() {<a name="line.264"></a>
+<span class="sourceLineNo">265</span>        return this.languages;<a name="line.265"></a>
+<span class="sourceLineNo">266</span>    }<a name="line.266"></a>
+<span class="sourceLineNo">267</span>}<a name="line.267"></a>
 
 
 



Mime
View raw message