auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
GeoFilterPanel() { numberModel = new SpinnerNumberModel(10, 1, Integer.MAX_VALUE, 1); initComponents(); checkboxPanel = new CheckBoxListPanel<>(); checkboxPanel.setPanelTitle(Bundle.GeoFilterPanel_DataSource_List_Title()); checkboxPanel.setPanelTitleIcon(new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/image.png"))); checkboxPanel.setSetAllSelected(true); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 15); add(checkboxPanel, gridBagConstraints); try { initCheckboxList(); } catch (TskCoreException ex) { logger.log(Level.WARNING, "Failed to initialize the CheckboxListPane", ex); } }

Target:
GeoFilterPanel() { numberModel = new SpinnerNumberModel(10, 1, Integer.MAX_VALUE, 1); initComponents(); checkboxPanel = new CheckBoxListPanel<>(); checkboxPanel.setPanelTitle(Bundle.GeoFilterPanel_DataSource_List_Title()); checkboxPanel.setPanelTitleIcon(new ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/images/image.png"))); checkboxPanel.setSetAllSelected(true); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 15, 0, 15); add(checkboxPanel, gridBagConstraints); }
Source:
private TestObjectStreamMarshaller marshaller() { if (marshaller == null) { marshaller = new TestObjectStreamMarshaller(); } return marshaller; }

Target:
private TestObjectStreamMarshaller marshaller() { return marshaller; }
Source:
public ContainerProvider getContainerProvider() { return this.containerProvider; }

Target:
@Nullable public ContainerProvider getContainerProvider() { return this.containerProvider; }
Source:
private String userCn(String username) { if (username.contains("@")) { try (LDAPResource ldap = new LDAPResource()) { Entry user = ldap.findUserByEmail(username); if (user != null) { return user.getDn().getName(); } } catch (LdapException | IOException e) { logger.debug("LDAP connection error", e); throw new AuthenticationException(LDAP_AUTH, "LDAP connection error", e); } } String sanitizedUser = username.replaceAll("[,=]", ""); String cn = "cn=" + sanitizedUser + "," + userDn; return cn; }

Target:
private String userCn(String username) { if (lookupAttrs.length > 0) { try (LDAPResource ldap = new LDAPResource()) { Entry user = ldap.lookupUser(username); if (user != null) { return user.getDn().getName(); } } catch (LdapException | IOException e) { logger.debug("LDAP connection error", e); throw new AuthenticationException(LDAP_AUTH, "LDAP connection error", e); } } String sanitizedUser = username.replaceAll("[,=]", ""); String cn = "cn=" + sanitizedUser + "," + userDn; return cn; }
Source:
private void resetOptionSettings(IHoldsOptions holder) { IOption[] opts = holder.getOptions(); for (IOption opt : opts) { Object val = opt.getDefaultValue(); if (val instanceof Boolean) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (Boolean)val); } else if (val instanceof String[]) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String[])val); } else if (val instanceof String){ ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String)val); } } }

Target:
private void resetOptionSettings(IHoldsOptions holder) { IOption[] opts = holder.getOptions(); for (IOption opt : opts) { Object val = opt.getDefaultValue(); if (val instanceof Boolean) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (Boolean)val); } else if (val instanceof String[]) { ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String[])val); } else if (val instanceof String){ ManagedBuildManager.setOption(toolChain.getParent(), holder, opt, (String)val); } else if (val == null) { holder.removeOption(opt); } else { ManagedBuilderCorePlugin.error("Unknown type of value " + val + " for " + opt); } } }
Source:
public GeoOverlay parse() throws InvalidStructureException, IOException, XmlPullParserException { DisplayUnit title = null; DisplayUnit coordinates = null; while (nextTagInBlock(NAME_GEO_OVERLAY)) { String tagName = parser.getName().toLowerCase(); if (NAME_COORDINATES.contentEquals(tagName)) { nextTagInBlock(NAME_COORDINATES); coordinates = new DisplayUnit(new TextParser(parser).parse()); } else if (NAME_TITLE.contentEquals(tagName)) { nextTagInBlock(NAME_TITLE); title = new DisplayUnit(new TextParser(parser).parse()); } } return new GeoOverlay(title, coordinates); }

Target:
public GeoOverlay parse() throws InvalidStructureException, IOException, XmlPullParserException { DisplayUnit title = null; DisplayUnit coordinates = null; while (nextTagInBlock(NAME_GEO_OVERLAY)) { String tagName = parser.getName().toLowerCase(); if (NAME_COORDINATES.contentEquals(tagName)) { nextTagInBlock(NAME_COORDINATES); coordinates = new DisplayUnit(new TextParser(parser).parse()); } else if (NAME_LABEL.contentEquals(tagName)) { nextTagInBlock(NAME_LABEL); title = new DisplayUnit(new TextParser(parser).parse()); } } return new GeoOverlay(title, coordinates); }
Source:
private boolean hasRuntimeAnnotation(@Nonnull JDefinedClassOrInterface type) { if (containsRuntimeAnnotation(type.getAnnotationTypes())) { return true; } for (JField field : type.getFields()) { if (containsRuntimeAnnotation(field.getAnnotationTypes())) { return true; } } for (JMethod method : type.getMethods()) { if (containsRuntimeAnnotation(method.getAnnotationTypes())) { return true; } for (JParameter param : method.getParams()) { if (containsRuntimeAnnotation(param.getAnnotationTypes())) { return true; } } } return false; }

Target:
private boolean hasRuntimeAnnotation(@Nonnull JDefinedClassOrInterface type) { if (isAnnotatedByRuntimeAnnotation(type)) { return true; } for (JField field : type.getFields()) { if (isAnnotatedByRuntimeAnnotation(field)) { return true; } } for (JMethod method : type.getMethods()) { if (isAnnotatedByRuntimeAnnotation(method)) { return true; } for (JParameter param : method.getParams()) { if (isAnnotatedByRuntimeAnnotation(param)) { return true; } } } return false; }
Source:
public void DoPrePublish(Collection collection, String encryptionPassword) throws IOException { try { BeginPublish(collection, encryptionPassword); SendManifest(collection, encryptionPassword); } catch (IOException e) { SlackNotification.alarm(String.format("Exception on the pre-publish of collection: %s: %s", collection.description.name, e.getMessage())); logError(e, "exception on the pre-publish of collection").collectionName(collection); throw e; } finally { collection.save(); } }

