Package java.lang

Examples of java.lang.RuntimeException


  // set mode option at run-time
  public void setMode(int opt) {
    if (cs.cs_option(ns.csh, CS_OPT_MODE, new NativeLong(opt)) == CS_ERR_OK) {
      this.mode = opt;
    } else {
      throw new RuntimeException("ERROR: Failed to set mode option");
    }
  }
View Full Code Here


  public Capstone(int arch, int mode) {
    cs = (CS)Native.loadLibrary("capstone", CS.class);
    int version = cs.cs_version(null, null);
    if (version != (CS_API_MAJOR << 8) + CS_API_MINOR) {
      throw new RuntimeException("Different API version between core & binding (CS_ERR_VERSION)");
    }

    this.arch = arch;
    this.mode = mode;
    ns = new NativeStruct();
    ns.handleRef = new NativeLongByReference();
    if (cs.cs_open(arch, mode, ns.handleRef) != CS_ERR_OK) {
      throw new RuntimeException("ERROR: Wrong arch or mode");
    }
    ns.csh = ns.handleRef.getValue();
    this.detail = CS_OPT_OFF;
  this.diet = cs.cs_support(CS_SUPPORT_DIET);
  }
View Full Code Here

  // set Assembly syntax
  public void setSyntax(int syntax) {
    if (cs.cs_option(ns.csh, CS_OPT_SYNTAX, new NativeLong(syntax)) == CS_ERR_OK) {
      this.syntax = syntax;
    } else {
      throw new RuntimeException("ERROR: Failed to set assembly syntax");
    }
  }
View Full Code Here

  // set detail option at run-time
  public void setDetail(int opt) {
    if (cs.cs_option(ns.csh, CS_OPT_DETAIL, new NativeLong(opt)) == CS_ERR_OK) {
      this.detail = opt;
    } else {
      throw new RuntimeException("ERROR: Failed to set detail option");
    }
  }
View Full Code Here

  // set mode option at run-time
  public void setMode(int opt) {
    if (cs.cs_option(ns.csh, CS_OPT_MODE, new NativeLong(opt)) == CS_ERR_OK) {
      this.mode = opt;
    } else {
      throw new RuntimeException("ERROR: Failed to set mode option");
    }
  }
View Full Code Here

    public static class CtorReader extends AFn {
        public Object invoke(Object reader, Object firstChar) {
            PushbackReader r = (PushbackReader) reader;
            Object name = read(r, true, null, false);
            if (!(name instanceof Symbol))
                throw new RuntimeException("Reader tag must be a symbol");
            Symbol sym = (Symbol) name;
            return sym.getName().contains(".") ? readRecord(r, sym) : readTagged(r, sym);
        }
View Full Code Here

                if (data_reader == null) {
                    IFn default_reader = (IFn) RT.DEFAULT_DATA_READER_FN.deref();
                    if (default_reader != null)
                        return default_reader.invoke(tag, o);
                    else
                        throw new RuntimeException("No reader function for tag " + tag.toString());
                }
            }

            return data_reader.invoke(o);
        }
View Full Code Here

    private Widget backWidget;

    public Cardflip(String id) {
        this(id, null);
        if (id == null || id.length() == 0) {
            throw new RuntimeException("Cardflip must have an id");
        }

    }
View Full Code Here

    switch (status) {
      case STATUS_OK:
        break;

      case STATUS_ERROR:
        throw new RuntimeException(oniGetExtendedError());

      case STATUS_NOT_IMPLEMENTED:
        throw new UnsupportedOperationException(oniGetExtendedError());

      case STATUS_NOT_SUPPORTED:
        throw new UnsupportedOperationException(oniGetExtendedError());

      case STATUS_BAD_PARAMETER:
        throw new IllegalArgumentException(oniGetExtendedError());

      case STATUS_OUT_OF_FLOW:
        throw new IllegalStateException(oniGetExtendedError());

      default:
        throw new RuntimeException(oniGetExtendedError());
    }
  }
View Full Code Here

TOP

Related Classes of java.lang.RuntimeException

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.