auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean checkForAndInstallJava(String requiredVersion) { List<String> requiredVersionParts = Splitter.on(".").splitToList(requiredVersion); int requiredJavaMinor = Integer.valueOf(requiredVersionParts.get(1)); Optional<String> installedJavaVersion = getInstalledJavaVersion(); if (installedJavaVersion.isPresent()) { List<String> installedVersionParts = Splitter.on(".").splitToList(installedJavaVersion.get()); int javaMajor = Integer.valueOf(installedVersionParts.get(0)); int javaMinor = Integer.valueOf(installedVersionParts.get(1)); if (javaMajor == 1 && javaMinor >= requiredJavaMinor) { log.debug("Java already installed at {}@{}", new Object[]{installedJavaVersion.get(), getEntity(), getLocation()}); return true; } } return tryJavaInstall(requiredVersion, BashCommands.installJava(requiredJavaMinor)) == 0; }

Target:
protected boolean checkForAndInstallJava(String requiredVersion) { int requiredJavaMinor; if (requiredVersion.contains(".")) { List<String> requiredVersionParts = Splitter.on(".").splitToList(requiredVersion); requiredJavaMinor = Integer.valueOf(requiredVersionParts.get(1)); } else if (requiredVersion.length() == 1) { requiredJavaMinor = Integer.valueOf(requiredVersion); } else { log.error("java version required is not supported", requiredVersion); throw new IllegalArgumentException("Required java version " + requiredVersion + " not supported"); } Optional<String> installedJavaVersion = getInstalledJavaVersion(); if (installedJavaVersion.isPresent()) { List<String> installedVersionParts = Splitter.on(".").splitToList(installedJavaVersion.get()); int javaMajor = Integer.valueOf(installedVersionParts.get(0)); int javaMinor = Integer.valueOf(installedVersionParts.get(1)); if (javaMajor == 1 && javaMinor >= requiredJavaMinor) { log.debug("Java already installed at {}@{}", new Object[]{installedJavaVersion.get(), getEntity(), getLocation()}); return true; } } return tryJavaInstall(requiredVersion, BashCommands.installJava(requiredJavaMinor)) == 0; }
Source:
public void killJob( @NotBlank(message = "No id entered. Unable to kill job.") final String id, @NotBlank(message = "No reason provided.") final String reason ) throws GenieException { final JobStatus jobStatus = this.jobSearchService.getJobStatus(id); if (jobStatus == JobStatus.INIT) { this.eventPublisher.publishEvent( new JobFinishedEvent( id, JobFinishedReason.KILLED, "User requested job be killed during initialization", this ) ); } else if (jobStatus == JobStatus.RUNNING) { final JobExecution jobExecution = this.jobSearchService.getJobExecution(id); if (jobExecution.getExitCode().isPresent()) { return; } if (!this.hostName.equals(jobExecution.getHostName())) { throw new GeniePreconditionException( "Job with id " + id + " is not running on this host (" + this.hostName + "). It's actually on " + jobExecution.getHostName() ); } if (SystemUtils.IS_OS_UNIX) { this.killJobOnUnix(jobExecution .getProcessId() .orElseThrow(() -> new GeniePreconditionException("No process id found. Unable to kill if no process id") ) ); } else { throw new java.lang.UnsupportedOperationException("Genie isn't currently supported on this OS"); } try { this.objectMapper.writeValue( new File(this.baseWorkingDir + "/" + id + "/genie/kill-reason"), new JobKillReasonFile(reason)); } catch (IOException e) { throw new GenieServerException("Failed to write job kill reason file", e); } } }

Target:
public void killJob( @NotBlank(message = "No id entered. Unable to kill job.") final String id, @NotBlank(message = "No reason provided.") final String reason ) throws GenieException { final JobStatus jobStatus = this.jobSearchService.getJobStatus(id); if (jobStatus == JobStatus.INIT) { this.eventPublisher.publishEvent( new JobFinishedEvent( id, JobFinishedReason.KILLED, "User requested job be killed during initialization", this ) ); } else if (jobStatus == JobStatus.RUNNING) { final JobExecution jobExecution = this.jobSearchService.getJobExecution(id); if (jobExecution.getExitCode().isPresent()) { return; } if (!this.hostName.equals(jobExecution.getHostName())) { throw new GeniePreconditionException( "Job with id " + id + " is not running on this host (" + this.hostName + "). It's actually on " + jobExecution.getHostName() ); } if (SystemUtils.IS_OS_UNIX) { this.killJobOnUnix(jobExecution .getProcessId() .orElseThrow(() -> new GeniePreconditionException("No process id found. Unable to kill if no process id") ) ); } else { throw new java.lang.UnsupportedOperationException("Genie isn't currently supported on this OS"); } try { this.objectMapper.writeValue( new File(this.baseWorkingDir + "/" + id + "/" + JobConstants.GENIE_KILL_REASON_FILE_NAME), new JobKillReasonFile(reason)); } catch (IOException e) { throw new GenieServerException("Failed to write job kill reason file", e); } } }
Source:
public void testGetTimeZones() { final TimeZone timeZone0 = mock(TimeZone.class); final TimeZone timeZone1 = mock(TimeZone.class); final String[] ids = new String[]{"0", "1"}; when(timeZone0.getRawOffset()).thenReturn(0); when(timeZone1.getRawOffset()).thenReturn(3600000); doReturn(ids).when(service).getAvailableIds(); doReturn(timeZone0).when(service).getTimeZone("0"); doReturn(timeZone1).when(service).getTimeZone("1"); final List<DMNSimpleTimeZone> simpleTimeZones = service.getTimeZones(); assertEquals(2, simpleTimeZones.size()); assertEquals(0, simpleTimeZones.get(0).getOffset(), 0.01d); assertEquals(1, simpleTimeZones.get(1).getOffset(), 0.01d); }

