auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Record record = (Record) o; return watermark == record.watermark && Objects.equals(flags, record.flags) && Objects.equals(key, record.key) && Arrays.equals(data, record.data); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Record record = (Record) o; return watermark == record.watermark && Objects.equals(flags, record.flags) && Objects.equals(key, record.key) && Arrays.equals(data, record.data); }
Source:
protected PatternParsingResults parse(InputStream in, URI uriToUse, Map<?, ?> options, ResourceSet resourceSet) { Resource resource = resource(in, uriToUse, options, resourceSet); EList<EObject> contents = resource.getContents(); DiagnosticCollector collector = new DiagnosticCollector(); for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : resource.getErrors()) { converter.convertResourceDiagnostic(diagnostic, Severity.ERROR, collector); } if (contents.isEmpty()) { return new PatternParsingResults(collector); } else { List<Pattern> patterns = Lists.newArrayList(); for (EObject eObject : contents) { BasicDiagnostic diagnosticChain = new BasicDiagnostic(); diagnostician.validate(eObject, diagnosticChain); for (Diagnostic diag : new DiagnosticTreeIterator(diagnosticChain)) { converter.convertValidatorDiagnostic(diag, collector); } if(eObject instanceof PatternModel){ for(Pattern pattern :((PatternModel) eObject).getPatterns()){ patterns.add(pattern); } } } return new PatternParsingResults(patterns, collector); } }

Target:
protected PatternParsingResults parse(InputStream in, URI uriToUse, Map<?, ?> options, ResourceSet resourceSet) { Resource resource = resource(in, uriToUse, options, resourceSet); EList<EObject> contents = resource.getContents(); PatternSetValidationDiagnostics diagnostics = validator.validate(resource); if (contents.isEmpty()) { return new PatternParsingResults(diagnostics); } else { List<Pattern> patterns = Lists.newArrayList(); for (EObject eObject : contents) { if(eObject instanceof PatternModel){ for(Pattern pattern :((PatternModel) eObject).getPatterns()){ patterns.add(pattern); } } } return new PatternParsingResults(patterns, diagnostics); } }
Source:
public static List<String> getMissingDependencies(PrismHelper helper, String bundleID) throws OozieClientException { XOozieClient oozieClient = new XOozieClient(readPropertiesFile(helper.getEnvFileName(), "prism.oozie_url")); BundleJob bundleJob = oozieClient.getBundleJobInfo(bundleID); CoordinatorJob jobInfo = oozieClient.getCoordJobInfo(bundleJob.getCoordinators().get(0).getId()); List<CoordinatorAction> actions = jobInfo.getActions(); Util.print("conf from event: " + actions.get(0).getMissingDependencies()); String[] missingDependencies = actions.get(0).getMissingDependencies().split("#"); return new ArrayList<String>(Arrays.asList(missingDependencies)); }

Target:
public static List<String> getMissingDependencies(PrismHelper helper, String bundleID) throws OozieClientException { XOozieClient oozieClient = new XOozieClient(helper.getClusterHelper().getOozieURL()); BundleJob bundleJob = oozieClient.getBundleJobInfo(bundleID); CoordinatorJob jobInfo = oozieClient.getCoordJobInfo(bundleJob.getCoordinators().get(0).getId()); List<CoordinatorAction> actions = jobInfo.getActions(); Util.print("conf from event: " + actions.get(0).getMissingDependencies()); String[] missingDependencies = actions.get(0).getMissingDependencies().split("#"); return new ArrayList<String>(Arrays.asList(missingDependencies)); }
Source:
private void testWalls(Grid grid) { int numWalls = 0; for (Entity entity : getEntities(grid)){ if (entity instanceof Box && ((Box)entity).isDestructible()){ numWalls++; } } assertTrue(numWalls > 0); }

Target:
private void testWalls(Grid grid) { int numWalls = 0; for (Entity entity : getEntities(grid)){ if (entity instanceof Wall){ numWalls++; } } assertTrue(numWalls > 0); }
Source:
VotingView(Map<Long,QuorumPeer.QuorumServer> view) { this.stringRepresentation = view.entrySet().stream() .sorted(Comparator.comparingLong(Map.Entry::getKey)) .filter(e -> e.getValue().addr != null) .map(e -> String.format("%s=%s:%d%s:%s%s", e.getKey().toString(), QuorumPeer.QuorumServer.delimitedHostString(e.getValue().addr), e.getValue().addr.getPort(), e.getValue().electionAddr == null ? "" : ":" + e.getValue().electionAddr.getPort(), e.getValue().type.equals(QuorumPeer.LearnerType.PARTICIPANT) ? "participant" : "observer", e.getValue().clientAddr ==null || e.getValue().isClientAddrFromStatic ? "" : String.format(";%s:%d", QuorumPeer.QuorumServer.delimitedHostString(e.getValue().clientAddr), e.getValue().clientAddr.getPort()))) .collect(Collectors.joining(", ")); }

Target:
VotingView(Map<Long,QuorumPeer.QuorumServer> view) { this.view = view.entrySet().stream() .filter(e -> e.getValue().addr != null) .collect(Collectors.toMap(Map.Entry::getKey, e -> String.format("%s:%d%s:%s%s", QuorumPeer.QuorumServer.delimitedHostString(e.getValue().addr), e.getValue().addr.getPort(), e.getValue().electionAddr == null ? "" : ":" + e.getValue().electionAddr.getPort(), e.getValue().type.equals(QuorumPeer.LearnerType.PARTICIPANT) ? "participant" : "observer", e.getValue().clientAddr ==null || e.getValue().isClientAddrFromStatic ? "" : String.format(";%s:%d", QuorumPeer.QuorumServer.delimitedHostString(e.getValue().clientAddr), e.getValue().clientAddr.getPort())), (v1, v2) -> v1, TreeMap::new)); }
Source:
private boolean isFromDeprecatedContainer(IndexEntry copyCandidate) { IndexValue copyCandidateValue = copyCandidate.getValue(); boolean isFromDeprecatedContainer = false; if (deprecatedContainers.contains( new Pair<>(copyCandidateValue.getAccountId(), copyCandidateValue.getContainerId()))) { logger.trace("{} in segment in is from deleted container", copyCandidate, storeId); isFromDeprecatedContainer = true; } return isFromDeprecatedContainer; }

