auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testMathFunctions1() throws Exception { doTest(readFile("/streamline-udf-math1.json"), getTuple()); new Verifications() { { String streamId; Tuple anchor; List<List<Object>> tuples = new ArrayList<>(); mockCollector.emit(streamId = withCapture(), anchor = withCapture(), withCapture(tuples)); Assert.assertEquals(1, tuples.size()); <START> Assert.assertEquals("POWER 1024.0 ABS 1.0 MOD 0 SQRT 1.4142135623730951 LN 0.6931471805599453" + <END> " LOG10 0.3010299956639812 EXP 7.38905609893065 CEIL 2.0 FLOOR 1.0", ((StreamlineEvent)(tuples.get(0).get(0))).get("body")); } }; }</code><technical_language>Is safe epsilon for comparing double type result</technical_language>

Target:
public void testMathFunctions1() throws Exception { doTest(readFile("/streamline-udf-math1.json"), getTuple()); new Verifications() { { String streamId; Tuple anchor; List<List<Object>> tuples = new ArrayList<>(); double delta = .0001; mockCollector.emit(streamId = withCapture(), anchor = withCapture(), withCapture(tuples)); Assert.assertEquals(1, tuples.size()); String res[] = (((StreamlineEvent)(tuples.get(0).get(0))).get("body")).toString().split(" "); Assert.assertEquals("POWER", res[0]); Assert.assertEquals(1024.0, Double.valueOf(res[1]), delta); Assert.assertEquals("ABS", res[2]); Assert.assertEquals(1.0, Double.valueOf(res[3]), delta); Assert.assertEquals("MOD", res[4]); Assert.assertEquals(0, Double.valueOf(res[5]), delta); Assert.assertEquals("SQRT", res[6]); Assert.assertEquals(1.4142135623730951, Double.valueOf(res[7]), delta); Assert.assertEquals("LN", res[8]); Assert.assertEquals(0.6931471805599453, Double.valueOf(res[9]), delta); Assert.assertEquals("LOG10", res[10]); Assert.assertEquals(0.3010299956639812, Double.valueOf(res[11]), delta); Assert.assertEquals("EXP", res[12]); Assert.assertEquals(7.38905609893065, Double.valueOf(res[13]), delta); Assert.assertEquals("CEIL", res[14]); Assert.assertEquals(2.0, Double.valueOf(res[15]), delta); Assert.assertEquals("FLOOR", res[16]); Assert.assertEquals(1.0, Double.valueOf(res[17]), delta); } }; }
Source:
<code>public void testSerialize() { Set<Property> props = new HashSet<Property>(); Property prop1 = new Property(); prop1.setName("testProp1"); prop1.setValue("testValue1"); prop1.setType(PropertyType.Text); <START> props.add(prop1); <END> ProducerInfo pi = new ProducerInfo(); pi.setId("testId"); pi.setProperties(props); pi.setTimestamp(System.currentTimeMillis()); ProducerInfo result = null; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(pi); oos.flush(); oos.close(); baos.close(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ObjectInputStream ois = new ObjectInputStream(bais); result = (ProducerInfo) ois.readObject(); bais.close(); ois.close(); } catch (Exception e) { e.printStackTrace(); fail("Failed to serialize: " + e); } assertNotNull(result); assertEquals(result, pi); }</code><technical_language>I test null values</technical_language>

Target:
public void testSerialize() { Set<Property> props = new HashSet<Property>(); Property prop1 = new Property(); prop1.setName("testProp1"); prop1.setValue("testValue1"); prop1.setType(PropertyType.Text); props.add(prop1); Property prop2 = new Property(); prop2.setName("testProp2"); prop2.setValue("testValue2"); prop2.setType(PropertyType.Number); props.add(prop2); ProducerInfo pi = new ProducerInfo(); pi.setId("testId"); pi.setDuration(500); pi.setFragmentId("fragId"); pi.setHostAddress("hostAddr"); pi.setHostName("hostName"); pi.setMultipleConsumers(true); pi.setSourceOperation("sourceOp"); pi.setSourceUri("sourceUri"); pi.setProperties(props); pi.setTimestamp(System.currentTimeMillis()); ProducerInfo result = null; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(pi); oos.flush(); oos.close(); baos.close(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ObjectInputStream ois = new ObjectInputStream(bais); result = (ProducerInfo) ois.readObject(); bais.close(); ois.close(); } catch (Exception e) { e.printStackTrace(); fail("Failed to serialize: " + e); } assertNotNull(result); assertEquals(result, pi); }
Source:
<code>private void write(TempFile tempFile, Type writerType, List<String> data) throws IOException { OrcWriter writer = new OrcWriter(new OutputStreamOrcDataSink(new FileOutputStream(tempFile.getFile())), <START> com.google.common.collect.ImmutableList.of(STRUCT_COL_NAME), <END> com.google.common.collect.ImmutableList.of(writerType), ORC, NONE, new OrcWriterOptions().withStripeMinSize(new DataSize(0, MEGABYTE)) .withStripeMaxSize(new DataSize(32, MEGABYTE)) .withStripeMaxRowCount(ORC_STRIPE_SIZE) .withRowGroupMaxRowCount(ORC_ROW_GROUP_SIZE) .withDictionaryMaxMemory(new DataSize(32, MEGABYTE)), ImmutableMap.of(), HIVE_STORAGE_TIME_ZONE, true, OrcWriteValidation.OrcWriteValidationMode.BOTH, new OrcWriterStats()); Block[] fieldBlocks = new Block[data.size()]; int entries = 10; boolean[] rowIsNull = new boolean[entries]; Arrays.fill(rowIsNull, false); BlockBuilder blockBuilder = TEST_DATA_TYPE.createBlockBuilder(null, entries); for (int i = 0; i < data.size(); i++) { byte[] bytes = data.get(i).getBytes(); for (int j = 0; j < entries; j++) { blockBuilder .writeBytes(Slices.wrappedBuffer(bytes, 0, bytes.length), 0, bytes.length); blockBuilder.closeEntry(); } fieldBlocks[i] = blockBuilder.build(); blockBuilder = blockBuilder.newBlockBuilderLike(null); } Block rowBlock = RowBlock.fromFieldBlocks(rowIsNull, fieldBlocks); writer.write(new Page(rowBlock)); writer.close(); }</code><technical_language>import ImmutableList</technical_language>

