auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private AbstractPlanNode buildSetOpPlan(AbstractPlanNode setOpPlanNode, List<CompiledPlan> childrenPlans, boolean needPushSetOpDown) { AbstractPlanNode rootNode = setOpPlanNode; if (needPushSetOpDown) { rootNode = SubPlanAssembler.addSendReceivePair(rootNode); for (CompiledPlan selectPlan : childrenPlans) { AbstractPlanNode childPlan = selectPlan.rootPlanGraph; AbstractPlanNode childParent = setOpPlanNode; if (selectPlan.rootPlanGraph instanceof ProjectionPlanNode) { setOpPlanNode.addAndLinkChild(selectPlan.rootPlanGraph); assert(selectPlan.rootPlanGraph.getChildCount() == 1); childPlan = selectPlan.rootPlanGraph.getChild(0); selectPlan.rootPlanGraph.clearChildren(); childParent = selectPlan.rootPlanGraph; } assert(childPlan instanceof MergeReceivePlanNode || childPlan instanceof ReceivePlanNode); childPlan = childPlan.getChild(0).getChild(0); childPlan.clearParents(); childParent.addAndLinkChild(childPlan); } } else { for (CompiledPlan selectPlan : childrenPlans) { rootNode.addAndLinkChild(selectPlan.rootPlanGraph); } } return rootNode; }

Target:
private AbstractPlanNode buildSetOpPlan(AbstractPlanNode setOpPlanNode, List<CompiledPlan> childrenPlans, boolean needPushSetOpDown) { AbstractPlanNode rootNode = setOpPlanNode; if (needPushSetOpDown) { rootNode = SubPlanAssembler.addSendReceivePair(rootNode); for (CompiledPlan selectPlan : childrenPlans) { AbstractPlanNode childPlan = selectPlan.rootPlanGraph; AbstractPlanNode childParent = setOpPlanNode; if (childPlan instanceof ProjectionPlanNode) { setOpPlanNode.addAndLinkChild(childPlan); assert(childPlan.getChildCount() == 1); AbstractPlanNode newChildPlan = childPlan.getChild(0); childPlan.clearChildren(); childParent = childPlan; childPlan = newChildPlan; } if(childPlan instanceof MergeReceivePlanNode || childPlan instanceof ReceivePlanNode) { childPlan = childPlan.getChild(0).getChild(0); childPlan.clearParents(); } childParent.addAndLinkChild(childPlan); } } else { for (CompiledPlan selectPlan : childrenPlans) { rootNode.addAndLinkChild(selectPlan.rootPlanGraph); } } return rootNode; }
Source:
private Optional<Map.Entry<String, Object>> metacardEntryToJsonEntry( final Map.Entry<String, Object> entry, WorkspaceTransformation transformation) { if (transformation.getMetacardValueType().isInstance(entry.getValue())) { final String newKey = transformation.getJsonKey(); return transformation .metacardValueToJsonValue( this, transformation.getMetacardValueType().cast(entry.getValue())) .map(newValue -> new AbstractMap.SimpleEntry<>(newKey, newValue)); } else { LOGGER.warn( "A workspace transformation expected a value of type for metacard attribute \"{}\", but instead found a value of type {}!", transformation.getMetacardValueType().getName(), entry.getKey(), entry.getValue().getClass().getName()); return Optional.empty(); } }

Target:
private Optional<Map.Entry<String, Object>> metacardEntryToJsonEntry( final Map.Entry<String, Object> entry, WorkspaceTransformation transformation) { if (transformation.getMetacardValueType().isInstance(entry.getValue())) { final String newKey = transformation.getJsonKey(); return transformation .metacardValueToJsonValue( this, transformation.getMetacardValueType().cast(entry.getValue())) .map(newValue -> new AbstractMap.SimpleEntry<>(newKey, newValue)); } else { LOGGER.warn( "A workspace transformation expected a value of type for metacard attribute \"{}\", but instead found a value of type {}.", transformation.getMetacardValueType().getName(), entry.getKey(), entry.getValue().getClass().getName()); return Optional.empty(); } }
Source:
protected void init(T parameters) { super.init(parameters); DiskImage representativeImage = getRepresentativeImage(); if (representativeImage == null) { return; } setImage(representativeImage); setStorageDomainId(representativeImage.getStorageIds().get(0)); if (!Guid.isNullOrEmpty(getParameters().getContainerId())) { setVmId(getParameters().getContainerId()); } else { List<VM> listVms = getVmDAO().getVmsListForDisk(representativeImage.getId(), false); if (!listVms.isEmpty()) { VM vm = listVms.get(0); setVm(vm); } } if (isLiveMerge()) { clearTaskHandlers(); } }

Target:
protected void init(T parameters) { super.init(parameters); DiskImage representativeImage = getRepresentativeImage(); if (representativeImage == null) { return; } setImage(representativeImage); setStorageDomainId(representativeImage.getStorageIds().get(0)); if (!Guid.isNullOrEmpty(getParameters().getContainerId())) { setVmId(getParameters().getContainerId()); } else { List<VM> listVms = getVmDAO().getVmsListForDisk(representativeImage.getId(), false); if (!listVms.isEmpty()) { VM vm = listVms.get(0); setVm(vm); } } }
Source:
private static Connection newConnection(Vertx vertx, RabbitMQOptions config) throws IOException, TimeoutException { ConnectionFactory cf = new ConnectionFactory(); String uri = config.getUri(); List<Address> addresses = null; if (uri != null) { try { log.info("Connecting to " + uri); cf.setUri(uri); } catch (Exception e) { throw new IllegalArgumentException("Invalid rabbitmq connection uri " + uri); } } else { cf.setUsername(config.getUser()); cf.setPassword(config.getPassword()); addresses = config.getAddresses().isEmpty() ? Collections.singletonList(new Address(config.getHost(), config.getPort())) : config.getAddresses(); cf.setVirtualHost(config.getVirtualHost()); } cf.setConnectionTimeout(config.getConnectionTimeout()); cf.setRequestedHeartbeat(config.getRequestedHeartbeat()); cf.setHandshakeTimeout(config.getHandshakeTimeout()); cf.setRequestedChannelMax(config.getRequestedChannelMax()); cf.setNetworkRecoveryInterval(config.getNetworkRecoveryInterval()); cf.setAutomaticRecoveryEnabled(config.isAutomaticRecoveryEnabled()); if(config.isSsl()) { SSLHelper sslHelper = new SSLHelper(config, config.getKeyCertOptions(), config.getTrustOptions()); JdkSslContext ctx = (JdkSslContext)sslHelper.getContext((VertxInternal)vertx); cf.useSslProtocol(ctx.context()); } return addresses == null ? cf.newConnection() : cf.newConnection(addresses); }