Target:
private boolean isFromDeprecatedContainer(IndexEntry copyCandidate) { IndexValue copyCandidateValue = copyCandidate.getValue(); boolean isFromDeprecatedContainer = false; if (deprecatedContainers.contains( new Pair<>(copyCandidateValue.getAccountId(), copyCandidateValue.getContainerId()))) { logger.debug("{} in store is from deprecated container.", copyCandidate, storeId); isFromDeprecatedContainer = true; } return isFromDeprecatedContainer; }
Source:
public InternalHiveBlock(long start, long end, List<HostAddress> addresses) { checkArgument(start <= end, "block must not have negative length"); this.start = start; this.end = end; this.addresses = addresses; }

Target:
public InternalHiveBlock(long start, long end, List<HostAddress> addresses) { checkArgument(start <= end, "block end cannot be before block start"); this.start = start; this.end = end; this.addresses = ImmutableList.copyOf(addresses); }
Source:
public Gist updateGist(Gist gist) throws IOException { Assert.isNotNull(gist, "Gist cannot be null"); String repo = gist.getId(); Assert.isNotNull(repo, "Repository cannot be null"); StringBuilder uri = new StringBuilder(IGitHubConstants.SEGMENT_GISTS); uri.append('/').append(repo).append(IGitHubConstants.SUFFIX_JSON); return this.client.put(uri.toString(), gist, Gist.class); }

Target:
public Gist updateGist(Gist gist) throws IOException { Assert.isNotNull(gist, "Gist cannot be null"); String id = gist.getId(); Assert.isNotNull(id, "Gist id cannot be null"); StringBuilder uri = new StringBuilder(IGitHubConstants.SEGMENT_GISTS); uri.append('/').append(id).append(IGitHubConstants.SUFFIX_JSON); return this.client.put(uri.toString(), gist, Gist.class); }
Source:
public static ClusterBasedJobCoordinator createFromConfigLoader(Config submissionConfig) { JobConfig jobConfig = new JobConfig(submissionConfig); if (!jobConfig.getConfigLoaderFactory().isPresent()) { throw new SamzaException(JobConfig.CONFIG_LOADER_FACTORY + " is required to initialize job coordinator from config loader"); } MetricsRegistryMap metrics = new MetricsRegistryMap(); Config config = prepareJob(ConfigUtil.loadConfig(submissionConfig)); CoordinatorStreamUtil.writeConfigToCoordinatorStream(config, true); DiagnosticsUtil.createDiagnosticsStream(config); return new ClusterBasedJobCoordinator( metrics, new CoordinatorStreamStore(CoordinatorStreamUtil.buildCoordinatorStreamConfig(config), metrics), config); }

Target:
static ClusterBasedJobCoordinator createFromConfigLoader(Config submissionConfig) { JobConfig jobConfig = new JobConfig(submissionConfig); if (!jobConfig.getConfigLoaderFactory().isPresent()) { throw new SamzaException(JobConfig.CONFIG_LOADER_FACTORY + " is required to initialize job coordinator from config loader"); } MetricsRegistryMap metrics = new MetricsRegistryMap(); Config originalConfig = ConfigUtil.loadConfig(submissionConfig); ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc = ApplicationDescriptorUtil.getAppDescriptor(ApplicationUtil.fromConfig(originalConfig), originalConfig); RemoteJobPlanner planner = new RemoteJobPlanner(appDesc); List<JobConfig> jobConfigs = planner.prepareJobs(); if (jobConfigs.size() != 1) { throw new SamzaException("Only support single remote job is supported."); } Config config = jobConfigs.get(0); CoordinatorStreamUtil.writeConfigToCoordinatorStream(config, true); DiagnosticsUtil.createDiagnosticsStream(config); MetadataStore metadataStore = new CoordinatorStreamStore(CoordinatorStreamUtil.buildCoordinatorStreamConfig(config), metrics); metadataStore.init(); return new ClusterBasedJobCoordinator( metrics, metadataStore, config); }
Source:
public void canClickWithModifierOnStyledText() throws Exception { bot.checkBox("Listen").select(); styledText = bot.styledTextInGroup("StyledText"); styledText.setText("This is sample text"); bot.button("Clear").click(); styledText.click(0, 1, SWT.MOD1); SWTBotText text = bot.textInGroup("Listeners"); assertTextContains("MouseEnter [6]: MouseEvent{StyledText ", text.widget); assertTextContains("Activate [26]: ShellEvent{StyledText ", text.widget); assertTextContains("FocusIn [15]: FocusEvent{StyledText ", text.widget); assertEventMatches(text, "MouseDown [3]: MouseEvent{StyledText time=0 data=null button=1 stateMask=" + toStateMask(SWT.NONE | SWT.MOD1, styledText.widget) + " x=0 y=0 count=1"); assertEventMatches(text, "MouseUp [4]: MouseEvent{StyledText time=0 data=null button=1 stateMask=" + toStateMask(SWT.BUTTON1 | SWT.MOD1, styledText.widget) + " x=0 y=0 count=1"); }

Target:
public void canClickWithModifierOnStyledText() throws Exception { final int line = 0, column = 17; final String txtAtColumn = "x"; bot.checkBox("Listen").select(); styledText = bot.styledTextInGroup("StyledText"); styledText.setText("This is sample text"); display.syncExec(new Runnable() { @Override public void run() { styledText.widget.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { assertNotEquals(e.stateMask & SWT.MOD1, 0); Point absolutePosition = styledText.display.getCursorLocation(); Point relativePosition = styledText.widget.toControl(absolutePosition); int offset = styledText.widget.getOffsetAtPoint(relativePosition); assertEquals(offset, column); int offset2 = styledText.widget.getOffsetAtPoint(new Point(e.x, e.y)); assertEquals(offset, offset2); assertEquals(styledText.widget.getText(offset, offset), txtAtColumn); } }); } }); bot.button("Clear").click(); styledText.click(line, column, SWT.MOD1); assertEquals(new Position(line, column), styledText.cursorPosition(true)); verifyNotifyClick(SWT.MOD1); }
Source:
public void dynamicallyConvertManagedToExternalTable() throws Throwable { primary.run("use " + primaryDbName) .run("create table t1 (id int) stored as orc") .run("insert into table t1 values (1)") .run("create table t2 (id int) partitioned by (key int) stored as orc") .run("insert into table t2 partition(key=10) values (1)") .runFailure("alter table t1 set tblproperties('EXTERNAL'='true')") .runFailure("alter table t2 set tblproperties('EXTERNAL'='true')"); }

