auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void logNodeCompAssignments() { if (nodeCompAssignmentCnts == null || nodeCompAssignmentCnts.isEmpty()) { LOG.info("NodeCompAssignment is empty"); return; } StringBuffer sb = new StringBuffer(); int cntAllNodes = 0; int cntFilledNodes = 0; for (RasNode node: new TreeSet<RasNode>(nodeCompAssignmentCnts.keySet())) { cntAllNodes++; Map<String, Integer> oneMap = nodeCompAssignmentCnts.get(node); if (oneMap.isEmpty()) { continue; } cntFilledNodes++; String oneMapJoined = String.join( ",", oneMap.entrySet() .stream().map(e -> String.format("%s: %s", e.getKey(), e.getValue())) .collect(Collectors.toList()) ); sb.append(String.format("\n\t(%d) Node %s: %s", cntFilledNodes, node.getId(), oneMapJoined)); } LOG.info("NodeCompAssignments available for of nodes {}", cntFilledNodes, cntAllNodes, sb); LOG.info("Executors assignments attempted (cnt={}) are: \n\t{}", execs.size(), execs.stream().map(x -> x.toString()).collect(Collectors.joining(",")) ); }

Target:
public void logNodeCompAssignments() { if (nodeCompAssignmentCnts == null || nodeCompAssignmentCnts.isEmpty()) { LOG.info("NodeCompAssignment is empty"); return; } StringBuffer sb = new StringBuffer(); int cntAllNodes = 0; int cntFilledNodes = 0; for (RasNode node: new TreeSet<>(nodeCompAssignmentCnts.keySet())) { cntAllNodes++; Map<String, Integer> oneMap = nodeCompAssignmentCnts.get(node); if (oneMap.isEmpty()) { continue; } cntFilledNodes++; String oneMapJoined = String.join( ",", oneMap.entrySet() .stream().map(e -> String.format("%s: %s", e.getKey(), e.getValue())) .collect(Collectors.toList()) ); sb.append(String.format("\n\t(%d) Node %s: %s", cntFilledNodes, node.getId(), oneMapJoined)); } LOG.info("NodeCompAssignments available for of nodes {}", cntFilledNodes, cntAllNodes, sb); LOG.info("Executors assignments attempted (cnt={}) are: \n\t{}", execs.size(), execs.stream().map(x -> x.toString()).collect(Collectors.joining(",")) ); }
Source:
public static void openConfigurationEditor(ILaunchDescriptor desc) { if (desc == null) return; Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); IStatus s = canOpenConfigurationEditor(desc); if( !s.isOK()) { MessageDialog.openError(shell, s.getMessage(), s.getException() == null ? s.getMessage() : s.getException().getMessage()); } try { LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); ILaunchMode mode = manager.getActiveLaunchMode(); IRemoteConnection target = manager.getActiveLaunchTarget(); ILaunchConfigurationType configType = manager.getLaunchConfigurationType(desc, target); ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(group.getIdentifier()); ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); if (config.isWorkingCopy() && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { config = ((ILaunchConfigurationWorkingCopy) config).doSave(); } final LaunchConfigurationEditDialog dialog = new LaunchConfigurationEditDialog(shell, config, groupExt); dialog.setInitialStatus(Status.OK_STATUS); dialog.open(); } catch (CoreException e2) { Activator.log(e2); } }

Target:
public static void openConfigurationEditor(ILaunchDescriptor desc) { if (desc == null) return; Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); IStatus s = canOpenConfigurationEditor(desc); if( !s.isOK()) { MessageDialog.openError(shell, s.getMessage(), s.getException() == null ? s.getMessage() : s.getException().getMessage()); return; } try { LaunchBarManager manager = Activator.getDefault().getLaunchBarUIManager().getManager(); ILaunchMode mode = manager.getActiveLaunchMode(); IRemoteConnection target = manager.getActiveLaunchTarget(); ILaunchConfigurationType configType = manager.getLaunchConfigurationType(desc, target); ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configType, mode.getIdentifier()); LaunchGroupExtension groupExt = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(group.getIdentifier()); ILaunchConfiguration config = manager.getLaunchConfiguration(desc, target); if (config.isWorkingCopy() && ((ILaunchConfigurationWorkingCopy) config).isDirty()) { config = ((ILaunchConfigurationWorkingCopy) config).doSave(); } final LaunchConfigurationEditDialog dialog = new LaunchConfigurationEditDialog(shell, config, groupExt); dialog.setInitialStatus(Status.OK_STATUS); dialog.open(); } catch (CoreException e2) { Activator.log(e2); } }
Source:
private SourceResponse executePostFederationQueryPlugins( SourceResponse sourceResponse, QueryRequest queryRequest) { QueryResponse queryResponse = new QueryResponseImpl( queryRequest, sourceResponse.getResults(), true, sourceResponse.getHits(), sourceResponse.getProperties()); try { for (PostFederatedQueryPlugin service : postQuery) { try { queryResponse = service.process(queryResponse); } catch (PluginExecutionException e) { LOGGER.info("Error executing PostFederatedQueryPlugin", e); } } } catch (StopProcessingException e) { LOGGER.info("Plugin stopped processing", e); } SourceResponseImpl responseAfterPlugins = new SourceResponseImpl( queryRequest, sourceResponse.getProperties(), queryResponse.getResults(), queryResponse.getHits()); Set<SourceProcessingDetails> detailsOfResponseAfterPlugins = responseAfterPlugins.getProcessingDetails(); detailsOfResponseAfterPlugins.addAll(queryResponse.getProcessingDetails()); detailsOfResponseAfterPlugins.addAll(sourceResponse.getProcessingDetails()); return responseAfterPlugins; }