Target:
public void testGetTimeZones() { final TimeZone timeZone0 = mock(TimeZone.class); final TimeZone timeZone1 = mock(TimeZone.class); final String[] ids = new String[]{"0", "1"}; when(timeZone0.getRawOffset()).thenReturn(0); when(timeZone1.getRawOffset()).thenReturn(3600000); doReturn(ids).when(service).getAvailableIds(); doReturn(timeZone0).when(service).getTimeZone("0"); doReturn(timeZone1).when(service).getTimeZone("1"); final List<DMNSimpleTimeZone> simpleTimeZones = service.getTimeZones(); assertEquals(2, simpleTimeZones.size()); assertEquals(0, simpleTimeZones.get(0).getOffset(), 0.01d); assertEquals(1, simpleTimeZones.get(1).getOffset(), 0.01d); assertEquals("+00:00", simpleTimeZones.get(0).getOffsetString()); assertEquals("+01:00", simpleTimeZones.get(1).getOffsetString()); }
Source:
private static Supplier<ClientRegistration.Builder> oidcRfc8414(URI issuer) { URI uri = UriComponentsBuilder.fromUri(issuer) .replacePath(OIDC_METADATA_PATH + issuer.getPath()).build(Collections.emptyMap()); return () -> { RequestEntity<Void> request = RequestEntity.get(uri).build(); Map<String, Object> configuration = rest.exchange(request, typeReference).getBody(); AuthorizationServerMetadata metadata = parse(configuration, AuthorizationServerMetadata::parse); validateJwksUri(metadata); ClientRegistration.Builder builder = withProviderConfiguration(metadata, issuer.toASCIIString()) .jwkSetUri(metadata.getJWKSetURI().toASCIIString()); String userinfoEndpoint = (String) configuration.get("userinfo_endpoint"); if (userinfoEndpoint != null) { builder.userInfoUri(userinfoEndpoint); } return builder; }; }

Target:
private static Supplier<ClientRegistration.Builder> oidcRfc8414(URI issuer) { URI uri = UriComponentsBuilder.fromUri(issuer) .replacePath(OIDC_METADATA_PATH + issuer.getPath()).build(Collections.emptyMap()); return getRfc8414Builder(issuer, uri); }
Source:
public void beginRecognizeInvoices() throws IOException { File invoice = new File("local/file_path/invoice.jpg"); Flux<ByteBuffer> buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(invoice.toPath()))); formRecognizerAsyncClient.beginRecognizeBusinessCards(buffer, invoice.length()) .flatMap(AsyncPollResponse::getFinalResult) .subscribe(recognizedInvoices -> { for (int i = 0; i < recognizedInvoices.size(); i++) { RecognizedForm recognizedForm = recognizedInvoices.get(i); Map<String, FormField> recognizedFields = recognizedForm.getFields(); FormField customAddrFormField = recognizedFields.get("CustomerAddress"); if (customAddrFormField != null) { if (FieldValueType.STRING == customAddrFormField.getValue().getValueType()) { System.out.printf("Customer Address: %s%n", customAddrFormField.getValue().asString()); } } FormField invoiceDateFormField = recognizedFields.get("InvoiceDate"); if (invoiceDateFormField != null) { if (FieldValueType.DATE == invoiceDateFormField.getValue().getValueType()) { LocalDate invoiceDate = invoiceDateFormField.getValue().asDate(); System.out.printf("Invoice Date: %s, confidence: %.2f%n", invoiceDate, invoiceDateFormField.getConfidence()); } } } }); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoices#Flux-long }

Target:
public void beginRecognizeInvoices() throws IOException { File invoice = new File("local/file_path/invoice.jpg"); Flux<ByteBuffer> buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(invoice.toPath()))); formRecognizerAsyncClient.beginRecognizeInvoices(buffer, invoice.length()) .flatMap(AsyncPollResponse::getFinalResult) .subscribe(recognizedInvoices -> { for (int i = 0; i < recognizedInvoices.size(); i++) { RecognizedForm recognizedForm = recognizedInvoices.get(i); Map<String, FormField> recognizedFields = recognizedForm.getFields(); FormField customAddrFormField = recognizedFields.get("CustomerAddress"); if (customAddrFormField != null) { if (FieldValueType.STRING == customAddrFormField.getValue().getValueType()) { System.out.printf("Customer Address: %s%n", customAddrFormField.getValue().asString()); } } FormField invoiceDateFormField = recognizedFields.get("InvoiceDate"); if (invoiceDateFormField != null) { if (FieldValueType.DATE == invoiceDateFormField.getValue().getValueType()) { LocalDate invoiceDate = invoiceDateFormField.getValue().asDate(); System.out.printf("Invoice Date: %s, confidence: %.2f%n", invoiceDate, invoiceDateFormField.getConfidence()); } } } }); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoices#Flux-long }
Source:
public ReviewerResource parse(ChangeResource rsrc, IdString id) throws OrmException, ResourceNotFoundException, AuthException { Account account = null; Account.Id accountId; if (id.equals("self")) { CurrentUser user = rsrc.getControl().getCurrentUser(); if (user instanceof IdentifiedUser) { accountId = ((IdentifiedUser)user).getAccountId(); } else if (user instanceof AnonymousUser) { throw new AuthException("Authentication required"); } else { throw new ResourceNotFoundException(id); } } else if (id.get().matches("^[0-9]+$")) { accountId = Account.Id.parse(id.get()); } else { account = accountResolver.find(id.get()); if (account != null) { accountId = account.getId(); } else { throw new ResourceNotFoundException(id); } } if (fetchAccountIds(rsrc).contains(accountId)) { if (account == null) { account = accountCache.get(accountId).getAccount(); } return new ReviewerResource(rsrc, account, id.get()); } throw new ResourceNotFoundException(id); }

Target:
public ReviewerResource parse(ChangeResource rsrc, IdString id) throws OrmException, ResourceNotFoundException, AuthException { Account.Id accountId; if (id.equals("self")) { CurrentUser user = rsrc.getControl().getCurrentUser(); if (user instanceof IdentifiedUser) { accountId = ((IdentifiedUser) user).getAccountId(); } else if (user instanceof AnonymousUser) { throw new AuthException("Authentication required"); } else { throw new ResourceNotFoundException(id); } } else { Set<Account.Id> matches = resolver.findAll(id.get()); if (matches.size() != 1) { throw new ResourceNotFoundException(id); } accountId = Iterables.getOnlyElement(matches); } if (fetchAccountIds(rsrc).contains(accountId)) { Account account = accountCache.get(accountId).getAccount(); return resourceFactory.create(rsrc, account); } throw new ResourceNotFoundException(id); }
Source:
public Optional<String> getCountryCode(String locationWKT, int radius) { try { Optional<String> alpha3CountryCode = geoEntryQueryable.getCountryCode(locationWKT, radius); if (alpha3CountryCode.isPresent()) { return alpha3CountryCode; } } catch (GeoEntryQueryException e) { LOGGER.debug("Error querying GeoNames", e); } catch (ParseException e) { LOGGER.debug("Error parsing WKT: ", locationWKT, e); } return Optional.empty(); }