Target:
public void dynamicallyConvertManagedToExternalTable() throws Throwable { primary.run("use " + primaryDbName) .run("create table t1 (id int) stored as orc") .run("insert into table t1 values (1)") .run("create table t2 (id int) partitioned by (key int) stored as orc") .run("insert into table t2 partition(key=10) values (1)") .runFailure("alter table t1 set tblproperties('EXTERNAL'='true')") .runFailure("alter table t1 set tblproperties('EXTERNAL'='true', 'TRANSACTIONAL'='false')") .runFailure("alter table t2 set tblproperties('EXTERNAL'='true')"); }
Source:
public void testParceling() { IpPrefix p; p = new IpPrefix("2001:4860:db8::/64"); assertParcelingIsLossless(p); assertTrue(p.isIPv6()); p = new IpPrefix("192.0.2.0/25"); assertParcelingIsLossless(p); assertTrue(p.isIPv4()); }

Target:
public void testParceling() { IpPrefix p; p = new IpPrefix("2001:4860:db8::/64"); assertParcelingIsLossless(p); assertTrue(p.isIPv6()); p = new IpPrefix("192.0.2.0/25"); assertParcelingIsLossless(p); assertTrue(p.isIPv4()); assertFieldCountEquals(2, IpPrefix.class); }
Source:
public static void main(String argv[]) { sServer = new WebViewZygoteServer(); try { Os.setpgid(0, 0); } catch (ErrnoException ex) { throw new RuntimeException("Failed to setpgid(0,0)", ex); } try { sServer.registerServerSocket("webview_zygote"); Log.d(TAG, "Listening for WebView requests"); sServer.runSelectLoop(TextUtils.join(",", Build.SUPPORTED_ABIS)); sServer.closeServerSocket(); } catch (Zygote.MethodAndArgsCaller caller) { caller.run(); } catch (RuntimeException e) { Log.e(TAG, "Fatal exception:", e); } Log.d(TAG, "Exiting webview_zygote server loop"); System.exit(0); }

Target:
public static void main(String argv[]) { sServer = new WebViewZygoteServer(); try { Os.setpgid(0, 0); } catch (ErrnoException ex) { throw new RuntimeException("Failed to setpgid(0,0)", ex); } try { sServer.registerServerSocket("webview_zygote"); sServer.runSelectLoop(TextUtils.join(",", Build.SUPPORTED_ABIS)); sServer.closeServerSocket(); } catch (Zygote.MethodAndArgsCaller caller) { caller.run(); } catch (RuntimeException e) { Log.e(TAG, "Fatal exception:", e); } System.exit(0); }
Source:
public static int getMetadataContentSize(int keySize, int numberOfKeys) { return Version_Field_Size_In_Bytes + TOTAL_SIZE_FIELD_SIZE_IN_BYTES + NUM_OF_KEYS_FIELD_SIZE_IN_BYTES + ( numberOfKeys * keySize * SIZE_OF_BLOB_FIELD_IN_BYTES); }

Target:
public static int getMetadataContentSize(int keySize, int numberOfKeys) { return Version_Field_Size_In_Bytes + TOTAL_SIZE_FIELD_SIZE_IN_BYTES + NUM_OF_KEYS_FIELD_SIZE_IN_BYTES + numberOfKeys * (keySize + SIZE_OF_BLOB_FIELD_SIZE_IN_BYTES); }
Source:
public void batchInsert(final List<DeviceData> deviceDataList) { final List<WriteRequest> writeRequestList = new LinkedList<>(); for (final DeviceData data : deviceDataList) { final HashMap<String, AttributeValue> item = deviceDataToAttributeMap(data); writeRequestList.add(new WriteRequest().withPutRequest(new PutRequest().withItem(item))); } Map<String, List<WriteRequest>> requestItems = new HashMap<>(); requestItems.put(this.tableName, writeRequestList); do { final BatchWriteItemRequest batchWriteItemRequest = new BatchWriteItemRequest().withRequestItems(requestItems); final BatchWriteItemResult result = this.dynamoDBClient.batchWriteItem(batchWriteItemRequest); requestItems = result.getUnprocessedItems(); LOGGER.debug("Unprocessed put request count {}", requestItems.size()); } while (requestItems.size() > 0); }

Target:
public int batchInsert(final List<DeviceData> deviceDataList) { final List<WriteRequest> writeRequestList = Lists.newLinkedList(); for (final DeviceData data : deviceDataList) { final HashMap<String, AttributeValue> item = deviceDataToAttributeMap(data); writeRequestList.add(new WriteRequest().withPutRequest(new PutRequest().withItem(item))); } Map<String, List<WriteRequest>> requestItems = Maps.newHashMapWithExpectedSize(1); requestItems.put(this.tableName, writeRequestList); int numAttempts = 0; do { numAttempts++; final BatchWriteItemRequest batchWriteItemRequest = new BatchWriteItemRequest().withRequestItems(requestItems); final BatchWriteItemResult result = this.dynamoDBClient.batchWriteItem(batchWriteItemRequest); requestItems = result.getUnprocessedItems(); LOGGER.debug("Unprocessed put request count {}", requestItems.size()); } while ((!requestItems.isEmpty()) && (numAttempts < MAX_BATCH_WRITE_ATTEMPTS)); if (!requestItems.isEmpty()) { LOGGER.warn("Exceeded attempts to batch write to Dynamo. items left over.", MAX_BATCH_WRITE_ATTEMPTS, requestItems.size()); } return deviceDataList.size() - requestItems.size(); }
Source:
private void header(@NonNull final BecauseYouReadCard card) { CardHeaderView header = new CardHeaderView(getContext()) .setTitle(card.title()) .setImage(R.drawable.ic_restore_black_24dp) .setImageCircleColor(R.color.gray_highlight) .setCard(card) .setCallback(getCallback()); header(header); OnClickListener listener = new SelectPageCallbackAdapter(card); CardLargeHeaderView largeHeader = new CardLargeHeaderView(getContext()) .setPageTitle(card.pageTitle()) .setSubtitle(card.subtitle()) .setImage(card.image()) .onClickListener(listener); largeHeader.setOnClickListener(listener); largeHeader(largeHeader); }

Target:
private void header(@NonNull final BecauseYouReadCard card) { CardHeaderView header = new CardHeaderView(getContext()) .setTitle(card.title()) .setImage(R.drawable.ic_restore_black_24dp) .setImageCircleColor(R.color.gray_highlight) .setCard(card) .setCallback(getCallback()); header(header); CardLargeHeaderView largeHeader = new CardLargeHeaderView(getContext()) .setPageTitle(card.pageTitle()) .setSubtitle(card.subtitle()) .setImage(card.image()); largeHeader.setOnClickListener(new SelectPageCallbackAdapter(card)); largeHeader(largeHeader); }
Source:
public static VmDevice addNetworkInterfaceDevice(VmDeviceId id, boolean plugged) { return addManagedDevice(id, VmDeviceType.INTERFACE, VmDeviceType.BRIDGE, null, plugged, false, ""); }