Target:
private SourceResponse executePostFederationQueryPlugins( SourceResponse sourceResponse, QueryRequest queryRequest) { QueryResponse queryResponse = new QueryResponseImpl( queryRequest, sourceResponse.getResults(), true, sourceResponse.getHits(), sourceResponse.getProperties()); try { for (PostFederatedQueryPlugin service : postQuery) { try { queryResponse = service.process(queryResponse); } catch (PluginExecutionException e) { LOGGER.info("Error executing PostFederatedQueryPlugin", e); } } } catch (StopProcessingException e) { LOGGER.info("Plugin stopped processing", e); } Set<SourceProcessingDetails> detailsOfResponseAfterPlugins = new HashSet<>(queryResponse.getProcessingDetails()); detailsOfResponseAfterPlugins.addAll(sourceResponse.getProcessingDetails()); return new SourceResponseImpl( queryRequest, sourceResponse.getProperties(), queryResponse.getResults(), queryResponse.getHits(), detailsOfResponseAfterPlugins); }
Source:
public void doRemoveRoles(@QueryParameter(required = true) String type, @QueryParameter(required = true) String roleNames) throws IOException { checkAdminPerm(); RoleMap roleMap = this.roleMaps.get(RoleType.fromString(type)); if (roleMap != null) { String[] split = roleNames.split(","); for (String aSplit : split) { Role role = roleMap.getRole(aSplit); if (role != null) { roleMap.removeRole(role); } } } persistChanges(); }

Target:
public void doRemoveRoles(@QueryParameter(required = true) String type, @QueryParameter(required = true) String roleNames) throws IOException { checkAdminPerm(); RoleMap roleMap = getRoleMap(RoleType.fromString(type)); String[] split = roleNames.split(","); for (String aSplit : split) { Role role = roleMap.getRole(aSplit); if (role != null) { roleMap.removeRole(role); } } persistChanges(); }
Source:
public GeneXref fetchAndCache(String accession, String geneSymbol) throws ResourceMappingException, HttpClientErrorException, ResourceAccessException { boolean saveValue = true; Optional<GeneXref> entrezGeneXrefOptional = null; try { entrezGeneXrefOptional = this.repository.findById(accession); } catch (DataAccessResourceFailureException e) { LOG.warn("Failed to read from Mongo database - falling back on the external web service. " + "Will not attempt to store variant in Mongo database."); saveValue = false; } final boolean saveValueFinal = saveValue; return entrezGeneXrefOptional.map(x -> x).orElseGet(() -> { try { GeneXref entrezGeneXref = this.fetchEntrezGeneXref(accession, geneSymbol); if (saveValueFinal && entrezGeneXref != null) { entrezGeneXref.setEnsemblGeneId(accession); this.repository.save(entrezGeneXref); } return entrezGeneXref; } catch (DataIntegrityViolationException e) { LOG.info(e.getLocalizedMessage()); } catch (ResourceMappingException e) { LOG.info(e.getLocalizedMessage()); } return null; }); }

Target:
public GeneXref fetchAndCache(String accession, String geneSymbol) throws ResourceMappingException, HttpClientErrorException, ResourceAccessException { boolean saveValue = true; Optional<GeneXref> entrezGeneXrefOptional = null; try { entrezGeneXrefOptional = this.repository.findById(accession); } catch (DataAccessResourceFailureException e) { LOG.warn("Failed to read from Mongo database - falling back on the external web service. " + "Will not attempt to store variant in Mongo database."); saveValue = false; } if (!entrezGeneXrefOptional.isPresent()) { try { GeneXref entrezGeneXref = this.fetchEntrezGeneXref(accession, geneSymbol); if (saveValue && entrezGeneXref != null) { entrezGeneXref.setEnsemblGeneId(accession); this.repository.save(entrezGeneXref); } return entrezGeneXref; } catch (DataIntegrityViolationException e) { LOG.info(e.getLocalizedMessage()); } catch (ResourceMappingException e) { LOG.info(e.getLocalizedMessage()); } } try { return entrezGeneXrefOptional.get(); } catch (NoSuchElementException e) { return null; } }
Source:
public void testCleanDirsWithSubmodule() throws Exception { SubmoduleAddCommand command = new SubmoduleAddCommand(db); String path = "sub"; command.setPath(path); String uri = db.getDirectory().toURI().toString(); command.setURI(uri); Repository repo = command.call(); repo.close(); Status beforeCleanStatus = git.status().call(); assertTrue(beforeCleanStatus.getAdded().contains(Constants.DOT_GIT_MODULES)); assertTrue(beforeCleanStatus.getAdded().contains(path)); Set<String> cleanedFiles = git.clean().setCleanDirectories(true) .call(); assertTrue(!cleanedFiles.contains(path + "/")); assertTrue(cleanedFiles.contains("File2.txt")); assertTrue(cleanedFiles.contains("File3.txt")); assertTrue(!cleanedFiles.contains("sub-noclean/File1.txt")); assertTrue(cleanedFiles.contains("sub-noclean/File2.txt")); assertTrue(cleanedFiles.contains("sub-clean/")); assertTrue(cleanedFiles.size() == 4); }

Target:
public void testCleanDirsWithSubmodule() throws Exception { SubmoduleAddCommand command = new SubmoduleAddCommand(db); String path = "sub"; command.setPath(path); String uri = db.getDirectory().toURI().toString(); command.setURI(uri); Repository repo = command.call(); repo.close(); Status beforeCleanStatus = git.status().call(); assertTrue(beforeCleanStatus.getAdded().contains(DOT_GIT_MODULES)); assertTrue(beforeCleanStatus.getAdded().contains(path)); Set<String> cleanedFiles = git.clean().setCleanDirectories(true) .call(); assertTrue(!cleanedFiles.contains(path + "/")); assertTrue(cleanedFiles.contains("File2.txt")); assertTrue(cleanedFiles.contains("File3.txt")); assertTrue(!cleanedFiles.contains("sub-noclean/File1.txt")); assertTrue(cleanedFiles.contains("sub-noclean/File2.txt")); assertTrue(cleanedFiles.contains("sub-clean/")); assertTrue(cleanedFiles.size() == 4); }
Source:
public static Object[][] data() { return new Object[][] { params( KeyContext::asInteger, "foo", 42, "For input string: \"foo\"", InvalidType.class.getName() + " cannot be cast to java.lang.String" ), params( KeyContext::asLong, "bar", 42L, "For input string: \"bar\"", InvalidType.class.getName() + " cannot be cast to java.lang.String" ), params( KeyContext::asBoolean, "foobar", true, "Invalid boolean value: expected either a Boolean, the String 'true' or the String 'false'.", "Invalid boolean value: expected either a Boolean, the String 'true' or the String 'false'." ) }; }