Target:
private static Connection newConnection(Vertx vertx, RabbitMQOptions config) throws IOException, TimeoutException { ConnectionFactory cf = new ConnectionFactory(); String uri = config.getUri(); List<Address> addresses = null; if (uri != null) { try { log.info("Connecting to " + uri); cf.setUri(uri); } catch (Exception e) { throw new IllegalArgumentException("Invalid rabbitmq connection uri " + uri); } } else { cf.setUsername(config.getUser()); cf.setPassword(config.getPassword()); addresses = config.getAddresses().isEmpty() ? Collections.singletonList(new Address(config.getHost(), config.getPort())) : config.getAddresses(); cf.setVirtualHost(config.getVirtualHost()); } cf.setConnectionTimeout(config.getConnectionTimeout()); cf.setRequestedHeartbeat(config.getRequestedHeartbeat()); cf.setHandshakeTimeout(config.getHandshakeTimeout()); cf.setRequestedChannelMax(config.getRequestedChannelMax()); cf.setNetworkRecoveryInterval(config.getNetworkRecoveryInterval()); cf.setAutomaticRecoveryEnabled(config.isAutomaticRecoveryEnabled()); if(config.isSsl()) { config.setSslEngineOptions(new JdkSSLEngineOptions()); SSLHelper sslHelper = new SSLHelper(config, config.getKeyCertOptions(), config.getTrustOptions()); JdkSslContext ctx = (JdkSslContext)sslHelper.getContext((VertxInternal)vertx); cf.useSslProtocol(ctx.context()); } return addresses == null ? cf.newConnection() : cf.newConnection(addresses); }
Source:
public List<String> search(@NonNull String input, @Nonnull String tableName, @Nonnull String resultColumn, @Nullable String orderByColumn, @Nonnull String... searchColumns) { final List<String> results = new ArrayList<>(); synchronized (mDatabaseLock) { Cursor cursor = null; try { final SQLiteDatabase db = getReadableDatabase(); final String baseQuery = String.format("SELECT DISTINCT %s FROM %s WHERE ", resultColumn, tableName); StringBuilder builder = new StringBuilder(baseQuery); for (int i = 0; i < searchColumns.length; i++) { if (i != 0) { builder.append(" OR "); } builder.append(searchColumns[i]) .append(" like '") .append(input) .append("%' "); } if (orderByColumn != null) { builder.append(" ORDER BY ") .append(orderByColumn); } cursor = db.rawQuery(builder.toString(), null); if (cursor != null && cursor.moveToFirst()) { do { results.add(cursor.getString(0)); } while (cursor.moveToNext()); } } finally { if (cursor != null) { cursor.close(); } } } return results; }

Target:
public Single<List<String>> search(@NonNull String input, @Nonnull String tableName, @Nonnull String resultColumn, @Nullable String orderByColumn, @Nonnull String... searchColumns) { return Single.fromCallable(() -> { final List<String> results = new ArrayList<>(); synchronized (mDatabaseLock) { Cursor cursor = null; try { final SQLiteDatabase db = getReadableDatabase(); final String baseQuery = String.format("SELECT DISTINCT %s FROM %s WHERE ", resultColumn, tableName); StringBuilder builder = new StringBuilder(baseQuery); for (int i = 0; i < searchColumns.length; i++) { if (i != 0) { builder.append(" OR "); } builder.append(searchColumns[i]) .append(" like '") .append(input) .append("%' "); } if (orderByColumn != null) { builder.append(" ORDER BY ") .append(orderByColumn); } cursor = db.rawQuery(builder.toString(), null); if (cursor != null && cursor.moveToFirst()) { do { results.add(cursor.getString(0)); } while (cursor.moveToNext()); } } finally { if (cursor != null) { cursor.close(); } } } return results; } ) .subscribeOn(Schedulers.io()); }
Source:
protected void internalRefresh(Object element) { if (element != null) { getContentProvider().runWhenReady(IN_UI_SYNC, new Runnable() { public void run() { getViewer().refresh(); } }); getContentProvider().runWhenReady(IN_UI_SYNC, new Runnable() { public void run() { updateHighlightRelatedChanges(getSelection()); } }); getContentProvider().runWhenReady(IN_UI_ASYNC, new Runnable() { public void run() { refreshTitle(); } }); } }

Target:
protected void internalRefresh(Object element) { if (element == null) { return; } getContentProvider().runWhenReady(IN_UI_SYNC, new Runnable() { public void run() { getViewer().refresh(); } }); getContentProvider().runWhenReady(IN_UI_SYNC, new Runnable() { public void run() { updateHighlightRelatedChanges(getSelection()); } }); getContentProvider().runWhenReady(IN_UI_ASYNC, new Runnable() { public void run() { refreshTitle(); } }); }
Source:
public UploadSessionPart(File file, BoxUploadSession uploadSession, int partNumber, BoxSession session) throws IOException { super(BoxUploadSessionPart.class, uploadSession.getEndpoints().getUploadPartEndpoint(), session); mRequestUrlString = uploadSession.getEndpoints().getUploadPartEndpoint(); mRequestMethod = Methods.PUT; mPartNumber = partNumber; mUploadSession = uploadSession; mFileSize = file.length(); mCurrentChunkSize = BoxUploadSession.getChunkSize(uploadSession, partNumber, mFileSize); mData = new byte[mCurrentChunkSize]; FileInputStream inputStream = new FileInputStream(file); inputStream.skip(partNumber * uploadSession.getPartSize()); inputStream.read(mData); mContentType = ContentTypes.APPLICATION_OCTET_STREAM; }

