煩惱歲月

          付出總是有回報的 take action follow your heart , or follow your head
          posts - 40, comments - 5, trackbacks - 0, articles - 4

          ResourecBundled cache的討論

          Posted on 2009-10-17 17:23 不需要解釋 閱讀(353) 評論(0)  編輯  收藏 所屬分類: java

          有個大師說過一句話,有人的地方就有江湖,有江湖的地方就有斗爭。今天在java eys就看到了一場Resourcebundle引起的口角,集體見:

          http://www.javaeye.com/topic/6417?page=1.

          這個問題在jdk1.6已經(jīng)不存在

          clearCache
          public static final void clearCache()
          Removes all resource bundles from the cache that have been loaded using the caller's class loader.
          Since:
          1.6
          See Also:
          ResourceBundle.Control.getTimeToLive(String,Locale)

          clearCache
          public static final void clearCache(ClassLoader loader)
          Removes all resource bundles from the cache that have been loaded using the given class loader.
          Parameters:
          loader - the class loader
          Throws:
          NullPointerException - if loader is null
          Since:
          1.6
          See Also:
          ResourceBundle.Control.getTimeToLive(String,Locale)

           

          在1.5,1.4怎么辦呢:

             Class klass = ResourceBundle.getBundle("your.Bundle").getClass().getSuperclass();
             Field field = klass.getDeclaredField("cacheList");
             field.setAccessible(true);
             sun.misc.SoftCache cache = (sun.misc.SoftCache)field.get(null);
             cache.clear();
             field.setAccessible(false);

          這樣就可以清楚cache.

          我實話告訴你們,我可是身經(jīng)百戰(zhàn)了.bbs我見的多了,哪個版我沒灌過?你們要知道, 一塌糊 涂的triangle,PIC,SEX版,那比你們不知道厲害到哪里去了,我在那談笑風聲.你 們有一好就是無論在哪個版,什么話題都灌,但是灌來灌去的問題,都too simple, sometimes naive!你 們懂不懂呀?啊?所以說灌水啊,關(guān)鍵是要提高自己的知識水平.你 們啊,不要總想著弄個大坑,然后灌上十大,再把我羞辱一番……你們啊,naive!你們這 樣灌是不行地!~那你問我支持 不支持灌水,我說支持,我常來這裡灌,你說支持不支持?
          主站蜘蛛池模板: 如皋市| 固镇县| 芒康县| 法库县| 门头沟区| 砚山县| 阳信县| 南皮县| 繁昌县| 将乐县| 上犹县| 十堰市| 忻城县| 濮阳市| 南康市| 淳安县| 洛宁县| 恩施市| 厦门市| 静海县| 河东区| 萨迦县| 桂东县| 临城县| 西充县| 张家港市| 宁化县| 察隅县| 余江县| 科技| 普陀区| 弥勒县| 北京市| 桐城市| 潮州市| 民勤县| 囊谦县| 湟中县| 正定县| 彰化市| 凤山市|