Target:
public static Object[][] data() { return new Object[][] { params( KeyContext::asInteger, "foo", 42, "Invalid Integer value: expected either a Number or a String that can be parsed into an Integer.", "For input string: \"foo\"" ), params( KeyContext::asLong, "bar", 42L, "Invalid Long value: expected either a Number or a String that can be parsed into a Long.", "For input string: \"bar\"" ), params( KeyContext::asBoolean, "foobar", true, "Invalid Boolean value: expected either a Boolean, the String 'true' or the String 'false'.", "" ), params( c -> c.as( MyPropertyType.class, MyPropertyType::new ), MyPropertyType.INVALID_VALUE, new MyPropertyType( "foobar" ), "Invalid value: expected either an instance of '" + MyPropertyType.class.getName() + "' or a String that can be parsed.", MyPropertyType.INVALID_VALUE_ERROR_MESSAGE ) }; }
Source:
public boolean isModifiable(final Object element) { boolean isModifiable = true; if (element instanceof SessionEditorInput) { SessionEditorInput sessionEditorInput = (SessionEditorInput) element; Session session = sessionEditorInput.getSession(); if (session != null) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); URI inputURI = sessionEditorInput.getURI(); URI resourceURI = inputURI.trimFragment(); Resource resource = resourceSet.getResource(resourceURI, false); assert resource != null : "No resource in resourceSet corresponding to " + resourceURI.toString(); String fragment = inputURI.fragment(); if (fragment != null) { EObject intputEObject = resource.getEObject(fragment); IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(resourceSet); isModifiable = intputEObject != null && permissionAuthority.canEditInstance(intputEObject); if (isModifiable && intputEObject instanceof Diagram) { Diagram diagram = (Diagram) intputEObject; EObject diagramElt = diagram.getElement(); isModifiable = permissionAuthority.canEditInstance(diagramElt); } } } } return isModifiable; }

Target:
public boolean isModifiable(final Object element) { boolean isModifiable = true; if (element instanceof SessionEditorInput) { SessionEditorInput sessionEditorInput = (SessionEditorInput) element; Session session = sessionEditorInput.getSession(); if (session != null) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); URI inputURI = sessionEditorInput.getURI(); URI resourceURI = inputURI.trimFragment(); Resource resource = resourceSet.getResource(resourceURI, false); if (resource == null) { SiriusDiagramEditorPlugin.getInstance().logError("No resource in resourceSet corresponding to " + resourceURI.toString()); } else { String fragment = inputURI.fragment(); if (fragment != null) { EObject intputEObject = resource.getEObject(fragment); IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(resourceSet); isModifiable = intputEObject != null && permissionAuthority.canEditInstance(intputEObject); if (isModifiable && intputEObject instanceof Diagram) { Diagram diagram = (Diagram) intputEObject; EObject diagramElt = diagram.getElement(); isModifiable = permissionAuthority.canEditInstance(diagramElt); } } } } } return isModifiable; }
Source:
public Map<String, Object> parse(List<String> args) throws Exception { List<String> others = new ArrayList<>(); Map<String, Object> argMap = new HashMap<>(); args.addAll(defaults); while(!args.isEmpty()) { String arg = args.remove(0); if(arg.equals(LONG_PREFIX)) { break; } if(!arg.startsWith(LONG_PREFIX)) { others.add(arg); break; } String[] argVal = parseArgument(arg.substring(2)); ParserArgument parserArgument = arguments.get(argVal[0]); if(parserArgument == null) { throw new IllegalArgumentException( String.format("Argument %1$s is not valid", arg) ); } if(parserArgument.getType() == ArgumentType.required_argument && argVal[1] == null) { throw new IllegalArgumentException( String.format("Argument's '%1$s' value is required", argVal[0]) ); } Matcher m = parserArgument.getMatcher().matcher(argVal[1]); if (!m.find()) { throw new IllegalArgumentException( String.format( "Argument's '%1$s' value don't match pattern: ", parserArgument.getMatcher().pattern() ) ); } if(!argMap.containsKey(argVal[0])) { argMap.put( argVal[0], Util.getObjectValueByString(parserArgument.getConvert(), argVal[1]) ); } } mandatory.removeAll(argMap.keySet()); if(!mandatory.isEmpty()) { throw new IllegalArgumentException( String.format("Argument(s) '%1$s' required", StringUtils.join(mandatory, ", ")) ); } others.addAll(args); argMap.put("__other__", others); return argMap; }

Target:
public Map<String, Object> parse(List<String> args) throws Exception { List<Object> others = new ArrayList<>(); Map<String, Object> argMap = new HashMap<>(); args.addAll(defaults); while(!args.isEmpty()) { String arg = args.remove(0); if(arg.equals(LONG_PREFIX)) { break; } if(!arg.startsWith(LONG_PREFIX)) { others.add(arg); break; } String[] argVal = parseArgument(arg.substring(2)); String key = argVal[0]; String value = argVal[1]; ParserArgument parserArgument = arguments.get(key); if(parserArgument == null) { throw new IllegalArgumentException( String.format("Argument %1$s is not valid", arg) ); } if ( value == null && parserArgument.getType() == ArgumentType.optional_argument || parserArgument.getType() == ArgumentType.required_argument ) { value = args.remove(0); if(value.equals(LONG_PREFIX)) { break; } } if(parserArgument.getType() == ArgumentType.required_argument && value == null) { throw new IllegalArgumentException( String.format("Argument's '%1$s' value is required", key) ); } Matcher m = parserArgument.getMatcher().matcher(value); if (!m.find()) { throw new IllegalArgumentException( String.format( "Argument's '%1$s' value don't match pattern: ", m.pattern() ) ); } Object convertedValue = Util.getObjectValueByString(parserArgument.getConvert(), value); if(!argMap.containsKey(key)) { argMap.put(key, convertedValue); } else { List<Object> objects = new ArrayList<>(); objects.add(argMap.get(key)); objects.add(convertedValue); argMap.put(key, objects); } } mandatory.removeAll(argMap.keySet()); if(!mandatory.isEmpty()) { throw new IllegalArgumentException( String.format("Argument(s) '%1$s' required", StringUtils.join(mandatory, ", ")) ); } others.addAll(args); argMap.put("__other__", others); return argMap; }
Source:
void session_does_not_check_for_strict_stubs_on_test_failure() { TestExecutionResult result = invokeTestClassAndRetrieveMethodResult(StrictStubsNotReportedOnTestFailure.class); assertThat(result.getStatus()).isEqualTo(TestExecutionResult.Status.FAILED); Throwable throwable = result.getThrowable().get(); assertThat(throwable).isInstanceOf(AssertionError.class); assertThat(throwable.getSuppressed()).isEmpty(); }

