Replace the callback to be used basic exception.

@param checkRule basic rule type ex,, BasicCheckRule.Mandatory
@param cb        callback class with implement ValidationInvalidCallback
@return CheckPointHeler check point helper
173190
public CheckPointHelper replaceExceptionCallback(BasicCheckRule checkRule, ValidationInvalidCallback cb) {
        this.msgChecker.replaceCallback(checkRule, cb);
        return this;
    }
1323563
function updateRules(rulesToUpdate, cb) {
    function updateRule(ruleDetails, cb1) {
      var id = ruleDetails._id;

      rulesModel.findOne({_id: id}, function(err, ruleToUpdate) {
        if (err) {
          return cb1(err);
        }

        if (ruleToUpdate === null && !options.createIfNotFound) {
          return cb1(new Error("No " + ruleType + " rule matches id " + id));
        } else if (ruleToUpdate === null && options.createIfNotFound) {
          ruleToUpdate = new rulesModel(ruleDetails);
        }

        for (var saveKey in ruleDetails) { // eslint-disable-line guard-for-in
          ruleToUpdate[saveKey] = ruleDetails[saveKey];
        }

        ruleToUpdate.save(cb1);
      });
    }

    async.map(rulesToUpdate, updateRule, cb);
  }
1322805
public BaseValidationCheck getValidationChecker(ValidationRule rule) {
        ValidationRule existRule = this.rules.stream().filter(r -> r.getRuleName().equals(rule.getRuleName())).findFirst().orElse(null);
        if (existRule == null) {
            throw new ValidationLibException("rulename : " + rule.getRuleName() + "checker is notfound  ", HttpStatus.INTERNAL_SERVER_ERROR);
        }
        return existRule.getValidationCheck();
    }
453048
private void validateEJBCallbackMethod(InterceptorMethodKind actualKind, Method m, boolean annotation)
                    throws EJBConfigurationException
    {
        // Get the name of the method.
        String methodName = m.getName();

        // Map the method name into one of the InterceptorMethodKind enum value
        // it is required to be by the EJB 3 specification.
        InterceptorMethodKind requiredKind = mapEjbCallbackName(methodName);

        // If the method is required to be a interceptor lifecycle callback method,
        // does the actual kind match the required kind?
        if (requiredKind != null && actualKind != requiredKind)
        {
            // It is one of the ejbXXXXX methods of the javax.ejb.SessionBean or
            // javax.ejb.MessageDriven interfaces, but either annotation or xml was used
            // to indicate it is the wrong kind of lifecycle callback event.

            // Get the class name of the EJB and map both the required InterceptorMethodKind
            // and actual InterceptorMethodKind into a String for the error message.
            String ejbClassName = ivEjbClass.getName();
            String required = mapInterceptorMethodKind(requiredKind, true, annotation);
            String actual = mapInterceptorMethodKind(actualKind, false, annotation);

            // Now build and log the error message based on type of EJB.
            StringBuilder sb = new StringBuilder();
            if (ivMDB)
            {
                // CNTR0243E: Because the {0} enterprise bean implements the javax.ejb.MessageDriven interface,
                // the {1} method must be a {2} method and not a {3} method.
                sb.append("CNTR0243E: Because the ").append(ejbClassName);
                sb.append(" enterprise bean implements the javax.ejb.MessageDriven interface, the ");
                sb.append(methodName).append(" method must be a ").append(required);
                sb.append(" method and not a ").append(actual).append(" method.");
                Tr.error(tc, "INVALID_MDB_CALLBACK_METHOD_CNTR0243E"
                         , new Object[] { ejbClassName, methodName, required, actual });

            }
            else if (ivSLSB)
            {
                // CNTR0241E: Because the {0} enterprise bean implements the javax.ejb.SessionBean interface,
                // the {1} method must be a {2} method and not a {3} method.
                sb.append("CNTR0241E: Because the ").append(ejbClassName);
                sb.append(" enterprise bean implements the javax.ejb.SessionBean interface, the ");
                sb.append(methodName).append(" method must be a ").append(required);
                sb.append(" method and not a ").append(actual).append(" method.");
                Tr.error(tc, "INVALID_SLSB_CALLBACK_METHOD_CNTR0241E"
                         , new Object[] { ejbClassName, methodName, required, actual });
            }
            else if (ivSFSB)
            {
                // CNTR0242E: Because the {0} enterprise bean implements the javax.ejb.SessionBean interface,
                // the {1} method must be a {2} method and not a {3} method.
                sb.append("CNTR0242E: Because the ").append(ejbClassName);
                sb.append(" enterprise bean implements the javax.ejb.SessionBean interface, the ");
                sb.append(methodName).append(" method must be a ").append(required);
                sb.append(" method and not a ").append(actual).append(" method.");
                Tr.error(tc, "INVALID_SFSB_CALLBACK_METHOD_CNTR0242E"
                         , new Object[] { ejbClassName, methodName, required, actual });
            }

            // Throw the EJBConfigurationException with message text that was built for the error.
            throw new EJBConfigurationException(sb.toString());
        }
    }
