auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static List<JavaFileScannerContext.Location> flow(ExplodedGraph.Node currentNode, SymbolicValue currentVal ) { List<JavaFileScannerContext.Location> flow = new ArrayList<>(); ExplodedGraph.Node node = currentNode; Symbol lastEvaluated = currentNode.programState.getLastEvaluated(); while (node != null) { ExplodedGraph.Node finalNode = node; if(finalNode.programPoint.syntaxTree() != null) { node.getLearnedConstraints().stream() .map(lc->lc.sv) .filter(sv -> sv.equals(currentVal)) .findFirst() .ifPresent(sv -> flow.add(new JavaFileScannerContext.Location("", finalNode.parent.programPoint.syntaxTree()))); if (lastEvaluated != null) { Symbol finalLastEvaluated = lastEvaluated; Optional<Symbol> learnedSymbol = node.getLearnedSymbols().stream() .map(ls -> ls.symbol) .filter(sv -> sv.equals(finalLastEvaluated)) .findFirst(); if (learnedSymbol.isPresent()) { lastEvaluated = finalNode.parent.programState.getLastEvaluated(); flow.add(new JavaFileScannerContext.Location("", finalNode.parent.programPoint.syntaxTree())); } } } node = node.parent; } return flow; }

Target:
public static List<JavaFileScannerContext.Location> flow(ExplodedGraph.Node currentNode, SymbolicValue currentVal) { List<JavaFileScannerContext.Location> flow = new ArrayList<>(); if (currentVal instanceof BinarySymbolicValue) { Set<JavaFileScannerContext.Location> locations = new HashSet<>(); locations.addAll(SECheck.flow(currentNode.parent, ((BinarySymbolicValue) currentVal).getLeftOp())); locations.addAll(SECheck.flow(currentNode.parent, ((BinarySymbolicValue) currentVal).getRightOp())); flow.addAll(locations); } ExplodedGraph.Node node = currentNode; Symbol lastEvaluated = currentNode.programState.getLastEvaluated(); while (node != null) { ExplodedGraph.Node finalNode = node; if (finalNode.programPoint.syntaxTree() == null) { continue; } node.getLearnedConstraints().stream() .map(ExplodedGraph.Node.LearnedConstraint::getSv) .filter(sv -> sv.equals(currentVal)) .findFirst() .ifPresent(sv -> flow.add(new JavaFileScannerContext.Location("", finalNode.parent.programPoint.syntaxTree()))); if (lastEvaluated != null) { Symbol finalLastEvaluated = lastEvaluated; Optional<Symbol> learnedSymbol = node.getLearnedSymbols().stream() .map(ExplodedGraph.Node.LearnedValue::getSymbol) .filter(sv -> sv.equals(finalLastEvaluated)) .findFirst(); if (learnedSymbol.isPresent()) { lastEvaluated = finalNode.parent.programState.getLastEvaluated(); flow.add(new JavaFileScannerContext.Location("", finalNode.parent.programPoint.syntaxTree())); } } node = node.parent; } return Lists.reverse(flow); }
Source:
public void initialize() { mentionPattern = Pattern.compile("\\b(" + Pattern.quote(userService.getUsername()) + ")\\b", CASE_INSENSITIVE); channelPattern = Pattern.compile("#([a-z][^#]+)\\b", CASE_INSENSITIVE); Platform.runLater(this::initChatView); addFocusListeners(); addImagePasteListener(); unreadMessagesCount.addListener((observable, oldValue, newValue) -> chatService.incrementUnreadMessagesCount(newValue.intValue() - oldValue.intValue()) ); StageHolder.getStage().focusedProperty().addListener(new WeakChangeListener<>(resetUnreadMessagesListener)); getRoot().selectedProperty().addListener(new WeakChangeListener<>(resetUnreadMessagesListener)); autoCompletionHelper.bindTo(messageTextField()); }

Target:
public void initialize() { mentionPattern = Pattern.compile("\\b(" + Pattern.quote(userService.getUsername()) + ")\\b", CASE_INSENSITIVE); initChatView(); addFocusListeners(); addImagePasteListener(); unreadMessagesCount.addListener((observable, oldValue, newValue) -> chatService.incrementUnreadMessagesCount(newValue.intValue() - oldValue.intValue())); JavaFxUtil.addListener(StageHolder.getStage().focusedProperty(), new WeakChangeListener<>(resetUnreadMessagesListener)); JavaFxUtil.addListener(getRoot().selectedProperty(), new WeakChangeListener<>(resetUnreadMessagesListener)); getRoot().setOnClosed(this::onClosed); }
Source:
public void updateDRepresentation(DRepresentation newDRepresentation) { this.dRepresentation = newDRepresentation; tableViewerListener.setdTable((DTable) dRepresentation); getTreeViewer().getTree().removeAll(); getTreeViewer().getTree().clearAll(true); while (getTreeViewer().getTree().getColumnCount() > 0) { getTreeViewer().getTree().getColumns()[0].dispose(); } treeLayout = new TreeColumnLayout(); composite.setLayout(treeLayout); dRepresentationChanged = true; initializeColumnsAndComponentsRelatedToDRepresentation(treeLayout); }

Target:
public void updateDRepresentation(DRepresentation newDRepresentation) { this.dRepresentation = newDRepresentation; tableViewerListener.resetDTable((DTable) dRepresentation); getTreeViewer().getTree().removeAll(); getTreeViewer().getTree().clearAll(true); while (getTreeViewer().getTree().getColumnCount() > 0) { getTreeViewer().getTree().getColumns()[0].dispose(); } treeLayout = new TreeColumnLayout(); composite.setLayout(treeLayout); dRepresentationReplaced = true; initializeColumnsAndComponentsRelatedToDRepresentation(treeLayout); }
Source:
private ChargeStatus internalChargeStatus(String code) { if(code == null) { return AUTHORISATION_SUCCESS; } else if (code.equals("P0010")) { return AUTHORISATION_REJECTED; } else { return AUTHORISATION_ERROR; } }