Target:
private void write(TempFile tempFile, Type writerType, List<String> data) throws IOException { OrcWriter writer = new OrcWriter( new OutputStreamOrcDataSink( new FileOutputStream(tempFile.getFile())), ImmutableList.of(STRUCT_COL_NAME), ImmutableList.of(writerType), ORC, NONE, new OrcWriterOptions().withStripeMinSize(new DataSize(0, MEGABYTE)).withStripeMaxSize(new DataSize(32, MEGABYTE)).withStripeMaxRowCount(ORC_STRIPE_SIZE) .withRowGroupMaxRowCount(ORC_ROW_GROUP_SIZE).withDictionaryMaxMemory(new DataSize(32, MEGABYTE)), ImmutableMap.of(), HIVE_STORAGE_TIME_ZONE, true, BOTH, new OrcWriterStats()); Block[] fieldBlocks = new Block[data.size()]; int entries = 10; boolean[] rowIsNull = new boolean[entries]; Arrays.fill(rowIsNull, false); BlockBuilder blockBuilder = TEST_DATA_TYPE.createBlockBuilder(null, entries); for (int i = 0; i < data.size(); i++) { byte[] bytes = data.get(i).getBytes(); for (int j = 0; j < entries; j++) { blockBuilder.writeBytes(Slices.wrappedBuffer(bytes), 0, bytes.length); blockBuilder.closeEntry(); } fieldBlocks[i] = blockBuilder.build(); blockBuilder = blockBuilder.newBlockBuilderLike(null); } Block rowBlock = RowBlock.fromFieldBlocks(rowIsNull, fieldBlocks); writer.write(new Page(rowBlock)); writer.close(); }
Source:
<code>public void testNotifyCheckpointComplete() throws Exception { TestTaskStateManager stateManager = new TestTaskStateManager(); MockEnvironment mockEnvironment = MockEnvironment.builder().setTaskStateManager(stateManager).build(); SubtaskCheckpointCoordinator subtaskCheckpointCoordinator = new MockSubtaskCheckpointCoordinatorBuilder() .setEnvironment(mockEnvironment) .build(); long checkpointId = 42L; { <START> boolean success = subtaskCheckpointCoordinator.notifyCheckpointComplete(checkpointId, mock(OperatorChain.class), () -> true); <END> assertTrue(success); assertEquals(checkpointId, stateManager.getNotifiedCompletedCheckpointId()); } long newCheckpointId = checkpointId + 1; { boolean success = subtaskCheckpointCoordinator.notifyCheckpointComplete(newCheckpointId, mock(OperatorChain.class), () -> false); assertFalse(success); assertEquals(newCheckpointId, stateManager.getNotifiedCompletedCheckpointId()); } }</code><technical_language>I this (mockito mock) break easily some more complex behavior is expected OperatorChain (more [here](<LINK_0> Instead, this work: final OperatorChain chain = new OperatorChain<>( new MockStreamTaskBuilder(new DummyEnvironment()).build(), new NonRecordWriter<>()); boolean success = subtaskCheckpointCoordinator.notifyCheckpointComplete(newCheckpointId, chain, () -> false);</technical_language>

Target:
public void testNotifyCheckpointComplete() throws Exception { TestTaskStateManager stateManager = new TestTaskStateManager(); MockEnvironment mockEnvironment = MockEnvironment.builder().setTaskStateManager(stateManager).build(); SubtaskCheckpointCoordinator subtaskCheckpointCoordinator = new MockSubtaskCheckpointCoordinatorBuilder() .setEnvironment(mockEnvironment) .build(); final OperatorChain<?, ?> operatorChain = new OperatorChain<>( new MockStreamTaskBuilder(new DummyEnvironment()).build(), new NonRecordWriter<>()); long checkpointId = 42L; { subtaskCheckpointCoordinator.notifyCheckpointComplete(checkpointId, operatorChain, () -> true); assertEquals(checkpointId, stateManager.getNotifiedCompletedCheckpointId()); } long newCheckpointId = checkpointId + 1; { subtaskCheckpointCoordinator.notifyCheckpointComplete(newCheckpointId, operatorChain, () -> false); assertEquals(newCheckpointId, stateManager.getNotifiedCompletedCheckpointId()); } }
Source:
<code>public void aNotBTest() { int lgK = 4; IntegerSummary.Mode a1Mode = IntegerSummary.Mode.AlwaysOne; IntegerSketch a1Sk1 = new IntegerSketch(lgK, a1Mode); IntegerSketch a1Sk2 = null; AnotB<IntegerSummary> anotb = new AnotB<>(); for (int i = 0; i < 5; i++) { a1Sk1.update(i, 1); } anotb.update(a1Sk1, a1Sk2); <START> anotb.getResult(); <END> }</code><technical_language>assertions here</technical_language>

Target:
public void aNotBTest() { int lgK = 4; int u = 5; IntegerSummary.Mode a1Mode = IntegerSummary.Mode.AlwaysOne; IntegerSketch a1Sk1 = new IntegerSketch(lgK, a1Mode); IntegerSketch a1Sk2 = null; AnotB<IntegerSummary> anotb = new AnotB<>(); for (int i = 0; i < u; i++) { a1Sk1.update(i, 1); } anotb.update(a1Sk1, a1Sk2); CompactSketch<IntegerSummary> cSk = anotb.getResult(); assertEquals((int)cSk.getEstimate(), u); }
Source:
<code>public boolean containsAll(List<Media> images){ if (images == null || images.isEmpty()) { return false; } if (data == null) { data = new ArrayList<>(); return false; } <START> if (data.size() <= 0) { <END> return false; } String fileName = data.get(0).getFilename(); String imageName = images.get(0).getFilename(); return imageName.equals(fileName); }</code><technical_language><=0</technical_language>

Target:
public boolean containsAll(List<Media> images){ if (images == null || images.isEmpty()) { return false; } if (data == null) { data = new ArrayList<>(); return false; } if (data.size() == 0) { return false; } String fileName = data.get(0).getFilename(); String imageName = images.get(0).getFilename(); return imageName.equals(fileName); }
Source:
<code>private boolean registerJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException { if (!jobStoreSupportsPersistence) { return true; <START> }else{ <END> persistedJobKeyList.remove(jobDetail.getKey()); } JobDetail existingJob = scheduler_.getJobDetail(jobDetail.getKey()); Trigger existingTrigger = scheduler_.getTrigger(trigger.getKey()); if (existingJob == null) return true; if (equals(existingJob, jobDetail) && equals(existingTrigger, trigger)) { return false; }else{ scheduler_.deleteJob(jobDetail.getKey()); return true; } }</code><technical_language>else is useless</technical_language>

Target:
private boolean registerJob(JobDetail jobDetail, Trigger trigger) throws SchedulerException { if (!jobStoreSupportsPersistence) { return true; } persistedJobKeyList.remove(jobDetail.getKey()); JobDetail existingJob = scheduler_.getJobDetail(jobDetail.getKey()); Trigger existingTrigger = scheduler_.getTrigger(trigger.getKey()); if (existingJob == null) { return true; } if (equals(existingJob, jobDetail) && equals(existingTrigger, trigger)) { return false; } if(equals(existingJob, jobDetail) && !equals(existingTrigger, trigger)){ scheduler_.rescheduleJob(trigger.getKey(), trigger); return false; } scheduler_.deleteJob(jobDetail.getKey()); return true; }
Source:
<code>public ConnectivityReceiver() { MerlinsBeardCreator merlinsBeardCreator = new MerlinsBeardCreator() { @Override public MerlinsBeard createMerlinsBeard(Context context) { return MerlinsBeard.from(context); } }; MerlinBinderRetriever merlinBinderRetriever = new MerlinBinderRetriever() { @Override public MerlinService.ConnectivityChangesNotifier retrieveConnectivityChangesNotifierIfAvailable(Context context) { IBinder iBinder = peekService(context, new Intent(context, MerlinService.class)); <START> if (iBinder != null <END> && iBinder instanceof MerlinService.ConnectivityChangesNotifier) { return (MerlinService.ConnectivityChangesNotifier) iBinder; } return null; } }; ConnectivityChangeEventCreator creator = new ConnectivityChangeEventCreator(); connectivityReceiverConnectivityChangeNotifier = new ConnectivityReceiverConnectivityChangeNotifier(merlinsBeardCreator, merlinBinderRetriever, creator); }</code><technical_language>is fine is do instanceof check need a null check beforehand, do you</technical_language>

Target:
public ConnectivityReceiver() { MerlinsBeardCreator merlinsBeardCreator = new MerlinsBeardCreator() { @Override public MerlinsBeard createMerlinsBeard(Context context) { return MerlinsBeard.from(context); } }; MerlinBinderRetriever merlinBinderRetriever = new MerlinBinderRetriever() { @Override public MerlinService.ConnectivityChangesNotifier retrieveConnectivityChangesNotifier(Context context) { IBinder iBinder = peekService(context, new Intent(context, MerlinService.class)); if (iBinder instanceof MerlinService.ConnectivityChangesNotifier) { return (MerlinService.ConnectivityChangesNotifier) iBinder; } return null; } }; ConnectivityChangeEventCreator creator = new ConnectivityChangeEventCreator(); connectivityReceiverConnectivityChangeNotifier = new ConnectivityReceiverConnectivityChangeNotifier(merlinsBeardCreator, merlinBinderRetriever, creator); }
Source:
<code>protected void connectSensors() { super.connectSensors(); connectServiceUpIsRunning(); HostAndPort hp = BrooklynAccessUtils.getBrooklynAccessibleAddress(this, getAttribute(HTTP_PORT)); ambariUri = String.format("http://%s:%d", hp.getHostText(), hp.getPort()); setAttribute(Attributes.MAIN_URI, URI.create(ambariUri)); sensors().set(AmbariServer.USERNAME, USERNAME); usernamePasswordCredentials = new UsernamePasswordCredentials( USERNAME, getAttribute(AmbariServer.PASSWORD) == null ? INITIAL_PASSWORD : getAttribute(AmbariServer.PASSWORD)); restAdapter = new RestAdapter.Builder() .setEndpoint(ambariUri) .setRequestInterceptor(new AmbariRequestInterceptor(usernamePasswordCredentials)) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); serviceUpHttpFeed = HttpFeed.builder() .entity(this) .period(500, TimeUnit.MILLISECONDS) .baseUri(ambariUri) .poll(new HttpPollConfig<Boolean>(URL_REACHABLE) .onSuccess(HttpValueFunctions.responseCodeEquals(200)) .onFailureOrException(Functions.constant(false))) .build(); enrichers().add(Enrichers.builder().updatingMap(Attributes.SERVICE_NOT_UP_INDICATORS) .from(URL_REACHABLE) .computing(Functionals.ifNotEquals(true).value("URL not reachable")) .build()); <START> connectSensorsHelper(); <END> }</code><technical_language>Is a name this - possibly connectAuthenticatedSensors? - try obvious is separate rest</technical_language>

Target:
protected void connectSensors() { super.connectSensors(); connectServiceUpIsRunning(); HostAndPort hp = BrooklynAccessUtils.getBrooklynAccessibleAddress(this, getAttribute(HTTP_PORT)); ambariUri = String.format("http://%s:%d", hp.getHostText(), hp.getPort()); setAttribute(Attributes.MAIN_URI, URI.create(ambariUri)); sensors().set(AmbariServer.USERNAME, USERNAME); usernamePasswordCredentials = new UsernamePasswordCredentials( USERNAME, getAttribute(AmbariServer.PASSWORD) == null ? INITIAL_PASSWORD : getAttribute(AmbariServer.PASSWORD)); restAdapter = new RestAdapter.Builder() .setEndpoint(ambariUri) .setRequestInterceptor(new AmbariRequestInterceptor(usernamePasswordCredentials)) .setLogLevel(RestAdapter.LogLevel.FULL) .build(); serviceUpHttpFeed = HttpFeed.builder() .entity(this) .period(500, TimeUnit.MILLISECONDS) .baseUri(ambariUri) .poll(new HttpPollConfig<Boolean>(URL_REACHABLE) .onSuccess(HttpValueFunctions.responseCodeEquals(200)) .onFailureOrException(Functions.constant(false))) .build(); enrichers().add(Enrichers.builder().updatingMap(Attributes.SERVICE_NOT_UP_INDICATORS) .from(URL_REACHABLE) .computing(Functionals.ifNotEquals(true).value("URL not reachable")) .build()); connectAuthenticatedSensors(); }
Source:
<code>public void testUpdateResourceUnit() { ResourcePoolsBuilder existingPoolsBuilder = ResourcePoolsBuilder.newResourcePoolsBuilder(); existingPoolsBuilder = existingPoolsBuilder.heap(20L, EntryUnit.ENTRIES).disk(500, MemoryUnit.MB); ResourcePools existing = existingPoolsBuilder.build(); ResourcePoolsBuilder toBeUpdatedPoolsBuilder = ResourcePoolsBuilder.newResourcePoolsBuilder(); <START> toBeUpdatedPoolsBuilder = toBeUpdatedPoolsBuilder.disk(2, MemoryUnit.GB); <END> ResourcePools toBeUpdated = toBeUpdatedPoolsBuilder.build(); ResourcePoolMerger merger = new ResourcePoolMerger(); try { existing = merger.validateAndMerge(existing, toBeUpdated); } catch (UnsupportedOperationException uoe) { assertThat(uoe.getMessage(), is("Updating resources with MemoryUnit as unit of measure is not supported")); } assertThat(existing.getPoolForResource(ResourceType.Core.DISK).getSize(), is(500L)); assertThat(existing.getPoolForResource(ResourceType.Core.DISK).getUnit(), Matchers.<ResourceUnit>is(MemoryUnit.MB)); }</code><technical_language>This test fails today pass in future ARC is implemented. I replace a test checking do try switch a count based resource a memory based one</technical_language>

Target:
public void testUpdateResourceUnit() { ResourcePoolsBuilder existingPoolsBuilder = ResourcePoolsBuilder.newResourcePoolsBuilder(); existingPoolsBuilder = existingPoolsBuilder.heap(20L, EntryUnit.ENTRIES).disk(500L, EntryUnit.ENTRIES); ResourcePools existing = existingPoolsBuilder.build(); ResourcePoolsBuilder toBeUpdatedPoolsBuilder = ResourcePoolsBuilder.newResourcePoolsBuilder(); toBeUpdatedPoolsBuilder = toBeUpdatedPoolsBuilder.disk(2, MemoryUnit.GB); ResourcePools toBeUpdated = toBeUpdatedPoolsBuilder.build(); ResourcePoolMerger merger = new ResourcePoolMerger(); try { existing = merger.validateAndMerge(existing, toBeUpdated); } catch (UnsupportedOperationException uoe) { assertThat(uoe.getMessage(), is("Updating ResourceUnit is not supported")); } assertThat(existing.getPoolForResource(ResourceType.Core.DISK).getSize(), is(500L)); assertThat(existing.getPoolForResource(ResourceType.Core.DISK).getUnit(), Matchers.<ResourceUnit>is(EntryUnit.ENTRIES)); }
Source:
<code>public void setMessage(Message msg) { Message oldMessage = this.message; this.message = msg; <START> for (Entry<String, HttpPanelComponentInterface> stringHttpPanelComponentInterfaceEntry : <END> components.entrySet()) { HttpPanelComponentInterface component = stringHttpPanelComponentInterfaceEntry.getValue(); if (!component.isEnabled(message)) { if (enabledComponents.contains(component)) { disableComponent(component); } } else if (!enabledComponents.contains(component)) { enableComponent(component); } } if (enabledComponents.size() == 0) { currentComponent = null; switchEmptyComponent(); notifyDisplayedMessageChangedListeners(oldMessage, message); return; } boolean switchView = true; if (currentComponent != null && enabledComponents.contains(components.get(currentComponent.getName()))) { switchView = false; } this.validate(); if (switchView) { switchComponent(enabledComponents.get(0).getName()); } else { updateContent(); } notifyDisplayedMessageChangedListeners(oldMessage, message); }</code><technical_language>reason name is verbose? entry, changed iterate values</technical_language>

Target:
public void setMessage(Message msg) { Message oldMessage = this.message; this.message = msg; for (HttpPanelComponentInterface component : components.values()) { if (!component.isEnabled(message)) { if (enabledComponents.contains(component)) { disableComponent(component); } } else if (!enabledComponents.contains(component)) { enableComponent(component); } } if (enabledComponents.size() == 0) { currentComponent = null; switchEmptyComponent(); notifyDisplayedMessageChangedListeners(oldMessage, message); return; } boolean switchView = true; if (currentComponent != null && enabledComponents.contains(components.get(currentComponent.getName()))) { switchView = false; } this.validate(); if (switchView) { switchComponent(enabledComponents.get(0).getName()); } else { updateContent(); } notifyDisplayedMessageChangedListeners(oldMessage, message); }
Source:
<code>public static InsightType fromString(final String text) { <START> if (text != null) { <END> for (final InsightType insightType : InsightType.values()) { if (text.equalsIgnoreCase(insightType.toString())) return insightType; } } throw new IllegalArgumentException("Illegal InsightType string"); }</code><technical_language>need check for null if invert equality check: ~~text.equalsIgnoreCase(insightType.toString()~~ insightType.toString().equalsIgnoreCase(text)</technical_language>

Target:
public static Category fromString(final String text) { if (text != null) { for (final Category category : Category.values()) { if (text.equalsIgnoreCase(category.toString())) return category; } } throw new IllegalArgumentException("Invalid Category string"); }
Source:
<code>void shouldBeBreakpointIfIgnoreRulesMatchButNotEnable(boolean request) { Message message = mock(Message.class); given(message.isInScope()).willReturn(true); given(breakpointManagementInterface.isBreakRequest()).willReturn(true); given(breakpointManagementInterface.isBreakResponse()).willReturn(true); BreakpointMessageInterface skipBreakpoint = mock(BreakpointMessageInterface.class); given(skipBreakpoint.isEnabled()).willReturn(false); given(skipBreakpoint.match(message, request, false)).willReturn(true); <START> List<BreakpointMessageInterface> x = new ArrayList<>(); x.add(skipBreakpoint); <END> breakpointMessageHandler.setEnabledIgnoreRules(x); boolean breakpoint = breakpointMessageHandler.isBreakpoint(message, request, false); assertThat(breakpoint, is(equalTo(true))); }</code><technical_language>List<BreakpointMessageInterface> ignoreRules = Arrays.asList(skipBreakpoint);</technical_language>

Target:
void shouldBeBreakpointIfIgnoreRulesMatchButNotEnable(boolean request) { Message message = mock(Message.class); given(message.isInScope()).willReturn(true); given(breakpointManagementInterface.isBreakRequest()).willReturn(true); given(breakpointManagementInterface.isBreakResponse()).willReturn(true); BreakpointMessageInterface skipBreakpoint = mock(BreakpointMessageInterface.class); given(skipBreakpoint.isEnabled()).willReturn(false); given(skipBreakpoint.match(message, request, false)).willReturn(true); List<BreakpointMessageInterface> ignoreRules = Arrays.asList(skipBreakpoint); breakpointMessageHandler.setEnabledIgnoreRules(ignoreRules); boolean breakpoint = breakpointMessageHandler.isBreakpoint(message, request, false); assertThat(breakpoint, is(equalTo(true))); }
Source:
<code>public static void main(String[] args) throws Exception { String projectId = requiredProperty("bigtable.projectID"); String instanceId = requiredProperty("bigtable.instanceID"); String table = System.getProperty("bigtable.table", "ManyThreadDriver"); recordCount = Long.parseLong(System.getProperty("recordCount", "100000")); valueSize = Integer.parseInt(System.getProperty("valueSize", "1024")); <START> runtimeInHour = Integer.parseInt(System.getProperty("runtimeInHour", "1")); <END> numThreads = Integer.parseInt(System.getProperty("numThreads", "1000")); runTest(projectId, instanceId, table); }</code><technical_language>runtimeHours</technical_language>

Target:
public static void main(String[] args) throws Exception { String projectId = requiredProperty("bigtable.projectID"); String instanceId = requiredProperty("bigtable.instanceID"); String table = System.getProperty("bigtable.table", "ManyThreadDriver"); recordCount = Long.parseLong(System.getProperty("recordCount", "100000")); valueSize = Integer.parseInt(System.getProperty("valueSize", "1024")); runtimeHours = Integer.parseInt(System.getProperty("runtimeHours", "1")); numThreads = Integer.parseInt(System.getProperty("numThreads", "1000")); runTest(projectId, instanceId, table); }
Source:
<code><F extends BaseBean> JSONArray addObjectRelation(List<F> objects) { JSONArray jsonArray = new JSONArray(); <START> if (objects != null && objects.size() > 0) { <END> for (F property : objects) { jsonArray.add(addIdForRelation(property.getId())); } } return jsonArray; }</code><technical_language>add this empty list check (null check is OK)? I is necessary empty list do in for statement</technical_language>

Target:
<F extends BaseBean> JSONArray addObjectRelation(List<F> objects) { JSONArray jsonArray = new JSONArray(); if (objects != null) { for (F property : objects) { jsonArray.add(addIdForRelation(property.getId())); } } return jsonArray; }
Source:
<code>private IndexValue markAsUndeleted(StoreKey id, FileSpan fileSpan, MessageInfo info, long operationTimeMs, short lifeVersion) throws StoreException { boolean hasLifeVersion = lifeVersion > (short) -1; validateFileSpan(fileSpan, true); IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } else if (value != null) { if (hasLifeVersion) { if (value.getLifeVersion() >= lifeVersion) { throw new StoreException("LifeVersion conflict in index. Id " + id + " LifeVersion: " + value.getLifeVersion() + " Undelete LifeVersion: " + lifeVersion, StoreErrorCodes.Life_Version_Conflict); } } else { <START> lifeVersion = (short) (value.getLifeVersion() + 1); <END> if (!value.isFlagSet(IndexValue.Flags.Delete_Index)) { throw new StoreException("Id " + id + " not deleted in index " + dataDir, StoreErrorCodes.ID_Not_Deleted); } } } long size = fileSpan.getEndOffset().getOffset() - fileSpan.getStartOffset().getOffset(); IndexValue newValue; newValue = new IndexValue(value.getSize(), value.getOffset(), value.getFlags(), value.getExpiresAtMs(), operationTimeMs, value.getAccountId(), value.getContainerId(), lifeVersion); newValue.setNewOffset(fileSpan.getStartOffset()); newValue.setNewSize(size); newValue.setFlag(IndexValue.Flags.Undelete_Index); addToIndex(new IndexEntry(id, newValue, null), fileSpan); return newValue; }</code><technical_language>Do need comparison liftVersion vaule.getLiftVersion() verify them</technical_language>

Target:
private IndexValue markAsUndeleted(StoreKey id, FileSpan fileSpan, MessageInfo info, long operationTimeMs, short lifeVersion) throws StoreException { boolean hasLifeVersion = lifeVersion > (short) -1; validateFileSpan(fileSpan, true); IndexValue value = findKey(id); if (value == null) { throw new StoreException("Id " + id + " not present in index " + dataDir, StoreErrorCodes.ID_Not_Found); } else if (value != null) { if (hasLifeVersion) { if (value.getLifeVersion() >= lifeVersion) { throw new StoreException("LifeVersion conflict in index. Id " + id + " LifeVersion: " + value.getLifeVersion() + " Undelete LifeVersion: " + lifeVersion, StoreErrorCodes.Life_Version_Conflict); } } else { lifeVersion = (short) (value.getLifeVersion() + 1); if (!value.isFlagSet(IndexValue.Flags.Delete_Index)) { throw new StoreException("Id " + id + " not deleted in index " + dataDir, StoreErrorCodes.ID_Not_Deleted); } } } long size = fileSpan.getEndOffset().getOffset() - fileSpan.getStartOffset().getOffset(); IndexValue newValue; newValue = new IndexValue(value.getSize(), value.getOffset(), value.getFlags(), value.getExpiresAtMs(), operationTimeMs, value.getAccountId(), value.getContainerId(), lifeVersion); newValue.setNewOffset(fileSpan.getStartOffset()); newValue.setNewSize(size); newValue.setFlag(IndexValue.Flags.Undelete_Index); newValue.clearFlag(IndexValue.Flags.Delete_Index); addToIndex(new IndexEntry(id, newValue, null), fileSpan); return newValue; }
Source:
<code>public String getMethodName() { <START> return "put"; <END> }</code><technical_language>this putTransient of IMap#putTransient</technical_language>

Target:
public String getMethodName() { return "putTransient"; }
Source:
<code>protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertNotNull(courseId); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertNotNull(feedbackSessionName); FeedbackSessionStatsPageData data = new FeedbackSessionStatsPageData(account); FeedbackSessionAttributes fsa = logic.getFeedbackSession(feedbackSessionName, courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible( instructor, fsa, false); data.sessionDetails = logic.getFeedbackSessionDetails(feedbackSessionName, courseId); <START> statusToAdmin = "Load feedback session details:<br>" + "Session name: " + feedbackSessionName; <END> return createAjaxResult(data); }</code><technical_language>This issue is InstructorHomePage I is need do for other places here. Instead, open a new issue add statusToAdmin other Actions it</technical_language>

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); Assumption.assertNotNull(courseId); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Assumption.assertNotNull(feedbackSessionName); FeedbackSessionStatsPageData data = new FeedbackSessionStatsPageData(account); FeedbackSessionAttributes fsa = logic.getFeedbackSession(feedbackSessionName, courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible( instructor, fsa, false); data.sessionDetails = logic.getFeedbackSessionDetails(feedbackSessionName, courseId); return createAjaxResult(data); }
Source:
<code>public String getError() { <START> return "The entry's parent tombstoned"; <END> }</code><technical_language>again, text. needs get in docs too. "The entry in metastore database a parent entry is a tombstone marker"</technical_language>

