auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void workingWithAgents() { Boolean b; dashboardWorkspace.selectTabInWorspaceMenu(TabNames.AGENTS); dashboardWorkspace.selectMachine("Workspace Agents", "dev-machine"); for (String agentName : AgentsList) { dashboardWorkspace.checkAgentExists(agentName); } for (int i = 0; i < AgentsList.size(); i++) { b = dashboardWorkspace.getAgentState(AgentsList.get(i)); Assert.assertEquals(b, AgentsStateList.get(i)); dashboardWorkspace.switchAgentState(AgentsList.get(i)); } clickOnSaveButton(); for (String agentName : AgentsList) { dashboardWorkspace.switchAgentState(agentName); } for (int i = 0; i < AgentsList.size(); i++) { b = dashboardWorkspace.getAgentState(AgentsList.get(i)); Assert.assertEquals(b, AgentsStateList.get(i)); } clickOnSaveButton(); }

Target:
public void workingWithAgents() { dashboardWorkspace.selectTabInWorspaceMenu(TabNames.AGENTS); dashboardWorkspace.selectMachine("Workspace Agents", "dev-machine"); agents.forEach( (name, value) -> { dashboardWorkspace.checkAgentExists(name); }); agents.forEach( (name, value) -> { Assert.assertEquals(dashboardWorkspace.getAgentState(name), value); dashboardWorkspace.switchAgentState(name); }); clickOnSaveButton(); agents.forEach( (name, value) -> { dashboardWorkspace.switchAgentState(name); }); clickOnSaveButton(); agents.forEach( (name, value) -> { Assert.assertEquals(dashboardWorkspace.getAgentState(name), value); }); }
Source:
protected void removeAllDraggableGroupComponent(Collection<FieldDefinition> fields) { Iterator<FieldDefinition> it = fields.iterator(); while (it.hasNext()) { FieldDefinition field = it.next(); try { layoutEditor.removeDraggableGroupComponent(getFormDefinition().getModel().getName(), field.getId()); } catch (JavaScriptException e) { } } }

Target:
protected void removeAllDraggableGroupComponent(Collection<FieldDefinition> fields) { String groupId = getFormDefinition().getModel().getName(); Iterator<FieldDefinition> it = fields.iterator(); while (it.hasNext()) { FieldDefinition field = it.next(); if (layoutEditor.hasDraggableGroupComponent(groupId, field.getId())) { layoutEditor.removeDraggableGroupComponent(groupId, field.getId()); } } }
Source:
public int getCurrentTaskThreadPoolSize() { return _record.getIntField(LiveInstanceProperty.CURRENT_TASK_THREAD_POOL_SIZE.name(), CURRENT_TASK_THREAD_POOL_SIZE_NOT_SET); }

Target:
public int getCurrentTaskThreadPoolSize() { return _record.getIntField(LiveInstanceProperty.CURRENT_TASK_THREAD_POOL_SIZE.name(), TaskConstants.DEFAULT_TASK_THREAD_POOL_SIZE); }
Source:
private Path getStagingDir(FileSystem fileSystem) { final String configuredStagingDir = flinkConfiguration.getString(YarnConfigOptions.STAGING_DIRECTORY); return configuredStagingDir != null ? new Path(configuredStagingDir) : fileSystem.getHomeDirectory(); }

Target:
private Path getStagingDir(FileSystem fileSystem) { final String configuredStagingDir = flinkConfiguration.getString(YarnConfigOptions.STAGING_DIRECTORY); return configuredStagingDir != null ? fileSystem.makeQualified(new Path(configuredStagingDir)) : fileSystem.getHomeDirectory(); }
Source:
public static Map<String, String> sendPutRequest(String url, String params, Map<String, String> headers) throws IDPTokenManagerException { HttpPut httpPut = new HttpPut(url); HttpClient httpClient = getCertifiedHttpClient(); HttpPut httpPutWithHeaders = (HttpPut) buildHeaders(httpPut, headers); Map<String, String> responseParams = new HashMap<String, String>(); if (params != null) { try { httpPutWithHeaders.setEntity(new StringEntity(params)); } catch (UnsupportedEncodingException e) { throw new IDPTokenManagerException("Invalid encoding type.", e); } } try { HttpResponse response = httpClient.execute(httpPutWithHeaders); String status = String.valueOf(response.getStatusLine().getStatusCode()); responseParams.put(Constants.SERVER_RESPONSE_STATUS, status); responseParams.put(Constants.SERVER_RESPONSE_BODY, getResponseBody(response)); } catch (ClientProtocolException e) { throw new IDPTokenManagerException("Invalid client protocol.", e); } catch (IOException e) { responseParams.put(Constants.SERVER_RESPONSE_BODY, "Internal Server Error"); responseParams.put(Constants.SERVER_RESPONSE_STATUS, Constants.INTERNAL_SERVER_ERROR); throw new IDPTokenManagerException("Server connectivity failure.", e); } return responseParams; }

Target:
public static Map<String, String> sendPutRequest(String url, String params, Map<String, String> headers) throws IDPTokenManagerException { HttpPut httpPut = new HttpPut(url); HttpClient httpClient = getCertifiedHttpClient(); httpPut = (HttpPut) buildHeaders(httpPut, headers); Map<String, String> responseParams = new HashMap<String, String>(); if (params != null) { try { httpPut.setEntity(new StringEntity(params)); } catch (UnsupportedEncodingException e) { throw new IDPTokenManagerException("Invalid encoding type.", e); } } try { HttpResponse response = httpClient.execute(httpPut); String status = String.valueOf(response.getStatusLine().getStatusCode()); responseParams.put(Constants.SERVER_RESPONSE_STATUS, status); responseParams.put(Constants.SERVER_RESPONSE_BODY, getResponseBody(response)); } catch (ClientProtocolException e) { String errorMsg = "Error occurred while sending 'Put' request due to an invalid client protocol being used"; responseParams.put(Constants.SERVER_RESPONSE_BODY, "Internal Server Error"); responseParams.put(Constants.SERVER_RESPONSE_STATUS, Constants.INTERNAL_SERVER_ERROR); Log.e(TAG, errorMsg); throw new IDPTokenManagerException(errorMsg, e); } catch (IOException e) { String errorMsg = "Error occurred while sending 'Put' request due to failure of server connection"; responseParams.put(Constants.SERVER_RESPONSE_BODY, "Internal Server Error"); responseParams.put(Constants.SERVER_RESPONSE_STATUS, Constants.INTERNAL_SERVER_ERROR); Log.e(TAG, errorMsg); throw new IDPTokenManagerException(errorMsg, e); } return responseParams; }
Source:
public void setKeepOpen(boolean keepOpen) { log.debug("keep open:" + keepOpen); this.keepOpen.set(keepOpen); }

