java.lang.NullPointerException.getLocalizedMessage()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(226)

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

NullPointerException.getLocalizedMessage介绍

暂无

代码示例

代码示例来源:origin: org.opencms/opencms-core

/**
 * Finds the path of the serialization policy file.<p>
 *
 * @param moduleBaseURL the GWT module's base url
 * @param strongName the strong name of the service
 *
 * @return the serialization policy path
 */
protected String getSerializationPolicyPath(String moduleBaseURL, String strongName) {
  // locate the serialization policy file in OpenCms
  String modulePath = null;
  try {
    modulePath = new URL(moduleBaseURL).getPath();
  } catch (MalformedURLException ex) {
    // moduleBaseUrl is bad
    LOG.error(ex.getLocalizedMessage(), ex);
    return null;
  } catch (NullPointerException ex) {
    // moduleBaseUrl is null
    LOG.error(ex.getLocalizedMessage(), ex);
    return null;
  }
  return SerializationPolicyLoader.getSerializationPolicyFileName(modulePath + strongName);
}

代码示例来源:origin: Sea-n/Android-TG-Bot

} catch (final NullPointerException e) {
  Log.e("fd", "Null Pointer", e);
  showError(e.getLocalizedMessage());
  return;

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

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

代码示例来源:origin: Sea-n/Android-TG-Bot

} catch (final NullPointerException e) {
  Log.e("api", "Null Pointer", e);
  final String finalResultText = e.getLocalizedMessage();
  Handler handler = new Handler(_context.getMainLooper());
  handler.post(new Runnable() {

代码示例来源:origin: de.unibonn.iai.eis/luzzu-io

} catch (NullPointerException e){
  logger.error("Cannot load metric for {}", className);
  throw new ExternalMetricLoaderException("Cannot create class instance " + className + ". Exception caused by an Illegal Access Exception : " + e.getLocalizedMessage());

代码示例来源:origin: de.unibonn.iai.eis/luzzu-io

} catch (NullPointerException e){
  logger.error("Cannot load metric for {}", className);
  throw new ExternalMetricLoaderException("Cannot create class instance " + className + ". Exception caused by an Illegal Access Exception : " + e.getLocalizedMessage());

代码示例来源:origin: de.unibonn.iai.eis/luzzu-io

} catch (NullPointerException e){
  logger.error("Cannot load metric for {}", className);
  throw new ExternalMetricLoaderException("Cannot create class instance " + className + ". Exception caused by an Illegal Access Exception : " + e.getLocalizedMessage());

代码示例来源:origin: de.unibonn.iai.eis/luzzu-io

} catch (NullPointerException e){
  logger.error("Cannot load metric for {}", className);
  throw new ExternalMetricLoaderException("Cannot create class instance " + className + ". Exception caused by an Illegal Access Exception : " + e.getLocalizedMessage());

代码示例来源:origin: org.opencms/opencms-core

LOG.error(e.getLocalizedMessage(), e);

代码示例来源:origin: io.github.luzzu/luzzu-io

} catch (NullPointerException e){
  logger.error("Cannot load metric for {}", className);
  throw new ExternalMetricLoaderException("Cannot create class instance " + className + ". Exception caused by an Illegal Access Exception : " + e.getLocalizedMessage());

代码示例来源:origin: org.opencms/opencms-solr

LOG.info(e.getLocalizedMessage());

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public static MethodHandle getMethodHandle(JRubyCallSite site, DynamicMethod method) {
  try {
    MethodHandle fast = getFastNumericMethodHandle(site, method);
    if (fast == null) {
      return generateNativeInvokerHandle(site, method);
    }
    MethodHandle guard = getDirectPointerParameterGuard(site, method);
    return guard != null
      ? MethodHandles.guardWithTest(guard, fast, generateNativeInvokerHandle(site, method))
      : fast;
  
  } catch (IndyNotSupportedException inse) {
    if (RubyInstanceConfig.LOG_INDY_BINDINGS) {
      LOG.info(site.name() + "\t" + inse.getLocalizedMessage());
    }
    return null;
  } catch (NullPointerException npe) {
    if (RubyInstanceConfig.LOG_INDY_BINDINGS) {
      LOG.info(site.name() + "\t" + npe.getLocalizedMessage());
    }
    return null;
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public static MethodHandle getMethodHandle(JRubyCallSite site, DynamicMethod method) {
  try {
    MethodHandle fast = getFastNumericMethodHandle(site, method);
    if (fast == null) {
      return generateNativeInvokerHandle(site, method);
    }
    MethodHandle guard = getDirectPointerParameterGuard(site, method);
    return guard != null
      ? MethodHandles.guardWithTest(guard, fast, generateNativeInvokerHandle(site, method))
      : fast;
  
  } catch (IndyNotSupportedException inse) {
    if (RubyInstanceConfig.LOG_INDY_BINDINGS) {
      LOG.info(site.name() + "\t" + inse.getLocalizedMessage());
    }
    return null;
  } catch (NullPointerException npe) {
    if (RubyInstanceConfig.LOG_INDY_BINDINGS) {
      LOG.info(site.name() + "\t" + npe.getLocalizedMessage());
    }
    return null;
  }
}

相关文章