auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void run(IAction action) { Job job = new Job(CodanUIMessages.Job_TitleRunningAnalysis) { @SuppressWarnings("unchecked") @Override protected IStatus run(final IProgressMonitor monitor) { if (sel instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) sel; int count = ss.size(); monitor.beginTask(getName(), count * 100); if (monitor.isCanceled()) return Status.CANCEL_STATUS; for (Iterator iterator = ss.iterator(); iterator.hasNext();) { Object o = iterator.next(); if (o instanceof IAdaptable) { o = ((IAdaptable) o).getAdapter(IResource.class); } if (o instanceof IResource) { IResource res = (IResource) o; SubProgressMonitor subMon = new SubProgressMonitor(monitor, 100); CodanRuntime.getInstance().getBuilder().processResource(res, subMon, CheckerLaunchMode.RUN_ON_DEMAND); if (subMon.isCanceled()) return Status.CANCEL_STATUS; } if (monitor.isCanceled()) return Status.CANCEL_STATUS; } } return Status.OK_STATUS; } }; job.setUser(true); job.schedule(); }

Target:
public void run(IAction action) { if (sel instanceof IStructuredSelection) { final IStructuredSelection ss = (IStructuredSelection) sel; Job job = new Job(CodanUIMessages.Job_TitleRunningAnalysis) { @Override protected IStatus run(final IProgressMonitor monitor) { int count = ss.size(); monitor.beginTask(getName(), count * 100); if (monitor.isCanceled()) return Status.CANCEL_STATUS; for (Iterator iterator = ss.iterator(); iterator.hasNext();) { Object o = iterator.next(); if (o instanceof IAdaptable) { o = ((IAdaptable) o).getAdapter(IResource.class); } if (o instanceof IResource) { IResource res = (IResource) o; SubProgressMonitor subMon = new SubProgressMonitor(monitor, 100); CodanRuntime.getInstance().getBuilder().processResource(res, subMon, CheckerLaunchMode.RUN_ON_DEMAND); if (subMon.isCanceled()) return Status.CANCEL_STATUS; } if (monitor.isCanceled()) return Status.CANCEL_STATUS; } return Status.OK_STATUS; } }; job.setUser(true); job.schedule(); } }
Source:
public void validate() { if (!file.exists() && overwriteFile == true) { throw new IllegalStateException("The file can not be overwritten because the file does not exist"); } }

Target:
public void validate() { if (file.exists() && !overwriteFileIfExists) { throw new IllegalStateException("The file already exists. Please configure the job to overwrite the existing file."); } }
Source:
public void resolveReference(String field) { if ((flags & ALL_RESOLVED_FLAG) != 0) { return; } synchronized (this) { try { if ((flags & ALL_RESOLVED_FLAG) != 0) { return; } if (linkedObjects.isEmpty()) { return; } boolean hasPotentialRefs = false; Collection<Object> rawValuesValues = rawValues.values(); for (Object rawValue : rawValuesValues) { if (rawValue instanceof Map && ((Map<?, ?>) rawValue).containsKey(StateSerializer.REFERENCE_KEY)) { hasPotentialRefs = true; break; } } if (!hasPotentialRefs) { return; } Profiler.Static.startThreadEvent(RESOLVE_REFERENCE_PROFILER_EVENT, this); try { Object object = linkedObjects.values().iterator().next(); Map<UUID, Object> references = StateValueUtils.resolveReferences(getDatabase(), object, rawValuesValues, field); Map<String, Object> resolved = new HashMap<>(); resolveMetricReferences(resolved); for (Map.Entry<? extends String, ?> e : rawValues.entrySet()) { UUID id = StateValueUtils.toIdIfReference(e.getValue()); if (id != null) { resolved.put(e.getKey(), references.get(id)); } } for (Map.Entry<String, Object> e : resolved.entrySet()) { put(e.getKey(), e.getValue()); } } finally { Profiler.Static.stopThreadEvent(); } } finally { flags |= ALL_RESOLVED_FLAG; } } }

Target:
public void resolveReference(String field) { if ((flags & ALL_RESOLVED_FLAG) != 0) { return; } synchronized (this) { if ((flags & ALL_RESOLVED_FLAG) != 0) { return; } if (linkedObjects.isEmpty()) { flags |= ALL_RESOLVED_FLAG; return; } boolean hasPotentialRefs = false; Collection<Object> rawValuesValues = rawValues.values(); for (Object rawValue : rawValuesValues) { if (rawValue instanceof Map && ((Map<?, ?>) rawValue).containsKey(StateSerializer.REFERENCE_KEY)) { hasPotentialRefs = true; break; } } if (!hasPotentialRefs) { flags |= ALL_RESOLVED_FLAG; return; } Profiler.Static.startThreadEvent(RESOLVE_REFERENCE_PROFILER_EVENT, this); try { Object object = linkedObjects.values().iterator().next(); Map<UUID, Object> references = StateValueUtils.resolveReferences(getDatabase(), object, rawValuesValues, field); Map<String, Object> resolved = new HashMap<>(); resolveMetricReferences(resolved); for (Map.Entry<? extends String, ?> e : rawValues.entrySet()) { UUID id = StateValueUtils.toIdIfReference(e.getValue()); if (id != null) { resolved.put(e.getKey(), references.get(id)); } } for (Map.Entry<String, Object> e : resolved.entrySet()) { put(e.getKey(), e.getValue()); } flags |= ALL_RESOLVED_FLAG; } finally { Profiler.Static.stopThreadEvent(); } } }
Source:
public Set<Attribute<T, ?>> describe() { return Collections.singleton( new MultivaluedAttribute<T, String>("grantedPermissions", String.class) .getter(MatrixAuthorizationStrategyConfigurator::getGrantedPermissions) .setter(MatrixAuthorizationStrategyConfigurator::setGrantedPermissions) ); }

