java.lang.ClassLoader.setClassAssertionStatus()方法的使用及代码示例

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

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

ClassLoader.setClassAssertionStatus介绍

[英]Sets the assertion status of the class with the specified name.

Note: This method does nothing in the Android reference implementation.
[中]设置具有指定名称的类的断言状态。
注意:此方法在Android参考实现中不起任何作用。

代码示例

代码示例来源:origin: PipelineAI/pipeline

public void setClassAssertionStatus(String className, boolean enabled) {
  delegate.setClassAssertionStatus(className, enabled);
}

代码示例来源:origin: apache/nifi

@Override
public void setClassAssertionStatus(String className, boolean enabled) {
  lookupClassLoader().setClassAssertionStatus(className, enabled);
}

代码示例来源:origin: stackoverflow.com

parent.setClassAssertionStatus(className, enabled);

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core

@Override
public synchronized void setClassAssertionStatus(String className, boolean enabled) {
  for (ClassLoader classloader : classLoaders) {
    classloader.setClassAssertionStatus(className, enabled);
  }
}

代码示例来源:origin: com.atlassian.plugins.rest/atlassian-rest-module

@Override
public synchronized void setClassAssertionStatus(String className, boolean enabled) {
  for (ClassLoader classloader : classLoaders) {
    classloader.setClassAssertionStatus(className, enabled);
  }
}

代码示例来源:origin: com.sap.cloud.servicesdk.prov/odata-core

@Override
public synchronized void setClassAssertionStatus(String className, boolean enabled) {
  for (ClassLoader cl : classLoaders) {
    cl.setClassAssertionStatus(className, enabled);
  }
}

代码示例来源:origin: com.google.code.maven-play-plugin.com.kjetland/gt-engine

@Override
public void setClassAssertionStatus(String s, boolean b) {
  super.setClassAssertionStatus(s, b);
}

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core

public synchronized void setClassAssertionStatus(String className, boolean enabled) {
  delegateClassLoader.setClassAssertionStatus(className, enabled);
}

代码示例来源:origin: DirectProject/nhin-d

/**
 * {@inheritDoc}
 */
@Override
public synchronized void setClassAssertionStatus(String arg0, boolean arg1) 
{
  for(ClassLoader loader : classLoaders)
    loader.setClassAssertionStatus(arg0, arg1);
  
  for(ClassLoader loader : resourceLoaders)
    loader.setClassAssertionStatus(arg0, arg1);
}

代码示例来源:origin: Silverpeas/Silverpeas-Core

@Override
public synchronized void setClassAssertionStatus(String className, boolean enabled) {
 super.setClassAssertionStatus(className, enabled);
}

代码示例来源:origin: org.ow2.jonas/jonas-commons

/**
 * @see java.lang.ClassLoader#setClassAssertionStatus(java.lang.String,
 *      boolean)
 */
public synchronized void setClassAssertionStatus(String className, boolean enabled) {
  getContextClassLoader().setClassAssertionStatus(className, enabled);
}

代码示例来源:origin: org.dspace.dependencies.jmockit/dspace-jmockit

private void enableAssertsIfTestClass(ClassLoader loader, ProtectionDomain protectionDomain, String className)
{
 if (
   loader != null && protectionDomain != null &&
   (className.endsWith("Test") || isFromTestClassesDirectory(protectionDomain))
 ) {
   loader.setClassAssertionStatus(className.replace('/', '.'), true);
 }
}

代码示例来源:origin: org.qcri.rheem/rheem-graphchi

/**
 * Initializes this instance.
 */
private void initialize() {
  // Set up.
  CompressedIO.disableCompression();
  GraphChiPlatform.class.getClassLoader().setClassAssertionStatus(
      "edu.cmu.graphchi.preprocessing.FastSharder", false);
}

代码示例来源:origin: org.apache.openjpa/openjpa-osgi

/**
 * Sets the desired assertion status for the named top-level class.
 *
 * @see ClassLoader#setClassAssertionStatus(String, boolean)
 */
@Override
public synchronized void setClassAssertionStatus(String className, boolean enabled) {
  for (ClassLoader classLoader : getClassLoaders()) {
    classLoader.setClassAssertionStatus(className, enabled);
  }
}

代码示例来源:origin: org.objectweb.jonas/jonas-commons

/**
 * @see java.lang.ClassLoader#setClassAssertionStatus(java.lang.String,
 *      boolean)
 */
public synchronized void setClassAssertionStatus(String className, boolean enabled) {
  getContextClassLoader().setClassAssertionStatus(className, enabled);
}

代码示例来源:origin: org.jboss.ironjacamar/ironjacamar-core-impl

/**
* {@inheritDoc}
*/
@Override
public void setClassAssertionStatus(String className, boolean enabled)
{
 if (resourceAdapterClassLoader != null)
   resourceAdapterClassLoader.setClassAssertionStatus(className, enabled);
 super.setClassAssertionStatus(className, enabled);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.osgi

/** 
 * Sets the desired assertion status for the named top-level class.
 * 
 * @see  ClassLoader#setClassAssertionStatus(String, boolean)
 */
@Override
public synchronized void setClassAssertionStatus(String className,
    boolean enabled) {
  for (ClassLoader classLoader : getClassLoaders()) {
    classLoader.setClassAssertionStatus(className, enabled);
  }
}

代码示例来源:origin: org.apache.nifi.minifi/minifi-nar-utils

@Override
public void setClassAssertionStatus(String className, boolean enabled) {
  lookupClassLoader().setClassAssertionStatus(className, enabled);
}

代码示例来源:origin: apache/nifi-minifi

@Override
public void setClassAssertionStatus(String className, boolean enabled) {
  lookupClassLoader().setClassAssertionStatus(className, enabled);
}

代码示例来源:origin: javapathfinder/jpf-core

@Test
public void testSetClassAssertionStatus1() {
 if (verifyAssertionErrorDetails("oops, assertion failed")) {
  ClassLoader cl = ClassLoader.getSystemClassLoader();
  // this should change the "desiredAssertionStatus()" return value to false, 
  // but it shouldn't change the actual assertion status since the class has 
  // been already initialized
  cl.setClassAssertionStatus("gov.nasa.jpf.test.vm.basic.AssertTest", false);
  assertFalse(AssertTest.class.desiredAssertionStatus());
  // throw AssertionError
  assert false : "oops, assertion failed";
 }
}

相关文章