auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private double sum(final int[] values) { final int length = values.length; double total = 0; for (int i = 0; i < length; ++i) { total += values[i]; } return total; }

Target:
private double sum(final int[] values) { final int length = values.length; double total = 0; for (int i = 0; i < length; i++) { total += values[i]; } return total; }
Source:
public void testOnlyInternalScriptContainsAPIBinding() throws InvalidScriptException { Script s = scriptWithApiBindingGlobal(); Script s2 = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithoutApiBinding(); Mockito.when(etd.getInternal()).thenReturn(ist); Mockito.when(ist.getPreScript()).thenReturn(s2); Mockito.when(ist.getPostScript()).thenReturn(s2); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s2); Mockito.when(it.getFlowScript()).thenReturn(fs); Boolean result = new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd); assertEquals(true, result); }

Target:
public void testOnlyInternalScriptContainsAPIBinding() throws InvalidScriptException { Script s = scriptWithApiBindingGlobal(); Script s2 = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithoutApiBinding(); Mockito.when(etd.getInternal()).thenReturn(ist); Mockito.when(ist.getPreScript()).thenReturn(s2); Mockito.when(ist.getPostScript()).thenReturn(s2); Mockito.when(sec.getScript()).thenReturn(s); Mockito.when(fe.getEnvScript()).thenReturn(s2); Mockito.when(it.getFlowScript()).thenReturn(fs); assertTrue(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd)); }
Source:
public void adsLeaderboardOnPageWithInfobox(String wikiName, String article, String adUnit) { String testedPage = urlBuilder.getUrlForPath(wikiName, article); MobileAdsBaseObject ads = new MobileAdsBaseObject(driver, testedPage); ads.verifyGptIframe(adUnit, MOBILE_TOP_LEADERBOARD, SRC); Point leaderboardLocation = driver.findElement(By.id(MOBILE_TOP_LEADERBOARD)).getLocation(); Point infoboxLocation = driver.findElement(By.className("portable-infobox")).getLocation(); Assertion.assertTrue(leaderboardLocation.getY() > infoboxLocation.getY()); }

Target:
public void adsLeaderboardOnPageWithInfobox(String wikiName, String article, String adUnit) { String testedPage = urlBuilder.getUrlForPath(wikiName, article); MobileAdsBaseObject ads = new MobileAdsBaseObject(driver, testedPage); PortableInfobox infobox = new PortableInfobox(); ads.verifyGptIframe(adUnit, MOBILE_TOP_LEADERBOARD, SRC); Assertion.assertTrue( ads.getElementTopPositionByCssSelector(AdsContent.getSlotSelector(AdsContent.MOBILETOP_LB)) >= infobox.getElementBottomPositionByCssSelector(PORTABLE_INFOBOX) ); }
Source:
public void addContents(@NonNull Container container) { Jenkins jenkins = Jenkins.getInstance(); if(jenkins != null) { File configFile = new File(jenkins.getRootDir(), "config.xml"); if (configFile.exists()) { try { File patchedXmlFile = SecretHandler.findSecrets(configFile); container.add(new FileContent("jenkins-root-configuration-files/" + configFile.getName(), patchedXmlFile)); } catch (Exception e) { logger.log(Level.WARNING, "could not add the {0} configuration file to the support bundle because of: {1}", new Object[]{configFile.getName(), e}); } } } }

Target:
public void addContents(@NonNull Container container) { Jenkins jenkins = Helper.getActiveInstance(); File configFile = new File(jenkins.getRootDir(), "config.xml"); if (configFile.exists()) { File patchedXmlFile = null; try { patchedXmlFile = SecretHandler.findSecrets(configFile); container.add(new FileContent("jenkins-root-configuration-files/" + configFile.getName(), patchedXmlFile)); } catch (IOException | ParserConfigurationException | XMLStreamException | SAXException | TransformerException e) { LOGGER.log(Level.WARNING, "could not add the {0} configuration file to the support bundle because of: {1}", new Object[]{configFile.getName(), e}); } finally { if (patchedXmlFile != null) { if(!patchedXmlFile.delete()) { LOGGER.log(Level.WARNING, "Failed to delete tmp file {0}", new Object[]{ patchedXmlFile.getPath() }); } } } } else { LOGGER.log(Level.WARNING, "Jenkins global config file does not exist."); } }
Source:
void touchProjects(final IProject[] projectsToTouch, IProgressMonitor progressMonitor) throws JavaModelException { WorkspaceJob touchJob = new WorkspaceJob(Messages.synchronizing_projects_job) { public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, projectsToTouch.length); for (IProject iProject : projectsToTouch) { if (JavaBuilder.DEBUG) { System.out.println("Touching project " + iProject.getName()); } if (iProject.isOpen()) { iProject.touch(subMonitor.split(1)); } } return Status.OK_STATUS; } public boolean belongsTo(Object family) { return ResourcesPlugin.FAMILY_MANUAL_REFRESH == family; } }; touchJob.schedule(); }

Target:
void touchProjects(final IProject[] projectsToTouch, IProgressMonitor progressMonitor) throws JavaModelException { WorkspaceJob touchJob = new WorkspaceJob(Messages.synchronizing_projects_job) { public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { SubMonitor subMonitor = SubMonitor.convert(monitor, projectsToTouch.length); for (IProject iProject : projectsToTouch) { if (JavaBuilder.DEBUG) { System.out.println("Touching project " + iProject.getName()); } if (iProject.isAccessible()) { iProject.touch(subMonitor.split(1)); } } return Status.OK_STATUS; } public boolean belongsTo(Object family) { return ResourcesPlugin.FAMILY_MANUAL_REFRESH == family; } }; touchJob.schedule(); }
Source:
private Client buildMockClient() { Client client = Mockito.mock(Client.class); Mockito.when(client.target(Mockito.any(URI.class))).thenReturn(buildMockWebTarget()); return client; }

Target:
private Client buildMockClient() { Client client = Mockito.mock(Client.class); Mockito.when(client.target(Mockito.any(URI.class))).then(this::buildMockWebTarget); return client; }
Source:
public Map<String, String> build() { Map<String, String> map = new HashMap<>(); if (_guid != null) map.put(GUID, _guid); if (_zoneId != null) map.put(ZONE_ID, _zoneId); if (_hostName != null) map.put(HOST_NAME, _hostName); if (_cmsUser != null) map.put(CMS_USER, _cmsUser); if (_cmsUserPassword != null) map.put(CMS_USER_PASSWORD, _cmsUserPassword); if (_port != null) map.put(PORT, _port); if (_apiVersion != null) map.put(API_VERSION, _apiVersion); if (_apiRelativePath != null) map.put(API_RELATIVE_PATH, _apiRelativePath); if (_retryCount != null) map.put(RETRY_COUNT, _retryCount); if (_retryInterval != null) map.put(RETRY_INTERVAL, _retryInterval); if (_nuageVspCmsId != null) map.put(NUAGE_VSP_CMS_ID, _nuageVspCmsId); return map; }

