auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void scanFile(XmlFile xmlFile) { if (!"pom.xml".equalsIgnoreCase(xmlFile.getInputFile().filename())) { return; } NodeList dependencies = evaluate(dependencyExpression, xmlFile.getNamespaceUnawareDocument()); for (int i = 0; i < dependencies.getLength(); i++) { Element dependency = (Element) dependencies.item(i); checkDependency(dependency); } }

Target:
protected void scanFile(XmlFile xmlFile) { if (!"pom.xml".equalsIgnoreCase(xmlFile.getInputFile().filename())) { return; } evaluateAsList(dependencyExpression, xmlFile.getNamespaceUnawareDocument()) .forEach(dependency -> checkDependency((Element) dependency)); }
Source:
protected void hookOnSubscribe(Subscription subscription) { this.subscription = subscription; logger.info("[{}] onSubscribe Pending: {}, Scheduling receive timeout task '{}'.", initialWork.getId(), initialWork.getNumberOfEvents(), initialWork.getTimeout()); queueWork(initialWork); }

Target:
protected void hookOnSubscribe(Subscription subscription) { if (Operators.setOnce(UPSTREAM, this, subscription)) { this.subscription = subscription; remaining.addAndGet(requested); subscription.request(requested); subscriberInitialized = true; drain(); } else { logger.error("Already subscribed once."); } }
Source:
public MaskOverviewProvider(DatasetLayout layout, File inputFile, ImageReaderSpi suggestedSPI) throws IOException { this (layout, inputFile, new SpiHelper(inputFile.toURI().toURL(), suggestedSPI)); }

Target:
public MaskOverviewProvider(DatasetLayout layout, File inputFile, ImageReaderSpi suggestedSPI) throws IOException { this (layout, inputFile, new SpiHelper(URLs.fileToUrl(inputFile), suggestedSPI)); }
Source:
private void deleteSearchItem(String item) { ArrayList<String> recents = new ArrayList<>(); Query<Preferences> query = mBucketPreferences.query(); try (ObjectCursor<Preferences> cursor = query.execute()) { if (cursor.moveToNext()) { recents = cursor.getObject().getRecentSearches(); } Preferences preferences = cursor.getObject(); mIndex = recents.indexOf(item); recents.remove(item); preferences.setRecentSearches(recents); preferences.save(); } }

Target:
private void deleteSearchItem(String item) { Preferences preferences = getPreferences(); if (preferences != null) { List<String> recents = preferences.getRecentSearches(); mDeletedItemIndex = recents.indexOf(item); recents.remove(item); preferences.setRecentSearches(recents); preferences.save(); } else { Log.e("deleteSearchItem", "Could not get preferences entity"); } }
Source:
private void registerMethod(@Nonnull final MethodHandles.Lookup caller, @Nonnull final AbstractServer server, @Nonnull final Method method) { final RequestHandler annotation = method.getAnnotation(RequestHandler.class); if(handlerMap.containsKey(annotation.type())) { throw new UnrecoverableCorfuError("HandlerMethod for " + annotation.type() + " already registered!"); } try { HandlerMethod h; if (Modifier.isStatic(method.getModifiers())) { MethodHandle mh = caller.unreflect(method); h = (HandlerMethod) LambdaMetafactory.metafactory(caller, "handle", MethodType.methodType(HandlerMethod.class), mh.type(), mh, mh.type()).getTarget().invokeExact(); } else { MethodType mt = MethodType.methodType(method.getReturnType(), method.getParameterTypes()); MethodHandle mh = caller.findVirtual(server.getClass(), method.getName(), mt); MethodType mtt = mh.type().dropParameterTypes(0, 1); h = (HandlerMethod) LambdaMetafactory.metafactory(caller, "handle", MethodType.methodType(HandlerMethod.class, server.getClass()), mtt, mh, mtt).getTarget().bindTo(server).invoke(); } final HandlerMethod handler = generateConditionalHandler(annotation.type(), h); handlerMap.put(annotation.type(), handler); } catch(Throwable e) { log.error("registerMethod: Exception during request handler registration", e); throw new UnrecoverableCorfuError(e); } }

Target:
private void registerMethod(@Nonnull final MethodHandles.Lookup caller, @Nonnull final AbstractServer server, @Nonnull final Method method) { final RequestHandler annotation = method.getAnnotation(RequestHandler.class); if (handlerMap.containsKey(annotation.type())) { throw new IllegalStateException("HandlerMethod for " + annotation.type() + " already registered!"); } try { HandlerMethod h; if (Modifier.isStatic(method.getModifiers())) { MethodHandle mh = caller.unreflect(method); h = (HandlerMethod) LambdaMetafactory.metafactory(caller, "handle", MethodType.methodType(HandlerMethod.class), mh.type(), mh, mh.type()).getTarget().invokeExact(); } else { MethodType mt = MethodType.methodType(method.getReturnType(), method.getParameterTypes()); MethodHandle mh = caller.findVirtual(server.getClass(), method.getName(), mt); MethodType mtt = mh.type().dropParameterTypes(0, 1); h = (HandlerMethod) LambdaMetafactory.metafactory(caller, "handle", MethodType.methodType(HandlerMethod.class, server.getClass()), mtt, mh, mtt).getTarget().bindTo(server).invoke(); } final HandlerMethod handler = generateConditionalHandler(annotation.type(), h); handlerMap.put(annotation.type(), handler); } catch (Throwable e) { throw new UnrecoverableCorfuError("Exception during request handler registration", e); } }
Source:
protected StreamTaskListener createListener() { File f = getLogFile(); if (f.isFile()) { if ((lastRotateMillis == null) || (lastRotateMillis + logRotateMillis < System.currentTimeMillis()) || (logRotateSize > 0 && f.length() > logRotateSize)) { lastRotateMillis = System.currentTimeMillis(); File p = null; for (int i = 5; i >= 0; i--) { File o = i == 0 ? f : new File(f.getParentFile(), f.getName() + "." + i); if (o.isFile()) { if (p != null && !p.exists()) { if (!o.renameTo(p)) { logger.log(getErrorLoggingLevel(), "Could not rotate log files {0} to {1}", new Object[]{o, p}); } } else { if (!o.delete()) { logger.log(getErrorLoggingLevel(), "Could not delete log files {0} to enable rotation", o); } } p = o; } } } } if (!f.getParentFile().isDirectory()) { if (!f.getParentFile().mkdirs()) { logger.log(getErrorLoggingLevel(), "Could not create directory {0}", f.getParentFile()); } } try { return new StreamTaskListener(f, true, null); } catch (IOException e) { throw new Error(e); } }