Target:
public void DoPrePublish(Collection collection, String encryptionPassword) throws IOException { try { BeginPublish(collection, encryptionPassword); SendManifest(collection, encryptionPassword); } catch (IOException e) { SlackNotification.alarm(String.format("Exception on the pre-publish of collection: %s: %s", collection.getDescription().getName(), e.getMessage())); logError(e, "exception on the pre-publish of collection").collectionName(collection).log(); throw e; } finally { collection.save(); } }
Source:
public void connectionStatusResponse(){ new Thread(new Runnable() { @Override public void run() { synchronized (serviceControllerLock) { while (mServiceRequestController == null) { try { this.wait(); } catch (InterruptedException e) { } } } if (mServiceRequestController.isConnected()) { onServerConnected(); } else { onServerDisconnected(); } } }).start(); }

Target:
public void connectionStatusResponse(){ new Thread(new Runnable() { @Override public void run() { synchronized (serviceControllerLock) { while (mServiceRequestController == null) { try { this.wait(); } catch (InterruptedException e) { Log.d("Y:" + this.getClass().getName(), "Stopped waiting for request controller" + e.getMessage()); } } } if (mServiceRequestController.isConnected()) { onServerConnected(); } else { onServerDisconnected(); } } }).start(); }
Source:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRestoreSnapshotCommand())) { restoreSnapshot(); } else if (command.equals(getDeleteSnapshotCommand())) { deleteSnapshot(); } else if (command.equals(getDeleteAllSnapshotsCommand())) { deleteAllSnapshots(); } else if (command.equals(getActivateSnapshotCommand())) { activateSnapshot(); } else if (command.equals(getDeactivateSnapshotCommand())) { deactivateSnapshot(); } else if (command.getName().equals("onRestoreSnapshot")) { onRestoreSnapshot(); } else if (command.getName().equals("onDeleteSnapshot")) { onDeleteSnapshot(); } else if (command.getName().equals("onDeleteAllSnapshots")) { onDeleteAllSnapshots(); } else if (command.getName().equals("onActivateSnapshot")) { onActivateSnapshot(); } else if (command.getName().equals("onDeactivateSnapshot")) { onDeactivateSnapshot(); } else if (command.getName().equals("cancelConfirmation")) { setConfirmWindow(null); } else if (command.equals(getNewSnapshotCommand())) { newSnapshot(); } else if (command.getName().equalsIgnoreCase("onCreateSnapshot")) { onCreateSnapshot(); } else if (command.getName().equalsIgnoreCase("cancel")) { setWindow(null); } else if (command.equals(getEditSnapshotScheduleCommand())) { editSnapshotSchedule(); } else if (command.getName().equalsIgnoreCase("onEditSnapshotSchedule")) { onEditSnapshotSchedule(); } }

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRestoreSnapshotCommand())) { restoreSnapshot(); } else if (command.equals(getDeleteSnapshotCommand())) { deleteSnapshot(); } else if (command.equals(getDeleteAllSnapshotsCommand())) { deleteAllSnapshots(); } else if (command.equals(getActivateSnapshotCommand())) { activateSnapshot(); } else if (command.equals(getDeactivateSnapshotCommand())) { deactivateSnapshot(); } else if (command.getName().equals("onRestoreSnapshot")) { onRestoreSnapshot(); } else if (command.getName().equals("onDeleteSnapshot")) { onDeleteSnapshot(); } else if (command.getName().equals("onDeleteAllSnapshots")) { onDeleteAllSnapshots(); } else if (command.getName().equals("onActivateSnapshot")) { onActivateSnapshot(); } else if (command.getName().equals("onDeactivateSnapshot")) { onDeactivateSnapshot(); } else if (command.getName().equals("cancelConfirmation")) { setConfirmWindow(null); } else if (command.equals(getCreateSnapshotCommand())) { createSnapshot(); } else if (command.getName().equalsIgnoreCase("onCreateSnapshot")) { onCreateSnapshot(); } else if (command.getName().equalsIgnoreCase("cancel")) { setWindow(null); } else if (command.equals(getEditSnapshotScheduleCommand())) { editSnapshotSchedule(); } else if (command.getName().equalsIgnoreCase("onEditSnapshotSchedule")) { onEditSnapshotSchedule(); } }
Source:
public static void processScheduledDeletions(SaveHandler saveHandler) { for (String folderName : foldersScheduledForDeletion) { File folder = new File(saveHandler.getWorldDirectory(), folderName); try { FileUtils.deleteDirectory(folder); LOGGER.info(DIMMGR, "Modded dimension directory scheduled for deletion was deleted.", folderName); } catch (Exception e) { LOGGER.error(DIMMGR, "Failed to delete modded dimension directory that was scheduled for deletion.", folderName, e); } } foldersScheduledForDeletion.clear(); }

Target:
public static void processScheduledDeletions(SaveHandler saveHandler) { List<String> toDelete = new ArrayList<>(foldersScheduledForDeletion); foldersScheduledForDeletion.clear(); if (!toDelete.isEmpty()) { StringBuilder text = new StringBuilder(); text.append("The following dimensions are marked for deletion by their owning mod. Proceed?\n\n"); for (String folder : toDelete) { text.append(folder).append('\n'); } if (!StartupQuery.confirm(text.toString())) { StartupQuery.abort(); return; } } for (String folderName : toDelete) { File folder = new File(saveHandler.getWorldDirectory(), folderName); try { FileUtils.deleteDirectory(folder); LOGGER.info(DIMMGR, "Modded dimension directory scheduled for deletion was deleted.", folderName); } catch (Exception e) { LOGGER.error(DIMMGR, "Failed to delete modded dimension directory that was scheduled for deletion.", folderName, e); } } }
Source:
protected List<Object> identifyClearGarbage(Object locator) { List<Object> garbage = new ArrayList<>(); garbage.addAll(locatorStore.clearUnsafe()); return garbage; }

Target:
protected List<Object> identifyClearGarbage(Object locator) { return new ArrayList<>(locatorStore.clearUnsafe()); }
Source:
public void onDirectTabChange(TabChangeEvent tEvent) { Tab selectedTab = tEvent.getTab(); if (selectedTab.getId().equalsIgnoreCase(DIRECTDOMAINTAB)) { directTabIndex = 0; } else if (selectedTab.getId().equalsIgnoreCase(DIRECTAGENTTAB)) { directTabIndex = 1; } else if (selectedTab.getId().equalsIgnoreCase(DIRECTCERTTAB)) { directTabIndex = 2; } else { directTabIndex = 3; } }