Target:
public Map<String, String> build() { Map<String, String> map = new HashMap<>(); putIfPresent(map, GUID, _guid); putIfPresent(map, ZONE_ID, _zoneId); putIfPresent(map, HOST_NAME, _hostName); putIfPresent(map, CMS_USER, _cmsUser); putIfPresent(map, CMS_USER_PASSWORD, _cmsUserPassword); putIfPresent(map, PORT, _port); putIfPresent(map, API_VERSION, _apiVersion); putIfPresent(map, API_RELATIVE_PATH, _apiRelativePath); putIfPresent(map, RETRY_COUNT, _retryCount); putIfPresent(map, RETRY_INTERVAL, _retryInterval); putIfPresent(map, NUAGE_VSP_CMS_ID, _nuageVspCmsId); return map; }
Source:
void setMaf(double maf) { if ((maf < 0.0 || maf > 1.0) && maf != -1.0) { throw new IllegalArgumentException("minimum allele frequency (maf=" + maf + ") should be in range [0.0, 1.0] or -1.0 if undefined"); } this.maf = maf; }

Target:
void setMaf(double maf) { if ((maf < 0.0 || maf > 1.0) && maf != -1.0) { throw new IllegalArgumentException("Minimum allele frequency (maf=" + maf + ") should be in range [0.0, 1.0] or -1.0 if undefined"); } this.maf = maf; }
Source:
public void testRecord001() throws CoreException { if (!isJRE14) { System.err.println("Test "+getName()+" requires a JRE 14"); return; } String contents = "package pkg;\n" + "public record Point() {\n" + " public Point {\n" + " System.out.println(\"no error\");\n" + " }\n" + "\n" + "}\n"; this.workingCopy = getWorkingCopy("/Converter13/src/X.java", true ); IJavaProject javaProject = this.workingCopy.getJavaProject(); String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true); try { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED); javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE); ASTNode node = buildAST( contents, this.workingCopy); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit compilationUnit = (CompilationUnit) node; assertProblemsSize(compilationUnit, 0); } finally { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old); } }

Target:
public void testRecord001() throws CoreException { if (!isJRE14) { System.err.println("Test "+getName()+" requires a JRE 14"); return; } String contents = "public record X() {\n" + " public X {\n" + " System.out.println(\"no error\");\n" + " }\n" + "\n" + "}\n"; this.workingCopy = getWorkingCopy("/Converter14/src/X.java", true ); IJavaProject javaProject = this.workingCopy.getJavaProject(); String old = javaProject.getOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, true); try { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, JavaCore.ENABLED); javaProject.setOption(JavaCore.COMPILER_PB_REPORT_PREVIEW_FEATURES, JavaCore.IGNORE); ASTNode node = buildAST( contents, this.workingCopy); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit compilationUnit = (CompilationUnit) node; assertProblemsSize(compilationUnit, 0); } finally { javaProject.setOption(JavaCore.COMPILER_PB_ENABLE_PREVIEW_FEATURES, old); } }
Source:
private ArrayList<Long> getIds(Context context){ String[] s_ids = PreferenceManager.getDefaultSharedPreferences(context).getString(MAIL_NOTIFS, "").split(";"); ArrayList<Long> ids = new ArrayList<>(); for (String s : s_ids){ ids.add(Long.parseLong(s)); } return ids; }

Target:
private ArrayList<Long> getIds(Context context){ String[] s_ids = MyPreferencesManager.getPreferences(context).getString(MAIL_NOTIFS, "").split(";"); ArrayList<Long> ids = new ArrayList<>(); for (String s : s_ids){ ids.add(Long.parseLong(s)); } return ids; }
Source:
public Tuple next() throws SQLException { while (count < offset) { if (super.next() == null) { return null; } count++; } if (limit >= 0 && count++ >= limit) { return null; } return super.next(); }

Target:
public Tuple next() throws SQLException { while (offsetCount < offset) { if (super.next() == null) { return null; } offsetCount++; } if (limit >= 0 && count++ >= limit) { return null; } return super.next(); }
Source:
private static MethodDeclarationTree getEnclosingConstructor(Tree tree) { FunctionTree function = (FunctionTree) CheckUtils.getFirstAncestor(tree, TreeKinds.functionKinds().toArray(new Tree.Kind[0])); if (function != null && isConstructor(function)) { return (MethodDeclarationTree) function; } return null; }

Target:
private static MethodDeclarationTree getEnclosingConstructor(Tree tree) { FunctionTree function = (FunctionTree) CheckUtils.getFirstAncestor(tree, KindSet.FUNCTION_KINDS); if (function != null && isConstructor(function)) { return (MethodDeclarationTree) function; } return null; }
Source:
public ElasticsearchTableDescription getTable(String schemaName, String tableName) { requireNonNull(schemaName, "schemaName is null"); requireNonNull(tableName, "tableName is null"); try { for (Map.Entry<SchemaTableName, ElasticsearchTableDescription> entry : tableDescriptions.entrySet()) { buildColumns(entry.getKey(), entry.getValue()); } } catch (Exception e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, e.getMessage()); } return tableDescriptions.get(new SchemaTableName(schemaName, tableName)); }

Target:
public ElasticsearchTableDescription getTable(String schemaName, String tableName) { requireNonNull(schemaName, "schemaName is null"); requireNonNull(tableName, "tableName is null"); for (Entry<SchemaTableName, ElasticsearchTableDescription> entry : tableDescriptions.entrySet()) { ElasticsearchTableDescription table = entry.getValue(); if (table.getColumns() == null) { buildColumns(table); } if (!table.isMetadataSet()) { table.setColumnsMetadata(table.getColumns().stream() .map(ElasticsearchColumnMetadata::new) .collect(Collectors.toList())); } } return tableDescriptions.get(new SchemaTableName(schemaName, tableName)); }
Source:
public static boolean isSvgImage(String path) { return path.toUpperCase().endsWith(ImageFileFormat.SVG.getName()) || path.toUpperCase().endsWith(ImageFileFormat.SVGZ.getName()); }

