auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isInventoryWhitelisted(Inventory inventory) { if (inventory == null) return false; Set<String> whitelist = settings.getProperty(RestrictionSettings.UNRESTRICTED_INVENTORIES); return whitelist.contains(inventory.getName()); }

Target:
private boolean isInventoryWhitelisted(Inventory inventory) { if (inventory == null) { return false; } Set<String> whitelist = settings.getProperty(RestrictionSettings.UNRESTRICTED_INVENTORIES); return whitelist.contains(ChatColor.stripColor(inventory.getName())); }
Source:
private void updateMidiValuesStartingAtNote(NoteName startingNote, NoteName currentActiveNote) { int correspondingMidiValue = startingNote.getMidi(); for (int i = 0; i < WHITE_KEY_COUNT; i++) { while (NoteName.getNoteNameFromMidiValue(correspondingMidiValue).isSigned()) { correspondingMidiValue++; } whitePianoKeys.get(i).setTag(correspondingMidiValue); whitePianoKeys.get(i).setText(NoteName.getNoteNameFromMidiValue(correspondingMidiValue).name()); correspondingMidiValue++; } correspondingMidiValue = startingNote.getMidi(); for (int i = 0; i < BLACK_KEY_COUNT; i++) { while (!NoteName.getNoteNameFromMidiValue(correspondingMidiValue).isSigned()) { correspondingMidiValue++; } blackPianoKeys.get(i).setTag(correspondingMidiValue); blackPianoKeys.get(i).setText(NoteName.getNoteNameFromMidiValue(correspondingMidiValue).name()); correspondingMidiValue++; } updateButtonColors(currentActiveNote); }

Target:
private void updateMidiValuesStartingAtNote(NoteName startingNote, NoteName currentActiveNote) { int correspondingMidiValue = startingNote.getMidi(); for (PianoKeyType type : PianoKeyType.values()) { updateMidiValueOfType(type, correspondingMidiValue); } updatePianoKeyColors(currentActiveNote); }
Source:
public void close() { _instanceCounter.dec(); _registry.removeMatching(new MetricFilter() { @Override public boolean matches(String name, Metric metric) { if (name.equals(_instanceCounterName) && _instanceCounter.getCount() != 0) { return false; } return _names.contains(name); } }); _names.clear(); }

Target:
public synchronized void close() { _instanceCounter.dec(); if (_instanceCounter.getCount() == 0) { _registry.remove(_instanceCounterName); } for (String name : _names) { _registry.remove(name); } _names.clear(); }
Source:
private CompletionStage<Void> deleteFromStoresAndNotify(K key, V value, Metadata metadata) { deleteFromStores(key); if (cacheNotifier != null && cacheNotifier.hasListener(CacheEntryExpired.class)) { return cacheNotifier.notifyCacheEntryExpired(key, value, metadata, null); } return CompletableFutures.completedNull(); }

Target:
private void deleteFromStoresAndNotify(K key, V value, Metadata metadata) { deleteFromStores(key); CompletionStages.join(cacheNotifier.notifyCacheEntryExpired(key, value, metadata, null)); }
Source:
private String getRecipientNames(Set<String> recipients) { StringBuilder namesStringBuilder = new StringBuilder(); int i = 0; for (String recipient : recipients) { if (i == recipients.size() - 1 && recipients.size() > 1) { namesStringBuilder.append("and "); } StudentAttributes student = roster.getStudentForEmail(recipient); if (courseId.equals(recipient)) { namesStringBuilder.append("<b>All students in this course</b>, "); } else if (student != null) { if (recipients.size() == 1) { namesStringBuilder.append("<b>" + student.name + " (" + student.team + ", " + student.email + ")</b>, "); } else { namesStringBuilder.append("<b>" + student.name + "</b>" + ", "); } } else { namesStringBuilder.append("<b>" + recipient + "</b>" + ", "); } i++; } String namesString = namesStringBuilder.toString(); return removeEndComma(namesString); }

Target:
private String getRecipientNames(Set<String> recipients) { StringBuilder namesStringBuilder = new StringBuilder(); int i = 0; for (String recipient : recipients) { if (i == recipients.size() - 1 && recipients.size() > 1) { namesStringBuilder.append("and "); } StudentAttributes student = roster.getStudentForEmail(recipient); if (courseId.equals(recipient)) { namesStringBuilder.append("All students in this course, "); } else if (student != null) { if (recipients.size() == 1) { namesStringBuilder.append(student.name + " (" + student.team + ", " + student.email + "), "); } else { namesStringBuilder.append(student.name + ", "); } } else { namesStringBuilder.append(recipient + ", "); } i++; } String namesString = namesStringBuilder.toString(); return removeEndComma(namesString); }
Source:
public void openOutsideWebsite(String url) { try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); } catch (ActivityNotFoundException e) { Toast.makeText(getActivity(), "No application can handle this request. " + "Please install a map app.", Toast.LENGTH_SHORT).show(); e.printStackTrace(); } }

Target:
public void openOutsideWebsite(String url) { try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); } catch (ActivityNotFoundException e) { Toast.makeText(getActivity(), "No application can handle this request. " + "Please install a map app.", Toast.LENGTH_SHORT).show(); Timber.e(e, "No map application"); } }
Source:
private static boolean verifyDeduction(ICPPTemplateParameter[] pars, CPPTemplateParameterMap tpMap, boolean useDefaults, IASTNode point) { for (ICPPTemplateParameter tpar : pars) { if (tpar.isParameterPack()) { ICPPTemplateArgument[] deducedArgs= tpMap.getPackExpansion(tpar); if (deducedArgs == null) { tpMap.put(tpar, ICPPTemplateArgument.EMPTY_ARGUMENTS); } else { for (ICPPTemplateArgument arg : deducedArgs) { if (arg == null) return false; } } } else { ICPPTemplateArgument deducedArg= tpMap.getArgument(tpar); if (deducedArg == null && useDefaults) { deducedArg= tpar.getDefaultValue(); if (deducedArg != null) { deducedArg= CPPTemplates.instantiateArgument(deducedArg, tpMap, -1, null, point); if (deducedArg != null) { if (deducedArg instanceof CPPTemplateTypeArgument) { CPPTemplateTypeArgument deducedTypeArg = (CPPTemplateTypeArgument) deducedArg; if (!(deducedTypeArg.getTypeValue() instanceof IProblemBinding)) { tpMap.put(tpar, deducedArg); } } else { tpMap.put(tpar, deducedArg); } } } } if (deducedArg == null) return false; } } return true; }