Target:
void session_does_not_check_for_strict_stubs_on_test_failure() { TestExecutionResult result = invokeTestClassAndRetrieveMethodResult(StrictStubsNotReportedOnTestFailure.class); assertThat(result.getStatus()).isEqualTo(TestExecutionResult.Status.FAILED); Throwable throwable = result.getThrowable().get(); assertThat(throwable).isInstanceOf(MyAssertionError.class); assertThat(throwable.getSuppressed()).isEmpty(); }
Source:
public List<ComponentTag> getFreeComponentTags( @PathParam("id") @RequiredParam String componentId) { Component componentExample = new Component(); componentExample.setComponentId(componentId); List<Component> components = componentExample.findByExample(); if (!components.isEmpty()) { List<ComponentTag> componentTags = service.getComponentService().getComponentDetails(componentId).getTags(); List<ComponentTag> allTags = service.getComponentService().getTagCloud(); List<ComponentTag> filteredTags = new ArrayList<>(); for (ComponentTag tag : allTags) { boolean pass = true; for (ComponentTag myTag : componentTags) { if (myTag.getText().toLowerCase().equals(tag.getText().toLowerCase())) { pass = false; break; } } if (pass) { filteredTags.add(tag); } } return filteredTags; } else { return service.getComponentService().getTagCloud(); } }

Target:
public List<ComponentTag> getFreeComponentTags( @PathParam("id") @RequiredParam String componentId) { Component componentExample = new Component(); componentExample.setComponentId(componentId); Component component = componentExample.find(); if (component != null) { ComponentTag componentTagExample = new ComponentTag(); componentTagExample.setComponentId(componentId); List<ComponentTag> componentTags = componentTagExample.findByExample(); List<ComponentTag> allTags = service.getComponentService().getTagCloud(); List<ComponentTag> filteredTags = new ArrayList<>(); for (ComponentTag tag : allTags) { boolean pass = true; for (ComponentTag myTag : componentTags) { if (myTag.getText().toLowerCase().equals(tag.getText().toLowerCase())) { pass = false; break; } } if (pass) { filteredTags.add(tag); } } return filteredTags; } else { return service.getComponentService().getTagCloud(); } }
Source:
public BlockStem(Material plantType) { if (plantType.equals(Material.MELON_STEM)) { fruitType = Material.MELON_BLOCK; seedsType = Material.MELON_SEEDS; } else if (plantType.equals(Material.PUMPKIN_STEM)) { fruitType = Material.PUMPKIN; seedsType = Material.PUMPKIN_SEEDS; } }

Target:
public BlockStem(Material plantType) { if (plantType == Material.MELON_STEM) { fruitType = Material.MELON_BLOCK; seedsType = Material.MELON_SEEDS; } else if (plantType == Material.PUMPKIN_STEM) { fruitType = Material.PUMPKIN; seedsType = Material.PUMPKIN_SEEDS; } else throw new IllegalArgumentException("Invalid plant material " + plantType.name() + " for BlockStem"); }
Source:
public static String getSamples() throws RuntimeException { Configuration conf = new Configuration(); Class klass = conf.getClass(); klass.getDeclaredMethods(); StringBuilder b = new StringBuilder(); b.append("Configuration examples:\n"); b.append("\n"); String sample = conf.getXMLRepresentationAsString(); b.append("<!-- Sample empty configuration.xml -->\n"); b.append(sample); b.append("\n"); List<Method> mthds = getSetters(klass); for (Method mthd : mthds) { conf = new Configuration(); Object defaultValue = getDefaultValue(klass, mthd, conf); conf = new Configuration(); Object sampleValue = getSampleValue(mthd, defaultValue); if (sampleValue == null) continue; try { mthd.invoke(conf, sampleValue); } catch (IllegalAccessException|IllegalArgumentException| InvocationTargetException ex) { throw new RuntimeException("error setting sample value for " + mthd); } sample = conf.getXMLRepresentationAsString(); sample = sample.replaceFirst( "(?sx)^<\\?xml.*Configuration\\d*\">\\n", ""); sample = sample.replaceFirst("</object>\\n</java>", ""); b.append(" <!-- Sample for "); b.append(mthd.getName()); b.append(". Default is: "); b.append(defaultValue); b.append(" -->"); b.append("\n"); b.append(sample); } return b.toString(); }

Target:
public static String getSamples() throws RuntimeException { Configuration conf = new Configuration(); Class klass = conf.getClass(); StringBuilder b = new StringBuilder(); b.append("Configuration examples:\n"); b.append("\n"); String sample = conf.getXMLRepresentationAsString(); b.append("<!-- Sample empty configuration.xml -->\n"); b.append(sample); b.append("\n"); List<Method> mthds = getSetters(klass); for (Method mthd : mthds) { conf = new Configuration(); Object defaultValue = getDefaultValue(klass, mthd, conf); conf = new Configuration(); Object sampleValue = getSampleValue(mthd, defaultValue); if (sampleValue == null) continue; try { mthd.invoke(conf, sampleValue); } catch (IllegalAccessException|IllegalArgumentException| InvocationTargetException ex) { throw new RuntimeException("error setting sample value for " + mthd); } sample = conf.getXMLRepresentationAsString(); sample = sample.replaceFirst( "(?sx)^<\\?xml.*Configuration\\d*\">\\n", ""); sample = sample.replaceFirst("</object>\\n</java>", ""); b.append(" <!-- Sample for "); b.append(mthd.getName()); b.append(". Default is: "); b.append(defaultValue); b.append(" -->"); b.append("\n"); b.append(sample); } return b.toString(); }
Source:
public HttpResponse doClear() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); LOGGER.info("Called clearing..."); clear(); return HttpResponses.redirectViaContextPath("/manage"); }

