auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Override protected void doEnqueue(Callback<V> callback) { sendRequest().handle((response, t) -> { if (t != null) { callback.onError(t); } else { try { callback.onSuccess(parseResponse(response, bodyConverter)); } catch (Throwable e) { callback.onError(e); } } return null; }); }

Target:
@Override protected void doEnqueue(Callback<V> callback) { sendRequest().handle((response, t) -> { if (t != null) { callback.onError(t); } else { try { callback.onSuccess(parseResponse(response, bodyConverter)); } catch (IOException e) { callback.onError(e); } } return null; }); }
Source:
public String send(Map<Header, Object> headers, Map<String, String> properties, ForkliftMessage message) throws ProducerException { throw new UnsupportedOperationException("Kafka Producer does not support headers or properties"); }

Target:
public String send(Map<Header, Object> headers, Map<String, String> properties, ForkliftMessage message) throws ProducerException { throw new UnsupportedOperationException("Kafka Producer does not support headers"); }
Source:
public DDF transformUDF(String RExp, List<String> columns) throws DDFException { String sqlCmd = String.format("SELECT %s FROM %s", RToSqlUdf(RExp, columns, this.getDDF().getSchema().getColumns()), this.getDDF().getTableName()); System.out.println("Performing: " + sqlCmd); DDF newddf = this.getManager().sql2ddf(sqlCmd); if (this.getDDF().isMutable()) { return this.getDDF().updateInplace(newddf); } else { newddf.getMetaDataHandler().copyFactor(this.getDDF()); return newddf; } }

Target:
public DDF transformUDF(String RExp, List<String> columns) throws DDFException { String sqlCmd = String.format("SELECT %s FROM %s", RToSqlUdf(RExp, columns, this.getDDF().getSchema().getColumns()), this.getDDF().getTableName()); DDF newddf = this.getManager().sql2ddf(sqlCmd); if (this.getDDF().isMutable()) { return this.getDDF().updateInplace(newddf); } else { newddf.getMetaDataHandler().copyFactor(this.getDDF()); return newddf; } }
Source:
public void offerPaymentStateTransition(String externalId, ChargeStatus fromChargeState, ChargeStatus targetChargeState, ChargeEventEntity chargeEventEntity) { PaymentGatewayStateTransitions.getInstance() .getEventForTransition(fromChargeState, targetChargeState) .ifPresent(eventType -> { PaymentStateTransition transition = new PaymentStateTransition(chargeEventEntity.getId(), eventType); stateTransitionQueue.offer(transition); logger.info("Offered payment state transition to emitter queue [from={}] [to={}] [chargeEventId={}] [chargeId={}]", fromChargeState, targetChargeState, chargeEventEntity.getId(), externalId); eventService.recordOfferedEvent(ResourceType.PAYMENT, externalId, Event.eventTypeForClass(eventType), chargeEventEntity.getUpdated() ); }); }

Target:
public void offerPaymentStateTransition(String externalId, ChargeStatus fromChargeState, ChargeStatus targetChargeState, ChargeEventEntity chargeEventEntity) { PaymentGatewayStateTransitions.getInstance() .getEventForTransition(fromChargeState, targetChargeState) .ifPresent(eventClass -> { PaymentStateTransition transition = new PaymentStateTransition(chargeEventEntity.getId(), eventClass); stateTransitionQueue.offer(transition); logger.info("Offered payment state transition to emitter queue [from={}] [to={}] [chargeEventId={}] [chargeId={}]", fromChargeState, targetChargeState, chargeEventEntity.getId(), externalId); eventService.recordOfferedEvent(ResourceType.PAYMENT, externalId, Event.eventTypeForClass(eventClass), chargeEventEntity.getUpdated() ); }); }
Source:
protected DownloadMeta fetch(ClientBlobStore store, String key, IOFunction<Long, Path> pathSupplier, IOFunction<File, OutputStream> outStreamSupplier) throws KeyNotFoundException, AuthorizationException, IOException { try (InputStreamWithMeta in = store.getBlob(key)) { long newVersion = in.getVersion(); if (newVersion == getLocalVersion()) { LOG.warn("The version did not change, but going to download again {}", getLocalVersion(), key); } Path downloadPath = pathSupplier.apply(newVersion); LOG.debug("Downloading to {}", key, downloadPath); long totalRead = 0; try (OutputStream out = outStreamSupplier.apply(downloadPath.toFile())) { byte[] buffer = new byte[4096]; int read; while ((read = in.read(buffer)) >= 0) { out.write(buffer, 0, read); totalRead += read; } } long expectedSize = in.getFileLength(); if (totalRead != expectedSize) { throw new IOException("We expected to download " + expectedSize + " bytes but found we got " + totalRead); } return new DownloadMeta(downloadPath, newVersion); } }

Target:
protected DownloadMeta fetch(ClientBlobStore store, String key, IOFunction<Long, Path> pathSupplier, IOFunction<File, OutputStream> outStreamSupplier) throws KeyNotFoundException, AuthorizationException, IOException { try (InputStreamWithMeta in = store.getBlob(key)) { long newVersion = in.getVersion(); long currentVersion = getLocalVersion(); if (newVersion == currentVersion) { LOG.warn("The version did not change, but going to download again {}", currentVersion, key); } Path downloadPath = pathSupplier.apply(newVersion); LOG.debug("Downloading to {}", key, downloadPath); long totalRead = 0; try (OutputStream out = outStreamSupplier.apply(downloadPath.toFile())) { byte[] buffer = new byte[4096]; int read; while ((read = in.read(buffer)) >= 0) { out.write(buffer, 0, read); totalRead += read; } } long expectedSize = in.getFileLength(); if (totalRead != expectedSize) { throw new IOException("We expected to download " + expectedSize + " bytes but found we got " + totalRead); } return new DownloadMeta(downloadPath, newVersion); } }
Source:
public void testEagerCompact() { List<Type> types = ImmutableList.of(VARCHAR); PagesIndex lazyCompactPagesIndex = newPagesIndex(types, 50, false); PagesIndex eagerCompactPagesIndex = newPagesIndex(types, 50, true); for (int i = 0; i < 5; i++) { lazyCompactPagesIndex.addPage(somePage(types)); eagerCompactPagesIndex.addPage(somePage(types)); } for (int i = 0; i < 5; i++) { Block lazyCompactBlock = lazyCompactPagesIndex.getChannel(0).get(i); Block eagerCompactBlock = eagerCompactPagesIndex.getChannel(0).get(i); assertTrue(eagerCompactBlock.getRetainedSizeInBytes() < lazyCompactBlock.getRetainedSizeInBytes(), "Expect retained size of block in eager compact PagesIndex smaller than lazy compact PagesIndex"); Block compactBlock = lazyCompactBlock.copyRegion(0, lazyCompactBlock.getPositionCount()); assertEquals(eagerCompactBlock.getRetainedSizeInBytes(), compactBlock.getRetainedSizeInBytes()); } }