Target:
public UploadSessionPart(File file, BoxUploadSession uploadSession, int partNumber, BoxSession session) throws IOException { super(BoxUploadSessionPart.class, uploadSession.getEndpoints().getUploadPartEndpoint(), session); mRequestUrlString = uploadSession.getEndpoints().getUploadPartEndpoint(); mRequestMethod = Methods.PUT; mPartNumber = partNumber; mUploadSession = uploadSession; mFile = file; mCurrentChunkSize = BoxUploadSession.getChunkSize(uploadSession, partNumber, mFile.length()); mContentType = ContentTypes.APPLICATION_OCTET_STREAM; }
Source:
public void request(long n) { if (n >= 0) { int m = mode; if (m == 0) { return; } if (m == 1) { BackpressureUtils.getAndAddRequest(this, n); subscriber.emit(); return; } if (n == Long.MAX_VALUE) { if (MODE.compareAndSet(this, -1, 0)) { subscriber.requestAll(); return; } } else { if (MODE.compareAndSet(this, -1, 1)) { BackpressureUtils.getAndAddRequest(this, n); subscriber.requestDefault(); return; } } m = mode; if (m == 0) { return; } else if (m == 1) { BackpressureUtils.getAndAddRequest(this, n); subscriber.emit(); return; } throw new IllegalStateException("Shouldn't be in mode: " + m); } }

Target:
public void request(long n) { if (n > 0) { if (get() == Long.MAX_VALUE) { return; } BackpressureUtils.getAndAddRequest(this, n); subscriber.emit(); } else if (n < 0) { throw new IllegalArgumentException("n >= 0 required"); } }
Source:
protected String createHttpRequestURL() { String bugUrl = getUrlSuffix(); if (bugUrl.length() > 0 && authenticationRequired) { if (!bugUrl.endsWith("?")) { bugUrl += "&"; } UserCredentials credentials = getClient().getLocation().getCredentials(AuthenticationType.REPOSITORY); if (credentials == null) { throw new IllegalStateException("Authentication requested without valid credentials"); } bugUrl += MessageFormat.format("Bugzilla_login={0}&Bugzilla_password={1}", new Object[] { credentials.getUserName(), credentials.getPassword() }); } return baseUrl() + bugUrl; }

Target:
protected String createHttpRequestURL() { String urlSuffix = getUrlSuffix(); if (urlSuffix.length() > 0 && authenticationRequired) { if (!urlSuffix.endsWith("?")) { urlSuffix += "&"; } UserCredentials credentials = getCredentials(); urlSuffix += MessageFormat.format("Bugzilla_login={0}&Bugzilla_password={1}", new Object[] { credentials.getUserName(), credentials.getPassword() }); } return baseUrl() + urlSuffix; }
Source:
protected ActionForward promptForFinalBillConfirmation(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, String caller) throws Exception { ActionForward forward = null; Object question = request.getParameter(KFSConstants.QUESTION_INST_ATTRIBUTE_NAME); if (question == null || question.toString().toLowerCase().contains("suspension")) { String questionText = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_FINAL_BILL_INDICATOR); return performQuestionWithoutInput(mapping, form, request, response, CUKFSConstants.CINV_FINAL_BILL_INDICATOR_CONFIRMATION_QUESTION, questionText, KFSConstants.CONFIRMATION_QUESTION, caller, StringUtils.EMPTY); } Object buttonClicked = request.getParameter(KFSConstants.QUESTION_CLICKED_BUTTON); if (CUKFSConstants.CINV_FINAL_BILL_INDICATOR_CONFIRMATION_QUESTION.equals(question) && ConfirmationQuestion.NO.equals(buttonClicked)) { forward = mapping.findForward(KFSConstants.MAPPING_BASIC); } return forward; }

Target:
protected ActionForward promptForFinalBillConfirmation(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, String caller) throws Exception { ActionForward forward = null; Object question = request.getParameter(KFSConstants.QUESTION_INST_ATTRIBUTE_NAME); if (question == null) { String questionText = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_FINAL_BILL_INDICATOR); return performQuestionWithoutInput(mapping, form, request, response, CuArConstants.CINV_FINAL_BILL_INDICATOR_CONFIRMATION_QUESTION, questionText, KFSConstants.CONFIRMATION_QUESTION, caller, StringUtils.EMPTY); } Object buttonClicked = request.getParameter(KFSConstants.QUESTION_CLICKED_BUTTON); if (CuArConstants.CINV_FINAL_BILL_INDICATOR_CONFIRMATION_QUESTION.equals(question) && ConfirmationQuestion.NO.equals(buttonClicked)) { forward = mapping.findForward(KFSConstants.MAPPING_BASIC); } return forward; }
Source:
public Path getParent() { if (virtualFile.parent() == null) { return null; } return new BridgePath(virtualFile.parent(), fs); }

Target:
public Path getParent() { if (virtualFile.parent() == null) { return null; } return new BridgePath(virtualFile.parent(), fileSystem); }
Source:
public CallAdapter<?> nextCallAdapter(CallAdapter.Factory skipPast, Type returnType, Annotation[] annotations) { checkNotNull(returnType, "returnType == null"); checkNotNull(annotations, "annotations == null"); for (int i = 0, count = adapterFactories.size(); i < count; i++) { CallAdapter.Factory factory = adapterFactories.get(i); if (factory == skipPast) continue; CallAdapter<?> adapter = factory.get(returnType, annotations, this); if (adapter != null) { return adapter; } } StringBuilder builder = new StringBuilder("Could not locate call adapter for ") .append(returnType) .append(". Tried:"); for (CallAdapter.Factory adapterFactory : adapterFactories) { if (adapterFactory != skipPast) { builder.append("\n * ").append(adapterFactory.getClass().getName()); } } if (skipPast != null) { builder.append("\nSkipped:\n * ").append(skipPast); } throw new IllegalArgumentException(builder.toString()); }

Target:
public CallAdapter<?> nextCallAdapter(CallAdapter.Factory skipPast, Type returnType, Annotation[] annotations) { checkNotNull(returnType, "returnType == null"); checkNotNull(annotations, "annotations == null"); int start = adapterFactories.indexOf(skipPast) + 1; for (int i = start, count = adapterFactories.size(); i < count; i++) { CallAdapter<?> adapter = adapterFactories.get(i).get(returnType, annotations, this); if (adapter != null) { return adapter; } } StringBuilder builder = new StringBuilder("Could not locate call adapter for ") .append(returnType) .append(". Tried:"); for (int i = start, count = adapterFactories.size(); i < count; i++) { builder.append("\n * ").append(adapterFactories.get(i).getClass().getName()); } if (skipPast != null) { builder.append("\nSkipped:"); for (int i = 0; i < start; i++) { builder.append("\n * ").append(adapterFactories.get(i).getClass().getName()); } } throw new IllegalArgumentException(builder.toString()); }
Source:
public void testEmptyArray() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputIndentationEmptyArray.java"), expected); }

