auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
List<List<Entry>> filterNotExistTableEdits(final List<List<Entry>> oldEntryList) { List<List<Entry>> entryList = new ArrayList<>(); Map<TableName, Boolean> existMap = new HashMap<>(); try (Connection localConn = ConnectionFactory.createConnection(ctx.getLocalConfiguration()); Admin localAdmin = localConn.getAdmin()) { for (List<Entry> oldEntries : oldEntryList) { List<Entry> entries = new ArrayList<>(); for (Entry e : oldEntries) { TableName tableName = e.getKey().getTableName(); boolean exist = true; if (existMap.containsKey(tableName)) { exist = existMap.get(tableName); } else { try { exist = localAdmin.tableExists(tableName); existMap.put(tableName, exist); } catch (IOException iox) { LOG.warn("Exception checking for local table " + tableName, iox); } } if (exist) { entries.add(e); } else { LOG.warn("Missing table detected at sink, local table also does not exist, " + "filtering edits for table '{}'", tableName); } } if (!entries.isEmpty()) { entryList.add(entries); } } } catch (IOException iox) { LOG.warn("Exception when creating connection to check local table", iox); return oldEntryList; } return entryList; }

Target:
List<List<Entry>> filterNotExistTableEdits(final List<List<Entry>> oldEntryList) { List<List<Entry>> entryList = new ArrayList<>(); Map<TableName, Boolean> existMap = new HashMap<>(); try (Connection localConn = ConnectionFactory.createConnection(ctx.getLocalConfiguration()); Admin localAdmin = localConn.getAdmin()) { for (List<Entry> oldEntries : oldEntryList) { List<Entry> entries = new ArrayList<>(); for (Entry e : oldEntries) { TableName tableName = e.getKey().getTableName(); boolean exist = true; if (existMap.containsKey(tableName)) { exist = existMap.get(tableName); } else { try { exist = localAdmin.tableExists(tableName); existMap.put(tableName, exist); } catch (IOException iox) { LOG.warn("Exception checking for local table " + tableName, iox); exist = true; } } if (exist) { entries.add(e); } else { LOG.warn("Missing table detected at sink, local table also does not exist, " + "filtering edits for table '{}'", tableName); } } if (!entries.isEmpty()) { entryList.add(entries); } } } catch (IOException iox) { LOG.warn("Exception when creating connection to check local table", iox); return oldEntryList; } return entryList; }
Source:
private static List<File> listFiles(String directory, String suffix) { File dir = new File(directory); List<File> propFiles = new ArrayList<>(); if (!dir.exists()) { logger.warn("Directory doesn't exists.", directory); return propFiles; } File[] dirFiles = dir.listFiles(); if (dirFiles != null) { for (File file : dirFiles) { if (file.getName().endsWith(suffix)) { propFiles.add(file); } } } return propFiles; }

Target:
private static List<File> listFiles(String directory, String suffix) { File dir = new File(directory); List<File> propFiles = new ArrayList<>(); File[] dirFiles = dir.listFiles(); if (dirFiles != null) { for (File file : dirFiles) { if (file.getName().endsWith(suffix)) { propFiles.add(file); } } } return propFiles; }
Source:
private DriverSideMsgHandler(final AggregationMaster aggregationMaster, final SerializableCodec<String> codec) { this.aggregationMaster = aggregationMaster; this.codec = codec; this.msgCountDown = new CountDownLatch(RemoteEMDriver.EVAL_NUM); this.slaveIds = Collections.synchronizedSet(new HashSet<String>(RemoteEMDriver.EVAL_NUM)); syncThread = new Thread(new SyncThread()); }

Target:
private DriverSideMsgHandler(final AggregationMaster aggregationMaster, final SerializableCodec<String> codec) { this.aggregationMaster = aggregationMaster; this.codec = codec; this.msgCountDown = new CountDownLatch(RemoteEMDriver.EVAL_NUM); this.workerIds = Collections.synchronizedSet(new HashSet<String>(RemoteEMDriver.EVAL_NUM)); syncWorkers(); }
Source:
private static String deriveTemplateUuidOnHost(VmwareHypervisorHost hyperHost, String storeIdentifier, String templateName) { try{ String templateUuid = UUID.nameUUIDFromBytes((templateName + "@" + storeIdentifier + "-" + hyperHost.getMor().getValue()).getBytes("UTF-8")).toString(); }catch(UnsupportedEncodingException e){ s_logger.warn("Unable to generate UUID due to unexpected encoding error."+e); } templateUuid = templateUuid.replaceAll("-", ""); return templateUuid; }

Target:
private static String deriveTemplateUuidOnHost(VmwareHypervisorHost hyperHost, String storeIdentifier, String templateName) { try{ String templateUuid = UUID.nameUUIDFromBytes((templateName + "@" + storeIdentifier + "-" + hyperHost.getMor().getValue()).getBytes("UTF-8")).toString(); }catch(UnsupportedEncodingException e){ s_logger.warn("Unable to generate UUID due to unexpected encoding error."+e.getLocalizedMessage()); } templateUuid = templateUuid.replaceAll("-", ""); return templateUuid; }
Source:
public void addUpdateTask(Operations operation, String key, String value) { mUpdateTasks.add(new BoxMetadataUpdateTask(operation, key, value)); setUpdateTasks(mUpdateTasks); }

