auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Map<String, Object> parseResponse(HttpResponse response) throws HttpResponseException, IOException { final StatusLine statusLine = response.getStatusLine(); if (statusLine.getStatusCode() >= 300) { logger.error(String.format("unable to parse response as the response status is %s", statusLine.getStatusCode())); throw new HttpResponseException(statusLine.getStatusCode(), statusLine.getReasonPhrase()); } final HttpEntity entity = response.getEntity(); if (null != entity){ Object returnVal = JSONUtils.parseJSONFromString(EntityUtils.toString(entity)); if (null!= returnVal){ return (Map<String, Object>) returnVal; } } return null; }

Target:
protected Map<String, Object> parseResponse(HttpResponse response) throws HttpResponseException, IOException { final StatusLine statusLine = response.getStatusLine(); String responseBody = response.getEntity() != null ? EntityUtils.toString(response.getEntity()) : ""; if (statusLine.getStatusCode() >= 300) { logger.error(String.format("unable to parse response as the response status is %s", statusLine.getStatusCode())); throw new HttpResponseException(statusLine.getStatusCode(),responseBody); } final HttpEntity entity = response.getEntity(); if (null != entity){ Object returnVal = JSONUtils.parseJSONFromString(EntityUtils.toString(entity)); if (null!= returnVal){ return (Map<String, Object>) returnVal; } } return new HashMap<String, Object>() ; }
Source:
public void checkLanguageServerInitialized() { projectExplorer.waitAndSelectItem(PROJECT_NAME); projectExplorer.openItemByPath(PROJECT_NAME); projectExplorer.openItemByPath(PATH_TO_GO_FILE); editor.waitTabIsPresent(GO_FILE_NAME); consoles.selectProcessByTabName("dev-machine"); consoles.waitExpectedTextIntoConsole(LS_INIT_MESSAGE); }