Target:
private static boolean verifyDeduction(ICPPTemplateParameter[] pars, CPPTemplateParameterMap tpMap, boolean useDefaults, IASTNode point) { for (ICPPTemplateParameter tpar : pars) { if (tpar.isParameterPack()) { ICPPTemplateArgument[] deducedArgs= tpMap.getPackExpansion(tpar); if (deducedArgs == null) { tpMap.put(tpar, ICPPTemplateArgument.EMPTY_ARGUMENTS); } else { for (ICPPTemplateArgument arg : deducedArgs) { if (arg == null) return false; } } } else { ICPPTemplateArgument deducedArg= tpMap.getArgument(tpar); if (deducedArg == null && useDefaults) { deducedArg= tpar.getDefaultValue(); if (deducedArg != null) { deducedArg= CPPTemplates.instantiateArgument(deducedArg, tpMap, -1, null, point); if (deducedArg != null) { if (deducedArg instanceof CPPTemplateTypeArgument) { CPPTemplateTypeArgument deducedTypeArg = (CPPTemplateTypeArgument) deducedArg; if (!(deducedTypeArg.getTypeValue() instanceof ISemanticProblem)) { tpMap.put(tpar, deducedArg); } } else { tpMap.put(tpar, deducedArg); } } } } if (deducedArg == null) return false; } } return true; }
Source:
protected void runNow(String ruleUID, boolean considerConditions, Map<String, Object> context) { RuntimeRule rule = getRuntimeRule(ruleUID); if (rule == null) { logger.warn("Failed to execute rule '{}': Invalid Rule UID", ruleUID); return; } synchronized (this) { final RuleStatus ruleStatus = getRuleStatus(ruleUID); if (ruleStatus != RuleStatus.IDLE) { logger.error("Failed to execute rule ‘{}' with status '{}'", ruleUID, ruleStatus.name()); return; } } setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.TRIGGERED, RuleStatusDetail.NONE, null, context), true); try { clearContext(rule); if (context != null && !context.isEmpty()) { getContext(ruleUID).putAll(context); } if (considerConditions) { if (calculateConditions(rule)) { setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.RUNNING), true); executeActions(rule, false); } } else { setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.RUNNING), true); executeActions(rule, false); } logger.debug("The rule '{}' is executed.", ruleUID); } catch (Throwable t) { logger.error("Fail to execute rule '{}': {}", new Object[] { ruleUID, t.getMessage() }, t); } synchronized (this) { if (getRuleStatus(ruleUID) == RuleStatus.TRIGGERED || getRuleStatus(ruleUID) == RuleStatus.RUNNING) { setRuleStatusInfo(ruleUID, new RuleStatusInfo(RuleStatus.IDLE), true); } } }

Target:
protected void runNow(String ruleUID, boolean considerConditions, Map<String, Object> context) { RuntimeRule rule = getRuntimeRule(ruleUID); if (rule == null) { logger.warn("Failed to execute rule '{}': Invalid Rule UID", ruleUID); return; } try { changeRuleStatus(rule, RuleStatusInfo.createTriggeredStatusInfo(context), RuleStatus.IDLE); clearContext(rule); if (context != null && !context.isEmpty()) { getContext(ruleUID).putAll(context); } if (considerConditions) { if (calculateConditions(rule)) { changeRuleStatus(rule, RuleStatusInfo.create(RuleStatus.RUNNING), RuleStatus.TRIGGERED); executeActions(rule, false); } } else { changeRuleStatus(rule, RuleStatusInfo.create(RuleStatus.RUNNING), RuleStatus.TRIGGERED); executeActions(rule, false); } logger.debug("The rule '{}' is executed.", ruleUID); if (getRuleStatus(ruleUID) != RuleStatus.DISABLED) { changeRuleStatus(rule, RuleStatusInfo.create(RuleStatus.IDLE), RuleStatus.TRIGGERED, RuleStatus.RUNNING); } } catch (Throwable t) { logger.error("Fail to execute rule '{}': {}", new Object[] { ruleUID, t.getMessage() }, t); } }
Source:
protected Pair<Boolean, StorageDomain> syncDomainLuns(StorageDomain storageDomain) { return new Pair<>( StorageHelperDirector.getInstance() .getItem(storageDomain.getStorageType()).syncDomainInfo(storageDomain, null), storageDomain); }

Target:
protected Pair<Boolean, Guid> syncDomainLuns(StorageDomain storageDomain) { return new Pair<>( StorageHelperDirector.getInstance() .getItem(storageDomain.getStorageType()).syncDomainInfo(storageDomain, null), storageDomain.getId()); }
Source:
protected void executeCommand() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.ResetGlusterVolumeOptions, new ResetGlusterVolumeOptionsVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().getVolumeOption(), getParameters().isForceAction())); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { if (getParameters().getVolumeOption() != null && !(getParameters().getVolumeOption().getKey().isEmpty())) { GlusterVolumeOptionEntity entity = getGlusterVolume().getOption(getParameters().getVolumeOption().getKey()); String optionValue = entity.getValue(); removeOptionInDb(entity); isResetAllOptions = false; getParameters().getVolumeOption().setValue(optionValue != null ? optionValue : ""); } else { for (GlusterVolumeOptionEntity option : getGlusterVolume().getOptions()) { removeOptionInDb(option); } isResetAllOptions = true; } } else { handleVdsError(AuditLogType.GLUSTER_VOLUME_OPTIONS_RESET_FAILED, returnValue.getVdsError().getMessage()); return; } }

