auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private JSONObject getTopology(StartAction startAction, Map<Integer, String> hostGroups, JoinCoordinator joinCoordinator) { JSONObject topo = null; if (startAction == StartAction.JOIN) { assert(joinCoordinator != null); topo = joinCoordinator.getTopology(); } else if (!startAction.doesRejoin()) { Map<Integer, Integer> sphMap = new HashMap<>(); try { List<String> children; children = m_messenger.getZK().getChildren(VoltZK.sitesPerHost, false); for (String child : children) { byte[] payload = m_messenger.getZK().getData( ZKUtil.joinZKPath(VoltZK.sitesPerHost, child), false, new Stat()); int sitesperhost = ByteBuffer.wrap(payload).getInt(); int hostId = Integer.parseInt(child.split("_")[1]); sphMap.put(hostId, sitesperhost); } } catch (Exception e) { VoltDB.crashGlobalVoltDB("Unable to get sitesperhost from Zookeeper", false, e); } int hostcount = m_clusterSettings.get().hostcount(); int kfactor = m_catalogContext.getDeployment().getCluster().getKfactor(); ClusterConfig clusterConfig = new ClusterConfig(hostcount, sphMap, kfactor); if (!clusterConfig.validate()) { VoltDB.crashLocalVoltDB(clusterConfig.getErrorMsg(), false, null); } topo = registerClusterConfig(clusterConfig, hostGroups); } else { Stat stat = new Stat(); try { topo = new JSONObject(new String(m_messenger.getZK().getData(VoltZK.topology, false, stat), "UTF-8")); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to get topology from ZK", true, e); } } return topo; }

Target:
private JSONObject getTopology(StartAction startAction, Map<Integer, String> hostGroups, JoinCoordinator joinCoordinator) { JSONObject topo = null; if (startAction == StartAction.JOIN) { assert(joinCoordinator != null); topo = joinCoordinator.getTopology(); } else if (!startAction.doesRejoin()) { Map<Integer, Integer> sphMap = new HashMap<>(); try { List<String> children = m_messenger.getZK().getChildren(VoltZK.sitesPerHost, false); for (String child : children) { byte[] payload = m_messenger.getZK().getData( ZKUtil.joinZKPath(VoltZK.sitesPerHost, child), false, new Stat()); int sitesperhost = ByteBuffer.wrap(payload).getInt(); int hostId = Integer.parseInt(child); sphMap.put(hostId, sitesperhost); } } catch (Exception e) { VoltDB.crashGlobalVoltDB("Unable to get sitesperhost from Zookeeper", false, e); } int hostcount = m_clusterSettings.get().hostcount(); int kfactor = m_catalogContext.getDeployment().getCluster().getKfactor(); ClusterConfig clusterConfig = new ClusterConfig(hostcount, sphMap, kfactor); if (!clusterConfig.validate()) { VoltDB.crashLocalVoltDB(clusterConfig.getErrorMsg(), false, null); } topo = registerClusterConfig(clusterConfig, hostGroups); } else { Stat stat = new Stat(); try { topo = new JSONObject(new String(m_messenger.getZK().getData(VoltZK.topology, false, stat), "UTF-8")); } catch (Exception e) { VoltDB.crashLocalVoltDB("Unable to get topology from ZK", true, e); } } return topo; }
Source:
public void getSubtreeRoots() { final CategoryTree tree = createAbcCategoryTree(); final Category a = tree.findById("A").get(); final Category b1 = tree.findById("B-1").get(); final Category c22 = tree.findById("C-2-2").get(); final CategoryTree subtree = tree.getSubtree(asList(a, b1, c22)); assertThat(subtree.getRoots()).extracting(c -> c.getId()) .as("roots are still categories which have no parent and are included in this tree") .containsOnly("A") .doesNotContain("B-1", "C-2-2", "B", "C"); assertThat(subtree.getSubtreeRoots()).extracting(c -> c.getId()) .as("subtree rootes are the categories at the top," + "no matter if they have a parent reference") .containsOnly("A", "B-1", "C-2-2") .doesNotContain("B", "C", "B-2"); }

Target:
public void getSubtreeRoots() { final CategoryTree tree = createAbcCategoryTree(); final Category a = tree.findById("A").get(); final Category b1 = tree.findById("B-1").get(); final Category c22 = tree.findById("C-2-2").get(); final CategoryTree subtree = tree.getSubtree(asList(a, b1, c22)); assertThat(subtree.getRoots()).extracting(c -> c.getId()) .as("roots are still categories which have no parent and are included in this tree") .containsOnly("A") .doesNotContain("B-1", "C-2-2", "B", "C"); assertThat(subtree.getSubtreeRoots()).extracting(c -> c.getId()) .as("subtree roots are the categories at the top," + "no matter if they have a parent reference") .containsOnly("A", "B-1", "C-2-2") .doesNotContain("B", "C", "B-2"); }
Source:
public void addContents(@NonNull Container result) { for (final Node node : Jenkins.getInstance().getNodes()) { result.add( new TruncatedContent("nodes/slave/" + node.getNodeName() + "/exportTable.txt") { @Override protected void printTo(PrintWriter out) throws IOException { try { VirtualChannel channel = node.getChannel(); if (channel instanceof Channel) { ((Channel)channel).dumpExportTable(out); } } catch (TruncationException e) { logger.log(Level.WARNING, "Truncated the output of export table for node: " + node.getNodeName(), e); } catch (IOException e) { logger.log(Level.WARNING, "Could not record environment of node " + node.getNodeName(), e); } } } ); } }

Target:
public void addContents(@NonNull Container result) { Jenkins instance = Jenkins.getInstance(); if (instance == null) { return; } for (final Node node : instance.getNodes()) { result.add( new TruncatedContent("nodes/slave/" + node.getNodeName() + "/exportTable.txt") { @Override protected void printTo(PrintWriter out) throws IOException { try { VirtualChannel channel = node.getChannel(); if (channel instanceof Channel) { ((Channel)channel).dumpExportTable(out); } } catch (TruncationException e) { logger.log(Level.WARNING, "Truncated the output of export table for node: " + node.getNodeName(), e); } catch (IOException e) { logger.log(Level.WARNING, "Could not record environment of node " + node.getNodeName(), e); } } } ); } }
Source:
public void processMessageToForwardAsAttachment(MessageViewInfo messageViewInfo) { boolean isMissingParts = !allPartsAvailable(messageViewInfo, false); if (isMissingParts) { attachmentMvpView.showMissingAttachmentsPartialMessageForwardWarning(); } else { try { File tempFile = File.createTempFile("pre", ".tmp"); tempFile.deleteOnExit(); FileOutputStream fileOutputStream = new FileOutputStream(tempFile); messageViewInfo.message.writeTo(fileOutputStream); fileOutputStream.close(); int loaderId = getNextFreeLoaderId(); Attachment attachment = Attachment.createAttachment(null, loaderId, "message/rfc822") .deriveWithMetadataLoaded("message/rfc822", messageViewInfo.message.getSubject(), tempFile.length()) .deriveWithLoadComplete(tempFile.getAbsolutePath()); attachments.put(attachment.uri, attachment); attachmentMvpView.addAttachmentView(attachment); } catch (java.io.IOException e) { throw new IllegalStateException("Error storing the message to a temporary file: " + e.getMessage()); } catch (MessagingException e) { throw new IllegalStateException("Received the same attachmentViewInfo twice!"); } } }

Target:
public void processMessageToForwardAsAttachment(MessageViewInfo messageViewInfo) throws IOException, MessagingException { boolean isMissingParts = !allPartsAvailable(messageViewInfo, false); if (isMissingParts) { attachmentMvpView.showMissingAttachmentsPartialMessageForwardWarning(); } else { File tempFile = File.createTempFile("pre", ".tmp"); tempFile.deleteOnExit(); FileOutputStream fileOutputStream = new FileOutputStream(tempFile); messageViewInfo.message.writeTo(fileOutputStream); fileOutputStream.close(); int loaderId = getNextFreeLoaderId(); Attachment attachment = Attachment.createAttachment(null, loaderId, "message/rfc822") .deriveWithMetadataLoaded("message/rfc822", messageViewInfo.message.getSubject(), tempFile.length()) .deriveWithLoadComplete(tempFile.getAbsolutePath()); attachments.put(attachment.uri, attachment); attachmentMvpView.addAttachmentView(attachment); } }
Source:
public boolean apply(BlockVector3 position, int depth) throws WorldEditException { if (mask.test(position)) { if (makeChangeTo(position, depth)) { ++affected; } } return true; }

Target:
public boolean apply(BlockVector3 position, int depth) throws WorldEditException { if (mask.test(position)) { if (naturalize(position, depth)) { ++affected; } } return true; }
Source:
public void testCheckAccessThread() { carbonSecurityManager = mock(CarbonSecurityManager.class); Thread thread = mock(Thread.class); carbonSecurityManager.checkAccess(thread); }

Target:
public void testCheckAccessThread() { System.setProperty("denied.system.properties", "mockDeniedProperty"); carbonSecurityManager = new CarbonSecurityManager(); Thread thread = mock(Thread.class); carbonSecurityManager.checkAccess(thread); }
Source:
MockBlobStore(StoreStats storeStats) { super(UtilsTest.getRandomString(10), null, null, null, new StorageManagerMetrics(new MetricRegistry()), null, 1024, null, null, null, null); this.storeStats = storeStats; }

Target:
MockBlobStore(StoreStats storeStats) { super(UtilsTest.getRandomString(10), null, null, null, new StorageManagerMetrics(new MetricRegistry()), null, CAPACITY, null, null, null, null); this.storeStats = storeStats; }
Source:
public ProgressInformationPanel(final boolean running) { super(WidgetUtils.COLOR_DEFAULT_BACKGROUND); setLayout(new BorderLayout()); _tableProgressInformationPanels = new ConcurrentHashMap<>(); _progressTimingCounters = new ConcurrentHashMap<>(); _stopWatch = Stopwatch.createUnstarted(); _executionLogTextArea = new JTextArea(); _executionLogTextArea.setText("--- DataCleaner progress information user-log ---"); _executionLogTextArea.setEditable(false); _executionLogTextArea.setBackground(WidgetUtils.COLOR_DEFAULT_BACKGROUND); _progressBarPanel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); _progressBarPanel.setLayout(new VerticalLayout(4)); final JXTaskPane progressTaskPane = WidgetFactory.createTaskPane("Progress", IconUtils.ACTION_EXECUTE); progressTaskPane.add(_progressBarPanel); final JXTitledPanel executionLogPanel = WidgetFactory.createTitledPanel("Execution log", WidgetUtils.scrolleable(_executionLogTextArea)); executionLogPanel.setBorder(new MatteBorder(1, 1, 1, 1, WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND)); final DCTaskPaneContainer taskPaneContainer = WidgetFactory.createTaskPaneContainer(); final int margin = 10; taskPaneContainer.setLayout(new BorderLayout(margin, margin)); if (running) { taskPaneContainer.add(progressTaskPane, BorderLayout.NORTH); } setBorder(new MatteBorder(0, 0, margin, 0, WidgetUtils.COLOR_DEFAULT_BACKGROUND)); taskPaneContainer.add(executionLogPanel, BorderLayout.CENTER); add(taskPaneContainer, BorderLayout.CENTER); }

Target:
public ProgressInformationPanel(final boolean running) { super(WidgetUtils.COLOR_DEFAULT_BACKGROUND); setLayout(new BorderLayout()); _tableProgressInformationPanels = new ConcurrentHashMap<>(); _progressTimingCounters = new ConcurrentHashMap<>(); _stopWatch = Stopwatch.createUnstarted(); _executionLogTextArea = new JTextArea(); _executionLogTextArea.setText("--- DataCleaner progress information user-log ---"); _executionLogTextArea.setEditable(false); _executionLogTextArea.setBackground(WidgetUtils.COLOR_DEFAULT_BACKGROUND); _progressBarPanel = new DCPanel(WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND); _progressBarPanel.setLayout(new VerticalLayout(4)); final JXTaskPane progressTaskPane = WidgetFactory.createTaskPane("Progress", IconUtils.ACTION_EXECUTE); progressTaskPane.add(_progressBarPanel); final JXTitledPanel executionLogPanel = WidgetFactory.createTitledPanel("Execution log", WidgetUtils.scrolleable(_executionLogTextArea)); executionLogPanel.setBorder(new MatteBorder(1, 1, 1, 1, WidgetUtils.COLOR_ALTERNATIVE_BACKGROUND)); final DCTaskPaneContainer taskPaneContainer = WidgetFactory.createTaskPaneContainer(); taskPaneContainer.setLayout(new BorderLayout(MARGIN, MARGIN)); if (running) { taskPaneContainer.add(progressTaskPane, BorderLayout.NORTH); } setBorder(new MatteBorder(0, 0, MARGIN, 0, WidgetUtils.COLOR_DEFAULT_BACKGROUND)); taskPaneContainer.add(executionLogPanel, BorderLayout.CENTER); add(taskPaneContainer, BorderLayout.CENTER); }
Source:
public String verifyRefundSubmittedEvent() throws JsonProcessingException { RefundHistory refundHistory = aValidRefundHistoryEntity() .build(); RefundSubmitted refundCreatedByUser = RefundSubmitted.from(refundHistory); return refundCreatedByUser.toJsonString(); }

Target:
public String verifyRefundSubmittedEvent() throws JsonProcessingException { RefundHistory refundHistory = aValidRefundHistoryEntity() .build(); RefundSubmitted refundSubmitted = RefundSubmitted.from(refundHistory); return refundSubmitted.toJsonString(); }
Source:
public <T extends ArtifactId> ResultSet<T> getResultArtifacts() { List<T> items = new ArrayList<>(); for (IAtsConfigObject configObject : getResults()) { if (configObject == null) { System.err.println("Unexpected null workitem"); } else { items.add((T) configObject.getStoreObject()); } } List<T> artifacts = new LinkedList<>(); for (ArtifactId artifact : items) { boolean artifactTypeMatch = isArtifactTypeMatch(artifact, artifactType); if (artifactTypeMatch) { artifacts.add((T) artifact); } } return ResultSets.newResultSet(artifacts); }

Target:
public <T extends ArtifactId> ResultSet<T> getResultArtifacts() { List<T> items = new ArrayList<>(); for (IAtsConfigObject configObject : getResults()) { if (configObject == null) { OseeLog.log(AbstractAtsConfigQueryImpl.class, Level.SEVERE, "Null found in results"); } else { items.add((T) configObject.getStoreObject()); } } List<T> artifacts = new LinkedList<>(); for (ArtifactId artifact : items) { boolean artifactTypeMatch = isArtifactTypeMatch(artifact, artifactType); if (artifactTypeMatch) { artifacts.add((T) artifact); } } return ResultSets.newResultSet(artifacts); }
Source:
public Response unregisteredStorageDomainsDiscover(Action action) { StorageType storageType = StorageType.ISCSI; IscsiDetails iscsiDetails = action.getIscsi(); if ((iscsiDetails != null) && (iscsiDetails.getAddress() != null)) { storageType = StorageType.FCP; } getEntity(); List<StorageServerConnections> storageServerConnections = new ArrayList<>(); if (storageType == StorageType.ISCSI) { for (String iscsiTarget : action.getIscsiTargets()) { StorageServerConnections connectionDetails = getInitializedConnectionIscsiDetails(action); connectionDetails.setiqn(iscsiTarget); storageServerConnections.add(connectionDetails); } } GetUnregisteredBlockStorageDomainsParameters unregisteredBlockStorageDomainsParameters = new GetUnregisteredBlockStorageDomainsParameters(guid, storageType, storageServerConnections); try { Pair<List<StorageDomain>, List<StorageServerConnections>> pair = getEntity(Pair.class, VdcQueryType.GetUnregisteredBlockStorageDomains, unregisteredBlockStorageDomainsParameters, "GetUnregisteredBlockStorageDomains", true); List<StorageDomain> storageDomains = pair.getFirst(); return actionSuccess(mapToStorageDomains(action, storageDomains)); } catch (Exception e) { return handleError(e, false); } }

Target:
public Response unregisteredStorageDomainsDiscover(Action action) { StorageType storageType = ((action.getIscsi() != null) && (action.getIscsi().getAddress() != null)) ? StorageType.FCP : StorageType.ISCSI; getEntity(); List<StorageServerConnections> storageServerConnections = new ArrayList<>(); if (storageType == StorageType.ISCSI) { for (String iscsiTarget : action.getIscsiTargets()) { StorageServerConnections connectionDetails = getInitializedConnectionIscsiDetails(action); connectionDetails.setiqn(iscsiTarget); storageServerConnections.add(connectionDetails); } } else { } GetUnregisteredBlockStorageDomainsParameters unregisteredBlockStorageDomainsParameters = new GetUnregisteredBlockStorageDomainsParameters(guid, storageType, storageServerConnections); try { Pair<List<StorageDomain>, List<StorageServerConnections>> pair = getEntity(Pair.class, VdcQueryType.GetUnregisteredBlockStorageDomains, unregisteredBlockStorageDomainsParameters, "GetUnregisteredBlockStorageDomains", true); List<StorageDomain> storageDomains = pair.getFirst(); return actionSuccess(mapToStorageDomains(action, storageDomains)); } catch (Exception e) { return handleError(e, false); } }
Source:
protected RevCommit getSelectedCommit(ExecutionEvent event) throws ExecutionException { List<RevCommit> commits = getSelectedCommits(event); if (commits.size() != 1) throw new ExecutionException( UIText.AbstractHistoryCommandHandler_CouldNotGetSelectedCommitMessage); return commits.get(0); }

Target:
protected RevCommit getSelectedCommit(ExecutionEvent event) throws ExecutionException { List<RevCommit> commits = getSelectedCommits(event); if (commits.size() != 1) throw new ExecutionException( UIText.AbstractHistoryCommandHandler_ActionRequiresOneSelectedCommitMessage); return commits.get(0); }
Source:
public void not_store_enrichment_for_origin_of_RejectionContext_type() { final RejectionContext origin = RejectionContext.newBuilder() .setEnrichment(newEnrichment()) .build(); final Event event = projectCreated(Time.getCurrentTime()); final Event enriched = event.toBuilder() .setContext(event.getContext() .toBuilder() .setRejectionContext(origin)) .build(); eventStore.append(enriched); final MemoizingObserver<Event> observer = memoizingObserver(); eventStore.read(EventStreamQuery.getDefaultInstance(), observer); final RejectionContext modifiedOrigin = observer.responses() .get(0) .getContext() .getRejectionContext(); assertTrue(isDefault(modifiedOrigin.getEnrichment())); }

Target:
public void not_store_enrichment_for_origin_of_RejectionContext_type() { final RejectionContext originContext = RejectionContext.newBuilder() .setEnrichment(newEnrichment()) .build(); final Event event = projectCreated(Time.getCurrentTime()); final Event enriched = event.toBuilder() .setContext(event.getContext() .toBuilder() .setRejectionContext(originContext)) .build(); eventStore.append(enriched); final MemoizingObserver<Event> observer = memoizingObserver(); eventStore.read(EventStreamQuery.getDefaultInstance(), observer); final RejectionContext loadedOriginContext = observer.responses() .get(0) .getContext() .getRejectionContext(); assertTrue(isDefault(loadedOriginContext.getEnrichment())); }
Source:
public void providesAnnotatedMethodsSortedByName() { TestClass tc = new TestClass(MethodsAnnotated.class); List<FrameworkMethod> annotatedMethods = tc.getAnnotatedMethods(); assertThat(extractNames(annotatedMethods), anyOf( equalTo(asList("methodA", "methodB", "methodC")), equalTo(asList("clone", "finalize", "getClass", "hashCode", "methodA", "methodB", "methodC", "notify", "notifyAll")) )); }

Target:
public void providesAnnotatedMethodsSortedByName() { TestClass tc = new TestClass(MethodsAnnotated.class); List<FrameworkMethod> annotatedMethods = tc.getAnnotatedMethods(); List<String> methodNames = extractNames(annotatedMethods); assertThat(methodNames.indexOf("methodA"), lessThan(methodNames.indexOf("methodB"))); }
Source:
public Set<Project> getDefaultProjects() { return (Set<Project>)getConfigurationValue("defaultProjects"); }

Target:
public Set<Project> getDefaultProjects() { Set<Project> projects = (Set<Project>)getConfigurationValue("defaultProjects"); if (projects == null) { return null; } return Collections.unmodifiableSet(projects); }
Source:
@Override public <T> T to(HttpEntity entity, Type type) throws ConversionException { try { InputStreamReader isr = new InputStreamReader(entity.getContent(), "UTF-8"); return gson.fromJson(isr, type); } catch (IOException e) { throw new ConversionException(e); } catch (JsonParseException e) { throw new ConversionException(e); } }

Target:
@Override public Object to(HttpEntity entity, Type type) throws ConversionException { try { InputStreamReader isr = new InputStreamReader(entity.getContent(), "UTF-8"); return gson.fromJson(isr, type); } catch (IOException e) { throw new ConversionException(e); } catch (JsonParseException e) { throw new ConversionException(e); } }
Source:
public CallBatcher<CallArgs, E> forArgsGenerator(CallArgsGenerator<E> generator) { return new CallBatcherImpl(client, caller, java.lang.Void.class, generator); }

Target:
public CallBatcher<Void, E> forArgsGenerator(CallArgsGenerator<E> generator) { return new CallBatcherImpl(client, caller, Void.class, generator); }
Source:
public void producesPartsWithContentLength() throws IOException { final RqMultipart.Base multipart = new RqMultipart.Base( new RqFake( Arrays.asList( "POST /h?a=4 HTTP/1.1", "Host: rtw.example.com", "Content-Type: multipart/form-data; boundary=AaB01x", "Content-Length: 100007" ), Joiner.on("\r\n").join( "--AaB01x", "Content-Disposition: form-data; name=\"t2\"", "", "447 N Wolfe Rd, Sunnyvale, CA 94085", "--AaB01x" ) ) ); MatcherAssert.assertThat( Integer.parseInt( new RqHeaders.Base( multipart.part("t2") .iterator() .next() ).header("Content-Length") .get(0) ), Matchers.equalTo(102) ); }

Target:
public void producesPartsWithContentLength() throws IOException { final RqMultipart.Base multipart = new RqMultipart.Base( new RqFake( Arrays.asList( "POST /h?a=4 HTTP/1.1", "Host: rtw.example.com", "Content-Type: multipart/form-data; boundary=AaB01x", "Content-Length: 100007" ), Joiner.on("\r\n").join( "--AaB01x", "Content-Disposition: form-data; name=\"t2\"", "", "447 N Wolfe Rd, Sunnyvale, CA 94085", "--AaB01x" ) ) ); MatcherAssert.assertThat( multipart.part("t2") .iterator() .next(), new HmRqHeader( "content-length", "102" ) ); }
Source:
private void fillContactDataFromNickname(String nickname, List<Recipient> recipients, Map<String, Recipient> recipientMap) { Uri queryUri = ContactsContract.CommonDataKinds.Email.CONTENT_URI; final ContentResolver contentResolver = getContext().getContentResolver(); final int INDEX_CONTACT_ID = 0; final int INDEX_NICKNAME = 1; Cursor nicknameCursor = getNicknameCursor(nickname); if (nicknameCursor != null && nicknameCursor.moveToFirst()) { while (!nicknameCursor.isAfterLast()) { String id = nicknameCursor.getString(INDEX_CONTACT_ID); String selection = ContactsContract.Data.CONTACT_ID + " = ?"; Cursor cursor = contentResolver .query(queryUri, PROJECTION, selection, new String[] { id }, SORT_ORDER); fillContactDataFromCursor(cursor, recipients, recipientMap, nicknameCursor.getString(INDEX_NICKNAME)); nicknameCursor.moveToNext(); } nicknameCursor.close(); } }

Target:
private boolean fillContactDataFromNickname(String nickname, List<Recipient> recipients, Map<String, Recipient> recipientMap) { boolean hasContact = false; final ContentResolver contentResolver = getContext().getContentResolver(); Uri queryUri = Email.CONTENT_URI; Cursor nicknameCursor = getNicknameCursor(nickname); if (nicknameCursor == null) { return hasContact; } try { while (nicknameCursor.moveToNext()) { String id = nicknameCursor.getString(INDEX_CONTACT_ID_FOR_NICKNAME); String selection = ContactsContract.Data.CONTACT_ID + " = ?"; Cursor cursor = contentResolver .query(queryUri, PROJECTION, selection, new String[] { id }, SORT_ORDER); fillContactDataFromCursor(cursor, recipients, recipientMap, nicknameCursor.getString(INDEX_NICKNAME)); hasContact = true; } } finally { nicknameCursor.close(); } return hasContact; }
Source:
@Override public Object[] toRow(final ConsumerRecord<String, String> message) { Object[] fields = new Object[4]; fields[0] = message.topic(); fields[1] = message.partition(); fields[2] = message.timestampType().name; return fields; }

Target:
@Override public Object[] toRow(final ConsumerRecord<String, String> message) { Object[] fields = new Object[3]; fields[0] = message.topic(); fields[1] = message.partition(); fields[2] = message.timestampType().name; return fields; }
Source:
public void build() throws BuildException { if ( baseColumn instanceof ActionCol52 ) { final Action action = builderFactory.getActionBuilder() .with( rule ) .with( row ) .with( columnIndex ) .with( (ActionCol52) baseColumn ) .build(); if ( action != null ) { rule.getActions() .add( action ); } } else if ( baseColumn instanceof ConditionCol52 ) { if ( baseColumn instanceof BRLConditionVariableColumn ) { final Condition condition = builderFactory.getBRLConditionBuilder() .with( (BRLConditionVariableColumn) baseColumn ) .with( getRealCellValue( (BRLConditionVariableColumn) baseColumn, row.get( columnIndex ) ) ) .with( columnIndex ) .build(); rule.getConditions() .add( condition ); } else { final Condition condition = builderFactory.getFieldConditionsBuilder() .with( resolvePattern( rule ) ) .with( (ConditionCol52) baseColumn ) .with( getRealCellValue( (ConditionCol52) baseColumn, row.get( columnIndex ) ) ) .with( columnIndex ) .build(); rule.getConditions() .add( condition ); } } }

Target:
public void build() throws BuildException { if ( baseColumn instanceof ActionCol52 ) { final Action action = builderFactory.getActionBuilder() .with( rule ) .with( row ) .with( columnIndex ) .with( (ActionCol52) baseColumn ) .build(); rule.getActions() .add( action ); } else if ( baseColumn instanceof ConditionCol52 ) { if ( baseColumn instanceof BRLConditionVariableColumn ) { final Condition condition = builderFactory.getBRLConditionBuilder() .with( (BRLConditionVariableColumn) baseColumn ) .with( getRealCellValue( (BRLConditionVariableColumn) baseColumn, row.get( columnIndex ) ) ) .with( columnIndex ) .build(); rule.getConditions() .add( condition ); } else { final Condition condition = builderFactory.getFieldConditionsBuilder() .with( resolvePattern( rule ) ) .with( (ConditionCol52) baseColumn ) .with( getRealCellValue( (ConditionCol52) baseColumn, row.get( columnIndex ) ) ) .with( columnIndex ) .build(); rule.getConditions() .add( condition ); } } }
Source:
public void testTimestamp() throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException { ______TS("success : created"); StudentAttributes s = new StudentAttributes(); s.name = "valid student"; s.lastName = "student"; s.email = "valid-fresh@email.com"; s.team = "validTeamName"; s.section = "validSectionName"; s.comments = ""; s.googleId = "validGoogleId"; s.course = "valid-course"; studentsDb.createEntity(s); StudentAttributes student = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertNotNull(student); AssertHelper.assertDateIsNow(student.getCreatedAt()); AssertHelper.assertDateIsNow(student.getUpdatedAt()); ______TS("success : lastUpdated"); s.name = "new-name"; studentsDb.updateStudentWithoutSearchability(s.course, s.email, s.name, s.team, s.section, s.email, s.googleId, s.comments); StudentAttributes updatedStudent = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertFalse(student.getUpdatedAt().equals(updatedStudent.getUpdatedAt())); AssertHelper.assertDateIsNow(updatedStudent.getUpdatedAt()); ______TS("success : keep lastUpdated"); s.name = "new-name-2"; studentsDb.updateStudentWithoutSearchability(s.course, s.email, s.name, s.team, s.section, s.email, s.googleId, s.comments, true); StudentAttributes updatedStudent2 = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertTrue(updatedStudent.getUpdatedAt().equals(updatedStudent2.getUpdatedAt())); }

Target:
public void testTimestamp() throws InvalidParametersException, EntityAlreadyExistsException, EntityDoesNotExistException { ______TS("success : created"); StudentAttributes s = new StudentAttributes(); s.name = "valid student"; s.lastName = "student"; s.email = "valid-fresh@email.com"; s.team = "validTeamName"; s.section = "validSectionName"; s.comments = ""; s.googleId = "validGoogleId"; s.course = "valid-course"; studentsDb.createEntity(s); StudentAttributes student = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertNotNull(student); AssertHelper.assertDateIsNow(student.getCreatedAt()); AssertHelper.assertDateIsNow(student.getUpdatedAt()); ______TS("success : update lastUpdated"); s.name = "new-name"; studentsDb.updateStudentWithoutSearchability(s.course, s.email, s.name, s.team, s.section, s.email, s.googleId, s.comments); StudentAttributes updatedStudent = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertFalse(student.getUpdatedAt().equals(updatedStudent.getUpdatedAt())); AssertHelper.assertDateIsNow(updatedStudent.getUpdatedAt()); ______TS("success : keep lastUpdated"); s.name = "new-name-2"; studentsDb.updateStudentWithoutSearchability(s.course, s.email, s.name, s.team, s.section, s.email, s.googleId, s.comments, true); StudentAttributes updatedStudent2 = studentsDb.getStudentForGoogleId(s.course, s.googleId); assertTrue(updatedStudent.getUpdatedAt().equals(updatedStudent2.getUpdatedAt())); }
Source:
protected void createExtend(TypeConstraint typeConstraint, Map<PVariable, Integer> variableMapping) { IInputKey inputKey = typeConstraint.getSupplierKey(); Tuple tuple = typeConstraint.getVariablesTuple(); int[] positions = new int[tuple.getSize()]; List<Integer> boundVariableIndices = new ArrayList<>(); Set<Integer> boundVariables = new HashSet<>(); for (int i = 0; i < tuple.getSize(); i++) { PVariable variable = (PVariable) tuple.get(i); Integer position = variableMapping.get(variable); positions[i] = position; if (variableBindings.get(typeConstraint).contains(position)) { boundVariables.add(position); boundVariableIndices.add(i); } } TupleMask indexerMask = TupleMask.fromSelectedIndices(inputKey.getArity(), boundVariableIndices); TupleMask callMask = TupleMask.fromSelectedIndices(variableMapping.size(), positions); operations.add(new GenericTypeExtend(inputKey, positions, callMask, indexerMask, boundVariables)); }

Target:
protected void createExtend(TypeConstraint typeConstraint, Map<PVariable, Integer> variableMapping) { IInputKey inputKey = typeConstraint.getSupplierKey(); Tuple tuple = typeConstraint.getVariablesTuple(); int[] positions = new int[tuple.getSize()]; List<Integer> boundVariableIndices = new ArrayList<>(); Set<Integer> boundVariables = new HashSet<>(); for (int i = 0; i < tuple.getSize(); i++) { PVariable variable = (PVariable) tuple.get(i); Integer position = variableMapping.get(variable); positions[i] = position; if (variableBindings.get(typeConstraint).contains(position)) { boundVariables.add(position); boundVariableIndices.add(i); } } TupleMask indexerMask = TupleMask.fromSelectedIndices(inputKey.getArity(), boundVariableIndices); TupleMask callMask = TupleMask.fromSelectedIndices(variableMapping.size(), boundVariables); operations.add(new GenericTypeExtend(inputKey, positions, callMask, indexerMask, boundVariables)); }
Source:
private File handleFileMessage(final File sourceFile, File tempFile, final File resultFile) throws IOException { if (!FileExistsMode.APPEND.equals(this.fileExistsMode) && this.deleteSourceFiles) { try { rename(sourceFile, resultFile); return resultFile; } catch (IOException e) { if (this.logger.isInfoEnabled()) { this.logger.info("Failed to move file '" + sourceFile + "'. Using copy and delete fallback.", e); } } } BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceFile)); return handleInputStreamMessage(bis, sourceFile, tempFile, resultFile); }