Target:
public void testEagerCompact() { List<Type> types = ImmutableList.of(VARCHAR); PagesIndex lazyCompactPagesIndex = newPagesIndex(types, 50, false); PagesIndex eagerCompactPagesIndex = newPagesIndex(types, 50, true); for (int i = 0; i < 5; i++) { lazyCompactPagesIndex.addPage(somePage(types)); eagerCompactPagesIndex.addPage(somePage(types)); assertTrue( eagerCompactPagesIndex.getEstimatedSize().toBytes() < lazyCompactPagesIndex.getEstimatedSize().toBytes(), "Expect eagerCompactPagesIndex retained less data than lazyCompactPagesIndex after adding the page, because the pages used in the test are compactable."); } lazyCompactPagesIndex.compact(); assertEquals(lazyCompactPagesIndex.getEstimatedSize(), eagerCompactPagesIndex.getEstimatedSize()); }
Source:
private File getLogsRoot() { final String overriddenLogsRoot = System.getProperty("hudson.triggers.SafeTimerTask.logsTargetDir"); if (overriddenLogsRoot == null) { return new File(Jenkins.get().getRootDir(), "logs"); } else { return new File(overriddenLogsRoot); } }

Target:
protected static File getLogsRoot() { final String overriddenLogsRoot = System.getProperty("hudson.triggers.SafeTimerTask.logsTargetDir"); if (overriddenLogsRoot == null) { return new File(Jenkins.get().getRootDir(), "logs"); } else { return new File(overriddenLogsRoot); } }
Source:
private void initSqlTypes() { sqlTypes.put("CALLITEM", "VARCHAR"); sqlTypes.put("COLORITEM", "VARCHAR"); sqlTypes.put("CONTACTITEM", "VARCHAR"); sqlTypes.put("DATETIMEITEM", "TIMESTAMP"); sqlTypes.put("DIMMERITEM", "SMALLINT"); sqlTypes.put("LOCATIONITEM", "VARCHAR"); sqlTypes.put("NUMBERITEM", "DOUBLE PRECISION"); sqlTypes.put("ROLLERSHUTTERITEM", "SMALLINT"); sqlTypes.put("STRINGITEM", "VARCHAR"); sqlTypes.put("SWITCHITEM", "VARCHAR"); logger.debug("JDBC::initPostgreSqlTypes: Initialize the type array sqlTypes={}", sqlTypes.values()); }

Target:
private void initSqlTypes() { sqlTypes.put("CALLITEM", "VARCHAR"); sqlTypes.put("COLORITEM", "VARCHAR"); sqlTypes.put("CONTACTITEM", "VARCHAR"); sqlTypes.put("DATETIMEITEM", "TIMESTAMP"); sqlTypes.put("DIMMERITEM", "SMALLINT"); sqlTypes.put("LOCATIONITEM", "VARCHAR"); sqlTypes.put("NUMBERITEM", "DOUBLE PRECISION"); sqlTypes.put("ROLLERSHUTTERITEM", "SMALLINT"); sqlTypes.put("STRINGITEM", "VARCHAR"); sqlTypes.put("SWITCHITEM", "VARCHAR"); logger.debug("JDBC::initSqlTypes: Initialize the type array sqlTypes={}", sqlTypes.values()); }
Source:
public void testConnectionUnavailable() throws IOException, InterruptedException { initialize(); List<RequestInfo> requestInfoList = new ArrayList<RequestInfo>(); List<ResponseInfo> responseInfoList; int requestCount; requestInfoList.add(new RequestInfo(host2, port2, new MockSend(3))); requestInfoList.add(new RequestInfo(host2, port2, new MockSend(4))); requestCount = requestInfoList.size(); responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); Assert.assertEquals("There are no responses expected", 0, responseInfoList.size()); time.sleep(CHECKOUT_TIMEOUT_MS + 1); do { responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); for (ResponseInfo responseInfo : responseInfoList) { NetworkClientErrorCode error = responseInfo.getError(); ByteBuffer response = responseInfo.getResponse(); Assert.assertNotNull("Should have encountered an error", error); Assert.assertEquals("Should have received a connection unavailable error", NetworkClientErrorCode.ConnectionUnavailable, error); Assert.assertNull("Should not have received a valid response", response); requestCount--; } } while (requestCount > 0); responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); Assert.assertEquals("No responses are expected at this time", 0, responseInfoList.size()); }

Target:
public void testConnectionUnavailable() throws IOException, InterruptedException { List<RequestInfo> requestInfoList = new ArrayList<RequestInfo>(); List<ResponseInfo> responseInfoList; requestInfoList.add(new RequestInfo(host2, port2, new MockSend(3))); requestInfoList.add(new RequestInfo(host2, port2, new MockSend(4))); int requestCount = requestInfoList.size(); int responseCount = 0; responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); Assert.assertEquals("There are no responses expected", 0, responseInfoList.size()); time.sleep(CHECKOUT_TIMEOUT_MS + 1); do { responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); for (ResponseInfo responseInfo : responseInfoList) { NetworkClientErrorCode error = responseInfo.getError(); ByteBuffer response = responseInfo.getResponse(); Assert.assertNotNull("Should have encountered an error", error); Assert.assertEquals("Should have received a connection unavailable error", NetworkClientErrorCode.ConnectionUnavailable, error); Assert.assertNull("Should not have received a valid response", response); responseCount++; } } while (requestCount > responseCount); responseInfoList = networkClient.sendAndPoll(requestInfoList); requestInfoList.clear(); Assert.assertEquals("No responses are expected at this time", 0, responseInfoList.size()); }
Source:
private static String lockMapToString(Map<String, Pair<String, String>> map) { if (map == null) { return "null"; } return map.entrySet().stream().map(e -> e.getKey() + '=' + e.getValue().getFirst()).collect(Collectors.joining(", ", "[", "]")); }