Target:
public static VmDevice addNetworkInterfaceDevice(VmDeviceId id, boolean plugged) { return addManagedDevice(id, VmDeviceType.INTERFACE, VmDeviceType.BRIDGE, null, plugged, false); }
Source:
protected void destroyVm() { if (getVm().getStatus() == VMStatus.MigratingFrom && getVm().getMigratingToVds() != null) { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.DestroyVm, new DestroyVmVDSCommandParameters(new Guid(getVm().getMigratingToVds().toString()), getVmId(), true, false, 0)); } if (getVm().getStatus() == VMStatus.Paused && getVm().getVmPauseStatus() == VmPauseStatus.NOERR) { VmStatic vmStatic = getVm().getStaticData(); VmHandler.decreasePendingVms(getVm().getRunOnVds(), vmStatic.getNumOfCpus(), vmStatic.getMinAllocatedMem(), vmStatic.getName()); } setActionReturnValue(Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.DestroyVm, new DestroyVmVDSCommandParameters(getVdsId(), getVmId(), false, false, 0)).getReturnValue()); }

Target:
protected void destroyVm() { boolean wasPaused = false; VmStatic vmStatic = getVm().getStaticData(); if (getVm().getStatus() == VMStatus.MigratingFrom && getVm().getMigratingToVds() != null) { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.DestroyVm, new DestroyVmVDSCommandParameters(new Guid(getVm().getMigratingToVds().toString()), getVmId(), true, false, 0)); } if (getVm().getStatus() == VMStatus.Paused && getVm().getVmPauseStatus() == VmPauseStatus.NOERR) { wasPaused = true; } setActionReturnValue(Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.DestroyVm, new DestroyVmVDSCommandParameters(getVdsId(), getVmId(), false, false, 0)).getReturnValue()); if (wasPaused) { VmHandler.decreasePendingVms(getVm().getRunOnVds(), vmStatic.getNumOfCpus(), vmStatic.getMinAllocatedMem(), vmStatic.getName()); } }
Source:
private void showMilestonePicker(TurboIssue issue) { List<TurboMilestone> milestoneList = ui.logic.getRepo(issue.getRepoId()).getMilestones(); MilestonePickerDialog dialog = new MilestonePickerDialog(stage, issue, milestoneList); Optional<Pair<ButtonType, Integer>> milestoneDialogResponse = dialog.showAndWait(); if (!milestoneDialogResponse.isPresent() || milestoneDialogResponse.get().getKey().equals(ButtonType.CANCEL)) { return; } Optional<Integer> newlyAssignedMilestone = Optional.ofNullable(milestoneDialogResponse.get().getValue()); if (!issue.getMilestone().equals(newlyAssignedMilestone)) { ui.undoController.addAction(issue, new ChangeMilestoneAction(ui.logic, issue.getMilestone(), newlyAssignedMilestone)); } }

Target:
private void showMilestonePicker(TurboIssue issue) { List<TurboMilestone> milestones = ui.logic.getRepo(issue.getRepoId()).getMilestones(); Optional<MilestonePickerDialogResponse> milestoneDialogResponse = new MilestonePickerDialog(stage, issue, milestones).showAndWait(); if (wasCancelled(milestoneDialogResponse)) return; Optional<Integer> newlyAssignedMilestone = milestoneDialogResponse.get().getMilestoneId(); if (!issue.getMilestone().equals(newlyAssignedMilestone)) { addActionIfMilestoneChanged(issue, newlyAssignedMilestone); } }
Source:
public synchronized void shutdown() { if (daemon == null) { return; } log.info("Signalling background sweeper to shut down."); daemon.interrupt(); try { daemon.join(); daemon = null; } catch (InterruptedException e) { throw Throwables.rewrapAndThrowUncheckedException(e); } }

Target:
public synchronized void shutdown() { if (daemon == null) { return; } log.debug("Signalling background sweeper to shut down."); daemon.interrupt(); try { daemon.join(); daemon = null; } catch (InterruptedException e) { throw Throwables.rewrapAndThrowUncheckedException(e); } }
Source:
private Filters getOptionType(String optionValue) { if (optionValue.contains("?") || optionValue.contains("*")) { return Filters.REGREX; } else if (optionValue.matches(CLASS_OR_METHOD_REGEX)) { return Filters.CLASSORMETHOD; } return Filters.PACKAGE; }

Target:
private Filters getOptionType(String optionValue) { if (REGULAR_EXPRESSION.matcher(optionValue).find()) { return Filters.REGEX; } else if (CLASS_OR_METHOD_REGEX.matcher(optionValue).find()) { return Filters.CLASS_OR_METHOD; } return Filters.PACKAGE; }
Source:
private boolean isEmailSentDataDisplayCorrect() { if (emailPage.isElementPresent(By.className("table"))) { return isEmailSentTableHeaderCorrect(); } else { return false; } }

Target:
private boolean isEmailSentDataDisplayCorrect() { return emailPage.isElementPresent(By.className("table")) && isEmailTableHeaderCorrect(); }
Source:
public String toString() { return "Card Payment{" + "paymentId='" + super.paymentId + '\'' + ", paymentProvider='" + paymentProvider + '\'' + ", cardBrandLabel='" + getCardBrand() + '\'' + ", amount=" + amount + ", state='" + state + '\'' + ", returnUrl='" + returnUrl + '\'' + ", reference='" + reference + '\'' + ", language='" + language.toString() + '\'' + ", delayedCapture=" + (delayedCapture != null ? delayedCapture.toString() : "") + ", createdDate='" + createdDate + '\'' + '}'; }

Target:
public String toString() { return "Card Payment{" + "paymentId='" + super.paymentId + '\'' + ", paymentProvider='" + paymentProvider + '\'' + ", cardBrandLabel='" + getCardBrand() + '\'' + ", amount=" + amount + ", state='" + state + '\'' + ", returnUrl='" + returnUrl + '\'' + ", reference='" + reference + '\'' + ", language='" + language.toString() + '\'' + ", delayedCapture=" + delayedCapture + ", createdDate='" + createdDate + '\'' + '}'; }
Source:
public AbstractPool(ConnectionManager cm, PoolConfiguration pc) { this.cm = cm; this.poolConfiguration = pc; this.pools = new ConcurrentHashMap<Credential, ManagedConnectionPool>(); this.transactionMap = new ConcurrentHashMap<Object, Map<ManagedConnectionPool, ConnectionListener>>(); this.semaphore = new Semaphore(poolConfiguration.getMaxSize()); this.shouldPrefill = pc.isPrefill(); }