Target:
public Set<Attribute<T, ?>> describe() { return new HashSet<>(Arrays.asList( new MultivaluedAttribute<T, String>("permissions", String.class) .getter(MatrixAuthorizationStrategyConfigurator::getPermissions) .setter(MatrixAuthorizationStrategyConfigurator::setPermissions), new MultivaluedAttribute<T, String>("grantedPermissions", String.class) .getter(unused -> null) .setter(MatrixAuthorizationStrategyConfigurator::setPermissionsDeprecated) )); }
Source:
public PlanNode visitLateralJoin(LateralJoinNode lateral, RewriteContext<PlanNode> context) { LateralJoinNode rewrittenLateral = (LateralJoinNode) context.defaultRewrite(lateral, context.get()); if (!rewrittenLateral.getCorrelation().isEmpty()) { Optional<ValuesNode> values = searchFrom(lateral.getSubquery()) .skipOnlyWhen(ProjectNode.class::isInstance) .where(ValuesNode.class::isInstance) .findSingle(); if (values.isPresent() && isSingleRowValuesWithNoColumns(values.get())) { List<ProjectNode> subqueryProjections = searchFrom(lateral.getSubquery()) .where(ProjectNode.class::isInstance) .findAll(); if (subqueryProjections.size() == 0) { return rewrittenLateral.getInput(); } else if (subqueryProjections.size() == 1) { Assignments assignments = Assignments.builder() .putIdentities(rewrittenLateral.getInput().getOutputSymbols()) .putAll(subqueryProjections.get(0).getAssignments()) .build(); return projectNode(rewrittenLateral.getInput(), assignments); } } } return rewrittenLateral; }

Target:
public PlanNode visitLateralJoin(LateralJoinNode lateral, RewriteContext<PlanNode> context) { LateralJoinNode rewrittenLateral = (LateralJoinNode) context.defaultRewrite(lateral, context.get()); if (rewrittenLateral.getCorrelation().isEmpty()) { return rewrittenLateral; } Optional<ValuesNode> values = searchFrom(lateral.getSubquery()) .skipOnlyWhen(ProjectNode.class::isInstance) .where(ValuesNode.class::isInstance) .findSingle(); if (!values.isPresent() || !isSingleRowValuesWithNoColumns(values.get())) { return rewrittenLateral; } List<ProjectNode> subqueryProjections = searchFrom(lateral.getSubquery()) .where(ProjectNode.class::isInstance) .findAll(); if (subqueryProjections.size() == 0) { return rewrittenLateral.getInput(); } else if (subqueryProjections.size() == 1) { Assignments assignments = Assignments.builder() .putIdentities(rewrittenLateral.getInput().getOutputSymbols()) .putAll(subqueryProjections.get(0).getAssignments()) .build(); return projectNode(rewrittenLateral.getInput(), assignments); } return rewrittenLateral; }
Source:
public static @Nullable Long getThreadPrio(KernelAnalysis module, Integer threadId, long ts) { Long execPrio = null; ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return execPrio; } Integer execPrioQuark; try { execPrioQuark = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.PRIO); ITmfStateInterval interval = ss.querySingleState(ts, execPrioQuark); ITmfStateValue prioValue = interval.getStateValue(); switch (prioValue.getType()) { case LONG: execPrio = prioValue.unboxLong(); break; case STRING: case DOUBLE: case NULL: case INTEGER: default: break; } } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return execPrio; }

Target:
public static @Nullable Integer getThreadPrio(KernelAnalysis module, Integer threadId, long ts) { Integer execPrio = null; ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return execPrio; } try { Integer execPrioQuark = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.PRIO); ITmfStateInterval interval = ss.querySingleState(ts, execPrioQuark); ITmfStateValue prioValue = interval.getStateValue(); execPrio = prioValue.unboxInt(); } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return execPrio; }
Source:
protected void reflectedUpdateFile(Path outputPath, byte[] data) throws InvocationTargetException, IllegalAccessException { if (cachedUpdateFileMethod == null) { getCachedUpdateFileMethod(); } Class parameters = cachedUpdateFileMethod.getParameterTypes(); if (parameters.length == 2 && parameters[0].equals(Path.class) && parameters[1].isArray()) { cachedUpdateFileMethod.invoke(outputPath, data); } else if (parameters.length == 3 && parameters[0].equals(Path.class) && parameters[1].isArray() && parameters[2].isPrimitive()) { cachedUpdateFileMethod.invoke(outputPath, data, true); } else { throw new RuntimeException("updateFile Method has unexpected parameters"); } }

Target:
protected void reflectedUpdateFile(Path outputPath, byte[] data) throws InvocationTargetException, IllegalAccessException { Class parameters = updateFileMethod.getParameterTypes(); if (parameters.length == 2 && parameters[0].equals(Path.class) && parameters[1].isArray()) { updateFileMethod.invoke(this, outputPath, data); } else if (parameters.length == 3 && parameters[0].equals(Path.class) && parameters[1].isArray() && parameters[2].isPrimitive()) { updateFileMethod.invoke(this, outputPath, data, true); } else { throw new RuntimeException("updateFile Method has unexpected parameters"); } }
Source:
public void testRemove() throws Exception { setUpGetConnection(2); setUpGetEntityExpectations(GUIDS[0], 2, getEntity(0)); setUriInfo(setUpActionExpectations(VdcActionType.DetachStorageDomainFromPool, DetachStorageDomainFromPoolParameters.class, new String[] { "StorageDomainId", "StoragePoolId" }, new Object[] { GUIDS[0], GUIDS[NAMES.length-1] }, true, true)); collection.remove(GUIDS[0].toString()); }

Target:
public void testRemove() throws Exception { setUpGetConnection(2); setUpGetEntityExpectations(GUIDS[0], 2, getEntity(0)); setUriInfo(setUpActionExpectations(VdcActionType.DetachStorageDomainFromPool, DetachStorageDomainFromPoolParameters.class, new String[] { "StorageDomainId", "StoragePoolId" }, new Object[] { GUIDS[0], GUIDS[NAMES.length-1] }, true, true)); verifyRemove(collection.remove(GUIDS[0].toString())); }
Source:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { boolean anyFailed = false; for (Guid childCmdId : childCmdIds) { switch (CommandCoordinatorUtil.getCommandStatus(childCmdId)) { case ACTIVE: log.info("Waiting on CloneCinderDisksCommandCallback child commands to complete"); return; case FAILED: case FAILED_RESTARTED: case UNKNOWN: anyFailed = true; break; default: break; } } T command = getCommand(cmdId); command.getParameters().setTaskGroupSuccess(!anyFailed); command.setCommandStatus(anyFailed ? CommandStatus.FAILED : CommandStatus.SUCCEEDED); log.info("All CloneCinderDisksCommandCallback commands have completed, status '{}'", command.getCommandStatus()); }