Target:
private static String lockMapToString(Map<String, Pair<String, String>> map) { if (map == null) { return ""; } return map.entrySet() .stream() .map(e -> e.getKey() + '=' + e.getValue().getFirst()) .collect(Collectors.joining(", ", "[", "]")); }
Source:
private Mono<TextAnalyticsPagedResponse<DetectLanguageResult>> getDetectedLanguageResponseInPage( Iterable<DetectLanguageInput> documents, TextAnalyticsRequestOptions options, Context context) { return service.languagesWithResponseAsync( new LanguageBatchInput().setDocuments(toLanguageInput(documents)), context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE), options == null ? null : options.getModelVersion(), options == null ? null : options.isIncludeStatistics()) .doOnSubscribe(ignoredValue -> logger.info("A batch of documents - {}", documents.toString())) .doOnSuccess(response -> logger.info("Detected languages for a batch of documents - {}", response.getValue())) .doOnError(error -> logger.warning("Failed to detect language - {}", error)) .map(this::toTextAnalyticsPagedResponse) .onErrorMap(throwable -> { if (throwable instanceof TextAnalyticsErrorException) { TextAnalyticsErrorException errorException = (TextAnalyticsErrorException) throwable; return new HttpResponseException(errorException.getMessage(), errorException.getResponse()); } return throwable; }); }

Target:
private Mono<TextAnalyticsPagedResponse<DetectLanguageResult>> getDetectedLanguageResponseInPage( Iterable<DetectLanguageInput> documents, TextAnalyticsRequestOptions options, Context context) { return service.languagesWithResponseAsync( new LanguageBatchInput().setDocuments(toLanguageInput(documents)), context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE), options == null ? null : options.getModelVersion(), options == null ? null : options.isIncludeStatistics()) .doOnSubscribe(ignoredValue -> logger.info("A batch of documents - {}", documents.toString())) .doOnSuccess(response -> logger.info("Detected languages for a batch of documents - {}", response.getValue())) .doOnError(error -> logger.warning("Failed to detect language - {}", error)) .map(this::toTextAnalyticsPagedResponse) .onErrorMap(throwable -> mapToHttpResponseExceptionIfExist(throwable)); }
Source:
protected void updateReferences(IProgressMonitor monitor, IProject project) throws JavaModelException { IJavaProject currentProject = JavaCore.create(project); IPluginModelBase[] pluginstoUpdate = fData.getPluginsToUpdate(); for (int i = 0; i < pluginstoUpdate.length; ++i) { IProject proj = pluginstoUpdate[i].getUnderlyingResource().getProject(); if (currentProject.getProject().equals(proj)) continue; IJavaProject javaProject = JavaCore.create(proj); IClasspathEntry[] cp = javaProject.getRawClasspath(); IClasspathEntry[] updated = getUpdatedClasspath(cp, currentProject); if (updated != null) { javaProject.setRawClasspath(updated, monitor); } try { updateRequiredPlugins(javaProject, monitor, pluginstoUpdate[i]); } catch (CoreException e) { PDEPlugin.log(e); } } }

Target:
protected void updateReferences(IProgressMonitor monitor, IProject project) throws JavaModelException { IJavaProject currentProject = JavaCore.create(project); IPluginModelBase[] pluginstoUpdate = fData.getPluginsToUpdate(); SubMonitor subMonitor = SubMonitor.convert(monitor, pluginstoUpdate.length); for (int i = 0; i < pluginstoUpdate.length; ++i) { SubMonitor iterationMonitor = subMonitor.newChild(1).setWorkRemaining(2); IProject proj = pluginstoUpdate[i].getUnderlyingResource().getProject(); if (currentProject.getProject().equals(proj)) continue; IJavaProject javaProject = JavaCore.create(proj); IClasspathEntry[] cp = javaProject.getRawClasspath(); IClasspathEntry[] updated = getUpdatedClasspath(cp, currentProject); if (updated != null) { javaProject.setRawClasspath(updated, iterationMonitor.newChild(1)); } iterationMonitor.setWorkRemaining(1); try { updateRequiredPlugins(javaProject, iterationMonitor.newChild(1), pluginstoUpdate[i]); } catch (CoreException e) { PDEPlugin.log(e); } } }
Source:
public boolean deregisterIncomingRelationships(Long tgt, String relationshipType, Class endNodeType, boolean relationshipEntity) { Iterator<Mappable> iterator = registeredRelationships.iterator(); List<Mappable> candidatesForDeletion = new ArrayList<>(); while (iterator.hasNext()) { Mappable mappedRelationship = iterator.next(); if (mappedRelationship.getEndNodeId() == tgt && mappedRelationship.getRelationshipType().equals(relationshipType) && endNodeType.equals( relationshipEntity ? mappedRelationship.getEndNodeType() : mappedRelationship.getStartNodeType())) { candidatesForDeletion.add(mappedRelationship); iterator.remove(); } } boolean notInGraphAtAll = candidatesForDeletion.size() == 0; return notInGraphAtAll || handleDeletionCandidates(candidatesForDeletion); }

Target:
public boolean deregisterIncomingRelationships(Long tgt, String relationshipType, Class endNodeType, boolean relationshipEntity) { Function<Mappable, Class> endNodeTypeExtractor = relationshipEntity ? Mappable::getEndNodeType : Mappable::getStartNodeType; return deregisterRelationshipsImpl(tgt, relationshipType, endNodeType, Mappable::getEndNodeId, endNodeTypeExtractor); }
Source:
protected void checkDatabaseConfiguration(Environment env, DataSource dataSource) { JdbcTemplate jdbc = new JdbcTemplate(dataSource); Long dbTimeZoneOffsetHours = jdbc.queryForObject("select current timezone from sysibm.sysdummy1", Long.class); Long propsTimeZoneOffsetHours = HOURS.convert( TimeZone.getTimeZone(property(env, "timezone")).getOffset(currentTimeMillis()), MILLISECONDS); if (!Objects.equals(dbTimeZoneOffsetHours, propsTimeZoneOffsetHours)) { throw new RuntimeException("Database has unexpected time zone - hour offset DB2: " + dbTimeZoneOffsetHours + ", properties: " + propsTimeZoneOffsetHours); } }

Target:
protected void checkDatabaseConfiguration(Environment env, DataSource dataSource) { JdbcTemplate jdbc = new JdbcTemplate(dataSource); Long dbTimeZoneOffsetHours = jdbc.queryForObject("select current timezone from sysibm.sysdummy1", Long.class); Long propsTimeZoneOffsetHours = HOURS.convert( TimeZone.getTimeZone(property(env, "timezone")).getOffset(currentTimeMillis()), MILLISECONDS); if (!Objects.equals(dbTimeZoneOffsetHours, propsTimeZoneOffsetHours)) { throw new RuntimeException("Database has unexpected time zone - hour offset in DB2 is " + dbTimeZoneOffsetHours + " but the expected hour offset based on timezone-property is " + propsTimeZoneOffsetHours + ". Change the timezone-property to match with your DB2 time zone."); } }
Source:
public Job dropStudyJob(JobBuilderFactory jobBuilderFactory) { logger.debug("Building '" + DROP_STUDY_JOB + "'"); JobBuilder jobBuilder = jobBuilderFactory .get(DROP_STUDY_JOB) .incrementer(new RunIdIncrementer()) .validator(new AggregatedVcfJobParametersValidator()); SimpleJobBuilder builder = jobBuilder .start(dropSingleStudyVariantsStep); return builder.build(); }