Target:
public static boolean isSvgImage(String path) { String pathToUpperCase = path.toUpperCase(); return pathToUpperCase.endsWith(ImageFileFormat.SVG.getName()) || pathToUpperCase.endsWith(ImageFileFormat.SVGZ.getName()); }
Source:
private String validateAndGetPayloadUrl(final ReleaseWebHookResource parameters) { String payloadUrl = parameters.getPayloadUrl(); if (StringUtils.isBlank(payloadUrl)) { throw new InvalidParameterException("pyaloadUrl is empty"); } final URI uri; try { uri = new URI(payloadUrl); } catch (final URISyntaxException e) { throw new InvalidParameterException("Malformed Payload URL " + e.getMessage()); } final String hostName = uri.getHost(); if (StringUtils.isBlank(hostName)) { throw new InvalidParameterException("Malformed Payload URL"); } return StringUtils.stripEnd(StringUtils.trim(payloadUrl), "/"); }

Target:
private String validateAndGetPayloadUrl(final ReleaseWebHookResource parameters) { String payloadUrl = parameters.getPayloadUrl(); if (StringUtils.isBlank(payloadUrl)) { throw new InvalidParameterException("PayloadUrl is empty"); } final URI uri; try { uri = new URI(payloadUrl); } catch (final URISyntaxException e) { throw new InvalidParameterException("Malformed Payload URL " + e.getMessage()); } final String hostName = uri.getHost(); if (StringUtils.isBlank(hostName)) { throw new InvalidParameterException("Payload URL is empty"); } return StringUtils.stripEnd(StringUtils.trim(payloadUrl), "/"); }
Source:
public int getPublishSizeLimit() { return 32 * 1024 * 1024; }

Target:
public int getPublishSizeLimit() { return publisSizeLimit; }
Source:
public void run() { if (fViewer == null || fInlinedAnnotationSupport == null || fCodeMiningProviders == null || fCodeMiningProviders.size() == 0 || fViewer.getAnnotationModel() == null) { return; } cancel(); fMonitor= new CancellationExceptionMonitor(); update(fMonitor); }

Target:
public void run() { if (fViewer == null || fInlinedAnnotationSupport == null || fCodeMiningProviders == null || fCodeMiningProviders.size() == 0 || fViewer.getAnnotationModel() == null) { return; } cancel(); updateCodeMinings(); }
Source:
public List<String> getPartitionDimensions() { return null; }

Target:
public List<String> getPartitionDimensions() { return partitionDimensions; }
Source:
public ConfigurationBuilder getDefaultConfigurationBuilder() { return globalConfigurationBuilder.defaultCacheName().map(namedConfigurationBuilders::get).orElse(null); }

Target:
public ConfigurationBuilder getDefaultConfigurationBuilder() { if (globalConfigurationBuilder.defaultCacheName().isPresent()) { return namedConfigurationBuilders.get(globalConfigurationBuilder.defaultCacheName().get()); } else { return null; } }
Source:
public static QueriesCommandBase<?> createQueryCommand(VdcQueryType query, VdcQueryParametersBase parameters, EngineContext engineContext) { Class<?> type = null; try { type = getCommandClass(query.name(), QueryPrefix); Constructor<?> info = engineContext != null ? findCommandConstructor(type, parameters.getClass(), engineContext.getClass()) : findCommandConstructor(type, parameters.getClass()); return (QueriesCommandBase<?>) info.newInstance(parameters); } catch (Exception e) { log.errorFormat("Command Factory: Failed to create command {0} using reflection\n. {1}", type, e); throw new RuntimeException(e); } }

Target:
public static QueriesCommandBase<?> createQueryCommand(VdcQueryType query, VdcQueryParametersBase parameters, EngineContext engineContext) { Class<?> type = null; try { type = getCommandClass(query.name(), QueryPrefix); QueriesCommandBase<?> result = null; if (engineContext == null) { result = (QueriesCommandBase<?>) findCommandConstructor(type, parameters.getClass()).newInstance(parameters); } else { result = (QueriesCommandBase<?>) findCommandConstructor(type, parameters.getClass(), EngineContext.class).newInstance(parameters, engineContext); } return result; } catch (Exception e) { log.errorFormat("Command Factory: Failed to create command {0} using reflection\n. {1}", type, e); throw new RuntimeException(e); } }
Source:
public void setUp(DBMSType dbmsType, DBMSConnection dbmsConnection, DBMSProcessor dbmsProcessor) throws SQLException, DatabaseNotSupportedException, InvalidDBMSConnectionPropertiesException { clientContextA = new BibDatabaseContext(new Defaults(BibDatabaseMode.BIBTEX)); DBMSSynchronizer synchronizerA = new DBMSSynchronizer(clientContextA, ',', pattern, new DummyFileUpdateMonitor()); clientContextA.convertToSharedDatabase(synchronizerA); clientContextA.getDBMSSynchronizer().openSharedDatabase(dbmsConnection); clientContextB = new BibDatabaseContext(new Defaults(BibDatabaseMode.BIBTEX)); DBMSSynchronizer synchronizerB = new DBMSSynchronizer(clientContextA, ',', pattern, new DummyFileUpdateMonitor()); clientContextB.convertToSharedDatabase(synchronizerB); clientContextB.getDBMSSynchronizer().openSharedDatabase(dbmsConnection); eventListenerB = new SynchronizationTestEventListener(); clientContextB.getDBMSSynchronizer().registerListener(eventListenerB); }