Target:
protected void executeCommand() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.ResetGlusterVolumeOptions, new ResetGlusterVolumeOptionsVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().getVolumeOption(), getParameters().isForceAction())); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { if (getParameters().getVolumeOption() != null && !(getParameters().getVolumeOption().getKey().isEmpty())) { GlusterVolumeOptionEntity entity = getGlusterVolume().getOption(getParameters().getVolumeOption().getKey()); removeOptionInDb(entity); isResetAllOptions = false; if(entity != null) { String optionValue = entity.getValue(); getParameters().getVolumeOption().setValue(optionValue != null ? optionValue : ""); } } else { for (GlusterVolumeOptionEntity option : getGlusterVolume().getOptions()) { removeOptionInDb(option); } isResetAllOptions = true; } } else { handleVdsError(AuditLogType.GLUSTER_VOLUME_OPTIONS_RESET_FAILED, returnValue.getVdsError().getMessage()); return; } }
Source:
public Boolean apply(EntryView.ReadWriteEntryView<K, Collection<V>> entryView) { boolean removed = false; try { Collection<V> values = entryView.get(); if(value == null) { entryView.remove(); removed = true; } else if (values.contains(value)){ Collection<V> newValues = new HashSet<>(); newValues.addAll(values); newValues.remove(value); if(newValues.isEmpty()) { entryView.remove(); } else { entryView.set(newValues); } removed = newValues.size() < values.size(); } } catch (NoSuchElementException ex) { } return removed; }

Target:
public Boolean apply(EntryView.ReadWriteEntryView<K, Collection<V>> entryView) { Boolean removed; if (value == null) { removed = removeKey(entryView); } else { removed = removeKeyValue(entryView); } return removed; }
Source:
public void tearDown() { account.shutdown(); }

Target:
public void tearDown() { account.shutdown(); cookieBasedClient.shutdown(); }
Source:
private List<Product> getProducts(boolean getRefs) throws CatalogException { IndexSearcher searcher = null; List<Product> products = new Vector<Product>(); try { try { reader = DirectoryReader.open(indexDir); } catch (IOException e) { e.printStackTrace(); } searcher = new IndexSearcher(reader); Term productIdTerm = new Term("myfield", "myvalue"); org.apache.lucene.search.Query query = new TermQuery(productIdTerm); Sort sort = new Sort(new SortField("CAS.ProductReceivedTime", SortField.Type.STRING, true)); TopDocs check = searcher.search(query, 1, sort); if(check.totalHits>0) { TopDocs topDocs = searcher.search(query, check.totalHits, sort); ScoreDoc[] hits = topDocs.scoreDocs; if (hits.length > 0) { for (ScoreDoc hit : hits) { Document productDoc = searcher.doc(hit.doc); CompleteProduct prod = toCompleteProduct(productDoc, getRefs, false); products.add(prod.getProduct()); } } else { LOG.log(Level.FINEST, "Request for products returned no results"); return products; } } } catch (IOException e) { LOG.log(Level.WARNING, "IOException when opening index directory: [" + indexFilePath + "] for search: Message: " + e.getMessage()); throw new CatalogException(e.getMessage(), e); } finally { if (searcher != null) { try { } catch (Exception ignore) { } } } return products; }

Target:
private List<Product> getProducts(boolean getRefs) throws CatalogException { IndexSearcher searcher = null; List<Product> products = new Vector<Product>(); try { try { reader = DirectoryReader.open(indexDir); } catch (IOException e) { e.printStackTrace(); } searcher = new IndexSearcher(reader); Term productIdTerm = new Term("myfield", "myvalue"); org.apache.lucene.search.Query query = new TermQuery(productIdTerm); Sort sort = new Sort(new SortField("CAS.ProductReceivedTime", SortField.Type.STRING, true)); TopDocs check = searcher.search(query, 1, sort); if(check.totalHits>0) { TopDocs topDocs = searcher.search(query, check.totalHits, sort); ScoreDoc[] hits = topDocs.scoreDocs; if (hits.length > 0) { for (ScoreDoc hit : hits) { Document productDoc = searcher.doc(hit.doc); CompleteProduct prod = toCompleteProduct(productDoc, getRefs, false); products.add(prod.getProduct()); } } else { LOG.log(Level.FINEST, "Request for products returned no results"); } } } catch (IOException e) { LOG.log(Level.WARNING, "IOException when opening index directory: [" + indexFilePath + "] for search: Message: " + e.getMessage()); throw new CatalogException(e.getMessage(), e); } finally { if (searcher != null) { try { } catch (Exception ignore) { } } } return products; }
Source:
public static void addMappingsFrom(File file) { try { addMappingsFrom(new FileInputStream(file)); } catch (FileNotFoundException ex) { log.log(Level.SEVERE, "Failed loading SHA1 to CoordinateUtils mapping from " + file.toString() + ": " + ex.getMessage(), ex); } }

Target:
public static void addMappingsFrom(File file) { try (FileInputStream inputStream = new FileInputStream(file)) { LineIterator it = IOUtils.lineIterator(inputStream, "UTF-8"); while (it.hasNext()) { String line = it.next(); if (line.startsWith("#") || line.trim().isEmpty()) continue; String[] parts = StringUtils.split(line, ' '); if (parts.length < 2) throw new IllegalArgumentException("Expected 'SHA1 GROUP_ID:ARTIFACT_ID:VERSION[:COORDINATE]', but was [" + line + "] in [" + file + "]"); addMapping(parts[0], parts[1]); } } catch (IOException e) { throw new WindupException("Failed to load SHA1 to " + Coordinate.class.getSimpleName() + " definitions from [" + file + "]", e); } }
Source:
public void visitNode(Tree tree) { if (tree.is(Tree.Kind.METHOD)) { methodUsesLocks.push(false); } if (tree.is(Tree.Kind.METHOD_INVOCATION) && (lockMethod.matches((MethodInvocationTree) tree) || tryLockMethod.matches((MethodInvocationTree) tree)) && methodUsesLocks.size() != 1) { methodUsesLocks.pop(); methodUsesLocks.push(true); } if (hasSemantic() && tree.is(Tree.Kind.ASSIGNMENT)) { AssignmentExpressionTree aet = (AssignmentExpressionTree) tree; if (aet.variable().is(Tree.Kind.IDENTIFIER) && !isInSyncBlock() && !withinStaticInitializer.peek() && !isUsingLock()) { IdentifierTree variable = (IdentifierTree) aet.variable(); if (isStaticNotVolatileObject(variable)) { reportIssue(variable, "Synchronize this lazy initialization of '" + variable.name() + "'"); } } } if (tree.is(Tree.Kind.STATIC_INITIALIZER)) { withinStaticInitializer.push(true); } super.visitNode(tree); }