Target:
private ChargeStatus internalChargeStatus(String code) { if(code == null) { return AUTHORISATION_SUCCESS; } else if ("P0010".equals(code)) { return AUTHORISATION_REJECTED; } else { return AUTHORISATION_ERROR; } }
Source:
public void handleEvent(EventBundle events) { if (!events.containsEventName(ThumbnailConstants.EventNames.scheduleThumbnailUpdate.name())) { return; } Set<String> processedDocs = new HashSet<>(); for (Event event : events) { if (!ThumbnailConstants.EventNames.scheduleThumbnailUpdate.name().equals(event.getName())) { continue; } DocumentEventContext context = (DocumentEventContext) event.getContext(); DocumentModel doc = context.getSourceDocument(); if (Boolean.TRUE.equals(context.getProperty(ThumbnailConstants.DISABLE_THUMBNAIL_COMPUTATION))) { log.trace("Thumbnail computation is disabled for document {}", doc.getId()); continue; } if (doc instanceof DeletedDocumentModel) { continue; } if (doc.isProxy()) { continue; } if (processedDocs.contains(doc.getId())) { continue; } CoreSession repo = context.getCoreSession(); processDoc(repo, doc); processedDocs.add(doc.getId()); } }

Target:
public void handleEvent(EventBundle events) { if (!events.containsEventName(ThumbnailConstants.EventNames.scheduleThumbnailUpdate.name())) { return; } Set<String> processedDocs = new HashSet<>(); for (Event event : events) { if (!ThumbnailConstants.EventNames.scheduleThumbnailUpdate.name().equals(event.getName())) { continue; } DocumentEventContext context = (DocumentEventContext) event.getContext(); DocumentModel doc = context.getSourceDocument(); if (Boolean.TRUE.equals(context.getProperty(ThumbnailConstants.DISABLE_THUMBNAIL_COMPUTATION))) { log.trace("Thumbnail computation is disabled for document {}", doc::getId); continue; } if (doc instanceof DeletedDocumentModel) { continue; } if (doc.isProxy()) { continue; } if (processedDocs.contains(doc.getId())) { continue; } CoreSession repo = context.getCoreSession(); processDoc(repo, doc); processedDocs.add(doc.getId()); } }
Source:
private void flatten(Map<String, Serializable> map, State state, String prefix) { for (Entry<String, Serializable> en : state.entrySet()) { String key = en.getKey(); Serializable value = en.getValue(); String name; String realName = keyMappings.get(key); if (realName != null) { name = realName; } else if (key.startsWith(KEY_PREFIX)) { name = DBSSession.convToNXQL(key); if (name == null) { continue; } } else { name = key; } name = prefix == null ? name : prefix + name; if (value instanceof State) { flatten(map, (State) value, name + '/'); } else if (value instanceof List) { String nameSlash = name + '/'; int i = 0; for (Object v : (List<?>) value) { if (v instanceof State) { flatten(map, (State) v, nameSlash + i + '/'); } else { map.put(nameSlash + i, (Serializable) v); } i++; } } else if (value instanceof Object[]) { String nameSlash = name + '/'; int i = 0; for (Object v : (Object[]) value) { map.put(nameSlash + i, (Serializable) v); i++; } } else { map.put(name, value); } } }

Target:
protected void flatten(Map<String, Serializable> map, State state, String prefix) { for (Entry<String, Serializable> en : state.entrySet()) { String key = en.getKey(); Serializable value = en.getValue(); String name; String realName = keyMappings.get(key); if (realName != null) { name = realName; } else if (key.startsWith(KEY_PREFIX)) { name = DBSSession.convToNXQL(key); if (name == null) { continue; } } else { name = key; } name = prefix == null ? name : prefix + name; if (value instanceof State) { flatten(map, (State) value, name + '/'); } else if (value instanceof List) { String nameSlash = name + '/'; int i = 0; for (Object v : (List<?>) value) { if (v instanceof State) { flatten(map, (State) v, nameSlash + i + '/'); } else { map.put(nameSlash + i, (Serializable) v); } i++; } } else if (value instanceof Object[]) { String nameSlash = name + '/'; int i = 0; for (Object v : (Object[]) value) { map.put(nameSlash + i, (Serializable) v); i++; } } else { map.put(name, value); } } }
Source:
public String get(final String key, final long languageId, final User user, final boolean respectFrontendRoles) { if(!UtilMethods.isSet(key)) { return null; } String languageValue = null; try { final ContentType languageVariableContentType = APILocator.getContentTypeAPI(user).find(LANGUAGEVARIABLE); languageValue = this.getValueFromUserLanguage(key, languageId, user, respectFrontendRoles, languageVariableContentType); if (null == languageValue) { languageValue = this.getValueFromUserFallbackLanguage(key, languageId, user, respectFrontendRoles, languageVariableContentType); if (null == languageValue && languageVariableContentType instanceof MultilinguableFallback && MultilinguableFallback.class.cast(languageVariableContentType).fallback()) { languageValue = this.getValueFromDefaultLanguage(key, user, respectFrontendRoles, languageVariableContentType); } } } catch (DotDataException | DotSecurityException e) { Logger.debug(this, String.format("Could not retrieve Language Variable '%s': %s", key, e.getMessage()), e); } return (null != languageValue)? languageValue:key; }

Target:
public String get(final String key, final long languageId, final User user, final boolean respectFrontendRoles) { if(!UtilMethods.isSet(key)) { return null; } String languageValue = null; try { final ContentType languageVariableContentType = APILocator.getContentTypeAPI(user).find(LANGUAGEVARIABLE); languageValue = this.getValueFromUserLanguage(key, languageId, user, respectFrontendRoles, languageVariableContentType); if (null == languageValue) { languageValue = this.getValueFromUserFallbackLanguage(key, languageId, user, respectFrontendRoles, languageVariableContentType); if (null == languageValue && languageVariableContentType instanceof MultilinguableFallback && MultilinguableFallback.class.cast(languageVariableContentType).fallback()) { languageValue = this.getValueFromDefaultLanguage(key, user, respectFrontendRoles, languageVariableContentType); } } } catch (DotDataException | DotSecurityException e) { Logger.debug(this, ()-> String.format("Could not retrieve Language Variable '%s': %s", key, e.getMessage(), e)); } return (null != languageValue)? languageValue:key; }
Source:
private Navigator getNavigator() { return BaseUI.getCurrent().getNavigator(); }