Target:
public UpdateFileMetadata addUpdateTask(Operations operation, String key, String value) { mUpdateTasks.add(new BoxMetadataUpdateTask(operation, key, value)); return setUpdateTasks(mUpdateTasks); }
Source:
private String getNameForNonStringMapRecord(Type keyType, Type valueType, Schema keySchema, Schema valueSchema) { if (keyType instanceof Class && valueType instanceof Class) { Class keyClass = (Class)keyType; Class valueClass = (Class)valueType; if (keyClass.getPackage().equals(JAVA_LANG_PKG) && valueClass.getPackage().equals(JAVA_LANG_PKG)) { return NS_MAP_ARRAY_RECORD + keyClass.getSimpleName() + valueClass.getSimpleName(); } } String name = keySchema.getFullName() + valueSchema.getFullName(); long fingerprint = 0; try { fingerprint = SchemaNormalization.fingerprint64(name.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { String msg = "Unable to create fingerprint for (" + keyType + ", " + valueType + ") pair"; throw new AvroRuntimeException(msg, e); } if (fingerprint < 0) fingerprint = -fingerprint; String fpString = Long.toString(fingerprint, 16); return NS_MAP_ARRAY_RECORD + fpString; }

Target:
private String getNameForNonStringMapRecord(Type keyType, Type valueType, Schema keySchema, Schema valueSchema) { if (keyType instanceof Class && valueType instanceof Class) { Class keyClass = (Class)keyType; Class valueClass = (Class)valueType; Package pkg1 = keyClass.getPackage(); Package pkg2 = valueClass.getPackage(); if (pkg1 != null && pkg1.getName().startsWith("java") && pkg2 != null && pkg2.getName().startsWith("java")) { return NS_MAP_ARRAY_RECORD + keyClass.getSimpleName() + valueClass.getSimpleName(); } } String name = keySchema.getFullName() + valueSchema.getFullName(); long fingerprint = 0; try { fingerprint = SchemaNormalization.fingerprint64(name.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { String msg = "Unable to create fingerprint for (" + keyType + ", " + valueType + ") pair"; throw new AvroRuntimeException(msg, e); } if (fingerprint < 0) fingerprint = -fingerprint; String fpString = Long.toString(fingerprint, 16); return NS_MAP_ARRAY_RECORD + fpString; }
Source:
public static void setupLogging(String log4jConfig, URL defaultUrl) { try { URL url = defaultUrl; if (!StringUtils.isBlank(log4jConfig)) { File f = new File(log4jConfig); if (f.exists()) { url = f.toURI().toURL(); } else { url = new URL(log4jConfig); } } LogManager.resetConfiguration(); DOMConfigurator.configure(url); } catch (IOException | FactoryConfigurationError ex) { throw new RuntimeException("Cannot configure logging: " + ex.getMessage(), ex); } }

Target:
public static void setupLogging(String log4jConfig, URL defaultUrl) { try { LogManager.resetConfiguration(); if (log4jConfig == null) { DOMConfigurator.configure(defaultUrl); } else { DOMConfigurator.configure(log4jConfig); } } catch (FactoryConfigurationError ex) { throw new RuntimeException("Cannot configure logging: " + ex.getMessage(), ex); } }
Source:
public Optional<HiveFileWriter> createFileWriter(Path path, List<String> inputColumnNames, StorageFormat storageFormat, Properties schema, JobConf conf, ConnectorSession session) { if (!HiveSessionProperties.isParquetOptimizedWriterEnabled(session)) { return Optional.empty(); } if (!MapredParquetOutputFormat.class.getName().equals(storageFormat.getOutputFormat())) { return Optional.empty(); } ParquetWriterOptions parquetWriterOptions = ParquetWriterOptions.builder() .setMaxPageSize(HiveSessionProperties.getParquetWriterPageSize(session)) .setMaxBlockSize(HiveSessionProperties.getParquetWriterBlockSize(session)) .build(); CompressionCodecName compressionCodecName = getCompression(conf); List<String> fileColumnNames = Splitter.on(',').trimResults().omitEmptyStrings().splitToList(schema.getProperty(META_TABLE_COLUMNS, "")); List<Type> fileColumnTypes = toHiveTypes(schema.getProperty(META_TABLE_COLUMN_TYPES, "")).stream() .map(hiveType -> hiveType.getType(typeManager)) .collect(toList()); int[] fileInputColumnIndexes = fileColumnNames.stream() .mapToInt(inputColumnNames::indexOf) .toArray(); try { FileSystem fileSystem = hdfsEnvironment.getFileSystem(session.getUser(), path, conf); Callable<Void> rollbackAction = () -> { fileSystem.delete(path, false); return null; }; return Optional.of(new ParquetFileWriter( fileSystem.create(path), rollbackAction, fileColumnNames, fileColumnTypes, parquetWriterOptions, fileInputColumnIndexes, compressionCodecName)); } catch (IOException e) { throw new PrestoException(HIVE_WRITER_OPEN_ERROR, "Error creating Parquet file", e); } }

Target:
public Optional<HiveFileWriter> createFileWriter(Path path, List<String> inputColumnNames, StorageFormat storageFormat, Properties schema, JobConf conf, ConnectorSession session) { if (!isParquetOptimizedWriterEnabled(session)) { return Optional.empty(); } if (!MapredParquetOutputFormat.class.getName().equals(storageFormat.getOutputFormat())) { return Optional.empty(); } ParquetWriterOptions parquetWriterOptions = ParquetWriterOptions.builder() .setMaxPageSize(getParquetWriterPageSize(session)) .setMaxBlockSize(getParquetWriterBlockSize(session)) .build(); CompressionCodecName compressionCodecName = getCompression(conf); List<String> fileColumnNames = Splitter.on(',').trimResults().omitEmptyStrings().splitToList(schema.getProperty(META_TABLE_COLUMNS, "")); List<Type> fileColumnTypes = toHiveTypes(schema.getProperty(META_TABLE_COLUMN_TYPES, "")).stream() .map(hiveType -> hiveType.getType(typeManager)) .collect(toList()); int[] fileInputColumnIndexes = fileColumnNames.stream() .mapToInt(inputColumnNames::indexOf) .toArray(); try { FileSystem fileSystem = hdfsEnvironment.getFileSystem(session.getUser(), path, conf); Callable<Void> rollbackAction = () -> { fileSystem.delete(path, false); return null; }; return Optional.of(new ParquetFileWriter( fileSystem.create(path), rollbackAction, fileColumnNames, fileColumnTypes, parquetWriterOptions, fileInputColumnIndexes, compressionCodecName)); } catch (IOException e) { throw new PrestoException(HIVE_WRITER_OPEN_ERROR, "Error creating Parquet file", e); } }
Source:
public void testRemoveValueNoStoreEntryNoCacheWriterEntry() throws Exception { final MockStore realStore = new MockStore(Collections.<String, String>emptyMap()); this.store = spy(realStore); final MockCacheWriter realCache = new MockCacheWriter(Collections.<String, String>emptyMap()); final Ehcache<String, String> ehcache = this.getEhcache(realCache); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(realStore.getMap().containsKey("key"), is(false)); assertThat(realCache.getEntries().containsKey("key"), is(false)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }

Target:
public void testRemoveValueNoStoreEntryNoCacheWriterEntry() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); final FakeCacheWriter fakeWriter = new FakeCacheWriter(Collections.<String, String>emptyMap()); final Ehcache<String, String> ehcache = this.getEhcache(fakeWriter); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(fakeStore.getEntryMap().containsKey("key"), is(false)); assertThat(fakeWriter.getEntryMap().containsKey("key"), is(false)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }
Source:
protected boolean shouldValidateOnBudgetTotal() { Boolean validateOnBudgetTotal = parameterService.getParameterValueAsBoolean(ArConstants.AR_NAMESPACE_CODE, ArConstants.CONTRACTS_GRANTS_INVOICE_COMPONENT, CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL, Boolean.TRUE.booleanValue()); if (LOG.isDebugEnabled()) { LOG.debug("shouldValidateOnBudgetTotal, the value of " + CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL + " is " + validateOnBudgetTotal.booleanValue()); } return validateOnBudgetTotal.booleanValue(); }

Target:
protected boolean shouldValidateOnBudgetTotal() { Boolean validateOnBudgetTotal = parameterService.getParameterValueAsBoolean(ArConstants.AR_NAMESPACE_CODE, ArConstants.CONTRACTS_GRANTS_INVOICE_COMPONENT, CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL, Boolean.TRUE); if (LOG.isDebugEnabled()) { LOG.debug("shouldValidateOnBudgetTotal, the value of " + CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL + " is " + validateOnBudgetTotal.booleanValue()); } return validateOnBudgetTotal.booleanValue(); }
Source:
public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, AggregateCall aggregateCall) { final List<RexNode> predicates = new ArrayList<>(); for (Integer arg : aggregateCall.getArgList()) { final RelDataType type = inputRowType.getFieldList().get(arg).getType(); if (type.isNullable()) { predicates.add( rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, rexBuilder.makeInputRef(type, arg))); } } final RexNode predicate = RexUtil.composeConjunction(rexBuilder, predicates, true); if (predicate == null) { return rexBuilder.makeBigintLiteral(BigDecimal.ONE); } else { return rexBuilder.makeCall(SqlStdOperatorTable.CASE, predicate, rexBuilder.makeBigintLiteral(BigDecimal.ONE), rexBuilder.makeBigintLiteral(BigDecimal.ZERO)); } }

Target:
public RexNode singleton(RexBuilder rexBuilder, RelDataType inputRowType, AggregateCall aggregateCall) { final List<RexNode> predicates = new ArrayList<>(); for (Integer arg : aggregateCall.getArgList()) { final RelDataType type = inputRowType.getFieldList().get(arg).getType(); if (type.isNullable()) { predicates.add( rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, rexBuilder.makeInputRef(type, arg))); } } final RexNode predicate = RexUtil.composeConjunction(rexBuilder, predicates, true); final RexNode rexOne = rexBuilder.makeExactLiteral( BigDecimal.ONE, aggregateCall.getType()); if (predicate == null) { return rexOne; } else { return rexBuilder.makeCall(SqlStdOperatorTable.CASE, predicate, rexOne, rexBuilder.makeExactLiteral(BigDecimal.ZERO, aggregateCall.getType())); } }
Source:
private Options createOptions() { Options opt = new Options(); opt.addOption(buildOption(CliOption.CONF, true, true)); opt.addOption(buildOption(CliOption.CONNECTOR, true, true)); opt.addOption(buildOption(CliOption.CHANGE_ID, true, false)); opt.addOption(buildOption(CliOption.REVISION_ID, true, false)); opt.addOption(buildOption(CliOption.PULL_REQUEST_ID, true, false)); return opt; }

Target:
private Options createOptions() { Options localOptions = new Options(); localOptions.addOption(buildOption(CliOption.CONF, true, true)); localOptions.addOption(buildOption(CliOption.CONNECTOR, true, true)); localOptions.addOption(buildOption(CliOption.CHANGE_ID, true, false)); localOptions.addOption(buildOption(CliOption.REVISION_ID, true, false)); localOptions.addOption(buildOption(CliOption.PULL_REQUEST_ID, true, false)); return localOptions; }
Source:
public void appliesOuterTimeoutOnAdditionalChildren() { Duration defaultInnerWait = Duration.ofMillis(2); Duration outerWait = Duration.ofMillis(20); WaitStrategy child1 = new SleepingStrategy(defaultInnerWait); WaitStrategy child2 = new SleepingStrategy(defaultInnerWait); final WaitStrategy underTest = ((WaitAllStrategy) new WaitAllStrategy() .withStrategy(child1) .withStartupTimeout(outerWait)) .withStrategy(child2); try { underTest.waitUntilReady(container); } catch (Exception e) { if (e.getCause() instanceof CaughtTimeoutException) fail("The timeout wasn't applied to inner strategies."); else { fail(e.getMessage()); } } }

Target:
public void appliesOuterTimeoutOnAdditionalChildren() { Duration defaultInnerWait = Duration.ofMillis(2); Duration outerWait = Duration.ofMillis(20); WaitStrategy child1 = new SleepingStrategy(defaultInnerWait); WaitStrategy child2 = new SleepingStrategy(defaultInnerWait); final WaitStrategy underTest = new WaitAllStrategy() .withStrategy(child1) .withStartupTimeout(outerWait) .withStrategy(child2); try { underTest.waitUntilReady(container); } catch (Exception e) { if (e.getCause() instanceof CaughtTimeoutException) fail("The timeout wasn't applied to inner strategies."); else { fail(e.getMessage()); } } }
Source:
SMTPConnection(NetClient client, ConnectionLifeCycleListener listener) { broken = true; idle = false; doShutdown = false; socketClosed = false; socketShutDown = false; this.client = client; this.listener = listener; this.nsHandler = new MultilineParser(buffer -> { if (commandReplyHandler == null) { log.debug("dropping reply arriving after we stopped processing \"" + buffer.toString() + "\""); } else { Handler<String> currentHandler = commandReplyHandler; commandReplyHandler = null; currentHandler.handle(buffer.toString()); } }); }

Target:
SMTPConnection(NetClient client, ConnectionLifeCycleListener listener) { broken = true; idle = false; doShutdown = false; socketClosed = false; socketShutDown = false; this.client = client; this.listener = listener; this.nsHandler = new MultilineParser(buffer -> { if (commandReplyHandler == null) { log.debug("dropping reply arriving after we stopped processing the buffer."); } else { Handler<String> currentHandler = commandReplyHandler; commandReplyHandler = null; currentHandler.handle(buffer.toString()); } }); }
Source:
public static boolean validatePort(String targetPort) { return StringUtils.isNotBlank(targetPort) && StringUtils.isNumeric(targetPort); }

Target:
public static boolean validatePort(String targetPort) { return StringUtils.isNotBlank(targetPort) && StringUtils.isNumeric(targetPort) && NumberUtils.createInteger(targetPort) != 0; }
Source:
private boolean validateSuiteSetting(String name, Set<String> keywords) throws JSONException { if (!moduleInfo.has(name)) { if(keywords != null) { CLog.i("Test Module: %s can't be found in module-info.json, but it has " + "key-word setting. Ignore checking...", name); return true; } CLog.w("Test Module: %s can't be found in module-info.json.", name); return false; } JSONArray compatibilitySuites = moduleInfo.getJSONObject(name). getJSONArray(LOCAL_COMPATIBILITY_SUITES); for (int i = 0; i < compatibilitySuites.length(); i++) { String suite = compatibilitySuites.optString(i); if (suite.equals(GENERAL_TESTS) || suite.equals(DEVICE_TESTS)) { return true; } } return false; }

Target:
private boolean validateSuiteSetting(String name, Set<String> keywords) throws JSONException { if (!moduleInfo.has(name)) { if (!keywords.isEmpty()) { CLog.d("Test Module: %s can't be found in module-info.json, but it has " + "keyword setting. Ignore checking...", name); return true; } CLog.w("Test Module: %s can't be found in module-info.json.", name); return false; } JSONArray compatibilitySuites = moduleInfo.getJSONObject(name). getJSONArray(LOCAL_COMPATIBILITY_SUITES); for (int i = 0; i < compatibilitySuites.length(); i++) { String suite = compatibilitySuites.optString(i); if (suite.equals(GENERAL_TESTS) || suite.equals(DEVICE_TESTS)) { return true; } } return false; }
Source:
public Mono<Instant> renewMessageLock(UUID lockToken) { return isAuthorized(PEEK_OPERATION).thenMany(createRequestResponse.flatMap(channel -> { Message requestMessage = createManagementMessage(RENEW_LOCK_OPERATION, channel.getReceiveLinkName()); requestMessage.setBody(new AmqpValue(Collections.singletonMap(LOCK_TOKENS_KEY, new UUID[]{lockToken}))); return channel.sendWithAck(requestMessage); }).flatMapMany(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); if (statusCode != AmqpResponseCode.OK.getValue()) { return Mono.error(ExceptionUtil.amqpResponseCodeToException(statusCode, "Could not renew the lock.", getErrorContext())); } return Flux.fromIterable(messageSerializer.deserializeList(responseMessage, Instant.class)); })) .next(); }