Target:
public Optional<String> getCountryCode(String locationWKT, int radius) { try { return geoEntryQueryable.getCountryCode(locationWKT, radius); } catch (GeoEntryQueryException e) { LOGGER.debug("Error querying GeoNames", e); } catch (ParseException e) { LOGGER.debug("Error parsing WKT: ", locationWKT, e); } return Optional.empty(); }
Source:
public FileKryoRegistrar() { super(); this.registrationId = DEFAULT_REGISTRATION_ID; }

Target:
public FileKryoRegistrar() { this.registrationId = DEFAULT_REGISTRATION_ID; }
Source:
public final void testPathsDirectoryWithNestedFile() throws IOException { TestRootModuleChecker.reset(); final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub(); antTask.setConfig(getPath(CUSTOM_ROOT_CONFIG_FILE)); antTask.setProject(new Project()); final FileResource fileResource = new FileResource( antTask.getProject(), getPath(FLAWLESS_INPUT)); final Path sourcePath = new Path(antTask.getProject()); sourcePath.add(fileResource); antTask.addPath(sourcePath); antTask.execute(); assertTrue("Checker is not processed", TestRootModuleChecker.isProcessed()); final List<File> filesToCheck = TestRootModuleChecker.getFilesToCheck(); assertThat("There more files to check then expected", filesToCheck.size(), is(1)); assertThat("The path of file differs from expected", filesToCheck.get(0).getAbsolutePath(), is(getPath(FLAWLESS_INPUT))); assertEquals("Amount of logged messages in unxexpected", 9, antTask.getLoggedMessages().size()); }

Target:
public final void testPathsDirectoryWithNestedFile() throws IOException { TestRootModuleChecker.reset(); final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub(); antTask.setConfig(getPath(CUSTOM_ROOT_CONFIG_FILE)); antTask.setProject(new Project()); final FileResource fileResource = new FileResource( antTask.getProject(), getPath("ant/checkstyleanttask/")); final Path sourcePath = new Path(antTask.getProject()); sourcePath.add(fileResource); antTask.addPath(sourcePath); antTask.execute(); assertTrue("Checker is not processed", TestRootModuleChecker.isProcessed()); final List<File> filesToCheck = TestRootModuleChecker.getFilesToCheck(); assertThat("There more files to check then expected", filesToCheck.size(), is(9)); assertThat("The path of file differs from expected", filesToCheck.get(5).getAbsolutePath(), is(getPath(FLAWLESS_INPUT))); assertEquals("Amount of logged messages in unxexpected", 9, antTask.getLoggedMessages().size()); }
Source:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.menu_clear_all_saved_pages: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.dialog_title_clear_saved_pages); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { app.getPersister(Bookmark.class).deleteAll(); } }); builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.create().show(); return true; default: throw new RuntimeException("Unknown menu item clicked!"); } }

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.menu_clear_all_saved_pages: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.dialog_title_clear_saved_pages); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { app.getPersister(Bookmark.class).deleteAll(); } }); builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.create().show(); return true; default: throw new RuntimeException("Unknown menu item clicked!"); } }
Source:
public void close() throws Exception { synchronized (this) { for (final MQTTSubscribeClient subClient : mqttSubscribeClientMap.values()) { subClient.disconnect(); } } }