Target:
private File handleFileMessage(final File sourceFile, File tempFile, final File resultFile) throws IOException { if (!FileExistsMode.APPEND.equals(this.fileExistsMode) && this.deleteSourceFiles) { rename(sourceFile, resultFile); return resultFile; } else { BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceFile)); return handleInputStreamMessage(bis, sourceFile, tempFile, resultFile); } }
Source:
protected Warning createWarning(final Matcher matcher) { String message = matcher.group(2); Priority priority; StringBuilder category = new StringBuilder(); if (matcher.group(1).equalsIgnoreCase("error")) { priority = Priority.HIGH; category.append("ERROR"); } else if (matcher.group(1).equalsIgnoreCase("information")) { priority = Priority.LOW; category.append("Info"); } else { priority = Priority.NORMAL; category.append("Warning"); } Warning warning = createWarning("See Warning message", 0, category.toString(), message, priority); return warning; }

Target:
protected Warning createWarning(final Matcher matcher) { String message = matcher.group(2); String message_category = matcher.group(1); Priority priority; String category; if ("error".equalsIgnoreCase(message_category)) { priority = Priority.HIGH; category = "ERROR"; } else if ("information".equalsIgnoreCase(message_category)) { priority = Priority.LOW; category = "Info"; } else { priority = Priority.NORMAL; category = "Warning"; } return createWarning("See Warning message", 0, category, message, priority); }
Source:
private void readCursorFile(File file) { try { m_cursorsWriter = new RandomAccessFile(file, "rwd"); String cursorId = null; while ((cursorId=m_cursorsWriter.readUTF()) != null) { m_readCursors.put(cursorId, new ReadCursor(cursorId)); m_cursorsWriter.readUTF(); } } catch(EOFException e) { } catch(IOException e) { throw new RuntimeException(e); } }