Target:
public void setUp(DBMSType dbmsType, DBMSConnection dbmsConnection, DBMSProcessor dbmsProcessor) throws Exception { clientContextA = new BibDatabaseContext(new Defaults(BibDatabaseMode.BIBTEX)); DBMSSynchronizer synchronizerA = new DBMSSynchronizer(clientContextA, ',', pattern, new DummyFileUpdateMonitor()); clientContextA.convertToSharedDatabase(synchronizerA); clientContextA.getDBMSSynchronizer().openSharedDatabase(dbmsConnection); clientContextB = new BibDatabaseContext(new Defaults(BibDatabaseMode.BIBTEX)); DBMSSynchronizer synchronizerB = new DBMSSynchronizer(clientContextA, ',', pattern, new DummyFileUpdateMonitor()); clientContextB.convertToSharedDatabase(synchronizerB); clientContextB.getDBMSSynchronizer().openSharedDatabase(dbmsConnection); eventListenerB = new SynchronizationTestEventListener(); clientContextB.getDBMSSynchronizer().registerListener(eventListenerB); }
Source:
private boolean validateMixPath(){ String mixPath = myMixPathSelector.getText(); File mix = new File(mixPath); if (!mix.exists()) { return false; } if (!mix.canExecute()) { String reason = mix.getPath() + "is not executable."; LOGGER.warn("Can't detect Mix version: " + reason); return false; } File exeFile = mix.getAbsoluteFile(); String exePath = exeFile.getPath(); String workDir = exeFile.getParent(); ProcessOutput output = null; boolean valid = false; for (String[] arguments : MIX_ARGUMENTS_ARRAY) { try { output = ElixirSystemUtil.getProcessOutput(3000, workDir, exePath, arguments); } catch (ExecutionException executionException) { LOGGER.warn(executionException); } if (output != null) { String transformedStdout = transformStdoutLine(output, STDOUT_LINE_TRANSFORMER); if (transformedStdout != null) { myMixVersionText.setText(transformedStdout); String versionString = transformedStdout.replaceAll("^[^0-9]*", ""); supportsFormatterOptionCheckBox.setSelected(compareVersions(versionString, "1.4") >= 0); valid = true; break; } else { String stderr = output.getStderr(); StringBuilder text = new StringBuilder("N/A"); if (StringUtil.isNotEmpty(stderr)) { text.append(": Error: ").append(stderr); } myMixVersionText.setText(text.toString()); } } } return valid; }

Target:
private boolean validateMixPath(){ String mixPath = myMixPathSelector.getText(); File mix = new File(mixPath); if (!mix.exists()) { return false; } if (!mix.canExecute()) { String reason = mix.getPath() + "is not executable."; LOGGER.warn("Can't detect Mix version: " + reason); return false; } File exeFile = mix.getAbsoluteFile(); String exePath = exeFile.getPath(); String workDir = exeFile.getParent(); ProcessOutput output = null; boolean valid = false; for (String[] arguments : MIX_ARGUMENTS_ARRAY) { try { output = ElixirSystemUtil.getProcessOutput(3000, workDir, exePath, arguments); } catch (ExecutionException executionException) { LOGGER.warn(executionException); } if (output != null) { String transformedStdout = transformStdoutLine(output, STDOUT_LINE_TRANSFORMER); if (transformedStdout != null) { myMixVersionText.setText(transformedStdout); String versionString = transformedStdout.replaceAll("^[^0-9]*", ""); ElixirSdkRelease elixirSdkRelease = ElixirSdkRelease.fromString(versionString); if (elixirSdkRelease != null) { supportsFormatterOptionCheckBox.setSelected(elixirSdkRelease.compareTo(ElixirSdkRelease.V_1_4) >= 0); } valid = true; break; } else { String stderr = output.getStderr(); StringBuilder text = new StringBuilder("N/A"); if (StringUtil.isNotEmpty(stderr)) { text.append(": Error: ").append(stderr); } myMixVersionText.setText(text.toString()); } } } return valid; }
Source:
public static KeyStore loadKeyStore(final Supplier<Provider[]> providers, final String providerName, FileInputStream is, String filename, char[] password) throws IOException { DataInputStream dis = new ResetableDataFileInputStream(is); int firstInt = dis.readInt(); dis.reset(); KeyStore result = null; try { if (firstInt == JKS_MAGIC) { result = tryLoadKeystore(providers, providerName, dis, password, JKS); } else if (firstInt == JCEKS_MAGIC) { result = tryLoadKeystore(providers, providerName, dis, password, JCEKS); } else if (firstInt == VERSION_1 || firstInt == VERSION_2) { dis.reset(); dis.skip(32); byte firstElementType = dis.readByte(); dis.reset(); if (firstElementType <= 5) { result = tryLoadKeystore(providers, providerName, dis, password, BKS, UBER); } else { result = tryLoadKeystore(providers, providerName, dis, password, UBER, BKS); } } else if (firstInt == VERSION_0) { result = tryLoadKeystore(providers, providerName, dis, password, UBER); } else if ((firstInt & 0xff000000) == SEQUENCE) { String[] parts = filename.split("\\."); String extension = parts[parts.length - 1]; if (extension.startsWith("b") || extension.startsWith("B")) { result = tryLoadKeystore(providers, providerName, dis, password, BCFKS, PKCS12); } else { result = tryLoadKeystore(providers, providerName, dis, password, PKCS12, BCFKS); } } } catch (Exception e) { e.printStackTrace(); } return result; }

Target:
public static KeyStore loadKeyStore(final Supplier<Provider[]> providers, final String providerName, FileInputStream is, String filename, char[] password) throws IOException, KeyStoreException{ DataInputStream dis = new ResetableDataFileInputStream(is); int firstInt = dis.readInt(); dis.reset(); KeyStore result = null; if (firstInt == JKS_MAGIC) { result = tryLoadKeystore(providers, providerName, dis, password, JKS); } else if (firstInt == JCEKS_MAGIC) { result = tryLoadKeystore(providers, providerName, dis, password, JCEKS); } else if (firstInt == VERSION_1 || firstInt == VERSION_2) { dis.reset(); dis.skip(32); byte firstElementType = dis.readByte(); dis.reset(); if (firstElementType <= 5) { result = tryLoadKeystore(providers, providerName, dis, password, BKS, UBER); } else { result = tryLoadKeystore(providers, providerName, dis, password, UBER, BKS); } } else if (firstInt == VERSION_0) { result = tryLoadKeystore(providers, providerName, dis, password, UBER); } else if ((firstInt & 0xff000000) == SEQUENCE) { String[] parts = filename.split("\\."); String extension = parts[parts.length - 1]; if (extension.startsWith("b") || extension.startsWith("B")) { result = tryLoadKeystore(providers, providerName, dis, password, BCFKS, PKCS12); } else { result = tryLoadKeystore(providers, providerName, dis, password, PKCS12, BCFKS); } } if (result == null) { throw log.keyStoreTypeNotDetected(); } return result; }
Source:
public void withJwkSetUriWhenUsingCustomTypeHeaderThenRefuseOmittedType() throws Exception { RestOperations restOperations = mock(RestOperations.class); when(restOperations.exchange(any(RequestEntity.class), eq(String.class))) .thenReturn(new ResponseEntity<>(JWK_SET, HttpStatus.OK)); NimbusJwtDecoder jwtDecoder = withJwkSetUri(JWK_SET_URI) .restOperations(restOperations) .jwtProcessorCustomizer(p -> p.setJWSTypeVerifier((type, context) -> { if (type == null) throw new BadJWTException("Illegal token type: null"); })) .build(); assertThatCode(() -> jwtDecoder.decode(SIGNED_JWT)) .isInstanceOf(JwtException.class) .hasMessageContaining("An error occurred while attempting to decode the Jwt: Illegal token type: null"); }