Target:
private Navigator getNavigator() { return BaseUI.getCurrentNavigator(); }
Source:
public ListApplicationJson list( @QueryParam("query") final String query ) { Applications applications = this.applicationService.getInstalledApplications(); applications = this.sortApplications( applications ); applications = this.filterApplications( applications, query ); final ListApplicationJson json = new ListApplicationJson(); for ( final Application application : applications ) { final ApplicationKey applicationKey = application.getKey(); if ( !ApplicationKey.from( "com.enonic.xp.admin.ui" ).equals( applicationKey ) && !ApplicationKey.from( "com.enonic.xp.app.standardidprovider" ).equals( applicationKey ) ) { final SiteDescriptor siteDescriptor = this.siteService.getDescriptor( applicationKey ); final AuthDescriptor authDescriptor = this.authDescriptorService.getDescriptor( applicationKey ); final boolean localApplication = this.applicationService.isLocalApplication( applicationKey ); final ApplicationDescriptor appDescriptor = this.applicationDescriptorService.get( applicationKey ); json.add( application, localApplication, appDescriptor, siteDescriptor, authDescriptor, iconUrlResolver ); } } return json; }

Target:
public ListApplicationJson list( @QueryParam("query") final String query ) { Applications applications = this.applicationService.getInstalledApplications(); applications = this.filterApplications( applications, query ); applications = this.sortApplications( applications ); final ListApplicationJson json = new ListApplicationJson(); for ( final Application application : applications ) { final ApplicationKey applicationKey = application.getKey(); if ( !ApplicationKey.from( "com.enonic.xp.admin.ui" ).equals( applicationKey ) && !ApplicationKey.from( "com.enonic.xp.app.standardidprovider" ).equals( applicationKey ) ) { final SiteDescriptor siteDescriptor = this.siteService.getDescriptor( applicationKey ); final AuthDescriptor authDescriptor = this.authDescriptorService.getDescriptor( applicationKey ); final boolean localApplication = this.applicationService.isLocalApplication( applicationKey ); final ApplicationDescriptor appDescriptor = this.applicationDescriptorService.get( applicationKey ); json.add( application, localApplication, appDescriptor, siteDescriptor, authDescriptor, iconUrlResolver ); } } return json; }
Source:
private boolean updateIsUsingScsiReservationRequested(LunDisk lunDisk) { return getVmDeviceForVm().isUsingScsiReservation() != Boolean.TRUE.equals(lunDisk.isUsingScsiReservation()); }

Target:
private boolean updateIsUsingScsiReservationRequested(LunDisk lunDisk) { Boolean isUsingScsiReservationNewValue = lunDisk.isUsingScsiReservation(); return isUsingScsiReservationNewValue != null && getVmDeviceForVm().isUsingScsiReservation() != isUsingScsiReservationNewValue; }
Source:
KafkaBasedLog<String, byte[]> setupAndCreateKafkaBasedLog(String topic, final WorkerConfig config) { Map<String, Object> originals = config.originals(); Map<String, Object> producerProps = new HashMap<>(originals); producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName()); producerProps.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, Integer.MAX_VALUE); Map<String, Object> consumerProps = new HashMap<>(originals); consumerProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); consumerProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName()); Map<String, Object> adminProps = new HashMap<>(originals); Map<String, Object> topicSettings = null; if (config instanceof DistributedConfig) { topicSettings = ((DistributedConfig) config).configStorageTopicSettings(); } NewTopic topicDescription = TopicAdmin.defineTopic(topic) .config(topicSettings) .compacted() .partitions(1) .replicationFactor(config.getShort(DistributedConfig.CONFIG_STORAGE_REPLICATION_FACTOR_CONFIG)) .build(); return createKafkaBasedLog(topic, producerProps, consumerProps, new ConsumeCallback(), topicDescription, adminProps); }

Target:
KafkaBasedLog<String, byte[]> setupAndCreateKafkaBasedLog(String topic, final WorkerConfig config) { Map<String, Object> originals = config.originals(); Map<String, Object> producerProps = new HashMap<>(originals); producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class.getName()); producerProps.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, Integer.MAX_VALUE); Map<String, Object> consumerProps = new HashMap<>(originals); consumerProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); consumerProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class.getName()); Map<String, Object> adminProps = new HashMap<>(originals); Map<String, Object> topicSettings = config instanceof DistributedConfig ? ((DistributedConfig) config).configStorageTopicSettings() : Collections.emptyMap(); NewTopic topicDescription = TopicAdmin.defineTopic(topic) .config(topicSettings) .compacted() .partitions(1) .replicationFactor(config.getShort(DistributedConfig.CONFIG_STORAGE_REPLICATION_FACTOR_CONFIG)) .build(); return createKafkaBasedLog(topic, producerProps, consumerProps, new ConsumeCallback(), topicDescription, adminProps); }
Source:
public SAMRecord next() { final SAMRecord result = wrappedIterator.next(); if (checker != null) { final SAMRecord previous = checker.getPreviousRecord(); if (!checker.isSorted(result)) { throw new IllegalStateException(String.format( "Records %s should come after %s when sorting with %s", checker.getSortKey(previous), checker.getSortKey(result), checker.getSortOrder())); } } return result; }

Target:
public SAMRecord next() { final SAMRecord result = wrappedIterator.next(); if (checker != null) { final SAMRecord previous = checker.getPreviousRecord(); if (!checker.isSorted(result)) { throw new IllegalStateException(String.format( "Record %s should come after %s when sorting with %s ordering.", previous.getSAMString().trim(), result.getSAMString().trim(), checker.getSortOrder())); } } return result; }
Source:
private EventData setSpanContext(EventData event, Context parentContext) { Context eventSpanContext = tracerProvider.startSpan(parentContext, ProcessKind.MESSAGE); if (eventSpanContext != null) { Optional<Object> eventDiagnosticIdOptional = eventSpanContext.getData(DIAGNOSTIC_ID_KEY); if (eventDiagnosticIdOptional.isPresent()) { event.addProperty(DIAGNOSTIC_ID_KEY, eventDiagnosticIdOptional.get().toString()); tracerProvider.endSpan(eventSpanContext, Signal.complete()); event.addContext(SPAN_CONTEXT_KEY, eventSpanContext); } } return event; }