Target:
public Job dropStudyJob(JobBuilderFactory jobBuilderFactory) { logger.debug("Building '" + DROP_STUDY_JOB + "'"); JobBuilder jobBuilder = jobBuilderFactory .get(DROP_STUDY_JOB) .incrementer(new RunIdIncrementer()); SimpleJobBuilder builder = jobBuilder .start(dropSingleStudyVariantsStep); return builder.build(); }
Source:
public String withdrawFunds(WithdrawFundsParams p) throws IOException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException { if (p instanceof DefaultWithdrawFundsParams) { DefaultWithdrawFundsParams params = (DefaultWithdrawFundsParams) p; CoingiWithdrawalRequest request = new CoingiWithdrawalRequest() .setAddress(params.address) .setAmount(params.amount) .setCurrency(params.currency.getCurrencyCode().toUpperCase()); return withdraw(request).toString(); } throw new NotYetImplementedForExchangeException(); }

Target:
public String withdrawFunds(WithdrawFundsParams p) throws IOException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException { try { if (p instanceof DefaultWithdrawFundsParams) { DefaultWithdrawFundsParams params = (DefaultWithdrawFundsParams) p; CoingiWithdrawalRequest request = new CoingiWithdrawalRequest() .setAddress(params.address) .setAmount(params.amount) .setCurrency(params.currency.getCurrencyCode().toUpperCase()); return withdraw(request).toString(); } throw new NotYetImplementedForExchangeException(); } catch (CoingiException e) { throw CoingiErrorAdapter.adapt(e); } }
Source:
public void intercept(InterceptorStack stack, ControllerMethod method, Object controllerInstance) throws InterceptionException { try { Method reflectionMethod = method.getMethod(); Object[] parameters = this.info.getParameters(); log.debug("Invoking {}", Stringnifier.simpleNameFor(reflectionMethod)); Object result = methodExecutor.invoke(reflectionMethod, controllerInstance, parameters); if (validator.hasErrors()) { if (log.isDebugEnabled()) { try { validator.onErrorUse(nothing()); } catch (ValidationException e) { log.debug("Some validation errors occured: {}", e.getErrors()); } } throw new InterceptionException( "There are validation errors and you forgot to specify where to go. Please add in your method " + "something like:\n" + "validator.onErrorUse(page()).of(AnyController.class).anyMethod();\n" + "or any view that you like.\n" + "If you didn't add any validation error, it is possible that a conversion error had happened."); } if (reflectionMethod.getReturnType().equals(Void.TYPE)) { this.info.setResult("ok"); } else { this.info.setResult(result); Type returnType = reflectionMethod.getGenericReturnType(); outjectResultEvent.fire(new OutjectResultEvent(returnType)); } stack.next(method, controllerInstance); } catch (IllegalArgumentException e) { throw new InterceptionException(e); } catch (MethodExecutorException e) { throwIfNotValidationException(e, new ApplicationLogicException("your controller raised an exception", e.getCause())); } catch (Exception e) { throwIfNotValidationException(e, new InterceptionException(e)); } }

Target:
public void intercept(InterceptorStack stack, ControllerMethod method, Object controllerInstance) throws InterceptionException { try { Method reflectionMethod = method.getMethod(); Object[] parameters = this.info.getParameters(); log.debug("Invoking {}", Stringnifier.simpleNameFor(reflectionMethod)); Object result = methodExecutor.invoke(reflectionMethod, controllerInstance, parameters); if (validator.hasErrors()) { if (log.isDebugEnabled()) { try { validator.onErrorUse(nothing()); } catch (ValidationException e) { log.debug("Some validation errors occured: {}", e.getErrors()); } } throw new InterceptionException( "There are validation errors and you forgot to specify where to go. Please add in your method " + "something like:\n" + "validator.onErrorUse(page()).of(AnyController.class).anyMethod();\n" + "or any view that you like.\n" + "If you didn't add any validation error, it is possible that a conversion error had happened."); } if (!reflectionMethod.getReturnType().equals(Void.TYPE)) { this.info.setResult(result); Type returnType = reflectionMethod.getGenericReturnType(); outjectResultEvent.fire(new OutjectResultEvent(returnType)); } stack.next(method, controllerInstance); } catch (IllegalArgumentException e) { throw new InterceptionException(e); } catch (MethodExecutorException e) { throwIfNotValidationException(e, new ApplicationLogicException("your controller raised an exception", e.getCause())); } catch (Exception e) { throwIfNotValidationException(e, new InterceptionException(e)); } }
Source:
protected EnumDeclaration create(CompilationUnit compilationUnit) { EnumDeclaration lambdaClass = super.create(compilationUnit); boolean hasDroolsParameter = lambdaParameters.stream().anyMatch(this::isDroolsParameter); if (hasDroolsParameter) { bitMaskVariables.stream().forEach(vd -> { Optional<ExpressionStmt> expressionStmt = vd.findAncestor(ExpressionStmt.class); MethodCallExpr methodCallExpr = expressionStmt.flatMap(a -> a.findFirst(MethodCallExpr.class)) .orElseThrow(() -> new IllegalStateException("MethodCallExpr is not found")); lambdaClass.addFieldWithInitializer(vd.getType(), vd.getName().asString(), methodCallExpr, Modifier.Keyword.PRIVATE, Modifier.Keyword.FINAL); }); } return lambdaClass; }

Target:
protected EnumDeclaration create(CompilationUnit compilationUnit) { EnumDeclaration lambdaClass = super.create(compilationUnit); boolean hasDroolsParameter = lambdaParameters.stream().anyMatch(this::isDroolsParameter); if (hasDroolsParameter) { bitMaskVariables.forEach(vd -> vd.generateBitMaskField(lambdaClass)); } return lambdaClass; }
Source:
public void notifyParameterChanged(String name) { if (!fParameterNames.contains(name)) { throw new RuntimeException(String.format(Messages.TmfAbstractAnalysisModule_InvalidParameter, name, getName())); } synchronized (fParameters) { Object oldValue = fParameters.get(name); Object value = getParameter(name); if ((value != null) && !(value.equals(oldValue))) { parameterChanged(name); } } }