Target:
public void onDirectTabChange(TabChangeEvent tEvent) { Tab selectedTab = tEvent.getTab(); if (DIRECTDOMAINTAB.equalsIgnoreCase(selectedTab.getId())) { directTabIndex = 0; } else if (DIRECTAGENTTAB.equalsIgnoreCase(selectedTab.getId())) { directTabIndex = 1; } else if (DIRECTCERTTAB.equalsIgnoreCase(selectedTab.getId())) { directTabIndex = 2; } else { directTabIndex = 3; } }
Source:
public Builder setOnAudioFocusChangeListener( @NonNull OnAudioFocusChangeListener listener, @NonNull Handler handler) { mOnAudioFocusChangeListener = listener; mFocusChangeHandler = handler; return this; }

Target:
public Builder setOnAudioFocusChangeListener( @NonNull OnAudioFocusChangeListener listener, @NonNull Handler handler) { if (listener == null) { throw new IllegalArgumentException( "OnAudioFocusChangeListener must not be null"); } if (handler == null) { throw new IllegalArgumentException( "Handler must not be null"); } mOnAudioFocusChangeListener = listener; mFocusChangeHandler = handler; return this; }
Source:
public void removeContainer(final RemoveContainerParams params) throws IOException { String containerId = params.getContainer(); Pod pod = getChePodByContainerId(containerId); String deploymentName = pod.getMetadata().getLabels().get(OPENSHIFT_DEPLOYMENT_LABEL); Deployment d = getDeploymentByName(deploymentName); ReplicaSet rs = getReplicaSetByLabel(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); Service svc = getCheServiceBySelector(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); if (svc != null) { LOG.info("Removing OpenShift Service " + svc.getMetadata().getName()); openShiftClient.resource(svc).delete(); } if (d != null) { LOG.info("Removing OpenShift Deployment " + d.getMetadata().getName()); openShiftClient.resource(d).delete(); } if (rs!= null) { LOG.info("Removing Replica Set " + rs.getMetadata().getName()); openShiftClient.resource(rs).delete(); } if (pod != null) { LOG.info("Removing OpenShift Pod " + pod.getMetadata().getName()); openShiftClient.resource(pod).delete(); } }

Target:
public void removeContainer(final RemoveContainerParams params) throws IOException { String containerId = params.getContainer(); Pod pod = getChePodByContainerId(containerId); String deploymentName = pod.getMetadata().getLabels().get(OPENSHIFT_DEPLOYMENT_LABEL); Deployment deployment = getDeploymentByName(deploymentName); ReplicaSet replicaSet = getReplicaSetByLabel(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); Service service = getCheServiceBySelector(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); if (service != null) { LOG.info("Removing OpenShift Service {}", service.getMetadata().getName()); openShiftClient.resource(service).delete(); } if (deployment != null) { LOG.info("Removing OpenShift Deployment {}", deployment.getMetadata().getName()); openShiftClient.resource(deployment).delete(); } if (replicaSet != null) { LOG.info("Removing Replica Set {}", replicaSet.getMetadata().getName()); openShiftClient.resource(replicaSet).delete(); } LOG.info("Removing OpenShift Pod {}", pod.getMetadata().getName()); openShiftClient.resource(pod).delete(); }
Source:
static void cancelOperation() throws IOException { String operationFullId = "projects/[projectId]/locations/us-central1/operations/[operationId]"; cancelOperation(operationFullId); }

Target:
static void cancelOperation() throws IOException { String projectId = "YOUR_PROJECT_ID"; String location = "us-central1"; String operationId = "YOUR_OPERATION_ID"; String operationFullId = String.format("projects/%s/locations/%s/operations/%s", projectId, location, operationId); cancelOperation(operationFullId); }
Source:
public IFigure getToolTip() { if (toolTip == null) { Figure composite = new Figure(); GridLayout fl = new GridLayout(2, false); fl.horizontalSpacing = 1; fl.verticalSpacing = 1; composite.setLayoutManager(fl); for (DecorationDescriptor decoDescriptor : decoDescriptors) { composite.add(getDecorationFigureForTooltip(decoDescriptor)); IFigure decorationTooltip = getDecorationTooltip(decoDescriptor); if (decorationTooltip != null) { composite.add(getDecorationTooltip(decoDescriptor)); } else { composite.add(new Figure()); } } toolTip = composite; } return toolTip; }

Target:
public IFigure getToolTip() { if (toolTip == null) { Figure composite = new Figure(); GridLayout fl = new GridLayout(2, false); fl.horizontalSpacing = 1; fl.verticalSpacing = 1; composite.setLayoutManager(fl); for (DecorationDescriptor decoDescriptor : decoDescriptors) { IFigure decorationFigureForTooltip = getDecorationFigureForTooltip(decoDescriptor); if (decorationFigureForTooltip != null) { composite.add(decorationFigureForTooltip); IFigure decorationTooltip = getDecorationTooltip(decoDescriptor); if (decorationTooltip != null) { composite.add(getDecorationTooltip(decoDescriptor)); } else { composite.add(new Figure()); } } } toolTip = composite; } return toolTip; }
Source:
public boolean syncWait() { try { lock.await(2000, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { return false; } return lock.getCount() == 0; }

Target:
public boolean syncWait() { try { lock.await(15, SECONDS); } catch (InterruptedException e) { throw new RuntimeException(e); } return lock.getCount() == 0; }
Source:
@Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); List<String> inputFields = fieldNames(getInput().getRowType()); if (groupSet.cardinality() == 1) { final String groupByFieldName = inputFields.get(groupSet.nth(0)); implementor.addGroupBy(groupByFieldName); } else { for (int group : groupSet) { implementor.addGroupBy(inputFields.get(group)); } } for (AggregateCall aggCall : aggCalls) { List<String> names = new ArrayList<>(); for (int i : aggCall.getArgList()) { names.add(inputFields.get(i)); } final String name = names.isEmpty() ? ElasticsearchConstants.ID : names.get(0); String op = String.format(Locale.ROOT, "\"%s\":{\"field\": \"%s\"}", toElasticAggregate(aggCall), name); implementor.addAggregation(aggCall.getName(), op); } }