Target:
private EventData setSpanContext(EventData event, Context parentContext) { Optional<Object> eventContextData = event.getContext().getData(SPAN_CONTEXT_KEY); if (eventContextData.isPresent()) { return event; } else { Context eventSpanContext = tracerProvider.startSpan(parentContext, ProcessKind.MESSAGE); if (eventSpanContext != null) { Optional<Object> eventDiagnosticIdOptional = eventSpanContext.getData(DIAGNOSTIC_ID_KEY); if (eventDiagnosticIdOptional.isPresent()) { event.addProperty(DIAGNOSTIC_ID_KEY, eventDiagnosticIdOptional.get().toString()); tracerProvider.endSpan(eventSpanContext, Signal.complete()); event.addContext(SPAN_CONTEXT_KEY, eventSpanContext); } } } return event; }
Source:
private String getYearCharacters(String label) { if (label != null) { int labelCPCount = label.codePointCount(0, label.length()); if (labelCPCount >= 4) { return label.substring(0, label.offsetByCodePoints(0, 4)); } } return null; }

Target:
private String getYearCharacters(String label) { if (label != null && label.length() >= 4) { return label.substring(0, 4); } return null; }
Source:
private int getKeepAliveTimeout(String keepAlive) { int keepAliveTimeout = -1; String timeout = keepAlive.split(KEEP_ALIVE_TIMEOUT)[1]; int commaIndex = timeout.indexOf(','); if (commaIndex != -1) { timeout = timeout.substring(0, commaIndex); } try { keepAliveTimeout = Integer.parseInt(timeout) * 1000; } catch (NumberFormatException e) { log.error("Error parsing value " + timeout + " as connection keep-alive timeout.", e); } return keepAliveTimeout; }

Target:
private int getKeepAliveTimeout(String keepAlive) { int keepAliveTimeout = -1; String timeout; try { timeout = keepAlive.split(KEEP_ALIVE_TIMEOUT)[1]; } catch (ArrayIndexOutOfBoundsException ex) { log.error("Value is not specified in KeepAlive Timeout header."); return -1; } int commaIndex = timeout.indexOf(','); if (commaIndex != -1) { timeout = timeout.substring(0, commaIndex); } try { keepAliveTimeout = Integer.parseInt(timeout) * 1000; } catch (NumberFormatException e) { log.error("Error parsing value " + timeout + " as connection keep-alive timeout.", e); } return keepAliveTimeout; }
Source:
private void addGroundOverlayToMap(String groundOverlayUrl, HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays, boolean containerVisibility) { BitmapDescriptor groundOverlayBitmap = BitmapDescriptorFactory .fromBitmap(getImagesCache().get(groundOverlayUrl)); for (KmlGroundOverlay kmlGroundOverlay : groundOverlays.keySet()) { if (kmlGroundOverlay.getImageUrl().equals(groundOverlayUrl)) { GroundOverlayOptions groundOverlayOptions = kmlGroundOverlay.getGroundOverlayOptions() .image(groundOverlayBitmap); GroundOverlay mapGroundOverlay = attachGroundOverlay(groundOverlayOptions); if (containerVisibility == false) { mapGroundOverlay.setVisible(false); } groundOverlays.put(kmlGroundOverlay, mapGroundOverlay); } } }

Target:
private void addGroundOverlayToMap(String groundOverlayUrl, HashMap<KmlGroundOverlay, GroundOverlay> groundOverlays, boolean containerVisibility) { BitmapDescriptor groundOverlayBitmap = BitmapDescriptorFactory .fromBitmap(getImagesCache().get(groundOverlayUrl)); for (KmlGroundOverlay kmlGroundOverlay : groundOverlays.keySet()) { if (kmlGroundOverlay.getImageUrl().equals(groundOverlayUrl)) { GroundOverlayOptions groundOverlayOptions = kmlGroundOverlay.getGroundOverlayOptions() .image(groundOverlayBitmap); GroundOverlay mapGroundOverlay = attachGroundOverlay(groundOverlayOptions); if (!containerVisibility) { mapGroundOverlay.setVisible(false); } groundOverlays.put(kmlGroundOverlay, mapGroundOverlay); } } }
Source:
public void loadPreviewImage(JLabel bp, Entity entity, IPlayer player) { Image camo = CamoManager.getPlayerCamoImage(player); if (entity.getCamoCategory() != null && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) { camo = CamoManager.getEntityCamoImage(entity); } int tint = PlayerColors.getColorRGB(player.getColorIndex()); bp.setIcon(new ImageIcon(bv.getTilesetManager().loadPreviewImage( entity, camo, tint, bp))); }

Target:
public void loadPreviewImage(JLabel bp, Entity entity, IPlayer player) { Image camo = CamoManager.getPlayerCamoImage(player); if ((entity.getCamoCategory() != null) && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) { camo = CamoManager.getEntityCamoImage(entity); } int tint = PlayerColors.getColorRGB(player.getColorIndex()); bp.setIcon(new ImageIcon(bv.getTilesetManager().loadPreviewImage( entity, camo, tint, bp))); }
Source:
protected String buildLargeQuery() { StringBuilder qb = new StringBuilder(); qb.append("SELECT"); qb.append(" '"); for (int i = 0; i < BYTES_PER_ROW; i++) { qb.append('a'); } qb.append("' "); qb.append("FROM generate_series(1, "); qb.append(LARGE_QUERY_ROW_COUNT); qb.append(") s(i)"); log.info( "Large query will generate " + MAX_MEMORY + " bytes across " + LARGE_QUERY_ROW_COUNT + " rows" ); return qb.toString(); }

Target:
protected String buildLargeQuery() { StringBuilder qb = new StringBuilder(); qb.append("SELECT"); qb.append(" '"); for (int i = 0; i < BYTES_PER_ROW; i++) { qb.append('a'); } qb.append("' "); qb.append("FROM generate_series(1, "); qb.append(LARGE_QUERY_ROW_COUNT); qb.append(") s(i)"); return qb.toString(); }
Source:
private void onConfigChanged(@SuppressWarnings("unused") ConfigChangeEvent event) { boolean schemaEnabledBefore = isSchemaEnabled(); boolean tokenMapEnabledBefore = tokenMapEnabled; List<String> keyspacesBefore = this.refreshedKeyspaces; this.schemaEnabledInConfig = config.getBoolean(DefaultDriverOption.METADATA_SCHEMA_ENABLED); this.refreshedKeyspaces = config.getStringList( DefaultDriverOption.METADATA_SCHEMA_REFRESHED_KEYSPACES, Collections.emptyList()); this.tokenMapEnabled = config.getBoolean(DefaultDriverOption.METADATA_TOKEN_MAP_ENABLED); if ((!schemaEnabledBefore || !keyspacesBefore.equals(refreshedKeyspaces) || (!tokenMapEnabledBefore && tokenMapEnabled)) && isSchemaEnabled()) { refreshSchema(null, false, true) .whenComplete( (metadata, error) -> { if (error != null) { Loggers.warnWithException( LOG, "[{}] Unexpected error while refreshing schema after it was re-enabled " + "in the configuration, keeping the previous version", logPrefix, error); } }); } }