Target:
public String getError() { return "The entry in the metastore database has a parent entry " + "which is a tombstone marker"; }
Source:
<code><START> public boolean isMaskFormatValid(String mask) { <END> return mask != null && mask.matches(ValidationUtils.NETMASK_PATTERN); }</code><technical_language>Again, I aggregating method is required. need validate a valid prefix format validate a valid netmask format. in frontend need this separation</technical_language>

Target:
public boolean isMaskFormatValid(String mask) { return mask != null && mask.matches(ValidationUtils.NETMASK_PATTERN + "|" + ValidationUtils.SUBNET_PATTERN_AS_NETMASK_WITH_OPTIONAL_PREFIX_SLASH); }
Source:
<code>public final int getRefCount() { <START> return refs == null ? 0 : refs.length; <END> }</code><technical_language>Instead of a null test here, a NO_REFS empty array constant initialize refs in constructor it. need worry null here, in getRef()</technical_language>

Target:
public final int getRefCount() { return refs.length; }
Source:
<code>public void optInMercury() { <START> MercuryContent.turnOnMercurySkin(driver, MercuryContent.MERCURY_WIKI); <END> }</code><technical_language>Please change MercuryContent.MERCURY_WIKI wikiURL</technical_language>

Target:
public void optInMercury() { MercuryContent.turnOnMercurySkin(driver, wikiURL); }
Source:
<code>protected void clientInit() { configuration.setApi(getApi()); configuration.setProfileDefinition(new TwitterProfileDefinition()); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> denied = ctx.getRequestParameter("denied"); <START> if (CommonHelper.isNotBlank(denied.orElse(null))) { <END> return true; } else { return false; } }); defaultLogoutActionBuilder((ctx, profile, targetUrl) -> Optional.of(RedirectAction.redirect("<LINK_0>"))); super.clientInit(); }</code><technical_language>prefer map and/or flatMap nulls while it: replace awful return true/false returning condition in if :)</technical_language>