Target:
public Mono<Instant> renewMessageLock(UUID lockToken) { return isAuthorized(PEEK_OPERATION).then(createRequestResponse.flatMap(channel -> { Message requestMessage = createManagementMessage(RENEW_LOCK_OPERATION, channel.getReceiveLinkName()); requestMessage.setBody(new AmqpValue(Collections.singletonMap(LOCK_TOKENS_KEY, new UUID[]{lockToken}))); return channel.sendWithAck(requestMessage); }).map(responseMessage -> { int statusCode = RequestResponseUtils.getResponseStatusCode(responseMessage); if (statusCode != AmqpResponseCode.OK.getValue()) { throw logger.logExceptionAsError(new AmqpException(false, String.format("Could not renew the lock for lock token: '%s'.", lockToken.toString()), getErrorContext())); } List<Instant> renewTimeList = messageSerializer.deserializeList(responseMessage, Instant.class); if (CoreUtils.isNullOrEmpty(renewTimeList)) { throw logger.logExceptionAsError(new AmqpException(false, String.format("Service bus response empty. " + "Could not renew message with lock token: '%s'.", lockToken.toString()), getErrorContext())); } return renewTimeList.get(0); })); }
Source:
public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; if (handler.isTokenRequest(request)) { handler.recordSession(request); } else if (handler.isBackChannelLogoutRequest(request)) { handler.destroySession(request); return; } else if (handler.isFrontChannelLogoutRequest(request)) { handler.destroySession(request); final String redirectionUrl = handler.computeRedirectionToServer(request); if (redirectionUrl != null) { CommonUtils.sendRedirect(response, redirectionUrl); } return; } else { logger.trace("Ignoring URI {}", request.getRequestURI()); } filterChain.doFilter(servletRequest, servletResponse); }