Target:
public void withJwkSetUriWhenUsingCustomTypeHeaderThenRefuseOmittedType() throws Exception { RestOperations restOperations = mock(RestOperations.class); when(restOperations.exchange(any(RequestEntity.class), eq(String.class))) .thenReturn(new ResponseEntity<>(JWK_SET, HttpStatus.OK)); NimbusJwtDecoder jwtDecoder = withJwkSetUri(JWK_SET_URI) .restOperations(restOperations) .jwtProcessorCustomizer(p -> p.setJWSTypeVerifier(new DefaultJOSEObjectTypeVerifier<>(new JOSEObjectType("JWS")))) .build(); assertThatCode(() -> jwtDecoder.decode(SIGNED_JWT)) .isInstanceOf(BadJwtException.class) .hasMessageContaining("An error occurred while attempting to decode the Jwt: Required JOSE header \"typ\" (type) parameter is missing"); }
Source:
private void animateAddImpl(final ViewHolder holder) { final View view = holder.itemView; if (view instanceof ProgressCardView) { view.setAlpha(1); view.setTranslationY(0f); dispatchAddFinished(holder); mAddAnimations.remove(holder); return; } final ViewPropertyAnimator animation = view.animate(); mAddAnimations.add(holder); animation.alpha(1).translationY(0).setDuration(getAddDuration()) .setListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animator) { dispatchAddStarting(holder); } @Override public void onAnimationCancel(Animator animator) { view.setTranslationY(0f); } @Override public void onAnimationEnd(Animator animator) { animation.setListener(null); dispatchAddFinished(holder); mAddAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start(); }

Target:
private void animateAddImpl(final ViewHolder holder) { final View view = holder.itemView; if (view instanceof ProgressCardView) { view.setAlpha(1); view.setTranslationY(0); dispatchAddFinished(holder); mAddAnimations.remove(holder); return; } final ViewPropertyAnimator animation = view.animate(); mAddAnimations.add(holder); animation.alpha(1).translationY(0).setDuration(getAddDuration()) .setListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animator) { dispatchAddStarting(holder); } @Override public void onAnimationCancel(Animator animator) { view.setTranslationY(0); } @Override public void onAnimationEnd(Animator animator) { animation.setListener(null); dispatchAddFinished(holder); mAddAnimations.remove(holder); dispatchFinishedWhenDone(); } }).start(); }
Source:
private Image findImageWithId(Set<? extends Image> images) { Optional<? extends Image> image = tryFind(images, idPredicate); if (image.isPresent()) { return image.get(); } logger.warn("Image %s not found in the image cache. Trying to get it from the provider...", imageId); Image imageFromProvider = getImageStrategy.getImage(imageId); if (imageFromProvider == null) { throwNoSuchElementExceptionAfterLoggingImageIds(format("%s not found", idPredicate), images); } this.images.registerImage(imageFromProvider); return imageFromProvider; }

Target:
private Image findImageWithId(Set<? extends Image> images) { Optional<? extends Image> image = tryFind(images, idPredicate); if (image.isPresent()) { return image.get(); } logger.info("Image %s not found in the image cache. Trying to get it from the provider...", imageId); Image imageFromProvider = getImageStrategy.getImage(imageId); if (imageFromProvider == null) { throwNoSuchElementExceptionAfterLoggingImageIds(format("%s not found", idPredicate), images); } this.images.registerImage(imageFromProvider); return imageFromProvider; }
Source:
public void testSetEventDataForPoolSetsEventDataJson() { Pool pool = mock(Pool.class); eventBuilder = new EventBuilder(factory, Event.Target.POOL, Event.Type.CREATED); when(pool.getSubscriptionId()).thenReturn("test-subscription-id"); String expectedEventData = "{\"subscriptionId\": \"test-subscription-id\"}"; Event event = eventBuilder.setEventData(pool).buildEvent(); assertEquals("The expected event data should have been" + expectedEventData + ", but they weren't", expectedEventData, event.getEventData()); }

Target:
public void testSetEventDataForPoolSetsEventDataJson() { Pool pool = mock(Pool.class); eventBuilder = new EventBuilder(factory, Event.Target.POOL, Event.Type.CREATED); when(pool.getSubscriptionId()).thenReturn("test-subscription-id"); String expectedEventData = "{\"subscriptionId\":\"test-subscription-id\"}"; Event event = eventBuilder.setEventData(pool).buildEvent(); assertEquals(expectedEventData, event.getEventData()); }
Source:
private void createOtherSystemTables(PhoenixConnection metaConnection, HBaseAdmin hbaseAdmin) throws SQLException, IOException { try { nSequenceSaltBuckets = ConnectionQueryServicesImpl.this.props.getInt( QueryServices.SEQUENCE_SALT_BUCKETS_ATTRIB, QueryServicesOptions.DEFAULT_SEQUENCE_TABLE_SALT_BUCKETS); metaConnection.createStatement().execute(getSystemSequenceTableDDL(nSequenceSaltBuckets)); } catch (TableAlreadyExistsException e) { nSequenceSaltBuckets = getSaltBuckets(e); } try { metaConnection.createStatement().execute(QueryConstants.CREATE_STATS_TABLE_METADATA); } catch (TableAlreadyExistsException ignore) try { metaConnection.createStatement().execute(getFunctionTableDDL()); } catch (TableAlreadyExistsException ignore) try { metaConnection.createStatement().execute(getLogTableDDL()); } catch (TableAlreadyExistsException ignore) try { metaConnection.createStatement().executeUpdate(getChildLinkDDL()); } catch (TableAlreadyExistsException e) try { metaConnection.createStatement().executeUpdate(getMutexDDL()); } catch (TableAlreadyExistsException e) try { createSysMutexTableIfNotExists(hbaseAdmin); } catch (IOException exception) { logger.error("Failed to created SYSMUTEX table. Upgrade or migration is not possible without it. Please retry."); throw exception; } }