Target:
private void onConfigChanged(@SuppressWarnings("unused") ConfigChangeEvent event) { boolean schemaEnabledBefore = isSchemaEnabled(); boolean tokenMapEnabledBefore = tokenMapEnabled; List<String> keyspacesBefore = this.refreshedKeyspaces; this.schemaEnabledInConfig = config.getBoolean(DefaultDriverOption.METADATA_SCHEMA_ENABLED); this.refreshedKeyspaces = config.getStringList( DefaultDriverOption.METADATA_SCHEMA_REFRESHED_KEYSPACES, Collections.emptyList()); this.tokenMapEnabled = config.getBoolean(DefaultDriverOption.METADATA_TOKEN_MAP_ENABLED); if ((!schemaEnabledBefore || !keyspacesBefore.equals(refreshedKeyspaces) || (!tokenMapEnabledBefore && tokenMapEnabled)) && isSchemaEnabled()) { refreshSchema(null, false, true) .whenComplete( (metadata, error) -> { if (error != null) { Loggers.warnWithException( LOG, "[{}] Unexpected error while refreshing schema after it was re-enabled " + "in the configuration, keeping previous version", logPrefix, error); } }); } }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((attributeName == null) ? 0 : attributeName.hashCode()); return result; }

Target:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((attributeName == null) ? 0 : attributeName.hashCode()); return result; }
Source:
private static void removeExistingData() { try { for (int i = 0; i < TEST_DATA_KEYS.length; i++) { voltClient.delete(TABLE_NAME, TEST_DATA_KEYS[i]); } for (int i = 0; i < SCAN_RECORD_COUNT; i++) { voltClient.delete(TABLE_NAME, SCAN_KEY_PREFIX + i); } } catch (Exception e) { e.printStackTrace(); fail("Failed removeExistingData"); } }

Target:
private static void removeExistingData() { try { for (int i = 0; i < TEST_DATA_KEYS.length; i++) { voltClient.delete(TABLE_NAME, TEST_DATA_KEYS[i]); } for (int i = 0; i < SCAN_RECORD_COUNT; i++) { voltClient.delete(TABLE_NAME, SCAN_KEY_PREFIX + i); } } catch (Exception e) { Logger logger = LoggerFactory.getLogger(VoltDBClientTest.class); logger.error("Error while calling 'removeExistingData()'", e); fail("Failed removeExistingData"); } }
Source:
private void tryCommit(Producer<?, ?> producer, Map<? super EventMessage<?>, MonitorCallback> monitorCallbacks) { try { producer.commitTransaction(); monitorCallbacks.forEach((k, v) -> v.reportSuccess()); } catch (ProducerFencedException e) { logger.warn("Unable to commit transaction", e); throw new EventPublicationFailedException( "Event publication failed: Exception occurred while committing kafka transaction", e); } }

Target:
private void tryCommit(Producer<?, ?> producer, Map<? super EventMessage<?>, MonitorCallback> monitorCallbacks) { try { producer.commitTransaction(); monitorCallbacks.forEach((k, v) -> v.reportSuccess()); } catch (ProducerFencedException e) { logger.warn("Unable to commit transaction", e); monitorCallbacks.forEach((k, v) -> v.reportFailure(e)); throw new EventPublicationFailedException( "Event publication failed: Exception occurred while committing kafka transaction", e); } }
Source:
protected Map<String, Object> subsetMap(String prefix) { Map<String, Object> subset = new TreeMap<String, Object>(); for (Map.Entry<String, Object> e : configMap.entrySet()) { if (e.getKey() != null && e.getKey().startsWith(prefix)) { subset.put(e.getKey(), e.getValue()); } } return subset; }

Target:
protected Map<String, String> subsetMap(String prefix) { Map<String, String> subset = new TreeMap<String, String>(); for (Map.Entry<String, String> e : configMap.entrySet()) { if (e.getKey() != null && e.getKey().startsWith(prefix)) { subset.put(e.getKey(), e.getValue()); } } return subset; }
Source:
public Set<JobStatus> getStatuses() { Set<JobStatus> status = new HashSet<JobStatus>(); if (pending) { status.addAll(SchedulerDBManager.PENDING_JOB_STATUSES); } if (running) { status.addAll(SchedulerDBManager.RUNNING_JOB_STATUSES); } if (finished) { status.addAll(SchedulerDBManager.FINISHED_JOB_STATUSES); } return status; }

Target:
public Set<JobStatus> getStatuses() { return status; }
Source:
private void buildIndex(HashMap<String, String> indexEntries) throws IOException { dirCache = new DirCache(db.getIndexFile(), db.getFS()); if (indexEntries != null) { assertTrue(dirCache.lock()); DirCacheEditor editor = dirCache.editor(); for (java.util.Map.Entry<String,String> e : indexEntries.entrySet()) { writeTrashFile(e.getKey(), e.getValue()); ObjectInserter inserter = db.newObjectInserter(); final ObjectId id = inserter.insert(Constants.OBJ_BLOB, e .getValue().getBytes(Constants.CHARSET)); editor.add(new DirCacheEditor.DeletePath(e.getKey())); editor.add(new DirCacheEditor.PathEdit(e.getKey()) { @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.REGULAR_FILE); ent.setObjectId(id); ent.setUpdateNeeded(false); } }); } assertTrue(editor.commit()); } }