Target:
@Override public void implement(Implementor implementor) { implementor.visitChild(0, getInput()); List<String> inputFields = fieldNames(getInput().getRowType()); for (int group : groupSet) { implementor.addGroupBy(inputFields.get(group)); } for (AggregateCall aggCall : aggCalls) { List<String> names = new ArrayList<>(); for (int i : aggCall.getArgList()) { names.add(inputFields.get(i)); } final String name = names.isEmpty() ? ElasticsearchConstants.ID : names.get(0); String op = String.format(Locale.ROOT, "\"%s\":{\"field\": \"%s\"}", toElasticAggregate(aggCall), name); implementor.addAggregation(aggCall.getName(), op); } }
Source:
public void testUDPLargePacket() throws Exception { Subject<byte[], byte[]> sub = PublishSubject.create(); SimpleChan simpleadapter = new SimpleChan(sub); TestAwaitableObserver<byte[]> monitor = new TestAwaitableObserver<>(); sub.subscribe(monitor); int port; ServerFrontEnd udpSrv = null; int chances = RETRIES; boolean ready = false; do { chances --; port = rand.nextInt(100) + 8000; try { udpSrv = ServerFrontEnd.udp(simpleadapter, port, 65535); udpSrv.startAsync().awaitRunning(); ready = true; } catch (IllegalStateException e) { if (chances <= 0) throw e; } } while (!ready); byte[] msg = new byte[65535 - 28]; rand.nextBytes(msg); sendMSG(msg, port); monitor.awaitOnNext(1, TIMEOUT); assertThat("msg was received", monitor.getOnNextEvents().get(0), equalTo(msg)); udpSrv.stopAsync().awaitTerminated(); }

Target:
public void testUDPLargePacket() throws Exception { Subject<byte[], byte[]> sub = PublishSubject.create(); SimpleChan simpleadapter = new SimpleChan(sub); TestAwaitableObserver<byte[]> monitor = new TestAwaitableObserver<>(); sub.subscribe(monitor); Pair<ServerFrontEnd, Integer> cnxn = connect(simpleadapter, 65535); ServerFrontEnd udpSrv = cnxn.getLeft(); int port = cnxn.getRight(); byte[] msg = new byte[65535 - 28]; rand.nextBytes(msg); sendMSG(msg, port); monitor.awaitOnNext(1, TIMEOUT); assertThat("msg was received", monitor.getOnNextEvents().get(0), equalTo(msg)); udpSrv.stopAsync().awaitTerminated(); }
Source:
public void set(String mode) { AccessType world = null, trusted = null; try { String[] modes = StringUtils.split(mode, ','); world = AccessType.valueOf(modes[0].trim()); trusted = AccessType.valueOf(modes[1].trim()); } catch (RuntimeException e) { LOGGER.error("RuntimeException ", e); } if (world != null && trusted != null) { set(world, trusted); } }

Target:
public void set(String mode) { AccessType world = null, trusted = null; try { String[] modes = StringUtils.split(mode, ','); world = AccessType.valueOf(modes[0].trim()); trusted = AccessType.valueOf(modes[1].trim()); } catch (RuntimeException e) { LOGGER.error(e.getMessage(), e); } if (world != null && trusted != null) { set(world, trusted); } }
Source:
public void name() throws Exception { assertThat(faker.pokemon().name(), matchesRegularExpression("([\\w'\\./ ]+ ?)+")); }

Target:
public void name() throws Exception { assertThat(faker.rockBand().name(), matchesRegularExpression("([\\w'/.,&]+ ?)+")); }
Source:
public CompletableFuture<Boolean> matchMCConfig(Member member, String eTag) { checkNotNull(member); checkNotNull(eTag); ClientInvocation invocation = new ClientInvocation( client, MCMatchMCConfigCodec.encodeRequest(eTag), null, member.getAddress() ); return new ClientDelegatingFuture<>( invocation.invoke(), serializationService, clientMessage -> { MCMatchMCConfigCodec.ResponseParameters response = MCMatchMCConfigCodec.decodeResponse(clientMessage); return response.response; }, true ); }

Target:
public CompletableFuture<Boolean> matchMCConfig(Member member, String eTag) { checkNotNull(member); checkNotNull(eTag); ClientInvocation invocation = new ClientInvocation( client, MCMatchMCConfigCodec.encodeRequest(eTag), null, member.getAddress() ); return new ClientDelegatingFuture<>( invocation.invoke(), serializationService, clientMessage -> { MCMatchMCConfigCodec.ResponseParameters response = MCMatchMCConfigCodec.decodeResponse(clientMessage); return response.response; }, false ); }
Source:
public TriggerResult onElement(T element, long timestamp, W window, TriggerContext ctx) throws Exception { TriggerResult triggerResult = this.nestedTrigger.onElement(element, timestamp, window, ctx); if (triggerResult.isFire()) { this.clear(window, ctx); return triggerResult; } ValueState<Long> timeoutState = ctx.getPartitionedState(this.timeoutStateDesc); long nextFireTimestamp = ctx.getCurrentProcessingTime() + this.interval; if (timeoutState.value() != null && continualInterval) { ctx.deleteProcessingTimeTimer(timeoutState.value()); timeoutState.clear(); } if (timeoutState.value() == null) { timeoutState.update(nextFireTimestamp); ctx.registerProcessingTimeTimer(nextFireTimestamp); } return triggerResult; }

Target:
public TriggerResult onElement(T element, long timestamp, W window, TriggerContext ctx) throws Exception { TriggerResult triggerResult = this.nestedTrigger.onElement(element, timestamp, window, ctx); if (triggerResult.isFire()) { this.clear(window, ctx); return triggerResult; } ValueState<Long> timeoutState = ctx.getPartitionedState(this.timeoutStateDesc); long nextFireTimestamp = ctx.getCurrentProcessingTime() + this.interval; Long timeoutTimestamp = timeoutState.value(); if (timeoutTimestamp != null && resetTimerOnNewRecord) { ctx.deleteProcessingTimeTimer(timeoutTimestamp); timeoutState.clear(); timeoutTimestamp = null; } if (timeoutTimestamp == null) { timeoutState.update(nextFireTimestamp); ctx.registerProcessingTimeTimer(nextFireTimestamp); } return triggerResult; }
Source:
public ExecutionResult executeCLI(Arguments arguments) { prepare(); try { if(!silent) { log.info("Execute {}", name, arguments); } context.setIOAgent(tracker.agent()); final String[] args = getArgumentStrings(arguments); if(strategy != null) { context.invokeStrategyCLI(strategy, name, args); } else { context.invokeStrategyCLI(strategyName, name, args); } return new ExecutionResult(true, tracker.stdout(), tracker.stderr()); } catch(StrategoExit e) { if(e.getValue() == 0) { return new ExecutionResult(true, tracker.stdout(), tracker.stderr()); } if(!silent) { log.error("Executing failed: {}", name, e); } return new ExecutionResult(false, tracker.stdout(), tracker.stderr()); } finally { SSLLibrary op = (SSLLibrary) context.getOperatorRegistry(SSLLibrary.REGISTRY_NAME); op.getDynamicRuleTable().clear(); op.getTableTable().clear(); } }