Target:
public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; if (handler.process(request, response)) { filterChain.doFilter(servletRequest, servletResponse); } }
Source:
public void doSetFilter(FileListFilter<F> filter) { this.filter = filter; }

Target:
protected final void doSetFilter(FileListFilter<F> filter) { this.filter = filter; }
Source:
private void convertAlert(HealthMapLocation healthMapLocation, Location location, Set<Location> convertedLocations, Set<DiseaseOccurrence> convertedOccurrences) { if (healthMapLocation.getAlerts() != null) { for (HealthMapAlert healthMapAlert : healthMapLocation.getAlerts()) { DiseaseOccurrence occurrence = alertConverter.convert(healthMapAlert, location); if (occurrence != null) { location = continueLocationConversion(healthMapLocation, location); if (location != null) { occurrence.setLocation(location); if (automaticModelRunsEnabled(occurrence)) { diseaseOccurrenceValidationService.addValidationParameters(occurrence); } diseaseService.saveDiseaseOccurrence(occurrence); convertedLocations.add(location); convertedOccurrences.add(occurrence); } else { break; } } } } }

Target:
private void convertAlert(HealthMapLocation healthMapLocation, Location location, Set<Location> convertedLocations, Set<DiseaseOccurrence> convertedOccurrences) { if (healthMapLocation.getAlerts() != null) { for (HealthMapAlert healthMapAlert : healthMapLocation.getAlerts()) { DiseaseOccurrence occurrence = alertConverter.convert(healthMapAlert, location); if (occurrence != null) { location = continueLocationConversion(healthMapLocation, location); if (location != null) { occurrence.setLocation(location); diseaseOccurrenceValidationService.addValidationParameters(occurrence); diseaseService.saveDiseaseOccurrence(occurrence); convertedLocations.add(location); convertedOccurrences.add(occurrence); } else { break; } } } } }
Source:
public void checkRecognizedFormTypeLabeledModel( HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { final FormTrainingClient formTrainingClient = getFormTrainingClient(httpClient, serviceVersion); dataRunner((data, dataLength) -> { beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<FormRecognizerOperationResult, CustomFormModel> syncPoller = formTrainingClient.beginTraining(trainingFilesUrl, useTrainingLabels, new TrainingOptions().setPollInterval(durationTestMode), Context.NONE); syncPoller.waitForCompletion(); CustomFormModel createdModel = syncPoller.getFinalResult(); FormRecognizerClient formRecognizerClient = getFormTrainingClient(httpClient, serviceVersion) .getFormRecognizerClient(); SyncPoller<FormRecognizerOperationResult, List<RecognizedForm>> syncPoller1 = formRecognizerClient.beginRecognizeCustomForms( createdModel.getModelId(), data, dataLength, new RecognizeCustomFormsOptions() .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode), Context.NONE); syncPoller1.waitForCompletion(); final RecognizedForm recognizedForm = syncPoller1.getFinalResult().stream().findFirst().get(); assertEquals("custom:" + createdModel.getModelId(), recognizedForm.getFormType()); assertNotNull(recognizedForm.getFormTypeConfidence()); final CustomFormSubmodel submodel = createdModel.getSubmodels().get(0); assertEquals("custom:" + createdModel.getModelId(), submodel.getFormType()); formTrainingClient.deleteModel(createdModel.getModelId()); formTrainingClient.deleteModel(createdModel.getModelId()); }); }, FORM_JPG); }