576434
public static boolean check() {
        Class<?> objectType;
        Class<?>  type;
        Class<?>  constants;
        Class<?>  emptyVis;
        Class<?>  repository;
        try {
            objectType = Class.forName(ORG_APACHE_BCEL_GENERIC_OBJECT_TYPE);
            type = Class.forName(ORG_APACHE_BCEL_GENERIC_TYPE);
            constants = Class.forName(ORG_APACHE_BCEL_CONSTANTS);
            emptyVis = Class.forName(ORG_APACHE_BCEL_CLASSFILE_EMPTY_VISITOR);
            repository = Class.forName(ORG_APACHE_BCEL_REPOSITORY);

        } catch (ClassNotFoundException e) {
            LOG.error("One or more required BCEL classes were missing."
                    + " Ensure that bcel.jar is placed at the same directory with spotbugs.jar");
            return false;
        }
        if (isFinal(objectType)) {
            error(ORG_APACHE_BCEL_GENERIC_OBJECT_TYPE);
            return false;
        }
        if (isFinal(type)) {
            error(ORG_APACHE_BCEL_GENERIC_TYPE);
            return false;
        }
        if (isFinal(constants)) {
            error(ORG_APACHE_BCEL_CONSTANTS);
            return false;
        }
        if (isFinal(emptyVis)) {
            error(ORG_APACHE_BCEL_CLASSFILE_EMPTY_VISITOR);
            return false;
        }
        if (isFinal(repository)) {
            error(ORG_APACHE_BCEL_REPOSITORY);
            return false;
        }
        return true;
    }
23879
private void removeCallBackStruct(Hashtable map, EventCallBackStruct cb_struct) throws DevFailed {
        removeFilters(cb_struct);
        String callback_key = cb_struct.device.name().toLowerCase() +
                "/" + cb_struct.attr_name + "." + cb_struct.event_name;
        map.remove(callback_key);
    }
1197686
public void checkPoint(ValidationData param, ValidationRule rule, Object bodyObj, Object standardValue) {
        //check
        Object value = param.getValue(bodyObj);
        BaseValidationCheck checker = this.validationRuleStore.getValidationChecker(rule);
        if ((value != null && standardValue != null) || rule.getAssistType().isNullable()) {
            boolean valid = checker.check(value, standardValue);

            if (!valid) {
                this.callExcpetion(param, rule, value, standardValue);
            }

        }
        //replace value
        Object replaceValue = checker.replace(value, standardValue, param);
        if (replaceValue != null && replaceValue != value) {
            param.replaceValue(bodyObj, replaceValue);
        }
    }
367265
public FxCopRule getRule(final String category, final String checkId) {
		String key = getRuleKey(category, checkId);
		FxCopRule rule = null;
		if (rules.containsKey(key)) {
			rule = rules.get(key);
		}
		return rule;
	}
1136003
public MultipleRuleContext<DPO, RI, RO> check(Rule<RI, RO> rule) {
        if (rule != null) {
            addedRules.add(rule);
        }

        // Change context
        return new MultipleRuleContext<DPO, RI, RO>(addedTriggers, addedDataProviders, dataProviderToRuleMapping,
                addedRuleInputTransformers, addedRules);
    }
437835
public static <P extends ICallbackPredicate> CallbackOption<P> of(P predicate)
		{
			return new CallbackOption<>(checkNotNull(predicate), Priority.NORMAL);
		}