Target:
public void visitNode(Tree tree) { if (tree.is(Tree.Kind.METHOD)) { methodUsesLocks.push(false); } if (tree.is(Tree.Kind.METHOD_INVOCATION) && (locks.anyMatch((MethodInvocationTree) tree)) && methodUsesLocks.size() != 1) { methodUsesLocks.pop(); methodUsesLocks.push(true); } if (hasSemantic() && tree.is(Tree.Kind.ASSIGNMENT)) { AssignmentExpressionTree aet = (AssignmentExpressionTree) tree; if (aet.variable().is(Tree.Kind.IDENTIFIER) && !isInSyncBlock() && !withinStaticInitializer.peek() && !isUsingLock()) { IdentifierTree variable = (IdentifierTree) aet.variable(); if (isStaticNotVolatileObject(variable)) { reportIssue(variable, "Synchronize this lazy initialization of '" + variable.name() + "'"); } } } if (tree.is(Tree.Kind.STATIC_INITIALIZER)) { withinStaticInitializer.push(true); } super.visitNode(tree); }
Source:
public void verifyNoAsyncErrors() { for (Throwable e : asyncErrors) { if (e instanceof AssertionError) throw (AssertionError) e; else fail("Async error during test execution: " + e); } }

Target:
public void verifyNoAsyncErrors() { for (Throwable e : asyncErrors) { if (e instanceof AssertionError) { throw (AssertionError) e; } else { fail("Async error during test execution: " + e); } } }
Source:
public void testInvalidKeyConfiguration() { TwitterComponent component = context().getComponent("twitter", TwitterComponent.class); TwitterComponentVerifier verifier = (TwitterComponentVerifier)component.getVerifier(); Map<String, Object> parameters = getParameters(); parameters.put("consumerKey", "invalid"); ComponentVerifier.Result result = verifier.verify(ComponentVerifier.Scope.CONNECTIVITY, parameters); Assert.assertEquals(ComponentVerifier.Result.Status.ERROR, result.getStatus()); Assert.assertEquals(1, result.getErrors().size()); Assert.assertEquals(VerificationError.StandardCode.AUTHENTICATION, result.getErrors().get(0).getCode()); Assert.assertEquals(401, result.getErrors().get(0).getDetails().get("twitter_status_code")); Assert.assertEquals(32, result.getErrors().get(0).getDetails().get("twitter_error_code")); }

Target:
public void testInvalidKeyConfiguration() { TwitterComponent component = context().getComponent("twitter", TwitterComponent.class); TwitterComponentVerifier verifier = (TwitterComponentVerifier)component.getVerifier(); Map<String, Object> parameters = getParameters(); parameters.put("consumerKey", "invalid"); ComponentVerifier.Result result = verifier.verify(ComponentVerifier.Scope.CONNECTIVITY, parameters); Assert.assertEquals(ComponentVerifier.Result.Status.ERROR, result.getStatus()); Assert.assertEquals(1, result.getErrors().size()); Assert.assertEquals(VerificationError.StandardCode.AUTHENTICATION, result.getErrors().get(0).getCode()); Assert.assertEquals(401, result.getErrors().get(0).getDetails().get(asAttribute("twitter_status_code"))); Assert.assertEquals(32, result.getErrors().get(0).getDetails().get(asAttribute("twitter_error_code"))); }
Source:
public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { String newName = formatParameter(sessionName); StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName); ICommandResult result = executeCommand(command.toString(), monitor, false); String[] errorOutput = result.getErrorOutput(); if (isError(result) && (errorOutput != null)) { int index = 0; while (index < errorOutput.length) { String line = errorOutput[index]; Matcher matcher = LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN.matcher(line); if (matcher.matches()) { return; } index++; } throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); } Document doc = getDocumentFromStrings(result.getOutput()); NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); if (sessions.getLength() != 1) { throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); } Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); if (rawSessionName == null) { throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); } if (!rawSessionName.getTextContent().equals(sessionName)) { throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); } }

Target:
public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { String newName = formatParameter(sessionName); StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName); ICommandResult result = executeCommand(command.toString(), monitor, false); String[] errorOutput = result.getErrorOutput(); if (isError(result) && (errorOutput != null)) { if (ignoredPattern(errorOutput, LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { return; } throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); } Document doc = getDocumentFromStrings(result.getOutput()); NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); if (sessions.getLength() != 1) { throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); } Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); if (rawSessionName == null) { throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); } if (!rawSessionName.getTextContent().equals(sessionName)) { throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); } }
Source:
private static void assertXaException(ExceptionRunnable runnable, int errorCode) { try { runnable.run(); fail(); } catch (Exception e) { Exceptions.assertException(XAException.class, e); assertEquals(errorCode, ((XAException) e).errorCode); } }

Target:
private static void assertXaException(ExceptionRunnable runnable, int errorCode) throws Exception { try { runnable.run(); fail(); } catch (XAException e) { assertEquals(errorCode, e.errorCode); } }
Source:
public void changeImageAlignment() { int numOfMedia = 3; List<String> wikiTexts = new ArrayList<String>(); wikiTexts.add("|centre"); wikiTexts.add("|left"); String randomArticleName = PageContent.ARTICLE_NAME_PREFIX + new VisualEditorPageObject(driver).getTimeStamp(); VisualEditorPageObject ve = new VisualEditorPageObject(driver).openVEOnArticle(wikiURL, randomArticleName); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); VisualEditorAddMediaDialog mediaDialog = ve.clickImageButton(); mediaDialog = mediaDialog.searchMedia("h"); ve = mediaDialog.addExistingMedia(numOfMedia); ve.verifyMedias(numOfMedia); ve.verifyEditorSurfacePresent(); ve.verifyVEToolBarPresent(); ve.selectMediaByIndex(2); VisualEditorMediaSettingsDialog mediaSettingsDialog = ve.openMediaSettings(); mediaSettingsDialog.selectSettings(Setting.ADVANCED); mediaSettingsDialog.clickAlignment(Alignment.LEFT); ve = mediaSettingsDialog.clickApplyChangesButton(); ve.verifyEditorSurfacePresent(); ve.verifyVEToolBarPresent(); ve.selectMediaByIndex(0); mediaSettingsDialog = ve.openMediaSettings(); mediaSettingsDialog.selectSettings(Setting.ADVANCED); mediaSettingsDialog.clickAlignment(Alignment.CENTER); ve = mediaSettingsDialog.clickApplyChangesButton(); ve.verifyEditorSurfacePresent(); ve.verifyVEToolBarPresent(); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyAddedDiffs(wikiTexts); saveDialog = reviewDialog.clickReturnToSaveFormButton(); ArticlePageObject article = saveDialog.savePage(); article.verifyVEPublishComplete(); }