Target:
public HttpResponse doClear() throws IOException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); clear(); return HttpResponses.redirectViaContextPath("/manage"); }
Source:
public void tick() { if (hurtTime <= 0 && TitleMenu.difficulty.difficultyName != MojamComponent.texts.getStatic("diffselect.nightmare")) { if (health < maxHealth) { if (--healingTime <= 0) { ++health; healingTime = HEALING_INTERVAL; } } } if (hurtTime > 0) { hurtTime--; } if (bounceWallTime > 0) { bounceWallTime--; } if (freezeTime > 0) { slideMove(xSlide, ySlide); xSlide *= 0.8; ySlide *= 0.8; if (xBump != 0 || yBump != 0) { move(xBump, yBump); } freezeTime--; return; } else { xSlide = ySlide = 0; if (health <= 0) { die(); remove(); return; } } }

Target:
public void tick() { if (hurtTime > 0) { hurtTime--; } if (bounceWallTime > 0) { bounceWallTime--; } if (freezeTime > 0) { slideMove(xSlide, ySlide); xSlide *= 0.8; ySlide *= 0.8; if (xBump != 0 || yBump != 0) { move(xBump, yBump); } freezeTime--; return; } else { xSlide = ySlide = 0; if (health <= 0) { die(); remove(); return; } } }
Source:
public void testNetworksConnectContainerShouldFailIfContainerNotRunning() throws Exception { assumeTrue("Docker API should be at least v1.21 to support Container Creation with " + "HostConfig, got " + sut.version().apiVersion(), compareVersion(sut.version().apiVersion(), "1.21") >= 0); assumeFalse(CIRCLECI); final String networkName = randomName(); final String containerName = randomName(); final NetworkCreation networkCreation = sut.createNetwork(NetworkConfig.builder().name(networkName).build()); assertThat(networkCreation.id(), is(notNullValue())); final ContainerConfig containerConfig = ContainerConfig.builder().image(BUSYBOX_LATEST).cmd("sh", "-c", "echo hello").build(); final ContainerCreation containerCreation = sut.createContainer(containerConfig, containerName); assertThat(containerCreation.id(), is(notNullValue())); try { sut.connectToNetwork(containerCreation.id(), networkCreation.id()); fail("Expected to throw DockerException"); } catch (DockerException e) { assertThat(e.getMessage(), containsString("is not running")); } finally { sut.removeContainer(containerCreation.id()); sut.removeNetwork(networkCreation.id()); } }

Target:
public void testNetworksConnectContainerShouldFailIfContainerNotRunning() throws Exception { assumeTrue("Docker API should be at least v1.21 to support Container Creation with " + "HostConfig, got " + sut.version().apiVersion(), compareVersion(sut.version().apiVersion(), "1.21") >= 0); assumeFalse(CIRCLECI); final String networkName = randomName(); final String containerName = randomName(); final NetworkCreation networkCreation = sut.createNetwork(NetworkConfig.builder().name(networkName).build()); assertThat(networkCreation.id(), is(notNullValue())); final ContainerConfig containerConfig = ContainerConfig.builder().image(BUSYBOX_LATEST).cmd("sh", "-c", "echo hello").build(); final ContainerCreation containerCreation = sut.createContainer(containerConfig, containerName); assertThat(containerCreation.id(), is(notNullValue())); try { exception.expect(DockerException.class); sut.connectToNetwork(containerCreation.id(), networkCreation.id()); } finally { sut.removeContainer(containerCreation.id()); sut.removeNetwork(networkCreation.id()); } }
Source:
public AbstractFileSystem(IConfiguration configuration, BackupMetrics backupMetrics, BackupNotificationMgr backupNotificationMgr) { this.backupMetrics = backupMetrics; this.addObserver(backupNotificationMgr); tasksQueued = new HashSet<>(configuration.getBackupQueueSize()); BlockingQueue<Runnable> uploadQueue = new ArrayBlockingQueue<>(configuration.getBackupQueueSize()); PolledMeter.using(backupMetrics.getRegistry()).withName(backupMetrics.uploadQueueSize).monitorSize(uploadQueue); this.fileUploadExecutor = new BlockingSubmitThreadPoolExecutor(configuration.getBackupThreads(), uploadQueue, configuration.getUploadTimeout()); BlockingQueue<Runnable> downloadQueue = new ArrayBlockingQueue<>(configuration.getDownloadQueueSize()); PolledMeter.using(backupMetrics.getRegistry()).withName(backupMetrics.downloadQueueSize).monitorSize(downloadQueue); this.fileDownloadExecutor = new BlockingSubmitThreadPoolExecutor(configuration.getRestoreThreads(), downloadQueue, configuration.getDownloadTimeout()); }

Target:
public AbstractFileSystem(IConfiguration configuration, BackupMetrics backupMetrics, BackupNotificationMgr backupNotificationMgr) { this.backupMetrics = backupMetrics; this.addObserver(backupNotificationMgr); tasksQueued = new ConcurrentHashMap<>().newKeySet(); BlockingQueue<Runnable> uploadQueue = new ArrayBlockingQueue<>(configuration.getBackupQueueSize()); PolledMeter.using(backupMetrics.getRegistry()).withName(backupMetrics.uploadQueueSize).monitorSize(uploadQueue); this.fileUploadExecutor = new BlockingSubmitThreadPoolExecutor(configuration.getBackupThreads(), uploadQueue, configuration.getUploadTimeout()); BlockingQueue<Runnable> downloadQueue = new ArrayBlockingQueue<>(configuration.getDownloadQueueSize()); PolledMeter.using(backupMetrics.getRegistry()).withName(backupMetrics.downloadQueueSize).monitorSize(downloadQueue); this.fileDownloadExecutor = new BlockingSubmitThreadPoolExecutor(configuration.getRestoreThreads(), downloadQueue, configuration.getDownloadTimeout()); }
Source:
private TarArchive getApplicationContent(Owner owner, Libraries libraries) { File jarFile = getJarFile(); ImagePackager packager = getConfiguredPackager(() -> new ImagePackager(jarFile)); if (jarFile.exists()) { return TarArchive.fromZip(jarFile, owner); } return new PackagedTarArchive(owner, libraries, packager); }

