<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>拈花微笑 &#187; java</title>
	<atom:link href="http://www.jayxu.com/tags/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jayxu.com</link>
	<description>晶 · 彦</description>
	<lastBuildDate>Thu, 02 Feb 2012 09:24:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
<link>http://www.jayxu.com</link>
<url>http://www.jayxu.com/wp-content/cbnet-favicon/1289928181_Black_Cat.png</url>
<title>拈花微笑</title>
</image>
		<item>
		<title>有关Java泛型的类型擦除（type erasing）</title>
		<link>http://www.jayxu.com/2012/02/02/13237/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%259c%2589%25e5%2585%25b3java%25e6%25b3%259b%25e5%259e%258b%25e7%259a%2584%25e7%25b1%25bb%25e5%259e%258b%25e6%2593%25a6%25e9%2599%25a4%25ef%25bc%2588type-erasing%25ef%25bc%2589</link>
		<comments>http://www.jayxu.com/2012/02/02/13237/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 09:24:41 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[spring mvc]]></category>
		<category><![CDATA[泛型]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=13237</guid>
		<description><![CDATA[自从Java 5引入泛型之后，Java与C++对于泛型不同的实现的优劣便一直是饭后的谈资。在我之前的很多training中，当讲到Java泛型时总是会和C++的实现比较，一般得出的结论是 Java使用类型擦除（type erasing），泛型信息只在编译时供javac作类型检查用，在编译后便被javac擦除，因此无法被反射 C++使用代码模板实现泛型，即在预处理时会生成类似｢list_int｣，｢list_char｣等的泛型类，虽然解决Java的运行时伪泛型的问题，但是会导致编译后的代码呈线性增长 于是在一般情况下，Java的类型擦除实现较优 这三条已经比绝大多数的Java培训讲师讲得深刻了。但是如果下面有人问｢在什么情况下C++的实现方式较优｣时，除了无法被反射，我很难现抓一个有说服力的例子。今天，Spring的RestTemplate终于给了我这个例子 我遇到的问题如下（阅读需要有一些Spring MVC、REST基础） 有一个返回类型为List的MVC方法： @RequestMapping&#40;value = &#34;...&#34;, method = RequestMethod.GET&#41; @ResponseBody public List&#60;DomainClass&#62; doSomethingREST&#40;&#41; &#123; &#160; &#160; List&#60;DomainClass&#62; domainObjs = ... ; &#160; &#160; return domainObjs; &#125; @RequestMapping(value = "...", method = RequestMethod.GET) @ResponseBody public List&#60;DomainClass&#62; doSomethingREST() { List&#60;DomainClass&#62; domainObjs = ... ; return domainObjs; } 在运行时，Spring MVC会将List转换成JSON字符串并返回至客户端。但是如果我在另一个service中使用RestTemplate直接调用该REST接口，问题便来了： List&#60;DomainClass&#62; <a href="http://www.jayxu.com/2012/02/02/13237/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>自从Java 5引入泛型之后，Java与C++对于泛型不同的实现的优劣便一直是饭后的谈资。在我之前的很多training中，当讲到Java泛型时总是会和C++的实现比较，一般得出的结论是</p>
<ul>
<li>Java使用类型擦除（type erasing），泛型信息只在编译时供javac作类型检查用，在编译后便被javac擦除，因此无法被反射</li>
<li>C++使用代码模板实现泛型，即在预处理时会生成类似｢list_int｣，｢list_char｣等的泛型类，虽然解决Java的运行时伪泛型的问题，但是会导致编译后的代码呈线性增长</li>
<li>于是在一般情况下，Java的类型擦除实现较优</li>
</ul>
<p>这三条已经比绝大多数的Java培训讲师讲得深刻了。但是如果下面有人问｢在什么情况下C++的实现方式较优｣时，除了无法被反射，我很难现抓一个有说服力的例子。今天，Spring的RestTemplate终于给了我这个例子</p>
<p>我遇到的问题如下（阅读需要有一些Spring MVC、REST基础）</p>
<p>有一个返回类型为List<DomainClass>的MVC方法：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">@RequestMapping<span class="br0">&#40;</span>value <span class="sy0">=</span> <span class="st0">&quot;...&quot;</span>, method <span class="sy0">=</span> RequestMethod.<span class="me1">GET</span><span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">@ResponseBody</div></li>
<li class="li1"><div class="de1"><span class="kw1">public</span> List<span class="sy0">&lt;</span>DomainClass<span class="sy0">&gt;</span> doSomethingREST<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; List<span class="sy0">&lt;</span>DomainClass<span class="sy0">&gt;</span> domainObjs <span class="sy0">=</span> ... <span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> domainObjs<span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">@RequestMapping(value = "...", method = RequestMethod.GET)
@ResponseBody
public List&lt;DomainClass&gt; doSomethingREST() {
    List&lt;DomainClass&gt; domainObjs = ... ;
    return domainObjs;
}</pre></div></div>

<p>在运行时，Spring MVC会将List<DomainClass>转换成JSON字符串并返回至客户端。但是如果我在另一个service中使用RestTemplate直接调用该REST接口，问题便来了：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">List<span class="sy0">&lt;</span>DomainClass<span class="sy0">&gt;</span> domainObjs <span class="sy0">=</span> <span class="kw1">this</span>.<span class="me1">restTemplate</span>.<span class="me1">getForObject</span><span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">restURL</span>, <span class="kw3">List</span>.<span class="kw1">class</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">List&lt;DomainClass&gt; domainObjs = this.restTemplate.getForObject(this.restURL, List.class);</pre></div></div>

<p>关键在于第二个参数，是返回值的类型，RestTemplate会根据此类型选择适当的MessageConverter将调用REST接口的返回值反序列化为与类型匹配的对象。由于List的泛型参数在编译时被擦除，于是RestTemplate便无法确定List中的内容。｢一般情况下｣（REST接口返回值不是List类型）不会有问题，但是巧合的是，如果服务器端使用JSON对REST结果进行序列化，返回值会被封装在List<LinkedHashMap>中，此时，Spring已无法判断开发人员是想直接获得List<LinkedHashMap>封装的JSON内容还是需要更进一步使用Jackson库将JSON反序列化为Java对象。现实情况下，Spring选择的前者，于是便会抛出ClassCastException</p>
<p>上网搜了一圈，已经有人向Spring提交了enhancement请求（<a href="https://jira.springsource.org/browse/SPR-7002" target="_blank">这里</a>和<a href="https://jira.springsource.org/browse/SPR-7023" target="_blank">这里</a>，其中第一个链接中的walkaround可以work），但是目前没有milestone<br />
&nbsp;
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2012/02/02/13237/">有关Java泛型的类型擦除（type erasing）</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&title=%E6%9C%89%E5%85%B3Java%E6%B3%9B%E5%9E%8B%E7%9A%84%E7%B1%BB%E5%9E%8B%E6%93%A6%E9%99%A4%EF%BC%88type+erasing%EF%BC%89" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2012/02/02/13237/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用Spring LDAP ODM操作LDAP</title>
		<link>http://www.jayxu.com/2011/12/14/13131/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25bd%25bf%25e7%2594%25a8spring-ldap-odm%25e6%2593%258d%25e4%25bd%259cldap</link>
		<comments>http://www.jayxu.com/2011/12/14/13131/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 15:10:16 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[spring context]]></category>
		<category><![CDATA[spring ldap]]></category>
		<category><![CDATA[spring ldap odm]]></category>
		<category><![CDATA[spring mvc]]></category>
		<category><![CDATA[spring orm]]></category>
		<category><![CDATA[spring tx]]></category>
		<category><![CDATA[struts]]></category>
		<category><![CDATA[牢骚]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=13131</guid>
		<description><![CDATA[Spring Source真的是个很神奇的开源社区，从《J2EE without EJB》开始为大家所知晓，到把IoC、AOP大范围地带到大家的开发模型中，再到和Hibernate、Struts组成每个Java函授学校必教的“SSH”组合，从此绿遍大江南北…… 在国内，大马路上随便抓一个Java程序员，10个里有9个半知道Spring；有9个知道怎么把SSH“组装”到一起（是的，“组装”，和流水线上的蓝领熟练工没有本质区别）；有9个半知道IoC、AOP；有2个知道IoC和AOP的本质；有3个知道Spring其实分为core、context、orm、tx等不同子框架；有1个知道Spring 3之后可以用annotation取代之前版本大部分的xml配置；有2个知道Spring mvc和security；有半个知道其实Spring的子框架远不止这些……这就是我们当前Java码农们的实际情况。而造成这一局面的，我谓之三害——高校计算机系功利的培养模式、以北大青鸟为首的各种速成班的祸害和程序员们自己懒惰、人云亦云、拒绝思考的慢性自杀 牢骚发完，本文将通过介绍Spring的两个子框架：Spring LDAP和Spring LDAP ODM，来实现对LDAP的操作 项目主页：http://www.springsource.org/ldap，该框架通过提供和ORM中相似的机制对LDAP相关操作进行封装，主要包括： 类比SessionFactory的LdapContextSource 类比HibernateTemplate等的LdapTemplate 伪事务支持，能否与tx框架的TransactionManager混用未知 类比JPA的使用@Entry、@Attribute、@Id标注的ODM——Object Directory Mapping 本文（原先）目标：使用ODM将User类与LDAP中的实体进行映射，LDAP中的实体的objectClass包括inetOrgPerson，organizationalPerson，person，shadowAccount和top 相关配置文件、代码在http://static.springsource.org/spring-ldap/docs/1.3.x/reference/html/上已经很详细了，这里只是做一点旁注，全部来自于这几天和Spring LDAP的斗智斗勇 对于shadowAccount的shadowLastChange域，值是一个整形，至于具体含义网上没有找到解释，试了几次之后发现是从1970-1-1 00:00:00至今的天数，如果model里定义的是Date类型的话，需要自行实现org.springframework.ldap.odm.typeconversion.impl.Converter接口进行转换 对于@Entry标记，其中的objectClasses定义必须与objectClass完全一致。在新建和查询object时，ODM会根据此标记进行匹配，无需再指定objectClass 每个entry必须指定@Id字段，类型为javax.naming.Name，其实就是DN。但是若在LdapContextSource中指定了base，则DN将会按照base截取相对路径。比如，DN为cn=user,ou=users,dc=jayxu,dc=com，base为dc=jayxu,dc=com，则取出的user对象DN为cn=user,ou=users 如果使用Spring MVC对LDAP对象进行JSON序列化，必须注意javax.naming.Name中的某些字段无法被序列化，所以在转换成JSON之前需要将DN置null。一种方法是使用@JsonIgnoreProperties标记model类，比如：@JsonIgnoreProperties(“dn”) 对于不需要与LDAP进行映射的字段使用@Transient进行标记 考虑使用org.springframework.ldap.pool.factory.PoolingContextSource引入连接池 如果事务中需要与JDBC进行互操作，需要使用org.springframework.ldap.transaction.compensating.manager.ContextSourceAndDataSourceTransactionManager作为tx manager 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 使用Spring LDAP ODM操作LDAP<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F06%2F09%2F2342%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之Hibernate+JBoss Treecache实现Hibernate集群</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之经验教训（一）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F01%2F12%2F13221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">解决Velocity＋Spring的中文乱码问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fspring-party&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">四年一宴 —— 安妮宝贝《春宴》书评 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Ftamaswells-spring-mingyaofeng.html&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">音乐生活&gt;&gt;Tamas Wells | 充满春天气息的民谣风 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fspring-flowers-message-block-information.html&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">春之信息花器留言座 [意外中秋礼物] (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fchuxiong-normal-university&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">大学时候的牢骚 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lzhi.org%2Fviews%2F777023&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">牢骚怨言要远离嘴边 (@lzhi)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Spring Source真的是个很神奇的开源社区，从《J2EE without EJB》开始为大家所知晓，到把IoC、AOP大范围地带到大家的开发模型中，再到和Hibernate、Struts组成每个Java函授学校必教的“SSH”组合，从此绿遍大江南北……</p>
<p>在国内，大马路上随便抓一个Java程序员，10个里有9个半知道Spring；有9个知道怎么把SSH“组装”到一起（是的，“组装”，和流水线上的蓝领熟练工没有本质区别）；有9个半知道IoC、AOP；有2个知道IoC和AOP的本质；有3个知道Spring其实分为core、context、orm、tx等不同子框架；有1个知道Spring 3之后可以用annotation取代之前版本大部分的xml配置；有2个知道Spring mvc和security；有半个知道其实Spring的子框架远不止这些……这就是我们当前Java码农们的实际情况。而造成这一局面的，我谓之三害——高校计算机系功利的培养模式、以北大青鸟为首的各种速成班的祸害和程序员们自己懒惰、人云亦云、拒绝思考的慢性自杀</p>
<p>牢骚发完，本文将通过介绍Spring的两个子框架：Spring LDAP和Spring LDAP ODM，来实现对LDAP的操作</p>
<p>项目主页：<a href="http://www.springsource.org/ldap" target="_blank">http://www.springsource.org/ldap</a>，该框架通过提供和ORM中相似的机制对LDAP相关操作进行封装，主要包括：</p>
<ul>
<li>类比SessionFactory的LdapContextSource</li>
<li>类比HibernateTemplate等的LdapTemplate</li>
<li>伪事务支持，能否与tx框架的TransactionManager混用未知</li>
<li>类比JPA的使用@Entry、@Attribute、@Id标注的ODM——Object Directory Mapping</li>
</ul>
<p>本文（原先）目标：使用ODM将User类与LDAP中的实体进行映射，LDAP中的实体的objectClass包括inetOrgPerson，organizationalPerson，person，shadowAccount和top</p>
<p>相关配置文件、代码在<a href="http://static.springsource.org/spring-ldap/docs/1.3.x/reference/html/" target="_blank">http://static.springsource.org/spring-ldap/docs/1.3.x/reference/html/</a>上已经很详细了，这里只是做一点旁注，全部来自于这几天和Spring LDAP的斗智斗勇</p>
<ul>
<li>对于shadowAccount的shadowLastChange域，值是一个整形，至于具体含义网上没有找到解释，试了几次之后发现是从1970-1-1 00:00:00至今的天数，如果model里定义的是Date类型的话，需要自行实现org.springframework.ldap.odm.typeconversion.impl.Converter接口进行转换</li>
<li>对于@Entry标记，其中的objectClasses定义必须与objectClass完全一致。在新建和查询object时，ODM会根据此标记进行匹配，无需再指定objectClass</li>
<li>每个entry必须指定@Id字段，类型为javax.naming.Name，其实就是DN。但是若在LdapContextSource中指定了base，则DN将会按照base截取相对路径。比如，DN为cn=user,ou=users,dc=jayxu,dc=com，base为dc=jayxu,dc=com，则取出的user对象DN为cn=user,ou=users</li>
<li>如果使用Spring MVC对LDAP对象进行JSON序列化，必须注意javax.naming.Name中的某些字段无法被序列化，所以在转换成JSON之前需要将DN置null。一种方法是使用@JsonIgnoreProperties标记model类，比如：@JsonIgnoreProperties(“dn”)</li>
<li>对于不需要与LDAP进行映射的字段使用@Transient进行标记</li>
<li>考虑使用org.springframework.ldap.pool.factory.PoolingContextSource引入连接池</li>
<li>如果事务中需要与JDBC进行互操作，需要使用org.springframework.ldap.transaction.compensating.manager.ContextSourceAndDataSourceTransactionManager作为tx manager</li>
</ul>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/12/14/13131/">使用Spring LDAP ODM操作LDAP</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F&title=%E4%BD%BF%E7%94%A8Spring+LDAP+ODM%E6%93%8D%E4%BD%9CLDAP" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F06%2F09%2F2342%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之Hibernate+JBoss Treecache实现Hibernate集群</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之经验教训（一）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F01%2F12%2F13221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">解决Velocity＋Spring的中文乱码问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fspring-party&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">四年一宴 —— 安妮宝贝《春宴》书评 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Ftamaswells-spring-mingyaofeng.html&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">音乐生活&gt;&gt;Tamas Wells | 充满春天气息的民谣风 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fspring-flowers-message-block-information.html&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">春之信息花器留言座 [意外中秋礼物] (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fchuxiong-normal-university&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">大学时候的牢骚 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lzhi.org%2Fviews%2F777023&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">牢骚怨言要远离嘴边 (@lzhi)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/12/14/13131/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</title>
		<link>http://www.jayxu.com/2011/12/02/13128/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e7%25a5%259d%25e8%25b4%25ba%25ef%25bc%259a%25e5%258f%2591%25e5%25b8%2583%25e3%2580%258ajava%25e8%2599%259a%25e6%258b%259f%25e6%259c%25ba%25e8%25a7%2584%25e8%258c%2583-%25ef%25bc%2588java-se-7-%25e4%25b8%25ad%25e6%2596%2587%25e7%2589%2588%25ef%25bc%2589%25e3%2580%258b</link>
		<comments>http://www.jayxu.com/2011/12/02/13128/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 08:14:53 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jvm]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=13128</guid>
		<description><![CDATA[原文转自：http://icyfenix.iteye.com/blog/1256329 《Java虚拟机规范 （Java SE 7 中文版）》是一份根据《Java Virtual Machine Specification （Java SE 7）》翻译的、非官方的、以Open Document形式发布的文档。 本译文由ItEye社区三位水友IcyFenix、wupuyuan、langyu合作完成，我们的翻译工作完全基于技术研究目的，任何人也都可以在以技术研究为目的前提下任意阅读、传播、使用这份文档。但没有得到原文作者和译者授权，不得用于商业出版。 ◎ 全文PDF下载地址：Download （@iteye.com） ◎ 如果没有ItEye账号的朋友，可在此下载：Download （@icyfenix.com） ◎ 译文勘误、更新地址：http://www.icyfenix.com/jvms_javase7_cn 翻译一本书，远远比读完一本书来的辛苦。不过回头看来，那些辛苦比起翻译过程中对自己的提升和认识到的朋友，收获是远远大于付出。如果这本书能再为其他人带来一点方便和用处，那我们就更加欣慰了。如果本书真的对您有用，希望您能： ◎ 向我们反馈本书中翻译的问题，以便我们能持续改进译文的质量。 ◎ 向朋友传播本书（如帮我转发一下此微博），以便我们的工作能发挥更大的价值。 译者序 从1999年4月出版的《Java虚拟机规范（第二版）》至今，已经超过12年，虽然此规范在JDK 5发布的时候作了较大的更新，但却始终没有发布完整的规范。在今年6月28日，最新的《Java虚拟机规范（Java SE 7版）》终于完成并在7月份正式发布。对于想了解Java虚拟机的程序员来说，《Java虚拟机规范》是必须阅读的，对于想深入了解Java语言细节的程序员，阅读《Java虚拟机规范》也有极大好处，但是《Java虚拟机规范》、《Java语言规范》发布十余年，一直没有中文译本，这让中国不少对Java虚拟机感兴趣，但英语能力较弱的程序员都被拒之门外。 在2011年初，《Java虚拟机规范（Java SE 7版）》还是草稿状态时，我就开始关注这本书，并陆续对其中第1、2、6、7章进行了翻译，到2011年9月时完成了200余页的译稿。这时候又在国内著名Java社区ItEye中结识了另外两名译者吴璞渊和冶秀刚，我们在随后的两个多月的时间里共同完成了其余章节的翻译和校对。 《Java虚拟机规范》并非某一款虚拟机实现的说明书，它是一份保证各个公司的Java虚拟机实现具备统一外部接口的契约文档，书中的概念和细节描述曾经与Sun的早期虚拟机的实现高度吻合，但是随着技术的发展，高性能虚拟机真正的细节实现方式已经渐渐与虚拟机规范所描述的内容产生了越来越大的差距。原作者也在书中不同地方反复强调过：虚拟机规范中所提及的“Java虚拟机”皆为虚拟机的概念模型而非具体实现。实现只要保证与概念模型最终等效即可，而具体实现的方式无需受概念模型束缚。因此通过虚拟机规范去分析程序的执行语义问题（虚拟机会做什么）时，但分析程序的执行行为问题（虚拟机是怎样做的、性能如何）则意义不大，如需对具体虚拟机实现进行调优、性能分析等，我推荐在本书基础上继续阅读《Java Performance》和《Oracle JRockit The Definitive Guide》等书。 在翻译过程中，我们尽最大努力保证作品的准确性和可读性，力求在保证语义准确的前提下，尽可能使用通俗易懂的方式向给各位读者介绍Java虚拟机的约束与运作原理。为此目标，我们在专有技术名词、偏僻词中用括号保留了原文、专门在多处读者理解起来可能有困难的地方，添加了“译者注”加以解释。 囿于我们的水平和写作时间，书中难免存在不妥之处，大家如有任何意见或建议都欢迎通过以下邮件地址与我联系：icyfenix@gmail.com。本书的勘误与最新版本可以在以下网址中获取：http://www.icyfenix.com/jvms_javase7_cn/ 最后，请允许我再介绍一下本书三位译者的技术背景与分工： 周志明（www.icyfenix.com &#38; weibo.com/icyfenix）：远光软件平台开发部部门经理，平台架构师，不愿意脱离编码的一线码农。著有《深入理解Java虚拟机：JVM高级特性与最佳实践》。关注各种Java应用，略懂OSGi、Java虚拟机和工作流。在本书翻译工作中负责全文统稿；前言和第1、2、6、7章的翻译；第3、4、5章的校审工作。 吴璞渊（wupuyuan.iteye.com）：就职于西门子，偏向程序和工作流设计，喜好Java各种新技术并倒腾。在本书翻译工作中负责第3章以及第4章的1至7节。。 冶秀刚（langyu.iteye.com）：思科平台工程师，从事分布式系统的研究与开发，爱好Java平台技术且正在努力成长中。在本书翻译工作中负责第5章及第4章的9至11节。 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3426&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">站长的必修课：选购虚拟主机你还在头疼吗？ (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Frtl8191se-linux-driver&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">瑞昱 RTL8191SE Wireless LAN 802.11N PCI-E NIC (RTL8192SE) Linux/BT3/BT4 下安装驱动 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2Farchives%2F85.html&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">VMware曝漏洞:Windows虚拟机可攻击Mac主机 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwordpress-3-3-sonny&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">WordPress 3.3 Sonny 原版已经发布 中文版稍候就来 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>原文转自：<a href="http://icyfenix.iteye.com/blog/1256329" target="_blank">http://icyfenix.iteye.com/blog/1256329</a></p>
<p>《Java虚拟机规范 （Java SE 7 中文版）》是一份根据<a href="http://download.oracle.com/javase/cmn/spec_index.html" target="_blank">《Java Virtual Machine Specification （Java SE 7）》</a>翻译的、非官方的、以Open Document形式发布的文档。</p>
<p>本译文由ItEye社区三位水友<a href="http://icyfenix.iteye.com/" target="_blank">IcyFenix</a>、<a href="http://wupuyuan.iteye.com/" target="_blank">wupuyuan</a>、<a href="http://langyu.iteye.com/" target="_blank">langyu</a>合作完成，<a href="http://icyfenix.iteye.com/blog/1181634" target="_blank">我们的翻译工作</a>完全基于技术研究目的，任何人也都可以在以技术研究为目的前提下任意阅读、传播、使用这份文档。但没有得到原文作者和译者授权，不得用于商业出版。</p>
<p>◎ 全文PDF下载地址：<a href="http://dl.iteye.com/topics/download/643fc75f-fb49-39eb-a5a0-e22ad2240e88" target="_blank">Download</a> （@iteye.com）<br />
◎ 如果没有ItEye账号的朋友，可在此下载：<a href="http://www.icyfenix.com/svn/fileDownload.jsp?url=Java%E8%99%9A%E6%8B%9F%E6%9C%BA%2F%E8%A7%84%E8%8C%83%E6%96%87%E6%A1%A3%2FJava+Virtual+Machine+Specification+Java+SE+7+%E4%B8%AD%E6%96%87%E7%89%88.pdf&amp;attachment=true" target="_blank">Download</a> （@icyfenix.com）<br />
◎ 译文勘误、更新地址：http://www.icyfenix.com/jvms_javase7_cn</p>
<p>翻译一本书，远远比读完一本书来的辛苦。不过回头看来，那些辛苦比起翻译过程中对自己的提升和认识到的朋友，收获是远远大于付出。如果这本书能再为其他人带来一点方便和用处，那我们就更加欣慰了。如果本书真的对您有用，希望您能：</p>
<p>◎ 向我们反馈本书中翻译的问题，以便我们能持续改进译文的质量。<br />
◎ 向朋友传播本书（<a href="http://weibo.com/1887642490/xxjVIf1Aa" target="_blank">如帮我转发一下此微博</a>），以便我们的工作能发挥更大的价值。</p>
<p>译者序</p>
<p>从1999年4月出版的《Java虚拟机规范（第二版）》至今，已经超过12年，虽然此规范在JDK 5发布的时候作了较大的更新，但却始终没有发布完整的规范。在今年6月28日，最新的《Java虚拟机规范（Java SE 7版）》终于完成并在7月份正式发布。对于想了解Java虚拟机的程序员来说，《Java虚拟机规范》是必须阅读的，对于想深入了解Java语言细节的程序员，阅读《Java虚拟机规范》也有极大好处，但是《Java虚拟机规范》、《Java语言规范》发布十余年，一直没有中文译本，这让中国不少对Java虚拟机感兴趣，但英语能力较弱的程序员都被拒之门外。</p>
<p>在2011年初，《Java虚拟机规范（Java SE 7版）》还是草稿状态时，我就开始关注这本书，并陆续对其中第1、2、6、7章进行了翻译，到2011年9月时完成了200余页的译稿。这时候又在国内著名Java社区ItEye中结识了另外两名译者吴璞渊和冶秀刚，我们在随后的两个多月的时间里共同完成了其余章节的翻译和校对。</p>
<p>《Java虚拟机规范》并非某一款虚拟机实现的说明书，它是一份保证各个公司的Java虚拟机实现具备统一外部接口的契约文档，书中的概念和细节描述曾经与Sun的早期虚拟机的实现高度吻合，但是随着技术的发展，高性能虚拟机真正的细节实现方式已经渐渐与虚拟机规范所描述的内容产生了越来越大的差距。原作者也在书中不同地方反复强调过：虚拟机规范中所提及的“Java虚拟机”皆为虚拟机的概念模型而非具体实现。实现只要保证与概念模型最终等效即可，而具体实现的方式无需受概念模型束缚。因此通过虚拟机规范去分析程序的执行语义问题（虚拟机会做什么）时，但分析程序的执行行为问题（虚拟机是怎样做的、性能如何）则意义不大，如需对具体虚拟机实现进行调优、性能分析等，我推荐在本书基础上继续阅读《Java Performance》和《Oracle JRockit The Definitive Guide》等书。</p>
<p>在翻译过程中，我们尽最大努力保证作品的准确性和可读性，力求在保证语义准确的前提下，尽可能使用通俗易懂的方式向给各位读者介绍Java虚拟机的约束与运作原理。为此目标，我们在专有技术名词、偏僻词中用括号保留了原文、专门在多处读者理解起来可能有困难的地方，添加了“译者注”加以解释。</p>
<p>囿于我们的水平和写作时间，书中难免存在不妥之处，大家如有任何意见或建议都欢迎通过以下邮件地址与我联系：icyfenix@gmail.com。本书的勘误与最新版本可以在以下网址中获取：http://www.icyfenix.com/jvms_javase7_cn/</p>
<p>最后，请允许我再介绍一下本书三位译者的技术背景与分工：</p>
<ul>
<li><strong>周志明</strong>（<a href="http://www.icyfenix.com/" target="_blank">www.icyfenix.com</a> &amp; <a href="http://weibo.com/icyfenix" target="_blank">weibo.com/icyfenix</a>）：远光软件平台开发部部门经理，平台架构师，不愿意脱离编码的一线码农。著有《深入理解Java虚拟机：JVM高级特性与最佳实践》。关注各种Java应用，略懂OSGi、Java虚拟机和工作流。在本书翻译工作中负责全文统稿；前言和第1、2、6、7章的翻译；第3、4、5章的校审工作。</li>
<li><strong>吴璞渊</strong>（<a href="http://wupuyuan.iteye.com/" target="_blank">wupuyuan.iteye.com</a>）：就职于西门子，偏向程序和工作流设计，喜好Java各种新技术并倒腾。在本书翻译工作中负责第3章以及第4章的1至7节。。</li>
<li><strong>冶秀刚</strong>（<a href="http://langyu.iteye.com/" target="_blank">langyu.iteye.com</a>）：思科平台工程师，从事分布式系统的研究与开发，爱好Java平台技术且正在努力成长中。在本书翻译工作中负责第5章及第4章的9至11节。</li>
</ul>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/12/02/13128/">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&title=%E7%A5%9D%E8%B4%BA%EF%BC%9A%E5%8F%91%E5%B8%83%E3%80%8AJava%E8%99%9A%E6%8B%9F%E6%9C%BA%E8%A7%84%E8%8C%83+%EF%BC%88Java+SE+7+%E4%B8%AD%E6%96%87%E7%89%88%EF%BC%89%E3%80%8B" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3426&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">站长的必修课：选购虚拟主机你还在头疼吗？ (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Frtl8191se-linux-driver&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">瑞昱 RTL8191SE Wireless LAN 802.11N PCI-E NIC (RTL8192SE) Linux/BT3/BT4 下安装驱动 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2Farchives%2F85.html&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">VMware曝漏洞:Windows虚拟机可攻击Mac主机 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwordpress-3-3-sonny&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">WordPress 3.3 Sonny 原版已经发布 中文版稍候就来 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/12/02/13128/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X and XX Usgaes for Java</title>
		<link>http://www.jayxu.com/2011/09/26/11723/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=x-and-xx-usgaes-for-java</link>
		<comments>http://www.jayxu.com/2011/09/26/11723/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 03:33:18 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=11723</guid>
		<description><![CDATA[-X -Xmixed mixed mode execution (default) -Xint interpreted mode execution only -Xbootclasspath:&#60;directories and zip/jar files separated by ;&#62; set search path for bootstrap classes and resources -Xbootclasspath/a:&#60;directories and zip/jar files separated by ;&#62; append to end of bootstrap class path -Xbootclasspath/p:&#60;directories and zip/jar files separated by ;&#62; prepend in front of bootstrap class path -Xnoclassgc <a href="http://www.jayxu.com/2011/09/26/11723/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<h1>-X</h1>
<table>
<tbody>
<tr>
<td>-Xmixed</td>
<td>mixed mode execution (default)</td>
</tr>
<tr>
<td>-Xint</td>
<td>interpreted mode execution only</td>
</tr>
<tr>
<td>-Xbootclasspath:&lt;directories and zip/jar files separated by ;&gt;</td>
<td>set search path for bootstrap classes and resources</td>
</tr>
<tr>
<td>-Xbootclasspath/a:&lt;directories and zip/jar files separated by ;&gt;</td>
<td>append to end of bootstrap class path</td>
</tr>
<tr>
<td>-Xbootclasspath/p:&lt;directories and zip/jar files separated by ;&gt;</td>
<td>prepend in front of bootstrap class path</td>
</tr>
<tr>
<td>-Xnoclassgc</td>
<td>disable class garbage collection</td>
</tr>
<tr>
<td>-Xincgc</td>
<td>enable incremental garbage collection</td>
</tr>
<tr>
<td>-Xloggc:&lt;file&gt;</td>
<td>log GC status to a file with time stamps</td>
</tr>
<tr>
<td>-Xbatch</td>
<td>disable background compilation</td>
</tr>
<tr>
<td>-Xms&lt;size&gt;</td>
<td>set initial Java heap size</td>
</tr>
<tr>
<td>-Xmx&lt;size&gt;</td>
<td>set maximum Java heap size</td>
</tr>
<tr>
<td>-Xss&lt;size&gt;</td>
<td>set java thread stack size</td>
</tr>
<tr>
<td>-Xprof</td>
<td>output cpu profiling data</td>
</tr>
<tr>
<td>-Xfuture</td>
<td>enable strictest checks, anticipating future default</td>
</tr>
<tr>
<td>-Xrs</td>
<td>reduce use of OS signals by Java/VM (see documentation)</td>
</tr>
<tr>
<td>-Xcheck:jni</td>
<td>perform additional checks for JNI functions</td>
</tr>
<tr>
<td>-Xshare:off</td>
<td>do not attempt to use shared class data</td>
</tr>
<tr>
<td>-Xshare:auto</td>
<td>use shared class data if possible (default)</td>
</tr>
<tr>
<td>-Xshare:on</td>
<td>require using shared class data, otherwise fail.</td>
</tr>
</tbody>
</table>
<h1>-XX</h1>
<table>
<tbody>
<tr>
<td>-XX:-AllowUserSignalHandlers</td>
<td>Do not complain if the application installs signal handlers. (Relevant to Solaris and Linux only.)</td>
</tr>
<tr>
<td>-XX:AltStackSize=16384</td>
<td>Alternate signal stack size (in Kbytes). (Relevant to Solaris only, removed from 5.0.)</td>
</tr>
<tr>
<td>-XX:-DisableExplicitGC</td>
<td>Disable calls to System.gc(), JVM still performs garbage collection when necessary.</td>
</tr>
<tr>
<td>-XX:+FailOverToOldVerifier</td>
<td>Fail over to old verifier when the new type checker fails. (Introduced in 6.)</td>
</tr>
<tr>
<td>-XX:+HandlePromotionFailure</td>
<td>The youngest generation collection does not require a guarantee of full promotion of all live objects. (Introduced in 1.4.2 update 11) [5.0 and earlier: false.]</td>
</tr>
<tr>
<td>-XX:+MaxFDLimit</td>
<td>Bump the number of file descriptors to max. (Relevant to Solaris only.)</td>
</tr>
<tr>
<td>-XX:PreBlockSpin=10</td>
<td>Spin count variable for use with -XX:+UseSpinning. Controls the maximum spin iterations allowed before entering operating system thread synchronization code. (Introduced in 1.4.2.)</td>
</tr>
<tr>
<td>-XX:-RelaxAccessControlCheck</td>
<td>Relax the access control checks in the verifier. (Introduced in 6.)</td>
</tr>
<tr>
<td>-XX:+ScavengeBeforeFullGC</td>
<td>Do young generation GC prior to a full GC. (Introduced in 1.4.1.)</td>
</tr>
<tr>
<td>-XX:+UseAltSigs</td>
<td>Use alternate signals instead of SIGUSR1 and SIGUSR2 for VM internal signals. (Introduced in 1.3.1 update 9, 1.4.1. Relevant to Solaris only.)</td>
</tr>
<tr>
<td>-XX:+UseBoundThreads</td>
<td>Bind user level threads to kernel threads. (Relevant to Solaris only.)</td>
</tr>
<tr>
<td>-XX:-UseConcMarkSweepGC</td>
<td>Use concurrent mark-sweep collection for the old generation. (Introduced in 1.4.1)</td>
</tr>
<tr>
<td>-XX:+UseGCOverheadLimit</td>
<td>Use a policy that limits the proportion of the VM&#8217;s time that is spent in GC before an OutOfMemory error is thrown. (Introduced in 6.)</td>
</tr>
<tr>
<td>-XX:+UseLWPSynchronization</td>
<td>Use LWP-based instead of thread based synchronization. (Introduced in 1.4.0. Relevant to Solaris only.)</td>
</tr>
<tr>
<td>-XX:-UseParallelGC</td>
<td>Use parallel garbage collection for scavenges. (Introduced in 1.4.1)</td>
</tr>
<tr>
<td>-XX:-UseParallelOldGC</td>
<td>Use parallel garbage collection for the full collections. Enabling this option automatically sets -XX:+UseParallelGC. (Introduced in 5.0 update 6.)</td>
</tr>
<tr>
<td>-XX:-UseSerialGC</td>
<td>Use serial garbage collection. (Introduced in 5.0.)</td>
</tr>
<tr>
<td>-XX:-UseSpinning</td>
<td>Enable naive spinning on Java monitor before entering operating system thread synchronizaton code. (Relevant to 1.4.2 and 5.0 only.) [1.4.2, multi-processor Windows platforms: true]</td>
</tr>
<tr>
<td>-XX:+UseTLAB</td>
<td>Use thread-local object allocation (Introduced in 1.4.0, known as UseTLE prior to that.) [1.4.2 and earlier, x86 or with -client: false]</td>
</tr>
<tr>
<td>-XX:+UseSplitVerifier</td>
<td>Use the new type checker with StackMapTable attributes. (Introduced in 5.0.)[5.0: false]</td>
</tr>
<tr>
<td>-XX:+UseThreadPriorities</td>
<td>Use native thread priorities.</td>
</tr>
<tr>
<td>-XX:+UseVMInterruptibleIO</td>
<td>Thread interrupt before or with EINTR for I/O operations results in OS_INTRPT. (Introduced in 6. Relevant to Solaris only.)</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td>-XX:+AggressiveOpts</td>
<td>Turn on point performance compiler optimizations that are expected to be default in upcoming releases. (Introduced in 5.0 update 6.)</td>
</tr>
<tr>
<td>-XX:CompileThreshold=10000</td>
<td>Number of method invocations/branches before compiling [-client: 1,500]</td>
</tr>
<tr>
<td>-XX:LargePageSizeInBytes=4m</td>
<td>Sets the large page size used for the Java heap. (Introduced in 1.4.0 update 1.) [amd64: 2m.]</td>
</tr>
<tr>
<td>-XX:MaxHeapFreeRatio=70</td>
<td>Maximum percentage of heap free after GC to avoid shrinking.</td>
</tr>
<tr>
<td>-XX:MaxNewSize=size</td>
<td>Maximum size of new generation (in bytes). Since 1.4, MaxNewSize is computed as a function of NewRatio. [1.3.1 Sparc: 32m; 1.3.1 x86: 2.5m.]</td>
</tr>
<tr>
<td>-XX:MaxPermSize=64m</td>
<td>Size of the Permanent Generation. [5.0 and newer: 64 bit VMs are scaled 30% larger; 1.4 amd64: 96m; 1.3.1 -client: 32m.]</td>
</tr>
<tr>
<td>-XX:MinHeapFreeRatio=40</td>
<td>Minimum percentage of heap free after GC to avoid expansion.</td>
</tr>
<tr>
<td>-XX:NewRatio=2</td>
<td>Ratio of new/old generation sizes. [Sparc -client: 8; x86 -server: 8; x86 -client: 12.]-client: 4 (1.3) 8 (1.3.1+), x86: 12]</td>
</tr>
<tr>
<td>-XX:NewSize=2.125m</td>
<td>Default size of new generation (in bytes) [5.0 and newer: 64 bit VMs are scaled 30% larger; x86: 1m; x86, 5.0 and older: 640k]</td>
</tr>
<tr>
<td>-XX:ReservedCodeCacheSize=32m</td>
<td>Reserved code cache size (in bytes) &#8211; maximum code cache size. [Solaris 64-bit, amd64, and -server x86: 48m; in 1.5.0_06 and earlier, Solaris 64-bit and and64: 1024m.]</td>
</tr>
<tr>
<td>-XX:SurvivorRatio=8</td>
<td>Ratio of eden/survivor space size [Solaris amd64: 6; Sparc in 1.3.1: 25; other Solaris platforms in 5.0 and earlier: 32]</td>
</tr>
<tr>
<td>-XX:TargetSurvivorRatio=50</td>
<td>Desired percentage of survivor space used after scavenge.</td>
</tr>
<tr>
<td>-XX:ThreadStackSize=512</td>
<td>Thread Stack Size (in Kbytes). (0 means use default stack size) [Sparc: 512; Solaris x86: 320 (was 256 prior in 5.0 and earlier); Sparc 64 bit: 1024; Linux amd64: 1024 (was 0 in 5.0 and earlier); all others 0.]</td>
</tr>
<tr>
<td>-XX:+UseBiasedLocking</td>
<td>Enable biased locking. For more details, see this tuning example. (Introduced in 5.0 update 6.) [5.0: false]</td>
</tr>
<tr>
<td>-XX:+UseFastAccessorMethods</td>
<td>Use optimized versions of Get&lt;Primitive&gt;Field.</td>
</tr>
<tr>
<td>-XX:-UseISM</td>
<td>Use Intimate Shared Memory. [Not accepted for non-Solaris platforms.] For details, see Intimate Shared Memory.</td>
</tr>
<tr>
<td>-XX:+UseLargePages</td>
<td>Use large page memory. (Introduced in 5.0 update 5.) For details, see Java Support for Large Memory Pages.</td>
</tr>
<tr>
<td>-XX:+UseMPSS</td>
<td>Use Multiple Page Size Support w/4mb pages for the heap. Do not use with ISM as this replaces the need for ISM. (Introduced in 1.4.0 update 1, Relevant to Solaris 9 and newer.) [1.4.1 and earlier: false]</td>
</tr>
<tr>
<td>-XX:+UseStringCache</td>
<td>Enables caching of commonly allocated strings.</td>
</tr>
<tr>
<td>-XX:AllocatePrefetchLines=1</td>
<td>Number of cache lines to load after the last object allocation using prefetch instructions generated in JIT compiled code. Default values are 1 if the last allocated object was an instance and 3 if it was an array.</td>
</tr>
<tr>
<td>-XX:AllocatePrefetchStyle=1</td>
<td>Generated code style for prefetch instructions. 0 &#8211; no prefetch instructions are generate*d*, 1 &#8211; execute prefetch instructions after each allocation, 2 &#8211; use TLAB allocation watermark pointer to gate when prefetch instructions are executed.</td>
</tr>
<tr>
<td>-XX:+UseCompressedStrings</td>
<td>Use a byte[] for Strings which can be represented as pure ASCII. (Introduced in Java 6 Update 21 Performance Release)</td>
</tr>
<tr>
<td>-XX:+OptimizeStringConcat</td>
<td>Optimize String concatenation operations where possible. (Introduced in Java 6 Update 20)</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td>-XX:-CITime</td>
<td>Prints time spent in JIT Compiler. (Introduced in 1.4.0.)</td>
</tr>
<tr>
<td>-XX:ErrorFile=./hs_err_pid&lt;pid&gt;.log</td>
<td>If an error occurs, save the error data to this file. (Introduced in 6.)</td>
</tr>
<tr>
<td>-XX:-ExtendedDTraceProbes</td>
<td>Enable performance-impacting dtrace probes. (Introduced in 6. Relevant to Solaris only.)</td>
</tr>
<tr>
<td>-XX:HeapDumpPath=./java_pid&lt;pid&gt;.hprof</td>
<td>Path to directory or filename for heap dump. Manageable. (Introduced in 1.4.2 update 12, 5.0 update 7.)</td>
</tr>
<tr>
<td>-XX:-HeapDumpOnOutOfMemoryError</td>
<td>Dump heap to file when java.lang.OutOfMemoryError is thrown. Manageable. (Introduced in 1.4.2 update 12, 5.0 update 7.)</td>
</tr>
<tr>
<td>-XX:OnError=”&lt;cmd args&gt;;&lt;cmd args&gt;”</td>
<td>Run user-defined commands on fatal error. (Introduced in 1.4.2 update 9.)</td>
</tr>
<tr>
<td>-XX:OnOutOfMemoryError=”&lt;cmd args&gt;; &lt;cmd args&gt;”</td>
<td>Run user-defined commands when an OutOfMemoryError is first thrown. (Introduced in 1.4.2 update 12, 6)</td>
</tr>
<tr>
<td>-XX:-PrintClassHistogram</td>
<td>Print a histogram of class instances on Ctrl-Break. Manageable. (Introduced in 1.4.2.) The jmap -histo command provides equivalent functionality.</td>
</tr>
<tr>
<td>-XX:-PrintConcurrentLocks</td>
<td>Print java.util.concurrent locks in Ctrl-Break thread dump. Manageable. (Introduced in 6.) The jstack -l command provides equivalent functionality.</td>
</tr>
<tr>
<td>-XX:-PrintCommandLineFlags</td>
<td>Print flags that appeared on the command line. (Introduced in 5.0.)</td>
</tr>
<tr>
<td>-XX:-PrintCompilation</td>
<td>Print message when a method is compiled.</td>
</tr>
<tr>
<td>-XX:-PrintGC</td>
<td>Print messages at garbage collection. Manageable.</td>
</tr>
<tr>
<td>-XX:-PrintGCDetails</td>
<td>Print more details at garbage collection. Manageable. (Introduced in 1.4.0.)</td>
</tr>
<tr>
<td>-XX:-PrintGCTimeStamps</td>
<td>Print timestamps at garbage collection. Manageable (Introduced in 1.4.0.)</td>
</tr>
<tr>
<td>-XX:-PrintTenuringDistribution</td>
<td>Print tenuring age information.</td>
</tr>
<tr>
<td>-XX:-TraceClassLoading</td>
<td>Trace loading of classes.</td>
</tr>
<tr>
<td>-XX:-TraceClassLoadingPreorder</td>
<td>Trace all classes loaded in order referenced (not loaded). (Introduced in 1.4.2.)</td>
</tr>
<tr>
<td>-XX:-TraceClassResolution</td>
<td>Trace constant pool resolutions. (Introduced in 1.4.2.)</td>
</tr>
<tr>
<td>-XX:-TraceClassUnloading</td>
<td>Trace unloading of classes.</td>
</tr>
<tr>
<td>-XX:-TraceLoaderConstraints</td>
<td>Trace recording of loader constraints. (Introduced in 6.)</td>
</tr>
<tr>
<td>-XX:+PerfSaveDataToFile</td>
<td>Saves jvmstat binary data on exit.</td>
</tr>
<tr>
<td>-XX:ParallelGCThreads=</td>
<td>Sets the number of garbage collection threads in the young and old parallel garbage collectors. The default value varies with the platform on which the JVM is running.</td>
</tr>
<tr>
<td>-XX:+UseCompressedOops</td>
<td>Enables the use of compressed pointers (object references represented as 32 bit offsets instead of 64-bit pointers) for optimized 64-bit performance with Java heap sizes less than 32gb.</td>
</tr>
<tr>
<td>-XX:+AlwaysPreTouch</td>
<td>Pre-touch the Java heap during JVM initialization. Every page of the heap is thus demand-zeroed during initialization rather than incrementally during application execution.</td>
</tr>
<tr>
<td>-XX:AllocatePrefetchDistance=</td>
<td>Sets the prefetch distance for object allocation. Memory about to be written with the value of new objects is prefetched into cache at this distance (in bytes) beyond the address of the last allocated object. Each Java thread has its own allocation point. The default value varies with the platform on which the JVM is running.</td>
</tr>
<tr>
<td>-XX:InlineSmallCode=</td>
<td>Inline a previously compiled method only if its generated native code size is less than this. The default value varies with the platform on which the JVM is running.</td>
</tr>
<tr>
<td>-XX:MaxInlineSize=35</td>
<td>Maximum bytecode size of a method to be inlined.</td>
</tr>
<tr>
<td>-XX:FreqInlineSize=</td>
<td>Maximum bytecode size of a frequently executed method to be inlined. The default value varies with the platform on which the JVM is running.</td>
</tr>
<tr>
<td>-XX:LoopUnrollLimit=</td>
<td>Unroll loop bodies with server compiler intermediate representation node count less than this value. The limit used by the server compiler is a function of this value, not the actual value. The default value varies with the platform on which the JVM is running.</td>
</tr>
<tr>
<td>-XX:InitialTenuringThreshold=7</td>
<td>Sets the initial tenuring threshold for use in adaptive GC sizing in the parallel young collector. The tenuring threshold is the number of times an object survives a young collection before being promoted to the old, or tenured, generation.</td>
</tr>
<tr>
<td>-XX:MaxTenuringThreshold=</td>
<td>Sets the maximum tenuring threshold for use in adaptive GC sizing. The current largest value is 15. The default value is 15 for the parallel collector and is 4 for CMS.</td>
</tr>
</tbody>
</table>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/09/26/11723/">X and XX Usgaes for Java</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&title=X+and+XX+Usgaes+for+Java" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/09/26/11723/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</title>
		<link>http://www.jayxu.com/2011/09/20/11718/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=differences-among-greedy-reluctant-and-possessive-quantifiers-for-rexexp-in-java</link>
		<comments>http://www.jayxu.com/2011/09/20/11718/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 02:53:26 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[regexp]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=11718</guid>
		<description><![CDATA[There are subtle differences among greedy, reluctant, and possessive quantifiers. Greedy quantifiers are considered “greedy” because they force the matcher to read in, or eat, the entire input string prior to attempting the first match. If the first match attempt (the entire input string) fails, the matcher backs off the input string by one character <a href="http://www.jayxu.com/2011/09/20/11718/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>There are subtle differences among greedy, reluctant, and possessive quantifiers.</p>
<p>Greedy quantifiers are considered “greedy” because they force the matcher to read in, or eat, the entire input string prior to attempting the first match. If the first match attempt (the entire input string) fails, the matcher backs off the input string by one character and tries again, repeating the process until a match is found or there are no more characters left to back off from. Depending on the quantifier used in the expression, the last thing it will try matching against is 1 or 0 characters.</p>
<p>The reluctant quantifiers, however, take the opposite approach: They start at the beginning of the input string, then reluctantly eat one character at a time looking for a match. The last thing they try is the entire input </p>
<p>Finally, the possessive quantifiers always eat the entire input string, trying once (and only once) for a match. Unlike the greedy quantifiers, possessive quantifiers never back off, even if doing so would allow the overall match to succeed.</p>
<p>To illustrate, consider the input string xfooxxxxxxfoo.</p>
<p>Enter your regex: .*foo // greedy quantifier<br />
Enter input string to search: xfooxxxxxxfoo<br />
I found the text “xfooxxxxxxfoo” starting at index 0 and ending at index 13.</p>
<p>Enter your regex: .*?foo // reluctant quantifier<br />
Enter input string to search: xfooxxxxxxfoo<br />
I found the text “xfoo” starting at index 0 and ending at index 4.<br />
I found the text “xxxxxxfoo” starting at index 4 and ending at index 13.</p>
<p>Enter your regex: .*+foo // possessive quantifier<br />
Enter input string to search: xfooxxxxxxfoo<br />
No match found.</p>
<p>The first example uses the greedy quantifier .* to find “anything”, zero or more times, followed by the letters “f” “o” “o”. Because the quantifier is greedy, the .* portion of the expression first eats the entire input string. At this point, the overall expression cannot succeed, because the last three letters (“f” “o” “o”) have already been consumed. So the matcher slowly backs off one letter at a time until the rightmost occurrence of “foo” has been regurgitated, at which point the match succeeds and the search ends.</p>
<p>The second example, however, is reluctant, so it starts by first consuming “nothing”. Because “foo” doesn&#8217;t appear at the beginning of the string, it&#8217;s forced to swallow the first letter (an “x”), which triggers the first match at 0 and 4. Our test harness continues the process until the input string is exhausted. It finds another match at 4 and 13.</p>
<p>The third example fails to find a match because the quantifier is possessive. In this case, the entire input string is consumed by .*+, leaving nothing left over to satisfy the “foo” at the end of the expression. Use a possessive quantifier for situations where you want to seize all of something without ever backing off; it will outperform the equivalent greedy quantifier in cases where the match is not immediately found
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/09/20/11718/">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&title=Differences+Among+Greedy%2C+Reluctant%2C+and+Possessive+Quantifiers+%28for+RexExp+in+Java%29" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/09/20/11718/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于『C++11 中值得关注的几大变化（详解）』</title>
		<link>http://www.jayxu.com/2011/09/01/11690/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%2585%25b3%25e4%25ba%258e%25e3%2580%258ec11-%25e4%25b8%25ad%25e5%2580%25bc%25e5%25be%2597%25e5%2585%25b3%25e6%25b3%25a8%25e7%259a%2584%25e5%2587%25a0%25e5%25a4%25a7%25e5%258f%2598%25e5%258c%2596%25ef%25bc%2588%25e8%25af%25a6%25e8%25a7%25a3%25ef%25bc%2589%25e3%2580%258f</link>
		<comments>http://www.jayxu.com/2011/09/01/11690/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 06:21:29 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[辩]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=11690</guid>
		<description><![CDATA[博客更新得越来越不频繁，一方面是忙+懒，另一方面围脖带来的写作习惯的变化，越来越多的想法使用140字以内的只字片语发布在围脖上。而WP上还 没有像twitter tools一样的围脖反向更新工具，所有的围脖相关工具不是登录绑定就是发博同步至围脖。可见国内互联网产品业余开发人员的同质与乏善可陈，难道要我自己 用PHP去写一个？ 最近发现在team里的一些讨论邮件还是有点意思的，我发表了一些观点，也进行了一些讨论。这些邮件算是一个观点展示、碰撞的积累。今天开始转贴一些，当然前提是非IBM confidential的。以下是第一篇 &#160; C++11 中值得关注的几大变化（详解） 原文出自酷壳 &#160; Me：Like Java &#38; C#, C++ started to introduce many language sugars into the new version 11 (to make the language up-to-date), esp. for Lambda grammar, which is deferred to Java 8. Another highlight is the standard thread lib, wonder if it supports multi-core architecture <a href="http://www.jayxu.com/2011/09/01/11690/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F11%2F295%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">printf(&quot;no title&quot;);</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F06%2F09%2F2342%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之Hibernate+JBoss Treecache实现Hibernate集群</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F31%2F11585%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">他说要给人民一个交代，于是给了人民一个胶带</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F19%2F11711%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">一周tweets更新 [2011-09-19]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F17%2F10237&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有了你之后，我会说“喵~~”</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F417&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">美国之外你应该关注的20家创新公司(下) (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F303&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">美国之外你应该关注的20家创新公司(上) (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fmore-caress&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">作为人 我们需要更多的爱与关注 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fbnu2011-105&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X2 W8 D1 105S 无条件积极关注与爱 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2724&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">关注网站安全，织梦CMS官方推出网站安全在线检测服务 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>博客更新得越来越不频繁，一方面是忙+懒，另一方面围脖带来的写作习惯的变化，越来越多的想法使用140字以内的只字片语发布在围脖上。而WP上还 没有像twitter tools一样的围脖反向更新工具，所有的围脖相关工具不是登录绑定就是发博同步至围脖。可见国内互联网产品业余开发人员的同质与乏善可陈，难道要我自己 用PHP去写一个？</p>
<p>最近发现在team里的一些讨论邮件还是有点意思的，我发表了一些观点，也进行了一些讨论。这些邮件算是一个观点展示、碰撞的积累。今天开始转贴一些，当然前提是非IBM confidential的。以下是第一篇</p>
<p>&nbsp;</p>
<p>C++11 中值得关注的几大变化（详解）</p>
<p>原文出自<a href="http://coolshell.cn/articles/5265.html" target="_blank">酷壳</a></p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Me</span></strong>：Like Java &amp; C#, C++ started to introduce many language sugars into the new version 11 (to make the language up-to-date), esp. for Lambda grammar, which is deferred to Java 8. Another highlight is the standard thread lib, wonder if it supports multi-core architecture well.</p>
<p><span style="text-decoration: underline;"><strong>Jacob</strong></span>：We took so long time to wait this new standard(1998&#8211;&gt;2003&#8211;&gt;2011); And we still need some times to wait the compiler to support them. It is a pity that we did not find new “Regular Expression” at C++11; I think it is a very useful specific. Maybe Boost still can be used for it. “wonder if it supports multi-core architecture well”,I am also wondering. Actually, There are some product can support it well: OpenMP(Intel), VS2010. I guess parallel computing especially GPU is a trend in desktop usage.</p>
<p><span style="text-decoration: underline;"><strong>Me</strong></span>：Agree that more and more programmers have already moved their compute-intensive (C/C++) code to GPU &#8211; which provides much more throughput. Hope Java could provide such feature in the future release.
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/09/01/11690/">关于『C++11 中值得关注的几大变化（详解）』</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F&title=%E5%85%B3%E4%BA%8E%E3%80%8EC%2B%2B11+%E4%B8%AD%E5%80%BC%E5%BE%97%E5%85%B3%E6%B3%A8%E7%9A%84%E5%87%A0%E5%A4%A7%E5%8F%98%E5%8C%96%EF%BC%88%E8%AF%A6%E8%A7%A3%EF%BC%89%E3%80%8F" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F09%2F1752%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">The Future Belongs To The Few Of Us Still Willing To Get Our Hands Dirty</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F29%2F2032%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">别了，sun.com</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F25%2F1892%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X的内存管理策略</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F04%2F2117%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">一周tweets更新 [2010-04-04]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F04%2F06%2F327%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">蹲伟大的友谊，纪念小波</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F417&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">美国之外你应该关注的20家创新公司(下) (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F303&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">美国之外你应该关注的20家创新公司(上) (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fmore-caress&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">作为人 我们需要更多的爱与关注 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fbnu2011-105&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X2 W8 D1 105S 无条件积极关注与爱 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2724&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F01%2F11690%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">关注网站安全，织梦CMS官方推出网站安全在线检测服务 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/09/01/11690/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Use Java 7, For Anything [zz]</title>
		<link>http://www.jayxu.com/2011/08/10/11629/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-use-java-7-for-anything-zz</link>
		<comments>http://www.jayxu.com/2011/08/10/11629/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 08:08:36 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=11629</guid>
		<description><![CDATA[From here. Shit happens, Oracle wanna risk the fame of Java?! &#160; Java 7 GA was released today, but as noted by Uwe Schindler, there are some very frightening bugs in HotSpot Loop optimizations that are enabled by default. In the best case scenario, these bugs cause the JVM to crash. In the worst case <a href="http://www.jayxu.com/2011/08/10/11629/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://www.lucidimagination.com/blog/2011/07/28/dont-use-java-7-for-anything/" target="_blank">here</a>. Shit happens, Oracle wanna risk the fame of Java?!</p>
<p>&nbsp;</p>
<p>Java 7 GA was <a href="http://mail.openjdk.java.net/pipermail/announce/2011-July/000106.html">released today</a>, but as noted by Uwe Schindler, there are some very frightening bugs in HotSpot Loop optimizations that are enabled by default. In the best case scenario, these bugs cause the JVM to crash. In the worst case scenario, they cause incorrect execution of loops.</p>
<p>Bottom Line: <a href="http://www.lucidimagination.com/search/document/1a0d3986e48a9348/warning_index_corruption_and_crashes_in_apache_lucene_core_apache_solr_with_java_7">Don&rsquo;t use Java 7</a> for anything (unless maybe you know you don&rsquo;t have any loops in your java code)</p>
<p><em>From: Uwe Schindler<br />
	Date: Thu, 28 Jul 2011 23:13:36 +0200<br />
	Subject: [WARNING] Index corruption and crashes in Apache Lucene Core / Apache Solr with Java 7</em></p>
<p><em>Hello Apache Lucene &amp; Apache Solr users,<br />
	Hello users of other Java-based Apache projects,</em></p>
<p><em>Oracle released Java 7 today. Unfortunately it contains hotspot compiler<br />
	optimizations, which miscompile some loops. This can affect code of several<br />
	Apache projects. Sometimes JVMs only crash, but in several cases, results<br />
	calculated can be incorrect, leading to bugs in applications (see Hotspot<br />
	bugs 7070134 [1], 7044738 [2], 7068051 [3]).</em></p>
<p><em>Apache Lucene Core and Apache Solr are two Apache projects, which are<br />
	affected by these bugs, namely all versions released until today. Solr users<br />
	with the default configuration will have Java crashing with SIGSEGV as soon<br />
	as they start to index documents, as one affected part is the well-known<br />
	Porter stemmer (see LUCENE-3335 [4]). Other loops in Lucene may be<br />
	miscompiled, too, leading to index corruption (especially on Lucene trunk<br />
	with pulsing codec; other loops may be affected, too &ndash; LUCENE-3346 [5]).</em></p>
<p><em>These problems were detected only 5 days before the official Java 7 release,<br />
	so Oracle had no time to fix those bugs, affecting also many more<br />
	applications. In response to our questions, they proposed to include the<br />
	fixes into service release u2 (eventually into service release u1, see [6]).<br />
	This means you cannot use Apache Lucene/Solr with Java 7 releases before<br />
	Update 2! If you do, please don&rsquo;t open bug reports, it is not the<br />
	committers&rsquo; fault! At least disable loop optimizations using the<br />
	-XX:-UseLoopPredicate JVM option to not risk index corruptions.</em></p>
<p><em>Please note: Also Java 6 users are affected, if they use one of those JVM<br />
	options, which are not enabled by default: -XX:+OptimizeStringConcat or<br />
	-XX:+AggressiveOpts</em></p>
<p><em>It is strongly recommended not to use any hotspot optimization switches in<br />
	any Java version without extensive testing!</em></p>
<p><em>In case you upgrade to Java 7, remember that you may have to reindex, as the<br />
	unicode version shipped with Java 7 changed and tokenization behaves<br />
	differently (e.g. lowercasing). For more information, read<br />
	JRE_VERSION_MIGRATION.txt in your distribution package!</em></p>
<p><em>On behalf of the Lucene project,<br />
	Uwe</em></p>
<p><em>[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7070134<br />
	[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7044738<br />
	[3] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7068051<br />
	[4] https://issues.apache.org/jira/browse/LUCENE-3335<br />
	[5] https://issues.apache.org/jira/browse/LUCENE-3346<br />
	[6] http://s.apache.org/StQ</em></p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/08/10/11629/">Don&#8217;t Use Java 7, For Anything [zz]</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F&title=Don%27t+Use+Java+7%2C+For+Anything+%5Bzz%5D" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F10%2F11629%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/08/10/11629/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>有关Character.isLetter()和Character.isLetterOrDigit()</title>
		<link>http://www.jayxu.com/2010/12/10/10324/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%259c%2589%25e5%2585%25b3character-isletter%25e5%2592%258ccharacter-isletterordigit</link>
		<comments>http://www.jayxu.com/2010/12/10/10324/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 03:27:40 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[apache commons]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=10324</guid>
		<description><![CDATA[在项目中有时候可能需要判断输入的是否全是英文或数字，如果你不善于使用正则，JDK中提供了Character类对字符进行操作，其中的 isLetter和isLetterOrDigit方法貌似可以做到这一点。但是如果你试下下面的代码，你会失望的： System.out.println&#40;Character.isLetter&#40;'中'&#41;&#41;; System.out.println(Character.isLetter('中')); 很不幸地，Java天生提供了对unicode的支持，因此在她眼里中文也是“letter”，所以上面打印出的是true……。替代方案是，使用Apache Commons子项目中的lang库，CharUtils的isAsciiAlpha和isAsciiAlphanumberic可以帮助你只对英文字母进行判断 多说一句，commons项目是个大宝库，其中提供了大量对JDK的增强API，lang库就是对java.lang的增强，比如使用反射生成toString的ToStringBuilder，使用反射生成hashCode的HashCodeBuilder，使用反射生成equals的EqualsBuilder等等，大家可以慢慢自己发掘～ 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 有关Character.isLetter()和Character.isLetterOrDigit()<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2379&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Linux+Apache+PHP+MySQL服务器环境(CentOS篇) (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_8192.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Character公司-回收印刷术 (@ycy8)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2F11&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">安装apache已经成功了！ (@dongdong)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fnginx-web-server&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nginx占有率超过10% 成为屈居apache之后的第二大web服务器 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在项目中有时候可能需要判断输入的是否全是英文或数字，如果你不善于使用正则，JDK中提供了<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Character.html" target="_blank">Character</a>类对字符进行操作，其中的 <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Character.html#isLetter(char)" target="_blank">isLetter</a>和<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Character.html#isLetterOrDigit(char)" target="_blank">isLetterOrDigit</a>方法貌似可以做到这一点。但是如果你试下下面的代码，你会失望的：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="kw3">Character</span>.<span class="me1">isLetter</span><span class="br0">&#40;</span><span class="st0">'中'</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">System.out.println(Character.isLetter('中'));</pre></div></div>

<p>很不幸地，Java天生提供了对unicode的支持，因此在她眼里中文也是“letter”，所以上面打印出的是true……。替代方案是，使用<a href="http://commons.apache.org/" target="_blank">Apache Commons</a>子项目中的<a href="http://commons.apache.org/lang/" target="_blank">lang</a>库，<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/CharUtils.html" target="_blank">CharUtils</a>的<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/CharUtils.html#isAsciiAlpha(char)" target="_blank">isAsciiAlpha</a>和<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/CharUtils.html#isAsciiAlphanumeric(char)" target="_blank">isAsciiAlphanumberic</a>可以帮助你只对英文字母进行判断</p>
<p>多说一句，commons项目是个大宝库，其中提供了大量对JDK的增强API，lang库就是对java.lang的增强，比如使用反射生成toString的<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/builder/ToStringBuilder.html" target="_blank">ToStringBuilder</a>，使用反射生成hashCode的<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/builder/HashCodeBuilder.html" target="_blank">HashCodeBuilder</a>，使用反射生成equals的<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/builder/EqualsBuilder.html" target="_blank">EqualsBuilder</a>等等，大家可以慢慢自己发掘～
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/12/10/10324/">有关Character.isLetter()和Character.isLetterOrDigit()</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F&title=%E6%9C%89%E5%85%B3Character.isLetter%28%29%E5%92%8CCharacter.isLetterOrDigit%28%29" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2379&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Linux+Apache+PHP+MySQL服务器环境(CentOS篇) (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_8192.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Character公司-回收印刷术 (@ycy8)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2F11&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">安装apache已经成功了！ (@dongdong)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fnginx-web-server&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nginx占有率超过10% 成为屈居apache之后的第二大web服务器 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/12/10/10324/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何在Hibernate中让SQLServer使用nvarchar代替varchar</title>
		<link>http://www.jayxu.com/2010/11/23/10275/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e5%259c%25a8hibernate%25e4%25b8%25ad%25e8%25ae%25a9sqlserver%25e4%25bd%25bf%25e7%2594%25a8nvarchar%25e4%25bb%25a3%25e6%259b%25bfvarchar</link>
		<comments>http://www.jayxu.com/2010/11/23/10275/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 08:19:38 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[dialect]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlserver]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=10275</guid>
		<description><![CDATA[有关SQLServer中varchar和nvarchar的区别可以直接去google。一般在中文系统中应该使用nvarchar作为字符串的对应类型，但是Hibernate中的默认实现SQLServerDialect使用了varchar。以下方法可以简单地转为使用nvarchar： 自己写一个dialect，继承SQLServerDialect，在构造器中将原先varchar类型的注册声明覆盖： registerColumnType&#40;Types.VARCHAR, &#34;nvarchar($l)&#34;&#41;; registerColumnType(Types.VARCHAR, "nvarchar($l)"); 千万注意，“$”后面的是字段长度的占位符，是“l(ength)”，而不是数字“1”（因为看hibernate的doc时没分清“l”和“1”，浪费了我一上午去找原因） 然后在hibernate的配置文件中将hibernate.dialect的值设为你的dialect实现类就OK了 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 如何在Hibernate中让SQLServer使用nvarchar代替varchar<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F15%2F13164%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">About save/persist, update/merge in JPA/Hibernate</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F06%2F09%2F2342%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之Hibernate+JBoss Treecache实现Hibernate集群</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F24%2F10280%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">谨慎升级至Hibernate 3.6</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">小心Derby的ResultSet陷阱</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fsql-wordpress-keywords&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL 查询包含某些文字的内容 如wordpress查询所有带图片的文章 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1967&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">用过SQL语句获取织梦DedeCMS每个栏目各有多少文章 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2Farchives%2F173.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL语句导入导出大全 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D316&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">利用SQL语句删除或修改织梦DedeCms数据库内容 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>有关SQLServer中varchar和nvarchar的区别可以直接去google。一般在中文系统中应该使用nvarchar作为字符串的对应类型，但是Hibernate中的默认实现SQLServerDialect使用了varchar。以下方法可以简单地转为使用nvarchar：</p>
<p>自己写一个dialect，继承SQLServerDialect，在构造器中将原先varchar类型的注册声明覆盖：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">registerColumnType<span class="br0">&#40;</span><span class="kw3">Types</span>.<span class="me1">VARCHAR</span>, <span class="st0">&quot;nvarchar($l)&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">registerColumnType(Types.VARCHAR, "nvarchar($l)");</pre></div></div>

<p>千万注意，“$”后面的是字段长度的占位符，是“l(ength)”，而不是数字“1”（因为看hibernate的doc时没分清“l”和“1”，浪费了我一上午去找原因）</p>
<p>然后在hibernate的配置文件中将hibernate.dialect的值设为你的dialect实现类就OK了
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/11/23/10275/">如何在Hibernate中让SQLServer使用nvarchar代替varchar</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F&title=%E5%A6%82%E4%BD%95%E5%9C%A8Hibernate%E4%B8%AD%E8%AE%A9SQLServer%E4%BD%BF%E7%94%A8nvarchar%E4%BB%A3%E6%9B%BFvarchar" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F15%2F13164%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">About save/persist, update/merge in JPA/Hibernate</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F06%2F09%2F2342%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之Hibernate+JBoss Treecache实现Hibernate集群</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F24%2F10280%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">谨慎升级至Hibernate 3.6</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">小心Derby的ResultSet陷阱</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fsql-wordpress-keywords&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL 查询包含某些文字的内容 如wordpress查询所有带图片的文章 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1967&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">用过SQL语句获取织梦DedeCMS每个栏目各有多少文章 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2Farchives%2F173.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL语句导入导出大全 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D316&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">利用SQL语句删除或修改织梦DedeCms数据库内容 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/11/23/10275/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>误区！double类型做加减法不会有误差？</title>
		<link>http://www.jayxu.com/2010/08/25/2401/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e8%25af%25af%25e5%258c%25ba%25ef%25bc%2581double%25e7%25b1%25bb%25e5%259e%258b%25e5%2581%259a%25e5%258a%25a0%25e5%2587%258f%25e6%25b3%2595%25e4%25b8%258d%25e4%25bc%259a%25e6%259c%2589%25e8%25af%25af%25e5%25b7%25ae%25ef%25bc%259f</link>
		<comments>http://www.jayxu.com/2010/08/25/2401/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 02:36:08 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://jayxu.com/?p=2401</guid>
		<description><![CDATA[如果你跟我一样以为Java的double类型只有在作乘除法时才会出现误差，那试一下在Java里执行一下下面的代码： public static void &#160;main&#40;String&#91;&#93; args&#41; &#123; &#160; &#160; System.out.println&#40;44.42 + 710.79 + 44.42 + &#160;88.85&#41;; &#125; public static void main(String[] args) { System.out.println(44.42 + 710.79 + 44.42 + 88.85); } 执行前先猜一下结果，是会输出888.48么？还是……？ 建议：对于和钱有关的计算，不论加减乘除，统一使用 BigDecimal！ 然而不多久之后同事告诉我另一个BigDecimal的问题，试一下下面的代码： System.out.println&#40;new BigDecimal&#40;0.99&#41;.setScale&#40;2, RoundingMode.DOWN&#41;.toString&#40;&#41;&#41;; System.out.println(new BigDecimal(0.99).setScale(2, RoundingMode.DOWN).toString()); 结果是令人发指的0.98！ 看了一下 BigDecimal(double)的源码，其中使用位操作分别提取了0.99浮点值的整数部分和纯小数部分，或者说是2的正数次幂和负数次幂部分。而这样提取出来的值纯小数部分本身就是近似的，与直接使用double类型没有本质区别，这是浮点表示法决定的，再经过2位截取后就产生了误差 而当使用BigDecimal(String)的构造器时得到的是精确值，因为该构造器将数字使用科学计数法表示，即 0.99表示为99*10^-2，这样做运算时先对齐至相同的整数位再进行计算 因此，对上面的补充是：如果要获取最精确的结果，请使用BD+字符串类型的构造器 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 误区！double类型做加减法不会有误差？<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>如果你跟我一样以为Java的double类型只有在作乘除法时才会出现误差，那试一下在Java里执行一下下面的代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> &nbsp;main<span class="br0">&#40;</span><span class="kw3">String</span><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="nu0">44.42</span> <span class="sy0">+</span> <span class="nu0">710.79</span> <span class="sy0">+</span> <span class="nu0">44.42</span> <span class="sy0">+</span> &nbsp;<span class="nu0">88.85</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public static void  main(String[] args) {
    System.out.println(44.42 + 710.79 + 44.42 +  88.85);
}</pre></div></div>

<p>执行前先猜一下结果，是会输出888.48么？还是……？</p>
<blockquote><p>建议：对于和钱有关的计算，不论加减乘除，统一使用 BigDecimal！</p></blockquote>
<p>然而不多久之后同事告诉我另一个BigDecimal的问题，试一下下面的代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="kw1">new</span> <span class="kw3">BigDecimal</span><span class="br0">&#40;</span><span class="nu0">0.99</span><span class="br0">&#41;</span>.<span class="me1">setScale</span><span class="br0">&#40;</span><span class="nu0">2</span>, RoundingMode.<span class="me1">DOWN</span><span class="br0">&#41;</span>.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">System.out.println(new BigDecimal(0.99).setScale(2, RoundingMode.DOWN).toString());</pre></div></div>

<p>结果是令人发指的0.98！</p>
<p>看了一下 BigDecimal(double)的源码，其中使用位操作分别提取了0.99浮点值的整数部分和纯小数部分，或者说是2的正数次幂和负数次幂部分。而这样提取出来的值纯小数部分本身就是近似的，与直接使用double类型没有本质区别，这是浮点表示法决定的，再经过2位截取后就产生了误差</p>
<p>而当使用BigDecimal(String)的构造器时得到的是精确值，因为该构造器将数字使用科学计数法表示，即 0.99表示为99*10^-2，这样做运算时先对齐至相同的整数位再进行计算</p>
<blockquote><p>因此，对上面的补充是：如果要获取最精确的结果，请使用BD+字符串类型的构造器</p></blockquote>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/08/25/2401/">误区！double类型做加减法不会有误差？</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&title=%E8%AF%AF%E5%8C%BA%EF%BC%81double%E7%B1%BB%E5%9E%8B%E5%81%9A%E5%8A%A0%E5%87%8F%E6%B3%95%E4%B8%8D%E4%BC%9A%E6%9C%89%E8%AF%AF%E5%B7%AE%EF%BC%9F" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/08/25/2401/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java程序员必看电影：Java 4-ever</title>
		<link>http://www.jayxu.com/2010/08/11/2396/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java%25e7%25a8%258b%25e5%25ba%258f%25e5%2591%2598%25e5%25bf%2585%25e7%259c%258b%25e7%2594%25b5%25e5%25bd%25b1%25ef%25bc%259ajava-4-ever</link>
		<comments>http://www.jayxu.com/2010/08/11/2396/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 12:08:47 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[程序员]]></category>

		<guid isPermaLink="false">http://jayxu.com/?p=2396</guid>
		<description><![CDATA[.net算个毛！ 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Java程序员必看电影：Java 4-ever<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>.net算个毛！</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="src" value="http://player.youku.com/player.php/sid/XMTg0OTc2Mzk2/v.swf" /><param name="quality" value="high" /><embed type="application/x-shockwave-flash" width="480" height="400" src="http://player.youku.com/player.php/sid/XMTg0OTc2Mzk2/v.swf" quality="high" align="middle"></embed></object>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/08/11/2396/">Java程序员必看电影：Java 4-ever</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&title=Java%E7%A8%8B%E5%BA%8F%E5%91%98%E5%BF%85%E7%9C%8B%E7%94%B5%E5%BD%B1%EF%BC%9AJava+4-ever" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/08/11/2396/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>有关Runtime.addShutdownHook(Thread)</title>
		<link>http://www.jayxu.com/2010/03/29/2101/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%259c%2589%25e5%2585%25b3runtime-addshutdownhookthread</link>
		<comments>http://www.jayxu.com/2010/03/29/2101/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 12:38:31 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[thread]]></category>

		<guid isPermaLink="false">http://jayxu.com/2010/03/29/2101/</guid>
		<description><![CDATA[今天在JDK的javadoc里瞎转的时候无意间发现这么一个有趣的回调方法： addShutdownHook public void &#60;b&#62;addShutdownHook&#60;/b&#62;&#40;&#60;a href=&#34;http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html&#34; title=&#34;class in java.lang&#34;&#62;Thread&#60;/a&#62; hook&#41; public void &#60;b&#62;addShutdownHook&#60;/b&#62;(&#60;a href="http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html" title="class in java.lang"&#62;Thread&#60;/a&#62; hook) Registers a new virtual-machine shutdown hook. The Java virtual machine shuts down in response to two kinds of events: The program exits normally, when the last non-daemon thread exits or when the exit (equivalently, System.exit) method is <a href="http://www.jayxu.com/2010/03/29/2101/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天在JDK的javadoc里瞎转的时候无意间发现这么一个有趣的回调方法：</p>
<blockquote>
<h3> addShutdownHook</h3>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw4">void</span> <span class="sy0">&lt;</span>b<span class="sy0">&gt;</span>addShutdownHook<span class="sy0">&lt;/</span>b<span class="sy0">&gt;</span><span class="br0">&#40;</span><span class="sy0">&lt;</span>a href<span class="sy0">=</span><span class="st0">&quot;http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html&quot;</span> title<span class="sy0">=</span><span class="st0">&quot;class in java.lang&quot;</span><span class="sy0">&gt;</span>Thread<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span> hook<span class="br0">&#41;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public void &lt;b&gt;addShutdownHook&lt;/b&gt;(&lt;a href="http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html" title="class in java.lang"&gt;Thread&lt;/a&gt; hook)</pre></div></div>

<dl>
<dd>
<p>Registers a new virtual-machine shutdown hook.</p>
<p> The Java virtual machine <i>shuts down</i> in response to two kinds of events:    </p>
<ul>
<li> The program <i>exits</i> normally, when the last  non-daemon   thread exits or when the <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html"><code>exit</code></a></tt> (equivalently,   <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/System.html"><code>System.exit</code></a></tt>) method is invoked, or
</p>
</li>
<li> The virtual machine is <i>terminated</i> in  response to a   user interrupt, such as typing <tt>^C</tt>, or a system-wide event,   such as user logoff or system shutdown.    </li>
</ul>
<p> A <i>shutdown hook</i> is simply an initialized but unstarted thread.  When the virtual machine begins its shutdown sequence it will start all registered shutdown hooks in some unspecified order and let them run concurrently.  When all the hooks have finished it will then run all uninvoked finalizers if finalization-on-exit has been enabled. Finally, the virtual machine will halt.  Note that daemon threads will continue to run during the shutdown sequence, as will non-daemon  threads if shutdown was initiated by invoking the <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html"><code>exit</code></a></tt> method.  </p>
<p> Once the shutdown sequence has begun it can be stopped only by invoking the <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html"><code>halt</code></a></tt> method, which forcibly terminates the virtual machine.  </p>
<p> Once the shutdown sequence has begun it is impossible to  register a new shutdown hook or de-register a previously-registered hook. Attempting either of these operations will cause an <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html" title="class in java.lang"><code>IllegalStateException</code></a></tt>  to be thrown.  </p>
<p> Shutdown hooks run at a delicate time in the life cycle of a  virtual machine and should therefore be coded defensively.  They should, in particular, be written to be thread-safe and to avoid deadlocks insofar as possible.  They should also not rely blindly upon services that may have registered their own shutdown hooks and therefore may themselves  in the process of shutting down.  Attempts to use other thread-based services such as the AWT event-dispatch thread, for example, may lead  to deadlocks.  </p>
<p> Shutdown hooks should also finish their work quickly.  When a program invokes <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html"><code>exit</code></a></tt> the expectation is that the virtual machine will promptly shut down and exit.  When the virtual machine is terminated due to user logoff or system shutdown the underlying operating system may only allow a fixed amount of time in which to shut down and exit.  It is therefore inadvisable to attempt  any user interaction or to perform a long-running computation in a shutdown hook.  </p>
<p> Uncaught exceptions are handled in shutdown hooks just as in  any other thread, by invoking the <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/ThreadGroup.html"><code>uncaughtException</code></a></tt> method of the thread&#8217;s <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/ThreadGroup.html" title="class in java.lang"><code>ThreadGroup</code></a></tt> object.   The default implementation of this method prints the exception&#8217;s stack trace to <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/System.html"><code>System.err</code></a></tt> and terminates the thread; it does not cause the virtual machine to exit or halt.  </p>
<p> In rare circumstances the virtual machine may <i>abort</i>,  that is, stop running without shutting down cleanly.  This occurs when the virtual machine is terminated externally, for example with the <tt>SIGKILL</tt> signal on Unix or the <tt>TerminateProcess</tt> call  on Microsoft Windows.  The virtual machine may also abort if a native method goes awry by, for example, corrupting internal data structures  or attempting to access nonexistent memory.  If the virtual machine aborts then no guarantee can be made about whether or not any shutdown hooks will be run. </p>
</p>
</dd>
<dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>hook</code> &#8211; An initialized but  unstarted <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html" title="class in java.lang"><code>Thread</code></a></tt> object </dd>
<dt><b>Throws:</b> </dt>
<dd><code><a href="http://java.sun.com/javase/6/docs/api/java/lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> &#8211; If the specified hook has already been registered,          or if it can be determined that the hook is already running or          has already been run </dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html" title="class in java.lang">IllegalStateException</a></code> &#8211; If the  virtual machine is already in the process          of shutting down </dd>
<dd><code><a href="http://java.sun.com/javase/6/docs/api/java/lang/SecurityException.html" title="class in java.lang">SecurityException</a></code> &#8211; If a security manager is present and it denies          <tt><a href="http://download.oracle.com/javase/6/docs/api/java/lang/RuntimePermission.html" title="class in java.lang"><code>RuntimePermission</code></a>("shutdownHooks")</tt></dd>
<dt><b>Since:</b></dt>
<dd>1.3</dd>
<dt><b>See Also:</b></dt>
<dd><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html"><code>removeShutdownHook(java.lang.Thread)</code></a>,  <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html"><code>halt(int)</code></a>,  <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html"><code>exit(int)</code></a></dd>
</dl>
</dd>
</dl>
</blockquote>
<p>即可以在runtime对象上注册一个回调方法，该方法会在JVM退出时执行传入的线程对象。在mac下试了一下，当调用System.exit()、使用系统kill命令杀掉java进程时该方法都会被调用。但是需要注意的是，当调用kill -9杀进程时，方法不被调用，JVM直接退出，Ｗindows下还没试过，不知道结果如何</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/03/29/2101/">有关Runtime.addShutdownHook(Thread)</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F&title=%E6%9C%89%E5%85%B3Runtime.addShutdownHook%28Thread%29" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F29%2F2101%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/03/29/2101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>植树节，写棵二叉树庆祝一下</title>
		<link>http://www.jayxu.com/2010/03/12/2090/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%25a4%258d%25e6%25a0%2591%25e8%258a%2582%25ef%25bc%258c%25e5%2586%2599%25e6%25a3%25b5%25e4%25ba%258c%25e5%258f%2589%25e6%25a0%2591%25e5%25ba%2586%25e7%25a5%259d%25e4%25b8%2580%25e4%25b8%258b</link>
		<comments>http://www.jayxu.com/2010/03/12/2090/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 09:41:49 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[binary tree]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://jayxu.com/?p=2090</guid>
		<description><![CDATA[今天下午看见一条推 RT: @rtmeme: RT @foxzzz RT @junyu: 看到 @windbreaker 老师在Buzz说：今天是植树节，写一棵二叉树庆祝之 (via @yangfannet) 于是兴起，花了半个多小时写了棵自认为（从工程而非算法上）比较牛逼的排序二叉树 package com.jayxu; import java.util.Iterator; import java.util.Random; import java.util.Stack; /** * * @author ijay */ public class BinaryTree implements Iterable { private static final char[] FIRST_CHAR = {'B', 'C', 'K', 'F', 'D', 'G'}; private static final char[] FOLLOWING_CHAR = {'a', 'k', 'l', 'p', <a href="http://www.jayxu.com/2010/03/12/2090/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天下午看见一条推</p>
<blockquote><p>RT: @rtmeme: RT @foxzzz RT @junyu: 看到 @windbreaker 老师在Buzz说：今天是植树节，写一棵二叉树庆祝之 (via @yangfannet)</p></blockquote>
<p>于是兴起，花了半个多小时写了棵自认为（从工程而非算法上）比较牛逼的排序二叉树</p>
<pre lang="java" line="1">
package com.jayxu;

import java.util.Iterator;
import java.util.Random;
import java.util.Stack;

/**
 *
 * @author ijay
 */
public class BinaryTree<t extends Comparable<t>> implements Iterable<t> {
    private static final char[] FIRST_CHAR = {'B', 'C', 'K', 'F', 'D', 'G'};
    private static final char[] FOLLOWING_CHAR = {'a', 'k', 'l', 'p', 'r', 't',
        'n', 'm', 's', 'e'};
    private static Random r = new Random(System.currentTimeMillis());
    private TreeNode root;

    public void addNode(T value) {
        root = addToNode(root, value);
    }

    private TreeNode addToNode(TreeNode node, T value) {
        if (node == null) {
            node = new TreeNode();
            node.value = value;
        } else if (value.compareTo(node.value) <= 0) {
            node.left = addToNode(node.left, value);
        } else {
            node.right = addToNode(node.right, value);
        }

        return node;
    }

    public Iterator<t> iterator() {
        return new PreOrderIterator();
    }

    private class TreeNode {
        TreeNode left;
        TreeNode right;
        T value;
    }

    private class PreOrderIterator implements Iterator<t> {
        private Stack
<treeNode> stack = new Stack
<treeNode>();

        private PreOrderIterator() {
            TreeNode current = root;

            while (current != null) {
                stack.push(current);
                current = current.left;
            }
        }

        public boolean hasNext() {
            return !stack.isEmpty();
        }

        public T next() {
            TreeNode n = stack.pop();

            TreeNode current = n.right;
            while (current != null) {
                stack.push(current);
                current = current.left;
            }

            return n.value;
        }

        public void remove() {
            throw new UnsupportedOperationException();
        }
    }

    public static void main(String[] args) {
        for (int i = 8; i < Integer.MAX_VALUE; i *= 2) {
            buildNTraverseTree(buildRawStrings(i), false);
        }
    }

    private static String[] buildRawStrings(int capacity) {
        String[] s = new String[capacity];

        s[0] = "Jay";
        s[1] = "Blader";
        s[2] = "Fred";
        s[3] = "Gavin";
        s[4] = "Alex";

        for (int i = 5; i < capacity; i++) {
            StringBuilder sb = new StringBuilder();

            sb.append(FIRST_CHAR[r.nextInt(FIRST_CHAR.length)]);

            int len = r.nextInt(10);
            for (int j = 0; j < len; j++) {
                sb.append(FOLLOWING_CHAR[r.nextInt(FOLLOWING_CHAR.length)]);
            }

            s[i] = sb.toString();
        }

        return s;
    }

    private static void buildNTraverseTree(String[] strings, boolean output) {
        System.out.print("Current capacity: " + strings.length + "\t");
        long start = System.currentTimeMillis();

        BinaryTree<string> tree = new BinaryTree<string>();

        for (String s : strings) {
            tree.addNode(s);
        }

        for (String s : tree) {
            if (output) {
                System.out.println(s);
            }
        }

        System.out.println("took " + (System.currentTimeMillis() - start)
                + " ms");
    }
}
</pre>
<p>该树特点：</p>
<ul>
<li>使用泛型</li>
<li>实现Iterable接口从而能够使用增强for循环遍历</li>
<li>实现非递归中序遍历</li>
<li>生成随机数据测试</li>
</ul>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/03/12/2090/">植树节，写棵二叉树庆祝一下</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F&title=%E6%A4%8D%E6%A0%91%E8%8A%82%EF%BC%8C%E5%86%99%E6%A3%B5%E4%BA%8C%E5%8F%89%E6%A0%91%E5%BA%86%E7%A5%9D%E4%B8%80%E4%B8%8B" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F12%2F2090%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/03/12/2090/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Snow Leopard下的JDK链接有问题</title>
		<link>http://www.jayxu.com/2010/01/26/2031/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=snow-leopard%25e4%25b8%258b%25e7%259a%2584jdk%25e9%2593%25be%25e6%258e%25a5%25e6%259c%2589%25e9%2597%25ae%25e9%25a2%2598</link>
		<comments>http://www.jayxu.com/2010/01/26/2031/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 09:51:11 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://jayxu.com/2010/01/26/2031/</guid>
		<description><![CDATA[今天在SL下build JRex，在执行ant make的时候总是出现以下错误： compile: [javac] Compiling 86 source files to /Users/ijay/Projects/mozilla/embedding/JRex/classes [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:38: ?????? sun.plugin.javascript ?????? [javac] import sun.plugin.javascript.JSContext; [javac] ^ [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:172: ?????? sun.plugin.javascript ?????? [javac] if (c instanceof sun.plugin.javascript.JSContext) [javac] ^ [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:174: ?Ҳ??????? [javac] ???ţ? ?? JSContext [javac] λ?ã? ?? netscape.javascript.JSObject [javac] JSContext j = (JSContext) c; [javac] ^ [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:174: ?Ҳ??????? <a href="http://www.jayxu.com/2010/01/26/2031/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F08%2F24%2F1711%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Snow Leopard终于要来了~~</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关64位Snow Leopard</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F30%2F1487%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard下的RSS Visualizer（屏保）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F10%2F29%2F26%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard入驻</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F03%2F1730%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Bootcamp 3.0 torrent</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天在SL下build <a href="http://jrex.mozdev.org/index.html" target="_blank">JRex</a>，在执行ant make的时候总是出现以下错误：</p>
<blockquote><p>
compile:<br />
    [javac] Compiling 86 source files to /Users/ijay/Projects/mozilla/embedding/JRex/classes<br />
    [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:38: ?????? sun.plugin.javascript ??????<br />
    [javac] import sun.plugin.javascript.JSContext;<br />
    [javac]                             ^<br />
    [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:172: ?????? sun.plugin.javascript ??????<br />
    [javac] 		    if (c instanceof sun.plugin.javascript.JSContext)<br />
    [javac] 		                                          ^<br />
    [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:174: ?Ҳ???????<br />
    [javac] ???ţ? ?? JSContext<br />
    [javac] λ?ã? ?? netscape.javascript.JSObject<br />
    [javac] 			JSContext j = (JSContext) c;<br />
    [javac] 			^<br />
    [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:174: ?Ҳ???????<br />
    [javac] ???ţ? ?? JSContext<br />
    [javac] λ?ã? ?? netscape.javascript.JSObject<br />
    [javac] 			JSContext j = (JSContext) c;<br />
    [javac] 			               ^<br />
    [javac] 4 ????</p>
<p>BUILD FAILED
</p></blockquote>
<p>检查了一下build.xml引入的JRex.properties，其中有一行内容如下：</p>
<blockquote><p>classpath		=${build};${java.home}/lib/plugin.jar;${java.home}/lib/deploy.jar;${java.home}/lib/jaws.jar </p></blockquote>
<p>于是又挨个去找那几个jar包（其中“plugin.jar”最像），最终发现了问题：/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib/plugin.jar（即“${java.home}/lib/plugin.jar”）是一个符号链接，指向“/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/Deploy.bundle/Contents/Home/lib/plugin2.jar”，而plugin2.jar不存在……<br />
把原先的符号链接删除，重建链接指向&#8230;/plugin.jar，问题解决<br />
已向apple提交该<a href="https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/110/wo/XJZavPdtHBSoMTJHofGkoM/5.79.28.0.9" target="_blank">bug</a>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/01/26/2031/">Snow Leopard下的JDK链接有问题</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F&title=Snow+Leopard%E4%B8%8B%E7%9A%84JDK%E9%93%BE%E6%8E%A5%E6%9C%89%E9%97%AE%E9%A2%98" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F08%2F24%2F1711%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Snow Leopard终于要来了~~</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关64位Snow Leopard</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F30%2F1487%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard下的RSS Visualizer（屏保）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F10%2F29%2F26%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard入驻</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F03%2F1730%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Bootcamp 3.0 torrent</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/01/26/2031/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>java.net论坛被黑（有图有真相）</title>
		<link>http://www.jayxu.com/2009/12/15/1947/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-net%25e8%25ae%25ba%25e5%259d%259b%25e8%25a2%25ab%25e9%25bb%2591%25ef%25bc%2588%25e6%259c%2589%25e5%259b%25be%25e6%259c%2589%25e7%259c%259f%25e7%259b%25b8%25ef%25bc%2589</link>
		<comments>http://www.jayxu.com/2009/12/15/1947/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 14:48:58 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/?p=1947</guid>
		<description><![CDATA[从今天中午开始java.net论坛被黑，所有标题、内容变成了“RED EYE OWNZ &#8211; by Z4i0n”，一直到现在都没恢复，Sun在干啥呢？ 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: java.net论坛被黑（有图有真相）<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2F%3Fp%3D226&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">百度被黑 2010-1.11 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3429&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">解析网站被挂黑链就会被降权吗 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3430&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">案例分析之论坛签名外链真实效果 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2427&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">庆祝织梦官方论坛成功升级，论坛调整说明 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>从今天中午开始<a href="http://forums.java.net/jive/index.jspa?categoryID=1" target="_blank">java.net论坛</a>被黑，所有标题、内容变成了“RED EYE OWNZ &#8211; by Z4i0n”，一直到现在都没恢复，Sun在干啥呢？</p>
<p><a href="http://www.jayxu.com/log/wp-content/uploads/2009/12/Fullscreen.png"><img class="alignnone size-medium wp-image-1946" title="Fullscreen" src="http://www.jayxu.com/log/wp-content/uploads/2009/12/Fullscreen-480x239.png" alt="" width="480" height="239" /></a>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/12/15/1947/">java.net论坛被黑（有图有真相）</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&title=java.net%E8%AE%BA%E5%9D%9B%E8%A2%AB%E9%BB%91%EF%BC%88%E6%9C%89%E5%9B%BE%E6%9C%89%E7%9C%9F%E7%9B%B8%EF%BC%89" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2F%3Fp%3D226&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">百度被黑 2010-1.11 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3429&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">解析网站被挂黑链就会被降权吗 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3430&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">案例分析之论坛签名外链真实效果 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2427&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">庆祝织梦官方论坛成功升级，论坛调整说明 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/12/15/1947/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Apache给EJB 3.1（JSR #318）投了否决票</title>
		<link>http://www.jayxu.com/2009/12/02/1899/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=apache%25e7%25bb%2599ejb-3-1%25ef%25bc%2588jsr-318%25ef%25bc%2589%25e6%258a%2595%25e4%25ba%2586%25e5%2590%25a6%25e5%2586%25b3%25e7%25a5%25a8</link>
		<comments>http://www.jayxu.com/2009/12/02/1899/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 16:49:51 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ejb]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jsr]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/12/02/1899/</guid>
		<description><![CDATA[刚才在Glassfish的Google Group上收到有关Apache在EJB 3.1 JSR表决上投了否决票的消息。过去看了一下，发现只有Apache投了否决票，Eclipse、Spring弃权，而且Apache的理由相当牛逼： On 2009-11-30 Apache Software Foundation voted No with the following comment: The Apache Software Foundation&#8217;s vote is based on the point of view that this spec lead &#8211; Sun &#8211; is in violation of the JSPA http://www.apache.org/jcp/sunopenletter.html and therefore shouldn&#8217;t be allowed to lead other JSRs until the above matter is <a href="http://www.jayxu.com/2009/12/02/1899/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F11%2F23%2F13076%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Ubuntu下启用Apache rewrite mod</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Character.isLetter()和Character.isLetterOrDigit()</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F29%2F2032%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">别了，sun.com</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>刚才在Glassfish的Google Group上收到有关Apache在EJB 3.1 JSR表决上投了否决票的消息。<a target="_blank" href="http://www.jcp.org/en/jsr/results?id=5029">过去</a>看了一下，发现只有Apache投了否决票，Eclipse、Spring弃权，而且Apache的理由相当牛逼：</p>
<blockquote><p>
On 2009-11-30 Apache Software Foundation voted No with the following comment:<br />
The Apache Software Foundation&#8217;s vote is based on the point of view that this spec lead &#8211; Sun &#8211; is in violation of the JSPA</p>
<p>http://www.apache.org/jcp/sunopenletter.html</p>
<p>and therefore shouldn&#8217;t be allowed to lead other JSRs until the above matter is resolved.</p>
<p>This vote is not a comment on the technical merits of the JSR.  If not for the issue of the spec lead, the ASF would have otherwise voted “yes”.
</p></blockquote>
<p>于是又围观了一下<a target="_blank" href="http://www.apache.org/jcp/sunopenletter.html">那封</a>公开信，不亏是Apache，邮件的口气都不一样，比如开头：</p>
<blockquote><p>My name is Geir Magnusson Jr, and I&#8217;m the officer of the Apache Software Foundation (ASF), a 501(c)3 public charity, charged with matters relating to our participation in the Java Community Process (JCP).  I am also the VP of the Apache Harmony project. In this matter I represent the ASF.
</p></blockquote>
<p>还有结尾：</p>
<blockquote><p>We expect you to offer an acceptable, JSPA-compliant license to us within 30 days, or provide a public explanation of why you cannot do so.
</p></blockquote>
<p>继续关注EJB 3.1的相关发展……
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/12/02/1899/">Apache给EJB 3.1（JSR #318）投了否决票</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&title=Apache%E7%BB%99EJB+3.1%EF%BC%88JSR+%23318%EF%BC%89%E6%8A%95%E4%BA%86%E5%90%A6%E5%86%B3%E7%A5%A8" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F11%2F23%2F13076%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Ubuntu下启用Apache rewrite mod</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Character.isLetter()和Character.isLetterOrDigit()</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F29%2F2032%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">别了，sun.com</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/12/02/1899/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 things all JAVA developers should know [zz]</title>
		<link>http://www.jayxu.com/2009/11/11/1809/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=10-things-all-java-developers-should-know-zz</link>
		<comments>http://www.jayxu.com/2009/11/11/1809/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 04:06:08 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/11/11/1809/</guid>
		<description><![CDATA[原文在这里 Since JAVA (I know it&#8217;s not an acronym, but it stands out like that) was officially introduced in 1995, it has changed the way most of us look at the Operating System. Bill Gate (how ironic) once said that it was not about the hardware but the software which will be the future. A <a href="http://www.jayxu.com/2009/11/11/1809/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>原文在<a href="http://armelnene.blogspot.com/2009/11/10-things-all-java-developers-should.html" target="_blank">这里</a></p>
<p>Since JAVA (I know it&#8217;s not an acronym, but it stands out like that) was officially introduced in 1995, it has changed the way most of us look at the Operating System. Bill Gate (how ironic) once said that it was not about the hardware but the software which will be the future. A decade or more later, the fifth employee of SUN, John Gage said “The Network is the Computer”. Fast-forwarding to the 21st century and John seemed to be right. Anyway, JAVA was built not to depend on an Operating System and deployed through the network. JAVA through its applet technology gave birth to Rich Network Application aka Rich Internet Application (RIA). JAVA is not perfect; or we would not have various releases and more on the way, but JAVA has given birth to a wide range of programming language (just Google it to find out more). Without further ado, I am going to get back to subject. This is a brief<br />
article on what I believe that every Java developers should know regardless of their experience. I do not personally believe that someone with 5 years experience is not as good as someone with 10 years experience. We all develop our own methods of working but as a developer you need to stay abreast of your technology. So, here are my top 10 not in order of importance (or?):</p>
<ol>
<li><strong>Remember the basic of JAVA language and OOP paradigm.</strong>Most experience developers seem to forget the theory behind the language. I am not saying that they are not good at their job but can they explain to junior developers why they have used interfaces instead of abstract classes or why implement a pattern over another one? As a programmer, you become very arrogant as you believe that you write the best code but in the real world, people work in teams with different skill set and experiences. It is important that you can backup your actions/ codes. A very simple question such as; when should I use a String object instead of a StringBuilder/ StringBuffer? You might take this question lightly but can you actually tell someone else the<br />
difference?</li>
<li><strong>Know your technology stack</strong>All developers have to know their technology stack. What does it mean? JAVA is not like other languages; JAVA has subsets such J2ME and superset such as Java EE. We have our own area of expertise but it is important to know the differences between the various sets of JAVA. Some basic questions such as the differences between SWING, Applet,<br />
Servlets, EJBs and JAVAFX will boost your confidence. Most developers do not know how to tweak the JVM and the differences between the JRE and the SDK environment. Do you know why you need the SDK to be installed to run Tomcat but you only need the JRE to run an application?</li>
<li><strong>Experiment with various Java EE framework</strong>I am not asking you to be an expert in every single Java EE framework but it will make the difference if you are familiar with Spring and EJB. That should actually be the de facto framework that should be on every developers CV. Developers should know the difference between Java EE 5 (soon 6) and Spring. Hibernate is also brilliant and it&#8217;s used for data access but all developers should have moved to JPA by now. Hibernate also comply with JPA therefore there is no more excuses.</li>
<li><strong>Know a scripting language</strong>JAVA can be heavyweight for some simple tasks which can be implemented using a simple dynamic language such as Python, Perl(?) and others. I would also recommend to developers to learn shell scripting on their target OS.</li>
<li><strong>Know how to develop web services</strong>The network is the computer, therefore it is important to know the different web services framework available. Data are integrated through web services and opening your services to the “cloud”. SWING developers will probably not develop web services but I am sure that they will be connecting to data through web services clients. Understanding the difference between the standardised SOAP and non-standardised ReST will help you choose which is best to implement your services.</li>
<li><strong>Know how and when to multithread your application</strong>I have to put that in there. Developers should know when and why to multithread an application, thread inter-communication and monitoring. All developers, junior or not, should know how to write a multi-threaded application.</li>
<li><strong>Database development using JDBC and JPA</strong>This should be a development law. All developers should know how to write SQL queries and how to create databases. All enterprise applications store data in some sort of relational database systems and it is therefore imperative that this knowledge should be of second nature. Java EE 5 introduced JPA (JDO was there before) but it is not<br />
applicable to all situation. Hence, knowing the difference and when to implement one instead of the other is important.</li>
<li><strong>Know a client side scripting language and what is AJAX</strong>The network is the computer and Internet is the deployment platform. Java EE and its various framework are server side executiong which can put extra “load” on the server. If you are looking to move a cloud based system where the providers charges you per resources used, it might be wise to move some of the execution to the client side. AJAX<br />
has been buzzing the scene for the last 3 years and more. This is not a technology but a new way of doing something that already existed. There are numerous JAVA AJAX framework such as GWT and DWR which makes it easy to develop AJAX based application which are compiled to JavaScript. Developers should also know what is the AJAX theories.</li>
<li><strong>Know your competitors and do not take part on “what is the best IDE” discussion</strong>JAVA is not the only language that can do what it does. I think that JAVA is more mature and complete as opposed to other languages. Knowing the difference between JAVA and .NET or JAVA and Ruby is a good asset to have. You also need to know when and why to use one instead of the other. Please please please, do not get into “my IDE is better than x because&#8230;” discussion as it is good for the JAVA community to have multiple IDEs and framework available to use. Every tools have their place as for example JDeveloper is better than x if you are going to solely develop on an Oracle stack and etc&#8230;</li>
<li><strong>Know ANT (MAVEN?), TOMCAT and any other mainstrean application server</strong>ANT is the de facto build script for JAVA and its IDE-based development. Maven is becoming popular and soon can be as popular as ANT (not sure of its popularity in the financial sector). TOMCAT should be immortalised as the based servlet container that all developers should be familiar with.</li>
</ol>
<p>There are alot more to add but this is just some of the basics that I think all developers should have in their repertoire. Feel free to add to this list in the comments box. If I could had another one to this, would be; all developers not just JAVA, should know how to search the web and Google is your best friends (<strong>now support my advertisers by clicking on the links on the right <img src='http://www.jayxu.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </strong> ). I hope you enjoyed the entry and feel free to comments good or bad!!! are welcome.
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/11/11/1809/">10 things all JAVA developers should know [zz]</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&title=10+things+all+JAVA+developers+should+know+%5Bzz%5D" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F02%2F13128%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">祝贺：发布《Java虚拟机规范 （Java SE 7 中文版）》</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/11/11/1809/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlockingQueue与InterruptedException</title>
		<link>http://www.jayxu.com/2009/11/10/1807/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=blockingqueue%25e4%25b8%258einterruptedexception</link>
		<comments>http://www.jayxu.com/2009/11/10/1807/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 05:10:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[concurrent]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/?p=1807</guid>
		<description><![CDATA[感谢Blader同学的抛砖 首先，这段代码会编译成功吗，运行起来会有异常吗，他会打印什么？ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; &#160; public class Foo &#123; &#160; &#160;public static void main&#40;String&#91;&#93; args&#41; throws InterruptedException &#123; &#160; &#160; &#160; &#160;BlockingQueue q = new LinkedBlockingQueue&#40;&#41;; &#160; &#160; &#160; &#160;q.put&#40;1&#41;; &#160; &#160; &#160; &#160;Thread.currentThread&#40;&#41;.interrupt&#40;&#41;; &#160; &#160; &#160; &#160;System.out.println&#40;q.take&#40;&#41;&#41;; &#160; &#160;&#125; &#125; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; public class Foo { public static void main(String[] <a href="http://www.jayxu.com/2009/11/10/1807/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>感谢Blader同学的抛砖</p>
<p>首先，这段代码会编译成功吗，运行起来会有异常吗，他会打印什么？</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">import</span> <span class="co2">java.util.concurrent.BlockingQueue</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="kw1">import</span> <span class="co2">java.util.concurrent.LinkedBlockingQueue</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2"><span class="kw1">public</span> <span class="kw1">class</span> Foo <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp;<span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> main<span class="br0">&#40;</span><span class="kw3">String</span><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span> <span class="kw1">throws</span> <span class="kw3">InterruptedException</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;BlockingQueue q <span class="sy0">=</span> <span class="kw1">new</span> LinkedBlockingQueue<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;q.<span class="me1">put</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw3">Thread</span>.<span class="me1">currentThread</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">interrupt</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>q.<span class="me1">take</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp;<span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class Foo {
   public static void main(String[] args) throws InterruptedException {
       BlockingQueue q = new LinkedBlockingQueue();
       q.put(1);
       Thread.currentThread().interrupt();
       System.out.println(q.take());
   }
}</pre></div></div>

<p>运行后结果如下：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">Exception</span> in thread <span class="st0">&quot;main&quot;</span> java.<span class="me1">lang</span>.<span class="kw3">InterruptedException</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at java.<span class="me1">util</span>.<span class="me1">concurrent</span>.<span class="me1">locks</span>.<span class="me1">AbstractQueuedSynchronizer</span>.<span class="me1">acquireInterruptibly</span><span class="br0">&#40;</span>AbstractQueuedSynchronizer.<span class="me1">java</span><span class="sy0">:</span><span class="nu0">1135</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at java.<span class="me1">util</span>.<span class="me1">concurrent</span>.<span class="me1">locks</span>.<span class="me1">ReentrantLock</span>.<span class="me1">lockInterruptibly</span><span class="br0">&#40;</span>ReentrantLock.<span class="me1">java</span><span class="sy0">:</span><span class="nu0">312</span><span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at java.<span class="me1">util</span>.<span class="me1">concurrent</span>.<span class="me1">LinkedBlockingQueue</span>.<span class="me1">take</span><span class="br0">&#40;</span>LinkedBlockingQueue.<span class="me1">java</span><span class="sy0">:</span><span class="nu0">354</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at Foo.<span class="me1">main</span><span class="br0">&#40;</span>Foo.<span class="me1">java</span><span class="sy0">:</span><span class="nu0">9</span><span class="br0">&#41;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">Exception in thread "main" java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1135)
	at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:312)
	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:354)
	at Foo.main(Foo.java:9)</pre></div></div>

<p>看了一下源代码，阻塞队列的访问方法（take、put、poll、offer）会在执行之前检查Lock对象的中断标记，而Lock对象则是检查当前线程的中断标记
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/11/10/1807/">BlockingQueue与InterruptedException</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F&title=BlockingQueue%E4%B8%8EInterruptedException" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F10%2F1807%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/11/10/1807/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which GlassFish version is right for me? [zz]</title>
		<link>http://www.jayxu.com/2009/07/18/1570/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=which-glassfish-version-is-right-for-me-zz</link>
		<comments>http://www.jayxu.com/2009/07/18/1570/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 17:57:55 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/07/18/1570/</guid>
		<description><![CDATA[GlassFish has several versions that you may have heard of. Each one attempts to address different needs. I&#8217;ve had several people in the last couple of weeks ask me which one they should use, so here&#8217;s a quick list of features and reasons to use one more than the other. • GlassFish v2.1: current JavaEE <a href="http://www.jayxu.com/2009/07/18/1570/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关使用asadmin启动Glassfish的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F10%2F2412%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在CLI下更新Glassfish</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F27%2F2424%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关PWC4011: Unable to set request character encoding to UTF-8</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>GlassFish has several versions that you may have heard of. Each one attempts to address different needs. I&#8217;ve had several people in the last couple of weeks ask me which one they should use, so here&#8217;s a quick list of features and reasons to use one more than the other.</p>
<p>• <strong>GlassFish v2.1</strong>: current JavaEE 5-certified and supported product. Offers centralized admin, clustering. v2.0 was released in September 2007 and v2.1 in March 2009 with the <a href="http://blogs.oracle.com/nazrul/entry/glassfish_enterprise_manager">Enterprise Manager</a> value add. All major IDE&#8217;s (NetBeans, Eclipse, IntelliJ) have <a href="http://glassfishplugins.java.net/">plugins</a> to deploy to this version. GlassFish v2.1 update 3 is the latest version available for supported customers.</p>
<p>• <strong>GlassFish v3 Prelude</strong>: interesting if you want a lightweight Java EE 5 web container (no EJB, JMS, etc&#8230;) with admin tools. This is the first release using the modular OSGi architecture, IPS packaging format, and developer features such as <a href="http://blogs.oracle.com/jluehe/entry/retain_session_data_during_redeployment">preserve session across redeployments</a>. This was released in November 2008 and is a <a href="http://www.oracle.com/us/sun/index.htm">supported product</a> (although not a long-lived as traditional software at Sun). It also offers native deployment of <a href="http://java.net/projects/glassfish-scripting/">Grails and Rails</a> applications. Some people use this version in development and deploy to v2.1.</p>
<p>• <strong>GlassFish v3 Preview</strong>: while not yet a supported product, this is a more recent version building on the same foundation as the above “Prelude” version, only it now offers both a Web distribution and a full Java EE 6 (Preview) distribution. It has a number of improvements over the “Prelude” version (IPS and updatetool for instance) and certainly much closer to a fully-featured application server. The final version should ship in September 2009 and offer a JavaEE 6, single-instance architecture. At that point this will become a supported product. The centralized administration will come in the v3.1 release which will mean feature parity with v2.1. If you like bleeding edge stuff, promoted builds for v3 are <a href="http://dlc.sun.com.edgesuite.net/glassfish/v3/promoted/">here</a>.</p>
<p>For more details on the releases, including sustaining (restricted) releases, please visit <a href="http://blogs.oracle.com/GlassFishForBusiness/">http://blogs.sun.com/GlassFishForBusiness/ </a>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/07/18/1570/">Which GlassFish version is right for me? [zz]</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F&title=Which+GlassFish+version+is+right+for+me%3F+%5Bzz%5D" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关使用asadmin启动Glassfish的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F10%2F2412%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在CLI下更新Glassfish</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F27%2F2424%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关PWC4011: Unable to set request character encoding to UTF-8</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/07/18/1570/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun 卖了……</title>
		<link>http://www.jayxu.com/2009/04/20/1477/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sun%25e5%258d%2596%25e7%25bb%2599oracle%25e4%25ba%2586%25e2%2580%25a6%25e2%2580%25a6</link>
		<comments>http://www.jayxu.com/2009/04/20/1477/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 14:06:15 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/04/20/1477/</guid>
		<description><![CDATA[刚刚得到的消息，Oracle收购了Sun，9.5刀一股，一共74亿 这里是Oracle的官方声明 这里是Sun的声明 这里是一篇国外新闻 接下来的时间就看Sun和Oracle的重复部分如何整合（或者舍弃）了 MySQL VS Oracle DB GlassFish VS WebLogic（不知道之前为什么买了BEA） JDK VS JRockit JDeveloper VS Netbeans 红色 VS 蓝色 关注中…… 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Sun 卖了……<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F29%2F2032%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">别了，sun.com</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F10%2F2412&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在CLI下更新Glassfish</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F16%2F2420%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Sun Pinyin开发团队接受China Daily采访</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><img src="http://jayxu.com/log/wp-content/uploads/2009/04/hp1v3-announcement.jpg" alt="" width="539" height="218" /></p>
<p>刚刚得到的消息，Oracle收购了Sun，9.5刀一股，一共74亿</p>
<ul>
<li><a href="http://www.oracle.com/us/sun/index.htm" target="_blank">这里</a>是Oracle的官方声明</li>
<li><a href="http://www.oracle.com/us/sun/index.htm" target="_blank">这里</a>是Sun的声明</li>
<li><a href="http://www.foxbusiness.com/story/markets/industries/technology/oracle-pays-xx-billion-sun-microsystems/" target="_blank">这里</a>是一篇国外新闻</li>
</ul>
<p>接下来的时间就看Sun和Oracle的重复部分如何整合（或者舍弃）了</p>
<ul>
<li> MySQL VS Oracle DB</li>
<li> GlassFish VS WebLogic（不知道之前为什么买了BEA）</li>
<li> JDK VS JRockit</li>
<li> JDeveloper VS Netbeans</li>
<li> 红色 VS 蓝色</li>
</ul>
<p>关注中……
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/04/20/1477/">Sun 卖了……</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F&title=Sun+%E5%8D%96%E4%BA%86%E2%80%A6%E2%80%A6" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F29%2F2032%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">别了，sun.com</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F10%2F2412%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在CLI下更新Glassfish</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F16%2F2420%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F20%2F1477%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Sun Pinyin开发团队接受China Daily采访</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/04/20/1477/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>遍历Map&lt;K, Collection&lt;V&gt;&gt;的正确方法</title>
		<link>http://www.jayxu.com/2009/03/24/1456/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e9%2581%258d%25e5%258e%2586map%25e7%259a%2584%25e6%25ad%25a3%25e7%25a1%25ae%25e6%2596%25b9%25e6%25b3%2595</link>
		<comments>http://www.jayxu.com/2009/03/24/1456/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 14:10:24 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/03/24/1456/</guid>
		<description><![CDATA[对于value为集合的map，一般直觉上我们可能会选用下面的方式遍历map中所有collection的所有对象： for(K key:map.keySet()){ for(V value:map.get(key)){ // do sth. } } 实际上，这种方式在第二行上会因为对哈希表的查询浪费效率，正确的做法应该这样： for&#40;List&#60;v&#62; list:map.values&#40;&#41;&#41;&#123; &#160; &#160; for&#40;V o:list&#41;&#123; &#160; &#160; &#160; &#160; // do sth. &#160; &#160; &#125; &#125; for(List&#60;v&#62; list:map.values()){ for(V o:list){ // do sth. } } 或者 for&#40;Map.Entry&#60;k,List&#60;v&#62;&#62; entry:map.entrySet&#40;&#41;&#41;&#123; &#160; &#160; for&#40;V o:entry.getValue&#40;&#41;&#41;&#123; &#160; &#160; &#160; &#160; // do sth. &#160; &#160; &#125; &#125; <a href="http://www.jayxu.com/2009/03/24/1456/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F544&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Google Maps 之父话当年 (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fkitchen-large-collecting-plate.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">厨房餐盘大搜罗 9月搜罗第一季 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F561&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Android版Google地图更新暴露Zagat收购案的司马昭之心 (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.mianfeidi.com%2F2011%2Fthemeforest-reviewit.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">来自ThemeForest的经典ReviewIT主题 (@mianfeidi)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>对于value为集合的map，一般直觉上我们可能会选用下面的方式遍历map中所有collection的所有对象：</p>
<pre line="1" lang="java">
for(K key:map.keySet()){
    for(V value:map.get(key)){
        // do sth.
    }
}
</pre>
<p>实际上，这种方式在第二行上会因为对哈希表的查询浪费效率，正确的做法应该这样：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">for</span><span class="br0">&#40;</span>List<span class="sy0">&lt;</span>v<span class="sy0">&gt;</span> list<span class="sy0">:</span>map.<span class="me1">values</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span>V o<span class="sy0">:</span>list<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// do sth.</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">for(List&lt;v&gt; list:map.values()){
    for(V o:list){
        // do sth.
    }
}</pre></div></div>

<p>或者</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">for</span><span class="br0">&#40;</span><span class="kw3">Map</span>.<span class="me1">Entry</span><span class="sy0">&lt;</span>k,List<span class="sy0">&lt;</span>v<span class="sy0">&gt;&gt;</span> entry<span class="sy0">:</span>map.<span class="me1">entrySet</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span>V o<span class="sy0">:</span>entry.<span class="me1">getValue</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// do sth.</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">for(Map.Entry&lt;k,List&lt;v&gt;&gt; entry:map.entrySet()){
    for(V o:entry.getValue()){
        // do sth.
    }
}</pre></div></div>

<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/03/24/1456/">遍历Map&lt;K, Collection&lt;V&gt;&gt;的正确方法</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F&title=%E9%81%8D%E5%8E%86Map%26lt%3BK%2C+Collection%26lt%3BV%26gt%3B%26gt%3B%E7%9A%84%E6%AD%A3%E7%A1%AE%E6%96%B9%E6%B3%95" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F544&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Google Maps 之父话当年 (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fkitchen-large-collecting-plate.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">厨房餐盘大搜罗 9月搜罗第一季 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F561&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Android版Google地图更新暴露Zagat收购案的司马昭之心 (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lzhi.org%2Fviews%2F636&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F24%2F1456%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">职场沟通八大黄金句型 (@lzhi)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/03/24/1456/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>慎用LinkedXxxx集合</title>
		<link>http://www.jayxu.com/2009/03/05/1441/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%2585%258e%25e7%2594%25a8linkedxxxx%25e9%259b%2586%25e5%2590%2588</link>
		<comments>http://www.jayxu.com/2009/03/05/1441/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 08:58:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[内存泄露]]></category>
		<category><![CDATA[调优]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/03/05/1441/</guid>
		<description><![CDATA[这两天发现项目中有个模块有内存泄露，512 MB的堆内存大概在5个小时左右被耗尽。通过NB的profiler跟踪可以看到如下结果： java.util.concurrent.LinkedBlockingQueue.Node对象尽然占了一多半。在实时profile中发现即使限定了list的capacity并且在不断调用take方法（相当于remove）时，Node的alive object数量仍在不断增长（照理说在某个时间节点后alive object数量应该增长得很缓慢，因为take的Node对象会被GC）。将LinkedBlockingQueue换成ArrayBlockingQueue后问题解决。继而发现LinkedList有同样的问题，于是得出结论： LinkedXxxx集合的remove、take，甚至clear方法不会导致被挪出队列的node马上被标记为可GC，可能会经过一个很长的时间（generation数量相当大） 由1推测LinkedXxxx的实现可能有内存泄露，或者JVM的GC算法可能有缺陷 由1、2得出经验：在集合内容需要做频繁替换（不断add/remove或者put/take）且程序运行时间很长的情况下最好不要使用LinkedXxxx，应该用ArrayXxxx替代并且指定capacity 补：感谢blader的补充，这个问题果然是个bug：http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6460501 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 慎用LinkedXxxx集合<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart中的TimeSeries可能导致内存泄露</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">让Struts 2性能提升一个数量级的的5个步骤 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3194&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">热点解读：个人信息是如何泄露的呢？ (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F719&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">优士网发布“一周年成就图谱” (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fmall.ycy8.net%2F2011_269.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">幸福时光可调光小马灯 (@ycy8)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_11768.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">毛阿敏个人专辑- 腔·调 (@ycy8)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>这两天发现项目中有个模块有内存泄露，512 MB的堆内存大概在5个小时左右被耗尽。通过NB的profiler跟踪可以看到如下结果：<a href="http://jayxu.com/log/wp-content/uploads/2009/03/profiler.png"><img class="size-medium wp-image-1443 alignnone" title="profiler" src="http://jayxu.com/log/wp-content/uploads/2009/03/profiler-480x146.png" alt="profiler" width="480" height="146" /></a><br />
java.util.concurrent.LinkedBlockingQueue.Node对象尽然占了一多半。在实时profile中发现即使限定了list的capacity并且在不断调用take方法（相当于remove）时，Node的alive object数量仍在不断增长（照理说在某个时间节点后alive object数量应该增长得很缓慢，因为take的Node对象会被GC）。将LinkedBlockingQueue换成ArrayBlockingQueue后问题解决。继而发现LinkedList有同样的问题，于是得出结论：</p>
<ol>
<li>LinkedXxxx集合的remove、take，甚至clear方法不会导致被挪出队列的node马上被标记为可GC，可能会经过一个很长的时间（generation数量相当大）</li>
<li>由1推测LinkedXxxx的实现可能有内存泄露，或者JVM的GC算法可能有缺陷</li>
<li>由1、2得出经验：在集合内容需要做频繁替换（不断add/remove或者put/take）且程序运行时间很长的情况下最好不要使用LinkedXxxx，应该用ArrayXxxx替代并且指定capacity</li>
</ol>
<p>补：感谢blader的补充，这个问题果然是个bug：<a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6460501" target="_blank">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6460501</a>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/03/05/1441/">慎用LinkedXxxx集合</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F&title=%E6%85%8E%E7%94%A8LinkedXxxx%E9%9B%86%E5%90%88" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart中的TimeSeries可能导致内存泄露</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">让Struts 2性能提升一个数量级的的5个步骤 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3194&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">热点解读：个人信息是如何泄露的呢？ (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F719&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">优士网发布“一周年成就图谱” (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fmall.ycy8.net%2F2011_269.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">幸福时光可调光小马灯 (@ycy8)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_11768.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">毛阿敏个人专辑- 腔·调 (@ycy8)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/03/05/1441/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java RMI中的NoSuchObjectException</title>
		<link>http://www.jayxu.com/2009/03/02/1425/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-rmi%25e4%25b8%25ad%25e7%259a%2584nosuchobjectexception</link>
		<comments>http://www.jayxu.com/2009/03/02/1425/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 03:08:17 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rmi]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/03/02/1425/</guid>
		<description><![CDATA[最近项目里的RMI在Linux下运行老出问题，而且问题出得还很不稳定。那个程序启动时会分别在4个端口上绑定4个相同的对象，结果就是有时绑定成功3个，有时候才1个……查看log，抛出下面异常 java.rmi.NoSuchObjectException: no such object in table 上网搜了一下，这篇文章给出了原因和解决方法：我在代码中做RMI绑定的时候用的是局部变量： registry.rebind&#40;name, UnicastRemoteObject.exportObject&#40;new RemoteObject&#40;&#41;, 0&#41;&#41;; registry.rebind(name, UnicastRemoteObject.exportObject(new RemoteObject(), 0)); 该局部变量在服务器端被GC后客户端再远程调用方法便会抛出上述异常。解决方法很简单，使用对远程对象的强引用以防止对象被GC，比如把局部引用改为类静态引用 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Java RMI中的NoSuchObjectException<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近项目里的RMI在Linux下运行老出问题，而且问题出得还很不稳定。那个程序启动时会分别在4个端口上绑定4个相同的对象，结果就是有时绑定成功3个，有时候才1个……查看log，抛出下面异常</p>
<blockquote><p>java.rmi.NoSuchObjectException: no such object in table</p></blockquote>
<p>上网搜了一下，<a href="http://forums.oracle.com" target="_blank">这篇</a>文章给出了原因和解决方法：我在代码中做RMI绑定的时候用的是局部变量：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">registry.<span class="me1">rebind</span><span class="br0">&#40;</span>name, <span class="kw3">UnicastRemoteObject</span>.<span class="me1">exportObject</span><span class="br0">&#40;</span><span class="kw1">new</span> <span class="kw3">RemoteObject</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">registry.rebind(name, UnicastRemoteObject.exportObject(new RemoteObject(), 0));</pre></div></div>

<p>该局部变量在服务器端被GC后客户端再远程调用方法便会抛出上述异常。解决方法很简单，使用对远程对象的强引用以防止对象被GC，比如把局部引用改为类静态引用
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/03/02/1425/">Java RMI中的NoSuchObjectException</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&title=Java+RMI%E4%B8%AD%E7%9A%84NoSuchObjectException" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/03/02/1425/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Tomcat 6中使用log4j</title>
		<link>http://www.jayxu.com/2009/01/20/1354/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%259c%25a8tomcat-6%25e4%25b8%25ad%25e4%25bd%25bf%25e7%2594%25a8log4j</link>
		<comments>http://www.jayxu.com/2009/01/20/1354/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 04:15:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[log4j]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/01/20/1354/</guid>
		<description><![CDATA[Tomcat 6之前，在web应用中使用log4j还算容易，只要将log4j的jar包和相应的配置文件扔到项目的class path就齐活了。但是从6开始，一切变得如此复杂…… 根据Tomcat 6 的官方文档，默认tomcat用的是JDK的logging框架，并配以“精简版”的common logging框架，即不支持common logging的底层框架自动切换功能，要使用log4j也就不可能了。要使用上述功能，需要使用“完整版”的common logging，而这个完整版的jar包apache上不提供下载，需要“自己编译tomcat代码”-_-&#124;&#124;&#124;，具体步骤如下： 当然，你必须得有JDK、ant、SVN（如果你直接下载源代码包，可以不需要SVN） 从http://svn.apache.org/repos/asf/tomcat/tc6.0.x/ check out代码 执行ant download 执行ant（这里提一句，源代码的编码为utf8，直接编译的话会扔一堆warning，只要改一下ant脚本里的javac task就好了，加上encoding=”utf8&#8243;） 执行ant -f extras.xml 将output/extras/tomcat-juli.jar覆盖到tomcat的bin目录下 将output/extras/tomcat-juli-adapters.jar拷到tomcat的lib目录下 在lib目录下写tomcat的全局log4j配置 在你的web项目中放入log4j.jar和log4j.properties(.xml) 附： tomcat-juli.jar tomcat-juli-adapters.jar 使用utf8编译的build.xml 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 在Tomcat 6中使用log4j<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何配置Tomcat数据库连接池</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwp_wpmm_log&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">关于 wordpress 数据库多出一个 wp_wpmm_log 表结构的说明 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fiphone-4-%25E5%25A4%259A%25E5%258A%259F%25E8%2583%25BD%25E5%2588%259B%25E6%2584%258F%25E9%259F%25B3%25E5%2593%258D%25E8%2583%258C%25E5%258C%2585.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IPhone 4 多功能创意音响背包 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fa4estudio-codina-house.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">A4estudio建筑设计-Codina House (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F1346.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">国家大J院 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_7070.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Jessie J个人专辑- Who You Are (@ycy8)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Tomcat 6之前，在web应用中使用log4j还算容易，只要将log4j的jar包和相应的配置文件扔到项目的class path就齐活了。但是从6开始，一切变得如此复杂……<br />
根据Tomcat 6 的<a href="http://tomcat.apache.org/tomcat-6.0-doc/logging.html" target="_blank">官方文档</a>，默认tomcat用的是JDK的logging框架，并配以“精简版”的common logging框架，即不支持common logging的底层框架自动切换功能，要使用log4j也就不可能了。要使用上述功能，需要使用“完整版”的common logging，而这个完整版的jar包apache上不提供下载，需要“自己编译tomcat代码”-_-|||，具体步骤如下：</p>
<ol>
<li>当然，你必须得有JDK、ant、SVN（如果你直接下载<a href="http://tomcat.apache.org/download-60.cgi" target="_blank">源代码包</a>，可以不需要SVN）</li>
<li>从http://svn.apache.org/repos/asf/tomcat/tc6.0.x/ check out代码</li>
<li>执行ant download</li>
<li>执行ant（这里提一句，源代码的编码为utf8，直接编译的话会扔一堆warning，只要改一下ant脚本里的javac task就好了，加上encoding=”utf8&#8243;）</li>
<li>执行ant -f extras.xml</li>
<li>将output/extras/<code>tomcat-juli.jar覆盖到tomcat的bin目录下</code></li>
<li>将output/extras/tomcat-juli-adapters.jar拷到tomcat的lib目录下</li>
<li>在lib目录下写tomcat的全局log4j配置</li>
<li>在你的web项目中放入log4j.jar和log4j.properties(.xml)</li>
</ol>
<p><del datetime="2009-12-18T09:08:48+00:00">附：<br />
tomcat-juli.jar<br />
tomcat-juli-adapters.jar<br />
使用utf8编译的build.xml</del>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/01/20/1354/">在Tomcat 6中使用log4j</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F&title=%E5%9C%A8Tomcat+6%E4%B8%AD%E4%BD%BF%E7%94%A8log4j" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何配置Tomcat数据库连接池</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwp_wpmm_log&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">关于 wordpress 数据库多出一个 wp_wpmm_log 表结构的说明 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fiphone-4-%25E5%25A4%259A%25E5%258A%259F%25E8%2583%25BD%25E5%2588%259B%25E6%2584%258F%25E9%259F%25B3%25E5%2593%258D%25E8%2583%258C%25E5%258C%2585.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IPhone 4 多功能创意音响背包 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fa4estudio-codina-house.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">A4estudio建筑设计-Codina House (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F1346.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">国家大J院 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_7070.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Jessie J个人专辑- Who You Are (@ycy8)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/01/20/1354/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>让Struts 2性能提升一个数量级的的5个步骤 [zz]</title>
		<link>http://www.jayxu.com/2009/01/06/1337/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e8%25ae%25a9struts-2%25e6%2580%25a7%25e8%2583%25bd%25e6%258f%2590%25e5%258d%2587%25e4%25b8%2580%25e4%25b8%25aa%25e6%2595%25b0%25e9%2587%258f%25e7%25ba%25a7%25e7%259a%2584%25e7%259a%25845%25e4%25b8%25aa%25e6%25ad%25a5%25e9%25aa%25a4</link>
		<comments>http://www.jayxu.com/2009/01/06/1337/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 02:55:48 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[转载]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[struts]]></category>
		<category><![CDATA[性能调优]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/01/06/1337/</guid>
		<description><![CDATA[原文：http://dev.yingzhitech.com/2009/01/06/96 freemarker 升级为2.3.14 ognl 升级为 2.7.3（要附加javassis类库） 根包下增加freemarker.properties文件，内容为template_update_delay=60000 struts.xml增加&#60;constant name=”struts.devMode” value=”false”/&#62;和&#60;constant name=”struts.freemarker.templatesCache” value=”true”/&#62; 把struts.xml中的默认拦截器定义为basicStack： &#60;package name=&#34;web&#34; extends=&#34;tiles-default&#34;&#62; &#160; &#160; &#60;default-interceptor-ref name=&#34;basicStack&#34; /&#62; &#60;/package&#62; &#60;package name="web" extends="tiles-default"&#62; &#60;default-interceptor-ref name="basicStack" /&#62; &#60;/package&#62; 执行了这几步之后，网站性能从5 req/s提升至70 req/s，请求处理时间从22s/req缩减至2s/req！ 参考连接： http://struts.apache.org/2.x/docs/performance-tuning.html http://www.blogjava.net/usherlight/archive/2008/07/01/211869.html http://www.blogjava.net/usherlight/archive/2008/07/12/214462.html http://www.blogjava.net/usherlight/archive/2008/09/02/226501.html 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 让Struts 2性能提升一个数量级的的5个步骤 [zz]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart中的TimeSeries可能导致内存泄露</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">慎用LinkedXxxx集合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F2484.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">果粒奶优果粒女优 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F719&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">优士网发布“一周年成就图谱” (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3399&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">由12306.cn谈谈网站性能技术 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2Fpost-196.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">关于BT服务器的网络性能…… (@dongdong)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>原文：<a href="http://dev.yingzhitech.com/2009/01/06/96" target="_blank">http://dev.yingzhitech.com/2009/01/06/96</a></p>
<ol>
<li>freemarker 升级为2.3.14</li>
<li>ognl 升级为 2.7.3（要附加javassis类库）</li>
<li>根包下增加freemarker.properties文件，内容为template_update_delay=60000</li>
<li>struts.xml增加&lt;constant name=”struts.devMode” value=”false”/&gt;和&lt;constant name=”struts.freemarker.templatesCache” value=”true”/&gt;</li>
<li>把struts.xml中的默认拦截器定义为basicStack：

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="xml"><ol><li class="li1"><div class="de1"><span class="sc3"><span class="re1">&lt;package</span> <span class="re0">name</span>=<span class="st0">&quot;web&quot;</span> <span class="re0">extends</span>=<span class="st0">&quot;tiles-default&quot;</span><span class="re2">&gt;</span></span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;default-interceptor-ref</span> <span class="re0">name</span>=<span class="st0">&quot;basicStack&quot;</span> <span class="re2">/&gt;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc3"><span class="re1">&lt;/package<span class="re2">&gt;</span></span></span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">&lt;package name="web" extends="tiles-default"&gt;
    &lt;default-interceptor-ref name="basicStack" /&gt;
&lt;/package&gt;</pre></div></div>

</li>
</ol>
<p>执行了这几步之后，网站性能从5 req/s提升至70 req/s，请求处理时间从22s/req缩减至2s/req！<br />
参考连接：<br />
<a href="http://struts.apache.org/2.x/docs/performance-tuning.html" target="_blank">http://struts.apache.org/2.x/docs/performance-tuning.html</a><br />
<a href="http://www.blogjava.net/usherlight/archive/2008/07/01/211869.html" target="_blank">http://www.blogjava.net/usherlight/archive/2008/07/01/211869.html</a><br />
<a href="http://www.blogjava.net/usherlight/archive/2008/07/12/214462.html" target="_blank">http://www.blogjava.net/usherlight/archive/2008/07/12/214462.html</a><br />
<a href="http://www.blogjava.net/usherlight/archive/2008/09/02/226501.html" target="_blank">http://www.blogjava.net/usherlight/archive/2008/09/02/226501.html</a><br />
<a href="http://struts.apache.org/2.x/docs/performance-tuning.html" target="_blank"></a>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/01/06/1337/">让Struts 2性能提升一个数量级的的5个步骤 [zz]</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F&title=%E8%AE%A9Struts+2%E6%80%A7%E8%83%BD%E6%8F%90%E5%8D%87%E4%B8%80%E4%B8%AA%E6%95%B0%E9%87%8F%E7%BA%A7%E7%9A%84%E7%9A%845%E4%B8%AA%E6%AD%A5%E9%AA%A4+%5Bzz%5D" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart中的TimeSeries可能导致内存泄露</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">慎用LinkedXxxx集合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F2484.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">果粒奶优果粒女优 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F719&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">优士网发布“一周年成就图谱” (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3399&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">由12306.cn谈谈网站性能技术 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2Fpost-196.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">关于BT服务器的网络性能…… (@dongdong)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/01/06/1337/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>如何使用J2D将一张图片灰度化</title>
		<link>http://www.jayxu.com/2008/12/10/1263/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e4%25bd%25bf%25e7%2594%25a8j2d%25e5%25b0%2586%25e4%25b8%2580%25e5%25bc%25a0%25e5%259b%25be%25e7%2589%2587%25e7%2581%25b0%25e5%25ba%25a6%25e5%258c%2596</link>
		<comments>http://www.jayxu.com/2008/12/10/1263/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 07:23:37 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=1263</guid>
		<description><![CDATA[可使用以下代码： Graphics2D g2d = source.createGraphics&#40;&#41;; &#160; ColorSpace grayCS = ColorSpace.getInstance&#40;ColorSpace.CS_GRAY&#41;; ColorConvertOp colorConvertOp = new ColorConvertOp&#40;grayCS, g2d.getRenderingHints&#40;&#41;&#41;; colorConvertOp.filter&#40;source, source&#41;; Graphics2D g2d = source.createGraphics(); ColorSpace grayCS = ColorSpace.getInstance(ColorSpace.CS_GRAY); ColorConvertOp colorConvertOp = new ColorConvertOp(grayCS, g2d.getRenderingHints()); colorConvertOp.filter(source, source); 其中source为BufferedImage对象 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 如何使用J2D将一张图片灰度化<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Tomcat 6中使用log4j</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>可使用以下代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">Graphics2D</span> g2d <span class="sy0">=</span> source.<span class="me1">createGraphics</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw3">ColorSpace</span> grayCS <span class="sy0">=</span> <span class="kw3">ColorSpace</span>.<span class="me1">getInstance</span><span class="br0">&#40;</span><span class="kw3">ColorSpace</span>.<span class="me1">CS_GRAY</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="kw3">ColorConvertOp</span> colorConvertOp <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw3">ColorConvertOp</span><span class="br0">&#40;</span>grayCS, g2d.<span class="me1">getRenderingHints</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">colorConvertOp.<span class="me1">filter</span><span class="br0">&#40;</span>source, source<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">Graphics2D g2d = source.createGraphics();

ColorSpace grayCS = ColorSpace.getInstance(ColorSpace.CS_GRAY);
ColorConvertOp colorConvertOp = new ColorConvertOp(grayCS, g2d.getRenderingHints());
colorConvertOp.filter(source, source);</pre></div></div>

<p>其中source为BufferedImage对象
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/12/10/1263/">如何使用J2D将一张图片灰度化</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&title=%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8J2D%E5%B0%86%E4%B8%80%E5%BC%A0%E5%9B%BE%E7%89%87%E7%81%B0%E5%BA%A6%E5%8C%96" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Tomcat 6中使用log4j</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/12/10/1263/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Enable Anti-Aliased Globally Since JDK 5</title>
		<link>http://www.jayxu.com/2008/11/25/1243/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-enable-anti-aliased-globally-since-jdk-5</link>
		<comments>http://www.jayxu.com/2008/11/25/1243/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 09:51:56 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/11/25/1243/</guid>
		<description><![CDATA[I just read “Swing Hacks” and find it is that easy to enable anti-aliased since JDK 5.  Just add a one-line code listed below at the very beginning of your whole application System.setProperty&#40;&#34;swing.aatext&#34;, &#34;true&#34;&#41;; System.setProperty("swing.aatext", "true"); That&#8217;s all 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: How To Enable Anti-Aliased Globally Since JDK 5<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fproud-swing-little-monkey-wall-clock.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">得意摇摆小猴挂钟 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2Fpost-194.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">新生陆续地来了，有些感想——新增&quot;感悟&quot;分类 (@dongdong)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fnginx-web-server&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nginx占有率超过10% 成为屈居apache之后的第二大web服务器 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.mianfeidi.com%2F2011%2Fmagpress-decaton.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">来自MagPress的黑色CMS WP主题Decaton (@mianfeidi)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>I just read “Swing Hacks” and find it is that easy to enable anti-aliased since JDK 5.  Just add a one-line code listed below at the very beginning of your whole application</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">System</span>.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;swing.aatext&quot;</span>, <span class="st0">&quot;true&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">System.setProperty("swing.aatext", "true");</pre></div></div>

<p>That&#8217;s all
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/25/1243/">How To Enable Anti-Aliased Globally Since JDK 5</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&title=How+To+Enable+Anti-Aliased+Globally+Since+JDK+5" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fproud-swing-little-monkey-wall-clock.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">得意摇摆小猴挂钟 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fxiaomanhua.info%2F1101%2F420%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">李梦龙传-梦龙的苦恼 (@xiaomanhua)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_8411.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">室内摄影作品 (@ycy8)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fxjeek.com%2F%3Fp%3D324&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">艺术广告牌 (@xjeek)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/25/1243/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JFreeChart中的TimeSeries可能导致内存泄露</title>
		<link>http://www.jayxu.com/2008/11/25/1233/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jfreechart%25e4%25b8%25ad%25e7%259a%2584timeseries%25e5%258f%25af%25e8%2583%25bd%25e5%25af%25bc%25e8%2587%25b4%25e5%2586%2585%25e5%25ad%2598%25e6%25b3%2584%25e9%259c%25b2</link>
		<comments>http://www.jayxu.com/2008/11/25/1233/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 06:40:01 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jfreechart]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[性能调优]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/11/25/1233/</guid>
		<description><![CDATA[前段时间说到现在的项目里在用JFreeChart。昨天晚上走之前没把客户端关掉，今天中午到公司发现程序已经崩了，狂抛OutOfMemoryError。用NB的profiler跟了一下，发现是JFreeChart或者说是没有正确使用JFreeChart的TimeSeries导致的后果 TimeSeries有一个方法setMaximumItemAge： public void setMaximumItemAge&#40;long periods&#41; public void setMaximumItemAge(long periods) 该方法文档如下： Sets the number of time units in the &#8216;history&#8217; for the series. This provides one mechanism for automatically dropping old data from the time series. For example, if a series contains daily data, you might set the history count to 30. Then, when you <a href="http://www.jayxu.com/2008/11/25/1233/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart Developer Guide</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">让Struts 2性能提升一个数量级的的5个步骤 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">慎用LinkedXxxx集合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>前段时间说到现在的项目里在用JFreeChart。昨天晚上走之前没把客户端关掉，今天中午到公司发现程序已经崩了，狂抛OutOfMemoryError。用NB的profiler跟了一下，发现是JFreeChart或者说是没有正确使用JFreeChart的TimeSeries导致的后果<br />
TimeSeries有一个方法setMaximumItemAge：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw4">void</span> setMaximumItemAge<span class="br0">&#40;</span><span class="kw4">long</span> periods<span class="br0">&#41;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public void setMaximumItemAge(long periods)</pre></div></div>

<p>该方法文档如下：</p>
<blockquote><dl>
<dd>Sets the number of time units in the &#8216;history&#8217; for the series.  This provides one mechanism for automatically dropping old data from the time series. For example, if a series contains daily data, you might set the history count to 30.  Then, when you add a new data item, all data items more than 30 days older than the latest value are automatically dropped from the series.</p>
</dd>
<dd> </dd>
<dd>
<dl>
<dt><strong>Parameters:</strong></dt>
<dd><code>periods</code> &#8211; the number of time periods.</dd>
<dt></dt>
</dl>
</dd>
</dl>
</blockquote>
<p>maximumItemAge的默认值为Long.MAX_VALUE，因此如果不设置该值的话在可预见的未来过期数据将不会被丢弃，这样会导致TimeSeries的数据越来越大，尤其是在设置axis.setAutoRange(true);和axis.setFixedAutoRange(DATA_AGE);后（将横轴设为固定长度，图表只容纳限定数目个点，视觉上就是数据从右边“推入”图表，从左侧被“推出”）。虽然视觉上数据只有那么一点，但是从图表上消失的“旧”数据并没有从series里清除，导致最终的内存不足</p>
<p><a href="http://jayxu.com/log/wp-content/uploads/2008/11/mem_heap_2.png"><img class="alignnone size-medium wp-image-1236" title="mem_heap_2" src="http://jayxu.com/log/wp-content/uploads/2008/11/mem_heap_2.png" alt="" width="436" height="278" /></a></p>
<p>未使用setMaximumItemAge的堆分布，才2分钟就开始深度GC，且堆大小已经开始扩大</p>
<p><a href="http://jayxu.com/log/wp-content/uploads/2008/11/mem_gc_2.png"><img class="alignnone size-medium wp-image-1237" title="mem_gc_2" src="http://jayxu.com/log/wp-content/uploads/2008/11/mem_gc_2.png" alt="" width="436" height="278" /></a></p>
<p>未使用setMaximumItemAge的对象年龄（代），曲线很陡，说明很多对象没有被回收</p>
<p><a href="http://jayxu.com/log/wp-content/uploads/2008/11/mem_heap.png"><img class="alignnone size-medium wp-image-1238" title="mem_heap" src="http://jayxu.com/log/wp-content/uploads/2008/11/mem_heap.png" alt="" width="436" height="278" /></a></p>
<p>使用setMaximumItemAge的堆分布，堆内存占用比较缓慢，堆大小未扩大，未进行深度GC</p>
<p><a href="http://jayxu.com/log/wp-content/uploads/2008/11/mem_gc.png"><img class="alignnone size-medium wp-image-1239" title="mem_gc" src="http://jayxu.com/log/wp-content/uploads/2008/11/mem_gc.png" alt="" width="436" height="278" /></a></p>
<p>使用setMaximumItemAge的对象年龄（代），数值很高，是因为还没有进行深度GC的原因</p>
<p>在此提醒正在使用JFreeChart尤其是TimeSeries的给位，千万记得设置maximumItemAge
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/25/1233/">JFreeChart中的TimeSeries可能导致内存泄露</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F&title=JFreeChart%E4%B8%AD%E7%9A%84TimeSeries%E5%8F%AF%E8%83%BD%E5%AF%BC%E8%87%B4%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart Developer Guide</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">让Struts 2性能提升一个数量级的的5个步骤 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">慎用LinkedXxxx集合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/25/1233/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JFreeChart Developer Guide</title>
		<link>http://www.jayxu.com/2008/11/15/848/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jfreechart-developer-guide</link>
		<comments>http://www.jayxu.com/2008/11/15/848/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 13:09:53 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jfreechart]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=848</guid>
		<description><![CDATA[互联网很强大，Google很强大 JFreeChart是个很强大的Java作图库，真的很强大，强大得不看文档都不知道该怎么用……JFC虽然遵循LGPL但文档是收费的，个人版45刀一份。刚才google了一下，找到一本1.0.4的PDF（最新为1.0.11），直接挂这里有点嚣张，谁要的给我mail 更新：到这儿下载吧~~ 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: JFreeChart Developer Guide<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart中的TimeSeries可能导致内存泄露</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>互联网很强大，Google很强大</p>
<p>JFreeChart是个很强大的Java作图库，真的很强大，强大得不看文档都不知道该怎么用……JFC虽然遵循LGPL但文档是收费的，个人版45刀一份。刚才google了一下，找到一本1.0.4的PDF（最新为1.0.11），直接挂这里有点嚣张，谁要的给我mail</p>
<p>更新：到<a href="http://www.damipan.com/file/sr4TBY.html" target="_blank">这儿</a>下载吧~~
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/15/848/">JFreeChart Developer Guide</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F&title=JFreeChart+Developer+Guide" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart中的TimeSeries可能导致内存泄露</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/15/848/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>如何cancel一个swing worker（续）</title>
		<link>http://www.jayxu.com/2008/11/14/844/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595cancel%25e4%25b8%2580%25e4%25b8%25aaswing-worker%25ef%25bc%2588%25e7%25bb%25ad%25ef%25bc%2589</link>
		<comments>http://www.jayxu.com/2008/11/14/844/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 15:35:19 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swingx]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=844</guid>
		<description><![CDATA[上一次谈到如何去cancel一个swing worker，今天在代码里又出了问题：即使使用swingWorker.cancel(true)仍然无法在sleep时中止线程。追了一下代码，最后在javax.swing.ImageIcon类里找到了原因： protected void loadImage(Image image) { synchronized(tracker) { int id = getNextID(); tracker.addImage(image, id); try { tracker.waitForID(id, 0); } catch (InterruptedException e) { System.out.println("INTERRUPTED while loading Image"); } loadStatus = tracker.statusID(id, false); tracker.removeImage(image, id); width = image.getWidth(imageObserver); height = image.getHeight(imageObserver); } } 其中第7行会抛出InterruptedException，而在第10行捕捉了该异常，导致InterruptedException无法抛到我的代码里。很典型的“eat-up exception”的例子。解决该问题可以在初始化ImageIcon前sleep一下，比如sleep(5)，让interrupted状态在sleep中触发InterruptedException 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 如何cancel一个swing worker（续）<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何cancel一个swingworker</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F05%2F10%2F221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Alloy</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>上一次谈到如何去cancel一个swing worker，今天在代码里又出了问题：即使使用swingWorker.cancel(true)仍然无法在sleep时中止线程。追了一下代码，最后在javax.swing.ImageIcon类里找到了原因：</p>
<pre lang="java" line="1">
protected void loadImage(Image image) {
    synchronized(tracker) {
        int id = getNextID();

        tracker.addImage(image, id);
	try {
	    tracker.waitForID(id, 0);
	} catch (InterruptedException e) {
	    System.out.println("INTERRUPTED while loading Image");
	}
        loadStatus = tracker.statusID(id, false);
	tracker.removeImage(image, id);

        width = image.getWidth(imageObserver);
	height = image.getHeight(imageObserver);
    }
}
</pre>
<p>其中第7行会抛出InterruptedException，而在第10行捕捉了该异常，导致InterruptedException无法抛到我的代码里。很典型的“eat-up exception”的例子。解决该问题可以在初始化ImageIcon前sleep一下，比如sleep(5)，让interrupted状态在sleep中触发InterruptedException
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/14/844/">如何cancel一个swing worker（续）</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F&title=%E5%A6%82%E4%BD%95cancel%E4%B8%80%E4%B8%AAswing+worker%EF%BC%88%E7%BB%AD%EF%BC%89" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何cancel一个swingworker</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F23%2F55%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">生活，就是一周接着一周</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/14/844/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JGraph中的deselect状态判断</title>
		<link>http://www.jayxu.com/2008/11/14/840/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jgraph%25e4%25b8%25ad%25e7%259a%2584deselect%25e7%258a%25b6%25e6%2580%2581%25e5%2588%25a4%25e6%2596%25ad</link>
		<comments>http://www.jayxu.com/2008/11/14/840/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 10:30:49 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jgraph]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=840</guid>
		<description><![CDATA[JGraph是基于Java swing、Java 2D开发的纯Java图形库，很像Eclipse的EMF、JMF，可以很方便地帮助开发人员在Swing框架中实现组件的呈现、布局、拖拽、group等图形化操作。JGraph也是基于MVC模式实现，将整个框架分为cell（M层）、cell view（C层）和renderer（V层）。有一些设计思想很有趣，比如它的GraphConstants，将所有属性存在传入的map里，通过方法签名实现属性的意义化和类型限制，很有趣的思想 下面进入正题，如何判断一个cell view被deselect。JGraph现在已半商业化，文档很稀少，JavaDoc更是不堪入目，最好的研究方法还是读源代码，比如前两天为了正确设置cell view的虚线边框颜色就看了一晚上源代码 JGraph的事件监听写得很诡异，在cell view中需要通过以下方法添加监听器： class MyCellView extends VertexView &#123; &#160; &#160; public CellHandle getHandle&#40;GraphContext context&#41; &#123; &#160; &#160; &#160; &#160; return new CellHandle&#40;&#41;&#123; &#160; &#160; &#160; &#160; &#160; &#160; void paint&#40;Graphics g&#41;; &#160; &#160; &#160; &#160; &#160; &#160; &#160; void overlay&#40;Graphics g&#41;; &#160; &#160; &#160; &#160; &#160; &#160; &#160; void <a href="http://www.jayxu.com/2008/11/14/840/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2Fpost-316.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">QQ123679这个用户的最新状态:QQ is die (@dongdong)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Ftoshiba-g810-reset&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">东芝toshiba G810 硬启动 重装系统 恢复到原始状态的方法 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Finput-hidde-label-js&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">输入框 选中 输入 离开 不同状态 label 自动隐藏 js 特效二 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2Fpost-425.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">[转载]如果你是个中国人，看看吧！ (@dongdong)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jgraph.com/" target="_blank">JGraph</a>是基于Java swing、Java 2D开发的纯Java图形库，很像Eclipse的EMF、JMF，可以很方便地帮助开发人员在Swing框架中实现组件的呈现、布局、拖拽、group等图形化操作。JGraph也是基于MVC模式实现，将整个框架分为cell（M层）、cell view（C层）和renderer（V层）。有一些设计思想很有趣，比如它的GraphConstants，将所有属性存在传入的map里，通过方法签名实现属性的意义化和类型限制，很有趣的思想<br />
下面进入正题，如何判断一个cell view被deselect。JGraph现在已半商业化，文档很稀少，JavaDoc更是不堪入目，最好的研究方法还是读源代码，比如前两天为了正确设置cell view的虚线边框颜色就看了一晚上源代码<br />
JGraph的事件监听写得很诡异，在cell view中需要通过以下方法添加监听器：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">class</span> MyCellView <span class="kw1">extends</span> VertexView <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> CellHandle getHandle<span class="br0">&#40;</span>GraphContext context<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">new</span> CellHandle<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">void</span> paint<span class="br0">&#40;</span><span class="kw3">Graphics</span> g<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">void</span> overlay<span class="br0">&#40;</span><span class="kw3">Graphics</span> g<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">void</span> mouseMoved<span class="br0">&#40;</span><span class="kw3">MouseEvent</span> event<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">void</span> mousePressed<span class="br0">&#40;</span><span class="kw3">MouseEvent</span> event<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">void</span> mouseDragged<span class="br0">&#40;</span><span class="kw3">MouseEvent</span> event<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">void</span> mouseReleased<span class="br0">&#40;</span><span class="kw3">MouseEvent</span> event<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">class MyCellView extends VertexView {
    public CellHandle getHandle(GraphContext context) {
        return new CellHandle(){
            void paint(Graphics g);

            void overlay(Graphics g);

            void mouseMoved(MouseEvent event);

            void mousePressed(MouseEvent event);

            void mouseDragged(MouseEvent event);

            void mouseReleased(MouseEvent event);
        };
    }
}</pre></div></div>

<p>你可以通过JGraph对象的getSelectionCell()或getSelectionCells()获得被选中的cell，但是有一个问题，就是当你单击空白区域以取消选择一个cell view时，该方法依然返回非空的最后选择的对象。于是尝试从MouseEvent获得点击时鼠标的X、Y坐标，并调用getFirstCellForLocation(double x, double y)获得鼠标位置的cell（没有则返回null）。但这样还是有问题，当你通过框选选择一个（或若干个）cell时，getFirstCellForLocation(double x, double y)返回的对象取决于你实现的方法（是press、drag还是release）。最后，在通读了一下JGraph的JavaDoc后，发现可以使用如下方法解决这个问题：</p>
<pre lang="java" line="1">
graph.getSelectionModel().addGraphSelectionListener(new GraphSelectionListener() {
    public void valueChanged(GraphSelectionEvent e) {
        MachineCell[] cell = null;

        if (e.isAddedCell()) { // selected
            cell = new MachineCell[]{(MachineCell) e.getCell()};
        } else {
            cell = new MachineCell[0];
        }

        for (ActionListener l : listeners) {
            l.actionPerformed(new ActionEvent(cell, 0, ""));
        }
    }
});</pre>
<p>其中第五行的isAddedCell()方法签名如下：</p>
<h3>isAddedCell</h3>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw4">boolean</span> <span class="sy0">&lt;</span>strong<span class="sy0">&gt;</span>isAddedCell<span class="sy0">&lt;/</span>strong<span class="sy0">&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public boolean &lt;strong&gt;isAddedCell&lt;/strong&gt;()</pre></div></div>

<dl>
<dd>Returns true if the first cell has been added to the selection, a return  value of false means the first cell has been removed from the selection.</p>
</dd>
<dd>
<dl>
<dt><strong>Returns:</strong></dt>
<dd>whether or not the first cell has been added or removed</dd>
</dl>
</dd>
</dl>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/14/840/">JGraph中的deselect状态判断</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F&title=JGraph%E4%B8%AD%E7%9A%84deselect%E7%8A%B6%E6%80%81%E5%88%A4%E6%96%AD" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2Fpost-316.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">QQ123679这个用户的最新状态:QQ is die (@dongdong)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Ftoshiba-g810-reset&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">东芝toshiba G810 硬启动 重装系统 恢复到原始状态的方法 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Finput-hidde-label-js&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">输入框 选中 输入 离开 不同状态 label 自动隐藏 js 特效二 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2Farchives%2F285.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F840%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">dedecms v5.3-v5.6 Get Shell 0day利用分析 (@swhack)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/14/840/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>小心Derby的ResultSet陷阱</title>
		<link>http://www.jayxu.com/2008/11/09/59/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25b0%258f%25e5%25bf%2583derby%25e7%259a%2584resultset%25e9%2599%25b7%25e9%2598%25b1</link>
		<comments>http://www.jayxu.com/2008/11/09/59/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 09:19:21 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[derby]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=59</guid>
		<description><![CDATA[Derby作为一个纯Java实现的嵌入式DB一直很受Java社区的欢迎，在我们的项目中也用到了。但昨天晚上遇到的一个问题让我对Derby相当失望——Derby实现的ResultSet会将列名中的表名抹掉 具体代码： SQL： SELECT staff.staffid FROM staff WHERE ... JDBC： ResultSet rs = stmt.executeQuery&#40;...&#41;; if&#40;rs.next&#40;&#41;&#41;&#123; &#160; &#160; String id = rs.getString&#40;&#34;staff.id&#34;&#41;; &#125; ResultSet rs = stmt.executeQuery(...); if(rs.next()){ String id = rs.getString("staff.id"); } 运行时抛出异常： Caused by: java.sql.SQLException: 列“staff.staffid”未找到。 &#160; &#160; at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException&#40;Unknown Source&#41; &#160; &#160; at org.apache.derby.impl.jdbc.Util.newEmbedSQLException&#40;Unknown Source&#41; &#160; &#160; at org.apache.derby.impl.jdbc.Util.newEmbedSQLException&#40;Unknown Source&#41; &#160; &#160; at <a href="http://www.jayxu.com/2008/11/09/59/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fsql-wordpress-keywords&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL 查询包含某些文字的内容 如wordpress查询所有带图片的文章 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1967&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">用过SQL语句获取织梦DedeCMS每个栏目各有多少文章 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D316&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">利用SQL语句删除或修改织梦DedeCms数据库内容 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1602%26cpage%3D1&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">织梦DedeCms用SQL语句调用数据库任意内容方法 | 织梦(Dedecms)管理员之家 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Derby作为一个纯Java实现的嵌入式DB一直很受Java社区的欢迎，在我们的项目中也用到了。但昨天晚上遇到的一个问题让我对Derby相当失望——Derby实现的ResultSet会将列名中的表名抹掉<br />
具体代码：<br />
SQL：</p>
<pre>SELECT staff.staffid FROM staff WHERE ...</pre>
<p>JDBC：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">ResultSet</span> rs <span class="sy0">=</span> stmt.<span class="me1">executeQuery</span><span class="br0">&#40;</span>...<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="kw1">if</span><span class="br0">&#40;</span>rs.<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw3">String</span> id <span class="sy0">=</span> rs.<span class="me1">getString</span><span class="br0">&#40;</span><span class="st0">&quot;staff.id&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">ResultSet rs = stmt.executeQuery(...);
if(rs.next()){
    String id = rs.getString("staff.id");
}</pre></div></div>

<p>运行时抛出异常：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">Caused by<span class="sy0">:</span> java.<span class="me1">sql</span>.<span class="kw3">SQLException</span><span class="sy0">:</span> 列“staff.<span class="me1">staffid</span>”未找到。</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">SQLExceptionFactory</span>.<span class="me1">getSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="kw3">Util</span>.<span class="me1">newEmbedSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="kw3">Util</span>.<span class="me1">newEmbedSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="kw3">Util</span>.<span class="me1">generateCsSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">EmbedConnection</span>.<span class="me1">newSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">ConnectionChild</span>.<span class="me1">newSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">EmbedResultSet</span>.<span class="me1">findColumnName</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">EmbedResultSet</span>.<span class="me1">getString</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">Caused by: java.sql.SQLException: 列“staff.staffid”未找到。
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedResultSet.findColumnName(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedResultSet.getString(Unknown Source)</pre></div></div>

<p>如果将select语句中的“staff.staffid”改成“staffid”则不会抛出上述异常。在项目中为了保持数量庞大的SQL语句的正确性和可维护性，一般会将表名、列名定义为常量。这样对于Derby数据库就需要一套特殊的、不带表名的列名常量，给代码维护带来很大的麻烦。不知道Sun将Derby这样实现的原因是什么，这个功能点的实现也不是很麻烦，打算去提交bug
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/09/59/">小心Derby的ResultSet陷阱</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F&title=%E5%B0%8F%E5%BF%83Derby%E7%9A%84ResultSet%E9%99%B7%E9%98%B1" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fsql-wordpress-keywords&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL 查询包含某些文字的内容 如wordpress查询所有带图片的文章 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1967&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">用过SQL语句获取织梦DedeCMS每个栏目各有多少文章 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D316&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">利用SQL语句删除或修改织梦DedeCms数据库内容 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1602%26cpage%3D1&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">织梦DedeCms用SQL语句调用数据库任意内容方法 | 织梦(Dedecms)管理员之家 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/09/59/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何使用反射调用静态方法</title>
		<link>http://www.jayxu.com/2008/11/09/809/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e4%25bd%25bf%25e7%2594%25a8%25e5%258f%258d%25e5%25b0%2584%25e8%25b0%2583%25e7%2594%25a8%25e9%259d%2599%25e6%2580%2581%25e6%2596%25b9%25e6%25b3%2595</link>
		<comments>http://www.jayxu.com/2008/11/09/809/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 09:04:55 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/11/09/809/</guid>
		<description><![CDATA[其实很简单，真的，将invoke(Object o, Object&#8230; params)的第一个参数传入null即可 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 如何使用反射调用静态方法<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>其实很简单，真的，将invoke(Object o, Object&#8230; params)的第一个参数传入null即可
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/09/809/">如何使用反射调用静态方法</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F&title=%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%8F%8D%E5%B0%84%E8%B0%83%E7%94%A8%E9%9D%99%E6%80%81%E6%96%B9%E6%B3%95" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/09/809/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何cancel一个swingworker</title>
		<link>http://www.jayxu.com/2008/10/30/764/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595cancel%25e4%25b8%2580%25e4%25b8%25aaswingworker</link>
		<comments>http://www.jayxu.com/2008/10/30/764/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 08:04:37 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swingx]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/10/30/764/</guid>
		<description><![CDATA[最近在项目里一直在用jdesktop的swingworker（已经合入JDK 6），是个不错的swing线程库。今天需要在界面里cancel一个swingworker。研究了一下午，结合swingworker的文档、源代码和自己的代码实验，以下是两种安全cancel一个swingworker的方法 方法一，使用isCancelled： protected Object doInBackground&#40;&#41; throws Exception &#123; &#160; &#160; while &#40;!isCancelled&#40;&#41;&#41; &#123; &#160; &#160; &#160; &#160;... &#160; &#160; &#125; &#160; &#160; &#160; return null; &#125; protected Object doInBackground() throws Exception { while (!isCancelled()) { ... } return null; } 需要cencel时调用swingworker.cancel(false)，不中断线程，只置cancel标记。 方法二，使用sleep： protected Object doInBackground&#40;&#41; throws Exception &#123; &#160; &#160; while &#40;running&#41; &#123; &#160; <a href="http://www.jayxu.com/2008/10/30/764/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用反射调用静态方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近在项目里一直在用jdesktop的swingworker（已经合入JDK 6），是个不错的swing线程库。今天需要在界面里cancel一个swingworker。研究了一下午，结合swingworker的文档、源代码和自己的代码实验，以下是两种安全cancel一个swingworker的方法</p>
<p>方法一，使用isCancelled：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">protected</span> <span class="kw3">Object</span> doInBackground<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span><span class="sy0">!</span>isCancelled<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;...</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">null</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">protected Object doInBackground() throws Exception {
    while (!isCancelled()) {
       ...
    }

    return null;
}</pre></div></div>

<p>需要cencel时调用swingworker.cancel(false)，不中断线程，只置cancel标记。</p>
<p>方法二，使用sleep：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">protected</span> <span class="kw3">Object</span> doInBackground<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>running<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; ...</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="me1">sleep</span><span class="br0">&#40;</span><span class="nu0">30</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">null</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">protected Object doInBackground() throws Exception {
    while (running) {
        ...
        sleep(30);
    }

    return null;
}</pre></div></div>

<p>需要cencel时调用swingworker.cancel(true)，在sleep处中断线程。切记，不需要捕捉sleep抛出的InterruptedException，swingworker会处理该异常。
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/10/30/764/">如何cancel一个swingworker</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F&title=%E5%A6%82%E4%BD%95cancel%E4%B8%80%E4%B8%AAswingworker" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用反射调用静态方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/10/30/764/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JScrollBar的unitIncrement和blockIncrement</title>
		<link>http://www.jayxu.com/2008/10/09/747/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jscrollbar%25e7%259a%2584unitincrement%25e5%2592%258cblockincrement</link>
		<comments>http://www.jayxu.com/2008/10/09/747/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 17:38:46 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/10/09/747/</guid>
		<description><![CDATA[这两天在写swing的时候遇到一个问题，JScrollPane在相应鼠标滚轮的时候很慢，滚了一大段才移了一点点，给人的感觉就是鼠标很“硬”。刚才查了一下javadoc，看到JScrollbar有个方法：setUnitIncrement(int) 和 setBlockIncrement(int)。前一个是设置点击上下箭头的移动距离（也包括滚轮滚动），后一个是单击滚动条上空白处的移动距离，单位为像素。输出了一下unitIncrement的默认值，竟然是1 -_-&#124;&#124;&#124;。手动设为10，感觉鼠标终于灵活了……具体代码： jScrollPane.getVerticalScrollBar&#40;&#41;.setUnitIncrement&#40;10&#41;; jScrollPane.getVerticalScrollBar().setUnitIncrement(10); 如果遇到和我相同问题的可以用上面的方法试一下。有点不爽的就是没有一个类似UIManager的全局变量可以设置，只能在各个JScrollBar上单独设置，有点麻烦。 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: JScrollBar的unitIncrement和blockIncrement<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>这两天在写swing的时候遇到一个问题，JScrollPane在相应鼠标滚轮的时候很慢，滚了一大段才移了一点点，给人的感觉就是鼠标很“硬”。刚才查了一下javadoc，看到JScrollbar有个方法：setUnitIncrement(int) 和 setBlockIncrement(int)。前一个是设置点击上下箭头的移动距离（也包括滚轮滚动），后一个是单击滚动条上空白处的移动距离，单位为像素。输出了一下unitIncrement的默认值，竟然是1 -_-|||。手动设为10，感觉鼠标终于灵活了……具体代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">jScrollPane.<span class="me1">getVerticalScrollBar</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">setUnitIncrement</span><span class="br0">&#40;</span><span class="nu0">10</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">jScrollPane.getVerticalScrollBar().setUnitIncrement(10);</pre></div></div>

<p>如果遇到和我相同问题的可以用上面的方法试一下。有点不爽的就是没有一个类似UIManager的全局变量可以设置，只能在各个JScrollBar上单独设置，有点麻烦。
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/10/09/747/">JScrollBar的unitIncrement和blockIncrement</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&title=JScrollBar%E7%9A%84unitIncrement%E5%92%8CblockIncrement" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/10/09/747/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何在Java的enum中使用annotation</title>
		<link>http://www.jayxu.com/2008/09/22/713/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e5%259c%25a8java%25e4%25b8%25ad%25e5%259c%25a8enum%25e4%25b8%25ad%25e4%25bd%25bf%25e7%2594%25a8annotation</link>
		<comments>http://www.jayxu.com/2008/09/22/713/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 15:14:59 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[编程]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/09/22/713/</guid>
		<description><![CDATA[刚才在写一个方法的时候试图在enum上使用annotation： public enum DataKey &#123; &#160; &#160; @Incremental &#160; &#160; @FromProbe &#160; &#160; @Transient&#40;replacePolicy = ReplacePlolicy.REPLACE_IF_LATER_THAN&#41; &#160; &#160; VISIT_COUNT &#125; public enum DataKey { @Incremental @FromProbe @Transient(replacePolicy = ReplacePlolicy.REPLACE_IF_LATER_THAN) VISIT_COUNT } 然后在merge的时候使用annotation： if &#40;key.getClass&#40;&#41;.isAnnotationPresent&#40;Transient.class&#41;&#41; &#123; &#160; &#160; ... &#125; if (key.getClass().isAnnotationPresent(Transient.class)) { ... } 结果不进if，debug时发现key（DataKey的对象）的类型是DataKey（其实也挺顺理成章的），于是使用如下代码： if &#40;DataKey.class.getField&#40;key.name&#40;&#41;&#41;.isAnnotationPresent&#40;Transient.class&#41;&#41; &#123; &#160; &#160; ... &#125; if (DataKey.class.getField(key.name()).isAnnotationPresent(Transient.class)) { <a href="http://www.jayxu.com/2008/09/22/713/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>刚才在写一个方法的时候试图在enum上使用annotation：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">enum</span> DataKey <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; @Incremental</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; @FromProbe</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; @<span class="kw1">Transient</span><span class="br0">&#40;</span>replacePolicy <span class="sy0">=</span> ReplacePlolicy.<span class="me1">REPLACE_IF_LATER_THAN</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; VISIT_COUNT</div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public enum DataKey {
    @Incremental
    @FromProbe
    @Transient(replacePolicy = ReplacePlolicy.REPLACE_IF_LATER_THAN)
    VISIT_COUNT
}</pre></div></div>

<p>然后在merge的时候使用annotation：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span>key.<span class="me1">getClass</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">isAnnotationPresent</span><span class="br0">&#40;</span><span class="kw1">Transient</span>.<span class="kw1">class</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">if (key.getClass().isAnnotationPresent(Transient.class)) {
    ...
}</pre></div></div>

<p>结果不进if，debug时发现key（DataKey的对象）的类型是DataKey（其实也挺顺理成章的），于是使用如下代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span>DataKey.<span class="kw1">class</span>.<span class="me1">getField</span><span class="br0">&#40;</span>key.<span class="me1">name</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">isAnnotationPresent</span><span class="br0">&#40;</span><span class="kw1">Transient</span>.<span class="kw1">class</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">if (DataKey.class.getField(key.name()).isAnnotationPresent(Transient.class)) {
    ...
}</pre></div></div>

<p>结果正确。<br />
结论：在对enum类型使用FIELD一级annotation时需要使用第二种方法进行反射
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/09/22/713/">如何在Java的enum中使用annotation</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&title=%E5%A6%82%E4%BD%95%E5%9C%A8Java%E7%9A%84enum%E4%B8%AD%E4%BD%BF%E7%94%A8annotation" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/09/22/713/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Deskzilla Cracked</title>
		<link>http://www.jayxu.com/2008/05/07/352/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=deskzilla-cracked</link>
		<comments>http://www.jayxu.com/2008/05/07/352/#comments</comments>
		<pubDate>Tue, 06 May 2008 16:32:20 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[购物]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[破解]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=352</guid>
		<description><![CDATA[最近破解上瘾了，昨天干到3点多，今天又花了一中午把deskzilla，一个bugzilla的桌面客户端）破解了。 这次破解花了很长时间，一是因为代码编译后被混淆了，找关键代码的时候着实花了不少时间。另一方面这个软件的license验证不是使用常见的布尔判断，而是用异常。这意味着必须仔细研究方法的调用栈，于是这次用了一个比较偷巧的方法：在代码中抛出并捕捉异常。在Java中，无论在代码何处抛出异常，JVM都会生成一个从程序入口到抛出异常方法的调用栈，这个机制在需要调用关系的场合非常有用，比如log4j，就是使用这种机制记录log的方法、行数、类名等等信息的。但是，这种机制是非常消耗资源的，因为调用栈里的每一个element都记录着方法、类、甚至行数（如果编译时打开“debug”开关）等信息，而这些信息都是通过反射机制从class文件里直接获得的。 通过对一堆类似huv、dww、dtg、gjt的混淆后的类的分析，终于找出了几个关键类： package z; public class dza extends hwn { // ... static { l = epv.a("Application.License.FULL", "Single-user license"); m = epv.a("Application.License.EVAL", "Evaluation license"); n = epv.a("Application.License.EAP", "EAP license"); o = epv.a("Application.License.OS", "License for open-source projects"); p = epv.a("Application.License.INVALID", "License is INVALID"); r = epv.a("Application.License.FLOATING", "Floating license"); s = epv.a("Application.License.PERSONAL", "Personal license"); t = <a href="http://www.jayxu.com/2008/05/07/352/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Synthetica破解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F05%2F10%2F221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Alloy</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IDEA，破解成功</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近破解上瘾了，昨天干到3点多，今天又花了一中午把<a href="http://www.almworks.com/deskzilla/overview.html" target="_blank">deskzilla</a>，一个bugzilla的桌面客户端）破解了。</p>
<p><a href="http://www.jayxu.com/log/wp-content/uploads/2008/05/crack.png"><img class="alignnone size-full wp-image-353" title="crack" src="http://www.jayxu.com/log/wp-content/uploads/2008/05/crack.png" alt="" width="403" height="236" /></a></p>
<p>这次破解花了很长时间，一是因为代码编译后被混淆了，找关键代码的时候着实花了不少时间。另一方面这个软件的license验证不是使用常见的布尔判断，而是用异常。这意味着必须仔细研究方法的调用栈，于是这次用了一个比较偷巧的方法：在代码中抛出并捕捉异常。在Java中，无论在代码何处抛出异常，JVM都会生成一个从程序入口到抛出异常方法的调用栈，这个机制在需要调用关系的场合非常有用，比如log4j，就是使用这种机制记录log的方法、行数、类名等等信息的。但是，这种机制是非常消耗资源的，因为调用栈里的每一个element都记录着方法、类、甚至行数（如果编译时打开“debug”开关）等信息，而这些信息都是通过反射机制从class文件里直接获得的。</p>
<p>通过对一堆类似huv、dww、dtg、gjt的混淆后的类的分析，终于找出了几个关键类：</p>
<pre lang="Java" line="1">
package z;

public class dza extends hwn {

    // ...

    static  {
        l = epv.a("Application.License.FULL", "Single-user license");
        m = epv.a("Application.License.EVAL", "Evaluation license");
        n = epv.a("Application.License.EAP", "EAP license");
        o = epv.a("Application.License.OS", "License for open-source projects");
        p = epv.a("Application.License.INVALID", "License is INVALID");
        r = epv.a("Application.License.FLOATING", "Floating license");
        s = epv.a("Application.License.PERSONAL", "Personal license");
        t = epv.a("Application.License.ACADEMIC", "Academic license");
        u = epv.a("Application.License.SITE", "Site license");
        a = new dza("FULL", l);
        b = new dza("PERSONAL", s);
        c = new dza("FLOATING", r);
        d = new dza("ACADEMIC", t);
        e = new dza("SITE", u);
        f = new dza("OS", o);
        g = new dza("EAP", n);
        h = new dza("KLEVAL", m);
        i = new dza("EVAL", m);
        j = new dza("INVALID", p);
    }

    // ...
}
</pre>
<p>可以看出这是定义license类型的类</p>
<pre lang="Java" line="1">
package z;

public class aef extends hwn {
    // ...

    public static final aef a = new gdo("UserName");
    public static final aef b = new gdo("UserCompany");
    public static final aef c = new fsf("CustomerID");
    public static final aef d = new fir("ExpirationDate");
    public static final aef e = new aef("LicenseType", dza.class);
    public static final aef f = new gdo("AdditionalInfo");
    public static final aef g = new fsf("MinBuild");
    public static final aef h = new fsf("MaxBuild");
    public static final aef i = new fsf("MaxLeaseCount");
    public static final aef m = new fsf("R");
    public static final Date j = new Date(0L);
    public static final Date k = new Date(1L);

    // ...
}
</pre>
<p>这个类定义了需要验证哪些内容，最后关键类的关键代码：</p>
<pre lang="Java" line="1">
package z;

public class huv implements cud {
    // ...

    public String a(aef aef1) {
        String s;

        if (aef1 == aef.d) {
            Date time = new Date(System.currentTimeMillis() + 24 * 60 * 60 * 1000);
            Calendar cal = Calendar.getInstance();
            cal.setTime(time);
            int year = cal.get(Calendar.YEAR);
            int month = cal.get(Calendar.MONTH) + 1;
            int day = cal.get(Calendar.DAY_OF_MONTH);

            s = "" + year;
            if (month < 10) {
                s += ("0" + month);
            }
            if (day < 10) {
                s += ("0" + day);
            }
        } else if (aef1 == aef.b) {
            s = "Nazca";
        } else if (aef1 == aef.f) {
            s = "to memorize my Macbook...";
        } else if (aef1 == aef.e) {
            return dza.a.h();
        } else if (aef1 == aef.a) {
            return "Cracked by Jay";
        } else if (aef1 == aef.i) {
            return "20";
        } else if (aef1 == aef.c) {
            return "1";
        } else {
            s = "";
        }

        return s;
    }

    // ...
}
</pre>
<p>可以看出过期时间定为当前时间的后一天，这样就永远不会过期了。最后编译，打包，替换原先的jar包，就行了。</p>
<p>最后提一句，破解时选择切入点非常重要。比如这次，我选择的切入点是相当靠后的，仅仅在字符串被送入验证方法之前。如果切入点再往前的话会很麻烦，因为看了一下代码，deskzilla的license是一个经3DES加密的XML文件，XML还需要用MD5校验，如果切入点是生成XML文件，那我还得搞到3DES的密钥，以及保证MD5验证通过。所谓打蛇打七寸，选对了切入点，往往有事半功倍的效果。
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/05/07/352/">Deskzilla Cracked</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F&title=Deskzilla+Cracked" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Synthetica破解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F05%2F10%2F221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Alloy</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IDEA，破解成功</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/05/07/352/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synthetica破解</title>
		<link>http://www.jayxu.com/2008/03/17/302/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=synthetica%25e7%25a0%25b4%25e8%25a7%25a3</link>
		<comments>http://www.jayxu.com/2008/03/17/302/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 02:29:34 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[破解]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/03/17/302/</guid>
		<description><![CDATA[话说前段时间提到把Synthetica给破了，而网上关于破解的文章很少，所以今天就详细说说我是怎么破的。 准备知识 Synthetica是一套很漂亮的Java的look &#38; feel，大家可以去主页上跑一下demo（JWS的，需要安装JRE） 。可惜是commercial的，虽然有评估版下载，但是恶心的是，在评估版界面的最下方会有一块多余的区域（下图） 那这次破解的目的就是把这块区域给去了。 就我这几次破解来看，破解主要分以下几个步骤： 1. 反编译 2. 找关键代码（比如序列号校验算法） 3. 修改源代码 4. 编译打包 其中第1步是前提，在这点上Java的byte code的反编译是比较容易的了，因为毕竟是中间码，而且编译期采取的优化手段不多，反编译过来的基本就是源码。这里推荐DJ Compiler，一个相当老牌的Java反编译器。值得注意的是并不是所有的byte code都能顺利反编译，有些Java程序会使用所谓的“混淆”技术对编译后的代码就行破坏，混淆器一般采用以下方法破坏代码： 1. 不可反编译。这点其实基本不可能 2. 反编译后代码不可读。这点相当恶心，混淆器会把类名、方法名、字段名替换成没有意义的名字，当你打开编辑器放眼望去全是“class A”，“int _fld00043”，“void _mhd2314”的时候你就知道该有多痛苦了 3. 插入不可编译代码。这一点也比较恶心，说穿了就是直接修改byte code中的指令，使用合法的，但不可能从源代码编译到的指令替代原有的指令（比较拗口），比如使用“goto”替代循环。这样你的代码即使可以反编译成源代码但只能看不能改，除非你把goto再替换回去 这次Syn并没有使用混淆，所以用DJ很轻易地就反编了，接下来的活就是怎么找关键代码。一开始我以为评估版输入序列号校验成功后就升级成商业版，于是在那儿找了半天序列号的校验方法，没找到。后来凯子提供一条线索，Syn的商业版是要重新下的，于是猜测评估版和商业版不是一个版本（有时候破解也是要点推理的：-）），估计不会校验注册码。于是改变方向找加那一行字的代码，最后找到了： public void paintBorder&#40;Component component, Graphics g, int j, int k, int l, int i1&#41;&#123; &#160; &#160; ... &#160; &#160; g.setColor&#40;UIManager.getColor&#40;&#34;Panel.background&#34;&#41;&#41;; &#160; &#160; g.fillRect&#40;j, i1, <a href="http://www.jayxu.com/2008/03/17/302/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IDEA，破解成功</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F05%2F10%2F221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Alloy</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F08%2F291%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">iPhone破解：1.0.2 -&gt; 1.1.3</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.mianfeidi.com%2F2011%2Fsenukex-2-0-6-cracked.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">英文外链核武器：SEnukeX 2.0.6破解版下载 (@mianfeidi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F4362.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">裤子破早操 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2704&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">公告：谨防购买低价破解版织梦采集侠，避免网站遭非法入侵 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F736.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">#操蛋事#736-小解 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>话说前段时间提到把<a href="http://www.javasoft.de/synthetica/themes/" target="_blank">Synthetica</a>给破了，而网上关于破解的文章很少，所以今天就详细说说我是怎么破的。</p>
<p><strong>准备知识</strong></p>
<p>Synthetica是一套很漂亮的Java的look &amp; feel，大家可以去主页上跑一下demo（JWS的，需要安装JRE） 。可惜是commercial的，虽然有评估版下载，但是恶心的是，在评估版界面的最下方会有一块多余的区域（下图）</p>
<p><a title="before.png" href="http://jayxu.com/log/wp-content/uploads/2008/03/before.png"><img src="http://jayxu.com/log/wp-content/uploads/2008/03/before.png" alt="before.png" /></a></p>
<p>那这次破解的目的就是把这块区域给去了。</p>
<p>就我这几次破解来看，破解主要分以下几个步骤：<br />
1. 反编译<br />
2. 找关键代码（比如序列号校验算法）<br />
3. 修改源代码<br />
4. 编译打包</p>
<p>其中第1步是前提，在这点上Java的byte code的反编译是比较容易的了，因为毕竟是中间码，而且编译期采取的优化手段不多，反编译过来的基本就是源码。这里推荐<a href="http://members.fortunecity.com/neshkov/dj.html" target="_blank">DJ Compiler</a>，一个相当老牌的Java反编译器。值得注意的是并不是所有的byte code都能顺利反编译，有些Java程序会使用所谓的“混淆”技术对编译后的代码就行破坏，混淆器一般采用以下方法破坏代码：<br />
1. 不可反编译。这点其实基本不可能<br />
2. 反编译后代码不可读。这点相当恶心，混淆器会把类名、方法名、字段名替换成没有意义的名字，当你打开编辑器放眼望去全是“class A”，“int _fld00043”，“void _mhd2314”的时候你就知道该有多痛苦了<br />
3. 插入不可编译代码。这一点也比较恶心，说穿了就是直接修改byte code中的指令，使用<span style="text-decoration: underline;">合法的，但不可能从源代码编译到的</span>指令替代原有的指令（比较拗口），比如使用“goto”替代循环。这样你的代码即使可以反编译成源代码但只能看不能改，除非你把goto再替换回去</p>
<p>这次Syn并没有使用混淆，所以用DJ很轻易地就反编了，接下来的活就是怎么找关键代码。一开始我以为评估版输入序列号校验成功后就升级成商业版，于是在那儿找了半天序列号的校验方法，没找到。后来凯子提供一条线索，Syn的商业版是要重新下的，于是猜测评估版和商业版不是一个版本（有时候破解也是要点推理的：-）），估计不会校验注册码。于是改变方向找加那一行字的代码，最后找到了：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw4">void</span> paintBorder<span class="br0">&#40;</span><span class="kw3">Component</span> component, <span class="kw3">Graphics</span> g, <span class="kw4">int</span> j, <span class="kw4">int</span> k, <span class="kw4">int</span> l, <span class="kw4">int</span> i1<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="me1">g</span>.<span class="me1">setColor</span><span class="br0">&#40;</span><span class="kw3">UIManager</span>.<span class="me1">getColor</span><span class="br0">&#40;</span><span class="st0">&quot;Panel.background&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; g.<span class="me1">fillRect</span><span class="br0">&#40;</span>j, i1, l, i1 <span class="sy0">+</span> <span class="nu0">16</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; g.<span class="me1">setColor</span><span class="br0">&#40;</span><span class="kw1">new</span> <span class="kw3">Color</span><span class="br0">&#40;</span>0xcc0000<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; g.<span class="me1">setFont</span><span class="br0">&#40;</span>g.<span class="me1">getFont</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">deriveFont</span><span class="br0">&#40;</span>10F<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; g.<span class="me1">drawString</span><span class="br0">&#40;</span><span class="st0">&quot;Synthetica - Unregistered Evaluation Copy!&quot;</span>, <span class="nu0">0</span>, k <span class="sy0">+</span> i1 <span class="sy0">+</span> g.<span class="me1">getFontMetrics</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getAscent</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public void paintBorder(Component component, Graphics g, int j, int k, int l, int i1){
    ...
    g.setColor(UIManager.getColor("Panel.background"));
    g.fillRect(j, i1, l, i1 + 16);
    g.setColor(new Color(0xcc0000));
    g.setFont(g.getFont().deriveFont(10F));
    g.drawString("Synthetica - Unregistered Evaluation Copy!", 0, k + i1 + g.getFontMetrics().getAscent());
    ...
}</pre></div></div>

<p>可以看出来它是通过Java 2D直接绘上去的，所以把这几句 注了，编译，打包，就ok了，最终结果：</p>
<p><a title="after.png" href="http://jayxu.com/log/wp-content/uploads/2008/03/after.png"><img src="http://jayxu.com/log/wp-content/uploads/2008/03/after.png" alt="after.png" /></a>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/03/17/302/">Synthetica破解</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F&title=Synthetica%E7%A0%B4%E8%A7%A3" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IDEA，破解成功</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F05%2F10%2F221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Alloy</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F08%2F291%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">iPhone破解：1.0.2 -&gt; 1.1.3</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.mianfeidi.com%2F2011%2Fsenukex-2-0-6-cracked.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">英文外链核武器：SEnukeX 2.0.6破解版下载 (@mianfeidi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F4362.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">裤子破早操 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2704&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">公告：谨防购买低价破解版织梦采集侠，避免网站遭非法入侵 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F736.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">#操蛋事#736-小解 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/03/17/302/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>思路有点乱，只想说</title>
		<link>http://www.jayxu.com/2007/07/16/58/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%2580%259d%25e8%25b7%25af%25e6%259c%2589%25e7%2582%25b9%25e4%25b9%25b1%25ef%25bc%258c%25e5%258f%25aa%25e6%2583%25b3%25e8%25af%25b4</link>
		<comments>http://www.jayxu.com/2007/07/16/58/#comments</comments>
		<pubDate>Sun, 15 Jul 2007 16:35:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[犯二]]></category>
		<category><![CDATA[编程]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=58</guid>
		<description><![CDATA[五年前，我是混进大学生队伍的痞子，在北京四年的摸爬滚打充分发掘出了我血液里山东人的那一份血气。一年前，我成了混入IT界的痞子，从此以code表达我的立场。那天强子开玩笑说如果当年方圆、老四他们软工挂科是在拍惊悚片的话，我们现在拍的就是毛片，别人看着很爽，coding的时候自己知道，委曲求全在心里。如果可以用Java我绝不会去用C++，如果可以用Swing我绝对不会选SWT，有netbeans这么好的IDE摆在那儿为什么还要用Eclipse这么一个操蛋玩意儿，有SVN了为什么还要用CVS，有Firefox为什么还要用IE，有thunder bird为什么还要用outlook，有搜狗为什么还要用微软拼音…… Eclipse代码看得越多越想骂街，才发现原来IBM里也有傻逼。累了，睡，明天还要上班。 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 思路有点乱，只想说<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F04%2F279%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">System.out.println(&quot;no title&quot;);</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F04%2F15%2F143%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">享受编程</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">中文编程语言？</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F19%2F2097%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">无路用的人 [张震岳]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>五年前，我是混进大学生队伍的痞子，在北京四年的摸爬滚打充分发掘出了我血液里山东人的那一份血气。一年前，我成了混入IT界的痞子，从此以code表达我的立场。那天强子开玩笑说如果当年方圆、老四他们软工挂科是在拍惊悚片的话，我们现在拍的就是毛片，别人看着很爽，coding的时候自己知道，委曲求全在心里。如果可以用Java我绝不会去用C++，如果可以用Swing我绝对不会选SWT，有netbeans这么好的IDE摆在那儿为什么还要用Eclipse这么一个操蛋玩意儿，有SVN了为什么还要用CVS，有Firefox为什么还要用IE，有thunder bird为什么还要用outlook，有搜狗为什么还要用微软拼音……</p>
<p>Eclipse代码看得越多越想骂街，才发现原来IBM里也有傻逼。累了，睡，明天还要上班。
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2007/07/16/58/">思路有点乱，只想说</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F&title=%E6%80%9D%E8%B7%AF%E6%9C%89%E7%82%B9%E4%B9%B1%EF%BC%8C%E5%8F%AA%E6%83%B3%E8%AF%B4" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F04%2F279%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">System.out.println(&quot;no title&quot;);</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F04%2F15%2F143%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">享受编程</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">中文编程语言？</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F19%2F2097%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">无路用的人 [张震岳]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2007/07/16/58/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>相当随的笔</title>
		<link>http://www.jayxu.com/2007/06/08/66/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e7%259b%25b8%25e5%25bd%2593%25e9%259a%258f%25e7%259a%2584%25e7%25ac%2594</link>
		<comments>http://www.jayxu.com/2007/06/08/66/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 15:33:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[生活]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[工作]]></category>
		<category><![CDATA[招聘]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=66</guid>
		<description><![CDATA[1. 今天一天基本没干其它事，一共面了5个人，虚脱了。要是技术强点的我还能忍受，妈的来了几个一问三不知的，他妈来面试干嘛啊！ 2. SWT是傻逼，JFace是傻逼，Eclipse的RCP是傻逼，IBM是傻逼。写出来的东西文档巨少，没有OO概念，一堆整数常量（有时候还得对整数做逻辑与操作），一堆全局变量（虽然用方法调用封装），我现在一看ResourcePlugin.getWorkspace().getActiveWorkspaceWindow().getActivePage().getShell()就想抽丫挺的。还有就是一个IResource接口（和子接口）定义了二三十个方法，要自己实现基本没戏，然后还很贱地给了一堆实现类，像File（实现IFile），Project（实现IProject），却把实现类放在internal包下面（Eclipse的inernal包不推荐二次开发人员使用）。更贱的是一些方法的参数直接要实现类，拿到接口还得做向下转型。妈的IBM那帮人脑子进水了啊，你不会用类继承啊，不懂OO就别他妈在那儿装逼，回去写你的C去吧，别在这儿糟贱Java！ 3. 北京的司机开车就他妈不知道谦让啊，今天晚上9点多打车到五道口，王庄路那个十字路口都堵上了四面八方的车还往里拥，你们他妈都急着投胎啊，幸亏的哥不错，让我下车，要不我现在还在车上呢！ 4. Bootcamp 1.3 beta 发布了，正在下，不知道改进了什么，估计又是升级Windows下的驱动，玩Mac的朋友可以更新一下。Bootcamp一次比一次大，这次已经到280M了。Leopard快出来啊，iPhone快出来啊。 5. 上周末韬子回北京，跟丫爽了一把，喝完啤酒还去Pepper干了半瓶伏特加，虽然期间吐了几次，第二天胃也烧得慌，但难得一次，相当尽兴。强子的胃彻底废了，前车之鉴啊，要限酒了。 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 相当随的笔<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F08%2F24%2F1711%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Snow Leopard终于要来了~~</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F11%2F07%2F25%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X竟然开源了</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F30%2F1487%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard下的RSS Visualizer（屏保）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关64位Snow Leopard</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F08%2F10599%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Android vs iPhone</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>1. 今天一天基本没干其它事，一共面了5个人，虚脱了。要是技术强点的我还能忍受，妈的来了几个一问三不知的，他妈来面试干嘛啊！</p>
<p>2. SWT是傻逼，JFace是傻逼，Eclipse的RCP是傻逼，IBM是傻逼。写出来的东西文档巨少，没有OO概念，一堆整数常量（有时候还得对整数做逻辑与操作），一堆全局变量（虽然用方法调用封装），我现在一看ResourcePlugin.getWorkspace().getActiveWorkspaceWindow().getActivePage().getShell()就想抽丫挺的。还有就是一个IResource接口（和子接口）定义了二三十个方法，要自己实现基本没戏，然后还很贱地给了一堆实现类，像File（实现IFile），Project（实现IProject），却把实现类放在internal包下面（Eclipse的inernal包不推荐二次开发人员使用）。更贱的是一些方法的参数直接要实现类，拿到接口还得做向下转型。妈的IBM那帮人脑子进水了啊，你不会用类继承啊，不懂OO就别他妈在那儿装逼，回去写你的C去吧，别在这儿糟贱Java！</p>
<p>3. 北京的司机开车就他妈不知道谦让啊，今天晚上9点多打车到五道口，王庄路那个十字路口都堵上了四面八方的车还往里拥，你们他妈都急着投胎啊，幸亏的哥不错，让我下车，要不我现在还在车上呢！</p>
<p>4. Bootcamp 1.3 beta 发布了，正在下，不知道改进了什么，估计又是升级Windows下的驱动，玩Mac的朋友可以更新一下。Bootcamp一次比一次大，这次已经到280M了。Leopard快出来啊，iPhone快出来啊。</p>
<p>5. 上周末韬子回北京，跟丫爽了一把，喝完啤酒还去Pepper干了半瓶伏特加，虽然期间吐了几次，第二天胃也烧得慌，但难得一次，相当尽兴。强子的胃彻底废了，前车之鉴啊，要限酒了。
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2007/06/08/66/">相当随的笔</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F&title=%E7%9B%B8%E5%BD%93%E9%9A%8F%E7%9A%84%E7%AC%94" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F08%2F24%2F1711%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Snow Leopard终于要来了~~</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F11%2F07%2F25%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X竟然开源了</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F30%2F1487%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard下的RSS Visualizer（屏保）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关64位Snow Leopard</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F08%2F10599%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F06%2F08%2F66%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Android vs iPhone</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2007/06/08/66/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>中文编程语言？</title>
		<link>http://www.jayxu.com/2007/04/26/68/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25b8%25ad%25e6%2596%2587%25e7%25bc%2596%25e7%25a8%258b%25e8%25af%25ad%25e8%25a8%2580%25ef%25bc%259f</link>
		<comments>http://www.jayxu.com/2007/04/26/68/#comments</comments>
		<pubDate>Thu, 26 Apr 2007 15:49:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[编程]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=68</guid>
		<description><![CDATA[大四的时候跟方圆和强子在阳台抽烟的时候突发奇想，想搞一个中文的编程语言，再仔细一琢磨，词法分析，语法分析上一点问题都没有，只是把标识符换成中文字符而已，但是真要写出来的话会比较诡异，恐怕广大灰领们短时间内接受不了（高亮为关键字）： 包 包一; 导入 爪哇.语言.系统.所有; &#160; 公有 类 类一 继承 类二 实现 接口三 &#123; &#160; &#160; 公有 静态 无返回值 主&#40;字符串 数组 数组一&#41; 会抛 异常一 &#123; &#160; &#160; &#160; &#160; &#160;对于 &#40;整型 啊 等于 0;啊 小于 100;啊 连加&#41; &#123; &#160; &#160; &#160; &#160; &#160; &#160; &#160;若&#40;数组一.长 恒等 1&#41; &#123; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <a href="http://www.jayxu.com/2007/04/26/68/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F04%2F15%2F143%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">享受编程</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F10%2F139%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Happy Coding Friends</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F11%2F295%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">printf(&quot;no title&quot;);</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">思路有点乱，只想说</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F04%2F279%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">System.out.println(&quot;no title&quot;);</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>大四的时候跟方圆和强子在阳台抽烟的时候突发奇想，想搞一个中文的编程语言，再仔细一琢磨，词法分析，语法分析上一点问题都没有，只是把标识符换成中文字符而已，但是真要写出来的话会比较诡异，恐怕广大灰领们短时间内接受不了（高亮为关键字）：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">包 包一<span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">导入 爪哇.语言.系统.所有<span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">公有 类 类一 继承 类二 实现 接口三 <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; 公有 静态 无返回值 主<span class="br0">&#40;</span>字符串 数组 数组一<span class="br0">&#41;</span> 会抛 异常一 <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;对于 <span class="br0">&#40;</span>整型 啊 等于 <span class="nu0">0</span><span class="sy0">;</span>啊 小于 <span class="nu0">100</span><span class="sy0">;</span>啊 连加<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;若<span class="br0">&#40;</span>数组一.长 恒等 <span class="nu0">1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;系统.输出.打印<span class="br0">&#40;</span><span class="st0">&quot;你好&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span> 否则 <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;扔 新 异常一<span class="br0">&#40;</span><span class="st0">&quot;参数过短&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">包 包一;
导入 爪哇.语言.系统.所有;

公有 类 类一 继承 类二 实现 接口三 {
    公有 静态 无返回值 主(字符串 数组 数组一) 会抛 异常一 {
         对于 (整型 啊 等于 0;啊 小于 100;啊 连加) {
             若(数组一.长 恒等 1) {
                 系统.输出.打印("你好");
             } 否则 {
                 扔 新 异常一("参数过短");
             }
         }
    }
}</pre></div></div>

<p>p.s. 现在javac已经开源了，有兴趣的同学只要自己定一套关键字，然后修改词法分析部分就行了。要真搞出这么一个东西别忘了把我放在鸣谢里哈：）
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2007/04/26/68/">中文编程语言？</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F&title=%E4%B8%AD%E6%96%87%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80%EF%BC%9F" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F04%2F15%2F143%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">享受编程</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F10%2F139%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Happy Coding Friends</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F11%2F295%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">printf(&quot;no title&quot;);</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F07%2F16%2F58%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">思路有点乱，只想说</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F04%2F279%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">System.out.println(&quot;no title&quot;);</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2007/04/26/68/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>我是谁？（一）</title>
		<link>http://www.jayxu.com/2007/02/07/105/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%2588%2591%25e6%2598%25af%25e8%25b0%2581%25ef%25bc%259f%25ef%25bc%2588%25e4%25b8%2580%25ef%25bc%2589</link>
		<comments>http://www.jayxu.com/2007/02/07/105/#comments</comments>
		<pubDate>Tue, 06 Feb 2007 17:05:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[动漫]]></category>
		<category><![CDATA[北航]]></category>
		<category><![CDATA[愤青]]></category>
		<category><![CDATA[朋友]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=105</guid>
		<description><![CDATA[本命年了，大学毕业了，工作了半年多了，在北京混了4年多了，天南海北的交了一帮朋友了。不知道他们是怎么看我，可能很多人其实并不了解我。这样吧，从今天开始自我审视一下，看一下或者说向各位展示一下我到底是个什么样的人。诸位看官，有空的评论一下，让我大概了解一下我在别人眼里的形象。大家是愿意评啊，是愿意评啊，是愿意评啊？ 初中开始受韩寒的影响（他应该算是我的同龄人吧，当时只知道哥们儿挺牛逼，门门挂红灯却把当时半拉上海市尤其是所谓的“教育界”折腾得鸡犬不宁，天天研究“韩寒现象”），文章比较愤，看不惯的就开骂。当然了，当时骂得算是相当文明的，一是年纪太小，而且光在上海待着，粗口知道得不多，二是作文都是要交的，我还没到韩寒这么不要命的地步，不太敢得罪老师。如果照现在的情况，再写文章恐怕是粗口满篇，而且还都是京片子，搞不好生殖器都得扯上几个。后来到了大学发现这个性格并不是传说中的“青春期叛逆心理”，并没有随着青春期的结束而终止（或者说我现在还在发育期？），反而似乎有愈演愈烈之势。记忆中印象较深的在大学四年当面骂过三个人，其中两个老师，还有一个是老八。 第一个是张茂林（既然老师当到这个份上就不用留面子了），大一上的时候教计算机导论。因为那是大一唯一一门专业课，而且教材是全英文，所以预习得比较认真，天天在宿舍抱着字典啃。顺便插一句，在宿舍看书的时候发现其它省市的计算机普及教育做得太次了。虽然也是第一次看英文得计算机教材，但是很多词一查字典就能和脑子里的中文概念对起来，比如stack和list，buble sort和quick sort。而那帮哥们儿则查了字典只能知道字面意思。于是后来在宿舍里我开始给他们讲一些“计算机概论”。上课前原以为那门课应该很有趣，因为书里涵盖的范围相当广，从硬件到数据结构到算法到操作系统，心里想着就算用中文讲也应该获益匪浅。结果那门课让那个姓张的活活的给教成了英文课，每堂课的内容都是从书里摘出几段，然后翻译成中文讲一遍。于是再上课我都是带着walkman去的（大一年纪太轻，还不知道翘课）。有一节课我带着耳机在看书，在两首歌的间歇听见了那孙子在讲编程语言类型，有一种是“declarative language”，生生让丫译成了“宣告型语言”，于是我当时就骂了一句“我操，什么叫宣告型语言啊”。可能大家都有经验，一般听歌的时候说话会比较大声，结果整个班的同学顺着声音朝我投来了景仰的目光。当然了，大家景仰的是我当堂“我操”，而不是我指出了他的错误。我抬头看了丫一眼，结果孙子什么反应都没有，继续讲课…… 第二个是刘超，现在好像是北航软件所的所长。他讲的是OO，大家可以在我的博客上找一下，2005年3月份我应该专门写过一篇博客，全文如下（http://scjp.spaces.live.com/blog/cns!8B55061AA378FE77!193.entry）： 程序员的信仰……不要误人子弟 这个学期大三（下），终于到了“熬出头”日子，因为全部是专业课，不用再上什么大物啊、数电啊、模电啊这些我一看了课表就想吐的课程，而且还有很多专业选修课可以上，再有就是我们学院的开课老师都挺有名气，像上操作系统的任爱华，上个人软件过程的吴超英……。 一拿到专业选修课的课表，我立马把“面向对象技术”列在选择范围之内，道理很简单，因为Java。第一节课，那老师看上去有快50的年纪，上得还算中规中矩，介绍了一下面向对象技术的历史。但从第二节课开始，他介绍Java基本知识，我的恶梦也开始了…… 首先是类型介绍，他赫然把String和int、double一起作为Java的类型来介绍。然后，他竟然自做主张地把System类划分到了java.io包下，范例程序中每次从标准输出打印时都要import一下io包。在讲布尔类型时他的幻灯片里还出现了“&#60;boolean&#62;!”（非操作）这样的语法。今天的课上，他把override译成了“重构”，还在Java的collention框架里添加了一个“dictionary”，结果听他一讲原来是map！还有其它的一些错误比如混用“boolean”和“Boolean”、“String”和“string”、“＝”和“＝＝”，真不知道他是不是科班出身。 前些天和同学聊天，我说程序员是有信仰的，对语言的执着、对技术的追求，那就是一种信仰。然而这个老师竟公然亵渎我的信仰，还将这么多的错误知识从讲台上传授下来，真的害人不浅。中国的计算机教育或者说大学计算机教育忽视教学质量，是不是滞后中国软件业发展的一个因素呢？ 结果那哥们儿果真在他的期末考试卷里出了这么一道题“请阐述一下重载和重构的区别”。我当时压着火气写下的答案是先分析了一下重构的含义，再比较了一下重载和覆盖的区别，然后善意地提醒他题目出错了。要不是不想在毕业的时候因为没有毕业证去跳如心楼，我早把他妈捎上了。 下一个就是老八了。骂他主要是因为丫大四前太没出息，整天无所事事，看电视，玩游戏，就是不干正经事。每次跟我要Java书看，说要学，结果每次都坚持不了三天。于是大三过完寒假有一天我实在忍不住了，在宿舍（好像当时就我们两个人）劈头盖脸把丫臭骂了一顿，具体内容就不贴了，脏字较多，属于限制级。自那以后丫稍微好一点，有点上进心了，结果大四顺利考上了6系的公费。但现在有时还是来问我一些Java的东西，每次问我都先骂一句“孙子你早干嘛去了？” 好了，先写这么多吧，最后以高中发在榕树下的一篇文章（应该算Blog的雏形了）结尾，让大家看一下当时我的笔风（发于2002年8月，可惜的是，5年过去了，中国的动漫一点气色都没有，倒有另一帮孙子做出了《蓝猫》这么一个不伦不类的怪胎）： 国产动画，给我一个看你的理由 如今的上海荧幕，可谓灿烂，好片云集，佳作不断。而对我来说，大概只能用八个字来形容：“风起云涌，暗自心痛”，因为里面少了我爱看的动画片。有人可能会惊奇——如今动画片已经不少了，像前一阵子大红大紫而今又在重播的《我为歌狂》，还有《封神榜》，都是动辄几十集的国产大片，为何还如此不知足呢？而我想说的是，如果这种东西也可以称作是动画片的话，那可以说，我对中国的动画界彻底地丧失了信心。 先让我们回到1999年。《宝莲灯》，号称“耗时五年，精心打造的第一部国产巨片”，就像炫耀了五千年的中国悠久的历史一样，这一次，国人又凭这“五年”为老本大肆卖弄了一番。这部电影是我自己掏钱去看的，也是本人自懂事以来第二次自己掏钱上电影院，为了就是给这部中国动画界的“圣婴”捧个场。客观地讲，这部电影还过得去，画面应该可以和八十年代的日本货一较高下了，再加上不少明星担任配音以及滚石公司鼎力制作的主题曲和插曲，更是增加了可看性。然而一想到那些铺天盖地的广告，我就一阵心酸——一个孕育了五年的生命竟然还是如此地平庸？“历时五年精心打造”？五年就打造出这么一个马戏团里只能用来赚钱，供大家娱乐的，严重发育不良的——侏儒？我是《名侦探柯南》的忠实观众。就我掌握的资料，《柯南》一共出了252集30分钟的电视版以及5部120分钟的剧场版。而照中国这种120分钟/5年的速度得340年才能赶上别人一部动画片的量，而质则比别人整整落后了二十年。 再看电视荧屏。 《封神榜》以其极差的画面以及零内涵给我留下了很深的——坏印象。它那种背景与前景分开处理的手法以及能够在人物脸部的向光处打出阴影的技巧，着实让我叹为观止。其次它把最根本的内容置之度外，这种洒脱也让我折服。《封神演义》之所以能被列为中国古典名著之一，主要是因为其丰富的内涵以及对众多人物的刻画。照理来说，将这部文学巨作搬上荧幕，这些特色理应秉承。而这部动画片只是平淡地白描，对人物的刻画也粗糙至极，只是让观众分出起码的善恶。可能是因为它的观众群只是定格在儿童这一低年龄段而怕太深奥了小朋友们看不懂吧？如果真是这样，那我终于从它身上找到了一个优点——平易近人，体贴的人性化设计。然而这是不可能的。如今说许多大人长不大，二十岁的人了还在看动画片。我就属于这些“长不大”之辈，但我看的决不是国产动画。因为中国的动画片已经丧失了内涵，这本是国人最引以为傲的，如今连这个也没了，还凭什么吸引我去看？那样做只会降低我的身份。 还有《我为歌狂》，也是不堪入目。其画面只是重复的几张静止的幻灯片的播放穿插一些同样重复的诸如人物面部表情变化的GIF图片以及一些背景音乐。这种东西一台电脑加一个PowerPoint就能搞定。而它的内容也只是《灌篮高手》的翻版，只是将篮球队的故事搬到了乐队罢了。而我认为，一味地模仿，只能失去本属于自己的东西，更何况自己本来就没有多少东西。 没有灵魂的躯壳、蹩脚的克隆技术，除了这些，还有其它原因致使国产动画离我越来越远吗？我认为还有。 有人说，阻碍国产动画发展的，是因为盗版的泛滥，就像过去国产软件在市场上的大萧条一样。胡扯！自己不争气却怪外界环境，就好像葡萄长不成西瓜却怪光照不充分一样。你凭什么拉我们去买你的正版VCD？凭什么让我们去受你的视觉污染？还有人说国产动画的不成熟是因为没有经费上的支持。无稽之谈！《宝莲灯》上映以后从市场上赚了多少钱？光从我身上就榨走了35块钱。现在都已经3年了，怎么一点动静都没有，难道又难产了？ 此外，就是主旨。国外动画片是以娱乐为主，而在轻松当中融入自己本民族的特色和作者自己的人生哲理。他们画出来的是娱乐，是智慧，而他们自己是学者，是大家，受人尊敬。比如《柯南》的作者青山冈昌，就在日本享有很高的知名度。而中国的动画片一开始就定下了“寓教于乐”的大方向，使动画片在娱乐性上的发挥受到了很大的限制。因此，国产动画只能成为教材，而且是幼稚园的教材，而他们的作者顶多只是个画家，只能得到小小孩们的一时的崇拜，而不是长久的社会的认可，就好像我到现在还不知道《宝莲灯》是哪一个画的。 还有，就是老掉牙的题材。中国人太讲究传统以至于那些“中华美德”、“中华成语”、“自古英雄出少年”天天挂在嘴边教育下一代的不够，还要一咕脑儿往银幕上搬，形成听觉、视觉双方面的攻势。而画这些东西的都是些不开化的中年人，这样能有什么创新？什么改革？如此下去，国产动画恐怕前途渺茫。 最后，就是优秀作品的选拔问题。日本有一个叫“小学馆漫画奖”已经举办了50多届，从中选拔出了许多诸如《柯南》、《浪客剑心》等优秀作品。而国内的漫画大奖赛去年好像只是第一届，这样就导致许多优秀的动漫作品不能与广大观众见面，只能作者与周遭的朋友分享。这不也是一种影响国产动画发展的障碍吗？ 大家一定还记得那个老掉牙的笑话，说中国与韩国国家男足主教练在世界杯预选赛之前去向上帝预测球队的未来。结果上帝给车范根的回答只是让他老泪纵横地走出了教堂，而面对戚务生时，上帝自己却泣不成声。中国何时才能做出让我们这些大孩子抱着不放的动画片？我不打算去问上帝，因为，我不想天上下雨！ 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 我是谁？（一）<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F10%2F19%2F119%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">北航宣讲会</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F10%2F15%2F1767%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">我的大学回忆：猥琐的北航猥琐的事 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F03%2F16%2F231%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">程序员的信仰……我想骂人</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F01%2F28%2F114%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">北航就业歌 [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>本命年了，大学毕业了，工作了半年多了，在北京混了4年多了，天南海北的交了一帮朋友了。不知道他们是怎么看我，可能很多人其实并不了解我。这样吧，从今天开始自我审视一下，看一下或者说向各位展示一下我到底是个什么样的人。诸位看官，有空的评论一下，让我大概了解一下我在别人眼里的形象。大家是愿意评啊，是愿意评啊，是愿意评啊？</p>
<p>初中开始受韩寒的影响（他应该算是我的同龄人吧，当时只知道哥们儿挺牛逼，门门挂红灯却把当时半拉上海市尤其是所谓的“教育界”折腾得鸡犬不宁，天天研究“韩寒现象”），文章比较愤，看不惯的就开骂。当然了，当时骂得算是相当文明的，一是年纪太小，而且光在上海待着，粗口知道得不多，二是作文都是要交的，我还没到韩寒这么不要命的地步，不太敢得罪老师。如果照现在的情况，再写文章恐怕是粗口满篇，而且还都是京片子，搞不好生殖器都得扯上几个。后来到了大学发现这个性格并不是传说中的“青春期叛逆心理”，并没有随着青春期的结束而终止（或者说我现在还在发育期？），反而似乎有愈演愈烈之势。记忆中印象较深的在大学四年当面骂过三个人，其中两个老师，还有一个是老八。</p>
<p>第一个是张茂林（既然老师当到这个份上就不用留面子了），大一上的时候教计算机导论。因为那是大一唯一一门专业课，而且教材是全英文，所以预习得比较认真，天天在宿舍抱着字典啃。顺便插一句，在宿舍看书的时候发现其它省市的计算机普及教育做得太次了。虽然也是第一次看英文得计算机教材，但是很多词一查字典就能和脑子里的中文概念对起来，比如stack和list，buble sort和quick sort。而那帮哥们儿则查了字典只能知道字面意思。于是后来在宿舍里我开始给他们讲一些“计算机概论”。上课前原以为那门课应该很有趣，因为书里涵盖的范围相当广，从硬件到数据结构到算法到操作系统，心里想着就算用中文讲也应该获益匪浅。结果那门课让那个姓张的活活的给教成了英文课，每堂课的内容都是从书里摘出几段，然后翻译成中文讲一遍。于是再上课我都是带着walkman去的（大一年纪太轻，还不知道翘课）。有一节课我带着耳机在看书，在两首歌的间歇听见了那孙子在讲编程语言类型，有一种是“declarative language”，生生让丫译成了“宣告型语言”，于是我当时就骂了一句“我操，什么叫宣告型语言啊”。可能大家都有经验，一般听歌的时候说话会比较大声，结果整个班的同学顺着声音朝我投来了景仰的目光。当然了，大家景仰的是我当堂“我操”，而不是我指出了他的错误。我抬头看了丫一眼，结果孙子什么反应都没有，继续讲课……</p>
<p>第二个是刘超，现在好像是北航软件所的所长。他讲的是OO，大家可以在我的博客上找一下，2005年3月份我应该专门写过一篇博客，全文如下（<a href="http://scjp.spaces.live.com/blog/cns!8B55061AA378FE77!193.entry" target="_blank">http://scjp.spaces.live.com/blog/cns!8B55061AA378FE77!193.entry</a>）：</p>
<p><strong>程序员的信仰……不要误人子弟</strong></p>
<blockquote><p><span style="font-style: normal;">这个学期大三（下），终于到了“熬出头”日子，因为全部是专业课，不用再上什么大物啊、数电啊、模电啊这些我一看了课表就想吐的课程，而且还有很多专业选修课可以上，再有就是我们学院的开课老师都挺有名气，像上操作系统的任爱华，上个人软件过程的吴超英……。</span></p>
<p><span style="font-style: normal;">一拿到专业选修课的课表，我立马把“面向对象技术”列在选择范围之内，道理很简单，因为Java。第一节课，那老师看上去有快50的年纪，上得还算中规中矩，介绍了一下面向对象技术的历史。但从第二节课开始，他介绍Java基本知识，我的恶梦也开始了……</span></p>
<p><span style="font-style: normal;">首先是类型介绍，他赫然把String和int、double一起作为Java的类型来介绍。然后，他竟然自做主张地把System类划分到了java.io包下，范例程序中每次从标准输出打印时都要import一下io包。在讲布尔类型时他的幻灯片里还出现了“&lt;boolean&gt;!”（非操作）这样的语法。今天的课上，他把override译成了“重构”，还在Java的collention框架里添加了一个“dictionary”，结果听他一讲原来是map！还有其它的一些错误比如混用“boolean”和“Boolean”、“String”和“string”、“＝”和“＝＝”，真不知道他是不是科班出身。</span></p>
<p><span style="font-style: normal;">前些天和同学聊天，我说程序员是有信仰的，对语言的执着、对技术的追求，那就是一种信仰。然而这个老师竟公然亵渎我的信仰，还将这么多的错误知识从讲台上传授下来，真的害人不浅。中国的计算机教育或者说大学计算机教育忽视教学质量，是不是滞后中国软件业发展的一个因素呢？</span></p></blockquote>
<p>结果那哥们儿果真在他的期末考试卷里出了这么一道题“请阐述一下重载和重构的区别”。我当时压着火气写下的答案是先分析了一下重构的含义，再比较了一下重载和覆盖的区别，然后善意地提醒他题目出错了。要不是不想在毕业的时候因为没有毕业证去跳如心楼，我早把他妈捎上了。</p>
<p>下一个就是老八了。骂他主要是因为丫大四前太没出息，整天无所事事，看电视，玩游戏，就是不干正经事。每次跟我要Java书看，说要学，结果每次都坚持不了三天。于是大三过完寒假有一天我实在忍不住了，在宿舍（好像当时就我们两个人）劈头盖脸把丫臭骂了一顿，具体内容就不贴了，脏字较多，属于限制级。自那以后丫稍微好一点，有点上进心了，结果大四顺利考上了6系的公费。但现在有时还是来问我一些Java的东西，每次问我都先骂一句“孙子你早干嘛去了？”</p>
<p>好了，先写这么多吧，最后以高中发在榕树下的一篇文章（应该算Blog的雏形了）结尾，让大家看一下当时我的笔风（发于2002年8月，可惜的是，5年过去了，中国的动漫一点气色都没有，倒有另一帮孙子做出了《蓝猫》这么一个不伦不类的怪胎）：</p>
<p><strong>国产动画，给我一个看你的理由</strong></p>
<blockquote><p><span style="font-style: normal;">如今的上海荧幕，可谓灿烂，好片云集，佳作不断。而对我来说，大概只能用八个字来形容：“风起云涌，暗自心痛”，因为里面少了我爱看的动画片。有人可能会惊奇——如今动画片已经不少了，像前一阵子大红大紫而今又在重播的《我为歌狂》，还有《封神榜》，都是动辄几十集的国产大片，为何还如此不知足呢？而我想说的是，如果这种东西也可以称作是动画片的话，那可以说，我对中国的动画界彻底地丧失了信心。</span></p>
<p><span style="font-style: normal;">先让我们回到1999年。《宝莲灯》，号称“耗时五年，精心打造的第一部国产巨片”，就像炫耀了五千年的中国悠久的历史一样，这一次，国人又凭这“五年”为老本大肆卖弄了一番。这部电影是我自己掏钱去看的，也是本人自懂事以来第二次自己掏钱上电影院，为了就是给这部中国动画界的“圣婴”捧个场。客观地讲，这部电影还过得去，画面应该可以和八十年代的日本货一较高下了，再加上不少明星担任配音以及滚石公司鼎力制作的主题曲和插曲，更是增加了可看性。然而一想到那些铺天盖地的广告，我就一阵心酸——一个孕育了五年的生命竟然还是如此地平庸？“历时五年精心打造”？五年就打造出这么一个马戏团里只能用来赚钱，供大家娱乐的，严重发育不良的——侏儒？我是《名侦探柯南》的忠实观众。就我掌握的资料，《柯南》一共出了252集30分钟的电视版以及5部120分钟的剧场版。而照中国这种120分钟/5年的速度得340年才能赶上别人一部动画片的量，而质则比别人整整落后了二十年。<br />
再看电视荧屏。</span></p>
<p><span style="font-style: normal;">《封神榜》以其极差的画面以及零内涵给我留下了很深的——坏印象。它那种背景与前景分开处理的手法以及能够在人物脸部的向光处打出阴影的技巧，着实让我叹为观止。其次它把最根本的内容置之度外，这种洒脱也让我折服。《封神演义》之所以能被列为中国古典名著之一，主要是因为其丰富的内涵以及对众多人物的刻画。照理来说，将这部文学巨作搬上荧幕，这些特色理应秉承。而这部动画片只是平淡地白描，对人物的刻画也粗糙至极，只是让观众分出起码的善恶。可能是因为它的观众群只是定格在儿童这一低年龄段而怕太深奥了小朋友们看不懂吧？如果真是这样，那我终于从它身上找到了一个优点——平易近人，体贴的人性化设计。然而这是不可能的。如今说许多大人长不大，二十岁的人了还在看动画片。我就属于这些“长不大”之辈，但我看的决不是国产动画。因为中国的动画片已经丧失了内涵，这本是国人最引以为傲的，如今连这个也没了，还凭什么吸引我去看？那样做只会降低我的身份。</span></p>
<p><span style="font-style: normal;">还有《我为歌狂》，也是不堪入目。其画面只是重复的几张静止的幻灯片的播放穿插一些同样重复的诸如人物面部表情变化的GIF图片以及一些背景音乐。这种东西一台电脑加一个PowerPoint就能搞定。而它的内容也只是《灌篮高手》的翻版，只是将篮球队的故事搬到了乐队罢了。而我认为，一味地模仿，只能失去本属于自己的东西，更何况自己本来就没有多少东西。</span></p>
<p><span style="font-style: normal;">没有灵魂的躯壳、蹩脚的克隆技术，除了这些，还有其它原因致使国产动画离我越来越远吗？我认为还有。</span></p>
<p><span style="font-style: normal;">有人说，阻碍国产动画发展的，是因为盗版的泛滥，就像过去国产软件在市场上的大萧条一样。胡扯！自己不争气却怪外界环境，就好像葡萄长不成西瓜却怪光照不充分一样。你凭什么拉我们去买你的正版VCD？凭什么让我们去受你的视觉污染？还有人说国产动画的不成熟是因为没有经费上的支持。无稽之谈！《宝莲灯》上映以后从市场上赚了多少钱？光从我身上就榨走了35块钱。现在都已经3年了，怎么一点动静都没有，难道又难产了？</span></p>
<p><span style="font-style: normal;">此外，就是主旨。国外动画片是以娱乐为主，而在轻松当中融入自己本民族的特色和作者自己的人生哲理。他们画出来的是娱乐，是智慧，而他们自己是学者，是大家，受人尊敬。比如《柯南》的作者青山冈昌，就在日本享有很高的知名度。而中国的动画片一开始就定下了“寓教于乐”的大方向，使动画片在娱乐性上的发挥受到了很大的限制。因此，国产动画只能成为教材，而且是幼稚园的教材，而他们的作者顶多只是个画家，只能得到小小孩们的一时的崇拜，而不是长久的社会的认可，就好像我到现在还不知道《宝莲灯》是哪一个画的。</span></p>
<p><span style="font-style: normal;">还有，就是老掉牙的题材。中国人太讲究传统以至于那些“中华美德”、“中华成语”、“自古英雄出少年”天天挂在嘴边教育下一代的不够，还要一咕脑儿往银幕上搬，形成听觉、视觉双方面的攻势。而画这些东西的都是些不开化的中年人，这样能有什么创新？什么改革？如此下去，国产动画恐怕前途渺茫。</span></p>
<p><span style="font-style: normal;">最后，就是优秀作品的选拔问题。日本有一个叫“小学馆漫画奖”已经举办了50多届，从中选拔出了许多诸如《柯南》、《浪客剑心》等优秀作品。而国内的漫画大奖赛去年好像只是第一届，这样就导致许多优秀的动漫作品不能与广大观众见面，只能作者与周遭的朋友分享。这不也是一种影响国产动画发展的障碍吗？</span></p>
<p><span style="font-style: normal;">大家一定还记得那个老掉牙的笑话，说中国与韩国国家男足主教练在世界杯预选赛之前去向上帝预测球队的未来。结果上帝给车范根的回答只是让他老泪纵横地走出了教堂，而面对戚务生时，上帝自己却泣不成声。中国何时才能做出让我们这些大孩子抱着不放的动画片？我不打算去问上帝，因为，我不想天上下雨！</span></p></blockquote>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2007/02/07/105/">我是谁？（一）</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F&title=%E6%88%91%E6%98%AF%E8%B0%81%EF%BC%9F%EF%BC%88%E4%B8%80%EF%BC%89" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F10%2F19%2F119%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">北航宣讲会</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F10%2F15%2F1767%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">我的大学回忆：猥琐的北航猥琐的事 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F03%2F16%2F231%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">程序员的信仰……我想骂人</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F01%2F28%2F114%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2007%2F02%2F07%2F105%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">北航就业歌 [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2007/02/07/105/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Taste of Life</title>
		<link>http://www.jayxu.com/2006/05/16/137/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=taste-of-life</link>
		<comments>http://www.jayxu.com/2006/05/16/137/#comments</comments>
		<pubDate>Tue, 16 May 2006 06:46:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[小资]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=137</guid>
		<description><![CDATA[一个宁静的下午，刚用钟爱的爪哇解决了一个需求。现在坐在一家广式茶餐厅临街的窗口，点一份午餐。虽然三点半才吃午饭有些对不起胃，但至少时间是由我自由分配的。看着窗外匆匆的行人，突然发现这种生活是我向往的，不规律但很自由，经常有成就感，不用遵守规章制度，忙的时候可以连干几个通宵，闲的时候可以整天整天地发呆，不富但有心情小资一把看来我不适合上班，我应该去做SOHO。Sigh，我不是一个挣大钱的人…… [手机记于2006年5月15日下午3点半 北航东南门金隆信] 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Taste of Life<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F822%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">2010上海世博会“人”字形概念楼</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F10%2F15%2F1767%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">我的大学回忆：猥琐的北航猥琐的事 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F08%2F23%2F1705%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Adium 消息样式 – Mochastyle</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F12%2F20%2F18%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">又有冲动装Ubuntu了</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F01%2F13%2F14%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">水穿石死了</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<div>一个宁静的下午，刚用钟爱的爪哇解决了一个需求。现在坐在一家广式茶餐厅临街的窗口，点一份午餐。虽然三点半才吃午饭有些对不起胃，但至少时间是由我自由分配的。看着窗外匆匆的行人，突然发现这种生活是我向往的，不规律但很自由，经常有成就感，不用遵守规章制度，忙的时候可以连干几个通宵，闲的时候可以整天整天地发呆，不富但有心情小资一把<img src="http://spaces.msn.com/rte/emoticons/smile_shades.gif" />看来我不适合上班，我应该去做SOHO。Sigh，我不是一个挣大钱的人<img src="http://spaces.msn.com/rte/emoticons/smile_thinking.gif" />……</div>
<div> </div>
<div>[手机记于2006年5月15日下午3点半 北航东南门金隆信]</div>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2006/05/16/137/">Taste of Life</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F&title=Taste+of+Life" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F27%2F9947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">原点</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F13%2F9976%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">来写点什么</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F11%2F24%2F13085%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Ubuntu下配置L2TP</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F17%2F10237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有了你之后，我会说“喵~~”</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F09%2F9959%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2006%2F05%2F16%2F137%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">圈圈</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2006/05/16/137/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Java 销魂落魄散  [zz]</title>
		<link>http://www.jayxu.com/2005/11/07/171/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-%25e9%2594%2580%25e9%25ad%2582%25e8%2590%25bd%25e9%25ad%2584%25e6%2595%25a3</link>
		<comments>http://www.jayxu.com/2005/11/07/171/#comments</comments>
		<pubDate>Mon, 07 Nov 2005 09:39:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[朋友]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=171</guid>
		<description><![CDATA[引用 java 销魂落魄散 今天和徐某（一个学弟）一起coding，co着co着，徐某看起动漫来，还不停自言自语，说什么“姆斯唐”（mustang，java 6 的开发代号），然后非常热情地把笔记本转向我，然后说：“看，这就是姆斯唐”。原来是一个主角叫“姆斯唐”&#8230;当场晕倒&#8230; 平时就知道这人甚爱“爪哇”，可是也不至于因为某个主角的名称有点YY而对这部动画片狂热不已吧&#8230;唉 遂有了“徐某已身中巨毒，此毒乃java销魂落魄散也”； 可是又回头想想自己对mustang如此的的sensitive&#8230; 哈，可能原本就是我自己中了“java 销魂落魄散”了吧&#8230;哀哉乎？不悲矣，乐在其中：） 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Java 销魂落魄散 [zz]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><em>引用</em></p>
<blockquote><p><a href="http://spaces.msn.com/members/iblader/blog/cns!1p0DAcB46DXvCW3U8pFzUvBQ!125.entry">java 销魂落魄散</a></p>
<div>今天和徐某（一个学弟）一起coding，co着co着，徐某看起动漫来，还不停自言自语，说什么“姆斯唐”（mustang，java 6 的开发代号），然后非常热情地把笔记本转向我，然后说：“看，这就是姆斯唐”。原来是一个主角叫“姆斯唐”&#8230;当场晕倒&#8230;</div>
<div></div>
<div>平时就知道这人甚爱“爪哇”，可是也不至于因为某个主角的名称有点YY而对这部动画片狂热不已吧&#8230;唉</div>
<div></div>
<div>遂有了“徐某已身中巨毒，此毒乃java销魂落魄散也”；</div>
<div></div>
<div>可是又回头想想自己对mustang如此的的sensitive&#8230;</div>
<div></div>
<div>哈，可能原本就是我自己中了“java 销魂落魄散”了吧&#8230;哀哉乎？不悲矣，乐在其中：）</div>
</blockquote>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2005/11/07/171/">Java 销魂落魄散  [zz]</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&title=Java+%E9%94%80%E9%AD%82%E8%90%BD%E9%AD%84%E6%95%A3++%5Bzz%5D" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2005/11/07/171/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Meet god father</title>
		<link>http://www.jayxu.com/2005/09/14/182/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=meet-god-father</link>
		<comments>http://www.jayxu.com/2005/09/14/182/#comments</comments>
		<pubDate>Wed, 14 Sep 2005 13:44:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=182</guid>
		<description><![CDATA[今天是Java China 2005的最后一天，下午没有去各个分会场，而是去了长富宫饭店的“Java认证群英欢庆会”，目的只有一个：和Java之父James Gosling合影。 …… 由于明天要交实习手册，拍照过程当中使用的个中手段先按下不表，总之合影是成功的，效果是令人满意的 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Meet god father<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Which GlassFish version is right for me? [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F19%2F11711%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">一周tweets更新 [2011-09-19]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F26%2F9968%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">moving on stage</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F04%2F26%2F68%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">中文编程语言？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<div>今天是Java China 2005的最后一天，下午没有去各个分会场，而是去了长富宫饭店的“Java认证群英欢庆会”，目的只有一个：和Java之父James Gosling合影。</div>
<div>……</div>
<div>由于明天要交实习手册，拍照过程当中使用的个中手段先按下不表，总之合影是成功的，效果是令人满意的 <img src='http://www.jayxu.com/wp-includes/images/smilies/icon_twisted.gif' alt=':twisted:' class='wp-smiley' /> </div>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2005/09/14/182/">Meet god father</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F&title=Meet+god+father" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F28%2F2428&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">楼市三字经</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F02%2F01%2F2039%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">所谓文化大国──韩寒@厦大</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2488%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">一周tweets更新 [2010-10-19]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F10%2F23%2F1778%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Hyper Chord -Tommy Emmanuel 2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F09%2F14%2F182%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2005/09/14/182/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>新学期，新气象</title>
		<link>http://www.jayxu.com/2005/08/31/190/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%2596%25b0%25e5%25ad%25a6%25e6%259c%259f%25ef%25bc%258c%25e6%2596%25b0%25e6%25b0%2594%25e8%25b1%25a1</link>
		<comments>http://www.jayxu.com/2005/08/31/190/#comments</comments>
		<pubDate>Wed, 31 Aug 2005 15:46:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[学校生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[uml]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=190</guid>
		<description><![CDATA[明天就回北京了，大四的学习生活马上就开始了。由于不想加入浩浩荡荡的考研大军，再加上我们系大四上一共才三节课，因此我可以说是闲得发慌，可以静下心来好好看看书，搞搞研究了。 在这里列两个list，好有个目标。 study list 研究一下eclipse的plugin机制，结合实验室现在的mipv6项目，继续实习时的工作 和师兄讨论一下，尽快定下毕设方向 争取一下保研的事 得花些时间在高老板那边，开始用户端的编码（突然发现struts是个好东东） 今天刚接了一个活儿，市场前景不错，得好好设计一下，还得找点人（毕竟几个以前得力的好搭档正准备考研），可能得先一个人扛一段时间 reading list 《Java与模式》看了大半了，这学期看完，然后总结一下 《The Object Primer》，系统整理一下oo知识 《UML参考手册》，UML 2.0推出了，得好好琢磨一下 《Expert One-on-One J2EE Development without EJB》 有时间的话看一下密码学 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 新学期，新气象<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F02%2F23%2F2068%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">请教新浪</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F02%2F05%2F1378%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">新CD入手</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F02%2F19%2F263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">新的开始</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F05%2F07%2F2148%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">新浪围脖挂了，twitter第一时间响应</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F09%2F03%2F121%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">新的开始……老八撞GS运了</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>明天就回北京了，大四的学习生活马上就开始了。由于不想加入浩浩荡荡的考研大军，再加上我们系大四上一共才三节课，因此我可以说是闲得发慌，可以静下心来好好看看书，搞搞研究了。</p>
<p>在这里列两个list，好有个目标。</p>
<p><em>study list</em></p>
<ol dir="ltr">
<li>研究一下eclipse的plugin机制，结合实验室现在的mipv6项目，继续实习时的工作</li>
<li>和师兄讨论一下，尽快定下毕设方向</li>
<li>争取一下保研的事</li>
<li>得花些时间在高老板那边，开始用户端的编码（突然发现struts是个好东东）</li>
<li>今天刚接了一个活儿，市场前景不错，得好好设计一下，还得找点人（毕竟几个以前得力的好搭档正准备考研），可能得先一个人扛一段时间</li>
</ol>
<p><em>reading list</em></p>
<ol>
<li>《Java与模式》看了大半了，这学期看完，然后总结一下</li>
<li>《The Object Primer》，系统整理一下oo知识</li>
<li>《UML参考手册》，UML 2.0推出了，得好好琢磨一下</li>
<li>《Expert One-on-One J2EE Development without EJB》</li>
<li>有时间的话看一下密码学</li>
</ol>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2005/08/31/190/">新学期，新气象</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F&title=%E6%96%B0%E5%AD%A6%E6%9C%9F%EF%BC%8C%E6%96%B0%E6%B0%94%E8%B1%A1" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F02%2F23%2F2068%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">请教新浪</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F02%2F05%2F1378%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">新CD入手</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F05%2F07%2F2148%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">新浪围脖挂了，twitter第一时间响应</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F02%2F19%2F263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">新的开始</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F09%2F03%2F121%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F31%2F190%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">新的开始……老八撞GS运了</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2005/08/31/190/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>使用策略模式（Strategy）实现多关键字排序</title>
		<link>http://www.jayxu.com/2005/08/04/10218/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25bd%25bf%25e7%2594%25a8%25e7%25ad%2596%25e7%2595%25a5%25e6%25a8%25a1%25e5%25bc%258f%25ef%25bc%2588strategy%25ef%25bc%2589%25e5%25ae%259e%25e7%258e%25b0%25e5%25a4%259a%25e5%2585%25b3%25e9%2594%25ae%25e5%25ad%2597%25e6%258e%2592%25e5%25ba%258f</link>
		<comments>http://www.jayxu.com/2005/08/04/10218/#comments</comments>
		<pubDate>Thu, 04 Aug 2005 04:37:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[strategy]]></category>

		<guid isPermaLink="false">http://www.blogjava.net/fidodido/archive/2005/08/04/9181.html</guid>
		<description><![CDATA[｢策略模式｣的出现，是为了提供一套相互之间可灵活替换的算法，在不影响上层接口的情况下，用户可以自由选择不同的算法完成逻辑。策略模式的UML示意图如下： 其中算法的模型接口在｢抽象策略｣中定义，各具象策略实现不同的策略。｢消费API｣就是调用不同算法的类，在其内部根据不同需要选择不同的算法。有时需要将具象策略实例化后再传给其它类，这时可以使用｢简单工厂｣（Simple Factory）或｢工厂方法｣（Factory Method）生成所需的具象策略。下面就以我正在做的一个项目，简化一下后说明一下策略模式的使用。 该项目是一个小型的商业网站，逻辑层由Servlet实现。用户有一个需求，需要从数据库调出商品信息后能够对记录按名称（name）、规格（standard）、价格（price）和注册日期（register date）进行排序。虽然可以考虑按不同的排序关键字使用不同的sql语句（即不同的order by）查询数据库。但这样做的网络数据流量太大，每次需要从数据库完整地取回一个数据集（ResultSet），所以我选择了将数据集一次取到客户端的一个List中，然后在客户端按不同的关键字对List进行排序。 java.util.Collections类中有一个public static void sort(List list, Comparator comparator)的方法，可以按照不同的Comparator对象对list进行排序，它使用的是快速排序，所以效率非常高。而java.util.Comparator是一个接口： package java.util; &#160; public abstract interface Comparator &#123; &#160; &#160; boolean equals&#40;Object object&#41;; &#160; &#160; &#160; int compare&#40;Object object, Object object1&#41;; &#125; package java.util; public abstract interface Comparator { boolean equals(Object object); int compare(Object object, Object object1); } 其中和排序有关的是compare方法，它返回一个整数，若第一个参数比第二个参数｢大｣，则返回一个正数，若｢小｣则返回一个负数，若｢相等｣则返回0，这里的｢大｣、｢小｣、｢相等｣是由compare方法具体实现定义的一种比较标准。由这个方法不禁想到C语言中qsort函数中使用的函数指针int *compare(*,*)，JAVA中之所以没有函数指针，就是用接口取代了（更详细的介绍见《Effective Java》中第22条｢用类和接口来代替函数指针｣）。 <a href="http://www.jayxu.com/2005/08/04/10218/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F25%2F1892%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X的内存管理策略</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>｢策略模式｣的出现，是为了提供一套相互之间可灵活替换的算法，在不影响上层接口的情况下，用户可以自由选择不同的算法完成逻辑。策略模式的UML示意图如下：</p>
<p><a class="hoverZoomLink" href="http://jayxu.com/log/wp-content/uploads/2005/08/r_image002.jpg"><img alt="" class="alignnone size-medium wp-image-10222 hoverZoomLink" height="210" src="http://jayxu.com/log/wp-content/uploads/2005/08/r_image002-480x210.jpg" width="480" /></a></p>
<p>其中算法的模型接口在｢抽象策略｣中定义，各具象策略实现不同的策略。｢消费API｣就是调用不同算法的类，在其内部根据不同需要选择不同的算法。有时需要将具象策略实例化后再传给其它类，这时可以使用｢简单工厂｣（Simple Factory）或｢工厂方法｣（Factory Method）生成所需的具象策略。下面就以我正在做的一个项目，简化一下后说明一下策略模式的使用。 该项目是一个小型的商业网站，逻辑层由Servlet实现。用户有一个需求，需要从数据库调出商品信息后能够对记录按名称（name）、规格（standard）、价格（price）和注册日期（register date）进行排序。虽然可以考虑按不同的排序关键字使用不同的sql语句（即不同的order by）查询数据库。但这样做的网络数据流量太大，每次需要从数据库完整地取回一个数据集（ResultSet），所以我选择了将数据集一次取到客户端的一个List中，然后在客户端按不同的关键字对List进行排序。 java.util.Collections类中有一个public static void sort(List list, Comparator comparator)的方法，可以按照不同的Comparator对象对list进行排序，它使用的是快速排序，所以效率非常高。而java.util.Comparator是一个接口：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">package</span> <span class="co2">java.util</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">abstract</span> <span class="kw1">interface</span> <span class="kw3">Comparator</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw4">boolean</span> equals<span class="br0">&#40;</span><span class="kw3">Object</span> object<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw4">int</span> compare<span class="br0">&#40;</span><span class="kw3">Object</span> object, <span class="kw3">Object</span> object1<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">package java.util;

public abstract interface Comparator {
    boolean equals(Object object);

    int compare(Object object, Object object1);
}</pre></div></div>

<p>其中和排序有关的是compare方法，它返回一个整数，若第一个参数比第二个参数｢大｣，则返回一个正数，若｢小｣则返回一个负数，若｢相等｣则返回0，这里的｢大｣、｢小｣、｢相等｣是由compare方法具体实现定义的一种比较标准。由这个方法不禁想到C语言中qsort函数中使用的函数指针int *compare(*,*)，JAVA中之所以没有函数指针，就是用接口取代了（更详细的介绍见《Effective Java》中第22条｢用类和接口来代替函数指针｣）。 很明显，Comparator接口就是我们的｢抽象策略｣，sort方法就是我们的｢消费API｣，而不同的｢具象策略｣就是我们从Comparator接口实现的根据不同关键字排序的类。 整个排序模型的UML图如下，其中为了作图方便，我从Comparator继承了一个接口ItemComparator，根据不同的关键字从ItemComparator接口泛化了NameComparator类，PriceComparator类，RegisterDateComparator类和StandardComparator类。实际运用中不需要这个接口，四个类可以直接从Comparator泛化。ItemBean是一个封装了商品信息的bean，List中存放的就是这些bean。ItemSort和ItemComparator以及四个具体类实现了｢简单工厂｣模式，并封装了sort方法。</p>
<p><a class="hoverZoomLink" href="http://jayxu.com/log/wp-content/uploads/2005/08/o_strategy.dfPackage.jpg"><img alt="" class="alignnone size-medium wp-image-10221 hoverZoomLink" height="480" src="http://jayxu.com/log/wp-content/uploads/2005/08/o_strategy.dfPackage-427x480.jpg" width="427" /></a></p>
<p>下面是具体的代码（StandardComparator类的代码与NameComparator类的代码大同小异，在这里不列出）：</p>
<p>NameComparator类</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">package</span> <span class="co2">com.lim.designpatterns.strategy</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">class</span> NameComparator <span class="kw1">implements</span> ItemComparator<span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; NameComparator<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><span class="br0">&#125;</span> <span class="co1">// 将构造器封装，包外的类欲得到Comparator实例只能通过简单工厂</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">int</span> compare<span class="br0">&#40;</span><span class="kw3">Object</span> o1,<span class="kw3">Object</span> o2<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">String</span> name1<span class="sy0">=</span><span class="br0">&#40;</span><span class="br0">&#40;</span>ItemBean<span class="br0">&#41;</span>o1<span class="br0">&#41;</span>.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">String</span> name2<span class="sy0">=</span><span class="br0">&#40;</span><span class="br0">&#40;</span>ItemBean<span class="br0">&#41;</span>o2<span class="br0">&#41;</span>.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> name1.<span class="me1">compareTo</span><span class="br0">&#40;</span>name2<span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// 调用String的CompareTo方法</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">package com.lim.designpatterns.strategy;

public class NameComparator implements ItemComparator{
    NameComparator(){} // 将构造器封装，包外的类欲得到Comparator实例只能通过简单工厂

    public int compare(Object o1,Object o2){
        String name1=((ItemBean)o1).getName();
        String name2=((ItemBean)o2).getName();

        return name1.compareTo(name2); // 调用String的CompareTo方法
    }
}</pre></div></div>

<p>PriceComparator类</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">package</span> <span class="co2">com.lim.designpatterns.strategy</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">class</span> PriceComparator <span class="kw1">implements</span> ItemComparator<span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; PriceComparator<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">int</span> compare<span class="br0">&#40;</span><span class="kw3">Object</span> o1,<span class="kw3">Object</span> o2<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">Double</span> price1<span class="sy0">=</span><span class="kw1">new</span> <span class="kw3">Double</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span>ItemBean<span class="br0">&#41;</span>o1<span class="br0">&#41;</span>.<span class="me1">getPrice</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">Double</span> price2<span class="sy0">=</span><span class="kw1">new</span> <span class="kw3">Double</span><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="br0">&#40;</span>ItemBean<span class="br0">&#41;</span>o2<span class="br0">&#41;</span>.<span class="me1">getPrice</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> price1.<span class="me1">compareTo</span><span class="br0">&#40;</span>price2<span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// 调用Double的CompareTo方法</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">package com.lim.designpatterns.strategy;

public class PriceComparator implements ItemComparator{
    PriceComparator(){}

    public int compare(Object o1,Object o2){
        Double price1=new Double(((ItemBean)o1).getPrice());
        Double price2=new Double(((ItemBean)o2).getPrice());

        return price1.compareTo(price2); // 调用Double的CompareTo方法
    }
}</pre></div></div>

<p>RegisterDateComparator类</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">package</span> <span class="co2">com.lim.designpatterns.strategy</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw1">import</span> <span class="co2">java.util.*</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">class</span> RegisterDateComparator <span class="kw1">implements</span> ItemComparator<span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; RegisterDateComparator<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">int</span> compare<span class="br0">&#40;</span><span class="kw3">Object</span> o1,<span class="kw3">Object</span> o2<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">Date</span> date1<span class="sy0">=</span><span class="br0">&#40;</span><span class="br0">&#40;</span>ItemBean<span class="br0">&#41;</span>o1<span class="br0">&#41;</span>.<span class="me1">getRegisterDate</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">Date</span> date2<span class="sy0">=</span><span class="br0">&#40;</span><span class="br0">&#40;</span>ItemBean<span class="br0">&#41;</span>o2<span class="br0">&#41;</span>.<span class="me1">getRegisterDate</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> date1.<span class="me1">compareTo</span><span class="br0">&#40;</span>date2<span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// 调用Date的CompareTo方法</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">package com.lim.designpatterns.strategy;

import java.util.*;

public class RegisterDateComparator implements ItemComparator{
    RegisterDateComparator(){}

    public int compare(Object o1,Object o2){
        Date date1=((ItemBean)o1).getRegisterDate();
        Date date2=((ItemBean)o2).getRegisterDate();

        return date1.compareTo(date2); // 调用Date的CompareTo方法
    }
}</pre></div></div>

<p>ItemSort类</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">package</span> <span class="co2">com.lim.designpatterns.strategy</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw1">import</span> <span class="co2">java.util.*</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">class</span> ItemSort<span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw3">List</span> sort<span class="br0">&#40;</span><span class="kw3">List</span> items,ItemComparator c<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">Collections</span>.<span class="me1">sort</span><span class="br0">&#40;</span>items,c<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> items<span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw1">final</span> ItemComparator NAME<span class="sy0">=</span><span class="kw1">new</span> NameComparator<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// 简单工厂</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw1">final</span> ItemComparator PRICE<span class="sy0">=</span><span class="kw1">new</span> PriceComparator<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw1">final</span> ItemComparator STANDARD<span class="sy0">=</span><span class="kw1">new</span> StandardComparator<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw1">final</span> ItemComparator REG_DATE<span class="sy0">=</span><span class="kw1">new</span> RegisterDateComparator<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">package com.lim.designpatterns.strategy;

import java.util.*;

public class ItemSort{
    public static List sort(List items,ItemComparator c){
        Collections.sort(items,c);
        return items;
    }

    public static final ItemComparator NAME=new NameComparator(); // 简单工厂

    public static final ItemComparator PRICE=new PriceComparator();

    public static final ItemComparator STANDARD=new StandardComparator();

    public static final ItemComparator REG_DATE=new RegisterDateComparator();
}</pre></div></div>

<p>TestItemSort类</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">package</span> <span class="co2">com.lim.designpatterns.strategy</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw1">import</span> <span class="co2">java.util.*</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">class</span> TestItemSort<span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> main<span class="br0">&#40;</span><span class="kw3">String</span><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">List</span> items<span class="sy0">=</span><span class="kw1">new</span> <span class="kw3">ArrayList</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// 向List添加条目</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; items<span class="sy0">=</span>ItemSort.<span class="me1">sort</span><span class="br0">&#40;</span>items,ItemSort.<span class="me1">NAME</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// 按名称排序</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; items<span class="sy0">=</span>ItemSort.<span class="me1">sort</span><span class="br0">&#40;</span>items,ItemSort.<span class="me1">PRICE</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// 按价格排序</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; items<span class="sy0">=</span>ItemSort.<span class="me1">sort</span><span class="br0">&#40;</span>items,ItemSort.<span class="me1">REG_DATE</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// 按注册日期排序</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; items<span class="sy0">=</span>ItemSort.<span class="me1">sort</span><span class="br0">&#40;</span>items,ItemSort.<span class="me1">STANDARD</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// 按规格排序</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">package com.lim.designpatterns.strategy;

import java.util.*;

public class TestItemSort{
    public static void main(String[] args){
        List items=new ArrayList();
        // 向List添加条目

        items=ItemSort.sort(items,ItemSort.NAME); // 按名称排序

        items=ItemSort.sort(items,ItemSort.PRICE); // 按价格排序

        items=ItemSort.sort(items,ItemSort.REG_DATE); // 按注册日期排序

        items=ItemSort.sort(items,ItemSort.STANDARD); // 按规格排序
    }
}</pre></div></div>

<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2005/08/04/10218/">使用策略模式（Strategy）实现多关键字排序</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F&title=%E4%BD%BF%E7%94%A8%E7%AD%96%E7%95%A5%E6%A8%A1%E5%BC%8F%EF%BC%88Strategy%EF%BC%89%E5%AE%9E%E7%8E%B0%E5%A4%9A%E5%85%B3%E9%94%AE%E5%AD%97%E6%8E%92%E5%BA%8F" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F25%2F1892%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X的内存管理策略</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F04%2F10218%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2005/08/04/10218/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IDEA，破解成功</title>
		<link>http://www.jayxu.com/2005/08/02/202/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=idea%25ef%25bc%258c%25e7%25a0%25b4%25e8%25a7%25a3%25e6%2588%2590%25e5%258a%259f</link>
		<comments>http://www.jayxu.com/2005/08/02/202/#comments</comments>
		<pubDate>Tue, 02 Aug 2005 15:15:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[破解]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=202</guid>
		<description><![CDATA[今天在TSS上看到IntelliJ的IDEA 5.0终于release了，于是马上当了一个，还申请了一个30天的评估号。要知道IDEA可是个人程序员非常钟爱的IDE，界面很漂亮，使用 Alloy的Look and Feel，而且功能也相当强大，个人认为在中国这片没有license概念的土地上可以和JBuilder抗衡。但是上网站一看价格，竟然要$499！看来自己花钱买license是不可能的了。于是又找出Java反编译利器DJ，打算破解IDEA。 由于有了alloy的破解经验，这一次很快找到了关键代码，稍做修改后，评估版30天的限制被我破掉了，以后可以在一个“舒适”的IDE上开发了 Develop with pleasure 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: IDEA，破解成功<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Synthetica破解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F05%2F10%2F221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Alloy</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Deskzilla Cracked</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天在TSS上看到IntelliJ的<a href="http://www.jetbrains.com/idea/index.html">IDEA 5.0</a>终于release了，于是马上当了一个，还申请了一个30天的评估号。要知道IDEA可是个人程序员非常钟爱的IDE，界面很漂亮，使用 <a href="http://spaces.msn.com/members/scjp/blog/cns!1pQR9YCOilXJCP9-P-lS-BlQ!217.entry">Alloy</a>的Look and Feel，而且功能也相当强大，个人认为在中国这片没有license概念的土地上可以和JBuilder抗衡。但是上网站一看价格，竟然要$499！看来自己花钱买license是不可能的了。于是又找出Java反编译利器DJ，打算破解IDEA。</p>
<p>由于有了alloy的破解经验，这一次很快找到了关键代码，稍做修改后，评估版30天的限制被我破掉了，以后可以在一个“舒适”的IDE上开发了 <img src='http://www.jayxu.com/wp-includes/images/smilies/icon_twisted.gif' alt=':twisted:' class='wp-smiley' /> </p>
<p>Develop with pleasure
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2005/08/02/202/">IDEA，破解成功</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F&title=IDEA%EF%BC%8C%E7%A0%B4%E8%A7%A3%E6%88%90%E5%8A%9F" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F03%2F17%2F302%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Synthetica破解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F05%2F10%2F221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Alloy</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F05%2F07%2F352%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F08%2F02%2F202%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Deskzilla Cracked</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2005/08/02/202/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java生日快乐</title>
		<link>http://www.jayxu.com/2005/07/12/209/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java%25e7%2594%259f%25e6%2597%25a5%25e5%25bf%25ab%25e4%25b9%2590</link>
		<comments>http://www.jayxu.com/2005/07/12/209/#comments</comments>
		<pubDate>Tue, 12 Jul 2005 09:43:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=209</guid>
		<description><![CDATA[Java今年10岁了，虽然我接触他只有短短的5年，但是这5年我“矢志不渝”地扛着Java的大旗，包括到处鼓吹“Compile once, run anywhere”；包括“怂恿”同学学习Java；包括和.net阵营的fans面红耳赤地争论；包括对CPP的鄙视 ；包括对《Thinking in Java》的作者Bruce Eckel的顶礼膜拜（虽然他先写了《Thinking in C++》，但我“不记前嫌” ）；包括对GoF的抱怨，只因为他们的《Design Patterns》用CPP写示例（那时还没有Java）；包括床头不下20本Java相关书籍；包括写blog指责学院一位资深的教授，只因为他教“面向对象技术”时讲授的Java知识错误百出；包括因为Java去看《Java与模式》（16开，1024页）、《Object-Oriented Software Construction》（1254页，E文）；包括这次花250大洋参加Java 10周年大会………… 一直关注Java的成长，一直关注Java技术的发展。10年对人类来说可能很短暂，但对于一门计算机技术来说，10年兴盛的发展本身就是一个奇迹。我是幸运的，因为我亲眼目睹并且亲身经历了Sun创造的这个奇迹。再过20年，我会很自豪地对我儿子说“小子，这就是Java，老爸是看着他长大的” 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Java生日快乐<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F414.html&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">生日快乐 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F12986.html&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">生日 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F459.html&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">我的生日 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fmall.ycy8.net%2F2011_262.html&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">七彩阳光罐子阳光瓶生日礼品 (@ycy8)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Java今年10岁了，虽然我接触他只有短短的5年，但是这5年我“矢志不渝”地扛着Java的大旗，包括到处鼓吹“Compile once, run anywhere”；包括“怂恿”同学学习Java；包括和.net阵营的fans面红耳赤地争论；包括对CPP的鄙视 <img src='http://www.jayxu.com/wp-includes/images/smilies/icon_cool.gif' alt=':cool:' class='wp-smiley' />  ；包括对《Thinking in Java》的作者Bruce Eckel的顶礼膜拜（虽然他先写了《Thinking in C++》，但我“不记前嫌” <img src='http://www.jayxu.com/wp-includes/images/smilies/icon_wink.gif' alt=':wink:' class='wp-smiley' />  ）；包括对GoF的抱怨，只因为他们的《Design Patterns》用CPP写示例（那时还没有Java）；包括床头不下20本Java相关书籍；包括写<a href="http://blog.csdn.net/sandy_xu/article/details/320387">blog</a>指责学院一位资深的教授，只因为他教“面向对象技术”时讲授的Java知识错误百出；包括因为Java去看《Java与模式》（16开，1024页）、《Object-Oriented Software Construction》（1254页，E文）；包括这次花250大洋参加Java 10周年大会…………</p>
<p>一直关注Java的成长，一直关注Java技术的发展。10年对人类来说可能很短暂，但对于一门计算机技术来说，10年兴盛的发展本身就是一个奇迹。我是幸运的，因为我亲眼目睹并且亲身经历了Sun创造的这个奇迹。再过20年，我会很自豪地对我儿子说“小子，这就是Java，老爸是看着他长大的”
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2005/07/12/209/">Java生日快乐</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F&title=Java%E7%94%9F%E6%97%A5%E5%BF%AB%E4%B9%90" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F15%2F1947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">java.net论坛被黑（有图有真相）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F20%2F11718%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Differences Among Greedy, Reluctant, and Possessive Quantifiers (for RexExp in Java)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F414.html&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">生日快乐 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F12986.html&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">生日 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F459.html&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">我的生日 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fmall.ycy8.net%2F2011_262.html&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F07%2F12%2F209%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">七彩阳光罐子阳光瓶生日礼品 (@ycy8)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2005/07/12/209/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>二探Web service</title>
		<link>http://www.jayxu.com/2005/06/24/213/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25ba%258c%25e6%258e%25a2web-service</link>
		<comments>http://www.jayxu.com/2005/06/24/213/#comments</comments>
		<pubDate>Fri, 24 Jun 2005 09:43:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=213</guid>
		<description><![CDATA[复习了一天体系结构，打开JB玩玩Web service消遣消遣。发现WSDL的描述文件支持用户自定义类，但不支持JDK中的类库，应该是因为C#中没有相应的类与之对应，好像比较麻烦。如果要真正做到Java与.net无障碍协作的话得把JDK中所有的类在.net端映射一下。但如果是小范围应用的话可以考虑适配器模式（Adapter） 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 二探Web service<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F09%2F10602%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">开源中最好的Web开发的资源 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F719%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">谁在twitter？</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F02%2F28%2F277%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">工欲善其事，必先利其器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F30%2F10614%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Groupon 是一场赤裸裸的庞氏骗局 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F05%2F19%2F10588%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Web上运行Linux [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>复习了一天体系结构，打开JB玩玩Web service消遣消遣。发现WSDL的描述文件支持用户自定义类，但不支持JDK中的类库，应该是因为C#中没有相应的类与之对应，好像比较麻烦。如果要真正做到Java与.net无障碍协作的话得把JDK中所有的类在.net端映射一下。但如果是小范围应用的话可以考虑适配器模式（Adapter） <img src='http://www.jayxu.com/wp-includes/images/smilies/icon_idea.gif' alt=':idea:' class='wp-smiley' />
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2005/06/24/213/">二探Web service</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F&title=%E4%BA%8C%E6%8E%A2Web+service" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F09%2F10602%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">开源中最好的Web开发的资源 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F719%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">谁在twitter？</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F30%2F10614%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Groupon 是一场赤裸裸的庞氏骗局 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F02%2F28%2F277%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">工欲善其事，必先利其器</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F05%2F19%2F10588%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2005%2F06%2F24%2F213%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Web上运行Linux [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2005/06/24/213/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