Target:
public void changeImageAlignment() { int numOfMedia = 3; List<String> wikiTexts = new ArrayList<String>(); wikiTexts.add("|centre"); wikiTexts.add("|left"); String randomArticleName = PageContent.ARTICLE_NAME_PREFIX + new VisualEditorPageObject(driver).getTimeStamp(); VisualEditorPageObject ve = new VisualEditorPageObject(driver).openVEOnArticle(wikiURL, randomArticleName); VisualEditorAddMediaDialog mediaDialog = ve.searchImage("h"); ve = mediaDialog.addExistingMedia(numOfMedia); ve.verifyMedias(numOfMedia); ve.alignMedia(2, Alignment.LEFT); ve.alignMedia(0, Alignment.CENTER); ve.verifyEditorSurfacePresent(); ve.verifyVEToolBarPresent(); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyAddedDiffs(wikiTexts); saveDialog = reviewDialog.clickReturnToSaveFormButton(); ArticlePageObject article = saveDialog.savePage(); article.verifyVEPublishComplete(); }
Source:
void packageNameFilterInclude_matchingPackagesAreIncluded() { EngineDiscoveryRequest request = request().filters( PackageNameFilter.includePackageNames("org.junit.jupiter.engine")).build(); TestDescriptor engineDescriptor = engineDescriptor() .with( classTestDescriptor("matching", MatchingClass.class) ) .build(); applier.applyAllFilters(request, engineDescriptor); Stream<UniqueId> includedDescriptors = engineDescriptor.getDescendants().stream().map(TestDescriptor::getUniqueId); assertThat(includedDescriptors) .containsExactly(UniqueId.root("class", "matching")); }

Target:
void packageNameFilterInclude_matchingPackagesAreIncluded() { EngineDiscoveryRequest request = request().filters( PackageNameFilter.includePackageNames("org.junit.jupiter.engine")).build(); TestDescriptor engineDescriptor = engineDescriptor() .with( classTestDescriptor("matching", MatchingClass.class) ) .build(); applier.applyAllFilters(request, engineDescriptor); assertThat(engineDescriptor.getDescendants()) .extracting(TestDescriptor::getUniqueId) .containsExactly(UniqueId.root("class", "matching")); }
Source:
public static List<VerificationError> requiresAny(Map<String, Object> parameters, Collection<OptionsGroup> groups) { final List<VerificationError> verificationErrors = new ArrayList<>(); final Set<String> keys = new HashSet<>(parameters.keySet()); for (OptionsGroup group : groups) { final Set<String> required = required(group.getOptions()); final ResultErrorBuilder builder = new ResultErrorBuilder() .code(VerificationError.StandardCode.INCOMPLETE_PARAMETER_GROUP) .detail(VerificationError.GroupAttribute.GROUP_NAME, group.getName()) .detail(VerificationError.GroupAttribute.GROUP_OPTIONS, String.join(",", parameters(group.getOptions()))); if (keys.containsAll(required)) { final Set<String> excluded = excluded(group.getOptions()); final Set<String> shouldBeExcluded = new HashSet<>(keys); shouldBeExcluded.retainAll(excluded); if (shouldBeExcluded.isEmpty()) { return Collections.emptyList(); } shouldBeExcluded.forEach(builder::parameterKey); verificationErrors.add(builder.build()); } else { for (String option : required) { if (!parameters.containsKey(option)) { builder.parameterKey(option); } } verificationErrors.add(builder.build()); } } return verificationErrors; }

Target:
public static List<VerificationError> requiresAny(Map<String, Object> parameters, Collection<OptionsGroup> groups) { final List<VerificationError> verificationErrors = new ArrayList<>(); final Set<String> keys = new HashSet<>(parameters.keySet()); for (OptionsGroup group : groups) { final Set<String> required = required(group.getOptions()); final Set<String> excluded = excluded(group.getOptions()); final ResultErrorBuilder builder = new ResultErrorBuilder() .code(VerificationError.StandardCode.ILLEGAL_PARAMETER_GROUP_COMBINATION) .detail(VerificationError.GroupAttribute.GROUP_NAME, group.getName()) .detail(VerificationError.GroupAttribute.GROUP_OPTIONS, String.join(",", parameters(group.getOptions()))); if (keys.containsAll(required)) { final Set<String> shouldBeExcluded = new HashSet<>(keys); shouldBeExcluded.retainAll(excluded); if (shouldBeExcluded.isEmpty()) { return Collections.emptyList(); } shouldBeExcluded.forEach(builder::parameterKey); verificationErrors.add(builder.build()); } else { for (String option : required) { if (!parameters.containsKey(option)) { builder.parameterKey(option); } } for (String option : excluded) { if (parameters.containsKey(option)) { builder.parameterKey(option); } } verificationErrors.add(builder.build()); } } return verificationErrors; }
Source:
public void checkAttributeValue(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<String> pshell = (List<String>) attribute.getValue(); if (pshell != null) for(String shell : pshell){ if(shell != null){ if(shell.isEmpty())throw new WrongAttributeValueException("shell cannot be empty"); else{ sess.getPerunBl().getModulesUtilsBl().checkFormatOfShell(shell, attribute); } } } }