Target:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { boolean anyFailed = false; for (Guid childCmdId : childCmdIds) { CommandStatus commandStatus = CommandCoordinatorUtil.getCommandStatus(childCmdId); switch (commandStatus) { case ACTIVE: log.info("Waiting on CloneCinderDisksCommandCallback child commands to complete"); return; case FAILED: case FAILED_RESTARTED: case UNKNOWN: anyFailed = true; break; default: log.error("Invalid command status: '{}", commandStatus); break; } } T command = getCommand(cmdId); command.getParameters().setTaskGroupSuccess(!anyFailed); command.setCommandStatus(anyFailed ? CommandStatus.FAILED : CommandStatus.SUCCEEDED); log.info("All CloneCinderDisksCommandCallback commands have completed, status '{}'", command.getCommandStatus()); }
Source:
protected Sequence<T> mergeCachedAndUncachedSequences( List<Pair<Interval, Sequence<T>>> sequencesByInterval, QueryToolChest<T, Query<T>> toolChest ) { if (sequencesByInterval.isEmpty()) { return Sequences.empty(); } return toolChest.mergeSequencesUnordered(Sequences.simple(Lists.transform( sequencesByInterval, new Function<Pair<Interval, Sequence<T>>, Sequence<T>>() { @Nullable @Override public Sequence<T> apply(Pair<Interval, Sequence<T>> input) { return input.rhs; } } ))); }

Target:
protected Sequence<T> mergeCachedAndUncachedSequences( List<Pair<Interval, Sequence<T>>> sequencesByInterval, QueryToolChest<T, Query<T>> toolChest ) { if (sequencesByInterval.isEmpty()) { return Sequences.empty(); } return toolChest.mergeSequencesUnordered( Sequences.simple( Lists.transform( sequencesByInterval, new Function<Pair<Interval, Sequence<T>>, Sequence<T>>() { @Override public Sequence<T> apply(Pair<Interval, Sequence<T>> input) { return input.rhs; } } ) ) ); }
Source:
public void run() { List<byte[]> args = command.getProcessedCommand(); byte[] channelName = args.get(1); byte[] message = args.get(2); try { long publishCount = context.getPubSub() .publish(context.getRegionProvider().getDataRegion(), channelName, message); ByteBuf response = Coder.getIntegerResponse(context.getByteBufAllocator(), publishCount); context.endAsyncCommandExecution(command, response); } catch (Throwable ex) { context.endAsyncCommandExecution(command, ex); } }

Target:
public void run() { List<byte[]> args = command.getProcessedCommand(); byte[] channelName = args.get(1); byte[] message = args.get(2); try { long publishCount = context.getPubSub() .publish(context.getRegionProvider().getDataRegion(), channelName, message); RedisResponse response = RedisResponse.integer(publishCount); context.endAsyncCommandExecution(command, response); } catch (Throwable ex) { context.endAsyncCommandExecution(command, ex); } }
Source:
public void reportIssue(JavaCheck javaCheck, Tree tree, String message) { throwIfEndOfAnalysisCheck(javaCheck); reportIssue(javaCheck, tree, message, ImmutableList.of(), null); }

Target:
public void reportIssue(JavaCheck javaCheck, Tree tree, String message) { reportIssue(javaCheck, tree, message, ImmutableList.of(), null); }
Source:
void followLeader() throws InterruptedException { self.end_fle = Time.currentElapsedTime(); long electionTimeTaken = self.end_fle - self.start_fle; self.setElectionTimeTaken(electionTimeTaken); LOG.info("FOLLOWING - LEADER ELECTION TOOK - {}", electionTimeTaken, QuorumPeer.FLE_TIME_UNIT); self.start_fle = 0; self.end_fle = 0; fzk.registerJMX(new FollowerBean(this, zk), self.jmxLocalPeerBean); try { InetSocketAddress addr = findLeader(); try { connectToLeader(addr); long newEpochZxid = registerWithLeader(Leader.FOLLOWERINFO); if (self.isReconfigStateChange()) throw new Exception("learned about role change"); long newEpoch = ZxidUtils.getEpochFromZxid(newEpochZxid); if (newEpoch < self.getAcceptedEpoch()) { LOG.error("Proposed leader epoch " + ZxidUtils.zxidToString(newEpochZxid) + " is less than our accepted epoch " + ZxidUtils.zxidToString(self.getAcceptedEpoch())); throw new IOException("Error: Epoch of leader is lower"); } syncWithLeader(newEpochZxid); QuorumPacket qp = new QuorumPacket(); while (this.isRunning()) { readPacket(qp); processPacket(qp); } } catch (Exception e) { LOG.warn("Exception when following the leader", e); try { sock.close(); } catch (IOException e1) { e1.printStackTrace(); } pendingRevalidations.clear(); } } finally { zk.unregisterJMX((Learner)this); } }

Target:
void followLeader() throws InterruptedException { self.end_fle = Time.currentElapsedTime(); long electionTimeTaken = self.end_fle - self.start_fle; self.setElectionTimeTaken(electionTimeTaken); LOG.info("FOLLOWING - LEADER ELECTION TOOK - {}", electionTimeTaken, QuorumPeer.FLE_TIME_UNIT); self.start_fle = 0; self.end_fle = 0; fzk.registerJMX(new FollowerBean(this, zk), self.jmxLocalPeerBean); try { QuorumServer leaderServer = findLeader(); try { connectToLeader(leaderServer.addr, leaderServer.hostname); long newEpochZxid = registerWithLeader(Leader.FOLLOWERINFO); if (self.isReconfigStateChange()) throw new Exception("learned about role change"); long newEpoch = ZxidUtils.getEpochFromZxid(newEpochZxid); if (newEpoch < self.getAcceptedEpoch()) { LOG.error("Proposed leader epoch " + ZxidUtils.zxidToString(newEpochZxid) + " is less than our accepted epoch " + ZxidUtils.zxidToString(self.getAcceptedEpoch())); throw new IOException("Error: Epoch of leader is lower"); } syncWithLeader(newEpochZxid); QuorumPacket qp = new QuorumPacket(); while (this.isRunning()) { readPacket(qp); processPacket(qp); } } catch (Exception e) { LOG.warn("Exception when following the leader", e); try { sock.close(); } catch (IOException e1) { e1.printStackTrace(); } pendingRevalidations.clear(); } } finally { zk.unregisterJMX((Learner)this); } }
Source:
public F next() throws NoSuchElementException { if(next==null&&this.hasNext()==false) { throw new NoSuchElementException(); } F f = next; next = null; return f; }

