Search in sources :

Example 1 with NullArgumentException

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);
}
Also used : AnomalyFunctionDTO(com.linkedin.thirdeye.datalayer.dto.AnomalyFunctionDTO) NullArgumentException(org.apache.commons.lang.NullArgumentException)

Example 2 with NullArgumentException

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);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) NullArgumentException(org.apache.commons.lang.NullArgumentException)

Example 3 with NullArgumentException

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;
}
Also used : Method(java.lang.reflect.Method) NullArgumentException(org.apache.commons.lang.NullArgumentException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 4 with NullArgumentException

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;
}
Also used : RemoteAngularObjectRegistry(org.apache.zeppelin.interpreter.remote.RemoteAngularObjectRegistry) NullArgumentException(org.apache.commons.lang.NullArgumentException) RemoteAngularObjectRegistry(org.apache.zeppelin.interpreter.remote.RemoteAngularObjectRegistry) AngularObjectRegistry(org.apache.zeppelin.display.AngularObjectRegistry)

Example 5 with NullArgumentException

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;
}
Also used : RemoteAngularObjectRegistry(org.apache.zeppelin.interpreter.remote.RemoteAngularObjectRegistry) NullArgumentException(org.apache.commons.lang.NullArgumentException) RemoteAngularObjectRegistry(org.apache.zeppelin.interpreter.remote.RemoteAngularObjectRegistry) AngularObjectRegistry(org.apache.zeppelin.display.AngularObjectRegistry)

Aggregations

NullArgumentException (org.apache.commons.lang.NullArgumentException)9 AnomalyFunctionDTO (com.linkedin.thirdeye.datalayer.dto.AnomalyFunctionDTO)2 DatasetConfigDTO (com.linkedin.thirdeye.datalayer.dto.DatasetConfigDTO)2 AngularObjectRegistry (org.apache.zeppelin.display.AngularObjectRegistry)2 RemoteAngularObjectRegistry (org.apache.zeppelin.interpreter.remote.RemoteAngularObjectRegistry)2 EmailConfigurationDTO (com.linkedin.thirdeye.datalayer.dto.EmailConfigurationDTO)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1