Target:
public void close() throws Exception { for (final MQTTSubscribeClient subClient : mqttSubscribeClientMap.values()) { subClient.disconnect(); } }
Source:
public void testSplit1() { String s1 = "(thrift://hcat1:port,thrift://hcat2:port),(thrift://hcat3:port,thrift://hcat4:port)"; p.put(EXTRA_HCAT_CLUSTERS, s1); List<String> s2 = Arrays.asList("", "thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s2)); String s3 = "(thrift://hcat1:port,thrift://hcat2:port) , (thrift://hcat3:port,thrift://hcat4:port)"; p.put(EXTRA_HCAT_CLUSTERS, s3); List<String> s4 = Arrays.asList("", "thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s4)); String s5 = " (thrift://hcat1:port,thrift://hcat2:port) , (thrift://hcat3:port,thrift://hcat4:port) "; p.put(EXTRA_HCAT_CLUSTERS, s5); List<String> s6 = Arrays.asList("", "thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s6)); }

Target:
public void testSplit1() { String s1 = "thrift://hcat1:port,thrift://hcat2:port;thrift://hcat3:port,thrift://hcat4:port;"; p.put(EXTRA_HCAT_CLUSTERS, s1); List<String> s2 = Arrays.asList("thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s2)); String s3 = "thrift://hcat1:port,thrift://hcat2:port ; thrift://hcat3:port,thrift://hcat4:port;"; p.put(EXTRA_HCAT_CLUSTERS, s3); List<String> s4 = Arrays.asList( "thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s4)); String s5 = "thrift://hcat1:port,thrift://hcat2:port"; p.put(EXTRA_HCAT_CLUSTERS, s5); List<String> s6 = Arrays.asList("thrift://hcat1:port,thrift://hcat2:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s6)); }
Source:
public MagicKey(String name, Cache<?, ?> primaryOwner) { this.name = name; address = addressOf(primaryOwner).toString(); Random r = new Random(); Object dummy; int attemptsLeft = 100000; do { final int hc = r.nextInt(); dummy = new Integer(hc); attemptsLeft--; } while (!isFirstOwner(primaryOwner, dummy) && attemptsLeft >= 0); if (attemptsLeft < 0) { throw new IllegalStateException("Could not find any key owned by " + primaryOwner); } hashcode = dummy.hashCode(); segment = primaryOwner.getAdvancedCache().getDistributionManager().getReadConsistentHash().getSegment(this); }

Target:
public MagicKey(String name, Cache<?, ?> primaryOwner) { this.name = name; address = addressOf(primaryOwner).toString(); Random r = new Random(); Object dummy; int attemptsLeft = 1000; do { final int hc = r.nextInt(); dummy = new Integer(hc); attemptsLeft--; } while (!isFirstOwner(primaryOwner, dummy) && attemptsLeft >= 0); if (attemptsLeft < 0) { throw new IllegalStateException("Could not find any key owned by " + primaryOwner); } hashcode = dummy.hashCode(); segment = primaryOwner.getAdvancedCache().getDistributionManager().getReadConsistentHash().getSegment(this); }
Source:
public RelDataType createRawType(String className, String serializerString) { return new DummyRawType(className, serializerString); }

Target:
public RelDataType createRawType(String className, String serializerString) { return canonize(new DummyRawType(className, serializerString)); }
Source:
public Map<String, Map<String, String>> extractBrokerConfigurations(Map<String, Object> properties) { Map<String, Map<String, String>> configPerBroker = new HashMap<String, Map<String, String>>(); for (Entry<String, Object> entry : properties.entrySet()) { String key = entry.getKey(); if (key.equals("service.pid") || key.equals("objectClass") || key.equals("component.name") || key.equals("component.id")) { continue; } if (!(entry.getValue() instanceof String)) { logger.error("Unexpected value {}:{}", entry.getKey(), entry.getValue()); continue; } String value = (String) entry.getValue(); String[] subkeys = key.split("\\."); if (subkeys.length != 2 || StringUtils.isBlank(value)) { logger.debug("MQTT Broker property '{}={}' should have the format 'broker.propertykey=value'", key, value); continue; } String brokername = subkeys[0].toLowerCase(); Map<String, String> brokerConfig = configPerBroker.get(brokername); if (brokerConfig == null) { brokerConfig = new HashMap<>(); configPerBroker.put(brokername, brokerConfig); brokerConfig.put(NAME_PROPERTY, brokername); } brokerConfig.put(subkeys[1], value); } return configPerBroker; }

Target:
public Map<String, Map<String, String>> extractBrokerConfigurations(Map<String, Object> properties) { Map<String, Map<String, String>> configPerBroker = new HashMap<String, Map<String, String>>(); for (Entry<String, Object> entry : properties.entrySet()) { String key = entry.getKey(); if (key.equals("service.pid") || key.equals("objectClass") || key.equals("component.name") || key.equals("component.id")) { continue; } if (!(entry.getValue() instanceof String)) { logger.warn("Unexpected value in broker configuration {}:{}", entry.getKey(), entry.getValue()); continue; } String value = (String) entry.getValue(); String[] subkeys = key.split("\\."); if (subkeys.length != 2 || StringUtils.isBlank(value)) { logger.debug("MQTT Broker property '{}={}' should have the format 'broker.propertykey=value'", key, value); continue; } String brokername = subkeys[0].toLowerCase(); Map<String, String> brokerConfig = configPerBroker.get(brokername); if (brokerConfig == null) { brokerConfig = new HashMap<>(); configPerBroker.put(brokername, brokerConfig); brokerConfig.put(NAME_PROPERTY, brokername); } brokerConfig.put(subkeys[1], value); } return configPerBroker; }
Source:
public boolean consume(QuotaConsumptionParametersWrapper parameters) { Pair<AuditLogType, AuditLogableBase> auditLogPair = new Pair<AuditLogType, AuditLogableBase>(); auditLogPair.setSecond(parameters.getAuditLogable()); lock.readLock().lock(); try { storage_pool storagePool = parameters.getAuditLogable().getStoragePool(); if (storagePool == null) { throw new InvalidQuotaParametersException("Null storage pool passed to QuotaManager"); } if (!storagePoolQuotaMap.containsKey(storagePool.getId())) { storagePoolQuotaMap.put(storagePool.getId(), new HashMap<Guid, Quota>()); } synchronized (storagePoolQuotaMap.get(storagePool.getId())) { if (!validateAndCompleteParameters(parameters, auditLogPair)) { throw new InvalidQuotaParametersException(); } return internalConsumeAndReleaseHandler(parameters, auditLogPair); } } finally { lock.readLock().unlock(); getQuotaManagerAuditLogger().auditLog(auditLogPair.getFirst(), auditLogPair.getSecond()); } }

Target:
public boolean consume(QuotaConsumptionParametersWrapper parameters) throws InvalidQuotaParametersException { Pair<AuditLogType, AuditLogableBase> auditLogPair = new Pair<AuditLogType, AuditLogableBase>(); auditLogPair.setSecond(parameters.getAuditLogable()); storage_pool storagePool = parameters.getAuditLogable().getStoragePool(); if (storagePool == null) { throw new InvalidQuotaParametersException("Null storage pool passed to QuotaManager"); } lock.writeLock().lock(); try { if (!storagePoolQuotaMap.containsKey(storagePool.getId())) { storagePoolQuotaMap.put(storagePool.getId(), new HashMap<Guid, Quota>()); } } finally { lock.writeLock().unlock(); } lock.readLock().lock(); try { synchronized (storagePoolQuotaMap.get(storagePool.getId())) { if (!validateAndCompleteParameters(parameters, auditLogPair)) { throw new InvalidQuotaParametersException(); } return internalConsumeAndReleaseHandler(parameters, auditLogPair); } } finally { lock.readLock().unlock(); getQuotaManagerAuditLogger().auditLog(auditLogPair.getFirst(), auditLogPair.getSecond()); } }
Source:
protected void testAccessControl() throws Exception { InstructorAttributes instructor1OfCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); FeedbackSessionAttributes accessableFeedbackSession = dataBundle.feedbackSessions.get("session1InCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.FEEDBACK_SESSION_NAME, accessableFeedbackSession.getFeedbackSessionName(), Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); }

Target:
protected void testAccessControl() throws Exception { InstructorAttributes instructor1OfCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); FeedbackSessionAttributes accessibleFeedbackSession = dataBundle.feedbackSessions.get("session1InCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.FEEDBACK_SESSION_NAME, accessibleFeedbackSession.getFeedbackSessionName(), Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); }
Source:
private void internalFreeMac(String mac) { if (allocatedMacs.get(mac) != null) { removeMacFromMap(allocatedMacs, mac); availableMacs.add(mac); } else if (allocatedCustomMacs.get(mac) != null) { removeMacFromMap(allocatedCustomMacs, mac); } }

Target:
private void internalFreeMac(String mac) { if (allocatedMacs.containsKey(mac)) { removeMacFromMap(allocatedMacs, mac); availableMacs.add(mac); } else if (allocatedCustomMacs.containsKey(mac)) { removeMacFromMap(allocatedCustomMacs, mac); } }
Source:
public void testDisableSSO() throws Exception { final Address keyStoreAddress = securityDomainOperations.createKeyStore(); try { page.getResourceManager().selectByName(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.getLastPairValue()); page.switchToSSOConfigTab(); page.disableSSO() .confirmAndDismissReloadRequiredMessage() .assertClosed(); new ResourceVerifier(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.and(SETTING, SINGLE_SIGN_ON), client) .verifyDoesNotExist(); } finally { operations.removeIfExists(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.and(SETTING, SINGLE_SIGN_ON)); operations.removeIfExists(keyStoreAddress); administration.reloadIfRequired(); } }

Target:
public void testDisableSSO() throws Exception { try { page.getResourceManager().selectByName(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.getLastPairValue()); page.switchToSSOConfigTab(); page.disableSSO() .confirmAndDismissReloadRequiredMessage() .assertClosed(); new ResourceVerifier(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.and(SETTING, SINGLE_SIGN_ON), client) .verifyDoesNotExist(); } finally { operations.removeIfExists(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.and(SETTING, SINGLE_SIGN_ON)); administration.reloadIfRequired(); } }
Source:
private CompletableFuture<Void> runFailureDetectorTask(PollReport pollReport) { return CompletableFuture.runAsync(() -> { correctWrongEpochs(pollReport); try { if (!pollReport.getWrongEpochs().isEmpty()) { if (isCurrentLayoutSlotUnFilled(pollReport)) { handleFailure(Collections.emptySet(), pollReport); } return; } } catch (Exception ex) { log.error("Can't fill slot. Poll report: {}", pollReport); } boolean failure = handleFailure(pollReport); if (failure) { return; } handleSequencer(pollReport, serverContext.copyManagementLayout()); handleHealing(pollReport, serverContext.copyManagementLayout()); }, detectionTaskWorkers); }

Target:
private CompletableFuture<Void> runFailureDetectorTask(PollReport pollReport) { return CompletableFuture.runAsync(() -> { correctWrongEpochs(pollReport); try { if (pollReport.isCurrentLayoutSlotUnFilled()) { handleFailure(Collections.emptySet(), pollReport); return; } if (!pollReport.getWrongEpochs().isEmpty()) { return; } } catch (Exception ex) { log.error("Can't fill slot. Poll report: {}", pollReport, ex); } handleFailure(pollReport); handleSequencer(pollReport, serverContext.copyManagementLayout()); handleHealing(pollReport, serverContext.copyManagementLayout()); }, failureDetectorWorker); }
Source:
public AdminCommand create( Path homeDir, Path configDir, OutsideWorld outsideWorld ) { boolean debug = !System.getenv().getOrDefault( "NEO4J_DEBUG", "" ).equals( "" ); LogProvider logProvider = FormattedLogProvider.withDefaultLogLevel( debug ? Level.DEBUG : Level.NONE ).toOutputStream( outsideWorld.outStream() ); Monitors monitors = new Monitors(); OnlineBackupContextBuilder contextBuilder = new OnlineBackupContextBuilder( homeDir, configDir ); BackupModule backupModule = new BackupModule( outsideWorld, logProvider, monitors ); BackupSupportingClassesFactoryProvider classesFactoryProvider = getProvidersByPriority().findFirst().orElseThrow( noProviderException() ); BackupSupportingClassesFactory supportingClassesFactory = classesFactoryProvider.getFactory( backupModule ); BackupStrategyCoordinatorFactory coordinatorFactory = new BackupStrategyCoordinatorFactory( backupModule ); return new OnlineBackupCommand( outsideWorld, contextBuilder, supportingClassesFactory, coordinatorFactory ); }

Target:
public AdminCommand create( Path homeDir, Path configDir, OutsideWorld outsideWorld ) { boolean debug = System.getenv().get( "NEO4J_DEBUG") != null; LogProvider logProvider = FormattedLogProvider.withDefaultLogLevel( debug ? Level.DEBUG : Level.NONE ).toOutputStream( outsideWorld.outStream() ); Monitors monitors = new Monitors(); OnlineBackupContextBuilder contextBuilder = new OnlineBackupContextBuilder( homeDir, configDir ); BackupModule backupModule = new BackupModule( outsideWorld, logProvider, monitors ); BackupSupportingClassesFactoryProvider classesFactoryProvider = getProvidersByPriority().findFirst().orElseThrow( noProviderException() ); BackupSupportingClassesFactory supportingClassesFactory = classesFactoryProvider.getFactory( backupModule ); BackupStrategyCoordinatorFactory coordinatorFactory = new BackupStrategyCoordinatorFactory( backupModule ); return new OnlineBackupCommand( outsideWorld, contextBuilder, supportingClassesFactory, coordinatorFactory ); }
Source:
public IndexedUserContainer() { List<User> users = Collections.emptyList(); UserService userService = UserServices.getUserService(); if (userService != null) { users = userService.getUsers(); } addContainerProperty(User.PROPERTY_FIRSTNAME, String.class, null); addContainerProperty(User.PROPERTY_LASTNAME, String.class, null); addContainerProperty(User.PROPERTY_EMAIL, String.class, null); addContainerProperty(User.PROPERTY_DISPLAY_NAME, String.class, null); addContainerProperty(PROPERTY_USER, User.class, null); for (User user : users) { addItem(user); } }

Target:
public IndexedUserContainer() { addContainerProperty(User.PROPERTY_FIRSTNAME, String.class, null); addContainerProperty(User.PROPERTY_LASTNAME, String.class, null); addContainerProperty(User.PROPERTY_EMAIL, String.class, null); addContainerProperty(User.PROPERTY_DISPLAY_NAME, String.class, null); addContainerProperty(PROPERTY_USER, User.class, null); }
Source:
private SyncRepoEntity getTagsSyncRepo(Repository repo) { Set<String> allRefs = repo.getAllRefs().keySet(); SyncRepoEntity local = new SyncRepoEntity( UIText.SynchronizeWithAction_tagsName); for (String ref : allRefs) { if (ref.startsWith(Constants.R_TAGS)) { local.addRef(createSyncRrepoEntity(ref)); } } return local; }

Target:
private SyncRepoEntity getTagsSyncRepo(Repository repo) { Set<String> allRefs = repo.getAllRefs().keySet(); SyncRepoEntity local = new SyncRepoEntity( UIText.SynchronizeWithAction_tagsName); for (String ref : allRefs) if (ref.startsWith(Constants.R_TAGS)) local.addRef(createSyncRepoEntity(ref)); return local; }
Source:
public Command revertUnsavedChangesBeforeExitCommand( final Command onCompleted) { return new Command() { @Override public void execute() { handleUnsavedChangesBeforeExit( new ArrayList<UnsavedChangesTarget>(), onCompleted); } }; }

Target:
public Command revertUnsavedChangesBeforeExitCommand( final Command onCompleted) { return () -> handleUnsavedChangesBeforeExit(new ArrayList<UnsavedChangesTarget>(), onCompleted); }
Source:
private void testAccumulate(final String accumulateFunction, final Number expectedResult) { final String drl = "import org.drools.compiler.oopath.*;\n" + "global java.lang.Object globalVar\n" + "\n" + "rule R when\n" + " accumulate ( Adult( $child: /children ) ; $accumulateResult: " + accumulateFunction + "($child.getAge()) )\n" + "then\n" + " kcontext.getKieRuntime().setGlobal(\"globalVar\", $accumulateResult);\n" + "end\n"; final KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build() .newKieSession(); final Man bob = new Man( "Bob", 40 ); bob.addChild( new Child( "Charles", 12 ) ); bob.addChild( new Child( "Debbie", 8 ) ); ksession.insert( bob ); ksession.fireAllRules(); final Number result = (Number) ksession.getGlobal("globalVar"); if (result instanceof Double) { assertEquals(expectedResult.doubleValue(), result.doubleValue(), 0); } else { assertEquals(expectedResult.longValue(), result.longValue()); } }

Target:
private void testAccumulate(final String accumulateFunction, final Number expectedResult) { final String drl = "import org.drools.compiler.oopath.model.*;\n" + "global java.lang.Object globalVar\n" + "\n" + "rule R when\n" + " accumulate ( Adult( $child: /children ) ; $accumulateResult: " + accumulateFunction + "($child.getAge()) )\n" + "then\n" + " kcontext.getKieRuntime().setGlobal(\"globalVar\", $accumulateResult);\n" + "end\n"; final KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build() .newKieSession(); final Man bob = new Man( "Bob", 40 ); bob.addChild( new Child( "Charles", 12 ) ); bob.addChild( new Child( "Debbie", 8 ) ); ksession.insert( bob ); ksession.fireAllRules(); final Number result = (Number) ksession.getGlobal("globalVar"); if (result instanceof Double) { Assertions.assertThat(expectedResult.doubleValue()).isEqualTo(result.doubleValue()); } else { Assertions.assertThat(expectedResult.longValue()).isEqualTo(result.longValue()); } }
Source:
PersistenceProcessorHandler(MetricsRegistry metrics, String tsoHostAndPort, LeaseManagement leaseManager, CommitTable commitTable, ReplyProcessor reply, RetryProcessor retryProc, Panicker panicker, TSOServerConfig config) throws InterruptedException, ExecutionException, IOException { this.tsoHostAndPort = tsoHostAndPort; this.leaseManager = leaseManager; this.commitTableClient = commitTable.getClient(); this.writer = commitTable.getWriter(); this.reply = reply; this.retryProc = retryProc; this.panicker = panicker; this.maxBatchSize = config.getMaxBatchSize() / config.getPersistHandlerNum(); LOG.info("Creating the persist processor with batch size {}, and timeout {}ms", maxBatchSize, config.getBatchPersistTimeoutMS()); flushTimer = metrics.timer(name("tso", "persist", "flush")); batchSizeHistogram = metrics.histogram(name("tso", "persist", "batchsize")); }

Target:
PersistenceProcessorHandler(MetricsRegistry metrics, String tsoHostAndPort, LeaseManagement leaseManager, CommitTable commitTable, ReplyProcessor reply, RetryProcessor retryProc, Panicker panicker, TSOServerConfig config) throws InterruptedException, ExecutionException, IOException { this.tsoHostAndPort = tsoHostAndPort; this.leaseManager = leaseManager; this.writer = commitTable.getWriter(); this.reply = reply; this.retryProc = retryProc; this.panicker = panicker; flushTimer = metrics.timer(name("tso", "persist", "flush")); batchSizeHistogram = metrics.histogram(name("tso", "persist", "batchsize")); }
Source:
public boolean isTrue(State state, String[] params) { ObjectInstance containerInstance = state.getObject(params[1]); if (ContainerFactory.getContentNames(containerInstance).size() != (this.topLevelIngredient.getContents().size() + this.topLevelIngredient.getNecessaryTraits().size())) { return false; } return true; }

Target:
public boolean isTrue(State state, String[] params) { ObjectInstance containerInstance = state.getObject(params[1]); int contentAmount = ContainerFactory.getContentNames(containerInstance).size(); int neededAmount = this.topLevelIngredient.getContents().size() + this.topLevelIngredient.getNecessaryTraits().size(); if (contentAmount != neededAmount) { return false; } return true; }
Source:
public boolean provides(final IOperation operation) { boolean provide = false; if (operation instanceof CreateDecoratorsOperation) { final IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget(); final View view = decoratorTarget.getAdapter(View.class); if (view != null && ActivityDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view)) && view.getElement() instanceof CallBehaviorAction) { provide = true; } else { provide = false; } } return provide; }

Target:
public boolean provides(final IOperation operation) { boolean provide = false; if (operation instanceof CreateDecoratorsOperation) { final IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget(); final View view = decoratorTarget.getAdapter(View.class); if (null != view && ActivityDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view)) && view.getElement() instanceof CallBehaviorAction) { provide = true; } else { provide = false; } } return provide; }
Source:
public HashCode buildHashCode() { return filter.buildHashCode(); }

Target:
public HashCode buildHashCode() { final List<HashCode> hashes = Lists.newArrayListWithCapacity(2); hashes.add(filter.buildHashCode()); final HashCode hc = Const.HASH_FUNCTION().newHasher() .putString(Strings.nullToEmpty(getType()), Const.UTF8_CHARSET) .hash(); hashes.add(hc); return Hashing.combineOrdered(hashes); }
Source:
public void openErroDialog(final String title, String pattern, String arg) { final String errorMsg = MessageFormat.format(pattern, new Object[] { arg }); try { MessageDialog.openError(Display.getCurrent().getActiveShell(), title, errorMsg); } catch (NullPointerException e) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { MessageDialog.openError(Display.getCurrent().getActiveShell(), title, errorMsg); } }); } }