Target:
public void checkLanguageServerInitialized() { projectExplorer.expandPathInProjectExplorerAndOpenFile(PROJECT_NAME, GO_FILE_NAME); editor.waitTabIsPresent(GO_FILE_NAME); consoles.selectProcessByTabName("dev-machine"); consoles.waitExpectedTextIntoConsole(LS_INIT_MESSAGE); }
Source:
public boolean containsApplication(String applicationName) { return getDriver().findElementsWithoutWaiting(By.xpath( " }

Target:
public boolean containsApplication(String applicationName) { return getDriver().hasElementWithoutWaiting(applicationElement(applicationName)); }
Source:
public void updateView() { mLocalMapList = mOffline.getAllUpdateInfo(); if (mLocalMapList == null) { mLocalMapList = new ArrayList<MKOLUpdateElement>(); } mLAdapter.notifyDataSetChanged(); }

Target:
public void updateView() { mLocalMapList = mOffline.getAllUpdateInfo(); if (mLocalMapList == null) { mLocalMapList = Collections.emptyList();; } mLAdapter.notifyDataSetChanged(); }
Source:
public Sequence<T> run(final Query<T> query) { DataSource dataSource = query.getDataSource(); if (dataSource instanceof UnionDataSource) { return new MergeSequence<T>( toolChest.getOrdering(), Sequences.simple( Lists.transform( ((UnionDataSource) dataSource).getDataSources(), new Function<DataSource, Sequence<T>>() { @Override public Sequence<T> apply(DataSource singleSource) { return baseRunner.run( query.withDataSource(singleSource) ); } } ) ) ); } else { return baseRunner.run(query); } }

Target:
public Sequence<T> run(final Query<T> query) { DataSource dataSource = query.getDataSource(); if (dataSource instanceof UnionDataSource) { return toolChest.mergeSequencesUnordered( Sequences.simple( Lists.transform( ((UnionDataSource) dataSource).getDataSources(), new Function<DataSource, Sequence<T>>() { @Override public Sequence<T> apply(DataSource singleSource) { return baseRunner.run( query.withDataSource(singleSource) ); } } ) ) ); } else { return baseRunner.run(query); } }
Source:
public String toString() { if (isValid()) { String longitude = ("" + coordinates.get(0)).contains(".") ? "" + coordinates.get(0) : "" + coordinates.get(0) + ".0"; String latitude = ("" + coordinates.get(1)).contains(".") ? "" + coordinates.get(1) : "" + coordinates.get(1) + ".0"; return String.format( Locale.US, "{type=Point, coordinates=[%s, %s], crs={%s}}", "" + longitude, latitude, coordinateSystem.toString()); } return ""; }

Target:
public String toString() { if (isValid()) { String longitude = Double.toString(coordinates.get(0)); String latitude = Double.toString(coordinates.get(1)); return String.format( Locale.ROOT, "{type=Point, coordinates=[%s, %s], crs={%s}}", "" + longitude, latitude, coordinateSystem); } return ""; }
Source:
public void onApplicationEvent(ContextRefreshedEvent event) { ConfigurableApplicationContext source = (ConfigurableApplicationContext) event.getSource(); if (!source.isRunning()) { source.start(); } }

Target:
public void onApplicationEvent(ContextRefreshedEvent event) { ConfigurableApplicationContext source = (ConfigurableApplicationContext) event.getSource(); if (source == this.applicationContext && !source.isRunning()) { source.start(); } }
Source:
public Media(final String filename) { pageId = UUID.randomUUID().toString(); this.filename = filename; }

Target:
public Media(final String filename) { this(); this.filename = filename; }
Source:
public void earlyStartup() { if (Boolean.getBoolean(SYSPROP_DISABLE_AERI)) { return; } new Job(Messages.JOB_NAME_INITIALIZING_AERI) { @Override protected IStatus run(IProgressMonitor monitor) { monitor.beginTask(Messages.TASK_NAME_INITIALIZING_AERI, IProgressMonitor.UNKNOWN); IEclipseContext aeriContext = initializeIdeContext(); IDEWorkflow dispatcher = aeriContext.get(IDEWorkflow.class); LogListener listener = aeriContext.get(LogListener.class); Platform.addLogListener(listener); if (!SystemControl.getSystemSettings().isConfigured() || !SystemControl.getSystemSettings().isDisableEclipseCrashDetection()) { scheduleHsErrCheck(listener); } monitor.done(); return Status.OK_STATUS; } }.schedule(); }

Target:
public void earlyStartup() { if (Boolean.getBoolean(SYSPROP_DISABLE_AERI)) { return; } new Job(Messages.JOB_NAME_INITIALIZING_AERI) { @Override protected IStatus run(IProgressMonitor monitor) { monitor.beginTask(Messages.TASK_NAME_INITIALIZING_AERI, IProgressMonitor.UNKNOWN); IEclipseContext aeriContext = initializeIdeContext(); IDEWorkflow dispatcher = aeriContext.get(IDEWorkflow.class); LogListener listener = aeriContext.get(LogListener.class); Platform.addLogListener(listener); if (!SystemControl.getSystemSettings().isConfigured() || !SystemControl.getSystemSettings().isDisableJvmCrashDetection()) { scheduleHsErrCheck(listener); } monitor.done(); return Status.OK_STATUS; } }.schedule(); }
Source:
private void snapshotAndWait(final String snapShotName, final TableName tableName) throws Exception{ admin.snapshot(snapShotName, tableName); LOG.info("Sleep for one second, waiting for HDFS Acl setup"); Threads.sleep(1000); }

Target:
private void snapshotAndWait(final String snapShotName, final TableName tableName) throws Exception{ admin.snapshot(snapShotName, tableName); LOG.info("Sleep for three seconds, waiting for HDFS Acl setup"); Threads.sleep(3000); }
Source:
public void checkThatTypeDeclarationRetrievedFromDataTypeFragmentImplementsMostSpecializedTypeDeclarationInterface() throws IOException { File input = new File("src/test/resources/org/raml/v2/api/v10/xml-external/input.raml"); assertTrue(input.isFile()); RamlModelResult ramlModelResult = new RamlModelBuilder().buildApi(input); assertFalse(ramlModelResult.hasErrors()); Api apiV10 = ramlModelResult.getApiV10(); Assert.assertTrue(((XMLTypeDeclaration) apiV10.resources().get(0).methods().get(0).body().get(0)).schemaPath().endsWith("person-schema.xsd")); }

Target:
public void checkThatTypeDeclarationRetrievedFromDataTypeFragmentImplementsMostSpecializedTypeDeclarationInterface() throws IOException { File input = new File("src/test/resources/org/raml/v2/api/v10/xml-external/input.raml"); Assert.assertTrue(input.isFile()); RamlModelResult ramlModelResult = new RamlModelBuilder().buildApi(input); Assert.assertTrue(ramlModelResult.hasErrors()); Api apiV10 = ramlModelResult.getApiV10(); Assert.assertTrue(((XMLTypeDeclaration) apiV10.resources().get(0).methods().get(0).body().get(0)).schemaPath().endsWith("person-schema.xsd")); }
Source:
public static DateTime fromServerFormatted(String date) { StringBuilder builder = new StringBuilder(); builder.append(date); int periodIndex = date.lastIndexOf("."); int zIndex = date.lastIndexOf("Z"); if (zIndex < 0) { builder.append("Z"); zIndex = date.length(); } if (periodIndex < 0) { builder.insert(zIndex, "."); periodIndex = zIndex; zIndex++; } date = builder.toString(); String millis = date.substring(periodIndex + 1, zIndex); millis = getPaddedMilliseconds(millis); builder.replace(periodIndex + 1, zIndex, millis); date = builder.toString(); DateTime dateTime = null; try { dateTime = DateTime.parse(date, FORMATTER_FROM_SERVER); } catch (IllegalArgumentException e) { Log.e(TAG, "Server sent an invalid date format: " + date, e); } return dateTime; }

Target:
public static DateTime fromServerFormatted(String date) { StringBuilder builder = new StringBuilder(date); int periodIndex = date.lastIndexOf("."); int zIndex = date.lastIndexOf("Z"); if (zIndex < 0) { builder.append("Z"); zIndex = date.length(); } if (periodIndex < 0) { builder.insert(zIndex, "."); periodIndex = zIndex; zIndex++; } date = builder.toString(); String millis = date.substring(periodIndex + 1, zIndex); millis = getPaddedMilliseconds(millis); builder.replace(periodIndex + 1, zIndex, millis); date = builder.toString(); DateTime dateTime = null; try { dateTime = DateTime.parse(date, FORMATTER_FROM_SERVER); } catch (IllegalArgumentException e) { Log.e(TAG, "Server sent an invalid date format: " + date, e); } return dateTime; }
Source:
public void whenSchemaHasRefToOtherSchemaRootItShouldLoadTheTypes() throws Exception { URL jsonSchemaResource = getClass().getClassLoader().getResource("jsonSchema/jsonSchemaWithRefToRoot.json"); MetaDataModel metaDataModel = modelFactory.buildModel(jsonSchemaResource); Assert.assertThat(metaDataModel, CoreMatchers.instanceOf(DefaultStructuredMetadataModel.class)); DefaultStructuredMetadataModel model = (DefaultStructuredMetadataModel) metaDataModel; Assert.assertThat(model.getFields().size(), CoreMatchers.is(1)); Assert.assertThat(model.getFields().get(0).getName(), CoreMatchers.is("position")); Assert.assertThat(model.getFields().get(0).getMetaDataModel().getDataType(), CoreMatchers.is(DataType.JSON)); Assert.assertThat(model.getFields().get(0).getMetaDataModel(), CoreMatchers.instanceOf(DefaultStructuredMetadataModel.class)); assertWarehouseLocationModel((DefaultStructuredMetadataModel) model.getFields().get(0).getMetaDataModel()); }

Target:
public void whenSchemaHasRefToOtherSchemaRootItShouldLoadTheTypes() throws Exception { URL jsonSchemaResource = getClass().getClassLoader().getResource("jsonSchema/jsonSchemaWithRefToRoot.json"); MetaDataModel metaDataModel = modelFactory.buildModel(jsonSchemaResource); Assert.assertThat(metaDataModel, CoreMatchers.instanceOf(DefaultStructuredMetadataModel.class)); DefaultStructuredMetadataModel model = (DefaultStructuredMetadataModel) metaDataModel; Assert.assertThat(model.getFields(), IsCollectionWithSize.hasSize(1)); Assert.assertThat(model.getFields().get(0).getName(), CoreMatchers.is("position")); Assert.assertThat(model.getFields().get(0).getMetaDataModel().getDataType(), CoreMatchers.is(DataType.JSON)); Assert.assertThat(model.getFields().get(0).getMetaDataModel(), CoreMatchers.instanceOf(DefaultStructuredMetadataModel.class)); assertWarehouseLocationModel((DefaultStructuredMetadataModel) model.getFields().get(0).getMetaDataModel()); }
Source:
public void renderHead(final IHeaderResponse response) { super.renderHead(response); final List<HeaderItem> depItemList = new ArrayList<>(); final JavaScriptContentHeaderItem chartScriptItem = new JavaScriptContentHeaderItem(toJavaScript(), getScriptId(), null) { @Override public List<HeaderItem> getDependencies() { return depItemList; } }; if (loader == null) { response.render(JavaScriptHeaderItem.forUrl(LOADER_URL)); } else { depItemList.add(loader.getHeaderItem()); } response.render(chartScriptItem); if (responsive) { final JavaScriptReferenceHeaderItem jQueryHeaderItem = JavaScriptHeaderItem.forReference( getApplication().getJavaScriptLibrarySettings().getJQueryReference()); response.render(new JavaScriptContentHeaderItem(createRedrawJavaScript(), getRedrawScriptId(), null) { @Override public List<HeaderItem> getDependencies() { final List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(jQueryHeaderItem); return dependencies; } }); } }

Target:
public void renderHead(final IHeaderResponse response) { super.renderHead(response); final List<HeaderItem> depItemList = new ArrayList<>(); final JavaScriptContentHeaderItem chartScriptItem = new JavaScriptContentHeaderItem(toJavaScript(), getScriptId(), null) { private static final long serialVersionUID = 1L; @Override public List<HeaderItem> getDependencies() { return depItemList; } }; if (loader == null) { response.render(createLoaderItem()); } else { depItemList.add(loader.getHeaderItem()); } response.render(chartScriptItem); if (responsive) { final JavaScriptReferenceHeaderItem jQueryHeaderItem = JavaScriptHeaderItem.forReference( getApplication().getJavaScriptLibrarySettings().getJQueryReference()); response.render(new JavaScriptContentHeaderItem(createRedrawJavaScript(), getRedrawScriptId(), null) { private static final long serialVersionUID = 1L; @Override public List<HeaderItem> getDependencies() { final List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(jQueryHeaderItem); return dependencies; } }); } }
Source:
public void VisualEditorEditing_002_delete() { String removeText = "Lorem"; ArticlePageObject article = base.openArticleByName(wikiURL, articleName); VisualEditorPageObject ve = article.openVEModeWithMainEditButton(); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve.removeText(removeText); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyDeletedDiffs(wikiTexts); saveDialog = reviewDialog.clickReturnToSaveFormButton(); article = saveDialog.savePage(); article.verifyVEPublishComplete(); article.logOut(wikiURL); }

Target:
public void VisualEditorEditing_002_delete() { String removeText = "Lorem"; ArticlePageObject article = base.openArticleByName(wikiURL, articleName); VisualEditorPageObject ve = article.openVEModeWithMainEditButton(); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve.removeText(removeText); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyDeletedDiffs(wikiTexts); saveDialog = reviewDialog.clickReturnToSaveFormButton(); article = saveDialog.savePage(); article.verifyVEPublishComplete(); }
Source:
public BitArray encode() { State initialState = State.INITIAL_STATE; if (null != charset) { CharacterSetECI eci = CharacterSetECI.getCharacterSetECI(charset); if (null == eci) { throw new IllegalArgumentException("No ECI code for character set " + charset.toString()); } initialState = initialState.appendFLGn(eci.getValue()); } Collection<State> states = Collections.singletonList(initialState); for (int index = 0; index < text.length; index++) { int pairCode; int nextChar = index + 1 < text.length ? text[index + 1] : 0; switch (text[index]) { case '\r': pairCode = nextChar == '\n' ? 2 : 0; break; case '.' : pairCode = nextChar == ' ' ? 3 : 0; break; case ',' : pairCode = nextChar == ' ' ? 4 : 0; break; case ':' : pairCode = nextChar == ' ' ? 5 : 0; break; default: pairCode = 0; } if (pairCode > 0) { states = updateStateListForPair(states, index, pairCode); index++; } else { states = updateStateListForChar(states, index); } } State minState = Collections.min(states, new Comparator<State>() { @Override public int compare(State a, State b) { return a.getBitCount() - b.getBitCount(); } }); return minState.toBitArray(text); }

Target:
public BitArray encode() { State initialState = State.INITIAL_STATE; if (charset != null) { CharacterSetECI eci = CharacterSetECI.getCharacterSetECI(charset); if (null == eci) { throw new IllegalArgumentException("No ECI code for character set " + charset.toString()); } initialState = initialState.appendFLGn(eci.getValue()); } Collection<State> states = Collections.singletonList(initialState); for (int index = 0; index < text.length; index++) { int pairCode; int nextChar = index + 1 < text.length ? text[index + 1] : 0; switch (text[index]) { case '\r': pairCode = nextChar == '\n' ? 2 : 0; break; case '.' : pairCode = nextChar == ' ' ? 3 : 0; break; case ',' : pairCode = nextChar == ' ' ? 4 : 0; break; case ':' : pairCode = nextChar == ' ' ? 5 : 0; break; default: pairCode = 0; } if (pairCode > 0) { states = updateStateListForPair(states, index, pairCode); index++; } else { states = updateStateListForChar(states, index); } } State minState = Collections.min(states, new Comparator<State>() { @Override public int compare(State a, State b) { return a.getBitCount() - b.getBitCount(); } }); return minState.toBitArray(text); }
Source:
private void updateBranches(Sender sender, BranchEvent branchEvent) { BranchEventType eventType = branchEvent.getEventType(); Branch branch = null; try { switch (eventType) { case Committing: case CommitFailed: case Deleting: case Purging: return; case Committed: branch = BranchManager.getBranchByGuid(branchEvent.getBranchGuid()); Artifact artifact = BranchManager.getAssociatedArtifact(branch); TransactionManager.clearCommitArtifactCacheForAssociatedArtifact(artifact); break; case Purged: branch = BranchManager.getBranchByGuid(branchEvent.getBranchGuid()); branch.setBranchState(BranchState.PURGED); branch.setArchived(true); BranchManager.decache(branch); BranchManager.refreshBranches(); break; case Deleted: branch = BranchManager.getBranchByGuid(branchEvent.getBranchGuid()); branch.setBranchState(BranchState.DELETED); branch.setArchived(true); BranchManager.decache(branch); BranchManager.refreshBranches(); break; default: break; } BranchManager.refreshBranches(); } catch (Exception ex) { EventUtil.eventLog("REM: updateBranches", ex); } }

Target:
private void updateBranches(Sender sender, BranchEvent branchEvent) { BranchEventType eventType = branchEvent.getEventType(); Branch branch = null; try { switch (eventType) { case Committing: case CommitFailed: case Deleting: case Purging: return; case Committed: branch = BranchManager.getBranchByGuid(branchEvent.getBranchGuid()); Artifact artifact = BranchManager.getAssociatedArtifact(branch); TransactionManager.clearCommitArtifactCacheForAssociatedArtifact(artifact); break; case Purged: branch = BranchManager.getBranchByGuid(branchEvent.getBranchGuid()); branch.setBranchState(BranchState.PURGED); branch.setArchived(true); branch.clearDirty(); BranchManager.decache(branch); break; case Deleted: branch = BranchManager.getBranchByGuid(branchEvent.getBranchGuid()); branch.setBranchState(BranchState.DELETED); branch.setArchived(true); branch.clearDirty(); BranchManager.decache(branch); break; default: break; } BranchManager.refreshBranches(); } catch (Exception ex) { EventUtil.eventLog("REM: updateBranches", ex); } }
Source:
private boolean inSameLogicalSlotSharingGroup( final ExecutionVertexID executionVertexId1, final ExecutionVertexID executionVertexId2) { final SlotSharingGroupId slotSharingGroupId1 = slotSharingGroupMap.get(executionVertexId1.getJobVertexId()); final SlotSharingGroupId slotSharingGroupId2 = slotSharingGroupMap.get(executionVertexId2.getJobVertexId()); return slotSharingGroupId1 != null && slotSharingGroupId1.equals(slotSharingGroupId2); }

Target:
private boolean inSameLogicalSlotSharingGroup( final ExecutionVertexID executionVertexId1, final ExecutionVertexID executionVertexId2) { return Objects.equals(getSlotSharingGroupId(executionVertexId1), getSlotSharingGroupId(executionVertexId2)); }
Source:
public RepositoryCommitRequestBuilder(String repositoryId) { this.repositoryId = repositoryId; }

Target:
protected RepositoryCommitRequestBuilder(String repositoryId) { this.repositoryId = repositoryId; }
Source:
public void testProcessScheduledMessageFailed() { final ResponseMessageResultType result = ResponseMessageResultType.NOT_OK; final Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, 1); final Date scheduledRetryTime = calendar.getTime(); final RetryHeader retryHeader = new RetryHeader(this.getMaxRetryCount, this.getMaxRetryCount, scheduledRetryTime); final ProtocolResponseMessage message = new ProtocolResponseMessage.Builder() .deviceMessageMetadata(DEVICE_MESSAGE_DATA).domain(DOMAIN).domainVersion(DOMAIN_VERSION).result(result) .dataObject(DATA_OBJECT).scheduled(true).retryHeader(retryHeader).build(); final ScheduledTask scheduledTask = new ScheduledTask(DEVICE_MESSAGE_DATA, DOMAIN, DOMAIN, DATA_OBJECT, SCHEDULED_TIME); when(this.scheduledTaskRepository.findByCorrelationUid(anyString())).thenReturn(scheduledTask); this.deviceResponseMessageService.processMessage(message); verify(this.domainResponseMessageSender, times(1)).send(message); verify(this.scheduledTaskRepository, times(1)).delete(scheduledTask); }

Target:
public void testProcessScheduledMessageFailed() { final ResponseMessageResultType result = ResponseMessageResultType.NOT_OK; final Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DATE, 1); final Date scheduledRetryTime = calendar.getTime(); final RetryHeader retryHeader = new RetryHeader(1, 1, scheduledRetryTime); final ProtocolResponseMessage message = new ProtocolResponseMessage.Builder() .deviceMessageMetadata(DEVICE_MESSAGE_DATA).domain(DOMAIN).domainVersion(DOMAIN_VERSION).result(result) .dataObject(DATA_OBJECT).scheduled(true).retryHeader(retryHeader).build(); final ScheduledTask scheduledTask = new ScheduledTask(DEVICE_MESSAGE_DATA, DOMAIN, DOMAIN, DATA_OBJECT, SCHEDULED_TIME); when(this.scheduledTaskRepository.findByCorrelationUid(anyString())).thenReturn(scheduledTask); this.deviceResponseMessageService.processMessage(message); verify(this.domainResponseMessageSender).send(message); verify(this.scheduledTaskRepository).delete(scheduledTask); }
Source:
public void channelRead0(ChannelHandlerContext ctx, Batch batch) throws Exception { logger.debug("Received a new payload"); processing.compareAndSet(false, true); for(Message message : batch.getMessages()) { if(logger.isDebugEnabled()) logger.debug("Sending a new message for the listener, sequence: " + message.getSequence()); messageListener.onNewMessage(ctx, message); if(needAck(message)) { ack(ctx, message); } } ctx.flush(); processing.compareAndSet(true, false); }

Target:
public void channelRead0(ChannelHandlerContext ctx, Batch batch) throws Exception { logger.debug("Received a new payload"); processing.compareAndSet(false, true); for(Message message : batch.getMessages()) { if(logger.isDebugEnabled()) { logger.debug("Sending a new message for the listener, sequence: " + message.getSequence()); } messageListener.onNewMessage(ctx, message); if(needAck(message)) { ack(ctx, message); } } ctx.flush(); processing.compareAndSet(true, false); }
Source:
private void initEditors() { daysEditor = new ListModelCheckBoxGroupEditor<>(new AbstractRenderer<StorageSyncSchedule.Day>() { @Override public String render(StorageSyncSchedule.Day object) { return object.toString().substring(0, 3); } }); frequencyEditor = new ListModelListBoxEditor<>(new AbstractRenderer<StorageSyncSchedule.Frequency>() { @Override public String render(StorageSyncSchedule.Frequency object) { return EnumTranslator.getInstance().translate(object); } }); geoRepSessionEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<GlusterGeoRepSession>() { @Override protected String renderNullSafe(GlusterGeoRepSession geoRepSession) { if (geoRepSession == null) { return ""; } else { return geoRepSession.getSlaveHostName() + "::" + geoRepSession.getSlaveVolumeName(); } } }); hoursEditor = new ListModelListBoxEditor<>(); minsEditor = new ListModelListBoxEditor<>(); }