Target:
private void readCursorFile(File file) { try { m_cursorsWriter = new RandomAccessFile(file, "rwd"); String cursorId = null; while ((cursorId=m_cursorsWriter.readUTF()) != null) { m_readCursors.put(cursorId, new ReadCursor(cursorId, m_numDeleted)); m_cursorsWriter.readUTF(); } } catch(EOFException e) { } catch(IOException e) { throw new RuntimeException(e); } }
Source:
public static ColumnPath fromDotString(String path) { checkNotNull(path, "path"); String[] parts = path.split("\\.(?=([^`]*`[^`]*`)*[^`]*$)"); for (int i = 0; i < parts.length; ++i) { String part = parts[i]; if (part.startsWith("`") && part.endsWith("`")) { parts[i] = part.substring(1, part.length() - 1); } } return get(parts); }

Target:
public static ColumnPath fromDotString(String path) { checkNotNull(path, "path"); return get(QuotedIdentifiers.getParts(path)); }
Source:
public String getUnifiedDiff() { PatchList patchList; try { patchList = getPatchList(); if (patchList.getOldId() == null) { return ""; } } catch (PatchListNotAvailableException e) { log.error("Cannot format patch", e); return ""; } TemporaryBuffer.Heap buf = new TemporaryBuffer.Heap(args.settings.maximumDiffSize); DiffFormatter fmt = new DiffFormatter(buf); Repository git; try { git = args.server.openRepository(change.getProject()); } catch (IOException e) { log.error("Cannot open repository to format patch", e); return ""; } try { fmt.setRepository(git); fmt.setDetectRenames(true); List<DiffEntry> entries = fmt.scan(patchList.getOldId(), patchList.getNewId()); try { fmt.format(entries); return RawParseUtils.decode(buf.toByteArray()); } catch (IOException err) { if (!JGitText.get().inMemoryBufferLimitExceeded.equals(err.getMessage())) { throw err; } StringBuilder sb = new StringBuilder(); for (DiffEntry e : entries) { switch (e.getChangeType()) { case ADD: sb.append("A ").append(e.getNewPath()); break; case MODIFY: sb.append("M ").append(e.getNewPath()); break; case DELETE: sb.append("D ").append(e.getOldPath()); break; case RENAME: sb.append(String.format("R%03d %s\n to %s", e.getScore(), e.getOldPath(), e.getNewPath())); break; case COPY: sb.append(String.format("C%03d %s\n from %s", e.getScore(), e.getNewPath(), e.getOldPath())); break; } sb.append('\n'); } sb.append(String.format( " %d files changed, %d insertions(+), %d deletions(-)\n", entries.size(), patchList.getInsertions(), patchList.getDeletions())); return sb.toString(); } } catch (IOException e) { log.error("Cannot format patch", e); return ""; } finally { fmt.release(); git.close(); } }