Target:
public void checkRecognizedFormTypeLabeledModel( HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { final FormTrainingClient formTrainingClient = getFormTrainingClient(httpClient, serviceVersion); dataRunner((data, dataLength) -> { beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<FormRecognizerOperationResult, CustomFormModel> syncPoller = formTrainingClient.beginTraining(trainingFilesUrl, useTrainingLabels, new TrainingOptions().setPollInterval(durationTestMode), Context.NONE); syncPoller.waitForCompletion(); CustomFormModel createdModel = syncPoller.getFinalResult(); FormRecognizerClient formRecognizerClient = getFormTrainingClient(httpClient, serviceVersion) .getFormRecognizerClient(); SyncPoller<FormRecognizerOperationResult, List<RecognizedForm>> syncPoller1 = formRecognizerClient.beginRecognizeCustomForms( createdModel.getModelId(), data, dataLength, new RecognizeCustomFormsOptions() .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode), Context.NONE); syncPoller1.waitForCompletion(); final RecognizedForm recognizedForm = syncPoller1.getFinalResult().stream().findFirst().get(); assertEquals("custom:" + createdModel.getModelId(), recognizedForm.getFormType()); assertNotNull(recognizedForm.getFormTypeConfidence()); final CustomFormSubmodel submodel = createdModel.getSubmodels().get(0); assertEquals("custom:" + createdModel.getModelId(), submodel.getFormType()); formTrainingClient.deleteModel(createdModel.getModelId()); }); }, FORM_JPG); }
Source:
protected Map<String, String> getImgMetadata(File file, List<String> ignoreKeysList) { logger.debug("Get image Metadata in Resource Action"); Map<String, String> meta = new HashMap<>(); try { Metadata metadata = ImageMetadataReader.readMetadata(file); for (Directory directory : metadata.getDirectories()) { for (Tag tag : directory.getTags()) { if (!ignoreKeysList.contains(tag.getTagName())) { logger.debug("Add Metadata with key: {}", tag.getTagName()); meta.put(tag.getTagName(), tag.getDescription()); } else { logger.debug("Skip Metadata key {}", tag.getTagName()); } } } } catch (ImageProcessingException ex) { logger.error("Error reading metadata"); } catch (IOException ioex) { logger.error("Error reading file"); } return meta; }

Target:
protected Map<String, String> getImgMetadata(File file, List<String> ignoreKeysList) { logger.debug("Get image Metadata in Resource Action"); Map<String, String> meta = new HashMap<>(); try { Metadata metadata = ImageMetadataReader.readMetadata(file); for (Directory directory : metadata.getDirectories()) { for (Tag tag : directory.getTags()) { if (!ignoreKeysList.contains(tag.getTagName())) { logger.debug("Add Metadata with key: {}", tag.getTagName()); meta.put(tag.getTagName(), tag.getDescription()); } else { logger.debug("Skip Metadata key {}", tag.getTagName()); } } } } catch (ImageProcessingException|IOException ex) { logger.error("Error reading image metadata", ex); } return meta; }
Source:
public DefaultCurveMetadataBuilder dayCount(DayCount dayCount) { if (dayCount != null) { this.info.put(CurveInfoType.DAY_COUNT, dayCount); } return this; }

Target:
public DefaultCurveMetadataBuilder dayCount(DayCount dayCount) { return addInfo(CurveInfoType.DAY_COUNT, dayCount); }
Source:
private TemporalUnitOffset getAllowableOffset() { if (SystemUtils.IS_OS_WINDOWS) { return within(0, ChronoUnit.MICROS); } else { return within(0, ChronoUnit.NANOS); } }