Target:
public void openErroDialog(final String title, String pattern, String arg) { final String errorMsg = MessageFormat.format(pattern, new Object[] { arg }); if (Display.getCurrent() != null) { MessageDialog.openError(Display.getCurrent().getActiveShell(), title, errorMsg); } else { Display.getDefault().syncExec(new Runnable() { @Override public void run() { MessageDialog.openError(Display.getCurrent().getActiveShell(), title, errorMsg); } }); } }
Source:
public void run() { logger.info("Starting MegaHttpServer at " + portnumber + " port"); try { ss = new ServerSocket(portnumber); } catch (IOException e) { logger.debug("ERROR -> " + e.getMessage()); } while (isRunning) { Socket s = null; try { s = ss != null ? ss.accept() : null; } catch (IOException e) { logger.debug("ERROR --> " + e.getMessage()); } if (!ss.isClosed()) { new Thread(new MegaDeviceHttpSocket(s)).start(); } } }

Target:
public void run() { logger.info("Starting MegaHttpServer at port", portnumber); try { ss = new ServerSocket(portnumber); } catch (IOException e) { logger.error("ERROR -> {}. Can't open socket ", e.getMessage()); } while (isRunning) { Socket s = null; try { s = ss != null ? ss.accept() : null; } catch (IOException e) { logger.error(e.getMessage()); } if (!ss.isClosed()) { try { Thread.sleep(10000); } catch (InterruptedException e) { logger.error(e.getMessage()); } new Thread(new MegaDeviceHttpSocket(s)).start(); } } }
Source:
private ProcessHandler startTestProcess(IJavaProject javaProject, TestExecutionContext context) { File suiteFile = createSuite(context, javaProject); if (suiteFile == null) { throw new RuntimeException("Can't create TestNG suite xml file."); } JavaParameters parameters = new JavaParameters(); parameters.setJavaExecutable("java"); parameters.setMainClassName("org.testng.CheTestNGLauncher"); parameters.setWorkingDirectory("/tmp"); List<String> classPath = new ArrayList<>(); Set<String> projectClassPath = classpathProvider.getProjectClassPath(javaProject); classPath.addAll(projectClassPath); classPath.add(ClasspathUtil.getJarPathForClass(org.testng.CheTestNG.class)); classPath.add(ClasspathUtil.getJarPathForClass(JCommander.class)); parameters.getClassPath().addAll(classPath); parameters.getParametersList().add("-suiteFile", suiteFile.getAbsolutePath()); CommandLine command = parameters.createCommand(); try { return new ProcessHandler(command.createProcess()); } catch (ExecutionException e) { LOG.error("Can't run TestNG JVM", e); } return null; }