Target:
public void checkAttributeValue(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { List<String> pshell = (List<String>) attribute.getValue(); if (pshell != null){ for(String shell : pshell){ if(shell != null){ if(shell.isEmpty()){ throw new WrongAttributeValueException("shell cannot be empty"); }else{ sess.getPerunBl().getModulesUtilsBl().checkFormatOfShell(shell, attribute); } }else{ throw new WrongAttributeValueException("shell cannot be null"); } } } }
Source:
public ChatComponent setObfuscated(boolean obfuscated) { $lock.writeLock().lock(); if (this.obfuscated == null) this.obfuscated = new AtomicBoolean(obfuscated); else this.obfuscated.set(obfuscated); $lock.writeLock().unlock(); return this; }

Target:
public ChatComponent setObfuscated(boolean obfuscated) { if (this.obfuscated == null) this.obfuscated = new AtomicBoolean(obfuscated); else this.obfuscated.set(obfuscated); return this; }
Source:
private Pattern compile(String name) throws MaxwellInvalidFilterException { if ( name.startsWith("/") ) { if ( !name.endsWith("/") ) { throw new MaxwellInvalidFilterException("Invalid regular expression: " + name); } return Pattern.compile(name.substring(1, name.length() - 1)); } else { return Pattern.compile("^" + name.trim() + "$"); } }

Target:
private Pattern compile(String name) throws MaxwellInvalidFilterException { name = name.trim(); if ( name.startsWith("/") ) { if ( !name.endsWith("/") ) { throw new MaxwellInvalidFilterException("Invalid regular expression: " + name); } return Pattern.compile(name.substring(1, name.length() - 1)); } else { return Pattern.compile("^" + name + "$"); } }
Source:
public static AlarmData copyFrom(IAlarmData source) { if (source == null) { return null; } AlarmData alarmData = new AlarmData(); alarmData.setReductionKey(source.getReductionKey()); alarmData.setAlarmType(source.getAlarmType()); alarmData.setClearKey(source.getClearKey()); alarmData.setAutoClean(source.getAutoClean()); alarmData.setX733AlarmType(source.getX733AlarmType()); alarmData.setX733ProbableCause(source.getX733ProbableCause()); alarmData.getUpdateFieldList().addAll( source.getUpdateFieldList().stream().map(UpdateField::copyFrom).collect(Collectors.toList())); alarmData.setManagedObject( source.getManagedObject() == null ? null : ManagedObject.copyFrom(source.getManagedObject())); return alarmData; }

Target:
public static AlarmData copyFrom(IAlarmData source) { if (source == null) { return null; } AlarmData alarmData = new AlarmData(); alarmData.setReductionKey(source.getReductionKey()); alarmData.setAlarmType(source.getAlarmType()); alarmData.setClearKey(source.getClearKey()); alarmData.setAutoClean(source.getAutoClean()); alarmData.setX733AlarmType(source.getX733AlarmType()); alarmData.setX733ProbableCause(source.getX733ProbableCause()); alarmData.getUpdateFieldList().addAll( source.getUpdateFieldList().stream().map(UpdateField::copyFrom).collect(Collectors.toList())); alarmData.setManagedObject(ManagedObject.copyFrom(source.getManagedObject())); return alarmData; }
Source:
private synchronized BulkMutation getOrAddBulkMutation(String tableName) { if (tableToBulkMutation.containsKey(tableName)) { return tableToBulkMutation.get(tableName); } final BulkMutation bulkMutation = session .createBulkMutation( session .getOptions() .getInstanceName() .toTableName(tableName), session.createAsyncExecutor()); tableToBulkMutation.put(tableName, bulkMutation); return bulkMutation; }

Target:
private BulkMutation getOrAddBulkMutation(String tableName) { synchronized (lock) { if (tableToBulkMutation.containsKey(tableName)) { return tableToBulkMutation.get(tableName); } final BulkMutation bulkMutation = session .createBulkMutation( session .getOptions() .getInstanceName() .toTableName(tableName), session.createAsyncExecutor()); tableToBulkMutation.put(tableName, bulkMutation); return bulkMutation; } }
Source:
public void run(IProgressMonitor monitor) throws InvocationTargetException { if (operationResult != null) throw new IllegalStateException(CoreText.OperationAlreadyExecuted); EclipseGitProgressTransformer gitMonitor = new EclipseGitProgressTransformer( SubMonitor.convert(monitor, 1)); try (Git git = new Git(repository)) { FetchCommand command; if (rc == null) command = git.fetch().setRemote(uri.toPrivateString()) .setRefSpecs(specs); else command = git.fetch().setRemote(rc.getName()); command.setCredentialsProvider(credentialsProvider) .setTimeout(timeout).setDryRun(dryRun) .setProgressMonitor(gitMonitor); if (tagOpt != null) command.setTagOpt(tagOpt); try { operationResult = command.call(); } catch (JGitInternalException e) { throw new InvocationTargetException( e.getCause() != null ? e.getCause() : e); } catch (Exception e) { throw new InvocationTargetException(e); } } }

Target:
public void run(IProgressMonitor monitor) throws InvocationTargetException { if (operationResult != null) throw new IllegalStateException(CoreText.OperationAlreadyExecuted); EclipseGitProgressTransformer gitMonitor = new EclipseGitProgressTransformer( monitor); try (Git git = new Git(repository)) { FetchCommand command; if (rc == null) command = git.fetch().setRemote(uri.toPrivateString()) .setRefSpecs(specs); else command = git.fetch().setRemote(rc.getName()); command.setCredentialsProvider(credentialsProvider) .setTimeout(timeout).setDryRun(dryRun) .setProgressMonitor(gitMonitor); if (tagOpt != null) command.setTagOpt(tagOpt); try { operationResult = command.call(); } catch (JGitInternalException e) { throw new InvocationTargetException( e.getCause() != null ? e.getCause() : e); } catch (Exception e) { throw new InvocationTargetException(e); } } }
Source:
public boolean validate() throws Exception { CompilerEnvirons env = new CompilerEnvirons(); env.setRecoverFromErrors(true); Parser parser = new Parser(env, new JSErrorReporter()); AstRoot rootNode = parser.parse(script, null, 0); JSNodeVisitor nodeVisitor = new JSNodeVisitor(); rootNode.visit(nodeVisitor); if (nodeVisitor.getRoot().visit(new JSSymbolVisitor())) { return true; } return false; }

Target:
public boolean validate() throws Exception { CompilerEnvirons env = new CompilerEnvirons(); env.setRecoverFromErrors(true); Parser parser = new Parser(env, new JSErrorReporter()); AstRoot rootNode = parser.parse(script, null, 0); JSNodeVisitor nodeVisitor = new JSNodeVisitor(); rootNode.visit(nodeVisitor); return nodeVisitor.getRoot().visit(); }
Source:
private void updateActionAvailability() { GlusterVolumeEntity volumeEntity = getEntity(); boolean allowRemove = true; boolean allowReplace = true; boolean allowAdvanced = true; boolean allowAdd = true; if (volumeEntity == null || getSelectedItems() == null || getSelectedItems().size() == 0) { allowRemove = false; allowReplace = false; allowAdvanced = false; allowAdd = false; } else { GlusterAsyncTask volumeTask = volumeEntity.getAsyncTask(); if (volumeTask != null && (volumeTask.getStatus() == JobExecutionStatus.STARTED || volumeTask.getType() == GlusterTaskType.REMOVE_BRICK && volumeTask.getStatus() == JobExecutionStatus.FINISHED)) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.STRIPE || getSelectedItems().size() == volumeEntity.getBricks().size()) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.REPLICATE && (volumeEntity.getBricks().size() == VolumeListModel.REPLICATE_COUNT_DEFAULT || getSelectedItems().size() > 1)) { allowRemove = false; } else if (volumeEntity.getVolumeType().isDispersedType()) { allowRemove = false; allowAdd = false; } if (getSelectedItems().size() == 1) { allowReplace = true; allowAdvanced = volumeEntity.isOnline() && getSelectedItems().get(0).isOnline(); } else { allowReplace = false; allowAdvanced = false; } } getRemoveBricksCommand().setIsExecutionAllowed(allowRemove); getReplaceBrickCommand().setIsExecutionAllowed(allowReplace); getBrickAdvancedDetailsCommand().setIsExecutionAllowed(allowAdvanced); getAddBricksCommand().setIsExecutionAllowed(allowAdd); }

