Skip to content

Instantly share code, notes, and snippets.

View tkfx's full-sized avatar

Alex Zhitnitsky tkfx

View GitHub Profile
System.out.println("Your pid is " + Process.getCurrentPid());
public static void main(String[] args) throws Exception {
Process proc = Runtime.getRuntime().exec(new String[] {
"/bin/sh",
"-c",
"echo $PPID"
});
if (proc.waitFor() == 0) {
InputStream in = proc.getInputStream();
int available = in.available();
@tkfx
tkfx / jshell
Created July 27, 2017 23:54
jshell
-> 2 + 2
| Expression value is: 4
|     assigned to temporary variable $1 of type int
int methodId = 2;
Object[] root = new Object[9];
List<Object> valCjrukeawxor = new LinkedList<Object>();
Set<Object> valRvshucjormy = new HashSet<Object>();
boolean valSboiogeldpb = true;
valRvshucjormy.add(valSboiogeldpb);
boolean valPjvoucyfprv = true;
if ( user.isCustomer() &&
account.equals(id) ) {
...
}
if( user.isCustomer() && account.equals(id) ) {
...
}
if( user.isCustomer() ) {
}
java.lang.NullPointerException: null
at com.sparktale.bugtale.server.app.servlet.billing.GetUserBillingServlet.internalWork(GetUserBillingServlet.java:64) [GetUserBillingServlet.class:na]
at com.sparktale.bugtale.server.app.servlet.billing.GetUserBillingServlet.internalWork(GetUserBillingServlet.java:27) [GetUserBillingServlet.class:na]
at com.sparktale.bugtale.server.app.servlet.AppServicesProtoServlet.work(AppServicesProtoServlet.java:82) [AppServicesProtoServlet.class:na]
at com.sparktale.bugtale.server.app.servlet.AppServicesProtoServlet.work(AppServicesProtoServlet.java:21) [AppServicesProtoServlet.class:na]
at com.sparktale.bugtale.server.common.servlet.CommonServlet.handleRequest(CommonServlet.java:144) [CommonServlet.class:na]
at com.sparktale.bugtale.server.common.servlet.CommonServlet.doPost(CommonServlet.java:64) [CommonServlet.class:na]
java.lang.NullPointerException: null
at com.sparktale.bugtale.server.app.servlet.billing.GetUserBillingServlet.internalWork(GetUserBillingServlet.java:64) [GetUserBillingServlet.class:na]
at com.sparktale.bugtale.server.app.servlet.billing.GetUserBillingServlet.internalWork(GetUserBillingServlet.java:27) [GetUserBillingServlet.class:na]
at com.sparktale.bugtale.server.app.servlet.AppServicesProtoServlet.work(AppServicesProtoServlet.java:82) [AppServicesProtoServlet.class:na]
at com.sparktale.bugtale.server.app.servlet.AppServicesProtoServlet.work(AppServicesProtoServlet.java:21) [AppServicesProtoServlet.class:na]
at com.sparktale.bugtale.server.common.servlet.CommonServlet.handleRequest(CommonServlet.java:144) [CommonServlet.class:na]
at com.sparktale.bugtale.server.common.servlet.CommonServlet.doPost(CommonServlet.java:64) [CommonServlet.class:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) [servlet-api.jar:na]
at javax.servl
private static final ThreadLocal<Integer> counter = new ThreadLocal<Integer>() {
@Override protected Integer initialValue() {
return 0;
}
};
private static void handleRequest() {
counter.set(counter.get() + 1);