Skip to content

Instantly share code, notes, and snippets.

View idler's full-sized avatar

Maxim Antonov idler

  • TeamIdea
  • Moscow, Russia
View GitHub Profile
@idler
idler / InterfaceOrClass
Created July 10, 2017 16:29
return new interface or return new class implemented interface
max@antonov :tmp: 19:24:57 [0] $ javap -c Ber
Compiled from "Ber.java"
class Ber {
Ber();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
@idler
idler / a.java
Created June 8, 2017 10:44
java fuck
private PreparedStatement getPreparedCategoryQuery() {
if (categoryPreparedQuery == null) {
try {
categoryPreparedQuery = dbconn.prepareStatement("INSERT INTO category (code) values(?)");
} catch (SQLException e) {
e.printStackTrace();
}
}
@idler
idler / Thread dump
Created March 25, 2017 16:26
Thread Dump
[java] 2017-03-25 19:24:01
[java] Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.65-b01 mixed mode):
[java]
[java] "ActiveMQ InactivityMonitor Worker" #117 daemon prio=5 os_prio=0 tid=0x00007fbc18c9f800 nid=0x30a0 waiting on condition [0x00007fbbf18e1000]
[java] java.lang.Thread.State: TIMED_WAITING (parking)
[java] at sun.misc.Unsafe.park(Native Method)
max@antonov :~: 22:41:32 [0] $ cat Ti.java
class Ti{
public static String a="test";
public static String b="Yes";
public static void main(String [] args){
StringBuilder c = new StringBuilder();
c.append(a); c.append(" "); c.append(b);
System.out.println(c);