Target:
protected StreamTaskListener createListener() { File f = getLogFile(); if (!f.getParentFile().isDirectory()) { if (!f.getParentFile().mkdirs()) { logger.log(getErrorLoggingLevel(), "Could not create directory {0}", f.getParentFile()); } } if (f.isFile()) { if ((lastRotateMillis + logRotateMillis < System.currentTimeMillis()) || (logRotateSize > 0 && f.length() > logRotateSize)) { lastRotateMillis = System.currentTimeMillis(); File prev = null; for (int i = 5; i >= 0; i--) { File curr = i == 0 ? f : new File(f.getParentFile(), f.getName() + "." + i); if (curr.isFile()) { if (prev != null && !prev.exists()) { if (!curr.renameTo(prev)) { logger.log(getErrorLoggingLevel(), "Could not rotate log files {0} to {1}", new Object[]{curr, prev}); } } else { if (!curr.delete()) { logger.log(getErrorLoggingLevel(), "Could not delete log file {0} to enable rotation", curr); } } } prev = curr; } } } else { lastRotateMillis = System.currentTimeMillis(); File oldFile = new File(Jenkins.getActiveInstance().getRootDir(), f.getName()); if (oldFile.isFile()) { File newFile = new File(f.getParentFile(), f.getName() + ".1"); if (!newFile.isFile()) { if (oldFile.renameTo(newFile)) { logger.log(getNormalLoggingLevel(), "Moved {0} to {1}", new Object[]{oldFile, newFile}); } else { logger.log(getErrorLoggingLevel(), "Could not move {0} to {1}", new Object[]{oldFile, newFile}); } } } } try { return new StreamTaskListener(f, true, null); } catch (IOException e) { throw new Error(e); } }
Source:
public void canSerializeAndDeserializeKeepingNonLoggability() { TableMetadataPersistence.NameComponentDescription.Builder builder = NAME_NOT_LOGGABLE_DESCRIPTION.persistToProto(); assertThat(NameComponentDescription.hydrateFromProto(builder.build())) .isEqualTo(NAME_NOT_LOGGABLE_DESCRIPTION) .matches(description -> !description.isNameLoggable()); }

Target:
public void canSerializeAndDeserializeKeepingNonLoggability() { assertCanSerializeAndDeserializeWithLoggability(NAME_NOT_LOGGABLE_DESCRIPTION, false); }
Source:
private boolean jsonExists(String path){ File test = new File(path + "/" + JSON_POM_FILE); return test.exists() && test.isFile(); }

Target:
private boolean jsonExists(String path) { File test = new File(path, JSON_POM_FILE); return test.exists() && test.isFile(); }
Source:
public boolean shouldShowNoResponseText(String giverEmail, String recipientEmail, FeedbackQuestionAttributes question) { return !(question.recipientType == FeedbackParticipantType.STUDENTS || question.recipientType == FeedbackParticipantType.TEAMS); }

Target:
public boolean shouldShowNoResponseText(String giverEmail, String recipientEmail, FeedbackQuestionAttributes question) { return question.recipientType != FeedbackParticipantType.STUDENTS && question.recipientType != FeedbackParticipantType.TEAMS; }
Source:
protected Map<List<String>, Object> getParamsForBean(SimulationDescriptor simulationDescriptor, FactIdentifier factIdentifier, List<FactMappingValue> factMappingValues, ExpressionEvaluatorFactory expressionEvaluatorFactory) { Map<List<String>, Object> paramsForBean = new HashMap<>(); for (FactMappingValue factMappingValue : factMappingValues) { ExpressionIdentifier expressionIdentifier = factMappingValue.getExpressionIdentifier(); FactMapping factMapping = simulationDescriptor.getFactMapping(factIdentifier, expressionIdentifier) .orElseThrow(() -> new IllegalStateException("Wrong expression, this should not happen")); List<String> pathToField = factMapping.getExpressionElementsWithoutClass().stream() .map(ExpressionElement::getStep).collect(toList()); ExpressionEvaluator expressionEvaluator = expressionEvaluatorFactory.getOrCreate(factMappingValue); try { Object value = expressionEvaluator.evaluateLiteralExpression(factMapping.getClassName(), factMapping.getGenericTypes(), factMappingValue.getRawValue()); paramsForBean.put(pathToField, value); } catch (RuntimeException e) { factMappingValue.setExceptionMessage(e.getMessage()); throw new ScenarioException(e.getMessage(), e); } } return paramsForBean; }

Target:
protected Map<List<String>, Object> getParamsForBean(SimulationDescriptor simulationDescriptor, FactIdentifier factIdentifier, List<FactMappingValue> factMappingValues, ExpressionEvaluatorFactory expressionEvaluatorFactory) { Map<List<String>, Object> paramsForBean = new HashMap<>(); boolean hasError = false; for (FactMappingValue factMappingValue : factMappingValues) { ExpressionIdentifier expressionIdentifier = factMappingValue.getExpressionIdentifier(); FactMapping factMapping = simulationDescriptor.getFactMapping(factIdentifier, expressionIdentifier) .orElseThrow(() -> new IllegalStateException("Wrong expression, this should not happen")); List<String> pathToField = factMapping.getExpressionElementsWithoutClass().stream() .map(ExpressionElement::getStep).collect(toList()); ExpressionEvaluator expressionEvaluator = expressionEvaluatorFactory.getOrCreate(factMappingValue); try { Object value = expressionEvaluator.evaluateLiteralExpression(factMapping.getClassName(), factMapping.getGenericTypes(), factMappingValue.getRawValue()); paramsForBean.put(pathToField, value); } catch (RuntimeException e) { factMappingValue.setExceptionMessage(e.getMessage()); hasError = true; } } if (hasError) { throw new ScenarioException("Error in one or more input values"); } return paramsForBean; }
Source:
public void singleStudent() { String student = "Alice"; String plants = "RC\nGG"; String[] expected = {"radishes", "clover", "grass", "grass"}; assertEquals(expected, new KindergartenGarden(plants) .getPlantsOfStudent(student)); }