Target:
public void notifyParameterChanged(String name) { synchronized (fParameters) { if (!fParameterNames.contains(name)) { throw new RuntimeException(String.format(Messages.TmfAbstractAnalysisModule_InvalidParameter, name, getName())); } Object oldValue = fParameters.get(name); Object value = getParameter(name); if ((value != null) && !(value.equals(oldValue))) { parameterChanged(name); } } }
Source:
public Release tagged(final String name) throws IOException { return this.get( this.tagged.path(name).back().method(Request.GET) .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_CREATED) .as(JsonResponse.class) .json().readObject().getInt("id") ); }

Target:
public Release tagged(final String name) throws IOException { return this.get( this.request.uri().path("/tags/").path(name) .back().method(Request.GET) .fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_CREATED) .as(JsonResponse.class) .json().readObject().getInt("id") ); }
Source:
private void updateSelection() { String lastNavFragment = getLastNavFragment(getContext()); int tagIndex = navAdapter.getTags().indexOf(lastNavFragment); if (tagIndex >= 0) { selectedNavListIndex = tagIndex; } else if (StringUtils.isNumeric(lastNavFragment)) { long feedId = Long.parseLong(lastNavFragment); if (navDrawerData != null) { List<Feed> feeds = navDrawerData.feeds; for (int i = 0; i < feeds.size(); i++) { if (feeds.get(i).getId() == feedId) { selectedNavListIndex = navAdapter.getSubscriptionOffset() + i; break; } } } } navAdapter.notifyDataSetChanged(); if (UserPreferences.getFeedFilter() != UserPreferences.FEED_FILTER_NONE) filteredMsg.setVisibility(View.VISIBLE); else filteredMsg.setVisibility(View.GONE); }

Target:
private void updateSelection() { String lastNavFragment = getLastNavFragment(getContext()); int tagIndex = navAdapter.getTags().indexOf(lastNavFragment); if (tagIndex >= 0) { selectedNavListIndex = tagIndex; } else if (StringUtils.isNumeric(lastNavFragment)) { long feedId = Long.parseLong(lastNavFragment); if (navDrawerData != null) { List<Feed> feeds = navDrawerData.feeds; for (int i = 0; i < feeds.size(); i++) { if (feeds.get(i).getId() == feedId) { selectedNavListIndex = navAdapter.getSubscriptionOffset() + i; break; } } } } navAdapter.notifyDataSetChanged(); }
Source:
public SymbolTable build(SymbolTable genericsSymbolTable) throws Exception { if (generics != null) { SymbolType[] syms = ASTSymbolTypeResolver.getInstance().valueOf(generics); genericsSymbolTable.pushScope(); updateTypeMappings(Arrays.asList(syms), method.getTypeParameters(), true, genericsSymbolTable, new HashSet<String>()); } else if (scope != null) { String symbolName = scope.getClazz().getName(); if (scope.getClazz().isMemberClass()) { symbolName = scope.getClazz().getCanonicalName(); } Symbol<?> s = symbolTable.findSymbol(symbolName, ReferenceType.TYPE); if (s != null) { Scope scope = s.getInnerScope(); if (scope != null) { Map<String, SymbolType> typeParams = scope.getTypeParams(); Scope newScope = new Scope(); for (String key : typeParams.keySet()) { SymbolType aux = typeParams.get(key).clone(); aux.setTemplateVariable(key); newScope.addSymbol(key, aux, null); } genericsSymbolTable.pushScope(newScope); } } updateTypeMapping(clazz, genericsSymbolTable, scope, false, new HashSet<String>()); Scope newScope = new Scope(); genericsSymbolTable.pushScope(newScope); if (method != null) { TypeVariable<?>[] typeParams = method.getTypeParameters(); for (int i = 0; i < typeParams.length; i++) { SymbolType aux = SymbolType.valueOf(typeParams[i], null); aux.setTemplateVariable(typeParams[i].getName()); genericsSymbolTable.pushSymbol(typeParams[i].getName(), ReferenceType.TYPE_PARAM, aux, null); } } } else { Scope newScope = new Scope(); genericsSymbolTable.pushScope(newScope); } return genericsSymbolTable; }

Target:
public SymbolTable build(SymbolTable genericsSymbolTable) throws Exception { if (generics != null) { SymbolType[] syms = ASTSymbolTypeResolver.getInstance().valueOf(generics); genericsSymbolTable.pushScope(); updateTypeMappings(Arrays.asList(syms),method.getTypeParameters(), true, genericsSymbolTable,new HashSet<String>()); } else if (scope != null) { String symbolName = scope.getClazz().getName(); if (scope.getClazz().isMemberClass()) { symbolName = scope.getClazz().getCanonicalName(); } Symbol<?> s = symbolTable.findSymbol(symbolName, ReferenceType.TYPE); if (s != null) { Scope scope = s.getInnerScope(); if (scope != null) { Map<String, SymbolType> typeParams = scope.getTypeParams(); Scope newScope = new Scope(); for (String key : typeParams.keySet()) { SymbolType aux = typeParams.get(key).cloneAsTypeVariable(key); newScope.addSymbol(key, aux, null); } genericsSymbolTable.pushScope(newScope); } } updateTypeMapping(clazz, genericsSymbolTable, scope, false, new HashSet<String>()); Scope newScope = new Scope(); genericsSymbolTable.pushScope(newScope); if (method != null) { TypeVariable<?>[] typeParams = method.getTypeParameters(); for (int i = 0; i < typeParams.length; i++) { SymbolType aux = SymbolType.typeVariableOf(typeParams[i]); genericsSymbolTable.pushSymbol(typeParams[i].getName(), ReferenceType.TYPE_PARAM, aux, null); } } } else { Scope newScope = new Scope(); genericsSymbolTable.pushScope(newScope); } return genericsSymbolTable; }
Source:
public byte[][] getByteParams(byte[]... args) { ArrayList<byte[]> byteParams = new ArrayList<byte[]>(); for (byte[] arg : args) { byteParams.add(arg); } if (contains(NX)) { byteParams.add(SafeEncoder.encode(NX)); } if (contains(XX)) { byteParams.add(SafeEncoder.encode(XX)); } if (contains(EX)) { byteParams.add(SafeEncoder.encode(EX)); final Object param = getParam(EX); byteParams.add(SafeEncoder.encode(String.valueOf(param))); } if (contains(PX)) { byteParams.add(SafeEncoder.encode(PX)); final Object param = getParam(PX); byteParams.add(SafeEncoder.encode(String.valueOf(param))); } return byteParams.toArray(new byte[byteParams.size()][]); }