Target:
public AbstractPool(ConnectionManager cm, PoolConfiguration pc) { this.cm = cm; this.poolConfiguration = pc; this.pools = new ConcurrentHashMap<Credential, ManagedConnectionPool>(); this.transactionMap = new ConcurrentHashMap<Object, Map<ManagedConnectionPool, ConnectionListener>>(); this.semaphore = new Semaphore(poolConfiguration.getMaxSize()); }
Source:
INodeDirectory getMetaEnabledParent() throws TransactionContextException, StorageException { if(isDirectory()){ INodeDirectory self = (INodeDirectory) this; if(self.isMetaEnabled()){ return self; } } INodeDirectory dir = getParent(); while (!isRoot() && !dir.isRoot()) { if (dir.isMetaEnabled()) { return dir; } dir = dir.getParent(); } return null; }

Target:
INodeDirectory getMetaEnabledParent() throws TransactionContextException, StorageException { INodeDirectory dir = getParent(); while (!isRoot() && !dir.isRoot()) { if (dir.isMetaEnabled()) { return dir; } dir = dir.getParent(); } return null; }
Source:
private List<Disk> manualAggregateSnapshots() { List<Disk> Param = new ArrayList<>(); DiskImage diskWithSnaps = diskWithSnapshots; diskWithSnaps.getSnapshots().addAll(snapshotsList); Param.add(diskWithSnapshots); Param.add(diskWithoutSnapshots); Param.add(ovfImage); Param.add(cinderDisk); return Param; }

Target:
private List<DiskImage> manualAggregateSnapshots() { DiskImage diskWithSnaps = diskWithSnapshots; diskWithSnaps.getSnapshots().addAll(snapshotsList); return Arrays.asList(diskWithSnapshots, diskWithoutSnapshots, ovfImage, cinderDisk); }
Source:
protected boolean haveConnectorFactory(String domainType, String connectorType) { String connectorFilter = String.format("(&(%s=%s)(%s=%s))", org.openengsb.core.api.Constants.DOMAIN_KEY, domainType, org.openengsb.core.api.Constants.CONNECTOR_KEY, connectorType); try { Collection<ServiceReference<ConnectorInstanceFactory>> serviceReferences = bundleContext.getServiceReferences(ConnectorInstanceFactory.class, connectorFilter); return !serviceReferences.isEmpty(); } catch (InvalidSyntaxException e) { throw new RuntimeException(e); } }