Target:
private void createOtherSystemTables(PhoenixConnection metaConnection, HBaseAdmin hbaseAdmin) throws SQLException, IOException { try { nSequenceSaltBuckets = ConnectionQueryServicesImpl.this.props.getInt( QueryServices.SEQUENCE_SALT_BUCKETS_ATTRIB, QueryServicesOptions.DEFAULT_SEQUENCE_TABLE_SALT_BUCKETS); metaConnection.createStatement().execute(getSystemSequenceTableDDL(nSequenceSaltBuckets)); } catch (TableAlreadyExistsException e) { nSequenceSaltBuckets = getSaltBuckets(e); } try { metaConnection.createStatement().execute(QueryConstants.CREATE_STATS_TABLE_METADATA); } catch (TableAlreadyExistsException ignore) try { metaConnection.createStatement().execute(getFunctionTableDDL()); } catch (TableAlreadyExistsException ignore) try { metaConnection.createStatement().execute(getLogTableDDL()); } catch (TableAlreadyExistsException ignore) try { metaConnection.createStatement().executeUpdate(getChildLinkDDL()); } catch (TableAlreadyExistsException e) try { metaConnection.createStatement().executeUpdate(getMutexDDL()); } catch (TableAlreadyExistsException e) }
Source:
public void convertFromJsonString() throws Exception { ObjectMapper mapper = new ObjectMapper(); String payload = mapper.writeValueAsString("foo"); Message message = MessageBuilder.withPayload(payload.getBytes()).setHeader(MessageHeaders.CONTENT_TYPE,"application/json").build(); CustomJackson2MappingMessageConverter converter = new CustomJackson2MappingMessageConverter(); Object converted = converter.convertFromInternal(message, String.class,null); }

Target:
public void convertFromJsonString() throws Exception { ObjectMapper mapper = new ObjectMapper(); String payload = mapper.writeValueAsString("foo"); Message message = MessageBuilder.withPayload(payload.getBytes()).setHeader(MessageHeaders.CONTENT_TYPE,"application/json").build(); CustomJackson2MappingMessageConverter converter = new CustomJackson2MappingMessageConverter(); Object converted = converter.convertFromInternal(message, String.class,null); assertThat(converted).isNotNull(); assertThat("foo").isEqualTo((String)converted); }
Source:
public void setObject(int parameterIndex, Object x) throws SQLException { checkOpen(); if (x == null) { setNull(parameterIndex, Types.OTHER); } else if (x instanceof Boolean) { setBoolean(parameterIndex, (Boolean) x); } else if (x instanceof Byte) { setByte(parameterIndex, (Byte) x); } else if (x instanceof Short) { setShort(parameterIndex, (Short) x); } else if (x instanceof Integer) { setInt(parameterIndex, (Integer) x); } else if (x instanceof Long) { setLong(parameterIndex, (Long) x); } else if (x instanceof Float) { setFloat(parameterIndex, (Float) x); } else if (x instanceof Double) { setDouble(parameterIndex, (Double) x); } else if (x instanceof BigDecimal) { setBigDecimal(parameterIndex, (BigDecimal) x); } else if (x instanceof String) { setString(parameterIndex, (String) x); } else if (x instanceof byte[]) { setBytes(parameterIndex, (byte[]) x); } else if (x instanceof Date) { setDate(parameterIndex, (Date) x); } else if (x instanceof Time) { setTime(parameterIndex, (Time) x); } else if (x instanceof Timestamp) { setTimestamp(parameterIndex, (Timestamp) x); } else { throw new SQLException("Unsupported object type: " + x.getClass().getName()); } }

Target:
public void setObject(int parameterIndex, Object x) throws SQLException { checkOpen(); if (x == null) { setNull(parameterIndex, Types.NULL); } else if (x instanceof Boolean) { setBoolean(parameterIndex, (Boolean) x); } else if (x instanceof Byte) { setByte(parameterIndex, (Byte) x); } else if (x instanceof Short) { setShort(parameterIndex, (Short) x); } else if (x instanceof Integer) { setInt(parameterIndex, (Integer) x); } else if (x instanceof Long) { setLong(parameterIndex, (Long) x); } else if (x instanceof Float) { setFloat(parameterIndex, (Float) x); } else if (x instanceof Double) { setDouble(parameterIndex, (Double) x); } else if (x instanceof BigDecimal) { setBigDecimal(parameterIndex, (BigDecimal) x); } else if (x instanceof String) { setString(parameterIndex, (String) x); } else if (x instanceof byte[]) { setBytes(parameterIndex, (byte[]) x); } else if (x instanceof Date) { setDate(parameterIndex, (Date) x); } else if (x instanceof Time) { setTime(parameterIndex, (Time) x); } else if (x instanceof Timestamp) { setTimestamp(parameterIndex, (Timestamp) x); } else { throw new SQLException("Unsupported object type: " + x.getClass().getName()); } }
Source:
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int numSessions = in.readInt(); for (int i = 0; i < numSessions; i++) { GrillSessionHandle sessionHandle = GrillSessionHandle.valueOf(in.readUTF()); String userName = in.readUTF(); String password = in.readUTF(); try { restoreSession(sessionHandle, userName, password); GrillSessionImpl session = getSession(sessionHandle); session.readExternal(in); } catch (GrillException e) { throw new IOException(e); } } }

Target:
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int numSessions = in.readInt(); restorableSessions = new ArrayList<GrillSessionImpl.GrillSessionPersistInfo>(); for (int i = 0; i < numSessions; i++) { GrillSessionImpl.GrillSessionPersistInfo persistInfo = new GrillSessionImpl.GrillSessionPersistInfo(); persistInfo.readExternal(in); restorableSessions.add(persistInfo); } }
Source:
private int readFileCompletely(final byte[] b, final int off, final int len) throws IOException { int validation = validate(b, off, len); if (validation < 1) { return validation; } buffer = new byte[bufferSize]; bCursor = (int) fCursor; int bytesRead = readInternal(0, buffer, 0, (int) contentLength, true); firstRead = false; if (bytesRead == -1) { return -1; } fCursorAfterLastRead = fCursor; limit = bytesRead; fCursor = bytesRead; return copyToUserBuffer(b, off, len); }