Target:
public void setKeepOpen(boolean keepOpen) { log.debug("keep open: {}", keepOpen); this.keepOpen.set(keepOpen); }
Source:
public void read(HttpServletRequest request, HttpServletResponse response, @PathVariable("doi") String doi, @PathVariable("number") int ingestionNumber) throws IOException { ArticleIngestionIdentifier ingestionId = ArticleIngestionIdentifier.create(DoiEscaping.resolve(doi), ingestionNumber); articleCrudService.readArticleMetadata(ingestionId).respond(request, response, entityGson); }

Target:
public void read(HttpServletRequest request, HttpServletResponse response, @PathVariable("doi") String doi, @PathVariable("number") int ingestionNumber) throws IOException { ArticleIngestionIdentifier ingestionId = ArticleIngestionIdentifier.create(DoiEscaping.unescape(doi), ingestionNumber); articleCrudService.readArticleMetadata(ingestionId).respond(request, response, entityGson); }
Source:
protected void onLoad(Bundle savedInstanceState) { Timber.v("onLoad"); ButterKnife.bind(this, getView()); setActionBar(); Person person = (Person) visit.included().get(1); Score score = visitResult.included().get(0); int points = score.attributes().pointsForKnock() + score.attributes().pointsForUpdates(); getView().animateScore(points); getView().animateLabels( score.attributes().pointsForKnock(), score.attributes().pointsForUpdates(), person.attributes().firstName()); }

Target:
protected void onLoad(Bundle savedInstanceState) { Timber.v("onLoad"); ButterKnife.bind(this, getView()); setActionBar(); getView().post(new Runnable() { @Override public void run() { String firstName = null; try { Person person = (Person) visit.included().get(1); firstName = person.attributes().firstName(); } catch (IndexOutOfBoundsException e) { Timber.e(e, "no person update found"); } Score score = visitResult.included().get(0); int points = score.attributes().pointsForKnock() + score.attributes().pointsForUpdates(); getView().animateScore(points); getView().animateLabels( score.attributes().pointsForKnock(), score.attributes().pointsForUpdates(), firstName); } }); }
Source:
public TagOperation(Repository repo, Tag tag, boolean shouldMoveTag) { this.tag = tag; this.repo = repo; tagName = tag.getTag(); this.shouldMoveTag = shouldMoveTag; refName = Constants.R_TAGS + tagName; }

Target:
public TagOperation(Repository repo, Tag tag, boolean shouldMoveTag) { this.tag = tag; this.repo = repo; this.shouldMoveTag = shouldMoveTag; }
Source:
protected IEclipseContext createContext(final Event trigger) { final IEclipseContext staticContext = EclipseContextFactory.create("keys-staticContext"); staticContext.set(Event.class, trigger); return staticContext; }

Target:
private IEclipseContext createContext(final Event trigger) { final IEclipseContext staticContext = EclipseContextFactory.create("keys-staticContext"); staticContext.set(Event.class, trigger); return staticContext; }
Source:
protected String getLockID() { return lockID; }

Target:
String getLockID() { return lockID; }
Source:
public DataSet data(DecoratedKey partitionKey) { SimpleDataSet result = new SimpleDataSet(metadata()); Config config = DatabaseDescriptor.getRawConfig(); String setting = null; try { setting = UTF8Type.instance.compose(partitionKey.getKey()); Field field = config.getClass().getDeclaredField(setting); if (!FIELDS.contains(field)) throw new InvalidRequestException("Invalid setting: " + setting); Object value = field.get(config); result.row(setting); if (value != null) result.column(VALUE, value.toString()); } catch (IllegalAccessException | IllegalArgumentException e) { throw new ServerError(e); } catch (NoSuchFieldException e) { throw new InvalidRequestException("No such setting: " + setting); } return result; }

Target:
public DataSet data(DecoratedKey partitionKey) { SimpleDataSet result = new SimpleDataSet(metadata()); String setting = UTF8Type.instance.compose(partitionKey.getKey()); Field field = FIELDS.get(setting); if (field != null) addValue(result, field); else { for (Map.Entry<String, Field> f : FIELDS.entrySet()) { if (setting.startsWith(f.getKey())) { addValue(result, f.getValue()); } } } return result; }
Source:
private void waitForTaskToBeStarted(Future<Void> taskExecutionSubmittedFuture) { try { taskExecutionSubmittedFuture.get(DOTASK_ACTION_TIMEOUT, TimeUnit.MILLISECONDS); } catch (Exception e) { logger.warn("Could not wait for the task to be started on TaskLauncher.", e); } }

Target:
private void waitForTaskToBeStarted(Future<Void> taskExecutionSubmittedFuture) { try { taskExecutionSubmittedFuture.get(DOTASK_ACTION_TIMEOUT, TimeUnit.MILLISECONDS); } catch (Exception e) { logger.warn("Error while waiting for the task to be started.", e); } }
Source:
public void onMatch(RelOptRuleCall call) { Sort sort = call.rel(0); FlinkLogicalTableSourceScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); int offset = sort.offset == null ? 0 : RexLiteral.intValue(sort.offset); int limit = offset + RexLiteral.intValue(sort.fetch); TableSourceTable newTableSourceTable = applyLimit(limit, tableSourceTable); FlinkLogicalTableSourceScan newScan = FlinkLogicalTableSourceScan.create(scan.getCluster(), newTableSourceTable); call.transformTo(sort.copy(sort.getTraitSet(), Collections.singletonList(newScan))); }

