carfield.com.hkclassloading.txt2022-05-03T14:08:30Z2022-05-03T14:08:30Z<br/>Hint to prevent blocking of loadClass by using Thread.getContextClassLoader() - <a href="https://blog.fastthread.io/2022/05/03/java-class-loading-performance-impact/">https://blog.fastthread.io[..]3/java-class-loading-performance-impact/</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2022-05-03T14:08:30Zcorner case.txt2021-10-17T11:59:31Z2021-10-17T11:59:31Z<br/>Corner case cheat sheet in Java - <a href="https://ge0ffrey.github.io/ge0ffrey-presentations/cornerCaseCheatSheet/cheatSheetJava.html">https://ge0ffrey.github.io[..]cornerCaseCheatSheet/cheatSheetJava.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2021-10-17T11:59:31Zcglib.txt2013-12-18T07:53:04Z2013-12-18T07:53:04Z<br/><a href="http://www.jroller.com/page/julien.dubois/20050506#java_dynamic_proxies_and_cglib">http://www.jroller.com[..]/20050506#java_dynamic_proxies_and_cglib</a> <br/><br/><a href="http://mydailyjava.blogspot.com.au/2013/11/cglib-missing-manual.html">http://mydailyjava.blogspot.com.au[..]com.au/2013/11/cglib-missing-manual.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2013-12-18T07:53:04Zpreprocessor.txt2013-12-05T05:16:04Z2013-12-05T05:16:04Z<br/>Funny, using gcc preprocessor with java - <a href="https://gist.github.com/anonymous/7797380">https://gist.github.com/anonymous/7797380</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2013-12-05T05:16:04ZIntrinsics.txt2012-09-11T14:21:17Z2012-09-11T14:21:17Z<br/>How JVM optimzate the code by understanding the intentional of programmer - <a href="http://bad-concurrency.blogspot.com.au/2012/08/arithmetic-overflow-and-intrinsics.html">http://bad-concurrency.blogspot.com.au[..]/arithmetic-overflow-and-intrinsics.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2012-09-11T14:21:17Zcracking java.txt2011-10-29T18:36:47Z2011-10-29T18:36:47Z<br/>"hi there".equals("cheers !") == true<br/>This is because in the JDK 1.3 SUN is caching the hash code so if it once is calculated, it doesn't get recalculated, so if the value field changes, the hashcode stays the same. <br/><br/><a href="http://www.artima.com/forums/flat.jsp?forum=106&thread=4864">http://www.artima.com/forums/flat.jsp?forum=106&thread=4864</a> <br/><br/>How to Modifying an Application without Modifying Its Source Code, with {-Xbootclasspath/p:} - <a href="http://www.ddj.com/architect/218501561;jsessionid=ZVULO0S3MMM4OQSNDLPCKH0CJUNN2JVN?_requestid=186396">http://www.ddj.com[..]M4OQSNDLPCKH0CJUNN2JVN?_requestid=186396</a> <br/><br/>Override string! - <a href="http://www.javacodegeeks.com/2011/10/weird-funny-java.html">http://www.javacodegeeks.com/2011/10/weird-funny-java.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2011-10-29T18:36:47Zexception.txt2009-07-26T17:08:14Z2009-07-26T17:08:14Z<br/>How to get line number of specific stacktrace<br/> private static void log(String prefix, <br/> String message) {<br/><br/> StackTraceElement ste = <br/> new Exception().getStackTrace()[2];<br/><br/> System.out.println("[" + prefix + "] " +<br/> ste.getClassName() + "." + <br/> ste.getMethodName() + "(" +<br/> ste.getLineNumber() + "): " + <br/> message);<br/> }<br/><br/><a href="http://jroller.com/page/davinci/20050602#abusing_java_for_debugging_purposes">http://jroller.com[..]0602#abusing_java_for_debugging_purposes</a> <br/><br/>Annotation of using stacktrace - <a href="http://www.theserverside.com/news/thread.tss?thread_id=55238#312195">http://www.theserverside.com[..]m/news/thread.tss?thread_id=55238#312195</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2009-07-26T17:08:14Zkill.txt2008-03-17T17:25:28Z2008-03-17T17:25:28Z<br/>if you do a “kill -3? of the java process id, it dumps a stack trace of every thread, including what locks it’s holding, to stdout. - <a href="http://blog.xcski.com/2006/09/01/java-barbie-says-kill-3-pid-is-my-new-best-friend">http://blog.xcski.com[..]ie-says-kill-3-pid-is-my-new-best-friend</a> <br/><br/>At windows, it is ctrl-break<br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2008-03-17T17:25:28Zquickstart.txt2007-05-13T11:12:13Z2007-05-13T11:12:13Z<br/>of various java server - <a href="http://www.learntechnology.net/content/main.jsp">http://www.learntechnology.net/content/main.jsp</a> <br/>of various java technology - <a href="http://www.javapassion.com/j2ee/index.html">http://www.javapassion.com/j2ee/index.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2007-05-13T11:12:13Zjar.txt2007-05-03T07:30:15Z2007-05-03T07:30:15Z<br/>This should not really matter for deployment case, but for development which keep on restarting may be useful<br/><br/><a href="http://ant.apache.org/manual/CoreTasks/jar.html#indexjars">http://ant.apache.org/manual/CoreTasks/jar.html#indexjars</a> <br/><br/>Edit JAR in code - <a href="http://www.java-tips.org/blog/java-se/how-to-modify-a-jar-file.html">http://www.java-tips.org[..]og/java-se/how-to-modify-a-jar-file.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2007-05-03T07:30:15ZThrows NULL.txt2007-04-27T08:12:43Z2007-04-27T08:12:43Z<br/>We can just <br/><br/><pre>throw null;</pre><br/><br/>in java, but probably not a good idea for most case<br/><br/><a href="http://beanman.wordpress.com/2007/04/20/throwing-null-with-different-jvm-options/">http://beanman.wordpress.com[..]hrowing-null-with-different-jvm-options/</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2007-04-27T08:12:43ZInteresting and useless trick.txt2007-02-15T09:34:38Z2007-02-15T09:34:38Z<br/>change intern String: <a href="http://cretesoft.com/archive/newsletter.do?issue=014">http://cretesoft.com/archive/newsletter.do?issue=014</a> <br/><br/>limitation of string size, parameter list length, ... etc: <a href="http://javaspecialists.co.za/archive/newsletter.do?issue=059&locale=en_US">http://javaspecialists.co.za[..]ive/newsletter.do?issue=059&locale=en_US</a> and <a href="http://www.javaspecialists.co.za/archive/newsletter.do?issue=121">http://www.javaspecialists.co.za/archive/newsletter.do?issue=121</a> <br/>Related is Size limitation of Java String - <a href="http://www.oreillynet.com/lpt/wlg/6303">http://www.oreillynet.com/lpt/wlg/6303</a> <br/><br/>generating nullpointerexception from throw NULL: <a href="http://fishbowl.pastiche.org/2003/04/30/throwing_null">http://fishbowl.pastiche.org/2003/04/30/throwing_null</a> <br/><br/>When no nullpointerexception when object is null: <a href="http://fishbowl.pastiche.org/2006/01/17/random_java_trivia">http://fishbowl.pastiche.org/2006/01/17/random_java_trivia</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2007-02-15T09:34:38Zj2me.txt2006-11-30T15:22:16Z2006-11-30T15:22:16Z<br/>optimizing java class for j2me, look like just break all OO principle... <a href="http://blog.javia.org/?p=31">http://blog.javia.org/?p=31</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2006-11-30T15:22:16Zbitwise operation on boolean.txt2006-11-11T10:03:05Z2006-11-11T10:03:05Z<br/>bitwise operation on boolean<br/><br/>The solution to the puzzle is given in the Java Language Specification, chapter 15.22.2:<br/>15.22.2 Boolean Logical Operators &, ^, and |<br/>When both operands of a &, ^, or | operator are of type boolean, then the type of the bitwise operator expression is boolean.<br/>For &, the result value is true if both operand values are true; otherwise, the result is false.<br/>For ^, the result value is true if the operand values are different; otherwise, the result is false.<br/>For |, the result value is false if both operand values are false; otherwise, the result is true.<br/><br/><a href="http://beust.com/weblog/archives/000350.html">http://beust.com/weblog/archives/000350.html</a> <br/><br/>Someone mentioned that there is no boolean, byte and short in byte code level, all just integer<br/><a href="http://oddjava.com/?q=node/8">http://oddjava.com/?q=node/8</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2006-11-11T10:03:05Zsecurity.txt2006-11-07T05:11:24Z2006-11-07T05:11:24Z<br/>Prevent System.exit() being call - <a href="http://jroller.com/page/ethdsy?entry=disabling_system_exit">http://jroller.com/page/ethdsy?entry=disabling_system_exit</a> Usually security manager forbid it <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2006-11-07T05:11:24ZCracking class files.txt2006-07-12T08:09:26Z2006-07-12T08:09:26Z<br/>No sure if that still valid, but look like encrypt class file don't help on protecting class.<br/><br/><a href="http://www.javaworld.com/javaworld/javaqa/2003-05/01-qa-0509-jcrypt.html">http://www.javaworld.com[..]ld/javaqa/2003-05/01-qa-0509-jcrypt.html</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2006-07-12T08:09:26Ztrick for java 5.txt2006-06-26T06:32:59Z2006-06-26T06:32:59Z<br/>New look of resultset, WebRowSet, <a href="http://www.onjava.com/lpt/a/6633">http://www.onjava.com/lpt/a/6633</a> , but I personally don't think this is something useful <br/><br/>Some information how using jmxagent: <a href="http://weblogs.java.net/blog/emcmanus/archive/2006/06/going_beyond_jd.html">http://weblogs.java.net[..]nus/archive/2006/06/going_beyond_jd.html</a> <br/><br/>Just come across a nice article that discuss about various new features of 1.5 and provide tips on how to use them: <a href="http://java.sys-con.com/read/171487_p.htm">http://java.sys-con.com/read/171487_p.htm</a> <br/><br/>Create collection quick<br/><br/>List<String> programmingLanguages = CollectionUtils.newList("Java", "C++", "Ruby");<br/><br/>Or this: <br/><br/>Map<String, String> langs = new HashMap<String, String>(3) {{<br/> put("Java", "Wicked");<br/> put("C++", "Ok");<br/> put("Ruby", "Interesting");<br/>}};<br/><br/><a href="http://www.theserverside.com/blogs/thread.tss?thread_id=37839">http://www.theserverside.com/blogs/thread.tss?thread_id=37839</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2006-06-26T06:32:59Zequals() at proxy generated instance.txt2006-05-16T07:30:58Z2006-05-16T07:30:58Z<br/>At least need to test on the interface level. And more complicate if you don't want to expose the internal structure to interface<br/><br/><a href="http://www.javaspecialists.co.za/archive/newsletter.do?issue=126">http://www.javaspecialists.co.za/archive/newsletter.do?issue=126</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2006-05-16T07:30:58Zjava.util.Calendar.txt2006-04-07T05:13:55Z2006-04-07T05:13:55Z<br/>I don't know this before, and I don't know if this is the behaviour of all Calendar implementation or it is only GregorianCalendar do this...<br/><br/><blockquote><br/>Every time you call set, Calendar sets a flag internally which indicates that something has changed. For performance reasons, the time is not actually computed until a call to getTime() (and variants).<br/><br/>The problem is that you are setting two conflicting states before computing the time:<br/><br/>thisMonth.set(Calendar.DAY_OF_MONTH, 1);<br/>thisMonth.set(Calendar.DAY_OF_WEEK, 1); <br/><br/>According to the JavaDoc:<br/>"If fields conflict, the calendar will give preference to fields set more recently."<br/><br/>Thus, in the second case, the call to set DAY_OF_MONTH is ignored. <br/></blockquote><br/><br/><a href="http://discuss.joelonsoftware.com/default.asp?joel.3.328034">http://discuss.joelonsoftware.com/default.asp?joel.3.328034</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2006-04-07T05:13:55Zbeware of java inline.txt2005-12-14T08:35:14Z2005-12-14T08:35:14Z<br/>Usually java inline constant , this work fine most likely but sometime you will have surprise about this<br/><br/><a href="http://www.cretesoft.com/archive/newsletter.do?issue=114">http://www.cretesoft.com/archive/newsletter.do?issue=114</a> <br/><a href="http://jroller.com/page/ee?entry=dependency_checking_of_javac">http://jroller.com/page/ee?entry=dependency_checking_of_javac</a> <br/><a href="http://jroller.com/page/ee?entry=javac_s_inlining_revisited">http://jroller.com/page/ee?entry=javac_s_inlining_revisited</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2005-12-14T08:35:14Zfind file in classpath.txt2005-07-12T04:27:06Z2005-07-12T04:27:06Z<br/>This is kind of useful to have a quick way to find file in classpath, see if some day really deploy to system I work on: <a href="http://jroller.com/page/mlconnor/20050708#code_to_find_files_on">http://jroller.com/page/mlconnor/20050708#code_to_find_files_on</a> <br/><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>2005-07-12T04:27:06Z