Target:
private void initEditors() { daysEditor = new ListModelCheckBoxGroupEditor<>(new AbstractRenderer<StorageSyncSchedule.Day>() { @Override public String render(StorageSyncSchedule.Day object) { return object.toString().substring(0, 3); } }); frequencyEditor = new ListModelListBoxEditor<>(new AbstractRenderer<StorageSyncSchedule.Frequency>() { @Override public String render(StorageSyncSchedule.Frequency object) { return EnumTranslator.getInstance().translate(object); } }); geoRepSessionEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<GlusterGeoRepSession>() { @Override protected String renderNullSafe(GlusterGeoRepSession geoRepSession) { if (geoRepSession == null) { return StringUtils.EMPTY; } else { return messages.geoRepRemoteSessionName(geoRepSession.getSlaveHostName(), geoRepSession.getSlaveVolumeName()); } } }); hoursEditor = new ListModelListBoxEditor<>(); minsEditor = new ListModelListBoxEditor<>(); }
Source:
public MethodNode getMain() { for (MethodNode m : methods) { if (m.getSelector().equals("main")) { return m; } } return null; }

Target:
public MethodNode getMain() { for (MethodNode m : methods) { if (m.getSelector().equals("main")) { return m; } } throw new MainMethodNotFoundException(); }
Source:
public void publishCommand(@NonNull byte[] data) { for (CommandSubscriber subscriber : mSubscribers) { subscriber.receiveCommand(data); } }

