On 15/01/2010 01:23 AM, Andrey P.Rybin wrote:
1. Bug fix:
I like freemarker's, dependencies in separate jars and i haven't
'velocity' in my classpath.
So I found bug: common click core depends on Velocity.
Would you mind raising a JIRA for this issue?
===
2. org.apache.click.util.ClickUtils.java
Instead of few .close(SomeIoObject) methods you can use ONE:
Thanks, I've checked your change into trunk.
====
3. properties files encoding
J2SE 5.0 reached its End of Service Life (EOSL) on November 3, 2009
So we can try to use some Java6 features with care.
For example (somewhere in Click core):
private static volatile Boolean java6;//def: null=unknown
public static void loadProperties (Properties properties, InputStream
in, final Charset charset)
throws IOException, IllegalArgumentException {
if (java6 == null) { //1st run
try {
java6 = Properties.class.getMethod("load", Reader.class) != null;
} catch (Exception ignore) {
java6 = false;
}//t
}//i
if (java6.booleanValue()) {
properties.load(new InputStreamReader(in, charset));
} else { //older than 1.6. load(Reader) not supported
properties.load(in);
}//i
}//loadProperties
Profit: click property files can be in UTF-8 encoding instead of that
ugly \u1234\u1234\u1234\u1234\u1234\u1234\u1234\u1234\u1234\u1234
and it is full backward compatible - you don't need to convert ISO
8859-1 encoded property files (with these \ucafe\ubebe) to UTF-8.
But you can.
Looks promising. I think Click uses Java ResourceBundle.getBundle to load its properties, so this
might require a bit of rework. If you are interested have a look at ClickUtils.getBundle implementation.
4. I made russian translation for click-control_ru.properties
Attached.
Thanks very much. Can you open a JIRA for this and attach the property file to that issue? Also note
that click-extras contains a couple of property files as well. Look under the folder
<click-dist>/extras/src/org/apache/click/extras/control
kind regards
bob