Target:
public void singleStudent() { String student = "Alice"; String plants = "RC\nGG"; List<Plant> expected = Arrays.asList(Plant.RADISHES, Plant.CLOVER, Plant.GRASS, Plant.GRASS); assertEquals( expected, new KindergartenGarden(plants).getPlantsOfStudent(student) ); }
Source:
public void scrollToIndex(int index) { ListModel<Object> model = getModel(); double scrollRatio; if (model != null) { if (index < 0 || index > model.getSize() - 1) { throw new IndexOutOfBoundsException("Illegal index: " + index); } scrollRatio = (double) index / model.getSize(); } else { int itemCount = getItemCount(); if (index < 0 || index > itemCount - 1) { throw new IndexOutOfBoundsException("Illegal index: " + index); } scrollRatio = (double) index / itemCount; } response(new AuInvoke(this, "_scrollToIndex", index, scrollRatio)); }

Target:
public void scrollToIndex(int index) { ListModel<Object> model = getModel(); int itemCount = model != null ? model.getSize() : getItemCount(); if (index < 0 || index > itemCount - 1) { throw new IndexOutOfBoundsException("Illegal index: " + index); } response(new AuInvoke(this, "scrollToIndex", index, (double) index / itemCount)); }
Source:
private ProgramState handleSpecialMethods(ProgramState ps, MethodInvocationTree mit) { if (AnnotationUtils.isAnnotatedNonNull(mit.symbol())) { return ps.addConstraint(ps.peekValue(), ObjectConstraint.NOT_NULL); } else if (OBJECT_WAIT_MATCHER.matches(mit)) { return ps.resetFieldValues(constraintManager, false); } return ps; }

Target:
private ProgramState handleSpecialMethods(ProgramState ps, MethodInvocationTree mit) { if (isAnnotatedNonNull(mit.symbol())) { return ps.addConstraint(ps.peekValue(), ObjectConstraint.NOT_NULL); } else if (OBJECT_WAIT_MATCHER.matches(mit)) { return ps.resetFieldValues(constraintManager, false); } return ps; }
Source:
public RepositoryObjectDataLoader loadHeaders(RepositoryObject obj) throws FedoraException { PID pid = obj.getPid(); try (FcrepoResponse response = getClient().head(pid.getRepositoryUri()).perform()) { if (response.getStatusCode() != 200) { throw new FedoraException("Received " + response.getStatusCode() + " response while retrieving headers for " + pid.getRepositoryUri()); } obj.setEtag(response.getHeaderValue("Etag")); String lastModString = response.getHeaderValue("Last-Modified"); if (lastModString != null) { obj.setLastModified(DateUtils.parseDate(lastModString)); } } catch (IOException e) { throw new FedoraException("Unable to create deposit record at " + pid.getRepositoryUri(), e); } catch (FcrepoOperationFailedException e) { throw ClientFaultResolver.resolve(e); } return this; }

Target:
public RepositoryObjectDataLoader loadHeaders(RepositoryObject obj) throws FedoraException { PID pid = obj.getPid(); try (FcrepoResponse response = getClient().head(pid.getRepositoryUri()).perform()) { if (response.getStatusCode() != HttpStatus.SC_OK) { throw new FedoraException("Received " + response.getStatusCode() + " response while retrieving headers for " + pid.getRepositoryUri()); } obj.setEtag(response.getHeaderValue("Etag")); String lastModString = response.getHeaderValue("Last-Modified"); if (lastModString != null) { obj.setLastModified(DateUtils.parseDate(lastModString)); } } catch (IOException e) { throw new FedoraException("Unable to create deposit record at " + pid.getRepositoryUri(), e); } catch (FcrepoOperationFailedException e) { throw ClientFaultResolver.resolve(e); } return this; }
Source:
private String createSwaggerSpecification() { String json = ""; try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(SerializationFeature.INDENT_OUTPUT, true); mapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, true); mapper.setSerializationInclusion(Include.NON_NULL); mapper.getSerializerProvider().setNullKeySerializer(new NullSerializer()); json = mapper.writeValueAsString(swaggerSpecification); } catch (Exception exp) { exp.printStackTrace(); } return json; }

Target:
private String createSwaggerSpecification() { String json = ""; try { ObjectMapper mapper = new ObjectMapper(); mapper.configure(SerializationFeature.INDENT_OUTPUT, true); mapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, true); mapper.setSerializationInclusion(Include.NON_NULL); mapper.getSerializerProvider().setNullKeySerializer(new NullSerializer()); json = mapper.writeValueAsString(swaggerSpecification); } catch (Exception exp) { log.error("Error while creating object mapper", exp); } return json; }
Source:
private void marshalAndSaveFact(FactHandle factHandle) { Object factObject = m_kieSession.getObject(factHandle); try { factObjects.put(DroolsStreamUtils.streamOut(factObject), factObject.getClass()); } catch (IOException e) { LOG.error("Exception while marshalling fact {}", e); } }

Target:
private void marshalAndSaveFact(FactHandle factHandle) { Object factObject = m_kieSession.getObject(factHandle); try { factObjects.put(DroolsStreamUtils.streamOut(factObject), factObject.getClass()); } catch (IOException e) { LOG.error("Exception while marshalling fact with Class {}", factObject, factObject.getClass().getCanonicalName(), e); } }
Source:
public static boolean isAlreadyPresent(ArrayList<Order> ordersPlaced, Order newOrder) { for (Order orderPlaced : ordersPlaced) { if (((orderPlaced instanceof BuyOrder) && (newOrder instanceof BuyOrder)) || ((orderPlaced instanceof SellOrder) && (newOrder instanceof SellOrder))) { if (orderPlaced.getStockSymbol().equals( newOrder.getStockSymbol())) { return true; } } } return false; }

Target:
public static boolean isAlreadyPresent(ArrayList<Order> ordersPlaced, Order newOrder) { for (Order orderPlaced : ordersPlaced) { boolean buyOrderPlaced; boolean newBuyOrder; if(orderPlaced instanceof BuyOrder) buyOrderPlaced = true; else if (orderPlaced instanceof SellOrder) buyOrderPlaced = false; if(newBuyOrder instanceof BuyOrder) newBuyOrder = true; else if (newBuyOrder instanceof SellOrder) newBuyOrder = false; if (buyOrderPlaced && newBuyOrder) { if (orderPlaced.getStockSymbol().equals( newOrder.getStockSymbol())) { return true; } } } return false; }
Source:
public static Calendar convertToUserTimeZone(Calendar time, double timeZone) { int serverOffset = time.getTimeZone().getRawOffset(); int sessionOffset = (int) (60 * 60 * 1000 * timeZone); int offset = sessionOffset - serverOffset; TimeZone sessionTimeZone = getTimeZone(timeZone); if (time.getTimeZone().equals(sessionTimeZone)) { return time; } else { time.setTimeZone(sessionTimeZone); time.add(Calendar.MILLISECOND, offset); } return time; }