Target:
protected boolean haveConnectorFactory(String domainType, String connectorType) { String connectorFilter = String.format(DOMAIN_CONNECTOR_PATTERN, domainType, connectorType); try { Collection<ServiceReference<ConnectorInstanceFactory>> serviceReferences = bundleContext.getServiceReferences(ConnectorInstanceFactory.class, connectorFilter); return !serviceReferences.isEmpty(); } catch (InvalidSyntaxException e) { throw new RuntimeException(e); } }
Source:
public void testCswUpdateByFilterConstraint() throws IOException, XPathExpressionException { Response firstResponse = ingestCswRecord(); Response secondResponse = ingestCswRecord(); given() .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML) .body(getFileContent(CSW_REQUEST_RESOURCE_PATH + "/CswUpdateByFilterConstraintRequest")) .post(CSW_PATH.getUrl()) .then() .body( hasXPath(" hasXPath(" hasXPath(" String firstId; String secondId; firstId = getMetacardIdFromCswInsertResponse(firstResponse); secondId = getMetacardIdFromCswInsertResponse(secondResponse); String firstUrl = REST_PATH.getUrl() + firstId; when() .get(firstUrl) .then() .log() .ifValidationFails() .assertThat() .body( hasXPath(" hasXPath(" hasXPath(" hasXPath( " is("Hydrography--Dictionaries"))); String secondUrl = REST_PATH.getUrl() + secondId; when() .get(secondUrl) .then() .log() .ifValidationFails() .assertThat() .body( hasXPath(" hasXPath(" hasXPath(" hasXPath( " is("Hydrography--Dictionaries"))); }

Target:
public void testCswUpdateByFilterConstraint() throws IOException, XPathExpressionException { Response firstResponse = ingestCswRecord(); Response secondResponse = ingestCswRecord(); given() .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML) .body(getFileContent(CSW_REQUEST_RESOURCE_PATH + "/CswUpdateByFilterConstraintRequest")) .post(CSW_PATH.getUrl()) .then() .body( hasXPath(" hasXPath(" hasXPath(" String firstId = getMetacardIdFromCswInsertResponse(firstResponse); String secondId = getMetacardIdFromCswInsertResponse(secondResponse); String firstUrl = REST_PATH.getUrl() + firstId; when() .get(firstUrl) .then() .log() .ifValidationFails() .assertThat() .body( hasXPath(" hasXPath(" hasXPath(" hasXPath( " is("Hydrography--Dictionaries"))); String secondUrl = REST_PATH.getUrl() + secondId; when() .get(secondUrl) .then() .log() .ifValidationFails() .assertThat() .body( hasXPath(" hasXPath(" hasXPath(" hasXPath( " is("Hydrography--Dictionaries"))); }
Source:
private void verifyTopic(final String topic, final T data) { if (data != null) { final String key = topic + (isKey.get() ? "--key" : "--value"); if (topicTypeRegistry.containsKey(key)) { assertThat(String.format("key[%s] data[%s][%s]", key, data, data.getClass()), topicTypeRegistry.get(key), equalTo(data.getClass())); } else { System.out.printf("storing key[%s] data[%s][%s]%n", key, data, data.getClass()); topicTypeRegistry.put(key, data.getClass()); } } }

Target:
private void verifyTopic(final String topic, final T data) { if (data != null) { final String key = topic + (isKey.get() ? "--key" : "--value"); if (topicTypeRegistry.containsKey(key)) { assertThat(String.format("key[%s] data[%s][%s]", key, data, data.getClass()), topicTypeRegistry.get(key), equalTo(data.getClass())); } else { topicTypeRegistry.put(key, data.getClass()); } } }
Source:
public void deleteProject(@PathParam("project") final String projectName) throws HistoryException { Project project = env.getProjects().get(projectName); if (project == null) { throw new IllegalStateException("cannot get project \"" + projectName + "\""); } project.setIndexed(false); logger.log(Level.INFO, "deleting configuration for project {0}", projectName); deleteProjectData(projectName); for (Group group : project.getGroups()) { group.getRepositories().remove(project); group.getProjects().remove(project); } List<RepositoryInfo> repos = env.getProjectRepositoriesMap().get(project); if (repos != null) { env.getRepositories().removeAll(repos); } env.getProjectRepositoriesMap().remove(project); env.getProjects().remove(projectName, project); env.refreshSearcherManagerMap(); }

Target:
public void deleteProject(@PathParam("project") final String projectName) throws HistoryException { Project project = disableProject(projectName); logger.log(Level.INFO, "deleting configuration for project {0}", projectName); deleteProjectData(projectName); for (Group group : project.getGroups()) { group.getRepositories().remove(project); group.getProjects().remove(project); } List<RepositoryInfo> repos = env.getProjectRepositoriesMap().get(project); if (repos != null) { env.getRepositories().removeAll(repos); } env.getProjectRepositoriesMap().remove(project); env.getProjects().remove(projectName, project); env.refreshSearcherManagerMap(); }
Source:
public static ListenerProtocol fromValue(String value) { ListenerProtocol[] items = ListenerProtocol.values(); for (ListenerProtocol item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } } return (ListenerProtocol) GetEnumValue.fromValueOrDefault(value, UNRECOGNIZED); }

Target:
public static Protocol fromValue(String value) { return (Protocol) GetEnumValue.fromValueOrDefault(value, Protocol.UNRECOGNIZED); }
Source:
public synchronized void putAll(Map<?, ?> t) { for (Map.Entry<?, ?> entry : t.entrySet()) { this.put(entry.getKey(), entry.getValue()); } }

Target:
public synchronized void putAll( Map<?, ?> t ) { for ( Map.Entry<?, ?> entry : t.entrySet() ) { put( entry.getKey(), entry.getValue() ); } }
Source:
double fractionOf( SearchEnvelope other ) { double fraction = 1.0; for ( int i = 0; i < min.length; i++ ) { long min = Math.max( this.min[i], other.min[i] ); long max = Math.min( this.max[i], other.max[i] ); final double innerFraction = (double) (max - min) / (double) (other.max[i] - other.min[i]); fraction *= innerFraction; } return fraction; }

Target:
double fractionOf( SearchEnvelope other ) { double fraction = 1.0; for ( int i = 0; i < nbrDim; i++ ) { long min = Math.max( this.min[i], other.min[i] ); long max = Math.min( this.max[i], other.max[i] ); final double innerFraction = (double) (max - min) / (double) (other.max[i] - other.min[i]); fraction *= innerFraction; } return fraction; }
Source:
public ProductDTO setProvidedProducts(Set<ProductDTO> providedProducts) { if (providedProducts != null) { if (this.providedProducts == null) { this.providedProducts = new HashSet<>(); } else { this.providedProducts.clear(); } for (ProductDTO dto : providedProducts) { if (isNullOrIncomplete(dto)) { throw new IllegalArgumentException( "collection contains null or incomplete provided products"); } } this.providedProducts.addAll(providedProducts); } else { this.providedProducts = null; } return this; }

Target:
public ProductDTO setProvidedProducts(Set<ProductDTO> providedProducts) { if (providedProducts != null) { if (this.providedProducts == null) { this.providedProducts = new HashSet<>(); } else { this.providedProducts.clear(); } for (ProductDTO dto : providedProducts) { if (isNullOrIncomplete(dto)) { throw new IllegalArgumentException("Collection is null or incomplete"); } } this.providedProducts.addAll(providedProducts); } else { this.providedProducts = null; } return this; }
Source:
public void setup(Context.OperatorContext context) { if (store[0] == null) { throw new RuntimeException("Left Store is Empty"); } if (store[1] == null) { throw new RuntimeException("Right Store is Empty"); } boolean isOuter = strategy.equals(JoinStrategy.LEFT_OUTER_JOIN) || strategy.equals(JoinStrategy.OUTER_JOIN); store[0].isOuterJoin(isOuter); isOuter = strategy.equals(JoinStrategy.RIGHT_OUTER_JOIN) || strategy.equals(JoinStrategy.OUTER_JOIN); store[1].isOuterJoin(isOuter); store[0].setup(); store[1].setup(); populateFields(); }

Target:
public void setup(Context.OperatorContext context) { boolean isOuter = strategy.equals(JoinStrategy.LEFT_OUTER_JOIN) || strategy.equals(JoinStrategy.OUTER_JOIN); leftStore.getStore().isOuterJoin(isOuter); isOuter = strategy.equals(JoinStrategy.RIGHT_OUTER_JOIN) || strategy.equals(JoinStrategy.OUTER_JOIN); rightStore.getStore().isOuterJoin(isOuter); leftStore.getStore().setup(context); rightStore.getStore().setup(context); populateFields(); windowTimeSec = (context.getValue(Context.OperatorContext.APPLICATION_WINDOW_COUNT) * context.getValue(Context.DAGContext.STREAMING_WINDOW_SIZE_MILLIS) * 1.0) / 1000.0; }
Source:
private static <T> T instantiatePage(SearchContext context, Class<T> pageClassToProxy) { try { Constructor<?>[] availableConstructors = pageClassToProxy.getDeclaredConstructors(); for (Constructor<?> c: availableConstructors){ Class<?>[] parameterTypes = c.getParameterTypes(); if (parameterTypes.length != 1) continue; Class<?> parameterClazz = parameterTypes[0]; if (!parameterClazz.isAssignableFrom(context.getClass())) continue; c.setAccessible(true); return (T) c.newInstance(context); } return pageClassToProxy.newInstance(); } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { throw new RuntimeException(e); } }

Target:
private static <T> T instantiatePage(SearchContext context, Class<T> pageClassToProxy) { try { Constructor<?>[] availableConstructors = pageClassToProxy.getDeclaredConstructors(); for (Constructor<?> c: availableConstructors) { Class<?>[] parameterTypes = c.getParameterTypes(); if (parameterTypes.length != 1) { continue; } Class<?> parameterClazz = parameterTypes[0]; if (!parameterClazz.isAssignableFrom(context.getClass())) { continue; } c.setAccessible(true); return pageClassToProxy.cast(c.newInstance(context)); } return pageClassToProxy.newInstance(); } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { throw new RuntimeException(e); } }
Source:
private boolean flatten(Map<String, String> map, String prefix, String name, Object value, TypeDescriptor sourceType) { String key = StringUtils.isEmpty(prefix) ? name : prefix + "." + name; if (sourceType != null) { if (sourceType.getType().equals(Boolean.class)) { map.putAll(formattingBoolean(name, value)); return true; } } if (value == null) { String resetKey = "_" + key; map.put(resetKey, ""); return true; } Class<?> clazz = value.getClass(); if (value instanceof Iterable) { if (StringUtils.isEmpty(name)) { return true; } Iterable<?> iterable = (Iterable<?>) value; map.putAll(this.convert(key, iterable)); } else if (clazz.isArray()) { if (StringUtils.isEmpty(name)) { return true; } map.putAll(this.convert(key, arrayObjectToList(value))); } else if (value instanceof Map) { Map<?, ?> m = (Map<?, ?>) value; map.putAll(this.convert(key, m)); } else { TypeDescriptor descriptor = (sourceType != null) ? sourceType : TypeDescriptor.forObject(value); if (BeanUtils.isSimpleProperty(clazz) || conversionService .canConvert(descriptor, STRING_DESC)) { map.put(key, conversionService.convert(value, descriptor, STRING_DESC).toString()); } else { return false; } } return true; }

Target:
private boolean flatten(Map<String, String> map, String prefix, String name, Object value, TypeDescriptor sourceType) { String key = StringUtils.isEmpty(prefix) ? name : prefix + "." + name; if (value == null) { String resetKey = determineResetKey(key, sourceType); map.put(resetKey, ""); return true; } Class<?> clazz = value.getClass(); if (value instanceof Iterable) { if (StringUtils.isEmpty(name)) { return true; } Iterable<?> iterable = (Iterable<?>) value; map.putAll(this.convert(key, iterable)); } else if (clazz.isArray()) { if (StringUtils.isEmpty(name)) { return true; } map.putAll(this.convert(key, arrayObjectToList(value))); } else if (value instanceof Map) { Map<?, ?> m = (Map<?, ?>) value; map.putAll(this.convert(key, m)); } else { TypeDescriptor descriptor = (sourceType != null) ? sourceType : TypeDescriptor.forObject(value); if (BeanUtils.isSimpleProperty(clazz) || conversionService .canConvert(descriptor, STRING_DESC)) { map.put(key, conversionService.convert(value, descriptor, STRING_DESC).toString()); } else { return false; } } return true; }
Source:
protected void doExecute() throws Exception { if (skip) { return; } if (isInstall) { installServerAssembly(); } else { log.info(MessageFormat.format(messages.getString("info.install.type.preexisting"), "")); checkServerHomeExists(); } boolean createServer = false; if (!serverDirectory.exists()) { createServer = true; } else if (refresh) { FileUtils.forceDelete(serverDirectory); createServer = true; } if (createServer) { log.info(MessageFormat.format(messages.getString("info.server.start.create"), serverName)); ServerTask serverTask = initializeJava(); serverTask.setOperation("create"); serverTask.setTemplate(template); serverTask.execute(); copyConfigFiles(true); exportParametersToXml(); log.info(MessageFormat.format(messages.getString("info.server.create.created"), serverName, serverDirectory.getCanonicalPath())); } else { copyConfigFiles(); exportParametersToXml(); } }

Target:
protected void doExecute() throws Exception { if (skip) { return; } if (isInstall) { installServerAssembly(); } else { log.info(MessageFormat.format(messages.getString("info.install.type.preexisting"), "")); checkServerHomeExists(); } boolean createServer = false; if (!serverDirectory.exists()) { createServer = true; } else if (refresh) { FileUtils.forceDelete(serverDirectory); createServer = true; } if (createServer) { log.info(MessageFormat.format(messages.getString("info.server.start.create"), serverName)); ServerTask serverTask = initializeJava(); serverTask.setOperation("create"); serverTask.setTemplate(template); serverTask.execute(); log.info(MessageFormat.format(messages.getString("info.server.create.created"), serverName, serverDirectory.getCanonicalPath())); } copyConfigFiles(true); exportParametersToXml(); }
Source:
public FromAttributesAuthorizationGenerator() { this.roleAttributes = Arrays.asList(new String[] {}); this.permissionAttributes = Arrays.asList(new String[] {}); }

Target:
public FromAttributesAuthorizationGenerator() { this.roleAttributes = new ArrayList(); this.permissionAttributes = new ArrayList(); }
Source:
public SELF withRowGroupSize(int rowGroupSize) { this.blockSize = rowGroupSize; return self(); }

Target:
public SELF withRowGroupSize(int rowGroupSize) { this.rowGroupSize = rowGroupSize; return self(); }
Source:
public void insertToMemberGroup(PerunSession sess, Member member, Vo vo) throws InternalErrorException, AlreadyMemberException { try { getPerunBl().getVosManagerBl().checkVoExists(sess, vo); Group g = getPerunBl().getGroupsManagerBl().getGroupByName(sess, vo, VosManager.MEMBERS_GROUP); getPerunBl().getGroupsManagerBl().addMemberToMembersGroup(sess, g, member); } catch (NotMemberOfParentGroupException ex) { throw new ConsistencyErrorException(ex); } catch (GroupNotExistsException e) { throw new InternalErrorException(e); } catch (VoNotExistsException e) { throw new InternalErrorException(e); } catch (WrongAttributeValueException e) { throw new ConsistencyErrorException(e); } catch (WrongReferenceAttributeValueException e) { throw new ConsistencyErrorException(e); } catch (NotGroupMemberException e) { throw new ConsistencyErrorException(e); } }

Target:
public void insertToMemberGroup(PerunSession sess, Member member, Vo vo) throws InternalErrorException, AlreadyMemberException, GroupOperationsException { try { getPerunBl().getVosManagerBl().checkVoExists(sess, vo); Group g = getPerunBl().getGroupsManagerBl().getGroupByName(sess, vo, VosManager.MEMBERS_GROUP); getPerunBl().getGroupsManagerBl().addMemberToMembersGroup(sess, g, member); } catch (GroupNotExistsException e) { throw new InternalErrorException(e); } catch (VoNotExistsException e) { throw new InternalErrorException(e); } catch (WrongAttributeValueException e) { throw new ConsistencyErrorException(e); } catch (WrongReferenceAttributeValueException e) { throw new ConsistencyErrorException(e); } }
Source:
public void retriesOnExceptionTillCount() throws Exception { final int count = 3; final int delay = 1000; final Take take = Mockito.mock(Take.class); final Request req = new RqFake(RqMethod.GET); Mockito.when(take.act(Mockito.any(Request.class))).thenThrow( new IOException() ); final long minTimeToFail = count * delay; final long startTime = System.currentTimeMillis(); try { new TkRetry(count, delay, take).act(req); } catch (final IOException exception) { MatcherAssert.assertThat( minTimeToFail, Matchers.lessThanOrEqualTo( System.currentTimeMillis() - startTime ) ); throw exception; } }

Target:
public void retriesOnExceptionTillCount() throws Exception { final int count = 3; final int delay = 1000; final Take take = Mockito.mock(Take.class); final Request req = new RqFake(RqMethod.GET); Mockito.when(take.act(Mockito.any(Request.class))).thenThrow( new IOException() ); final long startTime = System.currentTimeMillis(); try { new TkRetry(count, delay, take).act(req); } catch (final IOException exception) { MatcherAssert.assertThat( new Long(count * delay), Matchers.lessThanOrEqualTo( System.currentTimeMillis() - startTime ) ); throw exception; } }
Source:
public void canHandleMultipleClearsWithNoCorrrespondingProblemAlarm() throws Exception { final MockNode node = m_mockNetwork.getNode(1); sendNodeUpEvent(node); sendNodeUpEvent(node); await().until(() -> m_alarmDao.findAll().size() == 1 && m_alarmDao.findAll().get(0).getCounter() == 2); }

Target:
public void canHandleMultipleClearsWithNoCorrrespondingProblemAlarm() throws Exception { final MockNode node = m_mockNetwork.getNode(1); sendNodeUpEvent(node); sendNodeUpEvent(node); await().until(() -> m_alarmDao.findAll(), hasSize(1)); await().until(() -> m_alarmDao.findAll().get(0).getCounter(), equalTo(2)); }
Source:
public ImportTableDesc tableDesc(String dbName) throws SemanticException { try { Table table = new Table(metadata.getTable()); if (!AcidUtils.isTransactionalTable(table) && hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_STRICT_MANAGED_TABLES) && (table.getTableType() == TableType.MANAGED_TABLE)) { Hive hiveDb = Hive.get(hiveConf); HiveStrictManagedMigration.TableMigrationOption migrationOption = HiveStrictManagedMigration.determineMigrationTypeAutomatically(table.getTTable(), table.getTableType(),null, (Configuration)hiveConf, hiveDb.getMSC(),true); HiveStrictManagedMigration.migrateTable(table.getTTable(), table.getTableType(), migrationOption, false, getHiveUpdater(hiveConf), hiveDb.getMSC(), (Configuration)hiveConf); if (AcidUtils.isTransactionalTable(table)) { replicationSpec().setDoingMigration(); } } ImportTableDesc tableDesc = new ImportTableDesc(StringUtils.isBlank(dbName) ? table.getDbName() : dbName, table); tableDesc.setReplicationSpec(replicationSpec()); if (table.getTableType() == TableType.EXTERNAL_TABLE) { tableDesc.setExternal(true); } return tableDesc; } catch (Exception e) { throw new SemanticException(e); } }

Target:
public ImportTableDesc tableDesc(String dbName) throws SemanticException { try { Table table = new Table(metadata.getTable()); if (!AcidUtils.isTransactionalTable(table) && hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_STRICT_MANAGED_TABLES) && (table.getTableType() == TableType.MANAGED_TABLE)) { Hive hiveDb = Hive.get(hiveConf); HiveStrictManagedMigration.TableMigrationOption migrationOption = HiveStrictManagedMigration.determineMigrationTypeAutomatically(table.getTTable(), table.getTableType(),null, (Configuration)hiveConf, hiveDb.getMSC(),true); HiveStrictManagedMigration.migrateTable(table.getTTable(), table.getTableType(), migrationOption, false, getHiveUpdater(hiveConf), hiveDb.getMSC(), (Configuration)hiveConf); if (AcidUtils.isTransactionalTable(table)) { replicationSpec().setMigratingToTxnTable(); } } ImportTableDesc tableDesc = new ImportTableDesc(StringUtils.isBlank(dbName) ? table.getDbName() : dbName, table); tableDesc.setReplicationSpec(replicationSpec()); if (table.getTableType() == TableType.EXTERNAL_TABLE) { tableDesc.setExternal(true); } return tableDesc; } catch (Exception e) { throw new SemanticException(e); } }
Source:
protected boolean checkTemplateInStorageDomain() { boolean retValue = validate(getImportValidator().verifyDisks(imageList, imageToDestinationDomainMap)); if (retValue && !VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals(getVm().getVmtGuid()) && !getParameters().getCopyCollapse()) { for (DiskImage diskImage : imageList) { if (!diskImage.getImageTemplateId().equals(Guid.Empty)) { DiskImage templateDisk = getDbFacade().getDiskImageDao().get(diskImage.getImageTemplateId()); if (!templateDisk.getStorageIds().contains(diskImage.getStorageIds().get(0))) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN); } } } } return retValue; }

Target:
protected boolean checkTemplateInStorageDomain() { boolean retValue = validate(getImportValidator().verifyDisks(imageList, imageToDestinationDomainMap)); if (retValue && !VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals(getVm().getVmtGuid()) && !getParameters().getCopyCollapse()) { for (DiskImage diskImage : imageList) { if (!diskImage.getImageTemplateId().equals(Guid.Empty)) { DiskImage templateDisk = diskImageDao.get(diskImage.getImageTemplateId()); if (!templateDisk.getStorageIds().contains(diskImage.getStorageIds().get(0))) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN); } } } } return retValue; }
Source:
private void waitForReconciliationToComplete() { long startedAt = System.currentTimeMillis(); while (!deltaReconciliationCompleted() && (System.currentTimeMillis() - startedAt) <= MAX_TIME_TO_WAIT_FOR_RECONCILIATION) { try { Thread.sleep(1000); } catch (InterruptedException e) { Thread.interrupted(); break; } } if (!deltaReconciliationCompleted()) { throw new SystemFailureException(JcrI18n.journalHasNotCompletedReconciliation.text(journalId(), clusterName(), MAX_TIME_TO_WAIT_FOR_RECONCILIATION)); } }

Target:
private void waitForReconciliationToComplete() { try { reconciliationLatch.await(MAX_MINUTES_TO_WAIT_FOR_RECONCILIATION, TimeUnit.MINUTES); } catch (InterruptedException e) { Thread.interrupted(); } if (!deltaReconciliationCompleted()) { throw new SystemFailureException(JcrI18n.journalHasNotCompletedReconciliation.text(journalId(), clusterName(), MAX_MINUTES_TO_WAIT_FOR_RECONCILIATION)); } }
Source:
public void classSetup() throws Exception { removeAndRestoreDataBundle(dataBundle); }

Target:
public void classSetup() { removeAndRestoreDataBundle(dataBundle); }