Last modified 3 days ago
Last modified on 05/22/12 13:09:59
- string.toLowerCase() actually needs to be string.toLowerCase(Locale.US) in most cases. This meant in the past that GeoGebra did not funtion in Turkish. Please use Application.toLowerCase() and toUpperCase() so that it works in GWT too
- You need to specify an encoding, eg new InputStreamReader(is, "UTF8"). It may work without in your Locale, but the default will be different on some computers (eg UTF7 in Spain on Windows)
- care is needed calling methods from the superclass's constructor:
http://benpryor.com/blog/2008/01/02/dont-call-subclass-methods-from-a-superclass-constructor/
We've recently had to move setConstructionDefaults() from GeoElement's constructor to fix a longstanding bug with this
- string1 == string2 doesn't do what you might think, use string1.equals(string2)
- d == Double.NaN doesn't work as you might think, use Double.isNaN(d)
- in most cases you should use Kernel.isEqual(double1, double2) not double1 == double2. Also Kernel.isZero()
- Obey the equals / hashcode contract. Try to avoid the need for overriding equals/hashcode in new code: Instead explicitly check for equality and use Comparator<T> (instead of Comparable<T>) for sorting.
- Don't use top-bit set/Unicode characters eg §°é. They may work on your computer but will go pear shaped elsewhere. In Parser.jj use \u notation, for everything else please add to Unicode.java, then use eg Unicode.EULER_STRING
- use 2.0 / 3.0 not 2 / 3 (2 / 3 is actually zero)
- don't ever use System.gc() unless you really need it, and even then check with someone, see #2048
- Double.MIN_VALUE is a very small positive value. Use -Double.MAX_VALUE for the smallest double
- a = Double.NAN; i = (int)a; gives i = 0 (integers can't store NaN)
- Double.parseDouble(double) does not work in GWT for NaN. Use StringUtil.parseDouble(double) or MyDouble.parseDouble(double) instead (the later supports internationalized digits).