Target:
public void testEmptyArray() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class); checkConfig.addAttribute("tabWidth", "4"); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verifyWarns(checkConfig, getPath("InputIndentationEmptyArray.java"), expected); }
Source:
protected void setup(Context context) throws IOException, InterruptedException { namedOutputMeta = context.getConfiguration().get("output.meta"); if (namedOutputMeta == null || namedOutputMeta.isEmpty()) { throw new RuntimeException("no named output provided for metadata"); } namedOutputFault = context.getConfiguration().get("output.fault"); if (namedOutputFault == null || namedOutputFault.isEmpty()) { throw new RuntimeException("no named output provided for fault"); } String excludedIdsCSV = context.getConfiguration().get("excluded.ids"); if (excludedIdsCSV != null && !excludedIdsCSV.trim().isEmpty() && !WorkflowRuntimeParameters.UNDEFINED_NONEMPTY_VALUE.equals(excludedIdsCSV)) { log.info("got excluded ids: " + excludedIdsCSV); excludedIds = new HashSet<String>(Arrays.asList(StringUtils.split(excludedIdsCSV.trim(), ','))); } else { log.info("got no excluded ids"); } String maxFileSizeMBStr = context.getConfiguration().get(ImportWorkflowRuntimeParameters.IMPORT_CONTENT_MAX_FILE_SIZE_MB); if (maxFileSizeMBStr != null && !maxFileSizeMBStr.trim().isEmpty() && !WorkflowRuntimeParameters.UNDEFINED_NONEMPTY_VALUE.equals(maxFileSizeMBStr)) { this.maxFileSizeKB = 1024l * Integer.valueOf(maxFileSizeMBStr); } String processingTimeThresholdSecsStr = context.getConfiguration() .get(LOG_FAULT_PROCESSING_TIME_THRESHOLD_SECS); if (processingTimeThresholdSecsStr != null && !processingTimeThresholdSecsStr.trim().isEmpty() && !WorkflowRuntimeParameters.UNDEFINED_NONEMPTY_VALUE.equals(processingTimeThresholdSecsStr)) { this.processingTimeThreshold = 1000l * Integer.valueOf(processingTimeThresholdSecsStr); } mos = new MultipleOutputs(context); currentProgress = 0; intervalTime = System.currentTimeMillis(); }

Target:
protected void setup(Context context) throws IOException, InterruptedException { namedOutputMeta = context.getConfiguration().get("output.meta"); if (namedOutputMeta == null || namedOutputMeta.isEmpty()) { throw new RuntimeException("no named output provided for metadata"); } namedOutputFault = context.getConfiguration().get("output.fault"); if (namedOutputFault == null || namedOutputFault.isEmpty()) { throw new RuntimeException("no named output provided for fault"); } String excludedIdsCSV = context.getConfiguration().get("excluded.ids"); if (excludedIdsCSV != null && !excludedIdsCSV.trim().isEmpty() && !WorkflowRuntimeParameters.UNDEFINED_NONEMPTY_VALUE.equals(excludedIdsCSV)) { log.info("got excluded ids: " + excludedIdsCSV); excludedIds = new HashSet<String>(Arrays.asList(StringUtils.split(excludedIdsCSV.trim(), ','))); } else { log.info("got no excluded ids"); } Integer processingTimeThresholdSecs = WorkflowRuntimeParameters.getIntegerParamValue( LOG_FAULT_PROCESSING_TIME_THRESHOLD_SECS, context.getConfiguration()); if (processingTimeThresholdSecs != null) { this.processingTimeThreshold = 1000l * processingTimeThresholdSecs; } mos = new MultipleOutputs(context); currentProgress = 0; intervalTime = System.currentTimeMillis(); }
Source:
public void updateOvfData(List<StoragePool> storagePools) { log.info("Attempting to update VMs/Templates Ovf."); for (StoragePool pool : storagePools) { VdcReturnValueBase returnValueBase = performOvfUpdateForStoragePool(pool.getId()); if (!returnValueBase.getSucceeded()) { log.errorFormat("Exception while trying to update or remove VMs/Templates ovf in Data Center {0}.", pool.getName()); } if (ovfOnAnyDomainSupported(pool)) { log.infoFormat("Attempting to update ovfs in domain in Data Center {0}", pool.getName()); Set<Guid> domainsToUpdate = (Set<Guid>) returnValueBase.getActionReturnValue(); if (domainsToUpdate != null) { for (Guid id : domainsToUpdate) { performOvfUpdateForDomain(pool.getId(), id); } } } } }

Target:
public void updateOvfData(List<StoragePool> storagePools) { log.info("Attempting to update VMs/Templates Ovf."); for (StoragePool pool : storagePools) { VdcReturnValueBase returnValueBase = performOvfUpdateForStoragePool(pool.getId()); if (!returnValueBase.getSucceeded()) { log.error("Exception while trying to update or remove VMs/Templates ovf in Data Center {0}.", pool.getName()); } if (ovfOnAnyDomainSupported(pool)) { log.info("Attempting to update ovfs in domain in Data Center {0}", pool.getName()); Set<Guid> domainsToUpdate = (Set<Guid>) returnValueBase.getActionReturnValue(); if (domainsToUpdate != null) { for (Guid id : domainsToUpdate) { performOvfUpdateForDomain(pool.getId(), id); } } else { log.error("Data Center {0} domains list for OVF update returned as NULL"); } } } }
Source:
@Nullable public static <T> T getCallback(@NonNull Fragment fragment, @NonNull Class<T> callback) { if (callback.isInstance(fragment.getTargetFragment())) { return (T) fragment.getTargetFragment(); } if (callback.isInstance(fragment.getFragmentManager().getFragments().get(0))) { return (T) fragment.getFragmentManager().getFragments().get(0); } if (callback.isInstance(fragment.getActivity())) { return (T) fragment.getActivity(); } return null; }