Target:
public static Calendar convertToUserTimeZone(Calendar time, double timeZone) { time.add(Calendar.MILLISECOND, (int) (60 * 60 * 1000 * timeZone)); return time; }
Source:
public void discardCountsBelow(double i) { List<T> labelsToRemove = new ArrayList<>(); for (Entry<T, Double> entry : map.entrySet()) { final T label = entry.getKey(); Double sum = entry.getValue(); if (sum == null) sum = 0.0; if (sum < i) labelsToRemove.add(label); } for (T label : labelsToRemove) { map.remove(label); } }

Target:
public void discardCountsBelow(double i) { List<T> labelsToRemove = new ArrayList<>(); for (Entry<T, Double> entry : map.entrySet()) { T label = entry.getKey(); Double sum = entry.getValue(); if (sum == null) sum = 0.0; if (sum < i) labelsToRemove.add(label); } for (T label : labelsToRemove) { map.remove(label); } }
Source:
public Response createOrUpdateWorldpay3dsCredentials(@PathParam("accountId") Long gatewayAccountId, @Valid WorldpayUpdate3dsFlexCredentialsRequest worldpay3dsCredentials) { return gatewayAccountService.getGatewayAccount(gatewayAccountId) .map((gatewayAccountEntity) -> { if (gatewayAccountEntity.getGatewayName().equalsIgnoreCase("worldpay")) { worldpay3DsFlexCredentialsService.setGatewayAccountWorldpay3ds2Credentials(worldpay3dsCredentials, gatewayAccountEntity); return Response.ok().build(); } else { return notFoundResponse("Not a Worldpay gateway account"); } }) .orElseGet(() -> notFoundResponse("Not a Worldpay gateway account")); }

Target:
public Response createOrUpdateWorldpay3dsCredentials(@PathParam("accountId") Long gatewayAccountId, @Valid WorldpayUpdate3dsFlexCredentialsRequest worldpay3dsCredentials) { return gatewayAccountService.getGatewayAccount(gatewayAccountId) .filter(gatewayAccountEntity -> gatewayAccountEntity.getGatewayName().equals(PaymentGatewayName.WORLDPAY.getName())) .map(gatewayAccountEntity -> { worldpay3dsFlexCredentialsService.setGatewayAccountWorldpay3dsFlexCredentials(worldpay3dsCredentials, gatewayAccountEntity); return Response.ok().build(); }) .orElseGet(() -> notFoundResponse("Not a Worldpay gateway account")); }
Source:
public void makesRequestsAgainIfTimestampRangeDoesNotIncludeCorrectModuli() { when(allocator.getRelevantModuli(UUID_ONE)).thenReturn(MODULUS_ONE); when(allocator.getRelevantModuli(UUID_TWO)).thenReturn(MODULUS_TWO); when(timestamps.getFreshTimestamps(anyInt())) .thenReturn(TIMESTAMP_ZERO) .thenReturn(TIMESTAMP_ZERO) .thenReturn(TIMESTAMP_RANGE); assertThat(service.getFreshTimestampForClient(UUID_ONE)).isEqualTo(MODULUS_ONE_TIMESTAMP_IN_RANGE); verify(allocator, times(3)).getRelevantModuli(UUID_ONE); verify(timestamps, times(3)).getFreshTimestamps(anyInt()); }

Target:
public void makesRequestsAgainIfTimestampRangeDoesNotIncludeCorrectModuli() { when(allocator.getRelevantModuli(UUID_ONE)).thenReturn(RESIDUE_ONE); when(allocator.getRelevantModuli(UUID_TWO)).thenReturn(RESIDUE_TWO); when(timestamps.getFreshTimestamps(anyInt())) .thenReturn(TIMESTAMP_SEVEN) .thenReturn(TIMESTAMP_SEVEN) .thenReturn(TIMESTAMP_RANGE); assertThat(service.getFreshTimestampForClient(UUID_TWO)).isEqualTo(RESIDUE_TWO_TIMESTAMP_IN_RANGE); verify(allocator, times(3)).getRelevantModuli(UUID_TWO); verify(timestamps, times(3)).getFreshTimestamps(anyInt()); }
Source:
public void testFeatureAfterExcludingFolder() { String fileNameForExcluding = "AppController.java"; String pathToJavaFile = "/projects/" + PROJECT_NAME + "/src/main/java/org/eclipse/qa/examples"; doFileWatcherExcludeOperation( PROJECT_NAME + "/" + FOLDER_NAME_FOR_EXCLUDE, ADD_TO_FILE_WATCHER_EXCLUDES); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.openItemByVisibleNameInExplorer(fileNameForExcluding); editor.waitActiveEditor(); terminal.selectTerminalTab(); terminal.waitTerminalConsole(); terminal.waitTerminalIsNotEmpty(); terminal.typeIntoTerminal("cd " + pathToJavaFile + Keys.ENTER); terminal.waitExpectedTextIntoTerminal(pathToJavaFile); terminal.typeIntoTerminal( "pwd | cat - " + fileNameForExcluding + "> temp && mv temp " + "AppController.java" + Keys.ENTER); editor.selectTabByName("AppController"); editor.waitTextNotPresentIntoEditor(pathToJavaFile); editor.clickOnCloseFileIcon("AppController"); projectExplorer.openItemByVisibleNameInExplorer(fileNameForExcluding); editor.waitActiveEditor(); editor.waitTextIntoEditor(pathToJavaFile); doFileWatcherExcludeOperation( PROJECT_NAME + "/" + FOLDER_NAME_FOR_EXCLUDE, REMOVE_FROM_FILE_WATCHER_EXCLUDES); editor.closeAllTabsByContextMenu(); }