Target:
public byte[][] getByteParams(byte[]... args) { ArrayList<byte[]> byteParams = new ArrayList<byte[]>(); for (byte[] arg : args) { byteParams.add(arg); } if (contains(NX)) { byteParams.add(SafeEncoder.encode(NX)); } if (contains(XX)) { byteParams.add(SafeEncoder.encode(XX)); } if (contains(EX)) { byteParams.add(SafeEncoder.encode(EX)); byteParams.add(Protocol.toByteArray((int) getParam(EX))); } if (contains(PX)) { byteParams.add(SafeEncoder.encode(PX)); byteParams.add(Protocol.toByteArray((long) getParam(PX))); } return byteParams.toArray(new byte[byteParams.size()][]); }
Source:
private Map<String, Resource> getAllMetacardContent(Metacard metacard) { Map<String, Resource> resourceMap = new HashMap<>(); Attribute attribute = metacard.getAttribute(Metacard.DERIVED_RESOURCE_URI); if (attribute != null) { List<Serializable> serializables = attribute.getValues(); serializables.forEach( serializable -> { String fragment = CONTENT + File.separator; URI uri = null; try { uri = new URI((String) serializable); String derivedResourceFragment = uri.getFragment(); if (ContentItem.CONTENT_SCHEME.equals(uri.getScheme()) && StringUtils.isNotBlank(derivedResourceFragment)) { fragment += derivedResourceFragment + File.separator; Resource resource = getResource(metacard); if (resource != null) { resourceMap.put( fragment + uri.getSchemeSpecificPart() + "-" + resource.getName(), resource); } } } catch (URISyntaxException e) { LOGGER.debug( "Invalid Derived Resource URI Syntax for metacard : {}", metacard.getId(), e); } }); } URI resourceUri = metacard.getResourceURI(); Resource resource = getResource(metacard); if (resource != null) { resourceMap.put( CONTENT + File.separator + resourceUri.getSchemeSpecificPart() + "-" + resource.getName(), resource); } return resourceMap; }

Target:
private Map<String, Resource> getAllMetacardContent(Metacard metacard) { Attribute attribute = metacard.getAttribute(Metacard.DERIVED_RESOURCE_URI); Map<String, Resource> resourceMap = getResourceMap(metacard, attribute); URI resourceUri = metacard.getResourceURI(); Resource resource = getResource(metacard); if (resource != null) { resourceMap.put( CONTENT + File.separator + resourceUri.getSchemeSpecificPart() + "-" + resource.getName(), resource); } return resourceMap; }
Source:
public void schedulerEntries(WebContext ctx) { BasePageHelper<J, ?, ?, ?> ph = getEntriesAsPage(); ph.withContext(ctx); ph.addBooleanFacet(SchedulerEntry.SCHEDULER_DATA.inner(SchedulerData.ENABLED).getName(), NLS.get("SchedulerData.enabled")); ph.withSearchFields(QueryField.contains(SchedulerEntry.JOB_CONFIG_DATA.inner(JobConfigData.JOB_NAME))); ctx.respondWith().template("templates/biz/jobs/scheduler/entries.html.pasta", ph.asPage()); }

Target:
public void schedulerEntries(WebContext ctx) { BasePageHelper<J, ?, ?, ?> pageHelper = getEntriesAsPage(); pageHelper.withContext(ctx); pageHelper.addBooleanFacet(SchedulerEntry.SCHEDULER_DATA.inner(SchedulerData.ENABLED).getName(), NLS.get("SchedulerData.enabled")); pageHelper.withSearchFields(QueryField.contains(SchedulerEntry.JOB_CONFIG_DATA.inner(JobConfigData.JOB_NAME))); ctx.respondWith().template("templates/biz/jobs/scheduler/entries.html.pasta", pageHelper.asPage()); }
Source:
public void setPrimaryColor(int color, int glowRadius, int glowColor, int textureId) { if (clock != null) { ValueAnimator anim = new ValueAnimator(); anim.setIntValues(clock.getCurrentTextColor(), color); anim.setEvaluator(new ArgbEvaluator()); anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { clock.setTextColor((Integer)valueAnimator.getAnimatedValue()); } }); anim.setDuration(1000); anim.start(); applyTexture(clock, glowRadius, glowColor, textureId); } if ( clock_ampm != null ) { clock_ampm.setTextColor(color); applyTexture(clock_ampm, glowRadius, glowColor, textureId); } if (analog_clock != null) { analog_clock.setPrimaryColor(color); } if (layoutId == LAYOUT_ID_DIGITAL_FLIP) { CustomDigitalFlipClock layout = findViewById(R.id.time_layout); layout.setPrimaryColor(color); } if (calendarView != null) { calendarView.setSelectionColor(color); } }

Target:
public void setPrimaryColor(int color, int glowRadius, int glowColor, int textureId) { if (clock != null) { clock.setTextColor(color); applyTexture(clock, glowRadius, glowColor, textureId); } if ( clock_ampm != null ) { clock_ampm.setTextColor(color); applyTexture(clock_ampm, glowRadius, glowColor, textureId); } if (analog_clock != null) { analog_clock.setPrimaryColor(color); } if (layoutId == LAYOUT_ID_DIGITAL_FLIP) { CustomDigitalFlipClock layout = findViewById(R.id.time_layout); layout.setPrimaryColor(color); } if (calendarView != null) { calendarView.setSelectionColor(color); } }
Source:
public void launchPictureViewsRecomputation() { if (!StringUtils.isBlank(nxqlQuery)) { BulkService service = Framework.getService(BulkService.class); String user = documentManager.getPrincipal().getName(); service.submit(new BulkCommand.Builder(ACTION_NAME, nxqlQuery).user(user).build()); facesMessages.addFromResourceBundle(StatusMessage.Severity.INFO, "label.imaging.recompute.work.launched"); } }