Target:
private int readFileCompletely(final byte[] b, final int off, final int len) throws IOException { if (len == 0) { return 0; } if (!validate(b, off, len)) { return -1; } savePointerState(); bCursor = (int) fCursor; return optimisedRead(b, off, len, 0, contentLength); }
Source:
public Collection<RelationName> visitMatchPredicate(MatchPredicate matchPredicate, Void context) { Set<RelationName> relationNames = new HashSet<>(); for (Map.Entry<Field, Symbol> entry : matchPredicate.identBoostMap().entrySet()) { relationNames.addAll(((Symbol) entry.getKey()).accept(this, context)); relationNames.addAll(entry.getValue().accept(this, context)); } relationNames.addAll(matchPredicate.queryTerm().accept(this, context)); relationNames.addAll(matchPredicate.options().accept(this, context)); return relationNames; }

Target:
public Collection<RelationName> visitMatchPredicate(MatchPredicate matchPredicate, Void context) { Set<RelationName> relationNames = new HashSet<>(); for (Map.Entry<Field, Symbol> entry : matchPredicate.identBoostMap().entrySet()) { relationNames.addAll(entry.getKey().accept(this, context)); relationNames.addAll(entry.getValue().accept(this, context)); } relationNames.addAll(matchPredicate.queryTerm().accept(this, context)); relationNames.addAll(matchPredicate.options().accept(this, context)); return relationNames; }
Source:
public int adjustFactorWeight(String factorName, int weight){ if (factorName == null || factorName == "" || weight < 0 || Integer.MAX_VALUE - this.getTotalWeight() < weight){ logger.info( "skipping adjustFactorWeight as one or more of the input parameters are invalid"); return -1; } FactorComparator<T> value = this.factorComparatorList.get(factorName); if (null == value){ logger.info(String.format( "unable to udpate weight as the specified factorName %s doesn't exist", factorName)); return -1; } int returnVal = value.getWeight(); value.updateWeight(weight); return returnVal; }

Target:
public int adjustFactorWeight(String factorName, int weight){ if (factorName == null || factorName.length() == 0|| weight < 0 || Integer.MAX_VALUE - this.getTotalWeight() < weight){ throw new IllegalArgumentException("unable to adjust factor weight as one or more of the input parameters are invalid"); } FactorComparator<T> value = this.factorComparatorList.get(factorName); if (null == value){ throw new IllegalArgumentException(String.format( "unable to udpate weight as the specified factorName %s doesn't exist", factorName)); } int returnVal = value.getWeight(); value.updateWeight(weight); return returnVal; }
Source:
public void notifyOfCatalogUpdate() { try { clearSessions(); if (httpClientInterface != null) { httpClientInterface.notifyOfCatalogUpdate(); } } catch (Exception ex) { m_log.error("Failed to update HTTP interface after catalog update", ex); } }

Target:
public void notifyOfCatalogUpdate() { try { clearSessions(); } catch (Exception ex) { m_log.error("Failed to update HTTP interface after catalog update", ex); } }
Source:
public void testSend() throws InterruptedException, ExecutionException { final RenderedReport report = TestBeanFactory.createRenderedReportBuilder() .setFormat(new HtmlReportFormat.Builder().build()) .setBytes("report content".getBytes(StandardCharsets.UTF_8)) .build(); _sender.send( TestBeanFactory.createReportBuilder().setName("P75 TTI").build(), TestBeanFactory.createRecipient(), ImmutableMap.of(report.getFormat(), report), Instant.parse("2019-01-01T00:00:00.000Z") ).toCompletableFuture().get(); Mockito.verify(_mailer).sendMail(_message.capture()); Assert.assertEquals("[Report] P75 TTI for 2019-01-01T00:00Z", _message.getValue().getSubject()); Assert.assertEquals("report content", _message.getValue().getHTMLText()); }

Target:
public void testSend() throws InterruptedException, ExecutionException { final RenderedReport report = TestBeanFactory.createRenderedReportBuilder() .setReport(TestBeanFactory.createReportBuilder().setName("P75 TTI").build()) .setFormat(new HtmlReportFormat.Builder().build()) .setBytes("report content".getBytes(StandardCharsets.UTF_8)) .setScheduledFor(Instant.parse("2019-01-01T00:00:00.000Z")) .build(); _sender.send( TestBeanFactory.createRecipient(), ImmutableMap.of(report.getFormat(), report) ).toCompletableFuture().get(); Mockito.verify(_mailer).sendMail(_message.capture()); Assert.assertEquals("[Report] P75 TTI for 2019-01-01T00:00Z", _message.getValue().getSubject()); Assert.assertEquals("report content", _message.getValue().getHTMLText()); }
Source:
public void initialize(ConfigurableListableBeanFactory beanFactory) throws BeansException { BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory; for (String beanName : registry.getBeanDefinitionNames()) { BeanDefinition beanDefinition = registry.getBeanDefinition(beanName); if (beanDefinition instanceof AnnotatedBeanDefinition) { AnnotationMetadata metadata = ((AnnotatedBeanDefinition) beanDefinition).getMetadata(); boolean hasIntegrationConverter = metadata.hasAnnotation(IntegrationConverter.class.getName()); if (!hasIntegrationConverter && beanDefinition.getSource() instanceof MethodMetadata) { MethodMetadata beanMethod = (MethodMetadata) beanDefinition.getSource(); hasIntegrationConverter = beanMethod.isAnnotated(IntegrationConverter.class.getName()); } if (hasIntegrationConverter) { this.registerConvert(registry, new RuntimeBeanReference(beanName)); } } } }

Target:
public void initialize(ConfigurableListableBeanFactory beanFactory) throws BeansException { BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory; for (String beanName : registry.getBeanDefinitionNames()) { BeanDefinition beanDefinition = registry.getBeanDefinition(beanName); if (beanDefinition instanceof AnnotatedBeanDefinition) { AnnotationMetadata metadata = ((AnnotatedBeanDefinition) beanDefinition).getMetadata(); boolean hasIntegrationConverter = metadata.hasAnnotation(IntegrationConverter.class.getName()); if (!hasIntegrationConverter && beanDefinition.getSource() instanceof MethodMetadata) { MethodMetadata beanMethod = (MethodMetadata) beanDefinition.getSource(); hasIntegrationConverter = beanMethod.isAnnotated(IntegrationConverter.class.getName()); } if (hasIntegrationConverter) { this.registerConverter(registry, new RuntimeBeanReference(beanName)); } } } }
Source:
private void scan(Path filePath, Path rootPath, Map<String, Long> lastModifiedTimesForInputDir) { try { FileStatus parentStatus = fs.getFileStatus(filePath); String parentPathStr = filePath.toUri().getPath(); LOG.debug("scan {}", parentPathStr); FileStatus[] childStatuses = fs.listStatus(filePath); if (childStatuses.length == 0 && rootPath == null && (lastModifiedTimesForInputDir == null || lastModifiedTimesForInputDir.get(parentPathStr) == null)) { ScannedFileInfo info = new ScannedFileInfo(null, filePath.toString(), parentStatus.getModificationTime()); processDiscoveredFile(info); } for (FileStatus childStatus : childStatuses) { Path childPath = childStatus.getPath(); String childPathStr = childPath.toUri().getPath(); if (childStatus.isDirectory() && isRecursive()) { addToDiscoveredFiles(rootPath, parentStatus, childStatus, lastModifiedTimesForInputDir); scan(childPath, rootPath == null ? parentStatus.getPath() : rootPath, lastModifiedTimesForInputDir); } else if (acceptFile(childPathStr)) { addToDiscoveredFiles(rootPath, parentStatus, childStatus, lastModifiedTimesForInputDir); } else { ignoredFiles.add(childPathStr); } } } catch (FileNotFoundException fnf) { LOG.error("Failed to list directory {}", filePath, fnf); } catch (IOException e) { throw new RuntimeException("listing files", e); } }