Target:
@Nullable public static <T> T getCallback(@NonNull Fragment fragment, @NonNull Class<T> callback) { if (callback.isInstance(fragment.getTargetFragment())) { return (T) fragment.getTargetFragment(); } if (callback.isInstance(fragment.getParentFragment())) { return (T) fragment.getParentFragment(); } if (callback.isInstance(fragment.getActivity())) { return (T) fragment.getActivity(); } return null; }
Source:
public void shouldNotNotFailOnNotFoundUsernameTEST() throws Exception { initializeInMemoryDatabase(); executeDataSet(TEST_DATA); authenticate(); ForgotPasswordFormController controller = new ForgotPasswordFormController(); MockHttpServletRequest request = new MockHttpServletRequest(); request.setParameter("uname", "bruno"); request.setParameter("secretAnswer", "valid secret answer"); request.setMethod("POST"); HttpServletResponse response = new MockHttpServletResponse(); controller.handleRequest(request, response); Assert.assertEquals("what is your name bruno?", request.getAttribute("secretQuestion")); }

Target:
public void shouldNotNotFailOnNotFoundUsernameTEST() throws Exception { executeDataSet(TEST_DATA); ForgotPasswordFormController controller = (ForgotPasswordFormController) applicationContext.getBean("forgotPasswordForm"); MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); request.setParameter("uname", "bruno"); request.setParameter("secretAnswer", "valid secret answer"); request.setMethod("POST"); controller.handleRequest(request, response); Assert.assertEquals("what is your name bruno?", request.getParameter("secretQuestion")); }
Source:
protected boolean shouldIgnoreClass(Type type) { if (type instanceof Class) { Class<?> cls = (Class<?>) type; if (cls.getName().equals("javax.ws.rs.ApiResponse")) { return true; } } else { if (type instanceof com.fasterxml.jackson.core.type.ResolvedType) { com.fasterxml.jackson.core.type.ResolvedType rt = (com.fasterxml.jackson.core.type.ResolvedType) type; LOGGER.debug("Can't check class {}, {}", type, rt.getRawClass().getName()); if (rt.getRawClass().equals(Class.class)) { return true; } } } return false; }

Target:
protected boolean shouldIgnoreClass(Type type) { if (type instanceof Class) { Class<?> cls = (Class<?>) type; if (cls.getName().equals("javax.ws.rs.Response")) { return true; } } else { if (type instanceof com.fasterxml.jackson.core.type.ResolvedType) { com.fasterxml.jackson.core.type.ResolvedType rt = (com.fasterxml.jackson.core.type.ResolvedType) type; LOGGER.debug("Can't check class {}, {}", type, rt.getRawClass().getName()); if (rt.getRawClass().equals(Class.class)) { return true; } } } return false; }
Source:
private List<String> validate(JsonSchema jsonSchema, byte[] message) { List<String> errors = new ArrayList<>(); try { JsonNode messageNode = objectMapper.readTree(message); ProcessingReport report = jsonSchema.validateUnchecked(messageNode); for (Iterator<ProcessingMessage> iterator = report.iterator(); iterator.hasNext();) { errors.add(iterator.next().getMessage()); } } catch (IOException e) { LOGGER.warn("Error while deserializing message: " + new String(message), e); errors.add("Problem with message deserialization. Is this correct JSON format?"); } return errors; }

Target:
private List<String> validate(JsonSchema jsonSchema, byte[] message) { List<String> errors = new ArrayList<>(); try { JsonNode messageNode = objectMapper.readTree(message); ProcessingReport report = jsonSchema.validateUnchecked(messageNode); report.forEach(processingMessage -> errors.add(processingMessage.getMessage())); } catch (IOException e) { LOGGER.warn("Error while deserializing message: " + new String(message), e); errors.add("Problem with message deserialization. Is this correct JSON format?"); } return errors; }
Source:
private void advanceLocation() { ParticleEffect.FIREWORKS_SPARK.display(this.location, 8, Math.random() / 2, Math.random() / 2, Math.random() / 2, 0); playCombustionSound(this.location); this.location = this.location.add(this.direction.clone().multiply(this.speedFactor)); }

Target:
private void advanceLocation() { ParticleEffect.FIREWORKS_SPARK.display(this.location, 2, .001, .001, .001, 0); ParticleEffect.CRIT.display(this.location, 3, Math.random() * 2, Math.random() * 2, Math.random() * 2, 0); playCombustionSound(this.location); this.location = this.location.add(this.direction.clone().multiply(this.speedFactor)); }
Source:
protected void run() { for (;;) { try { processPendingChannelFlags(); int strategy = selectStrategy.calculateStrategy(selectNowSupplier, hasTasks()); switch (strategy) { case SelectStrategy.CONTINUE: continue; case SelectStrategy.BUSY_WAIT: strategy = epollBusyWait(); break; case SelectStrategy.SELECT: if (pendingWakeup) { strategy = epollWaitTimeboxed(); if (strategy != 0) { break; } pendingWakeup = false; if (hasTasks()) { break; } } wakenUp.lazySet(0); try { if (!hasTasks()) { strategy = epollWait(); } } finally { if (wakenUp.get() == 1 || wakenUp.getAndSet(1) == 1) { pendingWakeup = true; } } default: } final int ioRatio = this.ioRatio; if (ioRatio == 100) { try { if (strategy > 0) { processReady(events, strategy); } } finally { runAllTasks(); } } else { final long ioStartTime = System.nanoTime(); try { if (strategy > 0) { processReady(events, strategy); } } finally { final long ioTime = System.nanoTime() - ioStartTime; runAllTasks(ioTime * (100 - ioRatio) / ioRatio); } } if (allowGrowing && strategy == events.length()) { events.increase(); } } catch (Throwable t) { handleLoopException(t); } try { if (isShuttingDown()) { closeAll(); if (confirmShutdown()) { break; } } } catch (Throwable t) { handleLoopException(t); } } }