Target:
private TarArchive getApplicationContent(Owner owner, Libraries libraries) { File jarFile = getJarFile(); if (jarFile.exists()) { return TarArchive.fromZip(jarFile, owner); } ImagePackager packager = getConfiguredPackager(() -> new ImagePackager(jarFile)); return new PackagedTarArchive(owner, libraries, packager); }
Source:
public Exception staleMessageValidator() { String fromState = _message.getFromState(); String toState = _message.getToState(); String partitionName = _message.getPartitionName(); String state = _currentStateDelta.getState(partitionName); Exception err = null; if (toState.equalsIgnoreCase(state)) { err = new HelixDuplicatedStateTransitionException(String .format("Partition %s current state is same as toState (%s->%s) from message.", partitionName, fromState, toState)); } else if (fromState != null && !fromState.equals("*") && !fromState.equalsIgnoreCase(state)) { err = new HelixStateMismatchException(String.format( "Current state of stateModel does not match the fromState in Message, CurrentState: %s, Message: %s->%s, Partition: %s, from: %s, to: %s", state, fromState, toState, partitionName, _message.getMsgSrc(), _message.getTgtName())); } return err; }

Target:
public StaleMessageValidateResult staleMessageValidator() { String fromState = _message.getFromState(); String toState = _message.getToState(); String partitionName = _message.getPartitionName(); String state = _currentStateDelta.getState(partitionName); Exception err = null; if (toState.equalsIgnoreCase(state)) { err = new HelixDuplicatedStateTransitionException(String .format("Partition %s current state is same as toState (%s->%s) from message.", partitionName, fromState, toState)); } else if (fromState != null && !fromState.equals("*") && !fromState.equalsIgnoreCase(state)) { err = new HelixStateMismatchException(String.format( "Current state of stateModel does not match the fromState in Message, CurrentState: %s, Message: %s->%s, Partition: %s, from: %s, to: %s", state, fromState, toState, partitionName, _message.getMsgSrc(), _message.getTgtName())); } return new StaleMessageValidateResult(err); }
Source:
private Union createNewUnion(ByteBuffer buf, int position, boolean isWrapped) { NativeMemory nm = getNativeMemory(buf); Memory mem = new MemoryRegion(nm, position, maxIntermediateSize); Union union = isWrapped ? (Union) SetOperation.wrap(mem) : (Union) SetOperation.builder().initMemory(mem).build(size, Family.UNION); Int2ObjectMap<Union> unionMap = unions.get(buf); if (unionMap == null) { unionMap = new Int2ObjectOpenHashMap<>(); } unionMap.put(position, union); unions.put(buf, unionMap); return union; }

Target:
private Union createNewUnion(ByteBuffer buf, int position, boolean isWrapped) { NativeMemory nm = getNativeMemory(buf); Memory mem = new MemoryRegion(nm, position, maxIntermediateSize); Union union = isWrapped ? (Union) SetOperation.wrap(mem) : (Union) SetOperation.builder().initMemory(mem).build(size, Family.UNION); Int2ObjectMap<Union> unionMap = unions.get(buf); if (unionMap == null) { unionMap = new Int2ObjectOpenHashMap<>(); unions.put(buf, unionMap); } unionMap.put(position, union); return union; }
Source:
public static void verifyTrainingData() throws Exception { verifyTrainingData(createNameSampleStream(), new BigInteger("168206908604555450993491898907821588182")); }

Target:
public static void verifyTrainingData() throws Exception { verifyDirectoryChecksum(new File(getOpennlpDataDir(), "ontonotes4/data/files/data/english").toPath(), ".name", new BigInteger("74675117716526375898817028829433420680")); }
Source:
public void testValidTimeRange_onlyStartTimePassed() throws Exception { String args = {"--deleteall", "--starttime", "10"}; runIndexTool(args, 0); Assert.assertEquals(0, countRowsInIndex()); }

Target:
public void testValidTimeRange_onlyStartTimePassed() throws Exception { String args = {"--deleteall", "--starttime", "8"}; runIndexTool(args, 0); Assert.assertEquals(1, countRowsInIndex()); }
Source:
public void testCfEqualityChecker() throws TException { CassandraKeyValueServiceImpl kvs; if (keyValueService instanceof CassandraKeyValueService) { kvs = getUnderlyingKvs(keyValueService); } else if (keyValueService instanceof TableSplittingKeyValueService) { KeyValueService delegate = ((TableSplittingKeyValueService) keyValueService).getDelegate(NEVER_SEEN); assertThat(delegate instanceof CassandraKeyValueService) .isTrue(); kvs = (CassandraKeyValueServiceImpl) delegate; } else { throw getUnrecognizedKeyValueServiceException(); } kvs.createTable(NEVER_SEEN, getMetadata()); List<CfDef> knownCfs = kvs.getClientPool().runWithRetry(client -> client.describe_keyspace(CASSANDRA.getConfig().getKeyspaceOrThrow()).getCf_defs()); CfDef clusterSideCf = Iterables.getOnlyElement(knownCfs.stream() .filter(cf -> cf.getName().equals(getInternalTestTableName())) .collect(Collectors.toList())); assertThat( ColumnFamilyDefinitions.isMatchingCf( kvs.getCfForTable(NEVER_SEEN, getMetadata(), FOUR_DAYS_IN_SECONDS), clusterSideCf)) .isTrue(); }

Target:
public void testCfEqualityChecker() throws TException { CassandraKeyValueServiceImpl kvs; if (keyValueService instanceof CassandraKeyValueService) { kvs = getUnderlyingKvs(keyValueService); } else if (keyValueService instanceof TableSplittingKeyValueService) { KeyValueService delegate = ((TableSplittingKeyValueService) keyValueService).getDelegate(NEVER_SEEN); assertThat(delegate) .as("The nesting of Key Value Services has apparently changed") .isInstanceOf(CassandraKeyValueService.class); kvs = (CassandraKeyValueServiceImpl) delegate; } else { throw getUnrecognizedKeyValueServiceException(); } kvs.createTable(NEVER_SEEN, getMetadata()); List<CfDef> knownCfs = kvs.getClientPool().runWithRetry(client -> client.describe_keyspace(CASSANDRA.getConfig().getKeyspaceOrThrow()).getCf_defs()); CfDef clusterSideCf = Iterables.getOnlyElement(knownCfs.stream() .filter(cf -> cf.getName().equals(getInternalTestTableName())) .collect(Collectors.toList())); assertThat( ColumnFamilyDefinitions.isMatchingCf( kvs.getCfForTable(NEVER_SEEN, getMetadata(), FOUR_DAYS_IN_SECONDS), clusterSideCf)) .as("After serialization and deserialization to database, Cf metadata did not match.") .isTrue(); }
Source:
public BronKerboschCliqueFinder(Graph<V> graph, long timeout, TimeUnit unit) { this.graph = Objects.requireNonNull(graph, "Graph cannot be null"); if (timeout == 0L) { this.nanos = Long.MAX_VALUE; } else { this.nanos = unit.toNanos(timeout); } if (this.nanos < 1L) { throw new IllegalArgumentException("Invalid timeout, must be positive"); } this.timeLimitReached = false; }