Target:
private ProcessHandler startTestProcess(IJavaProject javaProject, TestExecutionContext context) { File suiteFile = createSuite(context, javaProject); if (suiteFile == null) { throw new RuntimeException("Can't create TestNG suite xml file."); } JavaParameters parameters = new JavaParameters(); parameters.setJavaExecutable("java"); parameters.setMainClassName("org.testng.CheTestNGLauncher"); String outputDirectory = getOutputDirectory(javaProject); parameters.getParametersList().add("-d", outputDirectory); parameters.setWorkingDirectory(PROJECTS_ROOT_FOLDER + javaProject.getPath()); List<String> classPath = new ArrayList<>(); Set<String> projectClassPath = classpathProvider.getProjectClassPath(javaProject); classPath.addAll(projectClassPath); classPath.add(ClasspathUtil.getJarPathForClass(org.testng.CheTestNG.class)); classPath.add(ClasspathUtil.getJarPathForClass(JCommander.class)); parameters.getClassPath().addAll(classPath); parameters.getParametersList().add("-suiteFile", suiteFile.getAbsolutePath()); if (context.isDebugModeEnable()) { debugPort = generateDebuggerPort(); parameters.getVmParameters().add("-Xdebug"); parameters.getVmParameters().add("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=" + debugPort); } CommandLine command = parameters.createCommand(); try { return new ProcessHandler(command.createProcess()); } catch (ExecutionException e) { LOG.error("Can't run TestNG JVM", e); } return null; }
Source:
public GdbFullCliConsole(ILaunch launch, String label, Process process, PTY pty) { super(label, null, false); fLaunch = launch; fLabel = label; new GdbConsoleLifecycleListener(this); fTerminalConnector = new GdbTerminalConnector(process); resetName(); }