Target:
public void onMatch(RelOptRuleCall call) { Sort sort = call.rel(0); FlinkLogicalTableSourceScan scan = call.rel(1); TableSourceTable tableSourceTable = scan.getTable().unwrap(TableSourceTable.class); int offset = sort.offset == null ? 0 : RexLiteral.intValue(sort.offset); int limit = offset + RexLiteral.intValue(sort.fetch); TableSourceTable newTableSourceTable = applyLimit(limit, tableSourceTable); FlinkLogicalTableSourceScan newScan = FlinkLogicalTableSourceScan.create(scan.getCluster(), newTableSourceTable); Sort newSort = sort.copy(sort.getTraitSet(), Collections.singletonList(newScan)); call.transformTo(newSort); }
Source:
public void store(Collection<Branch> branches) throws OseeCoreException { Callable<IStatus> task = new StoreBranchDatabaseCallable(getLogger(), session, getDatabaseService(), getExecutorAdmin(), getEventService(), branches); try { IStatus status = task.call(); if (!status.isOK()) { throw new OseeStateException("Error storing branches"); } else { for (Branch branch : branches) { branch.clearDirty(); } Map<String, Object> eventData = new HashMap<String, Object>(); eventData.put(OrcsConstants.ORCS_BRANCH_EVENT_DATA, Collections.unmodifiableCollection(branches)); getEventService().sendEvent(OrcsConstants.ORCS_BRANCH_MODIFIED_EVENT, eventData); } } catch (Exception ex) { OseeExceptions.wrapAndThrow(ex); } }

Target:
public void store(Collection<Branch> branches) throws OseeCoreException { Callable<IStatus> task = new StoreBranchDatabaseCallable(getLogger(), session, getDatabaseService(), getExecutorAdmin(), getEventService(), branches); try { IStatus status = task.call(); if (status.isOK()) { for (Branch branch : branches) { branch.clearDirty(); } Map<String, Object> eventData = new HashMap<String, Object>(); eventData.put(OrcsConstants.ORCS_BRANCH_EVENT_DATA, Collections.unmodifiableCollection(branches)); getEventService().sendEvent(OrcsConstants.ORCS_BRANCH_MODIFIED_EVENT, eventData); } else { throw new OseeStateException("Error storing branches"); } } catch (Exception ex) { OseeExceptions.wrapAndThrow(ex); } }
Source:
public RoutingResponse route(Router router) { List<Itinerary> itineraries = new ArrayList<>(); List<RoutingError> routingErrors = new ArrayList<>(); try { itineraries.addAll(DirectStreetRouter.route(router, request)); } catch (Exception e) { routingErrors.add( new RoutingError( RoutingErrorCode.SYSTEM_ERROR, "An error occurred during direct street routing.", null) ); } try { itineraries.addAll(routeTransit(router)); } catch (NoStopsInRangeException e) { for (String missing : e.getMissing()) { routingErrors.add( new RoutingError( RoutingErrorCode.NO_STOPS_IN_RANGE, "Unable to find any stops in range of the location.", missing) ); } } catch (Exception e) { routingErrors.add( new RoutingError( RoutingErrorCode.SYSTEM_ERROR, "An error occurred during transit routing.", null) ); } long startTimeFiltering = System.currentTimeMillis(); itineraries = filterChain().filter(itineraries); LOG.debug("Filtering took ms", System.currentTimeMillis() - startTimeFiltering); LOG.debug("Return TripPlan with itineraries", itineraries.size()); return new RoutingResponse( TripPlanMapper.mapTripPlan(request, itineraries), responseMetadata, routingErrors ); }