Target:
public BronKerboschCliqueFinder(Graph<V> graph, long timeout, TimeUnit unit) { this.graph = requireNonNull(graph, "Graph cannot be null"); if (timeout < 1L) { throw new IllegalArgumentException("Invalid timeout, must be positive!"); } this.nanos = unit.toNanos(timeout); }
Source:
public void run() { try { permits.acquire(); run(batch); } catch (Exception e) { permits.release(); log.error("Aggregation will be aborted due to an unexpected error", e); taskTracker.abort("Aborting aggregation due to an unexpected error: " + e.getMessage()); } }

Target:
public void run() { try { run(batch); } catch (Exception e) { log.error("Aggregation will be aborted due to an unexpected error", e); taskTracker.abort("Aborting aggregation due to an unexpected error: " + e.getMessage()); } }
Source:
public String getOriginalContent() { return this.nameplateContent; }

Target:
public String getOriginalContent() { return this.originalContent; }
Source:
private RestoreResult restoreAllRepositories() { final RestoreResult.Builder builder = RestoreResult.create(); final RepositoryIds existingRepositoryIds = getRepositories( true ); RepositoryIds currentRepositoryIds = null; try { closeIndices( existingRepositoryIds ); while ( !clusterManager.isHealthy() ) { Thread.sleep( 1000l ); } addResult( builder, doRestoreRepo( SystemConstants.SYSTEM_REPO.getId() ) ); openIndices( RepositoryIds.from( SystemConstants.SYSTEM_REPO.getId() ) ); currentRepositoryIds = getRepositories( false ); closeIndices( currentRepositoryIds ); currentRepositoryIds.forEach( ( repo ) -> addResult( builder, doRestoreRepo( repo ) ) ); return builder.build(); } catch ( InterruptedException e ) { throw Exceptions.unchecked( e ); } finally { openIndices( existingRepositoryIds ); openIndices( currentRepositoryIds ); } }

Target:
private RestoreResult restoreAllRepositories() { final RepositoryIds repositoryIds = getRepositories( true ); try { closeIndices( repositoryIds ); while ( clusterManager.isHealthy() ) { LOG.info( "Waiting for cluster providers to be deactivated to initiate restore" ); Thread.sleep( 1000l ); } return doRestoreIndices( Collections.emptySet() ); } catch ( InterruptedException e ) { throw Exceptions.unchecked( e ); } finally { openIndices( repositoryIds ); } }
Source:
public static void setNodeValue(NodeType node, String name, String value) { ElementParameterType property = getNodeProperty(node, name); if (property != null) { property.setValue(value); } }

Target:
public static void setNodeValue(NodeType node, String name, String value) { ElementParameterType property = getNodeProperty(node, name); if (property == null) { throw new IllegalArgumentException( "The component node "+node.getComponentName()+" doesn't have the property "+name ); } property.setValue(value); }
Source:
public void onPlayerTick(PlayerTickEvent evt) { if (evt.phase == Phase.START) { EntityPlayer player = evt.player; ItemStack boots = player.inventory.armorInventory.get(0); boolean hasBoots = !boots.isEmpty() && boots.getItem() == ELYTRA_BOOTS; IAttributeInstance elytraFlight = evt.player.getAttributeMap().getAttributeInstance(EntityPlayer.ELYTRA_FLIGHT); if (elytraFlight != null) { AttributeModifier mod = elytraFlight.getModifier(UUID_ELYTRA_BOOTS); if (mod != null) elytraFlight.removeModifier(mod); if (hasBoots) elytraFlight.applyModifier(new AttributeModifier( UUID_ELYTRA_BOOTS, "elytra_flight_boots", 1.0D, 0)); } } }

Target:
public void onPlayerTick(PlayerTickEvent evt) { if (evt.phase == Phase.START) { EntityPlayer player = evt.player; ItemStack boots = player.inventory.armorInventory.get(0); boolean hasBoots = !boots.isEmpty() && boots.getItem() == ELYTRA_BOOTS; IAttributeInstance elytraFlight = evt.player.getAttributeMap().getAttributeInstance(EntityPlayer.ELYTRA_FLIGHT); if (elytraFlight != null) { AttributeModifier mod = elytraFlight.getModifier(UUID_ELYTRA_BOOTS); if (mod != null) elytraFlight.removeModifier(mod); if (hasBoots) { elytraFlight.applyModifier(new AttributeModifier(UUID_ELYTRA_BOOTS, "elytra_flight_boots", 1.0D, 0)); if (player.ticksExisted % 20 == 0 && player.isElytraFlying()) { boots.damageItem(1, player); } } } } }
Source:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.isEmpty()) { return ""; } StringBuilder fragments = new StringBuilder(); Map<String, List<Integer>> optionRanks = generateOptionRanksMapping(responses); DecimalFormat df = new DecimalFormat("#.##"); for (Entry<String, List<Integer>> entry : optionRanks.entrySet()) { String option = Sanitizer.sanitizeForCsv(entry.getKey()); List<Integer> ranksAssigned = entry.getValue(); double average = computeAverage(ranksAssigned); fragments.append(option).append(',').append(df.format(average)).append(Const.EOL); } return "Option" + ", Average Rank" + Const.EOL + fragments.toString() + Const.EOL; }