Target:
public String getUnifiedDiff() { PatchList patchList; try { patchList = getPatchList(); if (patchList.getOldId() == null) { return ""; } } catch (PatchListNotAvailableException e) { log.error("Cannot format patch", e); return ""; } TemporaryBuffer.Heap buf = new TemporaryBuffer.Heap(args.settings.maximumDiffSize); DiffFormatter fmt = new DiffFormatter(buf); Repository git; try { git = args.server.openRepository(change.getProject()); } catch (IOException e) { log.error("Cannot open repository to format patch", e); return ""; } try { fmt.setRepository(git); fmt.setDetectRenames(true); fmt.format(patchList.getOldId(), patchList.getNewId()); return RawParseUtils.decode(buf.toByteArray()); } catch (IOException e) { if (JGitText.get().inMemoryBufferLimitExceeded.equals(e.getMessage())) { return ""; } log.error("Cannot format patch", e); return ""; } finally { fmt.release(); git.close(); } }
Source:
public static String percentageValueIsInRange(Number number) { return String.format("The percentage value <%s> should be between zero and hundred.",number.doubleValue()); }

Target:
public static String percentageValueIsInRange(Number number) { return String.format("The percentage value <%s> should be between 0 and 100.",number.doubleValue()); }
Source:
private boolean isRootProcessorScope(ComponentModel componentModel) { ComponentIdentifier identifier = componentModel.getIdentifier(); return identifier.equals(FLOW_IDENTIFIER) || identifier.equals(MUNIT_BEFORE_SUITE_IDENTIFIER) || identifier.equals(SUBFLOW_IDENTIFIER) || identifier.equals(CHOICE_WHEN_COMPONENT_IDENTIFIER) || identifier.equals(CHOICE_OTHERWISE_COMPONENT_IDENTIFIER) || identifier.equals(MUNIT_BEFORE_TEST_IDENTIFIER) || identifier.equals(MUNIT_AFTER_SUITE_IDENTIFIER) || identifier.equals(MUNIT_AFTER_TEST_IDENTIFIER); }