Target:
private void updateActionAvailability() { GlusterVolumeEntity volumeEntity = getEntity(); boolean allowRemove = true; boolean allowReplace = true; boolean allowAdvanced = true; boolean allowAdd = true; if (volumeEntity.getVolumeType().isDispersedType()) { allowRemove = false; allowAdd = false; } if (volumeEntity == null || getSelectedItems() == null || getSelectedItems().size() == 0) { allowRemove = false; allowReplace = false; allowAdvanced = false; } else { GlusterAsyncTask volumeTask = volumeEntity.getAsyncTask(); if (volumeTask != null && (volumeTask.getStatus() == JobExecutionStatus.STARTED || volumeTask.getType() == GlusterTaskType.REMOVE_BRICK && volumeTask.getStatus() == JobExecutionStatus.FINISHED)) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.STRIPE || getSelectedItems().size() == volumeEntity.getBricks().size()) { allowRemove = false; } else if (volumeEntity.getVolumeType() == GlusterVolumeType.REPLICATE && (volumeEntity.getBricks().size() == VolumeListModel.REPLICATE_COUNT_DEFAULT || getSelectedItems().size() > 1)) { allowRemove = false; } if (getSelectedItems().size() == 1) { allowReplace = true; allowAdvanced = volumeEntity.isOnline() && getSelectedItems().get(0).isOnline(); } else { allowReplace = false; allowAdvanced = false; } } getRemoveBricksCommand().setIsExecutionAllowed(allowRemove); getReplaceBrickCommand().setIsExecutionAllowed(allowReplace); getBrickAdvancedDetailsCommand().setIsExecutionAllowed(allowAdvanced); getAddBricksCommand().setIsExecutionAllowed(allowAdd); }
Source:
private void writeCheckpointIfNeed() { if (commitNeeded) { throw new IllegalStateException("A checkpoint should only be written if the previous commit has completed" + " and there is no new commit needed."); } if (checkpoint != null) { stateMgr.checkpoint(checkpoint); checkpoint = null; } }

Target:
private void writeCheckpointIfNeed() { if (commitNeeded) { log.error("Tried to write a checkpoint with pending uncommitted data, should complete the commit first."); throw new IllegalStateException("A checkpoint should only be written if no commit is needed."); } if (checkpoint != null) { stateMgr.checkpoint(checkpoint); checkpoint = null; } }
Source:
public void analyse(Project project, SensorContext context) { this.context = context; List<SquidAstVisitor<Grammar>> visitors = Lists.newArrayList(checks.all()); visitors.add(new FileLinesVisitor(fileLinesContextFactory, fileSystem)); this.scanner = PythonAstScanner.create(createConfiguration(), visitors.toArray(new SquidAstVisitor[visitors.size()])); scanner.scanFiles(Lists.newArrayList(fileSystem.files(fileSystem.predicates().hasLanguage(Python.KEY)))); Collection<SourceCode> squidSourceFiles = scanner.getIndex().search(new QueryByType(SourceFile.class)); save(squidSourceFiles); }