Target:
public final void publishCommand(@NonNull byte[] data) { if (mListener != null) { mListener.receiveCommand(data); } }
Source:
public ClockSkewEvents(MetricRegistry metricRegistry) { this.metricRegistry = metricRegistry; this.clockSkew = metricRegistry.histogram("clock.skew"); this.clockWentBackwards = metricRegistry.counter("clock.went-backwards"); this.exception = metricRegistry.counter("clock.monitor-exception"); }

Target:
public ClockSkewEvents(MetricRegistry metricRegistry) { this.clockSkew = metricRegistry.histogram("clock.skew"); this.clockWentBackwards = metricRegistry.counter("clock.went-backwards"); this.exception = metricRegistry.counter("clock.monitor-exception"); }
Source:
public void fetchAvailableEngineSettings(RepositoryDTO repositoryDTO, Consumer<Map<String, List<EngineSetting>>> callback, Consumer<Exception> errorCallback) { Map<String, List<EngineSetting>> settings = new HashMap<>(); List<CategoryDTO> categoryDTOS = new ArrayList<>(); for (TypeDTO typeDTO : repositoryDTO.getTypes()) { if (typeDTO.getId().equals("engines")) { categoryDTOS = typeDTO.getCategories(); } } for (CategoryDTO engine : categoryDTOS) { final String engineId = engine.getId(); settings.put(engineId, new ArrayList<>()); for (ApplicationDTO applicationDTO : engine.getApplications()) { if (applicationDTO.getId().equals("settings")) { for (ScriptDTO scriptDTO : applicationDTO.getScripts()) { this.getSetting(engineId, scriptDTO.getId(), setting -> settings.get(engineId).add(setting), errorCallback); } } } } callback.accept(settings); }