Target:
private boolean isRootProcessorScope(ComponentModel componentModel) { ComponentIdentifier identifier = componentModel.getIdentifier(); return identifier.equals(FLOW_IDENTIFIER) || identifier.equals(MUNIT_BEFORE_SUITE_IDENTIFIER) || identifier.equals(SUBFLOW_IDENTIFIER) || identifier.equals(MUNIT_BEFORE_TEST_IDENTIFIER) || identifier.equals(MUNIT_AFTER_SUITE_IDENTIFIER) || identifier.equals(MUNIT_AFTER_TEST_IDENTIFIER); }
Source:
public void testListRemote_Dumb_NoHEAD() throws Exception { Repository src = remoteRepository.getRepository(); File headref = new File(src.getDirectory(), Constants.HEAD); assertTrue("HEAD used to be present", headref.delete()); assertFalse("HEAD is gone", headref.exists()); Repository dst = createBareRepository(); Ref head; try (Transport t = Transport.open(dst, dumbAuthNoneURI)) { try (FetchConnection c = t.openFetch()) { head = c.getRef(Constants.HEAD); } } assertNull("has no " + Constants.HEAD, head); }

Target:
public void testListRemote_Dumb_NoHEAD() throws Exception { Repository src = remoteRepository.getRepository(); File headref = new File(src.getDirectory(), Constants.HEAD); assertTrue("HEAD used to be present", headref.delete()); assertFalse("HEAD is gone", headref.exists()); Repository dst = createBareRepository(); Ref head; try (Transport t = Transport.open(dst, dumbAuthNoneURI); FetchConnection c = t.openFetch()) { head = c.getRef(Constants.HEAD); } assertNull("has no " + Constants.HEAD, head); }
Source:
public void boardAutoCreator_clickYesInSavePrompt_currentBoardSaved() { int panelCount = panelControl.getPanelCount(); assertEquals(0, panelControl.getNumberOfSavedBoards()); pushKeys(new KeyCodeCombination(KeyCode.P, KeyCombination.SHORTCUT_DOWN)); pushKeys(new KeyCodeCombination(KeyCode.P, KeyCombination.SHORTCUT_DOWN)); pushKeys(new KeyCodeCombination(KeyCode.P, KeyCombination.SHORTCUT_DOWN)); assertEquals(panelCount + 3, panelControl.getPanelCount()); traverseMenu("Boards", "Auto-create", "Milestones"); PlatformEx.waitOnFxThread(); waitUntilNodeAppears(String.format(SAVE_MESSAGE, "Milestones")); click("Yes"); click("OK"); assertEquals(2, panelControl.getNumberOfSavedBoards()); assertEquals(5, panelControl.getPanelCount()); traverseMenu("Boards", "Open", "New Board"); PlatformEx.waitOnFxThread(); assertEquals(panelCount + 3, panelControl.getPanelCount()); }