Target:
protected void clientInit() { configuration.setApi(getApi()); configuration.setProfileDefinition(new TwitterProfileDefinition()); configuration.setHasBeenCancelledFactory(ctx -> { final Optional<String> denied = ctx.getRequestParameter("denied"); return denied.map(d -> CommonHelper.isNotBlank(d)).orElse(false); }); defaultLogoutActionBuilder((ctx, profile, targetUrl) -> Optional.of(RedirectAction.redirect("<LINK_0>"))); super.clientInit(); }
Source:
<code>public boolean canHandle(Resource resource, ResourceStrategyType resourceStrategyType) { boolean canHandle = false; switch (resourceStrategyType) { case UNLOAD_AT_RESOURCESET_DISPOSE: if (resource != null) { canHandle = <START> resource.getResourceSet().getPackageRegistry().getEPackage(resource.getURI().toString()) != <END> null; } break; default: break; } return canHandle; }</code><technical_language>getEPackage expects nsURI of EPackage, a resource URI</technical_language>

Target:
public boolean canHandle(Resource resource, ResourceStrategyType resourceStrategyType) { boolean canHandle = false; switch (resourceStrategyType) { case UNLOAD_AT_RESOURCESET_DISPOSE: if (resource != null) { List<EObject> contents = resource.getContents(); if (contents.size() > 0 && contents.get(0) instanceof EPackage) { EPackage pack = (EPackage) contents.get(0); canHandle = resource.getResourceSet().getPackageRegistry().getEPackage(pack.getNsURI()) != null; } } break; default: break; } return canHandle; }
Source:
<code>protected void executeVmCommand() { Guid createdSnapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); getParameters().setSnapshotType(determineSnapshotType()); getSnapshotDao().updateId(createdSnapshotId, newActiveSnapshotId); setActionReturnValue(createdSnapshotId); MemoryImageBuilder memoryImageBuilder = getMemoryImageBuilder(); addSnapshotToDB(createdSnapshotId, memoryImageBuilder); createSnapshotsForDisks(); fastForwardDisksToActiveSnapshot(); memoryImageBuilder.build(); boolean pendingAsyncTasks = <START> !getReturnValue().getVdsmTaskIdList().isEmpty() <END> || !CommandCoordinatorUtil.getChildCommandIds(getCommandId()).isEmpty(); if (!pendingAsyncTasks) { getParameters().setTaskGroupSuccess(true); incrementVmGeneration(); } setSucceeded(true); }</code><technical_language>check if u 'getTaskIdList'</technical_language>

