Example #1
0
 public StackTracer(Environment env, int limit) {
   this.env = env;
   this.result = new ArrayList<CallStackItem>();
   for (int i = 0; i < env.getCallStackTop(); i++) {
     if (limit != 0 && i >= limit) break;
     result.add(env.peekCall(i));
   }
 }
Example #2
0
  @Signature
  public PSqlStatement query(Environment env, String sql, @Nullable ArrayMemory args)
      throws Throwable {
    PreparedStatement statement = connection.prepareStatement(sql);
    PSqlStatement sqlStatement = new PSqlStatement(env, statement);

    if (args != null) {
      int index = 0;

      for (ReferenceMemory arg : args) {
        env.invokeMethod(sqlStatement, "bind", LongMemory.valueOf(index), arg.value);
        index += 1;
      }
    }

    return sqlStatement;
  }
Example #3
0
 public Memory getValue(Environment env) {
   if (value == null) return env.getStatic(internalName).toValue();
   else return value;
 }