Package xscript.runtime

Examples of xscript.runtime.XRuntimeException


      i=1;
    }
    Object[] oParam = new Object[params.length-i];
    XGenericClass[] genericClasses = method.getParams(_this==null?null:_this.getXClass(), new XGenericMethodProviderImp(method, generics));
    if(oParam.length!=genericClasses.length)
      throw new XRuntimeException("An native call error happened");
    for(int j=0; j<oParam.length; j++){
      long value = params[j+i];
      XGenericClass genericClass = genericClasses[j];
      oParam[j] = XWrapper.getJavaObject(virtualMachine.getObjectProvider(), genericClass, value);
    }
View Full Code Here


          } catch (InterruptedException e) {}
        }
      }
      if(invoke.hasResult())
        return invoke.getReturn();
      throw new XRuntimeException("Timeout of native call");
    }
  }
View Full Code Here

    for(int i=0; i<genericInfos.length; i++){
      if(genericInfos[i].getName().equals(genericName)){
        return i;
      }
    }
    throw new XRuntimeException("Can't find generic class %s", genericName);
  }
View Full Code Here

      return this;
    }
    XClass xClass = object.getXClass().getXClass();
    XClassTable classTable = getDeclaringClass().getClassTable(xClass);
    if(classTable==null){
      throw new XRuntimeException("Can't cast %s to %s", xClass, getDeclaringClass());
    }
    int i = classTable.getMethodID(index);
    return xClass.getVirtualMethod(i);
  }
View Full Code Here

          if(numNews==0){
            XMethod method = ((XInstructionInvokeSpecial)instructions[i]).getMethod(getDeclaringClass().getVirtualMachine());
            if(method.isConstructor() && getDeclaringClass().canCastTo(method.getDeclaringClass())){
              if(method.getParamCount()>0){
                if(explitite.contains(method.getDeclaringClass())){
                  throw new XRuntimeException("Error, calling 2 times the same super constructor");
                }else{
                  explitite.add(method.getDeclaringClass());
                }
              }
            }
View Full Code Here

  private byte[] userData;
  private boolean isVisible;
 
  protected XObject(XGenericClass xClass){
    if(XModifier.isAbstract(xClass.getXClass().getModifier()))
      throw new XRuntimeException("Can't create Object form abstract class %s", xClass);
    this.xClass = xClass;
    data = new byte[xClass.getXClass().getObjectSize()];
  }
View Full Code Here

    data = new byte[xClass.getXClass().getObjectSize()];
  }
 
  protected XObject(XGenericClass xClass, int size) {
    if(XModifier.isAbstract(xClass.getXClass().getModifier()))
      throw new XRuntimeException("Can't create Object form abstract class %s", xClass);
    if(!(xClass.getXClass() instanceof XArray))
      throw new XRuntimeException("%s isn't an array", xClass);
    this.xClass = xClass;
    data = new byte[xClass.getXClass().getObjectSize()+size];
    ((XArray)xClass.getXClass()).getLengthField().set(this, size);
  }
View Full Code Here

  }
 
  protected long createPointerForObject(XObject xObject) {
    long pointer = getNextFreePointer();
    if(pointer==0)
      throw new XRuntimeException("Out of memory");
    objects[(int) (pointer-1)] = xObject;
    return pointer;
  }
View Full Code Here

    methodReturn = method.getMethodReturnName();
    this.generics = generics;
    this.method = method;
    if(generics==null){
      if(method.getGenericParams()!=0)
        throw new XRuntimeException("Can't create a generic method %s without generic params, need %s generic params", method, method.getGenericParams());
    }else if(generics.length!=method.getGenericParams()){
      throw new XRuntimeException("Can't create a generic method %s with %s generic params, need %s generic params", method, generics.length, method.getGenericParams());
    }
    if(XModifier.isStatic(method.getModifier())){
      throw new XRuntimeException("Method %s is static", method);
    }
  }
View Full Code Here

      XClass xClass = vm.getClassProvider().getXClass(className);
      method = xClass.getMethod(methodName, methodParams, methodReturn);
      XChecks.checkAccess(methodExecutor.getMethod().getDeclaringClass(), method);
      if(generics==null){
        if(method.getGenericParams()!=0)
          throw new XRuntimeException("Can't create a generic method %s without generic params, need %s generic params", method, method.getGenericParams());
      }else if(generics.length!=method.getGenericParams()){
        throw new XRuntimeException("Can't create a generic method %s with %s generic params, need %s generic params", method, generics.length, method.getGenericParams());
      }
      if(XModifier.isStatic(method.getModifier())){
        throw new XRuntimeException("Method %s is static", method);
      }
    }
  }
View Full Code Here

TOP

Related Classes of xscript.runtime.XRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.