Target:
protected void run() { for (;;) { try { processPendingChannelFlags(); int strategy = selectStrategy.calculateStrategy(selectNowSupplier, hasTasks()); switch (strategy) { case SelectStrategy.CONTINUE: continue; case SelectStrategy.BUSY_WAIT: strategy = epollBusyWait(); break; case SelectStrategy.SELECT: if (pendingWakeup) { strategy = epollWaitTimeboxed(); if (strategy != 0) { break; } logger.warn("Missed eventfd write (not seen after > 1 second)"); pendingWakeup = false; if (hasTasks()) { break; } } wakenUp.set(0); try { if (!hasTasks()) { strategy = epollWait(); } } finally { if (wakenUp.get() == 1 || wakenUp.getAndSet(1) == 1) { pendingWakeup = true; } } default: } final int ioRatio = this.ioRatio; if (ioRatio == 100) { try { if (strategy > 0) { processReady(events, strategy); } } finally { runAllTasks(); } } else { final long ioStartTime = System.nanoTime(); try { if (strategy > 0) { processReady(events, strategy); } } finally { final long ioTime = System.nanoTime() - ioStartTime; runAllTasks(ioTime * (100 - ioRatio) / ioRatio); } } if (allowGrowing && strategy == events.length()) { events.increase(); } } catch (Throwable t) { handleLoopException(t); } try { if (isShuttingDown()) { closeAll(); if (confirmShutdown()) { break; } } } catch (Throwable t) { handleLoopException(t); } } }
Source:
public Collection<ReflogEntry> call() throws GitAPIException, Exception { checkCallable(); try { ReflogReader reader = new ReflogReader(repo, ref); return reader.getReverseEntries(); } catch (IOException e) { throw new InvalidRefNameException(MessageFormat.format( JGitText.get().cannotRead, ref), e); } }

Target:
public Collection<ReflogEntry> call() throws GitAPIException { checkCallable(); try { ReflogReader reader = new ReflogReader(repo, ref); return reader.getReverseEntries(); } catch (IOException e) { throw new InvalidRefNameException(MessageFormat.format( JGitText.get().cannotRead, ref), e); } }
Source:
private void invoke(LockListener invoker) { LockState state = lockState; switch (state) { case WAITING: throw new IllegalStateException("WAITING is not a valid state to invoke the listener"); case ACQUIRED: case RELEASED: invoker.onEvent(LockState.AVAILABLE); break; default: invoker.onEvent(state); break; } }

Target:
private void invoke(LockListener invoker) { LockState state = lockState; switch (state) { case WAITING: throw new IllegalStateException("WAITING is not a valid state to invoke the listener"); case ACQUIRED: case RELEASED: invoker.onEvent(LockState.ACQUIRED); break; default: invoker.onEvent(state); break; } }
Source:
private void initiateMastershipMigration(long nextSeqNo, AckingContainer ackingContainer) { Preconditions.checkNotNull(ackingContainer, "Acking container must be not null."); Pair<Long, Long> gap = m_gapTracker.getFirstGap(); assert (gap != null && nextSeqNo >= gap.getFirst() && nextSeqNo <= gap.getSecond()); setPendingContainer(ackingContainer); if (m_seqNoToDrain > nextSeqNo - 1) { exportLog.info("Export data missing from current queue [" + gap.getFirst() + ", " + gap.getSecond() + "] from " + this.toString() + ". Searching other sites for missing data."); m_seqNoToDrain = nextSeqNo - 1; mastershipCheckpoint(nextSeqNo - 1); } }

Target:
private void initiateMastershipMigration(long nextSeqNo, AckingContainer ackingContainer) { Preconditions.checkNotNull(ackingContainer, "Acking container must be not null."); Pair<Long, Long> gap = m_gapTracker.getFirstGap(); assert (gap != null && nextSeqNo >= gap.getFirst() && nextSeqNo <= gap.getSecond()); setPendingContainer(ackingContainer); exportLog.info("Export data missing from current queue [" + gap.getFirst() + ", " + gap.getSecond() + "] from " + this.toString() + ". Searching other sites for missing data."); migrateMastershipTo(null); }
Source:
public String toString() { StringJoiner joiner = new StringJoiner(", ", "SmartPay authorisation response (", ")"); if (StringUtils.isNotBlank(getTransactionId())) { joiner.add("pspReference: " + getTransactionId()); } if (StringUtils.isNotBlank(result)) { joiner.add("resultCode: " + result); } if (StringUtils.isNotBlank(getErrorCode())) { joiner.add("faultcode: " + getErrorCode()); } if (StringUtils.isNotBlank(getErrorMessage())) { joiner.add("faultstring: " + getErrorMessage()); } return joiner.toString(); }

Target:
public String toString() { StringJoiner joiner = new StringJoiner(", ", "SmartPay 3DS authorisation response (", ")"); if (StringUtils.isNotBlank(getTransactionId())) { joiner.add("pspReference: " + getTransactionId()); } if (StringUtils.isNotBlank(result)) { joiner.add("resultCode: " + result); } if (StringUtils.isNotBlank(getErrorCode())) { joiner.add("faultcode: " + getErrorCode()); } if (StringUtils.isNotBlank(getErrorMessage())) { joiner.add("faultstring: " + getErrorMessage()); } return joiner.toString(); }
Source:
public static void fineTunePrivileges(Path path) throws IOException { if (!OS_WINDOWS) Files.setPosixFilePermissions(path,getPermissionsMasks(NO_PATH_PRODIVED,path)); }

Target:
public static void fineTunePrivileges(Path path) throws IOException { if (!OS_WINDOWS) Files.setPosixFilePermissions(path, getPermissionsMasks(path)); }
Source:
public Map<String, String> getCache() { CacheState cacheState = getCacheState(); if (cacheState instanceof VersionedCache) { return ((VersionedCache) cacheState).getCache(); } else { throw new IllegalStateException("Cannot get cache: " + cacheState); } }

Target:
public Map<String, String> getCache() { CacheState cacheState = getCacheState(); if (cacheState instanceof VersionedCache) { return ((VersionedCache) cacheState).getCache(); } else { throw new ISE("Cannot get cache: %s", cacheState); } }
Source:
public void tearDown() throws IOException { dummyJarFile.delete(); miniCluster.getFileSystem().delete(finalClasspath, true); miniCluster.getFileSystem().delete(intermediatePath, true); }

