Package xscript.runtime

Examples of xscript.runtime.XRuntimeException


    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 isn't static", method);
    }
  }
View Full Code Here


      i = index;
    }else{
      XClass xClass = object.getXClass().getXClass();
      XClassTable classTable = getDeclaringClass().getClassTable(xClass);
      if(classTable==null)
        throw new XRuntimeException("Can't cast %s to %s", xClass, getDeclaringClass());
      data = object.getData();
      i = classTable.getFieldStartID()+index;
    }
    int size = getSizeInObject();
    long l = 0;
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 isn't static", method);
      }
    }
  }
View Full Code Here

    return l;
  }

  public void set(XObject object, long value) {
    if(XModifier.isFinal(modifier)){
      throw new XRuntimeException("Try to write final field %s", getName());
    }
    finalSet(object, value);
  }
View Full Code Here

      i = index;
    }else{
      XClass xClass = object.getXClass().getXClass();
      XClassTable classTable = getDeclaringClass().getClassTable(xClass);
      if(classTable==null)
        throw new XRuntimeException("Can't cast %s to %s", xClass, getDeclaringClass());
      data = object.getData();
      i = classTable.getFieldStartID()+index;
      if(getTypePrimitive()==XPrimitive.OBJECT){
        XGenericClass type = getType(object.getXClass());
        XChecks.checkCast(object.getXClass(), type);
View Full Code Here

      XClass xClass = virtualMachine.getClassProvider().getXClass(className);
      method = xClass.getMethod(methodName, paramNames, retName);
      genericID = method.getGenericID(genericName);
    }
    if(methodExecutor.getMethod()!=method)
      throw new XRuntimeException("Can't get generic %s of method %s in method %s", genericName, method, methodExecutor.getMethod());
    return methodExecutor.getGeneric(genericID);
  }
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

    if(field==null){
      XClass xClass = vm.getClassProvider().getXClass(className);
      field = xClass.getField(fieldName);
      XChecks.checkAccess(methodExecutor.getMethod().getDeclaringClass(), field);
      if(!field.getType().equals(fieldType)){
        throw new XRuntimeException("Type of field %s has changed", field);
      }
      if(!XModifier.isStatic(field.getModifier())){
        throw new XRuntimeException("Field %s isn't static", field);
      }
    }
  }
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.