Target:
protected void executeVmCommand() { Guid createdSnapshotId = getSnapshotDao().getId(getVmId(), SnapshotType.ACTIVE); getParameters().setSnapshotType(determineSnapshotType()); getSnapshotDao().updateId(createdSnapshotId, newActiveSnapshotId); setActionReturnValue(createdSnapshotId); MemoryImageBuilder memoryImageBuilder = getMemoryImageBuilder(); addSnapshotToDB(createdSnapshotId, memoryImageBuilder); createSnapshotsForDisks(); fastForwardDisksToActiveSnapshot(); memoryImageBuilder.build(); boolean pendingAsyncTasks = !getTaskIdList().isEmpty() || !CommandCoordinatorUtil.getChildCommandIds(getCommandId()).isEmpty(); if (!pendingAsyncTasks) { getParameters().setTaskGroupSuccess(true); incrementVmGeneration(); } setSucceeded(true); }
Source:
<code>public void registerChannelListener(final Map<String, Object> channelConfig, final ChannelListener listener) throws ConnectionException { try { TiSensorTag sensorTag = getSensorTag(SensorTagChannelDescriptor.getSensorTagAddress(channelConfig)); if (sensorTag.isConnected()) { SensorListener sensorListener = getSensorListener(sensorTag, SensorTagChannelDescriptor.getSensorName(channelConfig).toString().split("_")[0], SensorTagChannelDescriptor.getNotificationPeriod(channelConfig)); sensorListener.addChannelName((String) channelConfig.get("+name")); sensorListener.addDataType(DataType.getDataType((String) channelConfig.get("+value.type"))); sensorListener.addListener(listener); sensorListener.addSensorName(SensorTagChannelDescriptor.getSensorName(channelConfig)); registerNotification(sensorListener); } else { <START> logger.info("Listener registration failed: TiSensorTag not connected"); <END> } } catch (KuraBluetoothIOException | KuraBluetoothConnectionException e) { logger.error("Listener registration failed", e); } }</code><technical_language>a warn</technical_language>