Target:
public void tearDown() throws IOException { dummyJarFile.delete(); Assert.assertFalse(dummyJarFile.exists()); miniCluster.getFileSystem().delete(finalClasspath, true); Assert.assertFalse(miniCluster.getFileSystem().exists(finalClasspath)); miniCluster.getFileSystem().delete(intermediatePath, true); Assert.assertFalse(miniCluster.getFileSystem().exists(intermediatePath)); }
Source:
private void addSubscriptions(String resourcePath, List<Subscription> subscriptions, Queue<String> pathsQueue, boolean withChildren) throws EventBrokerException { try { UserRegistry userRegistry = this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId()); String subscriptionsPath = getSubscriptionsPath(resourcePath); if (userRegistry.resourceExists(subscriptionsPath)) { Collection collection = (Collection) userRegistry.get(subscriptionsPath); for (String subscriptionPath : collection.getChildren()) { Resource subscriptionResource = userRegistry.get(subscriptionPath); Subscription subscription = JavaUtil.getSubscription(subscriptionResource); subscription.setTopicName(removeResourcePath(resourcePath)); if (subscriptionPath.endsWith("/")) { subscriptionPath = subscriptionsPath.substring(0, subscriptionPath.lastIndexOf("/")); } subscription.setId(subscriptionPath.substring(subscriptionPath.lastIndexOf("/") + 1)); subscriptions.add(subscription); } } if (withChildren) { Collection childResources = (Collection) userRegistry.get(resourcePath); for (String childResourcePath : childResources.getChildren()) { if ((!childResourcePath.contains(EventBrokerConstants.EB_CONF_WS_SUBSCRIPTION_COLLECTION_NAME)) && (!childResourcePath.contains(EventBrokerConstants.EB_CONF_JMS_SUBSCRIPTION_COLLECTION_NAME))) { pathsQueue.add(childResourcePath); } } } } catch (RegistryException e) { throw new EventBrokerException("Cannot access the registry", e); } }

Target:
private void addSubscriptions(String resourcePath, List<Subscription> subscriptions, Queue<String> pathsQueue, boolean withChildren) throws EventBrokerException { try { UserRegistry userRegistry = this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId()); String subscriptionsPath = getSubscriptionsPath(resourcePath); if (userRegistry.resourceExists(subscriptionsPath)) { Collection collection = (Collection) userRegistry.get(subscriptionsPath); for (String subscriptionPath : collection.getChildren()) { Resource subscriptionResource = userRegistry.get(subscriptionPath); Subscription subscription = JavaUtil.getSubscription(subscriptionResource); subscription.setTopicName(removeResourcePath(resourcePath)); if (subscriptionPath.endsWith("/")) { subscriptionPath = subscriptionsPath.substring(0, subscriptionPath.lastIndexOf("/")); } subscription.setId(subscriptionPath.substring(subscriptionPath.lastIndexOf("/") + 1)); subscriptions.add(subscription); } } if (withChildren) { Collection childResources = (Collection) userRegistry.get(resourcePath); for (String childResourcePath : childResources.getChildren()) { if ((!EventBrokerConstants.EB_CONF_WS_SUBSCRIPTION_COLLECTION_NAME .contains(childResourcePath)) && (!EventBrokerConstants.EB_CONF_JMS_SUBSCRIPTION_COLLECTION_NAME .contains(childResourcePath))) { pathsQueue.add(childResourcePath); } } } } catch (RegistryException e) { throw new EventBrokerException("Cannot access the registry", e); } }
Source:
public Option<T> map(ResultSet r, int columnNumber, StatementContext ctx) throws SQLException { final ColumnMapper<?> mapper = ctx.findColumnMapperFor( GenericTypes.findGenericParameter(type, Option.class) .orElseThrow(() -> new NoSuchMapperException("No mapper for raw Option type"))) .orElseThrow(() -> new NoSuchMapperException("No mapper for type " + type + " nested in Option")); return (Option<T>) Option.of(mapper.map(r, columnNumber, ctx)); }

Target:
public Option<T> map(ResultSet r, int columnNumber, StatementContext ctx) throws SQLException { final ColumnMapper<?> mapper = ctx.findColumnMapperFor(nestedType) .orElseThrow(() -> new NoSuchMapperException("No mapper for type " + nestedType + " nested in Option")); return (Option<T>) Option.of(mapper.map(r, columnNumber, ctx)); }
Source:
public Client findClient(final WebContext context) { final String name = context.getRequestParameter(this.clientNameParameter); if (name == null && defaultClient != null) { return defaultClient; } CommonHelper.assertNotBlank("name", name); return findClient(name); }

Target:
public Client findClient(final WebContext context) { final String name = context.getRequestParameter(this.clientNameParameter); CommonHelper.assertNotBlank("name", name); return findClient(name); }
Source:
protected Response unwrapException(HttpRequest request, Throwable e) { Response jaxrsResponse = null; Throwable unwrappedException = e.getCause(); if (unwrappedException instanceof WebApplicationException) { WebApplicationException wae = (WebApplicationException) unwrappedException; Response response = wae.getResponse(); if (response != null) { try { if (response.getEntity() != null) return response; } catch(IllegalStateException ise) { } } } if ((jaxrsResponse = executeExceptionMapper(unwrappedException)) != null) { return jaxrsResponse; } if (unwrappedException instanceof WebApplicationException) { return handleWebApplicationException((WebApplicationException) unwrappedException); } else if (unwrappedException instanceof Failure) { return handleFailure(request, (Failure) unwrappedException); } else { if (unwrappedExceptions.contains(unwrappedException.getClass().getName()) && unwrappedException.getCause() != null) { return unwrapException(request, unwrappedException); } else { return null; } } }

Target:
protected Response unwrapException(HttpRequest request, Throwable e) { Response jaxrsResponse = null; Throwable unwrappedException = e.getCause(); if (unwrappedException instanceof WebApplicationException) { WebApplicationException wae = (WebApplicationException) unwrappedException; Response response = wae.getResponse(); if (response != null) { try { if (response.getEntity() != null) return response; } catch(IllegalStateException ise) { return response; } } } if ((jaxrsResponse = executeExceptionMapper(unwrappedException)) != null) { return jaxrsResponse; } if (unwrappedException instanceof WebApplicationException) { return handleWebApplicationException((WebApplicationException) unwrappedException); } else if (unwrappedException instanceof Failure) { return handleFailure(request, (Failure) unwrappedException); } else { if (unwrappedExceptions.contains(unwrappedException.getClass().getName()) && unwrappedException.getCause() != null) { return unwrapException(request, unwrappedException); } else { return null; } } }
Source:
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if(tab == EsteemedInnovation.tab) { for (Types component : Types.values()) { items.add(new ItemStack(MiscellaneousModule.COMPONENT, 1, component.getMetadata())); } } }