Target:
private TemporalUnitOffset getAllowableOffset() { return within(0, ChronoUnit.MICROS); }
Source:
public void shouldGetActiveDiagnosesWithFromDate() { assertEquals(1, diagnosisDAO.getActiveDiagnoses(new Patient(2), new Date(0)).size()); }

Target:
public void shouldGetActiveDiagnosesWithFromDate() { Calendar calendar = new GregorianCalendar(2014,1,1,13,24,56); assertEquals(1, diagnosisDAO.getActiveDiagnoses(new Patient(2), calendar.getTime()).size()); }
Source:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { final String sha1 = ObjectId.toString(BuildDataHelper.getCommitSHA1(build)); for (GitHubRepositoryName name : GitHubRepositoryNameContributor.parseAssociatedNames(build.getProject())) { for (GHRepository repository : name.resolve()) { listener.getLogger().println(Messages.GitHubCommitNotifier_SettingCommitStatus(repository.getUrl() + "/commit/" + sha1)); repository.createCommitStatus(sha1, GHCommitState.PENDING, build.getAbsoluteUrl(), Messages.CommitNotifier_Pending(build.getProject().getFullName()), build.getProject().getFullName()); } } return true; }

Target:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { final String sha1 = ObjectId.toString(BuildDataHelper.getCommitSHA1(build)); for (GitHubRepositoryName name : GitHubRepositoryNameContributor.parseAssociatedNames(build.getProject())) { for (GHRepository repository : name.resolve()) { listener.getLogger().println(Messages.GitHubCommitNotifier_SettingCommitStatus(repository.getUrl() + "/commit/" + sha1)); repository.createCommitStatus(sha1, GHCommitState.PENDING, build.getAbsoluteUrl(), Messages.CommitNotifier_Pending(build.getDisplayName()), build.getProject().getFullName()); } } return true; }
Source:
public V getOrFill(K key, Callable<V> callable) { try { return callable.call() ; } catch (Exception e) { e.printStackTrace(); return null; } }

Target:
public V getOrFill(K key, Callable<V> callable) { try { return callable.call() ; } catch (Exception e) { return null; } }
Source:
public void addAncestors(final Path qualifiedPath, @Nullable final BulkOperationState operationState) throws IOException { Collection<DDBPathMetadata> newDirs = new ArrayList<>(); final AncestorState ancestorState = extractOrCreate(operationState, BulkOperationState.OperationType.Rename); Path parent = qualifiedPath.getParent(); boolean entryFound = false; while (!parent.isRoot()) { synchronized (ancestorState) { if (ancestorState.contains(parent)) { break; } } PathMetadata directory = get(parent); if (directory == null || directory.isDeleted()) { if (entryFound) { LOG.warn("Inconsistent S3Guard table: adding directory {}", parent); } S3AFileStatus status = makeDirStatus(username, parent); LOG.debug("Adding new ancestor entry {}", status); DDBPathMetadata meta = new DDBPathMetadata(status, Tristate.FALSE, false); newDirs.add(meta); } else { entryFound = true; if (directory.getFileStatus().isFile()) { throw new PathIOException(parent.toString(), "Cannot overwrite parent file: metadatstore is" + " in an inconsistent state"); } synchronized (ancestorState) { ancestorState.put(parent, new DDBPathMetadata(directory)); } } parent = parent.getParent(); } if (!newDirs.isEmpty()) { patchLastUpdated(newDirs, ttlTimeProvider); innerPut(newDirs, operationState, ttlTimeProvider); } }