Target:
public void fetchAvailableEngineSettings(RepositoryDTO repositoryDTO, Consumer<Map<String, List<EngineSetting>>> callback, Consumer<Exception> errorCallback) { final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession(); interactiveScriptSession.eval(this.getFetchScript(repositoryDTO), output -> callback.accept((Map<String, List<EngineSetting>>) output), errorCallback); }
Source:
protected ModuleRuntimeContainers retrieveModuleRuntimeContainers(String streamName) { ModuleRuntimeContainers containers = new ModuleRuntimeContainers(); for (ModuleMetadataResource module : distributedTestSupport.ensureTemplate() .runtimeOperations().listRuntimeModules()) { String moduleId = module.getModuleId(); if (moduleId.contains(streamName)) { if (moduleId.contains("source")) { containers.addSourceContainer(module.getContainerId()); } else if (moduleId.contains("sink")) { containers.addSinkContainer(module.getContainerId()); } } } assertTrue(containers.toString(), containers.isComplete()); return containers; }

Target:
protected ModuleRuntimeContainers retrieveModuleRuntimeContainers(String streamName) { ModuleRuntimeContainers containers = new ModuleRuntimeContainers(); for (ModuleMetadataResource module : distributedTestSupport.ensureTemplate() .runtimeOperations().listRuntimeModules()) { String moduleId = module.getModuleId(); if (moduleId.contains(streamName)) { if (moduleId.contains("source")) { containers.addSourceContainer(module.getContainerId()); } else if (moduleId.contains("sink")) { containers.addSinkContainer(module.getContainerId()); } } } assertTrue(String.format("A source and/or sink module is missing from %s", containers), containers.isComplete()); return containers; }
Source:
public CryptoInputStream( Input input, Cipher cipher, int bufferSize, byte[] key, byte[] iv) throws IOException { this.input = input; this.cipher = cipher; this.bufferSize = Utils.checkBufferSize(cipher, bufferSize); this.key = key.clone(); this.initIV = iv.clone(); this.iv = iv.clone(); inBuffer = ByteBuffer.allocateDirect(this.bufferSize); outBuffer = ByteBuffer.allocateDirect(this.bufferSize + cipher.getTransformation().getAlgorithmBlockSize()); inBuffer.clear(); outBuffer.clear(); outBuffer.limit(0); initCipher(); }