Target:
public void boardAutoCreator_clickYesInSavePrompt_currentBoardSaved() { int panelCount = panelControl.getPanelCount(); assertEquals(0, panelControl.getNumberOfSavedBoards()); pushKeys(KeyboardShortcuts.CREATE_RIGHT_PANEL); pushKeys(KeyboardShortcuts.CREATE_RIGHT_PANEL); pushKeys(KeyboardShortcuts.CREATE_RIGHT_PANEL); assertEquals(panelCount + 3, panelControl.getPanelCount()); traverseMenu("Boards", "Auto-create", "Milestones"); PlatformEx.waitOnFxThread(); waitUntilNodeAppears(String.format(SAVE_MESSAGE, "Milestones")); click("Yes"); click("OK"); assertEquals(2, panelControl.getNumberOfSavedBoards()); assertEquals(5, panelControl.getPanelCount()); traverseMenu("Boards", "Open", "New Board"); PlatformEx.waitOnFxThread(); assertEquals(panelCount + 3, panelControl.getPanelCount()); }
Source:
public void startWebSocketServer(String hostname) throws IOException { startWebSocketServer(getRandomPort(), hostname, 5000); }

Target:
public void startWebSocketServer(String hostname) throws IOException { startWebSocketServer(hostname, 0, DEFAULT_TIMEOUT); }
Source:
public void afterPropertiesSet() { if (this.jpaParameters != null) { if (this.parameterSourceFactory == null) { ExpressionEvaluatingParameterSourceFactory expressionSourceFactory = new ExpressionEvaluatingParameterSourceFactory(this.beanFactory); expressionSourceFactory.setParameters(jpaParameters); this.parameterSourceFactory = expressionSourceFactory; } else { if (!(this.parameterSourceFactory instanceof ExpressionEvaluatingParameterSourceFactory)) { throw new IllegalStateException("You are providing 'JpaParameters'. " + "Was expecting the the provided jpaParameterSourceFactory " + "to be an instance of 'ExpressionEvaluatingJpaParameterSourceFactory', " + "however the provided one is of type '" + this.parameterSourceFactory.getClass().getName() + "'"); } } if (this.usePayloadAsParameterSource == null) { this.usePayloadAsParameterSource = false; } } else { if (this.parameterSourceFactory == null) { this.parameterSourceFactory = new BeanPropertyParameterSourceFactory(); } if (this.usePayloadAsParameterSource == null) { this.usePayloadAsParameterSource = true; } } if(maxNumberOfResultsExpression == null) { maxNumberOfResultsExpression = new LiteralExpression("0"); } }