Target:
public void addAncestors(final Path qualifiedPath, @Nullable final BulkOperationState operationState) throws IOException { Collection<DDBPathMetadata> newDirs = new ArrayList<>(); final AncestorState ancestorState = extractOrCreate(operationState, BulkOperationState.OperationType.Rename); Path parent = qualifiedPath.getParent(); boolean entryFound = false; while (!parent.isRoot()) { synchronized (ancestorState) { if (ancestorState.contains(parent)) { break; } } PathMetadata directory = get(parent); if (directory == null || directory.isDeleted()) { if (entryFound) { LOG.warn("Inconsistent S3Guard table: adding directory {}", parent); } S3AFileStatus status = makeDirStatus(username, parent); LOG.debug("Adding new ancestor entry {}", status); DDBPathMetadata meta = new DDBPathMetadata(status, Tristate.FALSE, false); newDirs.add(meta); } else { entryFound = true; if (directory.getFileStatus().isFile()) { throw new PathIOException(parent.toString(), "Cannot overwrite parent file: metastore is" + " in an inconsistent state"); } synchronized (ancestorState) { ancestorState.put(parent, new DDBPathMetadata(directory)); } } parent = parent.getParent(); } if (!newDirs.isEmpty()) { patchLastUpdated(newDirs, ttlTimeProvider); innerPut(newDirs, operationState, ttlTimeProvider); } }
Source:
public SqlSystemStreamConfig fetchSourceInfo(String source) { String[] sourceComponents = source.split("\\."); boolean isTable = false; int systemIdx = 0; int endIdx = sourceComponents.length - 1; int streamIdx = endIdx; if (sourceComponents.length != 2) { if (sourceComponents.length != 3 || !sourceComponents[0].equals(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { String msg = String.format("Source %s is not of the format [table.]{systemName}.{streamName{", source); LOG.error(msg); throw new SamzaException(msg); } } if (sourceComponents[endIdx].toLowerCase().equals(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { isTable = true; streamIdx = endIdx - 1; } String systemName = sourceComponents[systemIdx]; String streamName = sourceComponents[streamIdx]; return new SqlSystemStreamConfig(systemName, streamName, fetchSystemConfigs(systemName), isTable); }

Target:
public SqlSystemSourceConfig fetchSourceInfo(String source) { String[] sourceComponents = source.split("\\."); boolean isTable = false; int endIdx = sourceComponents.length - 1; int streamIdx = endIdx; boolean invalidQuery = false; if (sourceComponents.length != 2) { if (sourceComponents.length != 3 || !sourceComponents[endIdx].equalsIgnoreCase(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { invalidQuery = true; } } else { if (sourceComponents[0].equalsIgnoreCase(SAMZA_SQL_QUERY_TABLE_KEYWORD) || sourceComponents[1].equalsIgnoreCase(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { invalidQuery = true; } } if (invalidQuery) { String msg = String.format("Source %s is not of the format {systemName}.{streamName}[.%s]", source, SAMZA_SQL_QUERY_TABLE_KEYWORD); LOG.error(msg); throw new SamzaException(msg); } if (sourceComponents[endIdx].equalsIgnoreCase(SAMZA_SQL_QUERY_TABLE_KEYWORD)) { isTable = true; streamIdx = endIdx - 1; } String systemName = sourceComponents[0]; String streamName = sourceComponents[streamIdx]; return new SqlSystemSourceConfig(systemName, streamName, fetchSystemConfigs(systemName), isTable); }
Source:
public int removeAmmo(AmmoType ammoType, InfantryWeapon infantryWeapon, int shotsNeeded) { Objects.requireNonNull(ammoType); if (shotsNeeded <= 0) { return 0; } InfantryAmmoStorage ammoStorage = findSpareAmmo(ammoType, infantryWeapon); int shotsRemoved = removeAmmo(ammoStorage, shotsNeeded); shotsNeeded -= shotsRemoved; return shotsRemoved; }

Target:
public int removeAmmo(AmmoType ammoType, InfantryWeapon infantryWeapon, int shotsNeeded) { Objects.requireNonNull(ammoType); if (shotsNeeded <= 0) { return 0; } InfantryAmmoStorage ammoStorage = findSpareAmmo(ammoType, infantryWeapon); int shotsRemoved = removeAmmo(ammoStorage, shotsNeeded); return shotsRemoved; }
Source:
public Class<Void> getMarketDataType() { throw new UnsupportedOperationException("getMarketDataType not supported in MissingMappingId"); }

Target:
public Class<Void> getMarketDataType() { return Void.class; }
Source:
protected EntityEquipmentSlot validateSlotIndex(final int slot) { if (slot < 0 || slot >= slots.size()) throw new RuntimeException("Slot " + slot + " not in valid range - [0," + slots.size() + ")"); return slots.get(slot); }

Target:
protected EntityEquipmentSlot validateSlotIndex(final int slot) { if (slot < 0 || slot >= slots.size()) throw new IllegalArgumentException("Slot " + slot + " not in valid range - [0," + slots.size() + ")"); return slots.get(slot); }
Source:
public boolean directAchEdit(PaymentWorksVendorUpdatesDTO vendorUpdate, String vendorNumberList) { boolean isSuccessful = false; String routingNumber = getRoutingNumber(vendorUpdate.getField_changes().getField_changes()); String accountNumber = getAccountNumber(vendorUpdate.getField_changes().getField_changes()); if (!validateRoutingNumberAndAccountNumber(routingNumber, accountNumber)) { return isSuccessful; } List<String> vendorNumbers = Arrays.asList(vendorNumberList.split("\\s*,\\s*")); for (String vendorNumber : vendorNumbers) { PayeeACHAccount payeeAchAccount = this.getActivePayeeAchAccount(PdpConstants.PayeeIdTypeCodes.VENDOR_ID, vendorNumber, PdpConstants.DisbursementTypeCodes.ACH); if (!inactivatePayeeAchAccount(payeeAchAccount)) { isSuccessful = false; break; } if(!validatePayeeAchAccountExistence(payeeAchAccount, routingNumber, accountNumber)) { return isSuccessful; } PayeeACHAccount payeeAchAccountNew = buildPayeeAchAccountNew(vendorUpdate, routingNumber, accountNumber, vendorNumber, payeeAchAccount); if(!processPayeeAchAccountNew(payeeAchAccountNew, payeeAchAccount)) { break; } } return isSuccessful; }

Target:
public boolean directAchEdit(PaymentWorksVendorUpdatesDTO vendorUpdate, String vendorNumberList) { boolean successful = false; String routingNumber = getRoutingNumber(vendorUpdate.getField_changes().getField_changes()); String accountNumber = getAccountNumber(vendorUpdate.getField_changes().getField_changes()); if (validateRoutingNumberAndAccountNumber(routingNumber, accountNumber)) { return successful; } List<String> vendorNumbers = Arrays.asList(vendorNumberList.split("\\s*,\\s*")); for (String vendorNumber : vendorNumbers) { PayeeACHAccount payeeAchAccount = this.getActivePayeeAchAccount(PdpConstants.PayeeIdTypeCodes.VENDOR_ID, vendorNumber, PdpConstants.DisbursementTypeCodes.ACH); if (!inactivatePayeeAchAccount(payeeAchAccount)) { successful = false; break; } if(!validatePayeeAchAccountExistence(payeeAchAccount, routingNumber, accountNumber)) { return successful; } PayeeACHAccount payeeAchAccountNew = buildPayeeAchAccountNew(vendorUpdate, routingNumber, accountNumber, vendorNumber, payeeAchAccount); if(!processPayeeAchAccountNew(payeeAchAccountNew, payeeAchAccount)) { break; } successful = true; } return successful; }
Source:
public void reportCompleted(AgentRuntimeInfo agentRuntimeInfo, JobIdentifier jobIdentifier, JobResult result) { Map<String, Object> request = Map.of( "agent_runtime_info", agentRuntimeInfo, "job_identifier", jobIdentifier, "job_result", result); try { this.httpClientHttpInvokerRequestExecutor.doPost("report_completed", gson.toJson(new ReportCompleteStatusRequest(agentRuntimeInfo, jobIdentifier, result))); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
public void reportCompleted(AgentRuntimeInfo agentRuntimeInfo, JobIdentifier jobIdentifier, JobResult result) { try { this.httpClientHttpInvokerRequestExecutor.doPost("report_completed", gson.toJson(new ReportCompleteStatusRequest(agentRuntimeInfo, jobIdentifier, result), ReportCompleteStatusRequest.class)); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
private String resolveRelativeModulePath(String url) { File f = new File(url); if (!f.isAbsolute()) if (repo.isBare()) { url = new File(repo.getDirectory(), url).getAbsolutePath(); } else { url = new File(repo.getWorkTree(), url).getAbsolutePath(); } return url; }

Target:
private String resolveRelativeModulePath(String url) { File f = new File(url); if (!f.isAbsolute()) if (repo.isBare()) url = new File(repo.getDirectory(), url).getAbsolutePath(); else url = new File(repo.getWorkTree(), url).getAbsolutePath(); return url; }
Source:
protected CalculatedStatus calculateStatus() { Maybe<SshMachineLocation> sshMachineOption = Machines.findUniqueSshMachineLocation(entity.getLocations()); if (sshMachineOption.isPresent()) { SshMachineLocation sshMachine = sshMachineOption.get(); try { Duration timeout = config().get(CONNECT_TIMEOUT); Map<String, ?> flags = ImmutableMap.of( SshTool.PROP_CONNECT_TIMEOUT.getName(), timeout.toMilliseconds(), SshTool.PROP_SESSION_TIMEOUT.getName(), timeout.toMilliseconds(), SshTool.PROP_SSH_TRIES.getName(), 1); int exitCode = sshMachine.execCommands(flags, SshMachineFailureDetector.class.getName(), ImmutableList.of("exit")); return new BasicCalculatedStatus(exitCode == 0, sshMachine.toString()); } catch (Exception e) { return new BasicCalculatedStatus(false, e.getMessage()); } } else { return new BasicCalculatedStatus(true, "no machine started, not complaining"); } }

Target:
protected CalculatedStatus calculateStatus() { Maybe<SshMachineLocation> sshMachineOption = Machines.findUniqueSshMachineLocation(entity.getLocations()); if (sshMachineOption.isPresent()) { SshMachineLocation sshMachine = sshMachineOption.get(); try { Duration timeout = config().get(CONNECT_TIMEOUT); Map<String, ?> flags = ImmutableMap.of( SshTool.PROP_CONNECT_TIMEOUT.getName(), timeout.toMilliseconds(), SshTool.PROP_SESSION_TIMEOUT.getName(), timeout.toMilliseconds(), SshTool.PROP_SSH_TRIES.getName(), 1); int exitCode = sshMachine.execCommands(flags, SshMachineFailureDetector.class.getName(), ImmutableList.of("exit")); return new BasicCalculatedStatus(exitCode == 0, sshMachine.toString()); } catch (Exception e) { Exceptions.propagateIfFatal(e); boolean isFirstFailure = lastPublished != LastPublished.FAILED && currentFailureStartTime == null; if (isFirstFailure) { if (LOG.isDebugEnabled()) { LOG.debug("Failed connecting to machine " + sshMachine, e); } } else { if (LOG.isTraceEnabled()) { LOG.trace("Failed connecting to machine " + sshMachine, e); } } return new BasicCalculatedStatus(false, e.getMessage()); } } else { return new BasicCalculatedStatus(true, "no machine started, not complaining"); } }
Source:
private MessageType createSchema() { return new MessageType("schema", new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.INT32, INT32_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.INT64, INT64_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.FLOAT, FLOAT_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.DOUBLE, DOUBLE_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.BINARY, BINARY_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY, 12, FIXED_LEN_BYTE_ARRAY_FIELD) ); }

Target:
private static MessageType createSchema() { return new MessageType("schema", new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.INT32, INT32_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.INT64, INT64_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.FLOAT, FLOAT_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.DOUBLE, DOUBLE_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.BINARY, BINARY_FIELD), new PrimitiveType(Type.Repetition.REQUIRED, PrimitiveType.PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY, 12, FIXED_LEN_BYTE_ARRAY_FIELD) ); }
Source:
public ProjectExporter(ComponentService.Iface componentClient, ProjectService.Iface projectClient, User user, List<Project> projects, boolean extendedByReleases) throws SW360Exception { super(new ProjectHelper(projectClient, user, extendedByReleases, new ReleaseHelper(componentClient, false, null, null))); preloadRelatedDataFor(projects, extendedByReleases, user); }

Target:
public ProjectExporter(ComponentService.Iface componentClient, ProjectService.Iface projectClient, User user, List<Project> projects, boolean extendedByReleases) throws SW360Exception { super(new ProjectHelper(projectClient, user, extendedByReleases, new ReleaseHelper(componentClient))); preloadRelatedDataFor(projects, extendedByReleases, user); }
Source:
private DemoAdapter() { for (int i = 0; i < sSize; i++) { mItems.add("Item " + i); } }

Target:
private DemoAdapter() { for (int i = 0; i < SIZE; i++) { mItems.add("Item " + i); } }
Source:
public static List<IAnalysisModuleSource> getSources() { List<IAnalysisModuleSource> sources = new ArrayList<>(); IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(TMF_ANALYSIS_TYPE_ID); for (IConfigurationElement ce : config) { String elementName = ce.getName(); if (elementName.equals(SOURCE_ELEM)) { try { IAnalysisModuleSource source = (IAnalysisModuleSource) ce.createExecutableExtension(CLASS_ATTR); sources.add(source); } catch (InvalidRegistryObjectException e) { Activator.logError("Error creating module source", e); } catch (CoreException e) { Activator.logError("Error creating module source", e); } } } return sources; }

Target:
public static Iterable<IAnalysisModuleSource> getSources() { List<IAnalysisModuleSource> sources = new ArrayList<>(); IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(TMF_ANALYSIS_TYPE_ID); for (IConfigurationElement ce : config) { String elementName = ce.getName(); if (elementName.equals(SOURCE_ELEM)) { try { IAnalysisModuleSource source = (IAnalysisModuleSource) ce.createExecutableExtension(CLASS_ATTR); sources.add(source); } catch (InvalidRegistryObjectException e) { Activator.logError("Error creating module source", e); } catch (CoreException e) { Activator.logError("Error creating module source", e); } } } return sources; }