This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -jar rej.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.khotyn.test; | |
/** | |
* Quick Test | |
* | |
* @author khotyn 2011-11-29 上午9:34:25 | |
*/ | |
public class Test { | |
public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThisEscape { | |
public static Escape escape; | |
public static void main(String[] args) throws InterruptedException { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
new ThisEscape().test(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.khotyn.test; | |
import java.io.InputStream; | |
/** | |
* Read a file from the classpath without using any third party library. | |
* | |
* @author khotyn 2011-12-1 下午5:03:21 | |
*/ | |
public class ReadFromClasspath { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.khotyn.test; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
@Retention(RetentionPolicy.CLASS) | |
@Target(ElementType.TYPE) | |
public @interface Anno { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.annotation.*; | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.METHOD) | |
public @interface AnnoMethod { | |
int id() default 9; | |
String value() default "Hello, world"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int hexStringToInt(String str) { | |
if (str.length() == 8) { | |
int firstBit = Integer.valueOf(str.substring(0, 1), 16); | |
if (firstBit >= 8) { | |
return Integer.valueOf((firstBit - 8) + str.substring(1), 16) - 0x80000000; | |
} else { | |
return Integer.valueOf(str, 16); | |
} | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -XX:+UseConcMarkSweepGC -XX:+PrintFlagsFinal Main | grep -P "CMSInitiatingOccupancyFraction|CMSTriggerRatio|MinHeapFreeRatio" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.lang.management.ManagementFactory; | |
import java.util.Set; | |
import javax.management.MBeanServer; | |
import javax.management.ObjectName; | |
/** | |
* Print the Collector used in the program. | |
* @author khotyn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.khotyn.test; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Enumeration; | |
import java.util.List; | |
import java.util.jar.JarEntry; | |
import java.util.jar.JarFile; |
OlderNewer