Target:
public void registerChannelListener(final Map<String, Object> channelConfig, final ChannelListener listener) throws ConnectionException { try { TiSensorTag sensorTag = getSensorTag(SensorTagChannelDescriptor.getSensorTagAddress(channelConfig)); if (sensorTag.isConnected()) { SensorListener sensorListener = getSensorListener(sensorTag, SensorTagChannelDescriptor.getSensorName(channelConfig).toString().split("_")[0], SensorTagChannelDescriptor.getNotificationPeriod(channelConfig)); sensorListener.addChannelName((String) channelConfig.get("+name")); sensorListener.addDataType(DataType.getDataType((String) channelConfig.get("+value.type"))); sensorListener.addListener(listener); sensorListener.addSensorName(SensorTagChannelDescriptor.getSensorName(channelConfig)); registerNotification(sensorListener); } else { logger.warn("Listener registration failed: TiSensorTag not connected"); } } catch (KuraBluetoothIOException | ConnectionException e) { logger.error("Listener registration failed", e); } }
Source:
<code>public void createOrUpdateUser() throws Exception { createClientWithTokenOrPassword(); String name = "testCreateOrUpdateUser"; String externalId = "testCreateOrUpdateUser"; <START> for (User u : instance.getUsers()) { <END> if (externalId.equals(u.getExternalId())) { instance.deleteUser(u.getId()); } } String phoneAtCreation = "5555551234"; User user = new User(true, name); user.setExternalId(externalId); user.setPhone(phoneAtCreation); User createResult = instance.createOrUpdateUser(user); assertNotNull(createResult); assertNotNull(createResult.getId()); assertEquals(name, createResult.getName()); assertEquals(externalId, createResult.getExternalId()); assertEquals(phoneAtCreation, createResult.getPhone()); String phoneAtUpdate = "5555551235"; User updateUser = new User(true, name); updateUser.setId(createResult.getId()); updateUser.setExternalId(externalId); updateUser.setPhone(phoneAtUpdate); User updateResult = instance.createOrUpdateUser(updateUser); assertNotNull(updateResult); assertEquals(createResult.getId(), updateResult.getId()); assertEquals(name, updateResult.getName()); assertEquals(externalId, updateResult.getExternalId()); assertEquals(phoneAtUpdate, updateResult.getPhone()); instance.deleteUser(updateResult); }</code><technical_language>Instead of iterating users external id</technical_language>