Target:
public ExecutionResult executeCLI(Arguments arguments) { prepare(); try { if(!silent) { log.info("Execute {}", name, arguments); } context.setIOAgent(tracker.agent()); final String[] args = getArgumentStrings(arguments); if(strategy != null) { context.invokeStrategyCLI(strategy, name, args); } else { context.invokeStrategyCLI(strategyName, name, args); } return new ExecutionResult(true, tracker.stdout(), tracker.stderr()); } catch(StrategoExit e) { if(e.getValue() == 0) { return new ExecutionResult(true, tracker.stdout(), tracker.stderr()); } if(!silent) { log.error("Executing failed: {}", name, e); } return new ExecutionResult(false, tracker.stdout(), tracker.stderr()); } finally { final @Nullable IOperatorRegistry registry = context.getOperatorRegistry(SSLLibrary.REGISTRY_NAME); if(registry != null) { final SSLLibrary sslLibrary = (SSLLibrary) registry; sslLibrary.getDynamicRuleTable().clear(); sslLibrary.getTableTable().clear(); } } }
Source:
public static MysqlSavedSchema restore( ConnectionPool pool, Long serverID, CaseSensitivity caseSensitivity, Position targetPosition ) throws SQLException, InvalidSchemaError { try (Connection conn = pool.getConnection()) { Long schemaID = findSchema(conn, targetPosition, serverID); if (schemaID == null) { return null; } MysqlSavedSchema savedSchema = new MysqlSavedSchema(serverID, caseSensitivity); savedSchema.restoreFromSchemaID(conn, schemaID); savedSchema.handleVersionUpgrades(conn); return savedSchema; } }

Target:
public static MysqlSavedSchema restore( ConnectionPool pool, Long serverID, CaseSensitivity caseSensitivity, Position targetPosition ) throws SQLException, InvalidSchemaError { try ( Connection conn = pool.getConnection() ) { Long schemaID = findSchema(conn, targetPosition, serverID); if (schemaID == null) return null; MysqlSavedSchema savedSchema = new MysqlSavedSchema(serverID, caseSensitivity); savedSchema.restoreFromSchemaID(conn, schemaID); savedSchema.handleVersionUpgrades(conn); return savedSchema; } }
Source:
public void onBackPressed() { super.onBackPressed(); goToMap() }

Target:
public void onBackPressed() { finish(); super.onBackPressed(); }
Source:
public void start() { if (started.compareAndSet(false, true)) { refreshExecutor.scheduleWithFixedDelay(this::refreshAndStartQueries, 1, 1, TimeUnit.MILLISECONDS); resourceGroupRefreshExecutor.scheduleWithFixedDelay(this::refreshInternalResourceGroups, 1, 1, TimeUnit.SECONDS); } }

Target:
public void start() { if (started.compareAndSet(false, true)) { refreshExecutor.scheduleWithFixedDelay(() -> { try { refreshAndStartQueries(); lastSchedulingCycleRunTimeMs.getAndSet(currentTimeMillis()); } catch (Throwable t) { log.error(t, "Error while executing refreshAndStartQueries"); throw t; } }, 1, 1, MILLISECONDS); } }
Source:
public Page getNextPage() { try { Page dataPage = delegate.getNextPage(); if (dataPage == null) { return null; } if (bucketAdapter.isPresent()) { IntArrayList ids = bucketAdapter.get().computeEligibleRowIds(dataPage); Block[] adaptedBlocks = new Block[dataPage.getChannelCount()]; for (int i = 0; i < adaptedBlocks.length; i++) { adaptedBlocks[i] = new LazyBlock(ids.size(), new RowFilterLazyBlockLoader(dataPage.getBlock(i), ids)); } dataPage = new Page(ids.size(), adaptedBlocks); } int batchSize = dataPage.getPositionCount(); List<Block> blocks = new ArrayList<>(); for (int fieldId = 0; fieldId < columnMappings.size(); fieldId++) { ColumnMapping columnMapping = columnMappings.get(fieldId); switch (columnMapping.getKind()) { case PREFILLED: blocks.add(RunLengthEncodedBlock.create(types[fieldId], prefilledValues[fieldId], batchSize)); break; case REGULAR: Block block = dataPage.getBlock(columnMapping.getIndex()); if (coercers[fieldId] != null) { block = new LazyBlock(batchSize, new CoercionLazyBlockLoader(block, coercers[fieldId])); } blocks.add(block); break; case INTERIM: break; default: throw new UnsupportedOperationException(); } } return new Page(batchSize, blocks.toArray(new Block[0])); } catch (PrestoException e) { closeWithSuppression(e); throw e; } catch (RuntimeException e) { closeWithSuppression(e); throw new PrestoException(HIVE_CURSOR_ERROR, e); } }