Target:
public GdbFullCliConsole(ILaunch launch, String label, Process process, PTY pty) { super(label, null, false); fLaunch = launch; fLabel = label; fGdbPty = pty; new GdbConsoleLifecycleListener(this); fTerminalConnector = new GdbTerminalConnector(process); resetName(); }
Source:
public Method getOnStringMessageMethod(Object webSocketEndpoint) { Method[] methods = webSocketEndpoint.getClass().getMethods(); for (Method method : methods) { if (method.isAnnotationPresent(OnMessage.class)) { Class<?>[] paraTypes = method.getParameterTypes(); List<Class<?>> paraList = Arrays.asList(paraTypes); if (paraList.contains(String.class)) { return method; } } } return null; }

Target:
public Method getOnStringMessageMethod(Object webSocketEndpoint) { Method[] methods = webSocketEndpoint.getClass().getMethods(); if (methods == null) { return null; } for (Method method : methods) { if (method.isAnnotationPresent(OnMessage.class)) { Class<?>[] paraTypes = method.getParameterTypes(); List<Class<?>> paraList = Arrays.asList(paraTypes); if (paraList.contains(String.class)) { return method; } } } return null; }
Source:
public int ifHit(Vector<Bullet> alienBullets) { Iterator iteralien = ConcreteAggregate.createIterator(alienBullets); while (iteralien.hasNext()) { Bullet bullet = (Bullet) iteralien.next(); if (bullet instanceof MegaBullet) { if (ifHitMega(bullet, iteralien.position()) == true) { return iteralien.position(); } } if (bullet.getY() > ypos - 10 && bullet.getY() < ypos + 16) { if (bullet.getX() > xpos - 6 && bullet.getX() < xpos + 26) { lives -= 1; Game.logfile.writeHit("Spaceship", bullet.getX(), bullet.getY()); if (lives > 0) { Game.logfile.writeString("Spaceship has " + String.valueOf(lives) + " lives left"); } else { Game.logfile.writeString("Spaceship has no lives left"); } return iteralien.position(); } } } return -1; }