Target:
public void createOrUpdateUser() throws Exception { createClientWithTokenOrPassword(); String name = "testCreateOrUpdateUser"; String externalId = "testCreateOrUpdateUser"; for (User u: instance.lookupUserByExternalId(externalId)){ instance.deleteUser(u.getId()); } String phoneAtCreation = "5555551234"; User user = new User(true, name); user.setExternalId(externalId); user.setPhone(phoneAtCreation); User createResult = instance.createOrUpdateUser(user); assertNotNull(createResult); assertNotNull(createResult.getId()); assertEquals(name, createResult.getName()); assertEquals(externalId, createResult.getExternalId()); assertEquals(phoneAtCreation, createResult.getPhone()); String phoneAtUpdate = "5555551235"; User updateUser = new User(true, name); updateUser.setId(createResult.getId()); updateUser.setExternalId(externalId); updateUser.setPhone(phoneAtUpdate); User updateResult = instance.createOrUpdateUser(updateUser); assertNotNull(updateResult); assertEquals(createResult.getId(), updateResult.getId()); assertEquals(name, updateResult.getName()); assertEquals(externalId, updateResult.getExternalId()); assertEquals(phoneAtUpdate, updateResult.getPhone()); instance.deleteUser(updateResult); }
Source:
<code>public boolean checkAndNotify() { AsyncFileAlterationListener listenerCopy; synchronized (processingLock) { if (processing.get() != 0) { LOGGER.debug( "{} files are still processing. Waiting until the list is empty", processing.get()); return false; } else if (isProcessing) { LOGGER.debug("Another thread is currently running, returning until next poll"); return false; } <START> isProcessing = true; <END> synchronized (listenerLock) { if (listener == null) { isProcessing = false; return false; } listenerCopy = listener; } } if (rootFile.checkNetwork()) { checkAndNotify(rootFile, rootFile.getChildren(), listFiles(rootFile.getFile()), listenerCopy); } else { LOGGER.debug( "The monitored file does not exist. No file fileLocks will be done through the CDM", rootFile.getName()); } isProcessing = false; return true; }</code><technical_language>isProcessing is read modified of a single lock, defined volatile ensure is date. read updated lock</technical_language>

Target:
public boolean checkAndNotify() { AsyncFileAlterationListener listenerCopy; synchronized (processingLock) { if (processing.get() != 0) { LOGGER.debug( "{} files are still processing. Waiting until the list is empty", processing.get()); return false; } else if (isProcessing) { LOGGER.debug("Another thread is currently running, returning until next poll"); return false; } isProcessing = true; synchronized (listenerLock) { if (listener == null) { isProcessing = false; return false; } listenerCopy = listener; } } if (rootFile.checkNetwork()) { checkAndNotify(rootFile, rootFile.getChildren(), listFiles(rootFile.getFile()), listenerCopy); } else { LOGGER.debug( "The monitored file does not exist. No file fileLocks will be done through the CDM", rootFile.getName()); } synchronized (processingLock) { isProcessing = false; } return true; }
Source:
<code>public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> eventType) throws TmfTraceException { setCacheSize(); super.initTrace(resource, path, eventType); try { this.fTrace = new CTFTrace(path); CtfIteratorManager.addTrace(this); CtfTmfContext ctx; ctx = (CtfTmfContext) seekEvent(0L); CtfTmfEvent event = getNext(ctx); if ((ctx.getLocation().equals(CtfIterator.NULL_LOCATION)) || (ctx.getCurrentEvent() == null)) { this.setStartTime(TmfTimestamp.BIG_BANG); } else { final ITmfTimestamp curTime = event.getTimestamp(); this.setStartTime(curTime); this.setEndTime(curTime); } <START> CtfIterator iter = CtfIteratorManager.getIterator(this, ctx); <END> for (IEventDeclaration ied : iter.getEventDeclarations()) { CtfTmfEventType ctfTmfEventType = CtfTmfEventType.get(this, ied.getName()); if (ctfTmfEventType == null) { List<ITmfEventField> content = new ArrayList<>(); for (String fieldName : ied.getFields().getFieldsList()) { content.add(new TmfEventField(fieldName, null, null)); } ITmfEventField contentTree = new TmfEventField(ITmfEventField.ROOT_FIELD_ID, null, content.toArray(new ITmfEventField[content.size()])); ctfTmfEventType = new CtfTmfEventType(ied.getName(), this, contentTree); } } } catch (final CTFReaderException e) { throw new TmfTraceException(e.getMessage(), e); } }</code><technical_language>iter get closed. (The warnings coming!)</technical_language>