Target:
public Page getNextPage() { try { Page dataPage = delegate.getNextPage(); if (dataPage == null) { return null; } if (bucketAdapter.isPresent()) { IntArrayList rowsToKeep = bucketAdapter.get().computeEligibleRowIds(dataPage); Block[] adaptedBlocks = new Block[dataPage.getChannelCount()]; for (int i = 0; i < adaptedBlocks.length; i++) { Block block = dataPage.getBlock(i); if (block instanceof LazyBlock && !((LazyBlock) block).isLoaded()) { adaptedBlocks[i] = new LazyBlock(rowsToKeep.size(), new RowFilterLazyBlockLoader(dataPage.getBlock(i), rowsToKeep)); } else { adaptedBlocks[i] = block.getPositions(rowsToKeep.elements(), 0, rowsToKeep.size()); } } dataPage = new Page(rowsToKeep.size(), adaptedBlocks); } int batchSize = dataPage.getPositionCount(); List<Block> blocks = new ArrayList<>(); for (int fieldId = 0; fieldId < columnMappings.size(); fieldId++) { ColumnMapping columnMapping = columnMappings.get(fieldId); switch (columnMapping.getKind()) { case PREFILLED: blocks.add(RunLengthEncodedBlock.create(types[fieldId], prefilledValues[fieldId], batchSize)); break; case REGULAR: Block block = dataPage.getBlock(columnMapping.getIndex()); if (coercers[fieldId] != null) { block = new LazyBlock(batchSize, new CoercionLazyBlockLoader(block, coercers[fieldId])); } blocks.add(block); break; case INTERIM: break; default: throw new UnsupportedOperationException(); } } return new Page(batchSize, blocks.toArray(new Block[0])); } catch (PrestoException e) { closeWithSuppression(e); throw e; } catch (RuntimeException e) { closeWithSuppression(e); throw new PrestoException(HIVE_CURSOR_ERROR, e); } }
Source:
public ASTValue eval(WordsEnvironment environment) throws WordsRuntimeException { ASTValue className = this.children.get(0).eval(environment); ASTValue parentClassName = this.children.get(1).eval(environment); WordsClass wordsClass = environment.createClass(className.stringValue, parentClassName.stringValue); INodeClassStatementList statementList = (INodeClassStatementList) this.children.get(2); if (statementList != null) { for (Object child : statementList.children) { if (child instanceof INodeDefineProperty) { ASTValue propertyName = ((INodeDefineProperty) child).id.eval(environment); if (((INodeDefineProperty) child).literal == null) { wordsClass.setProperty(propertyName.stringValue, new WordsProperty(WordsProperty.PropertyType.NOTHING)); } else { ASTValue propertyValue = ((INodeDefineProperty) child).literal.eval(environment); WordsProperty wordsProp = null; switch (propertyValue.type) { case STRING: wordsProp = new WordsProperty(propertyValue.stringValue); break; case NUM: wordsProp = new WordsProperty(propertyValue.numValue); break; default: throw new AssertionError("literal wasn't number or string"); } wordsClass.setProperty(propertyName.stringValue, wordsProp); } } } } return null; }

Target:
public ASTValue eval(WordsEnvironment environment) throws WordsRuntimeException { ASTValue className = this.children.get(0).eval(environment); ASTValue parentClassName = this.children.get(1).eval(environment); WordsClass wordsClass = environment.createClass(className.stringValue, parentClassName.stringValue); INodeClassStatementList statementList = (INodeClassStatementList) this.children.get(2); if (statementList != null) { statementList.eval(environment, wordsClass); } return null; }
Source:
public VdcReturnValueBase ExecuteAction() { adjustExecutionReason(); _actionState = CommandActionState.EXECUTE; String tempVar = getDescription(); getReturnValue().setDescription((tempVar != null) ? tempVar : getReturnValue().getDescription()); setActionMessageParameters(); boolean actionAllowed = false; Step validatingStep = ExecutionHandler.addStep(getExecutionContext(), StepEnum.VALIDATING, null); try { actionAllowed = acquireLock() && (getReturnValue().getCanDoAction() || InternalCanDoAction()); ExecutionHandler.endStep(getExecutionContext(), validatingStep, actionAllowed); if (actionAllowed) { getReturnValue().setCanDoAction(true); getReturnValue().setIsSyncronious(true); getParameters().setTaskStartTime(System.currentTimeMillis()); Execute(); } else { getReturnValue().setCanDoAction(false); } } finally { freeLock(); } return getReturnValue(); }

Target:
public VdcReturnValueBase ExecuteAction() { determineExecutionReason(); _actionState = CommandActionState.EXECUTE; String tempVar = getDescription(); getReturnValue().setDescription((tempVar != null) ? tempVar : getReturnValue().getDescription()); setActionMessageParameters(); boolean actionAllowed = false; Step validatingStep = ExecutionHandler.addStep(getExecutionContext(), StepEnum.VALIDATING, null); try { actionAllowed = acquireLock() && (getReturnValue().getCanDoAction() || InternalCanDoAction()); ExecutionHandler.endStep(getExecutionContext(), validatingStep, actionAllowed); if (actionAllowed) { getReturnValue().setCanDoAction(true); getReturnValue().setIsSyncronious(true); getParameters().setTaskStartTime(System.currentTimeMillis()); Execute(); } else { getReturnValue().setCanDoAction(false); } } finally { freeLock(); } return getReturnValue(); }
Source:
public void shouldSerializeToJson() throws JsonProcessingException { final ObjectMapper mapper = JsonUtils.createObjectMapper(); mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true); final ObjectWriter writer = mapper.writerFor(SObjectTree.class); final SObjectTree tree = new SObjectTree(); final SObjectNode account1 = new SObjectNode(tree, simpleAccount); account1.addChild("Contacts", smith); account1.addChild("Contacts", evans); tree.addNode(account1); final SObjectNode account2 = new SObjectNode(tree, simpleAccount2); tree.addNode(account2); final String json = writer.writeValueAsString(tree); assertEquals("Should serialize to JSON as in Salesforce example", "{\"records\":[{\"Industry\":\"Banking\",\"Name\":\"SampleAccount\",\"NumberOfEmployees\":100,\"Phone\":\"1234567890\",\"Website\":\"www.salesforce.com\",\"attributes\":{\"referenceId\":\"ref1\",\"type\":\"Account\"},\"Contacts\":{\"records\":[{\"Email\":\"sample@salesforce.com\",\"LastName\":\"Smith\",\"Title\":\"President\",\"attributes\":{\"referenceId\":\"ref2\",\"type\":\"Contact\"}},{\"Email\":\"sample@salesforce.com\",\"LastName\":\"Evans\",\"Title\":\"Vice President\",\"attributes\":{\"referenceId\":\"ref3\",\"type\":\"Contact\"}}]}},{\"Industry\":\"Banking\",\"Name\":\"SampleAccount2\",\"NumberOfEmployees\":100,\"Phone\":\"1234567890\",\"Website\":\"www.salesforce2.com\",\"attributes\":{\"referenceId\":\"ref4\",\"type\":\"Account\"}}]}", json); }