Target:
public int ifHit(Vector<Bullet> alienBullets) { Iterator iterAlienBullets = ConcreteAggregate.createIterator(alienBullets); while (iterAlienBullets.hasNext()) { Bullet bullet = (Bullet) iterAlienBullets.next(); if (bullet instanceof MegaBullet) { if (ifHitMega(bullet, iterAlienBullets.position()) == true) { return iterAlienBullets.position(); } } if (bullet.getY() > ypos - 10 && bullet.getY() < ypos + 16) { if (bullet.getX() > xpos - 6 && bullet.getX() < xpos + 26) { lives -= 1; Game.logfile.writeHit("Spaceship", bullet.getX(), bullet.getY()); if (lives > 0) { Game.logfile.writeString("Spaceship has " + String.valueOf(lives) + " lives left"); } else { Game.logfile.writeString("Spaceship has no lives left"); } return iterAlienBullets.position(); } } } return -1; }
Source:
public Map<Object, Query> getTerms(final Query query) throws IOException { final Map<Object, Query> termMap = new TreeMap<>(); index.withReader(reader -> { LuceneUtil.extractTerms(query, termMap, reader, false); return termMap; }); return termMap; }

Target:
public Map<Object, Query> getTerms(final Query query) throws IOException { return index.withReader(reader -> { final Map<Object, Query> termMap = new TreeMap<>(); LuceneUtil.extractTerms(query, termMap, reader, false); return termMap; }); }
Source:
private static int convertTalendAvroType(String javaType) { int sqlType = Types.NULL; if (javaType.equals("java.lang.Byte")) { sqlType = Types.SMALLINT; } else if (javaType.equals("java.lang.Short")) { sqlType = Types.SMALLINT; } else if (javaType.equals("java.lang.Character")) { sqlType = Types.CHAR; } else if (javaType.equals("java.util.Date")) { sqlType = Types.DATE; } else if (javaType.equals("java.math.BigDecimal")) { sqlType = Types.DOUBLE; } else { throw new UnsupportedOperationException(javaType + " class can't be converted to SQL type."); } return sqlType; }

Target:
private int convertTalendAvroType(String javaType) { Integer sqlType = this.config.CONVERT_JAVATYPE_TO_SQLTYPE.get(javaType); if(sqlType != null){ return sqlType; } switch (javaType) { case "java.lang.Byte": sqlType = Types.SMALLINT; break; case "java.lang.Short": sqlType = Types.SMALLINT; break; case "java.lang.Character": sqlType = Types.CHAR; break; case "java.util.Date": sqlType = Types.DATE; break; case "java.math.BigDecimal": sqlType = Types.DOUBLE; break; default: throw new UnsupportedOperationException(javaType + " class can't be converted to SQL type."); } return sqlType; }
Source:
public Long getDirectUploadExpiration() { return config.get("direct_upload_expiration", Long.class, 10L*60); }

Target:
public Optional<Long> getDirectUploadExpiration() { return Optional.of(config.get("direct_upload_expiration", Long.class, 10L*60)); }
Source:
public void onMapReady(@NonNull final MapboxMap mapboxMap) { mapboxMap.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { ValueAnimatorIconAnimationActivity.this.style = style; mapView.addOnDidFinishRenderingMapListener(ValueAnimatorIconAnimationActivity.this); initLayerIcon(style); initDataSource(style); } }); }

Target:
public void onMapReady(@NonNull final MapboxMap mapboxMap) { mapboxMap.setStyle(new Style.Builder().fromUrl(Style.LIGHT) .withSource(new GeoJsonSource("source-id", FeatureCollection.fromFeatures(new Feature[] { Feature.fromGeometry(Point.fromLngLat( 119.86083984375, -1.834403324493515)), Feature.fromGeometry(Point.fromLngLat( 116.06637239456177, 5.970619502704659)), Feature.fromGeometry(Point.fromLngLat( 114.58740234375, 4.54357027937176)), Feature.fromGeometry(Point.fromLngLat( 118.19091796875, 5.134714634014467)), Feature.fromGeometry(Point.fromLngLat( 110.36865234374999, 1.4500404973608074)), Feature.fromGeometry(Point.fromLngLat( 109.40185546874999, 0.3076157096439005)), Feature.fromGeometry(Point.fromLngLat( 115.79589843749999, 1.5159363834516861)), Feature.fromGeometry(Point.fromLngLat( 113.291015625, -0.9667509997666298)), Feature.fromGeometry(Point.fromLngLat( 116.40083312988281, -0.3392008994314591)) }) )) .withImage(ICON_ID, BitmapUtils.getBitmapFromDrawable( getResources().getDrawable(R.drawable.map_marker_push_pin_pink))), new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { ValueAnimatorIconAnimationActivity.this.style = style; mapView.addOnDidFinishRenderingMapListener(ValueAnimatorIconAnimationActivity.this); } } ); }