Target:
public void afterPropertiesSet() { if (this.jpaParameters != null) { if (this.parameterSourceFactory == null) { ExpressionEvaluatingParameterSourceFactory expressionSourceFactory = new ExpressionEvaluatingParameterSourceFactory(this.beanFactory); expressionSourceFactory.setParameters(jpaParameters); this.parameterSourceFactory = expressionSourceFactory; } else { if (!(this.parameterSourceFactory instanceof ExpressionEvaluatingParameterSourceFactory)) { throw new IllegalStateException("You are providing 'JpaParameters'. " + "Was expecting the the provided jpaParameterSourceFactory " + "to be an instance of 'ExpressionEvaluatingJpaParameterSourceFactory', " + "however the provided one is of type '" + this.parameterSourceFactory.getClass().getName() + "'"); } } if (this.usePayloadAsParameterSource == null) { this.usePayloadAsParameterSource = false; } } else { if (this.parameterSourceFactory == null) { this.parameterSourceFactory = new BeanPropertyParameterSourceFactory(); } if (this.usePayloadAsParameterSource == null) { this.usePayloadAsParameterSource = true; } } }
Source:
private SingleCellAnalyticsSchemaField[] getFactorFieldNames(String experimentAccession, String cellId) { Map<String, Collection<Object>> queryResult = getCellQueryResultForMultiValueFields( experimentAccession, cellId, SingleCellAnalyticsCollectionProxy.FACTORS); return queryResult.getOrDefault(SingleCellAnalyticsCollectionProxy.FACTORS.name(), Collections.emptyList()) .stream() .filter(factor -> !factor.toString().equalsIgnoreCase("single_cell_identifier")) .map(factor -> SingleCellAnalyticsCollectionProxy.factorAsSchemaField(factor.toString(), StringUtils.capitalize(factor.toString()))) .toArray(SingleCellAnalyticsSchemaField[]::new); }