Target:
public CryptoInputStream( Input input, Cipher cipher, int bufferSize, byte[] key, byte[] iv) throws IOException { this.input = input; this.cipher = cipher; this.bufferSize = Utils.checkBufferSize(cipher, bufferSize); this.key = key.clone(); this.initIV = iv.clone(); this.iv = iv.clone(); inBuffer = ByteBuffer.allocateDirect(this.bufferSize); outBuffer = ByteBuffer.allocateDirect(this.bufferSize + cipher.getTransformation().getAlgorithmBlockSize()); outBuffer.limit(0); initCipher(); }
Source:
private <T> void createDeleteContainerWithSameName(Consumer<CosmosAsyncContainer> validateFunc) throws InterruptedException { CosmosAsyncContainer container = null; try { String testContainerId = UUID.randomUUID().toString(); CosmosContainerProperties containerProperties = getCollectionDefinition(testContainerId); container = createCollection(this.createdDatabase, containerProperties, new CosmosContainerRequestOptions()); validateFunc.accept(container); safeDeleteCollection(container); Thread.sleep(2000); container = createCollection(this.createdDatabase, containerProperties, new CosmosContainerRequestOptions()); validateFunc.accept(container); } finally { safeDeleteCollection(container); } }

Target:
private <T> void createDeleteContainerWithSameName(Consumer<CosmosAsyncContainer> validateFunc) throws InterruptedException { CosmosAsyncContainer container = null; try { String testContainerId = UUID.randomUUID().toString(); CosmosContainerProperties containerProperties = getCollectionDefinition(testContainerId); container = createCollection(this.createdDatabase, containerProperties, new CosmosContainerRequestOptions()); validateFunc.accept(container); safeDeleteCollection(container); Thread.sleep(COLLECTION_RECREATION_TIME_DELAY); container = createCollection(this.createdDatabase, containerProperties, new CosmosContainerRequestOptions()); validateFunc.accept(container); } finally { safeDeleteCollection(container); } }
Source:
private static String getEmailChangeConfirmationLink(String email, String password) { String mailSubject = "Confirm your email address change on Fandom"; String url = MailFunctions.getActivationLinkFromEmailContent( MailFunctions.getFirstEmailContent(email, password, mailSubject)); PageObjectLogging.log("getActivationLinkFromMail", "activation link is visible in email content: " + url, true); return url; }

Target:
private static String getEmailChangeConfirmationLink(String email, String password) { String mailSubject = "Confirm your email address change on Fandom"; String url = EmailUtils.getActivationLinkFromEmailContent( EmailUtils.getFirstEmailContent(email, password, mailSubject)); PageObjectLogging.log("getActivationLinkFromMail", "activation link is visible in email content: " + url, true); return url; }
Source:
public String createString(final String key, final int value) { return createString(key, "" + value); }

Target:
public String createString(final String key, final int value) { return createString(key, String.valueOf(value)); }
Source:
public String buildSqlSelect(DbMapComponent component, String outputTableName) { boolean checkUseUpdateStatement = checkUseUpdateStatement(component, outputTableName); if (checkUseUpdateStatement) { return buildSqlSelect(component, outputTableName, DEFAULT_TAB_SPACE_STRING, checkUseUpdateStatement); } else { return buildSqlSelect(component, outputTableName, DEFAULT_TAB_SPACE_STRING); } }

Target:
public String buildSqlSelect(DbMapComponent component, String outputTableName) { boolean checkUseUpdateStatement = checkUseUpdateStatement(component, outputTableName); if (checkUseUpdateStatement) { return buildSqlUpdate(component, outputTableName, DEFAULT_TAB_SPACE_STRING); } else { return super.buildSqlSelect(component, outputTableName, DEFAULT_TAB_SPACE_STRING); } }
Source:
public void filter() { Assert.assertNull("null list must result in null", ListUtils.filter(null, null)); Assert.assertNull("null list must result in null, even if the filter is not null", ListUtils.filter(null, null)); Assert.assertTrue("empty list must be an empty list", ListUtils.filter(new ArrayList<String>(), null).isEmpty()); Assert.assertTrue("empty list must be an empty list", ListUtils.filter(new ArrayList<String>(), new ListUtils.Filter<String>() { @Override public List<String> filter(List<String> data) { return data; } }).isEmpty()); List<String> testList = new ArrayList<>(); testList.add("bla"); testList.add("bli"); testList.add("blu"); testList.add("blo"); testList.add("foo"); testList.add("bar"); List<String> filtered = ListUtils.filter(testList, new ListUtils.PredicateFilter<>(new ListUtils.Predicate<String>() { @Override public boolean evaluate(String obj) { return obj.endsWith("a"); } })); Assert.assertEquals("only one elem#ent should match the criteria", 1, filtered.size()); Assert.assertEquals("and it should be 'bla'", "bla", filtered.get(0)); }

Target:
public void filter() { Assert.assertNull("null list must result in null", ListUtils.filter(null, null)); Assert.assertNull("null list must result in null, even if the filter is not null", ListUtils.filter(null, null)); Assert.assertTrue("empty list must be an empty list", ListUtils.filter(new ArrayList<String>(), null).isEmpty()); Assert.assertTrue("empty list must be an empty list", ListUtils.filter(new ArrayList<String>(), new ListUtils.Filter<String>() { @Override public List<String> filter(List<String> data) { return data; } }).isEmpty()); List<String> testList = new ArrayList<>(); testList.add("bla"); testList.add("bli"); testList.add("blu"); testList.add("blo"); testList.add("foo"); testList.add("bar"); List<String> filtered = ListUtils.filter(testList, new ListUtils.PredicateFilter<>(new ListUtils.Predicate<String>() { @Override public boolean evaluate(String obj) { return obj.endsWith("a"); } })); Assert.assertEquals("only one element should match the criteria", 1, filtered.size()); Assert.assertEquals("and it should be 'bla'", "bla", filtered.get(0)); }
Source:
public void handleMessageLog(TelemetryMessageLog messageLog) { LOG.debug("Received telemetry messages", messageLog.getMessageList().size()); final List<P> flowPackets = new LinkedList<>(); final List<Flow> flows = new LinkedList<>(); try (Timer.Context ctx = logParsingTimer.time()) { for (TelemetryMessageLogEntry eachMessage : messageLog.getMessageList()) { LOG.trace("Parsing packet: {}", eachMessage); final P flowPacket = parse(eachMessage); if (flowPacket != null) { flowPackets.add(flowPacket); flows.addAll(converter.convert(flowPacket)); } } packetsPerLogHistogram.update(flowPackets.size()); } try { LOG.debug("Persisting packets, flows.", flowPackets.size(), flows.size()); final FlowSource source = new FlowSource(messageLog.getLocation(), messageLog.getSourceAddress(), Strings.isNullOrEmpty(metaDataNodeLookup) ? null : new ContextKey(metaDataNodeLookup)); flowRepository.persist(flows, source); } catch (DetailedFlowException ex) { LOG.error("Error while persisting flows: {}", ex.getMessage(), ex); for (final String logMessage: ex.getDetailedLogMessages()) { LOG.error(logMessage); } } catch(UnrecoverableFlowException ex) { LOG.error("Error while persisting flows. Cannot recover: {}. messages are lost.", ex.getMessage(), messageLog.getMessageList().size(), ex); return; } catch (FlowException ex) { LOG.error("Error while persisting flows: {}", ex.getMessage(), ex); } LOG.debug("Completed processing telemetry messages.", messageLog.getMessageList().size()); }