Target:
public void testFeatureAfterExcludingFolder() { String fileNameForExcluding = "AppController.java"; String pathToJavaFile = format("/projects/%s/src/main/java/org/eclipse/qa/examples", PROJECT_NAME); doFileWatcherExcludeOperation( PROJECT_NAME + "/" + FOLDER_NAME_FOR_EXCLUDE, ADD_TO_FILE_WATCHER_EXCLUDES); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.openItemByVisibleNameInExplorer(fileNameForExcluding); editor.waitActiveEditor(); terminal.selectTerminalTab(); terminal.waitTerminalConsole(); terminal.waitTerminalIsNotEmpty(); terminal.typeIntoTerminal(format("cd %s%s", pathToJavaFile, ENTER)); terminal.waitExpectedTextIntoTerminal(pathToJavaFile); terminal.typeIntoTerminal( format( "pwd | cat - %s > temp && mv temp %s%s", fileNameForExcluding, fileNameForExcluding, ENTER)); editor.selectTabByName("AppController"); editor.waitTextNotPresentIntoEditor(pathToJavaFile); editor.clickOnCloseFileIcon("AppController"); projectExplorer.openItemByVisibleNameInExplorer(fileNameForExcluding); editor.waitActiveEditor(); editor.waitTextIntoEditor(pathToJavaFile); doFileWatcherExcludeOperation( PROJECT_NAME + "/" + FOLDER_NAME_FOR_EXCLUDE, REMOVE_FROM_FILE_WATCHER_EXCLUDES); editor.closeAllTabsByContextMenu(); }
Source:
public static void main(String[] args) throws Exception { final PerformanceTestConfiguration configuration = new PerformanceTestConfiguration(args[0]); final ResponseTimeCache responseTimeCache = new ResponseTimeCache(); final GatewayMetricsReporter metricsReporter = new GatewayMetricsReporter(configuration, responseTimeCache); metricsReporter.start(); final List<PerformanceTestLifeCyleListener> lifeCyleListeners = Arrays.asList(metricsReporter); for (PerformanceTestUseCase useCase : PerformanceTestUseCase.values()) { if (configuration.isUseCaseEnabled(useCase)) { useCase.getUseCaseRunner().setResponseTimeCache(responseTimeCache); useCase.getUseCaseRunner().execute(configuration, lifeCyleListeners); } } }

Target:
public static void main(String[] args) throws Exception { final PerformanceTestConfiguration configuration = new PerformanceTestConfiguration(args[0]); final ResponseTimeCache responseTimeCache = new ResponseTimeCache(); final GatewayMetricsReporter metricsReporter = new GatewayMetricsReporter(configuration, responseTimeCache); metricsReporter.start(); final List<PerformanceTestLifeCyleListener> lifeCyleListeners = Arrays.asList(metricsReporter); for (UseCaseRunner useCaseRunner : getUseCaseRunners()) { if (configuration.isUseCaseEnabled(useCaseRunner.getUseCaseName())) { useCaseRunner.setResponseTimeCache(responseTimeCache); useCaseRunner.execute(configuration, lifeCyleListeners); } } }
Source:
public void moveFactMapping(int oldIndex, int newIndex) { if (oldIndex < 0 || oldIndex >= factMappings.size()) { throw new IllegalArgumentException(new StringBuilder().append("Index ").append(oldIndex) .append(" not found in the list").toString()); } if (newIndex < 0 || newIndex >= factMappings.size()) { throw new IllegalArgumentException(new StringBuilder().append("Index ").append(newIndex) .append(" out of range").toString()); } FactMapping factMapping = factMappings.get(oldIndex); factMappings.remove(oldIndex); factMappings.add(newIndex, factMapping); }

Target:
public void moveFactMapping(int oldIndex, int newIndex) { if (oldIndex < 0 || oldIndex >= factMappings.size()) { throw new IndexOutOfBoundsException(new StringBuilder().append("Index ").append(oldIndex) .append(" not found in the list").toString()); } if (newIndex < 0 || newIndex >= factMappings.size()) { throw new IndexOutOfBoundsException(new StringBuilder().append("Index ").append(newIndex) .append(" out of range").toString()); } FactMapping factMapping = factMappings.get(oldIndex); factMappings.remove(oldIndex); factMappings.add(newIndex, factMapping); }
Source:
public void onStartup(TimeLockServerConfiguration configuration) { registerPaxosResource(); optionalSecurity = constructOptionalSslSocketFactory(paxosConfiguration); timeLockServerConfiguration = configuration; registerExceptionMappers(); registerLeaderElectionService(configuration); registerHealthCheck(configuration); registerClockMonitor(); Runnable clockSkewMonitor = ClockSkewMonitor.create(remoteServers, optionalSecurity, () -> configuration.enableClockSkewMonitorExperiment().orElse(Boolean.TRUE)); new Thread(clockSkewMonitor, "ClockSkewMonitor").start(); }

Target:
public void onStartup(TimeLockServerConfiguration configuration) { registerPaxosResource(); optionalSecurity = constructOptionalSslSocketFactory(paxosConfiguration); timeLockServerConfiguration = configuration; registerExceptionMappers(); registerLeaderElectionService(configuration); registerHealthCheck(configuration); registerClockService(); ClockSkewMonitor.create(remoteServers, optionalSecurity).runInBackground(); }
Source:
HardDeleter(StoreConfig config, StoreMetrics metrics, String dataDir, Log log, PersistentIndex index, MessageStoreHardDelete hardDelete, StoreKeyFactory factory, DiskIOScheduler diskIOScheduler, Time time) { this.metrics = metrics; this.dataDir = dataDir; this.log = log; this.index = index; this.hardDelete = hardDelete; this.factory = factory; this.diskIOScheduler = diskIOScheduler; this.time = time; scanSizeInBytes = Math.min(config.storeCleanupOperationsBytesPerSec * 10, 1024 * 1024); messageRetentionSeconds = Math.toIntExact(TimeUnit.DAYS.toSeconds(Integer.toUnsignedLong(config.storeDeletedMessageRetentionDays))); }

Target:
HardDeleter(StoreConfig config, StoreMetrics metrics, String dataDir, Log log, PersistentIndex index, MessageStoreHardDelete hardDelete, StoreKeyFactory factory, DiskIOScheduler diskIOScheduler, Time time) { this.metrics = metrics; this.dataDir = dataDir; this.log = log; this.index = index; this.hardDelete = hardDelete; this.factory = factory; this.diskIOScheduler = diskIOScheduler; this.time = time; scanSizeInBytes = Math.min(config.storeCleanupOperationsBytesPerSec * 10, 1024 * 1024); messageRetentionSeconds = (int) TimeUnit.DAYS.toSeconds(config.storeDeletedMessageRetentionDays); }
Source:
protected Optional<DyeColor> getFrom(ItemStack dataHolder) { Item item = dataHolder.getItem(); if (item instanceof BlockItem) { Block block = ((BlockItem) item).getBlock(); net.minecraft.item.DyeColor color = ((DyeColorBlockBridge) block).bridge$getDyeColor(); return Optional.ofNullable((DyeColor) (Object) color); } return Optional.empty(); }