Target:
public void shouldSerializeToJson() throws JsonProcessingException { final ObjectMapper mapper = JsonUtils.createObjectMapper(); mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true); final ObjectWriter writer = mapper.writerFor(SObjectTree.class); final SObjectTree tree = new SObjectTree(); final SObjectNode account1 = new SObjectNode(tree, simpleAccount); account1.addChild("Contacts", smith); account1.addChild("Contacts", evans); tree.addNode(account1); final SObjectNode account2 = new SObjectNode(tree, simpleAccount2); tree.addNode(account2); final String json = writer.writeValueAsString(tree); assertEquals("Should serialize to JSON as in Salesforce example", "{" + "\"records\":[" + "{" + "\"Industry\":\"Banking\"," + "\"Name\":\"SampleAccount\"," + "\"NumberOfEmployees\":100," + "\"Phone\":\"1234567890\"," + "\"Website\":\"www.salesforce.com\"," + "\"attributes\":{" + "\"referenceId\":\"ref1\"," + "\"type\":\"Account\"" + "}," + "\"Contacts\":{" + "\"records\":[" + "{" + "\"Email\":\"sample@salesforce.com\"," + "\"LastName\":\"Smith\"," + "\"Title\":\"President\"," + "\"attributes\":{" + "\"referenceId\":\"ref2\"," + "\"type\":\"Contact\"" + "}" + "}," + "{" + "\"Email\":\"sample@salesforce.com\"," + "\"LastName\":\"Evans\"," + "\"Title\":\"Vice President\"," + "\"attributes\":{" + "\"referenceId\":\"ref3\"," + "\"type\":\"Contact\"" + "}" + "}" + "]" + "}" + "}," + "{" + "\"Industry\":\"Banking\"," + "\"Name\":\"SampleAccount2\"," + "\"NumberOfEmployees\":100," + "\"Phone\":\"1234567890\"," + "\"Website\":\"www.salesforce2.com\"," + "\"attributes\":{" + "\"referenceId\":\"ref4\"," + "\"type\":\"Account\"" + "}" + "}" + "]" + "}", json); }
Source:
protected BuildResult perform(Run<?, ?> run, FilePath workspace, PluginLogger logger) throws InterruptedException, IOException{ if (isOverridden(HealthAwarePublisher.class, getClass(), "perform", AbstractBuild.class, PluginLogger.class) && run instanceof AbstractBuild) { return perform((AbstractBuild) run, logger); } else { throw new AbstractMethodError("you must override the new overload of perform(Run, FilePath, Launcher, PluginLogger)"); } }

Target:
protected BuildResult perform(Run<?, ?> run, FilePath workspace, PluginLogger logger) throws InterruptedException, IOException{ if (run instanceof AbstractBuild && Compatibility.isOverridden(HealthAwarePublisher.class, getClass(), "perform", AbstractBuild.class, PluginLogger.class)) { return perform((AbstractBuild) run, logger); } else { throw new AbstractMethodError("you must override the new overload of perform(Run, FilePath, Launcher, PluginLogger)"); } }
Source:
public OpenDocumentDialogPanel(String aId, AnnotatorState aBModel, ModalWindow aModalWindow, IModel<List<DecoratedObject<Project>>> aProjects) { super(aId); modalWindow = aModalWindow; state = aBModel; currentUser = userRepository.getCurrentUser(); selectedUser = currentUser; projects = aProjects; List<DecoratedObject<Project>> allowedProjects = projects.getObject(); if (!allowedProjects.isEmpty()) { selectedProject = allowedProjects.get(0).get(); } projectSelectionForm = new ProjectSelectionForm("projectSelectionForm"); if (aBModel.isProjectLocked()) { selectedProject = aBModel.getProject(); projectSelectionForm.getModelObject().projectSelection = aBModel.getProject(); projectSelectionForm.setVisible(false); } isAdmin = userRepository.isAdministrator(currentUser); userSelectionForm = new UserSelectionForm("userSelectionForm", aModalWindow); documentSelectionForm = new DocumentSelectionForm("documentSelectionForm", aModalWindow); userSelectionForm.add(visibleWhen(() -> isAdmin)); buttonsForm = new ButtonsForm("buttonsForm", aModalWindow); add(buttonsForm); add(userSelectionForm); add(projectSelectionForm); add(documentSelectionForm); }

Target:
public OpenDocumentDialogPanel(String aId, AnnotatorState aBModel, ModalWindow aModalWindow, IModel<List<DecoratedObject<Project>>> aProjects) { super(aId); modalWindow = aModalWindow; state = aBModel; projects = aProjects; projectListChoice = createProjectListChoice(aBModel); userListChoice = createUserListChoice(); docListChoice = createDocListChoice(); buttonsForm = new ButtonsForm("buttonsForm", aModalWindow); add(buttonsForm); add(projectListChoice); add(docListChoice); add(userListChoice); }
Source:
public void UpdateDynamicData(VdsDynamic dynamicData) { log.debug("Updated VDS dynamic without checking if update is needed"); DbFacade.getInstance().getVdsDynamicDao().update(dynamicData); }

Target:
public void UpdateDynamicData(VdsDynamic dynamicData) { DbFacade.getInstance().getVdsDynamicDao().update(dynamicData); }
Source:
private String getSequenceNumberInternal(StreamPartition<String> partition, ShardIteratorType iteratorEnum) { String shardIterator; try { shardIterator = kinesis.getShardIterator( partition.getStream(), partition.getPartitionId(), iteratorEnum.toString() ).getShardIterator(); } catch (LimitExceededException | ProvisionedThroughputExceededException | ResourceInUseException e) { throw new TransientStreamException(e); } catch (ResourceNotFoundException e) { throw new PossiblyTransientStreamException(e); } catch (AmazonKinesisException e) { throw new NonTransientStreamException(e); } return getSequenceNumberInternal(partition, shardIterator); }

Target:
private String getSequenceNumberInternal(StreamPartition<String> partition, ShardIteratorType iteratorEnum) { return wrapExceptions(() -> getSequenceNumberInternal( partition, kinesis.getShardIterator(partition.getStream(), partition.getPartitionId(), iteratorEnum.toString()) .getShardIterator() )); }
Source:
private static int getFullModifiers(ClassStub data, AsmReferenceResolver resolver) { int result = data.accessModifiers; String className = data.className; int idx = className.lastIndexOf('$'); if (idx > 0) { ClassNode outerClass = resolver.resolveClassNullable(className.substring(0, idx)); if (outerClass instanceof DecompiledClassNode) { Integer outerModifiers = ((DecompiledClassNode) outerClass).classData.innerClassModifiers.get(className.substring(idx + 1)); if (outerModifiers != null) { result |= outerModifiers; } } } return result; }