Target:
public RoutingResponse route(Router router) { List<Itinerary> itineraries = new ArrayList<>(); List<RoutingError> routingErrors = new ArrayList<>(); try { itineraries.addAll(DirectStreetRouter.route(router, request)); } catch (RoutingValidationException e) { routingErrors.addAll(e.getRoutingErrors()); } try { itineraries.addAll(routeTransit(router)); } catch (RoutingValidationException e) { routingErrors.addAll(e.getRoutingErrors()); } long startTimeFiltering = System.currentTimeMillis(); itineraries = filterChain().filter(itineraries); LOG.debug("Filtering took ms", System.currentTimeMillis() - startTimeFiltering); LOG.debug("Return TripPlan with itineraries", itineraries.size()); return new RoutingResponse( TripPlanMapper.mapTripPlan(request, itineraries), responseMetadata, routingErrors ); }
Source:
private void openRowGroup() throws IOException { if (!dictionaryOpen && dictionarySize > 0) { if (dictionary.length < dictionarySize) { dictionary = new long[dictionarySize]; systemMemoryContext.setBytes(sizeOf(dictionary)); } LongInputStream dictionaryStream = dictionaryDataStreamSource.openStream(); if (dictionaryStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Dictionary is not empty but data stream is not present"); } dictionaryStream.next(dictionary, dictionarySize); if (filter != null && !nonDeterministicFilter) { dictionaryFilterStatus = ensureCapacity(dictionaryFilterStatus, dictionarySize); Arrays.fill(dictionaryFilterStatus, 0, dictionarySize, FILTER_NOT_EVALUATED); } } dictionaryOpen = true; presentStream = presentStreamSource.openStream(); inDictionaryStream = inDictionaryStreamSource.openStream(); dataStream = dataStreamSource.openStream(); rowGroupOpen = true; }

Target:
private void openRowGroup() throws IOException { if (!dictionaryOpen && dictionarySize > 0) { if (dictionary.length < dictionarySize) { dictionary = new long[dictionarySize]; } LongInputStream dictionaryStream = dictionaryDataStreamSource.openStream(); if (dictionaryStream == null) { throw new OrcCorruptionException(streamDescriptor.getOrcDataSourceId(), "Dictionary is not empty but data stream is not present"); } dictionaryStream.nextLongVector(dictionarySize, dictionary); if (filter != null && !nonDeterministicFilter) { dictionaryFilterStatus = ensureCapacity(dictionaryFilterStatus, dictionarySize); Arrays.fill(dictionaryFilterStatus, 0, dictionarySize, FILTER_NOT_EVALUATED); } } dictionaryOpen = true; presentStream = presentStreamSource.openStream(); inDictionaryStream = inDictionaryStreamSource.openStream(); dataStream = dataStreamSource.openStream(); rowGroupOpen = true; }
Source:
public <F> void testServerException() throws Exception{ SessionFactory<F> sf = mock(SessionFactory.class); CachingSessionFactory<F> csf = new CachingSessionFactory<F>(sf, 2); FileTransferringMessageHandler<F> handler = new FileTransferringMessageHandler<F>(csf); Session<F> session1 = newSession(); Session<F> session2 = newSession(); Session<F> session3 = newSession(); when(sf.getSession()).thenReturn(session1).thenReturn(session2).thenReturn(session3); handler.setRemoteDirectoryExpression(new LiteralExpression("foo")); handler.afterPropertiesSet(); for (int i = 0; i < 3; i++) { try { handler.handleMessage(new GenericMessage<String>("hello")); } catch (Exception e) { assertEquals("test", e.getCause().getCause().getMessage()); } } verify(session1, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); verify(session2, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); verify(session3, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); SimplePool<?> pool = TestUtils.getPropertyValue(csf, "pool", SimplePool.class); assertEquals(1, pool.getAllocatedCount()); assertEquals(1, pool.getIdleCount()); assertSame(session3, TestUtils.getPropertyValue(pool, "allocated", Set.class).iterator().next()); }

Target:
public <F> void testServerException() throws Exception{ SessionFactory<F> sf = mock(SessionFactory.class); CachingSessionFactory<F> csf = new CachingSessionFactory<F>(sf, 2); FileTransferringMessageHandler<F> handler = new FileTransferringMessageHandler<F>(csf); Session<F> session1 = newSession(); Session<F> session2 = newSession(); Session<F> session3 = newSession(); when(sf.getSession()).thenReturn(session1, session2, session3); handler.setRemoteDirectoryExpression(new LiteralExpression("foo")); handler.afterPropertiesSet(); for (int i = 0; i < 3; i++) { try { handler.handleMessage(new GenericMessage<String>("hello")); } catch (Exception e) { assertEquals("test", e.getCause().getCause().getMessage()); } } verify(session1, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); verify(session2, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); verify(session3, times(1)).write(Mockito.any(InputStream.class), Mockito.anyString()); SimplePool<?> pool = TestUtils.getPropertyValue(csf, "pool", SimplePool.class); assertEquals(1, pool.getAllocatedCount()); assertEquals(1, pool.getIdleCount()); assertSame(session3, TestUtils.getPropertyValue(pool, "allocated", Set.class).iterator().next()); }
Source:
public List<Offer> getOffers(String direction, String fiatCurrencyCode) { List<Offer> offers = offerBookService.getOffers().stream() .filter(o -> !o.getDirection().name().equalsIgnoreCase(direction) && o.getOfferPayload().getCounterCurrencyCode().equalsIgnoreCase(fiatCurrencyCode)) .collect(Collectors.toList()); if (direction.equals(BUY.name())) offers.sort(Comparator.comparing(Offer::getPrice)); else offers.sort(Comparator.comparing(Offer::getPrice).reversed()); return offers; }

Target:
public List<Offer> getOffers(String direction, String fiatCurrencyCode) { List<Offer> offers = offerBookService.getOffers().stream() .filter(o -> { var offerOfWantedDirection = o.getDirection().name().equalsIgnoreCase(direction); var offerInWantedCurrency = o.getOfferPayload().getCounterCurrencyCode().equalsIgnoreCase(fiatCurrencyCode); return offerOfWantedDirection && offerInWantedCurrency; }) .collect(Collectors.toList()); if (direction.equalsIgnoreCase(BUY.name())) offers.sort(Comparator.comparing(Offer::getPrice).reversed()); else offers.sort(Comparator.comparing(Offer::getPrice)); return offers; }
Source:
public Pager<Commit> getCommits(int projectId, String ref, Date since, Date until, int itemsPerPage) throws GitLabApiException { Form formData = new GitLabApiForm() .withParam("ref_name", ref) .withParam("since", ISO8601.toString(since, false)) .withParam("until", ISO8601.toString(until, false)); return (new Pager<Commit>(this, Commit.class, itemsPerPage, formData.asMap(), "projects", projectId, "repository", "commits")); }

Target:
public Pager<Commit> getCommits(int projectId, String ref, Date since, Date until, int itemsPerPage) throws GitLabApiException { return getCommits(projectId, ref, since,until, null, itemsPerPage); }
Source:
public Optional<Urlset> getChangeList(@Nullable User user, String ownerId, String dataSetId) throws IOException { Urlset changeList = null; Optional<DataSet> maybeDataSet = dataSetRepository.getDataSet(user, ownerId, dataSetId); if (maybeDataSet.isPresent()) { DataSetMetaData dataSetMetaData = maybeDataSet.get().getMetadata(); RsMd rsMd = new RsMd(Capability.CHANGELIST.xmlValue); changeList = new Urlset(rsMd) .addLink(new RsLn(REL_UP, rsUriHelper.uriForRsDocument(dataSetMetaData, Capability.CAPABILITYLIST))); UpdatedPerPatchStore updatedPerPatchStore = maybeDataSet.get().getUpdatedPerPatchStore(); ChangesRetriever changesRetriever = new ChangesRetriever( updatedPerPatchStore, null, dataSetMetaData.getBaseUri()); Supplier<List<Integer>> versionsSupplier = () -> { try (Stream<Integer> versions = updatedPerPatchStore.getVersions()) { return versions.collect(Collectors.toList()); } }; List<String> changeFileNames = changesRetriever.retrieveChangeFileNames(versionsSupplier); for (String changeFileName : changeFileNames) { UrlItem item = new UrlItem(dataSetMetaData.getBaseUri() + "/" + dataSetMetaData.getOwnerId() + "/" + dataSetMetaData.getDataSetId() + "/changes/" + changeFileName) .withMetadata(new RsMd() .withChange("updated")); changeList.addItem(item); } } return Optional.ofNullable(changeList); }

Target:
public Optional<Urlset> getChangeList(@Nullable User user, String ownerId, String dataSetId) throws IOException { Urlset changeList = null; Optional<DataSet> maybeDataSet = dataSetRepository.getDataSet(user, ownerId, dataSetId); if (maybeDataSet.isPresent()) { DataSetMetaData dataSetMetaData = maybeDataSet.get().getMetadata(); LogList loglist = maybeDataSet.get().getImportManager().getLogList(); RsMd rsMd = new RsMd(Capability.CHANGELIST.xmlValue) .withFrom(ZonedDateTime.parse(loglist.getLastImportDate())); List<LogEntry> logEntries = loglist.getEntries(); changeList = new Urlset(rsMd) .addLink(new RsLn(REL_UP, rsUriHelper.uriForRsDocument(dataSetMetaData, Capability.CAPABILITYLIST))); ChangeListBuilder changeListBuilder = new ChangeListBuilder(dataSetMetaData.getBaseUri()); ChangesRetriever changesRetriever = maybeDataSet.get().getChangesRetriever(); List<String> changeFileNames = changeListBuilder.retrieveChangeFileNames( changesRetriever.getVersions() ); for (String changeFileName : changeFileNames) { LogEntry logEntry = logEntries.get(getVersionFromFileId(changeFileName)); UrlItem item = new UrlItem(rsUriHelper.uriForChanges(dataSetMetaData, changeFileName)) .withMetadata(new RsMd() .withChange("updated") .withType("application/vnd.timbuctoo-rdf.nquads_unified_diff") .withDateTime(ZonedDateTime.parse(logEntry.getImportStatus().getDate()))); changeList.addItem(item); } } return Optional.ofNullable(changeList); }
Source:
public void dispatchInvalidateOptionsMenu() { if (BuildConfig.DEBUG) Log.d(TAG, "[dispatchInvalidateOptionsMenu]"); mActivity.getWindow().invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL); if (mMenu != null) { mMenu.invalidate(); } }

Target:
public void dispatchInvalidateOptionsMenu() { if (BuildConfig.DEBUG) Log.d(TAG, "[dispatchInvalidateOptionsMenu]"); mActivity.getWindow().invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL); if (mMenu != null) mMenu.invalidate(); }
Source:
protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() == VdcBllErrors.ImageDoesNotExistInDomainError) { getReturnValue().setFault(new VdcFault(e, e.getVdsError().getCode())); log.errorFormat("Image {0} does not exist in domain {1}. Removing disk from DB.", getDiskImage().getId(), getParameters().getStorageDomainId()); } else { throw e; } } if (getParameters().isRemoveDuringExecution() && getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { removeImageFromDB(false); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }

Target:
protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() == VdcBllErrors.ImageDoesNotExistInDomainError) { getReturnValue().setFault(new VdcFault(e, e.getVdsError().getCode())); log.errorFormat("Image {0} does not exist in domain {1}. Removing disk from DB.", getDiskImage().getId(), getParameters().getStorageDomainId()); endCommand(); } else { throw e; } } if (getParameters().isRemoveDuringExecution() && getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { removeImageFromDB(false); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }
Source:
public void checkFileCopied() { container.start(); try { String filesList = container.execInContainer("ls","/opt/mappable-resource").getStdout(); Assert.assertTrue(filesList.contains(fileName)); } catch (Exception e) { e.printStackTrace(); } }

Target:
public void checkFileCopied() throws IOException, InterruptedException { try( GenericContainer container = new GenericContainer("alpine:latest") .withCommand("sleep","3000") .withCopyFileToContainer(MountableFile.forClasspathResource("/mappable-resource/"), containerPath) ) { container.start(); String filesList = container.execInContainer("ls","/tmp/mappable-resource").getStdout(); Assert.assertTrue(filesList.contains(fileName)); } }
Source:
public void shouldReturnGeneratedToken() throws Exception { LoginInput loginInput = new LoginInput(); loginInput.setUsername("admin"); loginInput.setPassword("$2a$10$WqtVx7Iio0cndyR1lEaKW.SWhUYmF/zHHG5hkAXvH5hUmklM7QfMO"); RestAssuredMockMvc.given() .contentType("application/json") .header("Accept", "application/json") .body(loginInput) .when() .post("/api/login") .peek() .then() .body("token", CoreMatchers.any(String.class)) .body("authorities", hasSize(greaterThan(0))) .statusCode(200); }

Target:
public void shouldReturnGeneratedToken() throws Exception { LoginInput loginInput = new LoginInput(); loginInput.setUsername("admin"); loginInput.setPassword("password"); RestAssuredMockMvc.given() .contentType("application/json") .header("Accept", "application/json") .body(loginInput) .when() .post("/api/login") .peek() .then() .body("token", CoreMatchers.any(String.class)) .body("authorities", hasSize(greaterThan(0))) .statusCode(200); }
Source:
public Set<Symbol> getOut(CFG.Block block) { return ImmutableSet.copyOf(out.get(block)); }

Target:
public Set<Symbol> getOut(CFG.Block block) { return out.get(block); }
Source:
SessionPayload(Collection<SessionCount> sessionCounts, Configuration configuration) { this.sessionCounts.addAll(sessionCounts); diagnostics = new Diagnostics(configuration); }

Target:
SessionPayload(Collection<SessionCount> sessionCounts, Configuration configuration) { this.sessionCounts = sessionCounts; diagnostics = new Diagnostics(configuration); }
Source:
protected String getPagePhrase(SyntaxContainer syntax, String pageNumber) { String result = ""; Integer page = IntegerCompat.tryParse(pageNumber); if (page == null) { page = 1; } PagingType pagingType = getPagingType(); if (pagingType != null) { String pagingSyntax = Config.<String> getValue(ConfigValues.DBPagingSyntax); switch (pagingType) { case Range: result = StringFormat.format(pagingSyntax, BigInteger.valueOf((page - 1) * syntax.getMaxCount() + 1), BigInteger.valueOf(page * syntax.getMaxCount())); break; case Offset: result = StringFormat.format(pagingSyntax, BigInteger.valueOf((page - 1) * syntax.getMaxCount() + 1), syntax.getMaxCount()); break; } } return result; }

Target:
protected String getPagePhrase(SyntaxContainer syntax, String pageNumber) { String result = ""; Integer page = IntegerCompat.tryParse(pageNumber); if (page == null) { page = 1; } PagingType pagingType = getPagingType(); if (pagingType != null) { String pagingSyntax = Config.<String> getValue(ConfigValues.DBPagingSyntax); BigInteger bigPage = BigInteger.valueOf(page); BigInteger bigCount = BigInteger.valueOf(syntax.getMaxCount()); BigInteger bigX = bigPage.subtract(BigInteger.ONE).multiply(bigCount).add(BigInteger.ONE); BigInteger bigY = bigPage.multiply(bigCount); switch (pagingType) { case Range: result = StringFormat.format(pagingSyntax, bigX, bigY); break; case Offset: result = StringFormat.format(pagingSyntax, bigX, bigCount); break; } } return result; }
Source:
public Worker(WorkerAbstract worker) throws WorkerException { try { loadProperties(); } catch (IOException e) { throw new WorkerException(e); } worker.initialize(properties); worker.onStartUp(); this.worker = worker; }

Target:
public Worker(WorkerAbstract worker) throws WorkerException, GravitonCommunicationException { try { loadProperties(); } catch (IOException e) { throw new WorkerException(e); } worker.initialize(properties); worker.onStartUp(); this.worker = worker; }
Source:
public abstract void toExecute(JobExecutionContext context) throws JobExecutionException; public static JobStatus scheduleJob(JobCurator jobCurator, Scheduler scheduler, JobDetail detail, Trigger trigger) throws SchedulerException { scheduler.getListenerManager().addJobListenerMatcher( PinsetterJobListener.LISTENER_NAME, jobNameEquals(detail.getKey().getName())); JobStatus status = null; try { status = jobCurator.create(new JobStatus(detail, trigger == null)); if (trigger != null) { scheduler.scheduleJob(detail, trigger); } else { scheduler.addJob(detail, false); } } catch (EntityExistsException e) { status = jobCurator.find(detail.getKey().getName()); jobCurator.merge(status); } catch (RuntimeException e) { status.setState(JobStatus.JobState.FAILED); jobCurator.merge(status); throw e; } return status; }

Target:
public abstract void toExecute(JobExecutionContext context) throws JobExecutionException; public static JobStatus scheduleJob(JobCurator jobCurator, Scheduler scheduler, JobDetail detail, Trigger trigger) throws SchedulerException { scheduler.getListenerManager().addJobListenerMatcher( PinsetterJobListener.LISTENER_NAME, jobNameEquals(detail.getKey().getName())); JobStatus status = null; try { status = jobCurator.create(new JobStatus(detail, trigger == null)); if (trigger != null) { scheduler.scheduleJob(detail, trigger); } else { scheduler.addJob(detail, false); } } catch (EntityExistsException e) { status = jobCurator.find(detail.getKey().getName()); jobCurator.merge(status); } catch (RuntimeException e) { failStatus(jobCurator, status); throw e; } catch (SchedulerException e) { failStatus(jobCurator, status); throw e; } return status; }
Source:
public void fillMsqMinSelectableChoices(int qnNumber, String value) { WebElement inputBox = getMsqMinSelectableChoicesBox(qnNumber); String id = inputBox.getAttribute("id"); fillTextBox(browser.driver.findElement(By.id(id)), value); }

Target:
public void fillMsqMinSelectableChoices(int qnNumber, String value) { WebElement inputBox = getMsqMinSelectableChoicesBox(qnNumber); fillTextBox(inputBox, value); executeScript("$(arguments[0]).change();", inputBox); }
Source:
public void roundTripEquivalence(IonDatagram input, boolean myExpectedEquality) throws IOException { IonDatagram[] data = roundTripDatagram(input); for(int i = 0; i < data.length - 1; i++){ runEquivalenceChecks(data[i], myExpectedEquality); checkEquivalence(data[i], data[i + 1], true); } }

Target:
public void roundTripEquivalence(IonDatagram input, boolean myExpectedEquality) throws IOException { IonDatagram[] data = roundTripDatagram(input); for(int i = 0; i < data.length; i++){ runEquivalenceChecks(data[i], myExpectedEquality); checkEquivalence(data[i], data[((i + 1) % data.length)], true); } }
Source:
public JLabel getConnectingLabel(ImageIcon icon){ if(connectingLabel == null ){ connectingLabel = new JLabel(Constant.messages.getString("websocket.manual_send.try_to_reopen")); } return connectingLabel; }

Target:
public JLabel getConnectingLabel(ImageIcon icon){ if(connectingLabel == null ){ connectingLabel = new JLabel(Constant.messages.getString("websocket.manual_send.adv_dialog.connecting")); connectingLabel.setIcon(icon); } return connectingLabel; }
Source:
public Void visitEnhancedForLoop(EnhancedForLoopTree node, Void p) { AnnotatedTypeMirror var = atypeFactory.getAnnotatedTypeLhs(node.getVariable()); AnnotatedTypeMirror iteratedType = atypeFactory.getIteratedType(node.getExpression()); boolean valid = validateTypeOf(node.getVariable()); if (valid) { commonAssignmentCheck( var, iteratedType, node.getExpression(), "enhancedfor.type.incompatible"); } return super.visitEnhancedForLoop(node, p); }

Target:
public Void visitEnhancedForLoop(EnhancedForLoopTree node, Void p) { AnnotatedTypeMirror var = atypeFactory.getAnnotatedTypeLhs(node.getVariable()); AnnotatedTypeMirror iteratedType = atypeFactory.getIterableElementType(node.getExpression()); boolean valid = validateTypeOf(node.getVariable()); if (valid) { commonAssignmentCheck( var, iteratedType, node.getExpression(), "enhancedfor.type.incompatible"); } return super.visitEnhancedForLoop(node, p); }
Source:
public static void updateNewNodeName(final Graph<?, Node> graph, final DMNModelInstrumentedBase dmnModel) { if (dmnModel instanceof BusinessKnowledgeModel) { updateBusinessKnowledgeModelDefaultName(graph, (BusinessKnowledgeModel) dmnModel); } else if (dmnModel instanceof Decision) { updateDecisionDefaultName(graph, (Decision) dmnModel); } else if (dmnModel instanceof InputData) { updateInputDataDefaultName(graph, (InputData) dmnModel); } else if (dmnModel instanceof KnowledgeSource) { updateKnowledgeSourceDefaultName(graph, (KnowledgeSource) dmnModel); } else if (dmnModel instanceof TextAnnotation) { updateTextAnnotationDefaultText(graph, (TextAnnotation) dmnModel); } else { throw new IllegalArgumentException("Default Name for '" + dmnModel.getClass().getSimpleName() + "' is not support."); } }

Target:
public static void updateNewNodeName(final Graph<?, Node> graph, final DMNModelInstrumentedBase dmnModel) { if (dmnModel instanceof BusinessKnowledgeModel) { updateBusinessKnowledgeModelDefaultName(graph, (BusinessKnowledgeModel) dmnModel); } else if (dmnModel instanceof Decision) { updateDecisionDefaultName(graph, (Decision) dmnModel); } else if (dmnModel instanceof InputData) { updateInputDataDefaultName(graph, (InputData) dmnModel); } else if (dmnModel instanceof KnowledgeSource) { updateKnowledgeSourceDefaultName(graph, (KnowledgeSource) dmnModel); } else if (dmnModel instanceof TextAnnotation) { updateTextAnnotationDefaultText(graph, (TextAnnotation) dmnModel); } else { throw new IllegalArgumentException("Default Name for '" + dmnModel.getClass().getSimpleName() + "' is not supported."); } }
Source:
private static synchronized @NonNull List<@NonNull URL> getExtraXsdFiles() { IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(TMF_XSD_BUILTIN_ID); List<@NonNull URL> list = new ArrayList<>(); for (IConfigurationElement element : elements) { if (element.getName().equals(XSD_FILE_ELEMENT)) { final String filename = element.getAttribute(XSD_FILE_ATTRIB); final String name = element.getContributor().getName(); SafeRunner.run(new ISafeRunnable() { @Override public void run() throws IOException { if (name != null) { Bundle bundle = Platform.getBundle(name); if (bundle != null) { URL xmlUrl = bundle.getResource(filename); if (xmlUrl == null) { throw new FileNotFoundException(filename); } URL locatedURL = FileLocator.toFileURL(xmlUrl); list.add(NonNullUtils.checkNotNull(locatedURL)); } } } @Override public void handleException(Throwable exception) { } }); } } return list; }

Target:
private static synchronized @NonNull List<@NonNull URL> getExtraXsdFiles() { return getUrlsFromConfiguration(TMF_XSD_ID, XSD_FILE_ELEMENT, XSD_FILE_ATTRIB); }
Source:
static AutomationScriptingParamsInjector newInstance(boolean inlinedContext) { if (inlinedContext) { return new AutomationScriptingParamsInjector() { @Override public void inject(Map<String,Object> parms, OperationContext ctx, ScriptingOperationDescriptor desc) { parms.putAll(ctx); } }; } return new AutomationScriptingParamsInjector() { @Override public void inject(Map<String,Object> parms, OperationContext ctx, ScriptingOperationDescriptor desc) { Arrays.stream(desc.getParams()).map(Param::getName).filter(name -> ctx.containsKey(name)) .forEach(name -> parms.put(name, ctx.get(name))); } }; }

Target:
public static AutomationScriptingParamsInjector newInstance(boolean inlinedContext) { if (inlinedContext) { return (params, ctx, desc) -> params.putAll(ctx); } return (params, ctx, desc) -> Arrays.stream(desc.getParams()).map(Param::getName).filter(ctx::containsKey) .forEach(name -> params.put(name, ctx.get(name))); }
Source:
public CatalogQueryScan(final String sql, final Schema outputSchema, final MasterCatalog catalog) { Objects.requireNonNull(sql); Objects.requireNonNull(outputSchema); Objects.requireNonNull(catalog); this.sql = sql; this.outputSchema = outputSchema; this.catalog = catalog; tuples = null; }

Target:
public CatalogQueryScan(final String sql, final Schema outputSchema, final MasterCatalog catalog) { this.sql = Objects.requireNonNull(sql);; this.outputSchema = Objects.requireNonNull(outputSchema); this.catalog = Objects.requireNonNull(catalog); }
Source:
protected void addDCValue(Context c, Item i, String schema, Node n) throws TransformerException, SQLException, AuthorizeException { String value = getStringValue(n); if (value == null) { value = ""; } else { value = value.trim(); } String element = getAttributeValue(n, "element"); String qualifier = getAttributeValue(n, "qualifier"); String language = null; if (!"".equals(getAttributeValue(n, "language"))){ language = getAttributeValue(n, "language"); } if (language != null) { language = language.trim(); } if (!isQuiet) { System.out.println("\tSchema: " + schema + " Element: " + element + " Qualifier: " + qualifier + " Value: " + value); } if ("none".equals(qualifier) || "".equals(qualifier)) { qualifier = null; } if (!isTest && !value.equals("")) { itemService.addMetadata(c, i, schema, element, qualifier, language, value); } else { MetadataSchema foundSchema = metadataSchemaService.find(c,schema); if (foundSchema == null) { System.out.println("ERROR: schema '"+schema+"' was not found in the registry."); return; } MetadataField foundField = metadataFieldService.findByElement(c, foundSchema, element, qualifier); if (foundField == null) { System.out.println("ERROR: Metadata field: '"+schema+"."+element+"."+qualifier+"' was not found in the registry."); return; } } }

Target:
protected void addDCValue(Context c, Item i, String schema, Node n) throws TransformerException, SQLException, AuthorizeException { String value = getStringValue(n); if (value == null) { value = ""; } else { value = value.trim(); } String element = getAttributeValue(n, "element"); String qualifier = getAttributeValue(n, "qualifier"); String language = null; if (StringUtils.isNotBlank(getAttributeValue(n, "language"))){ language = getAttributeValue(n, "language").trim(); } if (!isQuiet) { System.out.println("\tSchema: " + schema + " Element: " + element + " Qualifier: " + qualifier + " Value: " + value); } if ("none".equals(qualifier) || "".equals(qualifier)) { qualifier = null; } if (!isTest && !value.equals("")) { itemService.addMetadata(c, i, schema, element, qualifier, language, value); } else { MetadataSchema foundSchema = metadataSchemaService.find(c,schema); if (foundSchema == null) { System.out.println("ERROR: schema '"+schema+"' was not found in the registry."); return; } MetadataField foundField = metadataFieldService.findByElement(c, foundSchema, element, qualifier); if (foundField == null) { System.out.println("ERROR: Metadata field: '"+schema+"."+element+"."+qualifier+"' was not found in the registry."); return; } } }
Source:
private HttpRequestBase setContent(HttpEntityEnclosingRequestBase req, String content, String mediaType) { if (content != null) req.setEntity(new StringEntity(content, HTTP.DEF_CONTENT_CHARSET)); return req; }

Target:
private HttpRequestBase setContent(HttpEntityEnclosingRequestBase req, String content, String mediaType) { if (content != null) { if (!mediaType.equals(MediaType.TEXT_PLAIN)) { throw new IllegalArgumentException("RequestBuilder: the only supported content type is " + mediaType); } req.setEntity(new StringEntity(content, HTTP.DEF_CONTENT_CHARSET)); } return req; }
Source:
public LlapDaemonProtocolProtos.EvictEntityResponseProto evictEntity( RpcController controller, LlapDaemonProtocolProtos.EvictEntityRequestProto protoRequest) throws ServiceException { LlapDaemonProtocolProtos.EvictEntityResponseProto.Builder responseProtoBuilder = LlapDaemonProtocolProtos.EvictEntityResponseProto.newBuilder(); LlapIo<?> llapIo = LlapProxy.getIo(); if (llapIo != null) { llapIo.evictEntity(protoRequest); responseProtoBuilder.setAck(true); } else { responseProtoBuilder.setAck(false); } return responseProtoBuilder.build(); }

Target:
public LlapDaemonProtocolProtos.EvictEntityResponseProto evictEntity( RpcController controller, LlapDaemonProtocolProtos.EvictEntityRequestProto protoRequest) throws ServiceException { LlapDaemonProtocolProtos.EvictEntityResponseProto.Builder responseProtoBuilder = LlapDaemonProtocolProtos.EvictEntityResponseProto.newBuilder(); LlapIo<?> llapIo = LlapProxy.getIo(); if (llapIo != null) { long evicted = llapIo.evictEntity(protoRequest); responseProtoBuilder.setEvictedBytes(evicted); } else { responseProtoBuilder.setEvictedBytes(-1L); } return responseProtoBuilder.build(); }
Source:
protected void aggregateUpdate(Direction direction, Tuple updateElement, Tuple signature, boolean change) { Collection<Tuple> currentGroup = projection.get(signature); Object oldAggregate = mainAggregates.get(signature); Object safeOldAggregate = oldAggregate == null ? aggregateGroup(signature, null) : oldAggregate; boolean empty = currentGroup == null || currentGroup.isEmpty(); Object newAggregate = empty ? null : aggregateGroupAfterUpdate(signature, currentGroup, safeOldAggregate , direction, updateElement, change); if (!empty) mainAggregates.put(signature, newAggregate); else mainAggregates.remove(signature); Tuple oldTuple = packResult(signature, safeOldAggregate); Tuple newTuple = packResult(signature, newAggregate == null ? aggregateGroup(signature, null) : newAggregate); if (oldAggregate != null) propagateUpdate(Direction.REVOKE, oldTuple, null); if (newAggregate != null) propagateUpdate(Direction.INSERT, newTuple, null); if (aggregatorOuterIndexer != null) aggregatorOuterIndexer.propagate(signature, oldTuple, newTuple); if (aggregatorOuterIdentityIndexers != null) for (AggregatorOuterIdentityIndexer aggregatorOuterIdentityIndexer : aggregatorOuterIdentityIndexers) if (aggregatorOuterIdentityIndexer != null) aggregatorOuterIdentityIndexer.propagate(signature, oldTuple, newTuple); }

Target:
protected void aggregateUpdate(Direction direction, Tuple updateElement, Tuple signature, boolean change) { Collection<Tuple> currentGroup = projection.get(signature); Object oldAggregate = mainAggregates.get(signature); Object safeOldAggregate = oldAggregate == null ? aggregateGroup(signature, null) : oldAggregate; boolean empty = currentGroup == null || currentGroup.isEmpty(); Object newAggregate = empty ? null : aggregateGroupAfterUpdate(signature, currentGroup, safeOldAggregate , direction, updateElement, change); if (!empty) mainAggregates.put(signature, newAggregate); else mainAggregates.remove(signature); Tuple oldTuple = packResult(signature, safeOldAggregate); Tuple newTuple = packResult(signature, newAggregate == null ? aggregateGroup(signature, null) : newAggregate); if (oldAggregate != null) propagateUpdate(Direction.REVOKE, oldTuple, DifferentialTimestamp.ZERO); if (newAggregate != null) propagateUpdate(Direction.INSERT, newTuple, DifferentialTimestamp.ZERO); if (aggregatorOuterIndexer != null) aggregatorOuterIndexer.propagate(signature, oldTuple, newTuple); if (aggregatorOuterIdentityIndexers != null) for (AggregatorOuterIdentityIndexer aggregatorOuterIdentityIndexer : aggregatorOuterIdentityIndexers) if (aggregatorOuterIdentityIndexer != null) aggregatorOuterIdentityIndexer.propagate(signature, oldTuple, newTuple); }
Source:
public void changeConfigFile(String configName) { for (LoggerContext context: loggerContexts) { LogManager.getFactory().removeContext(context); } configFile = configName != null ? URI.create(configName) : null; clearLoadedLoggers(); }

Target:
public void changeConfigFile(String configName) { for (LoggerContext context: loggerContexts) { LogManager.getFactory().removeContext(context); } configFile = configName != null ? URI.create(configName) : null; clearLoadedLoggers(); loggerContexts.clear(); }
Source:
public MEMORY_BASIC_INFORMATION64() { }

Target:
public MEMORY_BASIC_INFORMATION64() { super(); }
Source:
public void testGetVMsForStorageDomain() { dao = dbFacade.getUnregisteredOVFDataDao(); List<OvfEntityData> ovfEntityDataList = dao.getAllForStorageDomain(FixturesTool.STORAGE_DOAMIN_NFS2_1, "VM"); assertTrue("a VM should be fetched for the specified storage domain", !ovfEntityDataList.isEmpty()); }

Target:
public void testGetVMsForStorageDomain() { dao = dbFacade.getUnregisteredOVFDataDao(); List<OvfEntityData> ovfEntityDataList = dao.getAllForStorageDomainByEntityType(FixturesTool.STORAGE_DOAMIN_NFS2_1, "VM"); assertTrue("A VM should be fetched for the specified storage domain", !ovfEntityDataList.isEmpty()); }
Source:
public ICubePrimer generateCube(int cubeX, int cubeY, int cubeZ) { ICubePrimer primer = new CubePrimer(); int floorY = cubeY * Cube.SIZE; int topY = (cubeY + 1) * Cube.SIZE; NavigableMap<Integer, Layer> cubeLayerSubMap = conf.layers.subMap(conf.layers.floorKey(floorY), true, topY, false); for (Entry<Integer, Layer> entry : cubeLayerSubMap.entrySet()) { Layer layer = entry.getValue(); int fromY = layer.fromY - floorY; int toY = layer.toY - floorY; IBlockState iBlockState = layer.blockState; for (int y = fromY > 0 ? fromY : 0; y < (toY < 16 ? toY : 16); y++) { for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { primer.setBlockState(x, y, z, iBlockState); } } } } return primer; }

Target:
public ICubePrimer generateCube(int cubeX, int cubeY, int cubeZ) { ICubePrimer primer = new CubePrimer(); int floorY = Coords.cubeToMinBlock(cubeY); int topY = Coords.cubeToMinBlock(cubeY + 1); NavigableMap<Integer, Layer> cubeLayerSubMap = conf.layers.subMap(conf.layers.floorKey(floorY), true, topY, false); for (Entry<Integer, Layer> entry : cubeLayerSubMap.entrySet()) { Layer layer = entry.getValue(); int fromY = layer.fromY - floorY; int toY = layer.toY - floorY; IBlockState iBlockState = layer.blockState; for (int y = fromY > 0 ? fromY : 0; y < (toY < 16 ? toY : 16); y++) { for (int x = 0; x < 16; x++) { for (int z = 0; z < 16; z++) { primer.setBlockState(x, y, z, iBlockState); } } } } return primer; }