java.lang.Error.toString()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中java.lang.Error.toString()方法的一些代码示例,展示了Error.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Error.toString()方法的具体详情如下:
包路径:java.lang.Error
类名称:Error
方法名:toString

Error.toString介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

/**
 * Constructs an exception.
 */
public NoSuchClassError(String className, Error cause) {
  super(cause.toString(), cause);
  this.className = className;
}

代码示例来源:origin: scouter-project/scouter

/**
 * Constructs an exception.
 */
public NoSuchClassError(String className, Error cause) {
  super(cause.toString(), cause);
  this.className = className;
}

代码示例来源:origin: org.javassist/javassist

/**
 * Constructs an exception.
 */
public NoSuchClassError(String className, Error cause) {
  super(cause.toString(), cause);
  this.className = className;
}

代码示例来源:origin: h2oai/h2o-2

public String toString() {  return ( m != null ) ? m : super.toString();  }
}

代码示例来源:origin: scouter-project/scouter

/**
 * Constructs an exception.
 */
public NoSuchClassError(String className, Error cause) {
  super(cause.toString(), cause);
  this.className = className;
}

代码示例来源:origin: spring-projects/spring-framework

@ExceptionHandler(AssertionError.class)
  public String handleAssertionError(Error err) {
    return err.toString();
  }
}

代码示例来源:origin: spring-projects/spring-framework

@ExceptionHandler(AssertionError.class)
  public String handleAssertionError(Error err) {
    return err.toString();
  }
}

代码示例来源:origin: Tencent/tinker

public static boolean isTinkerPatchServiceRunning(Context context) {
  final ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
  String serverName = getTinkerPatchServiceName(context);
  if (serverName == null) {
    return false;
  }
  try {
    // ActivityManager getRunningAppProcesses()
    List<ActivityManager.RunningAppProcessInfo> appProcessList = am
      .getRunningAppProcesses();
    if (appProcessList == null) {
      return false;
    }
    for (ActivityManager.RunningAppProcessInfo appProcess : appProcessList) {
      String processName = appProcess.processName;
      if (processName.equals(serverName)) {
        return true;
      }
    }
  } catch (Exception e) {
    Log.e(TAG, "isTinkerPatchServiceRunning Exception: " + e.toString());
    return false;
  } catch (Error e) {
    Log.e(TAG, "isTinkerPatchServiceRunning Error: " + e.toString());
    return false;
  }
  return false;
}

代码示例来源:origin: MovingBlocks/Terasology

/**
 * Turn on the keyboard overlay. This is a keyboard that hovers in front of the user, that can be typed upon by
 * pointing the ray extending from the top of the controller at the key the user wants to press.
 * @param showingState - true or false
 * @return - true if successful. If this call fails, an error is logged.
 */
public static boolean setKeyboardOverlayShowing(boolean showingState) {
  int ret;
  if (showingState) {
    Pointer pointer = new Memory(3);
    pointer.setString(0, "mc");
    Pointer empty = new Memory(1);
    empty.setString(0, "");
    ret = vrOverlay.ShowKeyboard.apply(0, 0, pointer, 256, empty, (byte) 1, 0);
    keyboardShowing = 0 == ret; //0 = no error, > 0 see EVROverlayError
    if (ret != 0) {
      logger.error("VR Overlay Error: " + vrOverlay.GetOverlayErrorNameFromEnum.apply(ret).getString(0));
    }
  } else {
    try {
      vrOverlay.HideKeyboard.apply();
    } catch (Error e) {
      logger.error("Error bringing up keyboard overlay: " + e.toString());
    }
    keyboardShowing = false;
  }
  return keyboardShowing;
}

代码示例来源:origin: twosigma/beakerx

@Override
public void run() {
 try {
  while (!this.isShutdown()) {
   sockets.poll();
   if (isControlMsg()) {
    handleControlMsg();
   } else if (isHeartbeatMsg()) {
    handleHeartbeat();
   } else if (isShellMsg()) {
    handleShell();
   } else if (isStdinMsg()) {
    handleStdIn();
   } else if (this.isShutdown()) {
    break;
   }
  }
 } catch (Exception e) {
  throw new RuntimeException(e);
 } catch (Error e) {
  logger.error(e.toString());
 } finally {
  close();
 }
}

代码示例来源:origin: org.jboss.javassist/com.springsource.javassist

/**
 * Constructs an exception.
 */
public NoSuchClassError(String className, Error cause) {
  super(cause.toString(), cause);
  this.className = className;
}

代码示例来源:origin: net.wetheinter/xapi-jre-reflect

/**
 * Constructs an exception.
 */
public NoSuchClassError(String className, Error cause) {
  super(cause.toString(), cause);
  this.className = className;
}

代码示例来源:origin: jobop/anylog

/**
 * Constructs an exception.
 */
public NoSuchClassError(String className, Error cause) {
  super(cause.toString(), cause);
  this.className = className;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Constructs an exception.
 */
public NoSuchClassError(String className, Error cause) {
  super(cause.toString(), cause);
  this.className = className;
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

/**
 * Constructs an exception.
 */
public NoSuchClassError(String className, Error cause) {
  super(cause.toString(), cause);
  this.className = className;
}

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

/**
  Annotate the NoClassDefFoundError with some info about the class
  we were trying to load.
*/
protected static Error noClassDefFound( String className, Error e ) {
  return new NoClassDefFoundError(
    "A class required by class: "+className +" could not be loaded:\n"
    +e.toString() );
}

代码示例来源:origin: approvals/ApprovalTests.Java

/***********************************************************************/
public String toString()
{
 return super.toString() + "\n" + (cause == null ? "" : "Causation:  " + cause.toString());
}
/***********************************************************************/

代码示例来源:origin: EvoSuite/evosuite

@Override
public String toString() {
  if(!MockFramework.isEnabled()){
    return super.toString();
  }
  return getDelegate().toString();
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-kernel

private static JPQLNode parse(String jpql) {
  if (jpql == null)
    jpql = "";
  try {
    return (JPQLNode) new JPQL(jpql).parseQuery();
  } catch (Error e) {
    // special handling for Error subclasses, which the
    // parser may sometimes (unfortunately) throw
    throw new UserException(_loc.get("parse-error",
      new Object[]{ e.toString(), jpql }));
  }
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

private static JPQLNode parse(String jpql) {
  if (jpql == null)
    jpql = "";
  try {
    return (JPQLNode) new JPQL(jpql).parseQuery();
  } catch (Error e) {
    // special handling for Error subclasses, which the
    // parser may sometimes (unfortunately) throw
    throw new UserException(_loc.get("parse-error",
      new Object[]{ e.toString(), jpql }));
  }
}

相关文章