Target:
private static int getFullModifiers(ClassStub data, AsmReferenceResolver resolver) { String className = data.className; int bound = className.length(); while (bound > 0) { int idx = className.lastIndexOf('$', bound); if (idx > 0) { ClassNode outerClass = resolver.resolveClassNullable(className.substring(0, idx)); if (outerClass instanceof DecompiledClassNode) { Integer outerModifiers = ((DecompiledClassNode) outerClass).classData.innerClassModifiers.get(className.substring(idx + 1)); if (outerModifiers != null) { return data.accessModifiers | outerModifiers; } } } bound = idx - 1; } return data.accessModifiers; }
Source:
public boolean isMultitenant() { return delegate.isMultitenant(); }

Target:
public final boolean isMultitenant() { return delegate.isMultitenant(); }
Source:
public void testAddQueryParam() { Map<String, String> mock = mock(Map.class); request.setQueryParams(mock); expect(mock.put(same(DEFAULT_KEY), eq(DEFAULT_VALUE))).andReturn(null); replay(mock); this.request.addQueryParam(DEFAULT_KEY, DEFAULT_VALUE); }

Target:
public void testAddQueryParam() { Map<String, String> mock = mock(Map.class); request.setQueryParams(mock); expect(mock.put(same(DEFAULT_KEY), eq(DEFAULT_VALUE))).andReturn(null); replay(mock); this.request.addQueryParam(DEFAULT_KEY, DEFAULT_VALUE); verify(mock); }
Source:
private Map<String, List<Pair<EtlKey, ExceptionWritable>>> readErrors(final FileSystem fs, final Path newExecutionOutput) throws IOException { final int maxErrorsFromFile = Integer.parseInt(props.getProperty(ETL_MAX_ERRORS_TO_PRINT_FROM_FILE, ETL_MAX_ERRORS_TO_PRINT_FROM_FILE_DEFAULT)); final Map<String, List<Pair<EtlKey, ExceptionWritable>>> errors = Maps.newHashMap(); for (final FileStatus f : fs.listStatus(newExecutionOutput, new PrefixFilter(EtlMultiOutputFormat.ERRORS_PREFIX))) { int errorCounter = 0; final Path filePath = f.getPath(); final SequenceFile.Reader reader = new SequenceFile.Reader(fs, filePath, fs.getConf()); EtlKey key = new EtlKey(); ExceptionWritable value = new ExceptionWritable(); while (reader.next(key, value) && errorCounter < maxErrorsFromFile) { errorCounter++; final List<Pair<EtlKey, ExceptionWritable>> errorsFromFile = errors.containsKey(filePath.toString()) ? errors.get(filePath.toString()) : Lists.<Pair<EtlKey, ExceptionWritable>>newArrayList(); if (errorCounter >= maxErrorsFromFile) { errorsFromFile.add( new Pair<EtlKey, ExceptionWritable>(new EtlKey(key), new ExceptionWritable("... Too many errors to show. Skipping..."))); } else { errorsFromFile.add( new Pair<EtlKey, ExceptionWritable>(new EtlKey(key), new ExceptionWritable(value.toString()))); } errors.put(filePath.toString(), errorsFromFile); } reader.close(); } return errors; }

Target:
private Map<String, List<Pair<EtlKey, ExceptionWritable>>> readErrors(final FileSystem fs, final Path newExecutionOutput) throws IOException { final int maxErrorsFromFile = Integer.parseInt(props.getProperty(ETL_MAX_ERRORS_TO_PRINT_FROM_FILE, ETL_MAX_ERRORS_TO_PRINT_FROM_FILE_DEFAULT)); final Map<String, List<Pair<EtlKey, ExceptionWritable>>> errors = Maps.newHashMap(); for (final FileStatus f : fs.listStatus(newExecutionOutput, new PrefixFilter(EtlMultiOutputFormat.ERRORS_PREFIX))) { int errorCounter = 0; final Path filePath = f.getPath(); final SequenceFile.Reader reader = new SequenceFile.Reader(fs, filePath, fs.getConf()); EtlKey key = new EtlKey(); ExceptionWritable value = new ExceptionWritable(); final List<Pair<EtlKey, ExceptionWritable>> errorsFromFile = Lists.<Pair<EtlKey, ExceptionWritable>>newArrayList(); while (reader.next(key, value)) { errorCounter++; if (errorCounter <= maxErrorsFromFile) { errorsFromFile.add( new Pair<EtlKey, ExceptionWritable>(new EtlKey(key), new ExceptionWritable(value.toString()))); } } if (errorCounter > 0) { if (errorCounter > maxErrorsFromFile) { errorsFromFile.add( new Pair<EtlKey, ExceptionWritable>( new EtlKey(key), new ExceptionWritable("... Too many errors to show. " + "Skipped " + (errorCounter - maxErrorsFromFile) + " ..."))); } errors.put(filePath.toString(), errorsFromFile); } reader.close(); } return errors; }
Source:
Map<String, String> getFieldAliases() { Map<String, String> outputFieldMappings = new HashMap<String, String>(); if (fieldAliases != null) { for (String field : Splitter.on(',').trimResults().split(fieldAliases)) { String[] value = field.split(":"); if (value.length == 2) { outputFieldMappings.put(value[0], value[1]); } } } return outputFieldMappings; }

Target:
Map<String, String> getFieldAliases() { Map<String, String> outputFieldMappings = new HashMap<String, String>(); if (StringUtils.isNotEmpty(fieldAliases)) { for (String field : Splitter.on(',').trimResults().split(fieldAliases)) { String[] value = field.split(":"); if (value.length == 2) { outputFieldMappings.put(value[0], value[1]); } else { throw new IllegalArgumentException( String.format("Either key or value is missing for 'Output fields to rename'. Please make sure that " + "both key and value are present.")); } } } return outputFieldMappings; }
Source:
public Mono<AmqpTransaction> createTransaction() { return createTransactionCoordinator() .cast(ReactorSender.class) .flatMap(coordinator -> { return coordinator.createTransaction(); }); }

Target:
public Mono<AmqpTransaction> createTransaction() { return createTransactionCoordinator() .flatMap(coordinator -> coordinator.createTransaction()); }