Target:
private void buildIndex(HashMap<String, String> indexEntries) throws IOException { dirCache = new DirCache(db.getIndexFile(), db.getFS()); if (indexEntries != null) { assertTrue(dirCache.lock()); DirCacheEditor editor = dirCache.editor(); for (java.util.Map.Entry<String,String> e : indexEntries.entrySet()) { writeTrashFile(e.getKey(), e.getValue()); ObjectInserter inserter = db.newObjectInserter(); final ObjectId id = inserter.insert(Constants.OBJ_BLOB, Constants.encode(e.getValue())); editor.add(new DirCacheEditor.DeletePath(e.getKey())); editor.add(new DirCacheEditor.PathEdit(e.getKey()) { @Override public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.REGULAR_FILE); ent.setObjectId(id); ent.setUpdateNeeded(false); } }); } assertTrue(editor.commit()); } }
Source:
protected void onPostExecute(UploadPostTaskResult result) { switch (result) { case ERROR: mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(mPost); mPostUploadNotifier.updateNotificationErrorForPost(mPost, mSite, mErrorMessage, 0); finishUpload(); break; case NOTHING_TO_UPLOAD: mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(mPost); finishUpload(); break; case PUSH_POST_DISPATCHED: break; } }

Target:
protected void onPostExecute(UploadPostTaskResult result) { switch (result) { case ERROR: mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(mPost); mPostUploadNotifier.updateNotificationErrorForPost(mPost, mSite, mErrorMessage, 0); finishUpload(); break; case NOTHING_TO_UPLOAD: mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(mPost, true); finishUpload(); break; case PUSH_POST_DISPATCHED: break; } }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; throw new ProvisionException("Only one ArchaiusModule may be installed"); }

Target:
public boolean equals(Object obj) { return this == obj; }
Source:
public SerializingCopier(Serializer<T> serializer) { if (serializer == null) { throw new NullPointerException("A " + SerializingCopier.class + " instance requires a " + Serializer.class + " instance to copy!"); } this.serializer = serializer; }

Target:
public SerializingCopier(Serializer<T> serializer) { if (serializer == null) { throw new NullPointerException("A " + SerializingCopier.class.getName() + " instance requires a " + Serializer.class.getName() + " instance to copy!"); } this.serializer = serializer; }
Source:
public static void saveValuesDDL(QuestionDB question, OptionDB option, String module) { ValueDB value = question.getValueBySession(module); if (!option.getName().equals(Constants.DEFAULT_SELECT_OPTION)) { if (value == null) { value = new ValueDB(option, question, Session.getSurveyByModule(module)); value.save(); } else { value.setOption(option); value.setValue(option.getName()); value.setUploadDate(new Date()); value.update(); } LayoutUtils.updateSurveyActionBarChartAddingQuestion(DashboardActivity.dashboardActivity.getSupportActionBar(), Session.getSurveyByModule(module).getId_survey(), question); } else { if (value != null) { value.delete(); LayoutUtils.updateSurveyActionBarChartRemovingQuestion(DashboardActivity.dashboardActivity.getSupportActionBar(), Session.getSurveyByModule(module).getId_survey(), question); } } }

Target:
public static void saveValuesDDL(QuestionDB question, OptionDB option, String module) { ValueDB value = question.getValueBySession(module); if (!option.getName().equals(Constants.DEFAULT_SELECT_OPTION)) { if (value == null) { value = new ValueDB(option, question, Session.getSurveyByModule(module)); value.save(); DomainEventPublisher .instance() .publish(new ValueChangedEvent(Session.getSurveyByModule(module).getId_survey(), new Question(question.getId_question(), question.getCompulsory()),ValueChangedEvent.Action.INSERT)); } else { value.setOption(option); value.setValue(option.getName()); value.setUploadDate(new Date()); value.update(); } } else { if (value != null) { value.delete(); DomainEventPublisher .instance() .publish(new ValueChangedEvent(Session.getSurveyByModule(module).getId_survey(), new Question(question.getId_question(), question.getCompulsory()),ValueChangedEvent.Action.DELETE)); } } }
Source:
public void setUp() throws Exception { catalogManager = new CatalogManager(); typeManager = new TypeRegistry(); transactionManager = createTestTransactionManager(catalogManager); tablePropertyManager = new TablePropertyManager(); testCatalog = createBogusTestingCatalog(CATALOG_NAME); catalogManager.registerCatalog(testCatalog); tablePropertyManager.addProperties(testCatalog.getConnectorId(), ImmutableList.of(stringSessionProperty("baz", "test property", null, false))); testSession = testSessionBuilder() .setCatalog(CATALOG_NAME) .setSchema(TINY_SCHEMA_NAME) .setTransactionId(transactionManager.beginTransaction(false)) .build(); metadata = new MockMetadata(typeManager, tablePropertyManager, testCatalog.getConnectorId()); }

Target:
public void setUp() throws Exception { catalogManager = new CatalogManager(); typeManager = new TypeRegistry(); transactionManager = createTestTransactionManager(catalogManager); tablePropertyManager = new TablePropertyManager(); testCatalog = createBogusTestingCatalog(CATALOG_NAME); catalogManager.registerCatalog(testCatalog); tablePropertyManager.addProperties(testCatalog.getConnectorId(), ImmutableList.of(stringSessionProperty("baz", "test property", null, false))); testSession = testSessionBuilder() .setTransactionId(transactionManager.beginTransaction(false)) .build(); metadata = new MockMetadata(typeManager, tablePropertyManager, testCatalog.getConnectorId()); }
Source:
protected void createEmptyRepository() throws Exception { File gitDir = new File(new File(getTestDirectory(), EMPTY_REPOSITORY), Constants.DOT_GIT); FileUtils.mkdirs(gitDir); Repository myRepository = new FileRepository(gitDir); myRepository.create(); IProject firstProject = ResourcesPlugin.getWorkspace().getRoot() .getProject(EMPTY_PROJECT); if (firstProject.exists()) firstProject.delete(true, null); IProjectDescription desc = ResourcesPlugin.getWorkspace() .newProjectDescription(EMPTY_PROJECT); desc.setLocation(new Path(new File(myRepository.getWorkTree(), EMPTY_PROJECT).getPath())); firstProject.create(desc, null); firstProject.open(null); IFolder folder = firstProject.getFolder(FOLDER); folder.create(false, true, null); IFile textFile = folder.getFile(FILE1); textFile.create(new ByteArrayInputStream("Hello, world" .getBytes(firstProject.getDefaultCharset())), false, null); IFile textFile2 = folder.getFile(FILE2); textFile2.create(new ByteArrayInputStream("Some more content" .getBytes(firstProject.getDefaultCharset())), false, null); new ConnectProviderOperation(firstProject, gitDir).execute(null); }