Target:
public void launchPictureViewsRecomputation() { if (!StringUtils.isBlank(nxqlQuery)) { BulkService service = Framework.getService(BulkService.class); String user = documentManager.getPrincipal().getName(); service.submit(new BulkCommand.Builder(ACTION_NAME, nxqlQuery, user) .param(PARAM_XPATH, "file:content") .build()); facesMessages.addFromResourceBundle(StatusMessage.Severity.INFO, "label.imaging.recompute.work.launched"); } }
Source:
public void addBundle(VersionedClause versionedBundle) throws CoreException { loadModel(); fBuildPathBundles.add(versionedBundle.getName()); if (fBuildPathVersioned.add(versionedBundle)) { fBuildPath.add(versionedBundle); } fBndModel.setBuildPath(fBuildPath); fBndModel.saveChangesTo(fBndDoc); InputStream str; try { str = new ByteArrayInputStream(fBndDoc.get() .getBytes(fBndFile.getCharset())); } catch (UnsupportedEncodingException e) { throw new CoreException(new Status(IStatus.ERROR, BndtoolsConstants.CORE_PLUGIN_ID, "Invalid encoding for " + fBndFile, e)); } fBndFile.setContents(str, IResource.KEEP_HISTORY, fMonitor); }

Target:
public void addBundle(VersionedClause versionedBundle) throws CoreException { loadModel(); buildPathBundles.add(versionedBundle.getName()); if (buildPathVersioned.add(versionedBundle)) { buildPath.add(versionedBundle); } bndModel.setBuildPath(buildPath); bndModel.saveChangesTo(bndDoc); InputStream str; try { str = new ByteBufferInputStream(bndDoc.get() .getBytes(bndFile.getCharset())); } catch (UnsupportedEncodingException e) { throw new CoreException(new Status(IStatus.ERROR, BndtoolsConstants.CORE_PLUGIN_ID, "Invalid encoding for " + bndFile, e)); } bndFile.setContents(str, IResource.KEEP_HISTORY, monitor); }
Source:
public void missingNonSuffixFieldsAreNotToleratedInPrefixMode() throws JsonProcessingException { JsonNode jsonNode = OBJECT_MAPPER.readTree(MULTIPART_NAME_METADATA_DESCRIPTION.renderToJson(SAMPLE_ROW)); ((ObjectNode) jsonNode).remove(ImmutableList.of("alpha", "omega")); assertThatThrownBy(() -> MULTIPART_NAME_METADATA_DESCRIPTION.parseFromJson(jsonNode.toString(), false)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("JSON object is missing field: alpha"); }

Target:
public void missingNonSuffixFieldsAreNotToleratedInPrefixMode() throws JsonProcessingException { JsonNode jsonNode = OBJECT_MAPPER.readTree(MULTIPART_NAME_METADATA_DESCRIPTION.renderToJson(SAMPLE_ROW)); ((ObjectNode) jsonNode).remove(ImmutableList.of("alpha", "omega")); assertThatThrownBy(() -> MULTIPART_NAME_METADATA_DESCRIPTION.parseFromJson(jsonNode.toString(), true)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("JSON object is missing field: alpha"); }
Source:
private Connection acquireConnection() throws ClassNotFoundException, SQLException { Class.forName("org.apache.ignite.IgniteJdbcThinDriver"); StringBuilder urlBuilder = new StringBuilder(); urlBuilder.append("jdbc:ignite:thin://"); urlBuilder.append(igniteParameters.getHost()); if (igniteParameters.getPort() != null) { urlBuilder.append(":" + igniteParameters.getPort()); } if (igniteParameters.getSchema() != null) { urlBuilder.append("/" + igniteParameters.getSchema()); } if (igniteParameters.getUser() != null) { urlBuilder.append(";" + igniteParameters.getUser()); } if (igniteParameters.getPassword() != null) { urlBuilder.append(";" + igniteParameters.getPassword()); } if (igniteParameters.getAdditionalConfigurations() != null) { urlBuilder.append(igniteParameters.getAdditionalConfigurations()); } return DriverManager.getConnection(urlBuilder.toString()); }

Target:
private Connection acquireConnection() throws ClassNotFoundException, SQLException { Class.forName(IgniteBackendConstants.DRIVER_NAME); StringBuilder urlBuilder = new StringBuilder(); urlBuilder.append(IgniteBackendConstants.JDBC_PREFIX); urlBuilder.append(igniteParameters.getHost()); if (igniteParameters.getPort() != null) { urlBuilder.append(":" + igniteParameters.getPort()); } if (igniteParameters.getSchema() != null) { urlBuilder.append("/" + igniteParameters.getSchema()); } if (igniteParameters.getUser() != null) { urlBuilder.append(";" + igniteParameters.getUser()); } if (igniteParameters.getPassword() != null) { urlBuilder.append(";" + igniteParameters.getPassword()); } if (igniteParameters.getAdditionalConfigurations() != null) { urlBuilder.append(igniteParameters.getAdditionalConfigurations()); } return DriverManager.getConnection(urlBuilder.toString()); }
Source:
public void broadcastUpdateNotebookJobInfo(long lastUpdateUnixTime) throws IOException { List<Map<String, Object>> notebookJobs; notebookJobs = notebook().getJobListforNotebookFromUnixTime(false, lastUpdateUnixTime, null); Map<String, Object> response = new HashMap<>(); response.put("lastResponseUnixTime", System.currentTimeMillis()); response.put("jobs", notebookJobs); broadcast(JOB_MANAGER_SERVICE.JOB_MANAGER_PAGE.getKey(), new Message(OP.LIST_UPDATE_NOTEBOOK_JOBS).put("notebookRunningJobs", response)); }

Target:
public void broadcastUpdateNotebookJobInfo(long lastUpdateUnixTime) throws IOException { List<Map<String, Object>> notebookJobs = new LinkedList<>(); Notebook notebookObject = notebook(); List<Map<String, Object>> jobNotes = null; if (notebookObject != null) { jobNotes = notebook().getJobListByUnixTime(false, lastUpdateUnixTime, null); notebookJobs = jobNotes == null ? notebookJobs : jobNotes; } Map<String, Object> response = new HashMap<>(); response.put("lastResponseUnixTime", System.currentTimeMillis()); response.put("jobs", notebookJobs != null ? notebookJobs : new LinkedList<>()); broadcast(JOB_MANAGER_SERVICE.JOB_MANAGER_PAGE.getKey(), new Message(OP.LIST_UPDATE_NOTEBOOK_JOBS).put("notebookRunningJobs", response)); }
Source:
protected boolean onSave(CommitBuilder commit) throws IOException, ConfigInvalidException { if (commit.getMessage() == null || "".equals(commit.getMessage())) { commit.setMessage("Updated reviewers configuration\n"); } saveConfig(FILENAME, cfg); return true; }

Target:
protected boolean onSave(CommitBuilder commit) throws IOException, ConfigInvalidException { if (Strings.isNullOrEmpty(commit.getMessage())) { commit.setMessage("Update reviewers configuration\n"); } saveConfig(FILENAME, cfg); return true; }
Source:
public HostConnectionPool<CL> getPoolForOperation(BaseOperation<CL, ?> op, String hashtag) throws NoAvailableHostsException { String key = op.getKey(); HostToken hToken = null; if (hashtag == null) { hToken = this.getTokenForKey(key); } else { String hashValue = StringUtils.substringBetween(key,Character.toString(hashtag.charAt(0)), Character.toString(hashtag.charAt(1))); hToken = this.getTokenForKey(hashValue); } HostConnectionPool<CL> hostPool = null; if (hToken != null) { hostPool = tokenPools.get(hToken.getToken()); } if (hashtag == null) { if (hostPool == null) { throw new NoAvailableHostsException( "Could not find host connection pool for key: " + key + ", hash: " + tokenMapper.hash(key)); } } else { if (hostPool == null) { throw new NoAvailableHostsException( "Could not find host connection pool for hashtag: " + hashtag + ", hash: " + tokenMapper.hash(hashtag)); } } return hostPool; }

Target:
public HostConnectionPool<CL> getPoolForOperation(BaseOperation<CL, ?> op, String hashtag) throws NoAvailableHostsException { String key = op.getKey(); HostToken hToken = null; if (hashtag == null || hashtag.isEmpty()) { hToken = this.getTokenForKey(key); } else { String hashValue = StringUtils.substringBetween(key,Character.toString(hashtag.charAt(0)), Character.toString(hashtag.charAt(1))); hToken = this.getTokenForKey(hashValue); } HostConnectionPool<CL> hostPool = null; if (hToken != null) { hostPool = tokenPools.get(hToken.getToken()); } if (hostPool == null) { throw new NoAvailableHostsException( "Could not find host connection pool for key: " + key + ", hash: " + tokenMapper.hash(key)); } return hostPool; }
Source:
public boolean isFulfilled(@NonNull ITmfTrace trace) { if ((trace instanceof ITmfTraceWithPreDefinedEvents)) { Set<String> mandatoryValues = getValues(ValuePriorityLevel.MANDATORY); if (mandatoryValues.isEmpty()) { return true; } Multimap<@NonNull String, @NonNull String> traceEvents = TmfEventTypeCollectionHelper.getEventFieldNames((((ITmfTraceWithPreDefinedEvents) trace).getContainedEventTypes())); Predicate<String> predicate = new Predicate<String>() { @Override public boolean test(@NonNull String eventName) { Collection<@NonNull String> fields = traceEvents.get(eventName); return fields.containsAll(mandatoryValues); } }; if (fEventNames.isEmpty()) { return traceEvents.keys().stream().allMatch(predicate); } return fEventNames.stream().anyMatch(predicate); } return true; }

Target:
public boolean isFulfilled(@NonNull ITmfTrace trace) { if ((trace instanceof ITmfTraceWithPreDefinedEvents)) { Set<String> mandatoryValues = getValues(ValuePriorityLevel.MANDATORY); if (mandatoryValues.isEmpty()) { return true; } Multimap<@NonNull String, @NonNull String> traceEvents = TmfEventTypeCollectionHelper.getEventFieldNames((((ITmfTraceWithPreDefinedEvents) trace).getContainedEventTypes())); if (fEventName.isEmpty()) { return traceEvents.keys().stream().allMatch(eventName -> { Collection<@NonNull String> fields = traceEvents.get(fEventName); return fields.containsAll(mandatoryValues); }); } Collection<@NonNull String> fields = traceEvents.get(fEventName); return fields.containsAll(mandatoryValues); } return true; }
Source:
private void executeToolForMutableTables(Connection conn, ConnectionQueryServices queryServices, Configuration conf, ArrayList<String> mutableTables) { LOGGER.info("Started " + operation + " for mutable tables"); try (Admin admin = queryServices.getAdmin()) { for (String dataTableFullName : mutableTables) { dataTableFullNameGlobal = dataTableFullName; HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); LOGGER.info("Executing " + operation + " of " + dataTableFullName); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); enableTable(admin, dataTableFullName, indexes); LOGGER.info("Completed " + operation + " of " + dataTableFullName); } } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while executing " + operation + " steps for "+ dataTableFullNameGlobal + " " + e); handleFailure(queryServices, dataTableFullNameGlobal, mutableTables); } rebuildIndexes(conn, conf, mutableTables); }

Target:
private void executeToolForMutableTables(Connection conn, ConnectionQueryServices queryServices, Configuration conf, ArrayList<String> mutableTables) { LOGGER.info("Started " + operation + " for mutable tables"); for (String dataTableFullName : mutableTables) { try (Admin admin = queryServices.getAdmin()) { HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); LOGGER.info("Executing " + operation + " of " + dataTableFullName); disableTable(admin, dataTableFullName, indexes); modifyTable(admin, dataTableFullName, indexes); enableTable(admin, dataTableFullName, indexes); LOGGER.info("Completed " + operation + " of " + dataTableFullName); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while executing " + operation + " steps for "+ dataTableFullName + " " + e); handleFailure(queryServices, dataTableFullName, mutableTables); } } rebuildIndexes(conn, conf, mutableTables); }
Source:
public static void validateExternalPropertyActivation(MavenProject project, List<ImageConfiguration> images) throws MojoFailureException { String prop = getExternalConfigActivationProperty(project); if(prop == null) { return; } if(images.size() == 1) return; int imagesWithoutExternalConfig = 0; for (ImageConfiguration image : images) { if(PropertyConfigHandler.canCoexistWithOtherPropertyConfiguredImages(image.getExternalConfig())) continue; imagesWithoutExternalConfig++; } if(imagesWithoutExternalConfig > 1) { throw new MojoFailureException("Configuration error: Cannot use property "+EXTERNALCONFIG_ACTIVATION_PROPERTY+" on projects with multiple images without explicit image external configuration."); } }

Target:
public static void validateExternalPropertyActivation(MavenProject project, List<ImageConfiguration> images) throws MojoFailureException { String prop = getExternalConfigActivationProperty(project); if(prop == null) { return; } if(images.size() == 1) { return; } int imagesWithoutExternalConfig = 0; for (ImageConfiguration image : images) { if(PropertyConfigHandler.canCoexistWithOtherPropertyConfiguredImages(image.getExternalConfig())) { continue; } imagesWithoutExternalConfig++; } if(imagesWithoutExternalConfig > 1) { throw new MojoFailureException("Configuration error: Cannot use property "+EXTERNALCONFIG_ACTIVATION_PROPERTY+" on projects with multiple images without explicit image external configuration."); } }