Target:
protected Optional<DyeColor> getFrom(ItemStack dataHolder) { Item item = dataHolder.getItem(); if (item instanceof BlockItem) { final Block block = ((BlockItem) item).getBlock(); return ((DyeColorBlockBridge) block).bridge$getDyeColor(); } return Optional.empty(); }
Source:
CustomCommandLine.Builder createProtoCompilerCommandLine() throws InterruptedException { CustomCommandLine.Builder result = CustomCommandLine.builder(); if (langPlugin != null) { result.addFormatted( "--plugin=protoc-gen-%s=%s", langPrefix, langPlugin.getExecutable().getExecPath()); } if (langPluginParameter != null) { result.addLazyString(new LazyLangPluginFlag(langPrefix, langPluginParameter)); } result.addAll(ruleContext.getFragment(ProtoConfiguration.class).protocOpts()); boolean areDepsStrict = areDepsStrict(ruleContext); boolean siblingRepositoryLayout = ruleContext .getAnalysisEnvironment() .getSkylarkSemantics() .experimentalSiblingRepositoryLayout(); addIncludeMapArguments( result, areDepsStrict ? protoInfo.getImportableProtos() : null, protoInfo.getTransitiveProtos()); if (areDepsStrict) { result.addFormatted(STRICT_DEPS_FLAG_TEMPLATE, ruleContext.getLabel()); } for (Artifact src : protoInfo.getDirectProtoSources()) { result.addPath(src.getExecPath()); } if (!hasServices) { result.add("--disallow_services"); } if (checkStrictImportPublic) { NestedSet<Pair<PathFragment, ImmutableList<Artifact>>> exportedProtos = protoInfo.getExportedProtos(); if (exportedProtos.isEmpty()) { result.add("--allowed_public_imports="); } else { result.addAll( "--allowed_public_imports", VectorArg.join(":").each(exportedProtos).mapped(new ExpandToImportPathsArgsFn())); } } if (additionalCommandLineArguments != null) { result.addAll(ImmutableList.copyOf(additionalCommandLineArguments)); } return result; }

Target:
CustomCommandLine.Builder createProtoCompilerCommandLine() { CustomCommandLine.Builder result = CustomCommandLine.builder(); if (langPlugin != null) { result.addFormatted( "--plugin=protoc-gen-%s=%s", langPrefix, langPlugin.getExecutable().getExecPath()); } if (langPluginParameter != null) { result.addLazyString(new LazyLangPluginFlag(langPrefix, langPluginParameter)); } result.addAll(ruleContext.getFragment(ProtoConfiguration.class).protocOpts()); boolean areDepsStrict = areDepsStrict(ruleContext); addIncludeMapArguments( result, areDepsStrict ? protoInfo.getStrictImportableSources() : null, protoInfo.getTransitiveSources()); if (areDepsStrict) { result.addFormatted(STRICT_DEPS_FLAG_TEMPLATE, ruleContext.getLabel()); } for (Artifact src : protoInfo.getDirectProtoSources()) { result.addPath(src.getExecPath()); } if (!hasServices) { result.add("--disallow_services"); } if (checkStrictImportPublic) { NestedSet<ProtoSource> publicImportSources = protoInfo.getPublicImportSources(); if (publicImportSources.isEmpty()) { result.add("--allowed_public_imports="); } else { result.addAll( "--allowed_public_imports", VectorArg.join(":") .each(publicImportSources) .mapped(EXPAND_TO_IMPORT_PATHS)); } } if (additionalCommandLineArguments != null) { result.addAll(ImmutableList.copyOf(additionalCommandLineArguments)); } return result; }
Source:
public final Object getValue(Tuple tuple, PDataType type, ImmutableBytesWritable ptr) throws SQLException { return getValue(tuple, type, ptr, -1); }

Target:
public final Object getValue(Tuple tuple, PDataType type, ImmutableBytesWritable ptr) throws SQLException { Expression expression = getExpression(); if (!expression.evaluate(tuple, ptr)) { return null; } if (ptr.getLength() == 0) { return null; } return type.toObject(ptr, expression.getDataType(), expression.getColumnModifier()); }
Source:
public BaseSingletonDOMElementFactory getDOMElementFactory(String className, ScenarioSimulationModel.Type modelType, FactMappingValueType valueType) { boolean isRuleScenario = Objects.equals(ScenarioSimulationModel.Type.RULE, modelType); if (ScenarioSimulationSharedUtils.isCollection(className)) { return collectionEditorSingletonDOMElementFactory; } if (Objects.equals(FactMappingValueType.EXPRESSION, valueType) && isRuleScenario) { return scenarioExpressionCellTextAreaSingletonDOMElementFactory; } return scenarioCellTextAreaSingletonDOMElementFactory; }

Target:
public BaseSingletonDOMElementFactory getDOMElementFactory(String className, ScenarioSimulationModel.Type modelType, FactMappingValueType valueType) { boolean isRuleScenario = Objects.equals(ScenarioSimulationModel.Type.RULE, modelType); if (ScenarioSimulationSharedUtils.isCollection(className) && Objects.equals(FactMappingValueType.NOT_EXPRESSION, valueType)) { return collectionEditorSingletonDOMElementFactory; } if (Objects.equals(FactMappingValueType.EXPRESSION, valueType) && isRuleScenario) { return scenarioExpressionCellTextAreaSingletonDOMElementFactory; } return scenarioCellTextAreaSingletonDOMElementFactory; }
Source:
protected void configure() { Multibinder<ServicePlugin> plugins = Multibinder.newSetBinder(binder(), ServicePlugin.class); plugins.addBinding().toInstance(Plugins.of(new HttpBackend(port))); bind(ObjectValidator.class).to(ApacheObjectValidator.class).in(Singleton.class); install(new ServletModule() { @Override protected void configureServlets() { bind(TestServlet.class).in(Singleton.class); serve("/test").with(TestServlet.class); } }); install(new SitebricksModule() { @Override protected void configureSitebricks() { at("/testservice").serve(ExampleService.class); at("/r/controllers").serve(ApControllerService.class); at("/r/aps").serve(AccessPointService.class); at("/r/operators").serve(OperatorService.class); at("/r/roaming-groups").serve(RoamingGroupService.class); at("/r/venues").serve(VenueService.class); at("/r/service-providers").serve(ServiceProviderEndpoint.class); } }); bindInterceptor(annotatedWith(Service.class), returns(only(Reply.class)), new HttpRequestErrorReporter("Internal Server Error")); }