Target:
public void analyse(Project project, SensorContext context) { this.context = context; List<SquidAstVisitor<Grammar>> visitors = Lists.newArrayList(checks.all()); visitors.add(new FileLinesVisitor(fileLinesContextFactory, fileSystem)); this.scanner = PythonAstScanner.create(createConfiguration(), visitors.toArray(new SquidAstVisitor[visitors.size()])); FilePredicates p = fileSystem.predicates(); scanner.scanFiles(Lists.newArrayList(fileSystem.files(p.and(p.hasType(InputFile.Type.MAIN), p.hasLanguage(Python.KEY))))); Collection<SourceCode> squidSourceFiles = scanner.getIndex().search(new QueryByType(SourceFile.class)); save(squidSourceFiles); }
Source:
private String createAchFormattedRemittanceIdTextBasedOnInvoiceDataForDv(String invoiceNumber, Date invoiceDate, String customerPaymentDocumentNumber) { StringBuilder formattedRemittanceIdText = new StringBuilder(KFSConstants.EMPTY_STRING); if (StringUtils.isNotBlank(invoiceNumber) && ObjectUtils.isNotNull(invoiceDate)) { formattedRemittanceIdText.append(invoiceNumber); formattedRemittanceIdText.append(KFSConstants.BLANK_SPACE); formattedRemittanceIdText.append(CuDisbursementVoucherConstants.DV_EXTRACT_EDOC_NUMBER_PREFIX_IDENTIFIER); formattedRemittanceIdText.append(customerPaymentDocumentNumber); } else if (StringUtils.isNotBlank(customerPaymentDocumentNumber)) { formattedRemittanceIdText.append(CuDisbursementVoucherConstants.DV_EXTRACT_EDOC_NUMBER_PREFIX_IDENTIFIER); formattedRemittanceIdText.append(customerPaymentDocumentNumber); } return formattedRemittanceIdText.toString(); }

Target:
private String createAchFormattedRemittanceIdTextBasedOnInvoiceDataForDv(String invoiceNumber, Date invoiceDate, String customerPaymentDocumentNumber) { StringBuilder formattedRemittanceIdText = new StringBuilder(KFSConstants.EMPTY_STRING); if (StringUtils.isNotBlank(invoiceNumber) && ObjectUtils.isNotNull(invoiceDate)) { formattedRemittanceIdText.append(invoiceNumber); formattedRemittanceIdText.append(KFSConstants.BLANK_SPACE); formattedRemittanceIdText.append(CuDisbursementVoucherConstants.DV_EXTRACT_EDOC_NUMBER_PREFIX_IDENTIFIER); formattedRemittanceIdText.append(StringUtils.isNotBlank(customerPaymentDocumentNumber) ? customerPaymentDocumentNumber : KFSConstants.EMPTY_STRING); } else if (StringUtils.isNotBlank(customerPaymentDocumentNumber)) { formattedRemittanceIdText.append(CuDisbursementVoucherConstants.DV_EXTRACT_EDOC_NUMBER_PREFIX_IDENTIFIER); formattedRemittanceIdText.append(customerPaymentDocumentNumber); } return formattedRemittanceIdText.toString(); }
Source:
public InteractiveUIContent build() { if (isSimple) { Preconditions.checkArgument(defaultCheck == null || defaultCheck.size() == 1); } boolean hasConfiguration = configurationUIRegistry != null; if (hasConfiguration) { Preconditions.checkArgument(configurationNodeKey != null); } final InteractiveUIContent interactiveUI = new InteractiveUIContent(parent, hasDescription, hasConfiguration); CheckboxTableViewer descriptorViewer = createViewer(interactiveUI); if (hasConfiguration) { createConfigurationComposite(interactiveUI); } setViewerInput(descriptorViewer); bindAndInit(interactiveUI, descriptorViewer); return interactiveUI; }

Target:
public InteractiveUIContent build() { Preconditions.checkArgument(!isSimple || defaultCheck == null || defaultCheck.size() == 1); boolean hasConfiguration = configurationUIRegistry != null; Preconditions.checkArgument(!hasConfiguration || configurationNodeKey != null); final InteractiveUIContent interactiveUI = new InteractiveUIContent(parent, hasDescription, hasConfiguration); CheckboxTableViewer descriptorViewer = createViewer(interactiveUI); if (hasConfiguration) { createConfigurationComposite(interactiveUI); } setViewerInput(descriptorViewer); bindAndInit(interactiveUI, descriptorViewer); return interactiveUI; }
Source:
public static void checkPhysicalLogicalTypeCompatible( LogicalType physicalFieldType, LogicalType logicalFieldType, String physicalFieldName, String logicalFieldName, boolean isSource) { if (isSource) { checkIfCompatible( physicalFieldType, logicalFieldType, (cause) -> new ValidationException( String.format("Type %s of table field '%s' does not match with " + "the physical type %s of the '%s' field of the %s.", logicalFieldType, logicalFieldName, physicalFieldType, physicalFieldName, "TableSource return type"), cause)); } else { checkIfCompatible( logicalFieldType, physicalFieldType, (cause) -> new ValidationException( String.format("Type %s of table field '%s' does not match with " + "the physical type %s of the '%s' field of the %s.", logicalFieldType, logicalFieldName, physicalFieldType, physicalFieldName, "TableSink consumed type"), cause)); } }

Target:
public static void checkPhysicalLogicalTypeCompatible( LogicalType physicalFieldType, LogicalType logicalFieldType, String physicalFieldName, String logicalFieldName, boolean isSource) { if (isSource) { checkIfCompatible( physicalFieldType, logicalFieldType, (cause) -> new ValidationException( String.format("Type %s of table field '%s' does not match with " + "the physical type %s of the '%s' field of the TableSource return type.", logicalFieldType, logicalFieldName, physicalFieldType, physicalFieldName), cause)); } else { checkIfCompatible( logicalFieldType, physicalFieldType, (cause) -> new ValidationException( String.format("Type %s of table field '%s' does not match with " + "the physical type %s of the '%s' field of the TableSink consumed type.", logicalFieldType, logicalFieldName, physicalFieldType, physicalFieldName), cause)); } }
Source:
public SourceWithKeys(byte[] startKey, byte[] stopKey, long size) { if (stopKey.length > 0) { Preconditions.checkState(Bytes.compareTo(startKey, stopKey) < 0, "[startKey, stopKey]", new String(startKey), new String(stopKey)); Preconditions.checkState(size > 0); } this.startKey = startKey; this.stopKey = stopKey; this.estimatedSize = size; LOG.debug("Creating split: {},", this); }

Target:
public SourceWithKeys(byte[] startKey, byte[] stopKey, long size) { if (stopKey.length > 0) { Preconditions.checkState(Bytes.compareTo(startKey, stopKey) < 0, "[startKey, stopKey]", new String(startKey), new String(stopKey)); Preconditions.checkState(size > 0); } this.startKey = startKey; this.stopKey = stopKey; this.estimatedSize = size; LOG.debug("Creating split: {}.", this); }