Target:
private void scan(Path filePath, Path rootPath, Map<String, Long> lastModifiedTimesForInputDir) throws IOException { FileStatus parentStatus = fs.getFileStatus(filePath); String parentPathStr = filePath.toUri().getPath(); LOG.debug("scan {}", parentPathStr); FileStatus[] childStatuses = fs.listStatus(filePath); if (childStatuses.length == 0 && rootPath == null && (lastModifiedTimesForInputDir == null || lastModifiedTimesForInputDir.get(parentPathStr) == null)) { ScannedFileInfo info = new ScannedFileInfo(null, filePath.toString(), parentStatus.getModificationTime()); processDiscoveredFile(info); } for (FileStatus childStatus : childStatuses) { Path childPath = childStatus.getPath(); String childPathStr = childPath.toUri().getPath(); if (childStatus.isDirectory() && isRecursive()) { addToDiscoveredFiles(rootPath, parentStatus, childStatus, lastModifiedTimesForInputDir); scan(childPath, rootPath == null ? parentStatus.getPath() : rootPath, lastModifiedTimesForInputDir); } else if (acceptFile(childPathStr)) { addToDiscoveredFiles(rootPath, parentStatus, childStatus, lastModifiedTimesForInputDir); } else { ignoredFiles.add(childPathStr); } } }
Source:
private Object parseValue(ComboboxHolder holder, String methodParameterType, FieldRecord fieldRecord, ClassLoader classLoader) { Object parsedValue = fieldRecord.getValue(); String valueAsString = null == parsedValue ? null : TypeHelper.format(parsedValue); if (parsedValue instanceof Map) { if (fieldRecord.getMetadata(MAP_KEY_TYPE) != null && fieldRecord.getMetadata(MAP_VALUE_TYPE) != null) { Map<Object, Object> parsedValueAsMap = (Map<Object, Object>) parsedValue; Map<Object, Object> parsedMap = new LinkedHashMap<>(); for (Iterator<Map.Entry<Object, Object>> it = parsedValueAsMap.entrySet().iterator(); it.hasNext();) { Map.Entry<Object, Object> entry = it.next(); parsedMap.put(TypeHelper.parseMapValue(entry.getKey(), fieldRecord.getMetadata(MAP_KEY_TYPE).getValue(), true), TypeHelper.parseMapValue(entry.getValue(), fieldRecord.getMetadata(MAP_VALUE_TYPE).getValue(), false)); it.remove(); } parsedValueAsMap.putAll(parsedMap); } } else if (null != holder && holder.isEnumCollection()) { String genericType = holder.getEnumName(); parsedValue = TypeHelper.parse(valueAsString, holder.getTypeClassName(), genericType, classLoader); } else if (parsedValue instanceof UUID) { parsedValue = (UUID) parsedValue; } else { parsedValue = TypeHelper.parse(valueAsString, methodParameterType, classLoader); } return parsedValue; }

Target:
private Object parseValue(ComboboxHolder holder, String methodParameterType, FieldRecord fieldRecord, ClassLoader classLoader) { Object parsedValue = fieldRecord.getValue(); String valueAsString = null == parsedValue ? null : TypeHelper.format(parsedValue); if (parsedValue instanceof Map) { if (fieldRecord.getMetadata(MAP_KEY_TYPE) != null && fieldRecord.getMetadata(MAP_VALUE_TYPE) != null) { Map<Object, Object> parsedValueAsMap = (Map<Object, Object>) parsedValue; Map<Object, Object> parsedMap = new LinkedHashMap<>(); for (Iterator<Map.Entry<Object, Object>> it = parsedValueAsMap.entrySet().iterator(); it.hasNext();) { Map.Entry<Object, Object> entry = it.next(); parsedMap.put(TypeHelper.parseMapValue(entry.getKey(), fieldRecord.getMetadata(MAP_KEY_TYPE).getValue(), true), TypeHelper.parseMapValue(entry.getValue(), fieldRecord.getMetadata(MAP_VALUE_TYPE).getValue(), false)); it.remove(); } parsedValueAsMap.putAll(parsedMap); } } else if (null != holder && holder.isEnumCollection()) { String genericType = holder.getEnumName(); parsedValue = TypeHelper.parse(valueAsString, holder.getTypeClassName(), genericType, classLoader); } else if (parsedValue instanceof String && UUID.class.getName().equals(methodParameterType)) { parsedValue = TypeHelper.parseStringToUUID(valueAsString); } else { parsedValue = TypeHelper.parse(valueAsString, methodParameterType, classLoader); } return parsedValue; }
Source:
private void logReceivedEvent(Segment segment, TrackedEventMessage<?> message, BlockingStream<?> eventStream) { logger.trace("Processor receiving event {}. Tracking token {}. Segment id {}. Thread {}. Processor instance {}. Event Stream {}.", getName(), message.getIdentifier(), message.trackingToken(), segment.getSegmentId(), Thread.currentThread().getName(), this, eventStream); }

Target:
private void logReceivedEvent(Segment segment, TrackedEventMessage<?> message, BlockingStream<?> eventStream) { if (logger.isTraceEnabled()) { logger.trace( "Processor receiving event {}. Tracking token {}. Segment id {}. Thread {}. Processor instance {}. Event Stream {}.", getName(), message.getIdentifier(), message.trackingToken(), segment.getSegmentId(), Thread.currentThread().getName(), this, eventStream); } }