use of org.apache.commons.lang.NullArgumentException in project pinot by linkedin.
the class DetectionJobResource method toggleRequiresCompletenessCheck.
private void toggleRequiresCompletenessCheck(Long id, boolean state) {
AnomalyFunctionDTO anomalyFunctionSpec = anomalyFunctionSpecDAO.findById(id);
if (anomalyFunctionSpec == null) {
throw new NullArgumentException("Function spec not found");
}
anomalyFunctionSpec.setRequiresCompletenessCheck(state);
anomalyFunctionSpecDAO.update(anomalyFunctionSpec);
}
use of org.apache.commons.lang.NullArgumentException in project tmdm-studio-se by Talend.
the class ListContentsCommitHandler method doUpdateFKAnnotationStructure.
protected void doUpdateFKAnnotationStructure(XSDAnnotationsStructure xsdAnnoStruct) {
if (xsdAnnoStruct == null) {
throw new NullArgumentException(null);
}
String fk = xsdAnnoStruct.getForeignKey();
if (fk == null || fk.trim().isEmpty()) {
xsdAnnoStruct.setForeignKeyNotSep(null);
xsdAnnoStruct.setFKFilter(null);
xsdAnnoStruct.setForeignKeyInfos(new ArrayList());
xsdAnnoStruct.setRetrieveFKinfos(null);
xsdAnnoStruct.setFKIntegrity(null);
xsdAnnoStruct.setFKIntegrityOverride(null);
if (xsdAnnoStruct.getAnnotation().getApplicationInformation().isEmpty() && xsdAnnoStruct.getAnnotation().getUserInformation().isEmpty()) {
xsdAnnoStruct.getDeclaration().setAnnotation(null);
}
}
}
use of org.apache.commons.lang.NullArgumentException in project applause by applause.
the class ExceptionUtils method setCause.
/**
* <p>Sets the cause of a <code>Throwable</code> using introspection, allowing
* source code compatibility between pre-1.4 and post-1.4 Java releases.</p>
*
* <p>The typical use of this method is inside a constructor as in
* the following example:</p>
*
* <pre>
* import org.apache.commons.lang.exception.ExceptionUtils;
*
* public class MyException extends Exception {
*
* public MyException(String msg) {
* super(msg);
* }
*
* public MyException(String msg, Throwable cause) {
* super(msg);
* ExceptionUtils.setCause(this, cause);
* }
* }
* </pre>
*
* @param target the target <code>Throwable</code>
* @param cause the <code>Throwable</code> to set in the target
* @return a <code>true</code> if the target has been modified
* @since 2.2
*/
public static boolean setCause(Throwable target, Throwable cause) {
if (target == null) {
throw new NullArgumentException("target");
}
Object[] causeArgs = new Object[] { cause };
boolean modifiedTarget = false;
if (THROWABLE_INITCAUSE_METHOD != null) {
try {
THROWABLE_INITCAUSE_METHOD.invoke(target, causeArgs);
modifiedTarget = true;
} catch (IllegalAccessException ignored) {
// Exception ignored.
} catch (InvocationTargetException ignored) {
// Exception ignored.
}
}
try {
Method setCauseMethod = target.getClass().getMethod("setCause", new Class[] { Throwable.class });
setCauseMethod.invoke(target, causeArgs);
modifiedTarget = true;
} catch (NoSuchMethodException ignored) {
// Exception ignored.
} catch (IllegalAccessException ignored) {
// Exception ignored.
} catch (InvocationTargetException ignored) {
// Exception ignored.
}
return modifiedTarget;
}
use of org.apache.commons.lang.NullArgumentException in project SSM by Intel-bigdata.
the class InterpreterFactory method createInterpreterGroup.
/**
* @param id interpreterGroup id. Combination of interpreterSettingId + noteId/userId/shared
* depends on interpreter mode
*/
@Override
public InterpreterGroup createInterpreterGroup(String id, InterpreterOption option) throws InterpreterException, NullArgumentException {
// When called from REST API without option we receive NPE
if (option == null) {
throw new NullArgumentException("option");
}
AngularObjectRegistry angularObjectRegistry;
InterpreterGroup interpreterGroup = new InterpreterGroup(id);
if (option.isRemote()) {
angularObjectRegistry = new RemoteAngularObjectRegistry(id, angularObjectRegistryListener, interpreterGroup);
} else {
angularObjectRegistry = new AngularObjectRegistry(id, angularObjectRegistryListener);
// TODO(moon) : create distributed resource pool for local interpreters and set
}
interpreterGroup.setAngularObjectRegistry(angularObjectRegistry);
return interpreterGroup;
}
use of org.apache.commons.lang.NullArgumentException in project zeppelin by apache.
the class InterpreterFactory method createInterpreterGroup.
/**
* @param id interpreterGroup id. Combination of interpreterSettingId + noteId/userId/shared
* depends on interpreter mode
*/
@Override
public InterpreterGroup createInterpreterGroup(String id, InterpreterOption option) throws InterpreterException, NullArgumentException {
//When called from REST API without option we receive NPE
if (option == null) {
throw new NullArgumentException("option");
}
AngularObjectRegistry angularObjectRegistry;
InterpreterGroup interpreterGroup = new InterpreterGroup(id);
if (option.isRemote()) {
angularObjectRegistry = new RemoteAngularObjectRegistry(id, angularObjectRegistryListener, interpreterGroup);
} else {
angularObjectRegistry = new AngularObjectRegistry(id, angularObjectRegistryListener);
// TODO(moon) : create distributed resource pool for local interpreters and set
}
interpreterGroup.setAngularObjectRegistry(angularObjectRegistry);
return interpreterGroup;
}
Aggregations