Target:
public F next() throws NoSuchElementException { if(next==null && !this.hasNext()) { throw new NoSuchElementException(); } F f = next; next = null; return f; }
Source:
S3SelectPushdown(HiveClientConfig hiveClientConfig) { this.hiveClientConfig = hiveClientConfig; }

Target:
S3SelectPushdown(HiveClientConfig hiveClientConfig) { this.hiveClientConfig = requireNonNull(hiveClientConfig); }
Source:
public FastClass(Class<?> hostClass) { super(hostClass, FASTCLASS_BY_GUICE_MARKER); hostIsInterface = hostClass.isInterface(); }

Target:
FastClass(Class<?> hostClass) { super(hostClass, FASTCLASS_BY_GUICE_MARKER); hostIsInterface = hostClass.isInterface(); }
Source:
private GHResponse runMoscow(GraphHopper hopper, String edgeBasedParam, boolean ch) { GHRequest req = new GHRequest(55.813357, 37.5958585, 55.811042, 37.594689); if (edgeBasedParam.equals("true") || edgeBasedParam.equals("false")) { req.getHints().putObject(Routing.EDGE_BASED, edgeBasedParam); } else { req.getHints().remove(Routing.EDGE_BASED); } req.putHint(CH.DISABLE, !ch); req.setVehicle("car"); req.setWeighting("fastest"); return hopper.route(req); }

Target:
private GHResponse runMoscow(GraphHopper hopper, String edgeBasedParam, boolean ch) { GHRequest req = new GHRequest(55.813357, 37.5958585, 55.811042, 37.594689); if (edgeBasedParam.equals("true") || edgeBasedParam.equals("false")) { req.getHints().putObject(Routing.EDGE_BASED, Helper.toObject(edgeBasedParam)); } else { req.getHints().remove(Routing.EDGE_BASED); } req.putHint(CH.DISABLE, !ch); req.setVehicle("car"); req.setWeighting("fastest"); return hopper.route(req); }
Source:
public void reset(ResetRequest request) throws GitException { try { ResetCommand resetCommand = getGit().reset(); resetCommand.setRef(request.getCommit()); int filePatternsAmount = request.getFilePattern().size(); for (int i = 0; i < filePatternsAmount; i++) { resetCommand.addPath(request.getFilePattern().get(i)); } if (request.getType() != null && filePatternsAmount == 0) { if (request.getType().equals(ResetRequest.ResetType.HARD)) { resetCommand.setMode(ResetCommand.ResetType.HARD); } else if (request.getType().equals(ResetRequest.ResetType.KEEP)) { resetCommand.setMode(ResetCommand.ResetType.KEEP); } else if (request.getType().equals(ResetRequest.ResetType.MERGE)) { resetCommand.setMode(ResetCommand.ResetType.MERGE); } else if (request.getType().equals(ResetRequest.ResetType.MIXED)) { resetCommand.setMode(ResetCommand.ResetType.MIXED); } else if (request.getType().equals(ResetRequest.ResetType.SOFT)) { resetCommand.setMode(ResetCommand.ResetType.SOFT); } } resetCommand.call(); } catch (GitAPIException exception) { throw new GitException(exception.getMessage(), exception); } }