Target:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.isEmpty()) { return ""; } StringBuilder fragments = new StringBuilder(); Map<String, List<Integer>> optionRanks = generateOptionRanksMapping(responses); DecimalFormat df = new DecimalFormat("#.##"); for (Entry<String, List<Integer>> entry : optionRanks.entrySet()) { String option = Sanitizer.sanitizeForCsv(entry.getKey()); List<Integer> ranksAssigned = entry.getValue(); double average = computeAverage(ranksAssigned); String fragment = option + "," + df.format(average) + Const.EOL; fragments.append(fragment); } return "Option, Average Rank" + Const.EOL + fragments.toString() + Const.EOL; }
Source:
protected void fillThreadSummary(final IPropertiesUpdate update, final RequestMonitor rm) { if (!fHideRunningThreadsProperty) { update.setProperty(IGdbLaunchVMConstants.PROP_THREAD_SUMMARY, null); rm.done(); return; } IProcesses processService = getServicesTracker().getService(IProcesses.class); final IContainerDMContext procDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IContainerDMContext.class); if (processService == null || procDmc == null) { update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Service or handle invalid", null)); } else { processService.getProcessesBeingDebugged( procDmc, new ViewerDataRequestMonitor<IDMContext[]>(getSession().getExecutor(), update) { @Override public void handleCompleted() { IRunControl runControl = getServicesTracker().getService(IRunControl.class); if (!isSuccess() || !(getData() instanceof IExecutionDMContext[]) || runControl == null) { update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Unable to get threads summary", null)); rm.done(); return; } int runningCount = 0; for (IExecutionDMContext execDmc : (IExecutionDMContext[])getData()) { if (!runControl.isSuspended(execDmc) && !runControl.isStepping(execDmc)) { runningCount++; } } update.setProperty(IGdbLaunchVMConstants.PROP_THREAD_SUMMARY, "(" + runningCount + " filtered running threads)"); rm.done(); } }); } }

Target:
protected void fillThreadSummary(final IPropertiesUpdate update, final RequestMonitor rm) { if (!fHideRunningThreadsProperty) { update.setProperty(IGdbLaunchVMConstants.PROP_THREAD_SUMMARY, null); rm.done(); return; } IProcesses processService = getServicesTracker().getService(IProcesses.class); final IContainerDMContext procDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IContainerDMContext.class); if (processService == null || procDmc == null) { update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Service or handle invalid", null)); } else { processService.getProcessesBeingDebugged( procDmc, new ViewerDataRequestMonitor<IDMContext[]>(getSession().getExecutor(), update) { @Override public void handleCompleted() { IRunControl runControl = getServicesTracker().getService(IRunControl.class); if (!isSuccess() || !(getData() instanceof IExecutionDMContext[]) || runControl == null) { update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Unable to get threads summary", null)); rm.done(); return; } int runningCount = 0; for (IExecutionDMContext execDmc : (IExecutionDMContext[])getData()) { if (!runControl.isSuspended(execDmc) && !runControl.isStepping(execDmc)) { runningCount++; } } update.setProperty(IGdbLaunchVMConstants.PROP_THREAD_SUMMARY, String.format("(%d %s)", runningCount, MessagesForGdbLaunchVM.ContainerVMNode_filtered_running_threads)); rm.done(); } }); } }
Source:
private static String getManifestAttributeValue(Attributes headers, String attributeName, File manifestFile) throws IOException { String location = headers.getValue("Bundle-Localization"); if (location == null || location.isEmpty()) { location = "OSGI-INF/l10n/bundle.properties"; } String rawValue = headers.getValue(attributeName); if (rawValue != null && !rawValue.isEmpty()) { if (rawValue.startsWith("%")) { String key = rawValue.substring(1); File l10nFile = new File(manifestFile.getParentFile().getParentFile(), location + ".properties"); if (l10nFile.exists()) { Properties properties = new Properties(); try (InputStream stream = new FileInputStream(l10nFile)) { properties.load(stream); } String translation = properties.getProperty(key); if (translation != null && !translation.isEmpty()) { return translation; } } return key; } return rawValue; } return null; }

Target:
private static String getManifestAttributeValue(Attributes headers, String attributeName, File manifestFile) throws IOException { String location = headers.getValue("Bundle-Localization"); if (location == null || location.isEmpty()) { location = "OSGI-INF/l10n/bundle"; } String rawValue = headers.getValue(attributeName); if (rawValue != null && !rawValue.isEmpty()) { if (rawValue.startsWith("%")) { String key = rawValue.substring(1); File l10nFile = new File(manifestFile.getParentFile().getParentFile(), location + ".properties"); if (l10nFile.exists()) { Properties properties = new Properties(); try (InputStream stream = new FileInputStream(l10nFile)) { properties.load(stream); } String translation = properties.getProperty(key); if (translation != null && !translation.isEmpty()) { return translation; } } return key; } return rawValue; } return null; }
Source:
public JsonItemParser<EnrichmentTagItem> enrichmentTagItemParser() { JsonItemParser<EnrichmentTagItem> sourceScJudgmentParser = new JsonItemParser<>(EnrichmentTagItem.class); sourceScJudgmentParser.setCommonValidator(commonValidator); sourceScJudgmentParser.setJsonFactory(jsonFactory); return sourceScJudgmentParser; }

Target:
public JsonItemParser<EnrichmentTagItem> enrichmentTagItemParser() { JsonItemParser<EnrichmentTagItem> enrichmentTagItemParser = new JsonItemParser<>(EnrichmentTagItem.class); enrichmentTagItemParser.setCommonValidator(commonValidator); enrichmentTagItemParser.setJsonFactory(jsonFactory); return enrichmentTagItemParser; }
Source:
public ProcessRecordsInput getNextResult() { if (!started) { start(); } ProcessRecordsInput result = null; try { result = getRecordsResultQueue.take(); result.withCacheExitTime(Instant.now()); prefetchCounters.removed(result); } catch (InterruptedException e) { log.error("Interrupted while getting records from the cache", e); } return result; }

Target:
public ProcessRecordsInput getNextResult() { if (!started) { throw new IllegalStateException("Threadpool in the cache was not started, make sure to call start on the cache"); } ProcessRecordsInput result = null; try { result = getRecordsResultQueue.take().withCacheExitTime(Instant.now()); prefetchCounters.removed(result); } catch (InterruptedException e) { log.error("Interrupted while getting records from the cache", e); } return result; }