Target:
protected void configure() { Multibinder<ServicePlugin> plugins = Multibinder.newSetBinder(binder(), ServicePlugin.class); plugins.addBinding().toInstance(Plugins.of(new HttpBackend(port))); bind(ObjectValidator.class).to(ApacheObjectValidator.class).in(Singleton.class); install(new ServletModule() { @Override protected void configureServlets() { bind(TestServlet.class).in(Singleton.class); serve("/test").with(TestServlet.class); } }); install(new SitebricksModule() { @Override protected void configureSitebricks() { at("/testservice").serve(ExampleService.class); at("/r/controllers").serve(ApControllerEndpoint.class); at("/r/aps").serve(AccessPointEndpoint.class); at("/r/operators").serve(OperatorEndpoint.class); at("/r/roaming-groups").serve(RoamingGroupEndpoint.class); at("/r/venues").serve(VenueEndpoint.class); at("/r/ip-types").serve(IpTypeService.class); at("/r/auth-types").serve(AuthTypeEndpoint.class); at("/r/service-providers").serve(ServiceProviderEndpoint.class); } }); bindInterceptor(annotatedWith(Service.class), returns(only(Reply.class)), new HttpRequestErrorReporter("Internal Server Error")); }
Source:
PartitionByOperatorSpec(OutputStreamImpl<KV<K, V>> outputStream, MapFunction<? super M, ? extends K> keyFunction, MapFunction<? super M, ? extends V> valueFunction, String opId) { super(OpCode.PARTITION_BY, opId); checkArgument(!(keyFunction instanceof TimerFunction || keyFunction instanceof WatermarkFunction), "A partitionBy operator does not accept a user defined TimerFunction or WatermarkFunction as the keyFunction."); checkArgument(!(valueFunction instanceof TimerFunction || valueFunction instanceof WatermarkFunction), "A partitionBy operator does not accept a user defined TimerFunction or WatermarkFunction as the valueFunction."); this.outputStream = outputStream; this.keyFunction = keyFunction; this.valueFunction = valueFunction; }

Target:
PartitionByOperatorSpec(OutputStreamImpl<KV<K, V>> outputStream, MapFunction<? super M, ? extends K> keyFunction, MapFunction<? super M, ? extends V> valueFunction, String opId) { super(OpCode.PARTITION_BY, opId); checkArgument(!(keyFunction instanceof TimerFunction || keyFunction instanceof WatermarkFunction), "keyFunction for partitionBy should not implement TimerFunction or WatermarkFunction."); checkArgument(!(valueFunction instanceof TimerFunction || valueFunction instanceof WatermarkFunction), "valueFunction for partitionBy should not implement TimerFunction or WatermarkFunction."); this.outputStream = outputStream; this.keyFunction = keyFunction; this.valueFunction = valueFunction; }
Source:
private void onLocalReplaysWatchEvent(WatchKey key) { List<CompletableFuture<Replay>> newReplaysFutures = new ArrayList<CompletableFuture<Replay>>(); Collection<Replay> deletedReplays = new ArrayList<Replay>(); for (WatchEvent<?> watchEvent : key.pollEvents()) { Path path = (Path) watchEvent.context(); Path fullPathToReplay = preferencesService.getReplaysDirectory().resolve(path); if (watchEvent.kind() == ENTRY_CREATE) { newReplaysFutures.add(tryLoadingLocalReplay(fullPathToReplay)); } else if (watchEvent.kind() == ENTRY_DELETE) { Optional<Replay> existingReplay = localReplays .stream() .filter(replay -> replay.getReplayFile().compareTo(fullPathToReplay) == 0) .findFirst(); if (existingReplay.isPresent()) { Replay deletedReplay = existingReplay.get(); deletedReplays.add(deletedReplay); localReplays.remove(deletedReplay); } } } CompletableFuture[] replayFuturesArray = newReplaysFutures.toArray(new CompletableFuture[newReplaysFutures.size()]); CompletableFuture<List<Replay>> newReplaysFuture = CompletableFuture.allOf(replayFuturesArray) .thenApply(ignoredVoid -> newReplaysFutures.stream() .map(future -> future.join()) .collect(Collectors.toList()) ); try { List<Replay> newReplays = newReplaysFuture.get(); localReplays.addAll(newReplays); publisher.publishEvent(new LocalReplaysChangedEvent(this, newReplays, deletedReplays)); } catch (Exception e) { logger.warn("Failed to load new local replays ({})", e.getMessage()); } }

Target:
protected void onLocalReplaysWatchEvent(WatchKey key) { List<CompletableFuture<Replay>> newReplaysFutures = new ArrayList<CompletableFuture<Replay>>(); Collection<Replay> deletedReplays = new ArrayList<Replay>(); for (WatchEvent<?> watchEvent : key.pollEvents()) { Path path = (Path) watchEvent.context(); Path fullPathToReplay = preferencesService.getReplaysDirectory().resolve(path); if (watchEvent.kind() == ENTRY_CREATE) { newReplaysFutures.add(tryLoadingLocalReplay(fullPathToReplay)); } else if (watchEvent.kind() == ENTRY_DELETE) { Optional<Replay> existingReplay = localReplays .stream() .filter(replay -> replay.getReplayFile().compareTo(fullPathToReplay) == 0) .findFirst(); if (existingReplay.isPresent()) { Replay deletedReplay = existingReplay.get(); deletedReplays.add(deletedReplay); localReplays.remove(deletedReplay); } } } CompletableFuture[] replayFuturesArray = newReplaysFutures.toArray(new CompletableFuture[newReplaysFutures.size()]); CompletableFuture<List<Replay>> newReplaysFuture = CompletableFuture.allOf(replayFuturesArray) .thenApply(ignoredVoid -> newReplaysFutures.stream() .map(CompletableFuture::join) .filter(Objects::nonNull) .collect(Collectors.toList()) ); try { List<Replay> newReplays = newReplaysFuture.get(); localReplays.addAll(newReplays); publisher.publishEvent(new LocalReplaysChangedEvent(this, newReplays, deletedReplays)); } catch (Exception e) { logger.warn("Failed to load new local replays ({})", e.getMessage()); } }
Source:
public static List<ExtMap> fetchPrincipalsByIdsRecursively( final ExtensionProxy extension, final String namespace, final List<String> ids) { Map<String, ExtMap> groupsCache = new HashMap<>(); Set<String> idsToFetch = new HashSet<>(); List<ExtMap> principals = findPrincipalsByIds(extension, namespace, ids, true, false); for (ExtMap principal : principals) { for (ExtMap memberOf : principal.get(PrincipalRecord.GROUPS, Collections.<ExtMap> emptyList())) { idsToFetch.add(memberOf.<String> get(PrincipalRecord.ID)); } } while (!idsToFetch.isEmpty()) { List<ExtMap> groups = findGroupRecordsByIds(extension, namespace, new ArrayList<String>(idsToFetch), true, false); idsToFetch.clear(); for (ExtMap group : groups) { groupsCache.put(group.<String> get(GroupRecord.ID), group); for (ExtMap memberOf : group.get(GroupRecord.GROUPS, Collections.<ExtMap> emptyList())) { if (!groupsCache.containsKey(memberOf.get(GroupRecord.ID))) { idsToFetch.add(memberOf.<String> get(GroupRecord.ID)); } } } } for (ExtMap principal : principals) { List<ExtMap> groups = new ArrayList<>(); for (ExtMap memberOf : principal.get(PrincipalRecord.GROUPS, Collections.<ExtMap> emptyList())) { groups.add(groupsCache.get(memberOf.get(GroupRecord.ID))); } principal.put(PrincipalRecord.GROUPS, groups); constructGroupsMembershipTree(groups, groupsCache); } return principals; }