Target:
public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> eventType) throws TmfTraceException { setCacheSize(); super.initTrace(resource, path, eventType); try { this.fTrace = new CTFTrace(path); CtfIteratorManager.addTrace(this); CtfTmfContext ctx; ctx = (CtfTmfContext) seekEvent(0L); CtfTmfEvent event = getNext(ctx); if ((ctx.getLocation().equals(CtfIterator.NULL_LOCATION)) || (ctx.getCurrentEvent() == null)) { this.setStartTime(TmfTimestamp.BIG_BANG); } else { final ITmfTimestamp curTime = event.getTimestamp(); this.setStartTime(curTime); this.setEndTime(curTime); } try (CtfIterator iter = CtfIteratorManager.getIterator(this, ctx)) { for (IEventDeclaration ied : iter.getEventDeclarations()) { CtfTmfEventType ctfTmfEventType = CtfTmfEventType.get(this, ied.getName()); if (ctfTmfEventType == null) { List<ITmfEventField> content = new ArrayList<>(); for (String fieldName : ied.getFields().getFieldsList()) { content.add(new TmfEventField(fieldName, null, null)); } ITmfEventField contentTree = new TmfEventField( ITmfEventField.ROOT_FIELD_ID, null, content.toArray(new ITmfEventField[content.size()]) ); ctfTmfEventType = new CtfTmfEventType(ied.getName(), this, contentTree); } } } } catch (final CTFReaderException e) { throw new TmfTraceException(e.getMessage(), e); } }
Source:
<code>public void testCreateOrReplaceGenericResource() { ConfigMap configMap = new ConfigMapBuilder() .withNewMetadata().withName("resource-cm-1").endMetadata() .addToData("a1", "A1") .addToData("a2", "A2") .build(); ConfigMap createdResource = client.resource(configMap).inNamespace(session.getNamespace()).createOrReplace(); configMap.setData(Collections.singletonMap("b1", "B1")); ConfigMap replacedResource = client.resource(configMap).inNamespace(session.getNamespace()).createOrReplace(); assertNotNull(createdResource); assertEquals(2, createdResource.getData().size()); assertEquals("A1", createdResource.getData().get("a1")); <START> assertEquals("A2", createdResource.getData().get("a2")); <END> assertNotNull(replacedResource); assertEquals(1, replacedResource.getData().size()); assertEquals("B1", replacedResource.getData().get("b1")); client.resource(configMap).inNamespace(session.getNamespace()).delete(); }</code><technical_language>this belongs a teardown method. If this test fails, cleaned rest of tests run fail (if this cleanup is necessary)</technical_language>

Target:
public void testCreateOrReplaceGenericResource() { ConfigMap configMap = new ConfigMapBuilder() .withNewMetadata().withName("resource-cm-1").endMetadata() .addToData("a1", "A1") .addToData("a2", "A2") .build(); ConfigMap createdResource = client.resource(configMap).inNamespace(session.getNamespace()).createOrReplace(); configMap.setData(Collections.singletonMap("b1", "B1")); this.resource = client.resource(configMap).inNamespace(session.getNamespace()).createOrReplace(); assertNotNull(createdResource); assertEquals(2, createdResource.getData().size()); assertEquals("A1", createdResource.getData().get("a1")); assertEquals("A2", createdResource.getData().get("a2")); ConfigMap replacedResource = (ConfigMap) this.resource; assertNotNull(replacedResource); assertEquals(1, replacedResource.getData().size()); assertEquals("B1", replacedResource.getData().get("b1")); }
Source:
<code><START> public SQLiteDatabase getReadableDatabase() { <END> SQLiteDatabase db = readableDatabase; if (db == null) { synchronized (databaseLock) { db = readableDatabase; if (db == null) { if (logging) log("Creating readable database"); db = readableDatabase = helper.getReadableDatabase(); } } } return db; }</code><technical_language>add @NonNull @CheckResult @WorkerThread methods well</technical_language>

Target:
public SQLiteDatabase getReadableDatabase() { return helper.getReadableDatabase(); }
Source:
<code><START> protected void connect() throws IOException <END> { mbeanServerConn = null; jmxc = null; ssProxy = StorageService.instance; msProxy = MessagingService.instance(); streamProxy = StreamManager.instance; compactionProxy = CompactionManager.instance; fdProxy = (FailureDetectorMBean) FailureDetector.instance; cacheService = CacheService.instance; spProxy = StorageProxy.instance; hhProxy = HintedHandOffManager.instance; gcProxy = new GCInspector(); gossProxy = Gossiper.instance; memProxy = ManagementFactory.getMemoryMXBean(); runtimeProxy = ManagementFactory.getRuntimeMXBean(); }</code><technical_language>method is throw IOException. get rid of this</technical_language>

Target:
protected void connect() { mbeanServerConn = null; jmxc = null; ssProxy = StorageService.instance; msProxy = MessagingService.instance(); streamProxy = StreamManager.instance; compactionProxy = CompactionManager.instance; fdProxy = (FailureDetectorMBean) FailureDetector.instance; cacheService = CacheService.instance; spProxy = StorageProxy.instance; hhProxy = HintedHandOffManager.instance; gcProxy = new GCInspector(); gossProxy = Gossiper.instance; memProxy = ManagementFactory.getMemoryMXBean(); runtimeProxy = ManagementFactory.getRuntimeMXBean(); }