Target:
protected void createEmptyRepository() throws Exception { File gitDir = new File(new File(getTestDirectory(), EMPTY_REPOSITORY), Constants.DOT_GIT); Repository myRepository = new FileRepository(gitDir); myRepository.create(); IProject firstProject = ResourcesPlugin.getWorkspace().getRoot() .getProject(EMPTY_PROJECT); if (firstProject.exists()) firstProject.delete(true, null); IProjectDescription desc = ResourcesPlugin.getWorkspace() .newProjectDescription(EMPTY_PROJECT); desc.setLocation(new Path(new File(myRepository.getWorkTree(), EMPTY_PROJECT).getPath())); firstProject.create(desc, null); firstProject.open(null); IFolder folder = firstProject.getFolder(FOLDER); folder.create(false, true, null); IFile textFile = folder.getFile(FILE1); textFile.create(new ByteArrayInputStream("Hello, world" .getBytes(firstProject.getDefaultCharset())), false, null); IFile textFile2 = folder.getFile(FILE2); textFile2.create(new ByteArrayInputStream("Some more content" .getBytes(firstProject.getDefaultCharset())), false, null); new ConnectProviderOperation(firstProject, gitDir).execute(null); }
Source:
private static Folder getCreationMenuModel(final URI uri) throws URISyntaxException { Folder folder = null; Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); Resource resource = resourceSet.getResource(uri, true); if (null != resource.getContents() && resource.getContents().get(0) instanceof Folder) { folder = (Folder) resource.getContents().get(0); } return folder; }

Target:
private static Folder getCreationMenuModel(final URI uri) throws URISyntaxException { Folder folder = null; Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); Resource resource = resourceSet.getResource(uri, true); if (null != resource.getContents() && 0 < resource.getContents().size() && resource.getContents().get(0) instanceof Folder) { folder = (Folder) resource.getContents().get(0); } return folder; }
Source:
public void close() { if (handler != null) { handler.removeCallbacksAndMessages(null); } }

Target:
public void close() { if (handler != null) { handler.removeCallbacksAndMessages(null); handler = null; } }
Source:
private void populateDefaultTypeDefinitions(){ UserDefinedType boolType = new UserDefinedType("Bool", new PrimitiveType(PrimitiveType.PrimitiveKind.BOOLEAN)); UserDefinedType intType = new UserDefinedType("Int", new PrimitiveType(PrimitiveType.PrimitiveKind.INTEGER)); UserDefinedType stringType = new UserDefinedType("String", new PrimitiveType(PrimitiveType.PrimitiveKind.STRING)); try{ addTypeTypeDefinition(boolType); addTypeTypeDefinition(intType); addTypeTypeDefinition(stringType); }catch(MultipleDefinitionException mde){ throw new UndefinedBehaviourError("could not create default type definitions (" + mde.getMessage() + ")"); } }

Target:
private void populateDefaultTypeDefinitions(){ Type boolType = new BooleanType(); Type intType = new IntegerType(); Type stringType = new StringType(); try{ addUserDefinedTypeDefinition("Bool", boolType); addUserDefinedTypeDefinition("Int", intType); addUserDefinedTypeDefinition("String", stringType); }catch(MultipleDefinitionException mde){ throw new UndefinedBehaviourError("could not create default type definitions (" + mde.getMessage() + ")"); } }
Source:
public void execute() { if (getRule() == null) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role permission rule provided"); } Role role = roleService.findRole(getRoleId()); if (role == null) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role id provided"); } CallContext.current().setEventDetails("Role id: " + role.getId() + ", rule:" + getRule() + ", permission: " + getPermission() + ", description: " + getDescription()); RolePermission rolePermission = roleService.createRolePermission(role, getRule(), getPermission(), getDescription()); if (rolePermission == null) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create role permission"); } RolePermissionResponse response = new RolePermissionResponse(); response.setId(rolePermission.getUuid()); response.setRoleId(role.getUuid()); response.setRule(rolePermission.getRule()); response.setRulePermission(rolePermission.getPermission()); response.setDescription(rolePermission.getDescription()); response.setResponseName(getCommandName()); response.setObjectName("rolepermission"); setResponseObject(response); }

Target:
public void execute() { final Role role = roleService.findRole(getRoleId()); if (role == null) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role id provided"); } CallContext.current().setEventDetails("Role id: " + role.getId() + ", rule:" + getRule() + ", permission: " + getPermission() + ", description: " + getDescription()); final RolePermission rolePermission = roleService.createRolePermission(role, getRule(), getPermission(), getDescription()); if (rolePermission == null) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create role permission"); } setupResponse(rolePermission, role); }
Source:
public Function<Set<String>, Set<String>> finisher() { return null; }

Target:
public Function<Set<String>, Set<String>> finisher() { return (inputSet) -> inputSet; }
Source:
public void testInstanceBuildSingleCoreNodeps() throws SQLException, IOException, SolrServerException { String testName = "testInstanceBuildSingleCoreNodeps"; System.out.println("-------------------" + testName + "-------------------"); String[] args = new String[] { "--context=index-config_DEV.xml", "--cores=ma", "--nodeps" }; System.out.println("Command line = " + StringUtils.join(args, ",")); IndexerManager indexerManager = new IndexerManager(); try { indexerManager.initialise(args); } catch (IndexerException ie) { fail(ie.getLocalizedMessage()); } String[] actualCores = indexerManager.getCores().toArray(new String[0]); String[] expectedCores = new String[] { IndexerManager.ANATOMY_CORE}; assertArrayEquals(expectedCores, actualCores); }