Target:
public void handleMessageLog(TelemetryMessageLog messageLog) { LOG.debug("Received telemetry messages", messageLog.getMessageList().size()); final List<P> flowPackets = new LinkedList<>(); final List<Flow> flows = new LinkedList<>(); try (Timer.Context ctx = logParsingTimer.time()) { for (TelemetryMessageLogEntry eachMessage : messageLog.getMessageList()) { LOG.trace("Parsing packet: {}", eachMessage); final P flowPacket = parse(eachMessage); if (flowPacket != null) { flowPackets.add(flowPacket); flows.addAll(converter.convert(flowPacket)); } } packetsPerLogHistogram.update(flowPackets.size()); } try { LOG.debug("Persisting packets, flows.", flowPackets.size(), flows.size()); final FlowSource source = new FlowSource(messageLog.getLocation(), messageLog.getSourceAddress(), contextKey); flowRepository.persist(flows, source); } catch (DetailedFlowException ex) { LOG.error("Error while persisting flows: {}", ex.getMessage(), ex); for (final String logMessage: ex.getDetailedLogMessages()) { LOG.error(logMessage); } } catch(UnrecoverableFlowException ex) { LOG.error("Error while persisting flows. Cannot recover: {}. messages are lost.", ex.getMessage(), messageLog.getMessageList().size(), ex); return; } catch (FlowException ex) { LOG.error("Error while persisting flows: {}", ex.getMessage(), ex); } LOG.debug("Completed processing telemetry messages.", messageLog.getMessageList().size()); }
Source:
private boolean entitySupportRetry(HttpRequest request) { boolean entitySupportRetry = true; if (request.getEntity() != null) { if (request.getEntity() instanceof InputStreamHttpEntity) { entitySupportRetry = ((InputStreamHttpEntity) request.getEntity()).getInputStream().markSupported(); } } return entitySupportRetry; }

Target:
private boolean entitySupportRetry(HttpRequest request) { boolean entitySupportRetry = true; if (request.getEntity() != null && request.getEntity() instanceof InputStreamHttpEntity) { entitySupportRetry = ((InputStreamHttpEntity) request.getEntity()).getInputStream().markSupported(); } return entitySupportRetry; }
Source:
private static TypedInput createResponseBody(final ResponseBody body) { if (body == null) { return null; } return new TypedInput() { @Override public String mimeType() { return body.contentType().toString(); } @Override public long length() { return body.contentLength(); } @Override public InputStream in() throws IOException { return body.byteStream(); } }; }

Target:
private static TypedInput createResponseBody(final ResponseBody body) { if (body.contentLength() == 0) { return null; } return new TypedInput() { @Override public String mimeType() { return body.contentType().toString(); } @Override public long length() { return body.contentLength(); } @Override public InputStream in() throws IOException { return body.byteStream(); } }; }
Source:
private CompletableFuture<Void> doInitialSync() { LOGGER.debug("Making initial Sync to all seed members: {}", seedMembers); if (seedMembers.isEmpty()) { return CompletableFuture.completedFuture(null); } CompletableFuture<Void> syncResponseFuture = new CompletableFuture<>(); String cid = member.id(); transport.listen().observeOn(scheduler) .filter(msg -> SYNC_ACK.equals(msg.qualifier())) .filter(msg -> cid.equals(msg.correlationId())) .filter(this::checkSyncGroup) .take(1) .timeout(config.getSyncTimeout(), TimeUnit.MILLISECONDS, scheduler) .subscribe(message -> { onSyncAck(message); schedulePeriodicSync(); syncResponseFuture.complete(null); }, throwable -> { LOGGER.info("Timeout getting initial SyncAck from seed members: {}", seedMembers); schedulePeriodicSync(); syncResponseFuture.complete(null); }); Message syncMsg = prepareSyncDataMsg(SYNC, cid); seedMembers.forEach(address -> transport.send(address, syncMsg)); return syncResponseFuture; }

Target:
private CompletableFuture<Void> doInitialSync() { LOGGER.debug("Making initial Sync to all seed members: {}", seedMembers); if (seedMembers.isEmpty()) { schedulePeriodicSync(); return CompletableFuture.completedFuture(null); } CompletableFuture<Void> syncResponseFuture = new CompletableFuture<>(); String cid = member.id(); transport.listen().observeOn(scheduler) .filter(msg -> SYNC_ACK.equals(msg.qualifier())) .filter(msg -> cid.equals(msg.correlationId())) .filter(this::checkSyncGroup) .take(1) .timeout(config.getSyncTimeout(), TimeUnit.MILLISECONDS, scheduler) .subscribe( message -> { onSyncAck(message); schedulePeriodicSync(); syncResponseFuture.complete(null); }, throwable -> { LOGGER.info("Timeout getting initial SyncAck from seed members: {}", seedMembers); schedulePeriodicSync(); syncResponseFuture.complete(null); }); Message syncMsg = prepareSyncDataMsg(SYNC, cid); seedMembers.forEach(address -> transport.send(address, syncMsg)); return syncResponseFuture; }
Source:
private int compactPartition(PartitionId partition) { if (isShuttingDown()) { logger.info("Skipping compaction due to shut down."); return 0; } logger.info("Beginning dead blob compaction for partition {}", partition); String partitionPath = partition.toPathString(); if (!partitions.contains(partition)) { logger.warn("Skipping compaction of Partition as the partition was reassgined", partition); return 0; } try { return cloudDestination.compactPartition(partitionPath); } catch (CloudStorageException ex) { logger.error("Compaction failed for partition {}", partitionPath, ex); vcrMetrics.compactionFailureCount.inc(); } return 0; }