Target:
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if (isInCreativeTab(tab)) { for (Types component : Types.values()) { items.add(new ItemStack(MiscellaneousModule.COMPONENT, 1, component.getMetadata())); } } }
Source:
protected String getPartName(String key, int partNumber, int totalParts) { int base = (int)Math.log10(totalParts) + 1; String format = String.format("%%s%%s%%0%dd", base); return String.format(format, key, PART_SEPARATOR, partNumber); }

Target:
protected String getPartName(String key, int partNumber, int totalParts) { int base = (int) Math.log10(totalParts) + 1; return String.format("%s%s%0" + base + "d", key, PART_SEPARATOR, partNumber); }
Source:
protected void setPluginConfigurationAttributes(Map attributes) { SCMConfigurations scmConfigurations = SCMMetadataStore.getInstance().getConfigurationMetadata(pluginConfiguration.getId()); for (SCMConfiguration scmConfiguration : scmConfigurations.list()) { String key = scmConfiguration.getKey(); if (attributes.containsKey(key)) { if (configuration.getProperty(key) == null) { configuration.addNewConfiguration(scmConfiguration.getKey(), scmConfiguration.getOption(Property.SECURE)); } configuration.getProperty(key).setConfigurationValue(new ConfigurationValue((String) attributes.get(key))); configuration.getProperty(key).handleSecureValueConfiguration(scmConfiguration.getOption(Property.SECURE)); } } }

Target:
protected void setPluginConfigurationAttributes(Map attributes) { SCMConfigurations scmConfigurations = SCMMetadataStore.getInstance().getConfigurationMetadata(pluginConfiguration.getId()); if (scmConfigurations == null) { throw new RuntimeException("metadata unavailable for plugin: " + pluginConfiguration.getId()); } for (SCMConfiguration scmConfiguration : scmConfigurations.list()) { String key = scmConfiguration.getKey(); if (attributes.containsKey(key)) { if (configuration.getProperty(key) == null) { configuration.addNewConfiguration(scmConfiguration.getKey(), scmConfiguration.getOption(Property.SECURE)); } configuration.getProperty(key).setConfigurationValue(new ConfigurationValue((String) attributes.get(key))); configuration.getProperty(key).handleSecureValueConfiguration(scmConfiguration.getOption(Property.SECURE)); } } }
Source:
public void handleDataChange(String dataPath, Object data) { if (logger.isDebugEnabled()) { logger.debug("Data change callback: paths changed: " + dataPath); } try { updateNotificationTime(System.nanoTime()); if (dataPath != null && dataPath.startsWith(_path)) { NotificationContext changeContext = new NotificationContext(_manager); changeContext.setType(NotificationContext.Type.CALLBACK); changeContext.setPathChanged(dataPath); changeContext.setChangeType(_changeType); enqueueTask(changeContext); } } catch (Exception e) { String msg = "exception in handling data-change. path: " + dataPath + ", listener: " + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }

Target:
public void handleDataChange(String dataPath, Object data) { if (logger.isDebugEnabled()) { logger.debug("Data change callback: paths changed: {}", dataPath); } try { updateNotificationTime(System.nanoTime()); if (dataPath != null && dataPath.startsWith(_path)) { NotificationContext changeContext = new NotificationContext(_manager); changeContext.setType(NotificationContext.Type.CALLBACK); changeContext.setPathChanged(dataPath); changeContext.setChangeType(_changeType); enqueueTask(changeContext); } } catch (Exception e) { String msg = "exception in handling data-change. path: " + dataPath + ", listener: " + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }
Source:
public void testReopenSession() throws Exception { final ProjectDiagram projectDiagram = mock(ProjectDiagram.class); tested.reopenSession(projectDiagram); verify(sessionEditorPresenter, times(1)).destroy(); verify(sessionEditorPresenter, times(1)).open(eq(projectDiagram), any(SessionPresenter.SessionPresenterCallback.class)); }

Target:
public void testReopenSession() { final ProjectDiagram projectDiagram = mock(ProjectDiagram.class); tested.reopenSession(projectDiagram); verify(sessionEditorPresenter, times(1)).destroy(); verify(sessionEditorPresenter, times(1)).open(eq(projectDiagram), any(SessionPresenter.SessionPresenterCallback.class)); }
Source:
public Scan addFamily(byte[] family) { throw new IllegalStateException("ImmutableScan does not allow access to addFamily"); }

Target:
public Scan addFamily(byte[] family) { throw new UnsupportedOperationException("ImmutableScan does not allow access to addFamily"); }
Source:
private boolean isEnabled(Object element) { if (element instanceof ICommand) { ICommand command = (ICommand) element; String val = command.getArguments().get(COMMAND_ENABLED); if(val != null) { boolean enabled = Boolean.parseBoolean(val); return enabled; } } else if (element instanceof ILaunchConfiguration) { try { return ExternalToolsUtil.isBuilderEnabled((ILaunchConfiguration) element); } catch (CoreException e) { } } else if (element instanceof ErrorConfig) { return false; } return true; }

Target:
private boolean isEnabled(Object element) { if (element instanceof ICommand) { ICommand command = (ICommand) element; String val = command.getArguments().get(COMMAND_ENABLED); if(val != null) { return Boolean.parseBoolean(val); } } else if (element instanceof ILaunchConfiguration) { try { return ExternalToolsUtil.isBuilderEnabled((ILaunchConfiguration) element); } catch (CoreException e) { } } else if (element instanceof ErrorConfig) { return false; } return true; }
Source:
public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { boolean inExposedModelControllerDomains = isInExposedModelControllerDomains(name); if (inExposedModelControllerDomains) { throw new RuntimeOperationsException(JmxLogger.ROOT_LOGGER.addNotificationListenerNotAllowed(name)); } mbs.addNotificationListener(name, listener, new BlockingNotificationFilter(filter), handback); }

Target:
public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException { boolean inExposedModelControllerDomains = isInExposedModelControllerDomains(name); if (inExposedModelControllerDomains) { throw new RuntimeOperationsException(JmxLogger.ROOT_LOGGER.addNotificationListenerNotAllowed(name)); } BlockingNotificationFilter blockingFilter = new BlockingNotificationFilter(filter); associations.put(new Association(name, listener, filter, handback), blockingFilter); mbs.addNotificationListener(name, listener, new BlockingNotificationFilter(filter), handback); }