Target:
public void reset(ResetRequest request) throws GitException { try { ResetCommand resetCommand = getGit().reset(); resetCommand.setRef(request.getCommit()); List<String> patterns = request.getFilePattern(); patterns.stream().forEach(resetCommand::addPath); if (request.getType() != null && patterns.isEmpty()) { switch (request.getType()) { case HARD: resetCommand.setMode(ResetType.HARD); break; case KEEP: resetCommand.setMode(ResetType.KEEP); break; case MERGE: resetCommand.setMode(ResetType.MERGE); break; case MIXED: resetCommand.setMode(ResetType.MIXED); break; case SOFT: resetCommand.setMode(ResetType.SOFT); break; } } resetCommand.call(); } catch (GitAPIException exception) { throw new GitException(exception.getMessage(), exception); } }
Source:
public void testAPIUsage() { final KieServices ks = KieServices.Factory.get(); final KieContainer kieContainer = DMNRuntimeUtil.getKieContainerIgnoringErrors(ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0"), ks.getResources().newClassPathResource("incomplete_expression.dmn", this.getClass()), ks.getResources().newClassPathResource("duff.drl", this.getClass())); Results verify = kieContainer.verify(); List<Message> kie_messages = verify.getMessages(); kie_messages.forEach(System.out::println); assertThat(kie_messages.size(), is(3)); assertThat(kie_messages.stream().filter(m -> m.getPath().equals("duff.drl")).count(), is(2L)); List<DMNMessage> dmnMessages = kie_messages.stream() .filter(DMNMessage.class::isInstance) .map(DMNMessage.class::cast) .collect(Collectors.toList()); assertThat(dmnMessages.size(), is(1)); DMNMessage dmnMessage = dmnMessages.get(0); assertThat(dmnMessage.getSourceId(), is("_c990c3b2-e322-4ef9-931d-79bcdac99686")); assertThat(dmnMessage.getMessageType(), is(DMNMessageType.ERR_COMPILING_FEEL)); assertThat(dmnMessage.getPath(), is("incomplete_expression.dmn")); }

Target:
public void testAPIUsage() { final KieServices ks = KieServices.Factory.get(); final KieContainer kieContainer = DMNRuntimeUtil.getKieContainerIgnoringErrors(ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0"), ks.getResources().newClassPathResource("incomplete_expression.dmn", this.getClass()), ks.getResources().newClassPathResource("duff.drl", this.getClass())); Results verify = kieContainer.verify(); List<Message> kie_messages = verify.getMessages(); kie_messages.forEach(m -> LOG.info("{}", m)); assertThat(kie_messages.size(), is(3)); assertThat(kie_messages.stream().filter(m -> m.getPath().equals("duff.drl")).count(), is(2L)); List<DMNMessage> dmnMessages = kie_messages.stream() .filter(DMNMessage.class::isInstance) .map(DMNMessage.class::cast) .collect(Collectors.toList()); assertThat(dmnMessages.size(), is(1)); DMNMessage dmnMessage = dmnMessages.get(0); assertThat(dmnMessage.getSourceId(), is("_c990c3b2-e322-4ef9-931d-79bcdac99686")); assertThat(dmnMessage.getMessageType(), is(DMNMessageType.ERR_COMPILING_FEEL)); assertThat(dmnMessage.getPath(), is("incomplete_expression.dmn")); }
Source:
protected void executeCommand() { for (VdsStatic vds : getParameters().getVdss()) { int selectedId = 1; List<Integer> map = LinqUtils.foreach(vds_spm_id_mapList, new Function<vds_spm_id_map, Integer>() { @Override public Integer eval(vds_spm_id_map vds_spm_id_map) { return vds_spm_id_map.getvds_spm_id(); } }); Collections.sort(map); for (int id : map) { if (selectedId == id) { selectedId++; } else { break; } } vds_spm_id_map newMap = new vds_spm_id_map(getParameters().getStoragePoolId(), vds.getId(), selectedId); DbFacade.getInstance().getVdsSpmIdMapDao().save(newMap); if (getParameters().isCompensationEnabled()) { getCompensationContext().snapshotNewEntity(newMap); getCompensationContext().stateChanged(); } } setSucceeded(true); }

Target:
protected void executeCommand() { int selectedId = 1; List<Integer> map = LinqUtils.foreach(vds_spm_id_mapList, new Function<vds_spm_id_map, Integer>() { @Override public Integer eval(vds_spm_id_map vds_spm_id_map) { return vds_spm_id_map.getvds_spm_id(); } }); Collections.sort(map); for (VdsStatic vds : getParameters().getVdss()) { for (Iterator<Integer> iterator = map.iterator(); iterator.hasNext();) { if (selectedId == iterator.next()) { selectedId++; iterator.remove(); } else { break; } } vds_spm_id_map newMap = new vds_spm_id_map(getParameters().getStoragePoolId(), vds.getId(), selectedId); DbFacade.getInstance().getVdsSpmIdMapDao().save(newMap); if (getParameters().isCompensationEnabled()) { getCompensationContext().snapshotNewEntity(newMap); getCompensationContext().stateChanged(); } selectedId++; } setSucceeded(true); }
Source:
public String render(final String templateName, final PageData pageData, final List<Locale> locales) { final Template template = compileTemplate(templateName); final Context context = Context.newContext(pageData);; context.data("locales", locales.stream().map(Locale::toLanguageTag).collect(toList())); try { Logger.debug("Rendering template " + templateName); return template.apply(context); } catch (IOException e) { throw new TemplateRenderException("Context could not be applied to template " + templateName, e); } }

Target:
public String render(final String templateName, final PageData pageData, final List<Locale> locales) { final Template template = compileTemplate(templateName); final Context context = Context.newContext(pageData); context.data("locales", locales.stream().map(Locale::toLanguageTag).collect(toList())); try { Logger.debug("Rendering template " + templateName); return template.apply(context); } catch (IOException e) { throw new TemplateRenderException("Context could not be applied to template " + templateName, e); } }
Source:
public double getRate() { if (reverseDirection) { return (encoder.getVelocity() - trueVelocity) * distancePerPulse * -1.0; } else { return (encoder.getVelocity() - trueVelocity) * distancePerPulse; } }

Target:
public double getRate() { try { return getRateSafely(); } catch (InvalidSensorException e) { LogKitten.e(e); return 0.0; } }
Source:
private String addSchemeIdColumn() { if (DbConnectionFactory.isMySql()) { return MYSQL_ADD_SCHEME_ID_COLUMN; } else if (DbConnectionFactory.isPostgres()) { return POSTGRES_ADD_SCHEME_ID_COLUMN; } else if (DbConnectionFactory.isMsSql()) { return MSSQL_ADD_SCHEME_ID_COLUMN; } else if (DbConnectionFactory.isOracle()) { return ORACLE_ADD_SCHEME_ID_COLUMN; } else { return null; } }

Target:
private String addSchemeIdColumn() { String sql = null; if (DbConnectionFactory.isMySql()) { sql = MYSQL_ADD_SCHEME_ID_COLUMN; } else if (DbConnectionFactory.isPostgres()) { sql = POSTGRES_ADD_SCHEME_ID_COLUMN; } else if (DbConnectionFactory.isMsSql()) { sql = MSSQL_ADD_SCHEME_ID_COLUMN; } else if (DbConnectionFactory.isOracle()) { sql = ORACLE_ADD_SCHEME_ID_COLUMN; } return sql; }
Source:
public void accept(CompletionProposal proposal) { long start= JavaPlugin.DEBUG_RESULT_COLLECTOR ? System.currentTimeMillis() : 0; try { if (isFiltered(proposal)) return; if (proposal.getKind() == CompletionProposal.POTENTIAL_METHOD_DECLARATION) { acceptPotentialMethodDeclaration(proposal); } else { IJavaCompletionProposal javaProposal= createJavaCompletionProposal(proposal); if (javaProposal != null) { fJavaProposals.add(javaProposal); if (proposal.getKind() == CompletionProposal.KEYWORD) fKeywords.add(javaProposal); ((AbstractJavaCompletionProposal) javaProposal).setSuffixProposal(proposal.isSuffixProposal()); } } } catch (IllegalArgumentException e) { JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, "Exception when processing proposal for: " + String.valueOf(proposal.getCompletion()), e)); } if (JavaPlugin.DEBUG_RESULT_COLLECTOR) fUITime += System.currentTimeMillis() - start; }

Target:
public void accept(CompletionProposal proposal) { long start= JavaPlugin.DEBUG_RESULT_COLLECTOR ? System.currentTimeMillis() : 0; try { if (isFiltered(proposal)) return; if (proposal.getKind() == CompletionProposal.POTENTIAL_METHOD_DECLARATION) { acceptPotentialMethodDeclaration(proposal); } else { IJavaCompletionProposal javaProposal= createJavaCompletionProposal(proposal); if (javaProposal != null) { fJavaProposals.add(javaProposal); if (proposal.getKind() == CompletionProposal.KEYWORD) fKeywords.add(javaProposal); if (javaProposal instanceof AbstractJavaCompletionProposal) ((AbstractJavaCompletionProposal) javaProposal).setSuffixProposal(proposal.isSuffixProposal()); } } } catch (IllegalArgumentException e) { JavaPlugin.log(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.OK, "Exception when processing proposal for: " + String.valueOf(proposal.getCompletion()), e)); } if (JavaPlugin.DEBUG_RESULT_COLLECTOR) fUITime += System.currentTimeMillis() - start; }
Source:
public void testReverse2() { Comparator<Item> comparator = Comparator.naturalOrder(); assertEquals(comparator, comparator.reversed().reversed()); }

Target:
public void testReverse2() { Comparator<Item> comparator = Comparator.naturalOrder(); assertSame(comparator, comparator.reversed().reversed()); }
Source:
public boolean onHttpResponseReceive(HttpMessage msg) { if (options.isEnabled() && msg.getResponseHeader().isHtml()) { try { String html = msg.getResponseBody().toString(); Source document = new Source(html); List<Element> heads = document.getAllElements("head"); Element head = heads.isEmpty() ? null : heads.get(0); if (head != null && msg.getHistoryRef() != null) { String host = msg.getRequestHeader().getHeader("host"); String frontEndApiUrl = API .getInstance() .getCallBackUrl(this.api, "https://" + host); int historyReferenceId = msg.getHistoryRef().getHistoryId(); StringBuilder injectedContentBuilder = new StringBuilder(65000) .append("<script src='" + frontEndApiUrl + "?action=getFile" + "&filename=front-end-scanner.js" + "&historyReferenceId=" + historyReferenceId + "'></script>"); String injectedContent = injectedContentBuilder.toString(); OutputDocument newResponseBody = new OutputDocument(document); int insertPosition = head.getChildElements().get(0).getBegin(); newResponseBody.insert(insertPosition, injectedContent); msg.getResponseBody() .setBody(newResponseBody.toString()); int newLength = msg.getResponseBody().length(); msg.getResponseHeader().setContentLength(newLength); } else { LOGGER.debug("<head></head> is missing in the response"); } } catch (Exception e) { LOGGER.error(e.getMessage(), e); } } return true; }

Target:
public boolean onHttpResponseReceive(HttpMessage msg) { if (options.isEnabled() && msg.getResponseHeader().isHtml()) { try { String html = msg.getResponseBody().toString(); Source document = new Source(html); List<Element> heads = document.getAllElements("head"); Element head = heads.isEmpty() ? null : heads.get(0); if (head != null && msg.getHistoryRef() != null) { String host = msg.getRequestHeader().getHeader("host"); String frontEndApiUrl = API .getInstance() .getCallBackUrl(this.api, "https://" + host); int historyReferenceId = msg.getHistoryRef().getHistoryId(); StringBuilder injectedContentBuilder = new StringBuilder(200) .append("<script src='") .append(frontEndApiUrl) .append("?action=getFile") .append("&filename=front-end-scanner.js") .append("&historyReferenceId=") .append(historyReferenceId) .append("'></script>"); String injectedContent = injectedContentBuilder.toString(); OutputDocument newResponseBody = new OutputDocument(document); int insertPosition = head.getChildElements().get(0).getBegin(); newResponseBody.insert(insertPosition, injectedContent); msg.getResponseBody() .setBody(newResponseBody.toString()); int newLength = msg.getResponseBody().length(); msg.getResponseHeader().setContentLength(newLength); } else { LOGGER.debug("<head></head> is missing in the response"); } } catch (Exception e) { LOGGER.error(e.getMessage(), e); } } return true; }
Source:
public Iterator<DataRecord> getAllRecords() throws DataStoreException { return null; }

Target:
public Iterator<DataRecord> getAllRecords() throws DataStoreException { Iterator<DataStore> iter = delegateHandler.getAllDelegatesIterator(); Iterator<DataRecord> result = Iterators.emptyIterator(); while (iter.hasNext()) { DataStore ds = iter.next(); if (ds instanceof SharedDataStore) { result = Iterators.concat(result, ((SharedDataStore) ds).getAllRecords()); } } return result; }
Source:
public void handleDelete(ActionParameters params) throws ActionException { params.requireAdminUser(); try { int id = -1; JSONObject jsonParams = params.getPayLoadJSON(); if (jsonParams.has("id")) { id = jsonParams.getInt("id"); } int deleteId = service.deleteAnnouncement(id); final JSONObject result = new JSONObject(); JSONHelper.putValue(result, "id", deleteId); ResponseHelper.writeResponse(params, result); } catch (Exception e) { LOG.error("Error with deleting announcement", e); throw new ActionException("Cannot delete announcement"); } }

Target:
public void handleDelete(ActionParameters params) throws ActionException { params.requireAdminUser(); try { int id = -1; JSONObject jsonParams = params.getPayLoadJSON(); if (jsonParams.has("id")) { id = jsonParams.getInt("id"); } int deleteId = service.deleteAnnouncement(id); final JSONObject result = new JSONObject(); JSONHelper.putValue(result, "id", deleteId); ResponseHelper.writeResponse(params, result); } catch (Exception e) { throw new ActionException("Cannot delete announcement", e); } }
Source:
public List<Descriptor<RetentionStrategy<?>>> getDockerRetentionStrategies() { List<Descriptor<RetentionStrategy<?>>> strategies = new ArrayList<Descriptor<RetentionStrategy<?>>>(); strategies.addAll(RetentionStrategy.all()); strategies.add(DockerOnceRetentionStrategy.DESCRIPTOR); strategies.add(DockerCloudRetentionStrategy.DESCRIPTOR); return strategies; }

Target:
public List<Descriptor<RetentionStrategy<?>>> getDockerRetentionStrategies() { List<Descriptor<RetentionStrategy<?>>> strategies = new ArrayList<>(); strategies.add(DockerOnceRetentionStrategy.DESCRIPTOR); strategies.add(DockerCloudRetentionStrategy.DESCRIPTOR); strategies.addAll(RetentionStrategy.all()); return strategies; }
Source:
private Object getConfigurationValue(String fieldName) { Lock readLock = null; try { readLock = configLock.readLock(); readLock.lock(); return invokeGetter(configuration, fieldName); } catch (IOException e) { return null; } finally { if (readLock != null) { readLock.unlock(); } } }

Target:
public Object getConfigurationValue(String fieldName) { try { configLock.readLock().lock(); return getFieldValue(configuration, fieldName); } catch (IOException e) { return null; } finally { configLock.readLock().unlock(); } }
Source:
void clearCache() { this.permittedCache.clear(); this.permittedCache = new ConcurrentHashMap<String, Boolean>(); }

Target:
final void clearCache() { this.permittedCache.clear(); this.permittedCache = new ConcurrentHashMap<String, Boolean>(); }
Source:
void save(CallbackGroup group) { String message = editArea.getValue().trim(); if (message.length() == 0) { return; } CommentInfo original = comment; CommentInput input = CommentInput.create(original); input.setMessage(message); enableEdit(false); GerritCallback<CommentInfo> cb = new GerritCallback<CommentInfo>() { @Override public void onSuccess(CommentInfo result) { enableEdit(true); set(result); setEdit(false); if (autoClosed) { setOpen(false); } parent.updateUnsaved(DraftBox.this, false); getCm().focus(); } @Override public void onFailure(Throwable e) { enableEdit(true); super.onFailure(e); } }; if (original.id() == null) { CommentApi.createDraft(psId, input, group == null ? cb : group.add(cb)); } else { CommentApi.updateDraft( psId, original.id(), input, group == null ? cb : group.add(cb)); } }

Target:
void save(CallbackGroup group) { String message = editArea.getValue().trim(); if (message.length() == 0) { return; } CommentInfo original = comment; CommentInput input = CommentInput.create(original); input.setMessage(message); enableEdit(false); GerritCallback<CommentInfo> cb = new GerritCallback<CommentInfo>() { @Override public void onSuccess(CommentInfo result) { enableEdit(true); set(result); setEdit(false); if (autoClosed) { setOpen(false); } parent.updateUnsaved(DraftBox.this, false); } @Override public void onFailure(Throwable e) { enableEdit(true); super.onFailure(e); } }; if (original.id() == null) { CommentApi.createDraft(psId, input, group == null ? cb : group.add(cb)); } else { CommentApi.updateDraft( psId, original.id(), input, group == null ? cb : group.add(cb)); } getCm().focus(); }
Source:
private static void updateQueryOutputLocations(QueryStateMachine queryStateMachine, OutputBufferId rootBufferId, Set<RemoteTask> tasks, boolean noMoreExchangeLocations) { Map<URI, TaskId> bufferLocations = tasks.stream() .collect(toImmutableMap( task -> getBufferLocationForRemoteTask(task, rootBufferId), task -> task.getTaskId())); queryStateMachine.updateOutputLocations(bufferLocations, noMoreExchangeLocations); }

Target:
private static void updateQueryOutputLocations(QueryStateMachine queryStateMachine, OutputBufferId rootBufferId, Set<RemoteTask> tasks, boolean noMoreExchangeLocations) { Map<URI, TaskId> bufferLocations = tasks.stream() .collect(toImmutableMap( task -> getBufferLocation(task, rootBufferId), RemoteTask::getTaskId)); queryStateMachine.updateOutputLocations(bufferLocations, noMoreExchangeLocations); }
Source:
public static Path getLocation(GlobalConfiguration globalConfiguration, String location) { GlobalStateConfiguration globalState = globalConfiguration.globalState(); Path persistentLocation = Paths.get(globalState.persistentLocation()); if (location == null) return persistentLocation; Path path = Paths.get(location); if (!globalState.enabled()) { return path; } if (path.isAbsolute()) { if (path.startsWith(persistentLocation)) { return path; } else { throw PERSISTENCE.forbiddenStoreLocation(path, persistentLocation); } } return persistentLocation.resolve(path); }

Target:
public static Path getLocation(GlobalConfiguration globalConfiguration, String location) { GlobalStateConfiguration globalState = globalConfiguration.globalState(); Path persistentLocation = Paths.get(globalState.persistentLocation()); if (location == null) { if (!globalState.enabled()) { throw PERSISTENCE.storeLocationRequired(); } return persistentLocation; } Path path = Paths.get(location); if (!globalState.enabled()) { return path; } if (path.isAbsolute()) { if (path.startsWith(persistentLocation)) { return path; } else { throw PERSISTENCE.forbiddenStoreLocation(path, persistentLocation); } } return persistentLocation.resolve(path); }
Source:
protected RefUpdate.Result doRename() throws IOException { Ref src = exactRef(source.getName()); if (src.isSymbolic()) { return RefUpdate.Result.IO_FAILURE; } if (exactRef(destination.getName()) != null || src == null || !source.getOldObjectId().equals(src.getObjectId())) { return RefUpdate.Result.LOCK_FAILURE; } if (!addReftable(this::writeRename)) { return RefUpdate.Result.LOCK_FAILURE; } return RefUpdate.Result.RENAMED; }

Target:
protected RefUpdate.Result doRename() throws IOException { Ref src = exactRef(source.getName()); if (exactRef(destination.getName()) != null || src == null || !source.getOldObjectId().equals(src.getObjectId())) { return RefUpdate.Result.LOCK_FAILURE; } if (src.isSymbolic()) { return RefUpdate.Result.IO_FAILURE; } if (!addReftable(this::writeRename)) { return RefUpdate.Result.LOCK_FAILURE; } return RefUpdate.Result.RENAMED; }
Source:
public void deregister() { Chart chart = getChart(); if ((chart != null) && !chart.isDisposed()) { chart.getPlotArea().removeMouseTrackListener(this); chart.getPlotArea().removeMouseMoveListener(this); chart.getPlotArea().removePaintListener(this); fTooltipHandler.deactivateHoverHelp(chart.getPlotArea()); } }

Target:
public void deregister() { Chart chart = getChart(); if ((chart != null) && !chart.isDisposed()) { chart.getPlotArea().removeMouseMoveListener(this); chart.getPlotArea().removePaintListener(this); fTooltipHandler.deactivateHoverHelp(chart.getPlotArea()); } }
Source:
public ListenableFuture<Optional<String>> getName(final LabelId id) { final String name = idCache.getIfPresent(id); if (name != null) { return Futures.immediateFuture(Optional.of(name)); } class GetNameFunction implements AsyncFunction<Optional<String>, Optional<String>> { @Nullable @Override public ListenableFuture<Optional<String>> apply(@Nullable final Optional<String> name) { checkNotNull(name); if (name.isPresent()) { addNameToCache(id, name.get()); addIdToCache(name.get(), id); return Futures.immediateFuture(Optional.of(name.get())); } return Futures.immediateFuture(Optional.<String>absent()); } } return transform(store.getName(id, type), new GetNameFunction()); }

Target:
public ListenableFuture<Optional<String>> getName(final LabelId id) { final String name = idCache.getIfPresent(id); if (name != null) { return Futures.immediateFuture(Optional.of(name)); } class GetNameFunction implements AsyncFunction<Optional<String>, Optional<String>> { @Nullable @Override public ListenableFuture<Optional<String>> apply(@Nullable final Optional<String> name) { checkNotNull(name); if (name.isPresent()) { addNameToCache(id, name.get()); addIdToCache(name.get(), id); } return Futures.immediateFuture(name); } } return transform(store.getName(id, type), new GetNameFunction()); }
Source:
public void open() throws IOException { writer = CompressionFactory.getLongSerializer( ioPeon, StringUtils.safeFormat("%s.long_column", filenameBase), byteOrder, encoding, compression ); writer.open(); }

Target:
public void open() throws IOException { writer = CompressionFactory.getLongSerializer( ioPeon, StringUtils.format("%s.long_column", filenameBase), byteOrder, encoding, compression ); writer.open(); }
Source:
void assertLastChangedDateString() throws Exception { final TimeZone tz = TimeZone.getTimeZone("GMT"); final Calendar c = Calendar.getInstance(tz); final Date now = c.getTime(); final String dateFomratString = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; final SimpleDateFormat sdf = new SimpleDateFormat(dateFomratString); sdf.setTimeZone(tz); Connection cx = geopkg.getDataSource().getConnection(); Statement st = cx.createStatement(); ResultSet rs = null; try { rs = st.executeQuery(String.format("SELECT last_change FROM %s;", GeoPackage.GEOPACKAGE_CONTENTS)); if (rs.next()) { final String dateString = rs.getString(1); Date parsedDate = sdf.parse(dateString); assertEquals("Month value does not match", new SimpleDateFormat("MMMM").format(now), new SimpleDateFormat("MMMM").format(parsedDate)); assertEquals("Minutes value does not match", new SimpleDateFormat("mm").format(now), new SimpleDateFormat("mm").format(parsedDate)); } } finally { if (rs != null) { rs.close(); } st.close(); cx.close(); } }

Target:
void assertLastChangedDateString() throws Exception { final TimeZone tz = TimeZone.getTimeZone("GMT"); final Calendar c = Calendar.getInstance(tz); final Date now = c.getTime(); final String dateFomratString = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; final SimpleDateFormat sdf = new SimpleDateFormat(dateFomratString); sdf.setTimeZone(tz); try (Connection cx = geopkg.getDataSource().getConnection(); Statement st = cx.createStatement(); ResultSet rs = st.executeQuery(String.format("SELECT last_change FROM %s;", GeoPackage.GEOPACKAGE_CONTENTS))){ if (rs.next()) { final String dateString = rs.getString(1); Date parsedDate = sdf.parse(dateString); assertEquals("Month value does not match", new SimpleDateFormat("MMMM").format(now), new SimpleDateFormat("MMMM").format(parsedDate)); assertEquals("Minutes value does not match", new SimpleDateFormat("mm").format(now), new SimpleDateFormat("mm").format(parsedDate)); } } }
Source:
private Optional<SnomedConceptIndexEntry> getCandidate(final Collection<SnomedConceptIndexEntry> candidates, final int rowIndex) { if (StringUtils.isEmpty(topLevelConceptId)) { return FluentIterable.from(candidates).first(); } return FluentIterable.from(candidates).firstMatch(new Predicate<SnomedConceptIndexEntry>() { @Override public boolean apply(final SnomedConceptIndexEntry input) { return isValidCandidate(input, rowIndex); } }); }

Target:
protected Optional<SnomedConceptIndexEntry> getCandidate(final Collection<SnomedConceptIndexEntry> candidates, final int rowIndex) { return FluentIterable.from(candidates).first(); }
Source:
public static ImmutableList<Ds3Request> splitAllMultiResponseRequests( final ImmutableList<Ds3Request> ds3Requests) { if (isEmpty(ds3Requests)) { LOG.info("No requests"); return ImmutableList.of(); } final ImmutableList.Builder<Ds3Request> builder = ImmutableList.builder(); for (final Ds3Request ds3Request : ds3Requests) { builder.addAll(splitMultiResponseRequest(ds3Request)); } return builder.build(); }

Target:
public static ImmutableList<Ds3Request> splitAllMultiResponseRequests( final ImmutableList<Ds3Request> ds3Requests) throws ResponseTypeNotFoundException { if (isEmpty(ds3Requests)) { LOG.info("No requests to split"); return ImmutableList.of(); } final ImmutableList.Builder<Ds3Request> builder = ImmutableList.builder(); for (final Ds3Request ds3Request : ds3Requests) { builder.addAll(splitMultiResponseRequest(ds3Request)); } return builder.build(); }
Source:
private static DetailAST getNodeWithParentScope(int literal, String scope, int parentTokenType) { final DetailAST ast1 = new DetailAST(); ast1.setType(parentTokenType); final DetailAST ast2 = new DetailAST(); ast2.setType(TokenTypes.MODIFIERS); final DetailAST ast3 = new DetailAST(); ast3.setType(literal); ast3.setText(scope); ast2.setFirstChild(ast3); ast1.setFirstChild(ast2); final DetailAST ast = new DetailAST(); ast.setType(TokenTypes.OBJBLOCK); ast1.addChild(ast); return ast; }

Target:
private static DetailAST getNodeWithParentScope(int literal, String scope, int parentTokenType) { final DetailAST ast = getNode(parentTokenType, TokenTypes.MODIFIERS, literal); ast.setText(scope); final DetailAST ast2 = getNode(TokenTypes.OBJBLOCK); ast.getParent().getParent().addChild(ast2); return ast; }
Source:
public void deregisterInvertingProxyAgent(String ccmV2AgentCrn) { if (ccmV2AgentCrn != null) { String requestId = Optional.ofNullable(MDCBuilder.getMdcContextMap() .get(LoggerContextKey.REQUEST_ID.toString())).orElse(UUID.randomUUID().toString()); MDCBuilder.addRequestId(requestId); ccmV2Client.deregisterInvertingProxyAgent(requestId, ccmV2AgentCrn); } else { LOGGER.info("Cluster ccmV2AgentCrn is not initialized, nothing to unregister."); } }

Target:
public void deregisterInvertingProxyAgent(String ccmV2AgentCrn) { if (ccmV2AgentCrn != null) { ccmV2Client.deregisterInvertingProxyAgent(MDCBuilder.getOrGenerateRequestId(), ccmV2AgentCrn); } else { LOGGER.info("Cluster ccmV2AgentCrn is not initialized, nothing to unregister."); } }