293463
void validateStopCloseForMessageListener(String functionCall) throws IllegalStateException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "validateStopForMessageListener");

        //Before triggering onMessage .. SIB pushes "owning session object" to Thread Local, 
        //Now obtain the Session object from Thread Local and validate with 'this'. 
        if ((JmsSessionImpl.asyncReceiverThreadLocal.get() != null) && (JmsSessionImpl.asyncReceiverThreadLocal.get() == this)) {

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(tc, "Message Listener onMessage called stop on its own Context/connection.");

            if (functionCall.equalsIgnoreCase("stop")) {
                //stop is called.

                //the stop call is driven from this JmsSessionImpl object only.. throw JMSException
                throw (IllegalStateException) JmsErrorUtils.newThrowable(IllegalStateException.class,
                                                                         "INVALID_METHOD_CWSIA0517",
                                                                         new Object[] { this },
                                                                         tc
                                );
            } else {
                //close is called
                //the stop call is driven from this JmsSessionImpl object only.. throw JMSException
                throw (IllegalStateException) JmsErrorUtils.newThrowable(IllegalStateException.class,
                                                                         "INVALID_METHOD_CWSIA0518",
                                                                         new Object[] { this },
                                                                         tc
                                );

            }

        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "validateStopForMessageListener");

    }
1297413
function cb(err) {
        if (callback) {
            if (err) return callback(err);
            callback(null, rec);
        }
        callback = null;
        if (!err) {
            that.emit('logged', rec);
        }
    }
527977
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPRule updateCPRule(CPRule cpRule) {
		return cpRulePersistence.update(cpRule);
	}
1007658
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPRule addCPRule(CPRule cpRule) {
		cpRule.setNew(true);

		return cpRulePersistence.update(cpRule);
	}
480972
function(inputValue, ruleValue, attribute, callback) {
    var fn = this.isMissed() ? missedRuleValidator : this.fn;

    return fn.apply(this, [inputValue, ruleValue, attribute, callback]);
  }
601887
private void checkBasicConstraints(X509Certificate currCert)
        throws CertPathValidatorException
    {
        String msg = "basic constraints";
        if (debug != null) {
            debug.println("---checking " + msg + "...");
            debug.println("i = " + i +
                        ", maxPathLength = " + maxPathLength);
        }

        /* check if intermediate cert */
        if (i < certPathLength) {
            // RFC5280: If certificate i is a version 3 certificate, verify
            // that the basicConstraints extension is present and that cA is
            // set to TRUE.  (If certificate i is a version 1 or version 2
            // certificate, then the application MUST either verify that
            // certificate i is a CA certificate through out-of-band means
            // or reject the certificate.  Conforming implementations may
            // choose to reject all version 1 and version 2 intermediate
            // certificates.)
            //
            // We choose to reject all version 1 and version 2 intermediate
            // certificates except that it is self issued by the trust
            // anchor in order to support key rollover or changes in
            // certificate policies.
            int pathLenConstraint = -1;
            if (currCert.getVersion() < 3) {    // version 1 or version 2
                if (i == 1) {                   // issued by a trust anchor
                    if (X509CertImpl.isSelfIssued(currCert)) {
                        pathLenConstraint = Integer.MAX_VALUE;
                    }
                }
            } else {
                pathLenConstraint = currCert.getBasicConstraints();
            }

            if (pathLenConstraint == -1) {
                throw new CertPathValidatorException
                    (msg + " check failed: this is not a CA certificate",
                     null, null, -1, PKIXReason.NOT_CA_CERT);
            }

            if (!X509CertImpl.isSelfIssued(currCert)) {
                if (maxPathLength <= 0) {
                   throw new CertPathValidatorException
                        (msg + " check failed: pathLenConstraint violated - "
                         + "this cert must be the last cert in the "
                         + "certification path", null, null, -1,
                         PKIXReason.PATH_TOO_LONG);
                }
                maxPathLength--;
            }
            if (pathLenConstraint < maxPathLength)
                maxPathLength = pathLenConstraint;
        }

        if (debug != null) {
            debug.println("after processing, maxPathLength = " + maxPathLength);
            debug.println(msg + " verified.");
        }
    }
1133039
protected final void waitForCheckpoint(boolean persistent)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "waitForCheckpoint");

        checkpointHelper.waitForCheckpoint(persistent);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "waitForCheckpoint",
                       "persistent=" + persistent + "(boolean)");
    }