Target:
private int compactPartition(PartitionId partition) throws CloudStorageException { if (isShutDown()) { logger.info("Skipping compaction due to shut down."); return 0; } logger.info("Beginning dead blob compaction for partition {}", partition); String partitionPath = partition.toPathString(); if (!partitions.contains(partition)) { logger.warn("Skipping compaction of Partition as the partition was reassigned", partition); return 0; } try { return cloudDestination.compactPartition(partitionPath); } catch (CloudStorageException ex) { logger.error("Compaction failed for partition {}", partitionPath, ex); throw ex; } }
Source:
public void before() { try { SWTBotUtils.openTrace(TRACE_PROJECT_NAME, FileLocator.toFileURL(CtfTestTrace.ARM_64_BIT_HEADER.getTraceURL()).getPath(), KERNEL_TRACE_TYPE); } catch (IOException e) { fail(e.getMessage()); } SWTBotUtils.activateEditor(fBot, "bug446190"); fViewBotCfv = fBot.viewById(ControlFlowView.ID); SWTBotUtils.openView(CP_ID); fViewBotCp = fBot.viewById(CP_ID); fViewBotCp.show(); fViewBotCfv.show(); fViewBotCfv.setFocus(); }

Target:
public void before() { try { SWTBotUtils.openTrace(TRACE_PROJECT_NAME, Paths.get(FileLocator.toFileURL(CtfTestTrace.ARM_64_BIT_HEADER.getTraceURL()).toURI()).toString(), KERNEL_TRACE_TYPE); } catch (IOException | URISyntaxException e) { fail(e.getMessage()); } SWTBotUtils.activateEditor(fBot, "bug446190"); fViewBotCfv = fBot.viewById(ControlFlowView.ID); SWTBotUtils.openView(CP_ID); fViewBotCp = fBot.viewById(CP_ID); fViewBotCp.show(); fViewBotCfv.show(); fViewBotCfv.setFocus(); }
Source:
public Status update(String table, String key, HashMap<String, ByteIterator> values) { try { if (!transactionUpdate) { BaseDocument updateDoc = new BaseDocument(); for (String field : values.keySet()) { updateDoc.addAttribute(field, byteIteratorToString(values.get(field))); } arangoDriver.updateDocument(table, key, updateDoc); return Status.OK; } else { String transactionAction = "function (id) {" + "var db = require('internal').db;" + String.format("db._update(id, %s, true, false, %s);}", mapToJson(values), Boolean.toString(waitForSync).toLowerCase()); TransactionEntity transaction = arangoDriver.createTransaction(transactionAction); transaction.addWriteCollection(table); transaction.setParams(createDocumentHandle(table, key)); arangoDriver.executeTransaction(transaction); return Status.OK; } } catch (ArangoException e) { if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { logger.error("Fail to update: " + table + " " + key, e); } else { logger.debug("Trying to update document not exist: {}", table, key); return Status.NOT_FOUND; } } catch (Exception e) { logger.error("Exception while trying update " + table + " " + key, e); } return Status.ERROR; }

Target:
public Status update(String table, String key, HashMap<String, ByteIterator> values) { try { if (!transactionUpdate) { BaseDocument updateDoc = new BaseDocument(); for (String field : values.keySet()) { updateDoc.addAttribute(field, byteIteratorToString(values.get(field))); } arangoDriver.updateDocument(table, key, updateDoc); return Status.OK; } else { String transactionAction = "function (id) {" + "var db = require('internal').db;" + String.format("db._update(id, %s, true, false, %s);}", mapToJson(values), Boolean.toString(waitForSync).toLowerCase()); TransactionEntity transaction = arangoDriver.createTransaction(transactionAction); transaction.addWriteCollection(table); transaction.setParams(createDocumentHandle(table, key)); arangoDriver.executeTransaction(transaction); return Status.OK; } } catch (ArangoException e) { if (e.getErrorNumber() != ErrorNums.ERROR_ARANGO_DOCUMENT_NOT_FOUND) { logger.error("Fail to update: with ex {}", table, key, e.toString()); } else { logger.debug("Trying to update document not exist: {}", table, key); return Status.NOT_FOUND; } } catch (RuntimeException e) { logger.error("Exception while trying update with ex {}", table, key, e.toString()); } return Status.ERROR; }
Source:
public void testActionStore () throws Exception { ObjectStoreEnvironmentBean oseb = BeanPopulator.getNamedInstance(ObjectStoreEnvironmentBean.class, "communicationStore"); oseb.setObjectStoreDir("tmp"); ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean(); objectStoreEnvironmentBean.setLocalOSRoot( "tmp" ); ActionStore as = new ActionStore(objectStoreEnvironmentBean); final OutputObjectState buff = new OutputObjectState(); final String tn = "/StateManager/junit"; for (int i = 0; i < 100; i++) { Uid u = new Uid(); as.write_uncommitted(u, tn, buff); as.commit_state(u, tn); assertTrue(as.currentState(u, tn) != StateStatus.OS_UNCOMMITTED); InputObjectState ios = new InputObjectState(); as.allObjUids("", ios); assertTrue(as.read_uncommitted(u, tn) == null); as.write_committed(u, tn, buff); as.read_committed(u, tn); assertTrue(!as.remove_uncommitted(u, tn)); as.remove_committed(u, tn); assertTrue(!as.hide_state(u, tn)); assertTrue(!as.reveal_state(u, tn)); } }

Target:
public void testActionStore () throws Exception { ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean(); objectStoreEnvironmentBean.setLocalOSRoot( "tmp" ); ActionStore as = new ActionStore(objectStoreEnvironmentBean); final OutputObjectState buff = new OutputObjectState(); final String tn = "/StateManager/junit"; for (int i = 0; i < 100; i++) { Uid u = new Uid(); as.write_uncommitted(u, tn, buff); as.commit_state(u, tn); assertTrue(as.currentState(u, tn) != StateStatus.OS_UNCOMMITTED); InputObjectState ios = new InputObjectState(); as.allObjUids("", ios); assertTrue(as.read_uncommitted(u, tn) == null); as.write_committed(u, tn, buff); as.read_committed(u, tn); assertTrue(!as.remove_uncommitted(u, tn)); as.remove_committed(u, tn); assertTrue(!as.hide_state(u, tn)); assertTrue(!as.reveal_state(u, tn)); } }