Target:
public void testInstanceBuildSingleCoreNodeps() throws SQLException, IOException, SolrServerException { String testName = "testInstanceBuildSingleCoreNodeps"; System.out.println("-------------------" + testName + "-------------------"); String[] args = new String[] { "--cores=anatomy", "--nodeps" }; System.out.println("Command line = " + StringUtils.join(args, ",")); IndexerManager indexerManager = new IndexerManager(); try { indexerManager.initialise(args); } catch (IndexerException ie) { fail(ie.getLocalizedMessage()); } String[] actualCores = indexerManager.getCores().toArray(new String[0]); String[] expectedCores = new String[] { IndexerManager.ANATOMY_CORE}; assertArrayEquals(expectedCores, actualCores); try { indexerManager.run(); } catch (IndexerException ie) { fail(ie.getLocalizedMessage()); } }
Source:
public boolean hasNext() { try { if (currentProgrammes == null) { if (!programmeQueries.hasNext()) { return false; } currentResponse = client.execute(programmeQueries.next()); currentProgrammes = currentResponse.getResults(); return true; } else if (currentResponse.hasNext()) { currentProgrammes = currentResponse.getNext().getResults(); return true; } else if (!currentResponse.hasNext()) { if (!programmeQueries.hasNext()) { return false; } currentResponse = client.execute(programmeQueries.next()); currentProgrammes = currentResponse.getResults(); return true; } return false; } catch (GlycerinException e) { throw Throwables.propagate(e); } }

Target:
public boolean hasNext() { try { if (currentResponse == null) { if (programmeQueries.hasNext()) { currentResponse = client.execute(programmeQueries.next()); return currentResponse.hasNext(); } else { return false; } } else if (currentResponse.hasNext()) { return true; } else { if (programmeQueries.hasNext()) { currentResponse = client.execute(programmeQueries.next()); return currentResponse.hasNext(); } else { return false; } } } catch (GlycerinException e) { throw Throwables.propagate(e); } }
Source:
public Exporter(Collection col) { mCol = col; mDid = null; mCids = null; }

Target:
public Exporter(Collection col) { mCol = col; mDid = null; }
Source:
public void handleReceive(@Nullable Resp response, @Nullable Throwable error, Span span) { assert response != null || error != null : "Either the response or error parameters may be null, but not both"; if (!(response instanceof HttpClientResponse)) { handleFinish(adapter, response, error, span); return; } HttpClientResponse clientResponse = (HttpClientResponse) response; Object unwrapped = clientResponse.unwrap(); if (unwrapped == null) { handleFinish(error, span); } else { handleFinish(new HttpClientResponse.Adapter(clientResponse), unwrapped, error, span); } }

Target:
public void handleReceive(@Nullable Resp response, @Nullable Throwable error, Span span) { if (response == null && error == null) { throw new IllegalArgumentException( "Either the response or error parameters may be null, but not both"); } if (!(response instanceof HttpClientResponse)) { handleFinish(adapter, response, error, span); return; } HttpClientResponse clientResponse = (HttpClientResponse) response; Object unwrapped = clientResponse.unwrap(); if (unwrapped == null) { handleFinish(error, span); } else { handleFinish(new HttpClientResponse.Adapter(clientResponse), unwrapped, error, span); } }
Source:
private TableOperatorWrapper<?> visitTwoInputTransformation( TwoInputTransformation<RowData, RowData, RowData> transform) { Transformation<?> input1 = transform.getInput1(); Transformation<?> input2 = transform.getInput2(); int inputIdx1 = inputTransforms.indexOf(input1); int inputIdx2 = inputTransforms.indexOf(input2); TableOperatorWrapper<?> wrapper = new TableOperatorWrapper<>( transform.getOperatorFactory(), genSubOperatorName(transform), Arrays.asList(transform.getInputType1(), transform.getInputType2()), transform.getOutputType()); if (inputIdx1 >= 0 && inputIdx2 >= 0) { orderedInputTransforms.add(input1); inputSpecs.add(createInputSpec(readOrders[inputIdx1], wrapper, 1)); orderedInputTransforms.add(input2); inputSpecs.add(createInputSpec(readOrders[inputIdx2], wrapper, 2)); headWrappers.add(wrapper); } else if (inputIdx1 >= 0) { TableOperatorWrapper<?> inputWrapper = visit(input2); wrapper.addInput(inputWrapper, 2); orderedInputTransforms.add(input1); inputSpecs.add(createInputSpec(readOrders[inputIdx1], wrapper, 1)); headWrappers.add(wrapper); } else if (inputIdx2 >= 0) { TableOperatorWrapper<?> inputWrapper = visit(input1); wrapper.addInput(inputWrapper, 1); orderedInputTransforms.add(input2); inputSpecs.add(createInputSpec(readOrders[inputIdx2], wrapper, 2)); headWrappers.add(wrapper); } else { TableOperatorWrapper<?> inputWrapper1 = visit(input1); wrapper.addInput(inputWrapper1, 1); TableOperatorWrapper<?> inputWrapper2 = visit(input2); wrapper.addInput(inputWrapper2, 2); } return wrapper; }

Target:
private TableOperatorWrapper<?> visitTwoInputTransformation( TwoInputTransformation<RowData, RowData, RowData> transform) { Transformation<?> input1 = transform.getInput1(); Transformation<?> input2 = transform.getInput2(); int inputIdx1 = inputTransforms.indexOf(input1); int inputIdx2 = inputTransforms.indexOf(input2); TableOperatorWrapper<?> wrapper = new TableOperatorWrapper<>( transform.getOperatorFactory(), genSubOperatorName(transform), Arrays.asList(transform.getInputType1(), transform.getInputType2()), transform.getOutputType()); if (inputIdx1 >= 0 && inputIdx2 >= 0) { processInput(input1, inputIdx1, wrapper, 1); processInput(input2, inputIdx2, wrapper, 2); headWrappers.add(wrapper); } else if (inputIdx1 >= 0) { TableOperatorWrapper<?> inputWrapper = visit(input2); wrapper.addInput(inputWrapper, 2); processInput(input1, inputIdx1, wrapper, 1); headWrappers.add(wrapper); } else if (inputIdx2 >= 0) { TableOperatorWrapper<?> inputWrapper = visit(input1); wrapper.addInput(inputWrapper, 1); processInput(input2, inputIdx2, wrapper, 2); headWrappers.add(wrapper); } else { TableOperatorWrapper<?> inputWrapper1 = visit(input1); wrapper.addInput(inputWrapper1, 1); TableOperatorWrapper<?> inputWrapper2 = visit(input2); wrapper.addInput(inputWrapper2, 2); } return wrapper; }