Target:
private SingleCellAnalyticsSchemaField[] getFactorFieldNames(String experimentAccession, String cellId) { Map<String, Collection<Object>> queryResult = getCellQueryResultForMultiValueFields( experimentAccession, cellId, SingleCellAnalyticsCollectionProxy.FACTORS); return queryResult.getOrDefault(SingleCellAnalyticsCollectionProxy.FACTORS.name(), Collections.emptyList()) .stream() .filter(factor -> !factor.toString().equalsIgnoreCase("single_cell_identifier")) .map(factor -> SingleCellAnalyticsCollectionProxy.factorAsSchemaField(factor.toString())) .toArray(SingleCellAnalyticsSchemaField[]::new); }
Source:
public void run() { if (zibase != null && eventPubisher != null) { try { zibase.hostRegistering(listenerHost, listenerPort); DatagramSocket serverSocket = new DatagramSocket(listenerPort); byte[] receiveData = new byte[470]; DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); running = true; while (running) { serverSocket.receive(receivePacket); ZbResponse zbResponse = new ZbResponse(receivePacket.getData()); logger.debug("ZIBASE MESSAGE: {}", zbResponse.getMessage()); publishEvents(zbResponse); Arrays.fill(receivePacket.getData(), 0, receivePacket.getLength(), (byte) 0); } zibase.hostUnregistering(listenerHost, listenerPort); serverSocket.close(); } catch (SocketException ex) { logger.error("Could not open socket to zibase : {}", ex); } catch (UnknownHostException ex) { logger.error("Given Zibase host not reachable : {}", ex); } catch (IOException ex) { logger.error("IO error reading Zibase socket : {}", ex); } } else { logger.error("Zibase not initialized. Ip Address may be wrong or not reachable !"); } }

Target:
public void run() { if (zibase != null && eventPublisher != null) { try { zibase.hostRegistering(listenerHost, listenerPort); DatagramSocket serverSocket = new DatagramSocket(listenerPort); byte[] receiveData = new byte[470]; DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); running = true; while (running) { serverSocket.receive(receivePacket); ZbResponse zbResponse = new ZbResponse(receivePacket.getData()); logger.debug("ZIBASE MESSAGE: {}", zbResponse.getMessage()); publishEvents(zbResponse); Arrays.fill(receivePacket.getData(), 0, receivePacket.getLength(), (byte) 0); } zibase.hostUnregistering(listenerHost, listenerPort); serverSocket.close(); } catch (SocketException ex) { logger.error("Could not open socket to zibase : {}", ex); } catch (UnknownHostException ex) { logger.error("Given Zibase host not reachable : {}", ex); } catch (IOException ex) { logger.error("IO error reading Zibase socket : {}", ex); } } else { logger.error("Zibase not initialized. IP address may be wrong or not reachable !"); } }
Source:
public String[] getIndexToolArgValues(String schema, String baseTable, String indexName, String outFile, String tenantId) { String args[] = { "-s", schema, "-dt", baseTable, "-it", indexName, "-direct", "-op", outFile }; ArrayList<String> list = new ArrayList<>(Arrays.asList(args)); if (!GLOBAL_INDEX_ID.equals(tenantId)) { list.add("-tenant"); list.add(tenantId); } if (syncRebuild) { list.add("-runfg"); } if(verify != null) { list.add("-v"); list.add(verify); } return list.toArray(new String[list.size()]); }

Target:
public String[] getIndexToolArgValues(String schema, String baseTable, String indexName, String outFile, String tenantId) { String args[] = { "-s", schema, "-dt", baseTable, "-it", indexName, "-direct", "-op", outFile }; ArrayList<String> list = new ArrayList<>(Arrays.asList(args)); if (!GLOBAL_INDEX_ID.equals(tenantId)) { list.add("-tenant"); list.add(tenantId); } if (syncRebuild) { list.add("-runfg"); } if(!Strings.isNullOrEmpty(verify)) { list.add("-v"); list.add(verify); } return list.toArray(new String[list.size()]); }