Target:
public static List<ExtMap> fetchPrincipalsByIdsRecursively( final ExtensionProxy extension, final String namespace, final List<String> ids) { Map<String, ExtMap> groupsCache = new HashMap<>(); Set<String> idsToFetch = new HashSet<>(); List<ExtMap> principals = findPrincipalsByIds(extension, namespace, ids, true, false); for (ExtMap principal : principals) { for (ExtMap memberOf : principal.get(PrincipalRecord.GROUPS, Collections.<ExtMap> emptyList())) { idsToFetch.add(memberOf.<String> get(GroupRecord.ID)); } } while (!idsToFetch.isEmpty()) { List<ExtMap> groups = findGroupRecordsByIds(extension, namespace, new ArrayList<String>(idsToFetch), true, false); idsToFetch.clear(); for (ExtMap group : groups) { groupsCache.put(group.<String> get(GroupRecord.ID), group); for (ExtMap memberOf : group.get(GroupRecord.GROUPS, Collections.<ExtMap> emptyList())) { if (!groupsCache.containsKey(memberOf.get(GroupRecord.ID))) { idsToFetch.add(memberOf.<String> get(GroupRecord.ID)); } } } } for (ExtMap principal : principals) { constructGroupsMembershipTree(principal, PrincipalRecord.GROUPS, groupsCache); } return principals; }
Source:
public void drawText (String string, int x, int y, int flags) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); NSAutoreleasePool pool = checkGC(CLIPPING | TRANSFORM | FONT | FOREGROUND_FILL); try { int length = string.length(); if (length == 0) return; boolean mode = true; switch (data.textAntialias) { case SWT.DEFAULT: if (!handle.isDrawingToScreen()) mode = false; break; case SWT.OFF: mode = false; break; case SWT.ON: mode = true; break; } handle.saveGraphicsState(); handle.setShouldAntialias(mode); if (length == 1 && flags == SWT.DRAW_TRANSPARENT) { doFastDrawText(string, x, y); } else { doDrawText(string, x, y, flags); } handle.restoreGraphicsState(); } finally { uncheckGC(pool); } }

Target:
public void drawText (String string, int x, int y, int flags) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); NSAutoreleasePool pool = checkGC(CLIPPING | TRANSFORM | FONT | FOREGROUND_FILL); try { int length = string.length(); if (length == 0) return; boolean mode = true; switch (data.textAntialias) { case SWT.DEFAULT: if (!handle.isDrawingToScreen()) mode = false; break; case SWT.OFF: mode = false; break; case SWT.ON: mode = true; break; } handle.saveGraphicsState(); handle.setShouldAntialias(mode); if (length == 1 && (flags & SWT.DRAW_TRANSPARENT) != 0) { doFastDrawText(string, x, y); } else { doDrawText(string, x, y, flags); } handle.restoreGraphicsState(); } finally { uncheckGC(pool); } }
Source:
public Void visitTableScan(TableScanNode node, Context context) { TableHandle tableHandle = node.getTable(); Set<Column> columns = new HashSet<>(); for (ColumnHandle columnHandle : node.getAssignments().values()) { columns.add(createColumn(metadata.getColumnMetadata(session, tableHandle, columnHandle))); } Optional<TableStatistics> tableStats = Optional.empty(); if (context.extractStats()) { Constraint<ColumnHandle> constraint = new Constraint<>(node.getCurrentConstraint()); tableStats = Optional.of(metadata.getTableStatistics(session, tableHandle, constraint)); } inputs.add(createInput(metadata.getTableMetadata(session, tableHandle), tableHandle, columns, tableStats)); return null; }

Target:
public Void visitTableScan(TableScanNode node, Context context) { TableHandle tableHandle = node.getTable(); Set<Column> columns = new HashSet<>(); for (ColumnHandle columnHandle : node.getAssignments().values()) { columns.add(createColumn(metadata.getColumnMetadata(session, tableHandle, columnHandle))); } Set<ColumnHandle> desiredColumns = node.getAssignments().values().stream().collect(toImmutableSet()); Optional<TableStatistics> statistics = Optional.empty(); if (context.isExtractStatistics()) { Constraint<ColumnHandle> constraint = new Constraint<>(node.getCurrentConstraint()); TableStatistics tableStatistics = metadata.getTableStatistics(session, tableHandle, constraint); statistics = Optional.of(pruneStatistics(tableStatistics, desiredColumns)); } inputs.add(createInput(metadata.getTableMetadata(session, tableHandle), tableHandle, columns, statistics)); return null; }
Source:
protected Object joinOldAndNewValues(Object oldValue, Object newValue) { if ((oldValue instanceof Map) && (newValue instanceof Map)) { return combineCurrentAndResolvedValueMaps((Map) oldValue, (Map) newValue); } else if ((oldValue instanceof List) && (newValue instanceof List)) { return combineCurrentAndResolvedValueList((List) oldValue, (List) newValue); } else if ((oldValue instanceof String) && (newValue instanceof String)) { return newValue; } else { LOG.warn("Types of oldValue and newValue are not the same, so is not able " + "to join them. Then, new type will be returned ", new Object[]{oldValue, newValue, this}); return newValue; } }

Target:
protected Object joinOldAndNewValues(Object oldValue, Object newValue) { if ((oldValue instanceof Map) && (newValue instanceof Map)) { return combineCurrentAndResolvedValueMaps((Map) oldValue, (Map) newValue); } else if ((oldValue instanceof List) && (newValue instanceof List)) { return combineCurrentAndResolvedValueList((List) oldValue, (List) newValue); } else { LOG.debug("Types of oldValue and newValue are not the same, so is not able " + "to join them. Then, new type will be returned ", new Object[]{oldValue, newValue, this}); return newValue; } }