auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public BeaconMonitoring( boolean runDiscovery, int timeFrequency, Set<BackendlessBeacon> monitoredBeacons ) { if( timeFrequency < 0 ) <START> throw new IllegalArgumentException( ExceptionMessage.INVALID_LOG_POLICY ); <END> if(monitoredBeacons == null) receiveBeaconsInfo(); this.discovery = runDiscovery; super.setTimeFrequency( timeFrequency ); }</code><technical_language>ExceptionMessage.INVALID_LOG_POLICY << right</technical_language>

Target:
public BeaconMonitoring( boolean runDiscovery, int timeFrequency, Set<BackendlessBeacon> monitoredBeacons ) { if(monitoredBeacons == null) receiveBeaconsInfo(); this.discovery = runDiscovery; super.setTimeFrequency( timeFrequency ); }
Source:
<code>public boolean isValid(List<VdsNetworkInterface> value, ConstraintValidatorContext context) { List<String> staticIps = new ArrayList<String>(); for (VdsNetworkInterface networkInterface : value) { <START> if (NetworkBootProtocol.StaticIp.equals(networkInterface.getBootProtocol())) { <END> if (staticIps.contains(networkInterface.getAddress())) { return false; } else { staticIps.add(networkInterface.getAddress()); } } } return true; }</code><technical_language>please operator == enum.equals for comparison of enum values</technical_language>

Target:
public boolean isValid(List<VdsNetworkInterface> value, ConstraintValidatorContext context) { List<String> staticIps = new ArrayList<String>(); for (VdsNetworkInterface networkInterface : value) { if (networkInterface.getBootProtocol() == NetworkBootProtocol.StaticIp && validAddress(networkInterface.getAddress())) { if (staticIps.contains(networkInterface.getAddress())) { return false; } else { staticIps.add(networkInterface.getAddress()); } } } return true; }
Source:
<code>public void setConfig(Conversion config) { <START> this.config = config; <END> }</code><technical_language>assert.NotNull</technical_language>

Target:
public void setConfig(Conversion config) { Assert.notNull(config, "Conversion argument cannot be null."); this.config = config; }
Source:
<code>public void stressCache() throws Exception { StringFactory factory = new StringFactory(); SpatialIndexCache<String,Exception> cache = new SpatialIndexCache<>( factory ); CacheStresser[] stressers = new CacheStresser[100]; for ( int i = 0; i < stressers.length; i++ ) { stressers[i] = new CacheStresser( cache ); stressers[i].start(); } Thread.sleep( 5_000 ); for ( CacheStresser stresser : stressers ) { <START> stresser.interrupt(); <END> } for ( CacheStresser stresser : stressers ) { stresser.join(); } for ( CacheStresser stresser : stressers ) { assertNull( stresser.failed ); } }</code><technical_language>please custom flag stop work instead of interrupts</technical_language>

Target:
public void stressCache() throws Exception { StringFactory factory = new StringFactory(); SpatialIndexCache<String> cache = new SpatialIndexCache<>( factory ); ExecutorService pool = Executors.newFixedThreadPool( 20 ); Future<?>[] futures = new Future[100]; AtomicBoolean shouldContinue = new AtomicBoolean( true ); try { for ( int i = 0; i < futures.length; i++ ) { futures[i] = pool.submit( new CacheStresser( cache, shouldContinue ) ); } Thread.sleep( 5_000 ); shouldContinue.set( false ); for ( Future<?> future : futures ) { future.get( 10, TimeUnit.SECONDS ); } } finally { pool.shutdown(); } }
Source:
<code>public boolean hasFinishedWonder() { <START> return Asset.getAsset(getAssets(),ASSET_WONDER_STAGES) == wonder.getStages().size(); <END> }</code><technical_language>Gonna call this a blocker</technical_language>

Target:
public boolean hasFinishedWonder() { return wonder.getNextStage() == null; }
Source:
<code>private void normalize(String[] lineValues) throws FormatException { for (int i = 0; i < lineValues.length; i++) { if (lineValues[i] == null) { if ("error".equals(m_blank)) { throw new FormatException("Blank values are not allowed"); } } else { if (m_nowhitespace && (lineValues[i].charAt(0) == ' ' || lineValues[i].charAt(lineValues[i].length() - 1) == ' ')) { throw new FormatException("Whitespace detected--nowhitespace is used"); } else { lineValues[i] = lineValues[i].trim(); } if (!m_customNullString.isEmpty()) { if (m_customNullString.equals(lineValues[i])) { lineValues[i] = null; } <START> } else if (lineValues[i].equals("NULL") || lineValues[i].equals(CSV_NULL) <END> || lineValues[i].equals(QUOTED_CSV_NULL)) { lineValues[i] = null; } } } }</code><technical_language>"NULL".equals(lineValues[i]) || CSV_NULL.equals(lineValues[i])</technical_language>

Target:
private void normalize(String[] lineValues) throws FormatException { for (int i = 0; i < lineValues.length; i++) { if (lineValues[i] == null) { if ("error".equals(m_blank)) { throw new FormatException("Blank values are not allowed"); } } else { if (m_nowhitespace && (lineValues[i].charAt(0) == ' ' || lineValues[i].charAt(lineValues[i].length() - 1) == ' ')) { throw new FormatException("Whitespace detected--nowhitespace is used"); } else { lineValues[i] = lineValues[i].trim(); } if (!m_customNullString.isEmpty()) { if (m_customNullString.equals(lineValues[i])) { lineValues[i] = null; } } else if ("NULL".equals(lineValues[i]) || CSV_NULL.equalsIgnoreCase(lineValues[i]) || QUOTED_CSV_NULL.equals(lineValues[i])) { lineValues[i] = null; } } } }
Source:
<code>public void shouldFailWithAdditionalInfosWhenReadingDBlobContent() throws IOException { SimpleManagedBlob mock = Mockito.mock(SimpleManagedBlob.class); when(mock.getEncoding()).thenReturn("UTF-8"); when(mock.getKey()).thenReturn("anyKey:anyKey"); when(mock.getProviderId()).thenReturn("anyProvider:anyProvider"); when(mock.getMimeType()).thenReturn("text/html"); when(mock.getDigest()).thenReturn("anyDigest"); when(mock.getStream()).thenThrow(IOException.class); try { cs.convert("html2text", new SimpleBlobHolder(mock), Collections.emptyMap()); } catch (ConversionException e) { assertTrue(e.getInfos().size() == 2); assertTrue(e.getInfos().get(0).contains("anyProvider:anyProvider")); assertTrue(e.getInfos().get(1).contains("anyKey:anyKey")); <START> <END> } }</code><technical_language>Blank line needed</technical_language>

Target:
public void shouldFailWithAdditionalInfosWhenReadingDBlobContent() throws IOException { SimpleManagedBlob mock = Mockito.mock(SimpleManagedBlob.class); when(mock.getEncoding()).thenReturn("UTF-8"); when(mock.getKey()).thenReturn("anyKey:anyKey"); when(mock.getProviderId()).thenReturn("anyProvider:anyProvider"); when(mock.getMimeType()).thenReturn("text/html"); when(mock.getDigest()).thenReturn("anyDigest"); when(mock.getStream()).thenThrow(IOException.class); try { cs.convert("html2text", new SimpleBlobHolder(mock), Collections.emptyMap()); fail("Should have raised a ConversionException"); } catch (ConversionException e) { assertEquals(1, e.getInfos().size()); assertTrue(e.getInfos().get(0).contains("anyProvider:anyProvider")); assertTrue(e.getInfos().get(0).contains("anyKey:anyKey")); } }
Source:
<code>public void testSinkTasksHandleCloseErrors() throws Exception { createTask(initialState); expectInitializeTask(); expectTaskGetTopic(true); expectConsumerPoll(1); expectConversionAndTransformation(1); sinkTask.put(EasyMock.anyObject()); PowerMock.expectLastCall().andVoid(); expectConsumerPoll(1); expectConversionAndTransformation(1); <START> Throwable a = new RuntimeException(); <END> sinkTask.put(EasyMock.anyObject()); PowerMock.expectLastCall().andThrow(a); EasyMock.expect(sinkTask.preCommit(EasyMock.anyObject())) .andStubReturn(Collections.emptyMap()); Throwable b = new RuntimeException(); sinkTask.close(EasyMock.anyObject()); PowerMock.expectLastCall().andThrow(b); PowerMock.replayAll(); workerTask.initialize(TASK_CONFIG); try { workerTask.execute(); fail(); } catch (Throwable t) { PowerMock.verifyAll(); assertNotEquals(b, t); assertSame(a, t.getCause()); assertTrue(t.getSuppressed().length > 0); assertSame(b, t.getSuppressed()[0]); } }</code><technical_language>If refer this while making assertions, a more descriptive name readability. putFailure closeFailure below, maybe</technical_language>

Target:
public void testSinkTasksHandleCloseErrors() throws Exception { createTask(initialState); expectInitializeTask(); expectTaskGetTopic(true); expectConsumerPoll(1); expectConversionAndTransformation(1); sinkTask.put(EasyMock.anyObject()); PowerMock.expectLastCall().andVoid(); expectConsumerPoll(1); expectConversionAndTransformation(1); sinkTask.put(EasyMock.anyObject()); PowerMock.expectLastCall().andAnswer(() -> { workerTask.stop(); return null; }); consumer.wakeup(); PowerMock.expectLastCall(); EasyMock.expect(sinkTask.preCommit(EasyMock.anyObject())) .andStubReturn(Collections.emptyMap()); Throwable closeException = new RuntimeException(); sinkTask.close(EasyMock.anyObject()); PowerMock.expectLastCall().andThrow(closeException); PowerMock.replayAll(); workerTask.initialize(TASK_CONFIG); try { workerTask.execute(); fail("workerTask.execute should have thrown an exception"); } catch (RuntimeException e) { PowerMock.verifyAll(); assertSame("Exception from close should propagate as-is", closeException, e); } }
Source:
<code>public Builder withAutoscaleDisabledVmDurationInSecs(long disabledVmDurationInSecs) { <START> if(disabledVmDurationInSecs > 0L) <END> throw new IllegalArgumentException("disabledVmDurationInSecs must be greater than 0: " + disabledVmDurationInSecs); this.disabledVmDurationInSecs = disabledVmDurationInSecs; return this; }</code><technical_language><= 0</technical_language>

Target:
public Builder withAutoscaleDisabledVmDurationInSecs(long disabledVmDurationInSecs) { if(disabledVmDurationInSecs <= 0L) { throw new IllegalArgumentException("disabledVmDurationInSecs must be greater than 0: " + disabledVmDurationInSecs); } this.disabledVmDurationInSecs = disabledVmDurationInSecs; return this; }
Source:
<code>public void aggregate(final ByteBuffer buf, final int position) { final IndexedInts keys = keySelector.getRow(); if (keys == null) { return; } <START> final WritableMemory mem = WritableMemory.wrap(buf); <END> final WritableMemory region = mem.writableRegion(position, maxIntermediateSize); final ArrayOfDoublesUpdatableSketch sketch = ArrayOfDoublesSketches.wrapUpdatableSketch(region); final double[] values = new double[valueSelectors.size()]; int valueIndex = 0; for (final BaseDoubleColumnValueSelector valueSelector : valueSelectors) { values[valueIndex++] = valueSelector.getDouble(); } for (int i = 0; i < keys.size(); i++) { final String key = keySelector.lookupName(keys.get(i)); sketch.update(key, values); } }</code><technical_language>Consider similar optimization e. g. in SketchBufferAggregator</technical_language>

Target:
public void aggregate(final ByteBuffer buf, final int position) { for (int i = 0; i < valueSelectors.length; i++) { values[i] = valueSelectors[i].getDouble(); } final IndexedInts keys = keySelector.getRow(); final WritableMemory mem = WritableMemory.wrap(buf); final WritableMemory region = mem.writableRegion(position, maxIntermediateSize); final Lock lock = stripedLock.getAt(lockIndex(position)).writeLock(); lock.lock(); try { final ArrayOfDoublesUpdatableSketch sketch = ArrayOfDoublesSketches.wrapUpdatableSketch(region); for (int i = 0, keysSize = keys.size(); i < keysSize; i++) { final String key = keySelector.lookupName(keys.get(i)); sketch.update(key, values); } } finally { lock.unlock(); } }
Source:
<code>public EventTypeSchema getSchemaVersion(final String name, final String version) throws NoSuchSchemaException, IllegalVersionNumberException, InternalNakadiException { <START> final Pattern versionPattern = Pattern.compile("\\d+\\.\\d+\\.\\d+"); <END> final Matcher versionMatcher = versionPattern.matcher(version); if (!versionMatcher.matches()) { throw new IllegalVersionNumberException(version); } final String sql = "SELECT ets_schema_object FROM zn_data.event_type_schema " + "WHERE ets_event_type_name = ? AND ets_schema_object ->> 'version' = ?"; try { final List<EventTypeSchema> schemas = jdbcTemplate.query(sql, new Object[]{name, version}, new SchemaRowMapper()); if (schemas.size() != 1) throw new InternalNakadiException( String.format("Unexpected number of schemas with version {}: {}", version, schemas.size())); return schemas.get(0); } catch (EmptyResultDataAccessException e) { throw new NoSuchSchemaException("EventType \"" + name + "\" has no schema with version \"" + version + "\"", e); } }</code><technical_language>static class field in order compile call</technical_language>

Target:
public EventTypeSchema getSchemaVersion(final String name, final String version) throws NoSuchSchemaException, InternalNakadiException { final String sql = "SELECT ets_schema_object FROM zn_data.event_type_schema " + "WHERE ets_event_type_name = ? AND ets_schema_object ->> 'version' = ?"; try { final List<EventTypeSchema> schemas = jdbcTemplate.query(sql, new Object[]{name, version}, new SchemaRowMapper()); if (schemas.size() != 1) throw new InternalNakadiException( String.format("Unexpected number of schemas with version {}: {}", version, schemas.size())); return schemas.get(0); } catch (EmptyResultDataAccessException e) { throw new NoSuchSchemaException("EventType \"" + name + "\" has no schema with version \"" + version + "\"", e); } }
Source:
<code>public InlineFixedWidthHexIntegerURIHandler(final String namespace, final int fixedWidth) { super(namespace); this.fixedWidth = fixedWidth; zeroPadding = new <START> StringBuilder(); <END> for (int i = 0; i < fixedWidth; i++) { zeroPadding.append('0'); } }</code><technical_language>performance critical this section is, want give initial capacity this StringBuilder</technical_language>

Target:
public InlineFixedWidthHexIntegerURIHandler(final String namespace, final int fixedWidth) { super(namespace); this.fixedWidth = fixedWidth; zeroPadding = new StringBuilder(fixedWidth); for (int i = 0; i < fixedWidth; i++) { zeroPadding.append('0'); } }
Source:
<code>public int compare(ProtoSnippet o1, ProtoSnippet o2) { <START> if (Float.compare(o1.weight, o2.weight) != 0) { <END> return o1.weight > o2.weight ? -1 : 1; } return 0; }</code><technical_language>probable original intent avoid overhead of Float.compare call floatToIntBits do precise equality ? switch logic: if (o1.weight > o2.weight) { return -1; } else if (o1.weight < o2.weight) { return 1; } else { return 0; } clearer for findbugs care exact equality? This is for ordering I fine treat 2 weights equal (for ordering purposes) if change epsilon</technical_language>

Target:
public int compare(ProtoSnippet o1, ProtoSnippet o2) { if (o1.maxStartOffset != o2.maxStartOffset) { return o1.maxStartOffset < o2.maxStartOffset ? -1 : 1; } if (o1.minEndOffset != o2.minEndOffset) { return o1.minEndOffset < o2.minEndOffset ? -1 : 1; } return 0; }
Source:
<code>public void cleanup() throws IOException { long start = System.currentTimeMillis(); System.out.println("About to invoke cluster.cleanup()"); <START> if (plaintextCluster != null) { <END> plaintextCluster.cleanup(); } System.out.println("ServerPlaintextTokenTest::cluster.cleanup() took " + (System.currentTimeMillis() - start) + " ms."); }</code><technical_language>add prefix "About invoke" message</technical_language>

Target:
public void cleanup() throws IOException { long start = System.currentTimeMillis(); System.out.println("ServerPlaintextTokenTest::About to invoke cluster.cleanup()"); if (plaintextCluster != null) { plaintextCluster.cleanup(); } System.out.println( "ServerPlaintextTokenTest::cluster.cleanup() took " + (System.currentTimeMillis() - start) + " ms."); }
Source:
<code>private boolean securityKeyExpired(final SecurityKey securityKey) { final Date now = new Date(); final Date validTo = securityKey.getValidTo(); <START> return (validTo != null && validTo.before(now)); <END> }</code><technical_language>![MAJOR](<LINK_1> Remove useless parentheses. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private boolean securityKeyExpired(final SecurityKey securityKey) { final Date now = new Date(); final Date validTo = securityKey.getValidTo(); return validTo != null && validTo.before(now); }
Source:
<code>public RunQuickAccessProvider() { <START> super(DebugPlugin.getDefault().getLaunchManager().getLaunchMode("run")); <END> }</code><technical_language>org.eclipse.debug.core.ILaunchManager.RUN_MODE</technical_language>

Target:
public RunQuickAccessProvider() { super(DebugPlugin.getDefault().getLaunchManager().getLaunchMode(ILaunchManager.RUN_MODE)); }
Source:
<code>public static void main(String[] args) throws IOException, GeneralSecurityException { Options options = OptionsParser.parse(args, Options.class, TransmissionProbability.class.getSimpleName()); options.validateOptions(); GenomicsAuth auth = options.getGenomicsAuth(); GetVariantsSummaryResponse summary = auth.getService().variants().getSummary() .setDatasetId(options.datasetId).setFields("contigBounds").execute(); List<SearchVariantsRequest> requests = getVariantRequests(summary, options); Pipeline p = Pipeline.create(); DataflowWorkarounds.registerGenomicsCoders(p); DataflowWorkarounds.getPCollection(requests, p, options.numWorkers) .apply(ParDo.named("VariantReader") .of(new VariantReader(auth, VARIANT_FIELDS))) .apply(ParDo.named("ExtractFamilyVariantStatus") .of(new ExtractFamilyVariantStatus())) .apply(GroupByKey.<String, Boolean>create()) .apply(ParDo.named("CalculateTransmissionProbability") .of(new DoFn<KV<String, Iterable<Boolean>>, KV<String, Double>>() { @Override public void processElement(ProcessContext c) { KV<String, Iterable<Boolean>> input = c.element(); long m=0,f=0; for (Boolean b : input.getValue()) { <START> if (b) m++; <END> else f++; } double tdt = Math.pow(m-f, 2.0) / (m+f); c.output(KV.of(input.getKey(), tdt)); } })) .apply(ParDo.named("WriteDataToFile") .of(new DoFn<KV<String, Double>, String>() { @Override public void processElement(ProcessContext c) { KV<String, Double> pair = c.element(); String output = "Id : " + pair.getKey(); output += "\tValue:" + pair.getValue() + "\n"; c.output(output); } })) .apply(TextIO.Write.named("WriteCounts").to(options.output)); p.run(DataflowWorkarounds.getRunner(options)); }</code><technical_language>brackets ifs/elses, spaces operators (= above, -, + below)</technical_language>

Target:
public static void main(String[] args) throws IOException, GeneralSecurityException { Options options = OptionsParser.parse(args, Options.class, TransmissionProbability.class.getSimpleName()); options.validateOptions(); GenomicsAuth auth = options.getGenomicsAuth(); List<SearchVariantsRequest> requests = getVariantRequests(auth, options); Pipeline p = GenomicsPipeline.create(options); DataflowWorkarounds.registerGenomicsCoders(p); DataflowWorkarounds.getPCollection(requests, p, options.numWorkers) .apply(ParDo.named("VariantReader") .of(new VariantReader(auth, VARIANT_FIELDS))) .apply(ParDo.named("ExtractFamilyVariantStatus") .of(new ExtractAlleleTransmissionStatus())) .apply(GroupByKey.<Allele, Boolean>create()) .apply(ParDo.named("CalculateTransmissionProbability") .of(new CalculateTransmissionProbability())) .apply(ParDo.named("WriteDataToFile") .of(new DoFn<KV<Allele, Double>, String>() { @Override public void processElement(ProcessContext c) { KV<Allele, Double> pair = c.element(); String output = pair.getKey().getReferenceName() + "\t" + pair.getKey().getAllele() + "\t" + pair.getValue() + "\n"; c.output(output); } })) .apply(TextIO.Write.named("WriteResults").to(options.output)); p.run(); }
Source:
<code>public Boolean extract(Cursor cursor, Column column) { <START> int columnIndex = cursor.getColumnIndex(column.getName()); <END> if (cursor.isNull(columnIndex)) { return null; } try { int intValue = cursor.getInt(columnIndex); if (intValue != 0 && intValue != 1) { throw new NumberFormatException("A Boolean Column must have the value 0 or 1"); } return (intValue == 1); } catch (NumberFormatException e) { String value = cursor.getString(columnIndex); throw new IllegalStateException("Cannot extract Boolean value from Column " + column.getName() + ". Cannot convert value stored in column to a Boolean : " + value); } }</code><technical_language>Need check if column exists in cursor</technical_language>

Target:
public Boolean extract(Cursor cursor, Column column) { int columnIndex = cursor.getColumnIndex(column.getName()); if (columnIndex < 0) { throw new IllegalArgumentException("Column with name " + column.getName() + " not found."); } if (cursor.isNull(columnIndex)) { return null; } try { int intValue = cursor.getInt(columnIndex); if (intValue != 0 && intValue != 1) { throw new NumberFormatException("A Boolean Column must have the value 0 or 1"); } return (intValue == 1); } catch (NumberFormatException e) { String value = cursor.getString(columnIndex); throw new IllegalStateException("Cannot extract Boolean value from Column " + column.getName() + ". Cannot convert value stored in column to a Boolean : " + value); } }
Source:
<code>public <T> Mono<T> insert(String containerName, Object objectToSave, PartitionKey partitionKey) { Assert.hasText(containerName, "containerName should not be null, empty or only whitespaces"); Assert.notNull(objectToSave, "objectToSave should not be null"); final Class<T> domainType = (Class<T>) objectToSave.getClass(); generateIdIfNullAndAutoGenerationEnabled(objectToSave, domainType); final JsonNode originalItem = prepareToPersistAndConvertToItemProperties(objectToSave); final CosmosItemRequestOptions options = new CosmosItemRequestOptions(); CosmosAsyncContainer cosmosAsyncContainer = cosmosAsyncClient.getDatabase(this.databaseName) .getContainer(containerName); Mono<CosmosItemResponse<JsonNode>> item; if (partitionKey == null) { item = cosmosAsyncContainer.createItem(originalItem, options); } else { <START> item = cosmosAsyncContainer.createItem(originalItem, partitionKey, options); <END> } return item.publishOn(Schedulers.parallel()) .onErrorResume(throwable -> CosmosExceptionUtils.exceptionHandler("Failed to insert item", throwable)) .flatMap(cosmosItemResponse -> { CosmosUtils.fillAndProcessResponseDiagnostics(this.responseDiagnosticsProcessor, cosmosItemResponse.getDiagnostics(), null); return Mono.just(toDomainObject(domainType, cosmosItemResponse.getItem())); }); }</code><technical_language>update logic in CosmosAsyncContainer#createItem public <T> Mono<CosmosItemResponse<T>> createItem( T item, PartitionKey partitionKey, CosmosItemRequestOptions options) { if (options == null) { options = new CosmosItemRequestOptions(); } ModelBridgeInternal.setPartitionKey(options, partitionKey); return createItem(item, options); } public <T> Mono<CosmosItemResponse<T>> createItem( T item, PartitionKey partitionKey, CosmosItemRequestOptions options) { if (options == null) { options = new CosmosItemRequestOptions(); } if (partitionKey != null) { ModelBridgeInternal.setPartitionKey(options, partitionKey); } return createItem(item, options); } delete if (partitionKey == null) here</technical_language>

Target:
public <T> Mono<T> insert(String containerName, Object objectToSave, PartitionKey partitionKey) { Assert.hasText(containerName, "containerName should not be null, empty or only whitespaces"); Assert.notNull(objectToSave, "objectToSave should not be null"); final Class<T> domainType = (Class<T>) objectToSave.getClass(); generateIdIfNullAndAutoGenerationEnabled(objectToSave, domainType); final JsonNode originalItem = prepareToPersistAndConvertToItemProperties(objectToSave); final CosmosItemRequestOptions options = new CosmosItemRequestOptions(); return cosmosAsyncClient .getDatabase(this.databaseName) .getContainer(containerName) .createItem(originalItem, partitionKey, options) .publishOn(Schedulers.parallel()) .onErrorResume(throwable -> CosmosExceptionUtils.exceptionHandler("Failed to insert item", throwable)) .flatMap(cosmosItemResponse -> { CosmosUtils.fillAndProcessResponseDiagnostics(this.responseDiagnosticsProcessor, cosmosItemResponse.getDiagnostics(), null); return Mono.just(toDomainObject(domainType, cosmosItemResponse.getItem())); }); }
Source:
<code><START> public CustomizedScanInfoBuilder(ScanInfo scanInfo, Scan scan) throws IOException { <END> this.scanInfo = scanInfo; this.scan = new Scan(scan); }</code><technical_language>Scan constructor throws IOE now?? issue for this patch,</technical_language>

Target:
public CustomizedScanInfoBuilder(ScanInfo scanInfo, Scan scan) { this.scanInfo = scanInfo; try { this.scan = new Scan(scan); } catch (IOException e) { throw new AssertionError("Scan should not throw IOException", e); } }
Source:
<code>public void refresh() { query = getStringExtra(QUERY); <START> super.refresh(true); <END> }</code><technical_language>force of refreshes</technical_language>

Target:
public void refresh() { query = getStringExtra(QUERY); super.refresh(); }
Source:
<code>private static Map<String, String> createMapForSimpleDataTypes() { <START> Map<String, String> mapDataTypeNamesToDisplayNames = new HashMap<>(); <END> for (String simpleDataType : simpleDataTypes) { mapDataTypeNamesToDisplayNames.put(simpleDataType, simpleDataType); } return mapDataTypeNamesToDisplayNames; }</code><technical_language>resolut more readable Streams here, perform a map operation finally collect a Map type.. major</technical_language>

Target:
static Map<String, String> createMapForSimpleDataTypes() { if (simpleDataTypes == null) { return new HashMap<>(); } return simpleDataTypes.stream().collect(toMap(x -> x, x -> x)); }
Source:
<code>private void attachNetwork(Guid clusterId, NetworkCluster networkCluster, Network network) { getNetworkClusterDao().save(new NetworkCluster(clusterId, network.getId(), NetworkStatus.OPERATIONAL, false, networkCluster.isRequired(), false, false, false)); <START> List<VDS> hosts = getVdsDao().getAllForVdsGroup(clusterId); <END> List<Network> clusterNetworks = networkDao.getAllForCluster(clusterId); for (VDS host : hosts) { HostNetworkAttachmentsPersister persister = new HostNetworkAttachmentsPersister(this.networkAttachmentDao, host.getId(), interfaceDao.getAllInterfacesForVds(host.getId()), Collections.<NetworkAttachment> emptyList(), clusterNetworks); persister.persistNetworkAttachments(); } if (network.getCluster().isDisplay()) { final DisplayNetworkClusterHelper displayNetworkClusterHelper = new DisplayNetworkClusterHelper( getNetworkClusterDao(), getVmDao(), networkCluster, network.getName(), auditLogDirector); if (displayNetworkClusterHelper.isDisplayToBeUpdated()) { displayNetworkClusterHelper.warnOnActiveVm(); } getNetworkClusterDao().setNetworkExclusivelyAsDisplay(clusterId, network.getId()); } if (network.getCluster().isMigration()) { getNetworkClusterDao().setNetworkExclusivelyAsMigration(clusterId, network.getId()); } NetworkClusterHelper.setStatus(clusterId, network); }</code><technical_language>Please injected vdsDao</technical_language>

Target:
private void attachNetwork(Guid clusterId, NetworkCluster networkCluster, Network network) { getNetworkClusterDao().save(new NetworkCluster(clusterId, network.getId(), NetworkStatus.OPERATIONAL, false, networkCluster.isRequired(), false, false, false)); List<VDS> hosts = vdsDao.getAllForVdsGroup(clusterId); List<Network> clusterNetworks = networkDao.getAllForCluster(clusterId); for (VDS host : hosts) { HostNetworkAttachmentsPersister persister = new HostNetworkAttachmentsPersister(this.networkAttachmentDao, host.getId(), interfaceDao.getAllInterfacesForVds(host.getId()), Collections.<NetworkAttachment> emptyList(), clusterNetworks); persister.persistNetworkAttachments(); } if (network.getCluster().isDisplay()) { final DisplayNetworkClusterHelper displayNetworkClusterHelper = new DisplayNetworkClusterHelper( getNetworkClusterDao(), getVmDao(), networkCluster, network.getName(), auditLogDirector); if (displayNetworkClusterHelper.isDisplayToBeUpdated()) { displayNetworkClusterHelper.warnOnActiveVm(); } getNetworkClusterDao().setNetworkExclusivelyAsDisplay(clusterId, network.getId()); } if (network.getCluster().isMigration()) { getNetworkClusterDao().setNetworkExclusivelyAsMigration(clusterId, network.getId()); } NetworkClusterHelper.setStatus(clusterId, network); }
Source:
<code><START> public static void listFiles(Path projectPath, PathConsumer consumer) <END> throws IOException { listFilesRecursively(projectPath, projectPath, consumer, new HashSet<>()); }</code><technical_language>this method public</technical_language>

Target:
static void listFiles(Path projectPath, PathConsumer consumer) throws IOException { listFilesRecursively(projectPath, projectPath, consumer, new HashSet<>()); }
Source:
<code>public ChildrenIterator(E root) { this.expectedModCount = Graph.this.modcount; this.iteratorStack = new LinkedList<Iterator<Node<E>>>(); iteratorStack.add(Iterators.singletonIterator(Graph.this.nodes.get(root))); consumedNodes = new <START> LinkedHashSet<Node<E>>(); <END> }</code><technical_language>a LinkedHashSet instead of a HashSet? in this usage scenario, maintaining linked list LinkedHashSet pay off, right</technical_language>

Target:
public ChildrenIterator(E root) { this.expectedModCount = Graph.this.modcount; this.iteratorStack = new LinkedList<Iterator<Node<E>>>(); iteratorStack.add(Iterators.singletonIterator(Graph.this.nodes.get(root))); consumedNodes = new HashSet<Node<E>>(); }
Source:
<code>public <T> Class<? extends T> loadClass(CatalogItem<T> item) { if (log.isDebugEnabled()) <START> log.debug("Instantiating catalog item "+item); <END> Preconditions.checkNotNull(item); CatalogItemDo<?> loadedItem = getCatalogItemDo(item.getId()); if (loadedItem==null) throw new NoSuchElementException("Unable to load '"+item.getId()+"' to instantiate it"); return (Class<? extends T>) loadedItem.getJavaClass(); }</code><technical_language>log message wrong: log.debug("Loading class for item {}", item). is instantiating implemented, needing call getJavaClass</technical_language>

Target:
public <T> Class<? extends T> loadClass(CatalogItem<T> item) { if (log.isDebugEnabled()) log.debug("Loading class for catalog item "+item); Preconditions.checkNotNull(item); CatalogItemDo<?> loadedItem = getCatalogItemDo(item.getId()); if (loadedItem==null) throw new NoSuchElementException("Unable to load '"+item.getId()+"' to instantiate it"); return (Class<? extends T>) loadedItem.getJavaClass(); }
Source:
<code>public void testCastNullToColumnTypes() { String tableName = "test_cast_null_to_column_types"; Session session = Session.builder(getSession()) .setCatalogSessionProperty(catalog, "orc_optimized_writer_enabled", "true") .build(); assertUpdate(session, "" + "CREATE TABLE " + tableName + " (" + " col1 bigint," + " col2 map(bigint, bigint)," + " partition_key varchar)" + "WITH (" + " format = 'ORC', " + " partitioned_by = ARRAY[ 'partition_key' ] " + ")"); <START> assertUpdate( <END> session, "INSERT INTO " + tableName + " (col1) " + "VALUES " + " (1), " + " (2), " + " (3)", 3); assertUpdate("DROP TABLE " + tableName); }</code><technical_language>This wrapping hard read. Put line. format()</technical_language>

Target:
public void testCastNullToColumnTypes() { String tableName = "test_cast_null_to_column_types"; Session session = Session.builder(getSession()) .setCatalogSessionProperty(catalog, "orc_optimized_writer_enabled", "true") .build(); assertUpdate(session, "" + "CREATE TABLE " + tableName + " (" + " col1 bigint," + " col2 map(bigint, bigint)," + " partition_key varchar)" + "WITH (" + " format = 'ORC', " + " partitioned_by = ARRAY[ 'partition_key' ] " + ")"); assertUpdate(session, format("INSERT INTO %s (col1) VALUES (1), (2), (3)", tableName), 3); assertUpdate("DROP TABLE " + tableName); }
Source:
<code>public void removeContainersWithoutContents() { ListIterator<BriefObjectMetadata> resultIt = this.getResultList().listIterator(this.getResultList().size()); while (resultIt.hasPrevious()) { BriefObjectMetadata briefObject = resultIt.previous(); if (briefObject == null || briefObject.getResourceType() == null) { continue; } String resourceType = briefObject.getResourceType(); if ((!briefObject.getCountMap().containsKey("child") || briefObject.getCountMap().get("child") == 0) <START> && !ResourceType.File.equals(resourceType)) { <END> if (this.matchingContainerPids != null && this.matchingContainerPids.contains(briefObject.getId())) { } else { log.debug("Removing container " + briefObject.getId() + "from hierarchical result because it has no children"); resultIt.remove(); if (briefObject.getAncestorPathFacet() != null && briefObject.getAncestorPathFacet().getFacetNodes() != null) { for (HierarchicalFacetNode facetTier : briefObject.getAncestorPathFacet().getFacetNodes()) { String tierIdentifier = facetTier.getSearchValue(); Long count = this.subcontainerCounts.get(tierIdentifier); if (count != null) { this.subcontainerCounts.put(tierIdentifier, count - 1); } } } } } } }</code><technical_language>this part of condition changed check for type 'File', checked for 'CONTAINER'</technical_language>

Target:
public void removeContainersWithoutContents() { ListIterator<BriefObjectMetadata> resultIt = this.getResultList().listIterator(this.getResultList().size()); while (resultIt.hasPrevious()) { BriefObjectMetadata briefObject = resultIt.previous(); if (briefObject == null || briefObject.getResourceType() == null) { continue; } String resourceType = briefObject.getResourceType(); if ((!briefObject.getCountMap().containsKey("child") || briefObject.getCountMap().get("child") == 0) && !ResourceType.File.equals(resourceType)) { if (this.matchingContainerPids != null && this.matchingContainerPids.contains(briefObject.getId())) { } else { log.debug("Removing container " + briefObject.getId() + "from hierarchical result because it has no children"); resultIt.remove(); } } } }
Source:
<code>private void onSave() { UnitVmModel model = (UnitVmModel) getWindow(); if (!model.validate()) { return; } String name = model.getName().getEntity(); boolean isBaseTemplate = false; if (model.getBehavior().isExistingTemplateBehavior()) { isBaseTemplate = ((TemplateVmModelBehavior) model.getBehavior()).getVmTemplate().isBaseTemplate(); } else if (model.getBehavior().isBlankTemplateBehavior()) { isBaseTemplate = true; } if (isBaseTemplate) { AsyncDataProvider.getInstance().isTemplateNameUnique(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { TemplateListModel templateListModel = (TemplateListModel) target; boolean isNameUnique = (Boolean) returnValue; templateListModel.postNameUniqueCheck(isNameUnique); } <START> }), name, model.getDataCenterWithClustersList().getSelectedItem().getDataCenter().getId()); <END> } else { postNameUniqueCheck(true); } }</code><technical_language>simplify this model.getSelectedDataCenter().getId() - I for Blank template model.getSelectedDataCenter() returns null fail NPE here</technical_language>

Target:
private void onSave() { UnitVmModel model = (UnitVmModel) getWindow(); if (!model.validate()) { return; } String name = model.getName().getEntity(); boolean isBaseTemplate = false; if (model.getBehavior().isExistingTemplateBehavior()) { isBaseTemplate = ((TemplateVmModelBehavior) model.getBehavior()).getVmTemplate().isBaseTemplate(); } else if (model.getBehavior().isBlankTemplateBehavior()) { isBaseTemplate = true; } if (isBaseTemplate) { AsyncDataProvider.getInstance().isTemplateNameUnique(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { TemplateListModel templateListModel = (TemplateListModel) target; boolean isNameUnique = (Boolean) returnValue; templateListModel.postNameUniqueCheck(isNameUnique); } }), name, model.getSelectedDataCenter().getId()); } else { postNameUniqueCheck(true); } }
Source:
<code><START> public void checkAutomaticChangeContributeToFalse() { <END> openContributeTab(); setStateContributeChecboxAndCloseForm(true); projectExplorer.waitAndSelectItem(FIRST_PROJECT_NAME); pullRequestPanel.waitOpenPanel(); pullRequestPanel.clickHideButtonAndWaitClosePanel(); notificationsPopupPanel.waitExpectedMessageOnProgressPanelAndClosed(NOTIFICATION_MESS); openContributeTab(); preferences.waitContributeCheckboxIsNotSelected(); setStateContributeChecboxAndCloseForm(true); projectExplorer.waitAndSelectItem(SECOND_PROJECT_NAME); pullRequestPanel.waitOpenPanel(); pullRequestPanel.openOptionsMenu(); pullRequestPanel.clickContextHideButtonAndWAitClosedPanel(); notificationsPopupPanel.waitExpectedMessageOnProgressPanelAndClosed(NOTIFICATION_MESS); openContributeTab(); preferences.waitContributeCheckboxIsNotSelected(); setStateContributeChecboxAndCloseForm(true); projectExplorer.waitAndSelectItem(FIRST_PROJECT_NAME); pullRequestPanel.waitOpenPanel(); pullRequestPanel.clickPullRequestBtn(); menu.runCommand(ASSISTANT, TOOL_WINDOWS, CONTRIBUTE_TOOL_WIDOWS); pullRequestPanel.waitClosePanel(); openContributeTab(); preferences.waitContributeCheckboxIsNotSelected(); preferences.clickOnCloseBtnAndWaitClosedForm(); }</code><technical_language>"Contribute false" mean</technical_language>

Target:
public void checkAutomaticChangeContributeToFalse() { openContributeTab(); setStateContributeChecboxAndCloseForm(true); projectExplorer.waitAndSelectItem(FIRST_PROJECT_NAME); pullRequestPanel.waitOpenPanel(); pullRequestPanel.closePanelByHideButton(); notificationsPopupPanel.waitExpectedMessageOnProgressPanelAndClosed(NOTIFICATION_MESSAGE); openContributeTab(); preferences.waitContributeCheckboxIsNotSelected(); setStateContributeChecboxAndCloseForm(true); projectExplorer.waitAndSelectItem(SECOND_PROJECT_NAME); pullRequestPanel.waitOpenPanel(); pullRequestPanel.openOptionsMenu(); pullRequestPanel.closePanelFromContextMenu(); notificationsPopupPanel.waitExpectedMessageOnProgressPanelAndClosed(NOTIFICATION_MESSAGE); openContributeTab(); preferences.waitContributeCheckboxIsNotSelected(); setStateContributeChecboxAndCloseForm(true); projectExplorer.waitAndSelectItem(FIRST_PROJECT_NAME); pullRequestPanel.waitOpenPanel(); pullRequestPanel.clickPullRequestBtn(); menu.runCommand(ASSISTANT, TOOL_WINDOWS, CONTRIBUTE_TOOL_WIDOWS); pullRequestPanel.waitClosePanel(); openContributeTab(); preferences.waitContributeCheckboxIsNotSelected(); preferences.closeForm(); }
Source:
<code>public GeofenceCircle() { <START> super(); <END> }</code><technical_language>is need call super explicitly. applies other constructors</technical_language>

Target:
public GeofenceCircle() { }
Source:
<code>public void testAsyncTaskWithMultiplePartitionMultithreaded() throws Exception { Map<Integer, List<KV>> input = new HashMap<>(); Map<Integer, List<Integer>> output = new HashMap<>(); List<Integer> partition = Arrays.asList(1, 2, 3, 4, 5); List<Integer> outputPartition = partition.stream().map(x -> x * 10).collect(Collectors.toList()); for (int i = 0; i < 5; i++) { List<KV> keyedPartition = new ArrayList<>(); for (Integer val : partition) { keyedPartition.add(KV.of(i, val)); } input.put(i, keyedPartition); <START> output.put(i, new ArrayList<Integer>(outputPartition)); <END> } CollectionStream<KV> inputStream = CollectionStream.of("async-test", "ints", input); CollectionStream outputStream = CollectionStream.empty("async-test", "ints-out", 5); TestRunner .of(MyAsyncStreamTask.class) .addInputStream(inputStream) .addOutputStream(outputStream) .addOverrideConfig("task.max.concurrency", "4") .run(Duration.ofSeconds(2)); StreamAssert.that(outputStream).containsInAnyOrder(output, Duration.ofMillis(1000)); }</code><technical_language>right. I misread before. I mixed data coming from</technical_language>

Target:
public void testAsyncTaskWithMultiplePartitionMultithreaded() throws Exception { Map<Integer, List<KV>> inputPartitionData = new HashMap<>(); Map<Integer, List<Integer>> expectedOutputPartitionData = new HashMap<>(); List<Integer> partition = Arrays.asList(1, 2, 3, 4, 5); List<Integer> outputPartition = partition.stream().map(x -> x * 10).collect(Collectors.toList()); for (int i = 0; i < 5; i++) { List<KV> keyedPartition = new ArrayList<>(); for (Integer val : partition) { keyedPartition.add(KV.of(i, val)); } inputPartitionData.put(i, keyedPartition); expectedOutputPartitionData.put(i, new ArrayList<Integer>(outputPartition)); } CollectionStream<KV> inputStream = CollectionStream.of("async-test", "ints", inputPartitionData); CollectionStream outputStream = CollectionStream.empty("async-test", "ints-out", 5); TestRunner .of(MyAsyncStreamTask.class) .addInputStream(inputStream) .addOutputStream(outputStream) .addOverrideConfig("task.max.concurrency", "4") .run(Duration.ofSeconds(2)); StreamAssert.containsInAnyOrder(outputStream, expectedOutputPartitionData, Duration.ofMillis(1000)); }
Source:
<code>Set<AlternateHandle.Id> skipMe(Set<AlternateHandle.Id> skips) { Set<AlternateHandle.Id> withMe = new HashSet<AlternateHandle.Id>(); <START> if (skips != null) withMe.addAll(skips); <END> withMe.add(getAlternateId()); return withMe; }</code><technical_language>nit: add braces if-block</technical_language>

Target:
Set<AlternateHandle.Id> skipMe(Set<AlternateHandle.Id> skips) { Set<AlternateHandle.Id> withMe = new HashSet<AlternateHandle.Id>(); if (skips != null) { withMe.addAll(skips); } withMe.add(getAlternateId()); return withMe; }
Source:
<code>public boolean validateChecksum() { if (StringUtils.isNotBlank(checksum)) { try { return DigestHelper.check(checksum, new FileInputStream(downloadedFilePath)); } catch (IOException e) { <START> throw new CloudRuntimeException("could not check sum for file: " + downloadedFilePath); <END> } catch (NoSuchAlgorithmException e) { throw new CloudRuntimeException("Unknown checksum algorithm: " + checksum, e); } } return true; }</code><technical_language>missing argument view actual exception message/stack trace: file: " + downloadedFilePath, e)</technical_language>

Target:
public boolean validateChecksum() { if (StringUtils.isNotBlank(checksum)) { try { return DigestHelper.check(checksum, new FileInputStream(downloadedFilePath)); } catch (IOException e) { throw new CloudRuntimeException("could not check sum for file: " + downloadedFilePath,e); } catch (NoSuchAlgorithmException e) { throw new CloudRuntimeException("Unknown checksum algorithm: " + checksum, e); } } return true; }
Source:
<code>public String getFirstImageText() { <START> waitForElementByElement(thumbnails.get(0)); <END> int firstNumber = thumbnails.get(0).getAttribute("src").indexOf("px-"); int secondNumber = thumbnails.get(0).getAttribute("src").indexOf("-Wikia-Visualization-Main"); return thumbnails.get(0).getAttribute("src").substring(firstNumber + 3, secondNumber - 1); }</code><technical_language>wait for this, a list</technical_language>

Target:
public String getFirstImageText() { int indexComparisonStart = thumbnails.get(0).getAttribute("src").indexOf("px-"); int indexComparisonFinish = thumbnails.get(0).getAttribute("src").indexOf("-Wikia-Visualization-Main"); return thumbnails.get(0).getAttribute("src").substring(indexComparisonStart + 3, indexComparisonFinish - 1); }
Source:
<code>public PlannerTool(final Database database, byte[] catalogHash) { assert(database != null); m_database = database; m_catalogHash = catalogHash; m_cache = AdHocCompilerCache.getCacheForCatalogHash(catalogHash); m_hsql = HSQLInterface.loadHsqldb(); String binDDL = m_database.getSchema(); String ddl = Encoder.decodeBase64AndDecompress(binDDL); String[] commands = ddl.split("\n"); for (String command : commands) { String decoded_cmd = Encoder.hexDecodeToString(command); decoded_cmd = decoded_cmd.trim(); if (decoded_cmd.length() == 0) continue; try { m_hsql.runDDLCommand(decoded_cmd); } catch (HSQLParseException e) { throw new RuntimeException("Error creating hsql: " + e.getMessage() + " in DDL statement: " + decoded_cmd); } } if (hostLog.isDebugEnabled()) { <START> hostLog.debug("hsql loaded"); <END> } if (m_plannerStats == null) { synchronized (this.getClass()) { if (m_plannerStats == null) { final StatsAgent statsAgent = VoltDB.instance().getStatsAgent(); if (statsAgent != null) { m_plannerStats = new PlannerStatsCollector(-1); statsAgent.registerStatsSource(StatsSelector.PLANNER, -1, m_plannerStats); } } } } }</code><technical_language>this change. Smells of premature optimization</technical_language>

Target:
public PlannerTool(final Database database, byte[] catalogHash) { assert(database != null); m_database = database; m_catalogHash = catalogHash; m_cache = AdHocCompilerCache.getCacheForCatalogHash(catalogHash); m_hsql = HSQLInterface.loadHsqldb(); String binDDL = m_database.getSchema(); String ddl = Encoder.decodeBase64AndDecompress(binDDL); String[] commands = ddl.split("\n"); for (String command : commands) { String decoded_cmd = Encoder.hexDecodeToString(command); decoded_cmd = decoded_cmd.trim(); if (decoded_cmd.length() == 0) continue; try { m_hsql.runDDLCommand(decoded_cmd); } catch (HSQLParseException e) { throw new RuntimeException("Error creating hsql: " + e.getMessage() + " in DDL statement: " + decoded_cmd); } } hostLog.debug("hsql loaded"); if (m_plannerStats == null) { synchronized (this.getClass()) { if (m_plannerStats == null) { final StatsAgent statsAgent = VoltDB.instance().getStatsAgent(); if (statsAgent != null) { m_plannerStats = new PlannerStatsCollector(-1); statsAgent.registerStatsSource(StatsSelector.PLANNER, -1, m_plannerStats); } } } } }
Source:
<code><START> public EntityController(DataServiceV3 dataServiceV3, EntityMapper entityMapper) { <END> super(API_ENTITY_ID, 3); this.dataServiceV3 = requireNonNull(dataServiceV3); this.entityMapper = requireNonNull(entityMapper); }</code><technical_language>Why</technical_language>

Target:
EntityController(DataServiceV3 dataServiceV3, EntityMapper entityMapper) { super(API_ENTITY_ID, 3); this.dataServiceV3 = requireNonNull(dataServiceV3); this.entityMapper = requireNonNull(entityMapper); }
Source:
<code>private boolean isManagerNode() { try { <START> Registry configRegistry = BPELServiceComponent.getRegistryService().getConfigSystemRegistry(-1234); <END> RegistryContext registryContext = configRegistry.getRegistryContext(); if (registryContext != null) { return !registryContext.isReadOnly(); } } catch (RegistryException e) { log.error("Error occurred while retrieving config registry", e); } return false; }</code><technical_language>replace -1234 MultitenantConstants.SUPER_TENANT_ID</technical_language>

Target:
private boolean isManagerNode() { try { Registry configRegistry = BPELServiceComponent.getRegistryService().getConfigSystemRegistry( MultitenantConstants.SUPER_TENANT_ID); RegistryContext registryContext = configRegistry.getRegistryContext(); if (registryContext != null) { return !registryContext.isReadOnly(); } } catch (RegistryException e) { log.error("Error occurred while retrieving config registry", e); } return false; }
Source:
<code><START> public synchronized void lock() { <END> hasBeenInitialized = true; internalMap = ImmutableMap.copyOf(internalMap); }</code><technical_language>I imagine synchronized keyword is move init this private. Is situation want this locked externally</technical_language>

Target:
private void lock() { hasBeenInitialized = true; internalMap = ImmutableMap.copyOf(internalMap); }
Source:
<code>public void testHasChangedAttributesMultiple() { TaskAttribute attributeCustom = newData.getRoot().createAttribute("custom"); attributeCustom.setValue("1"); TaskAttribute attributeSummary = newData.getRoot().createAttribute(TaskAttribute.SUMMARY); attributeSummary.setValue("1"); TaskDataDiff diff = manger.createDiff(newData, oldData, new NullProgressMonitor()); <START> assertTrue(diff.hasChanged()); <END> }</code><technical_language>is this true, false of attributes a kind</technical_language>

Target:
public void testHasChangedAttributesMultiple() { TaskAttribute attributeCustom = newData.getRoot().createAttribute("custom"); attributeCustom.setValue("1"); TaskAttribute attributeSummary = newData.getRoot().createAttribute(TaskAttribute.SUMMARY); attributeSummary.setValue("1"); TaskDataDiff diff = manager.createDiff(newData, oldData, new NullProgressMonitor()); assertTrue(diff.hasChanged()); }
Source:
<code><START> public static IOContainer fromConfig() { <END> if ( FROM_CONFIG_INSTANCE == null ) { synchronized (IOContainer.class) { String driver = configuration.getStringProperty(CoreConfig.CASSANDRA_DRIVER); FROM_CONFIG_INSTANCE = new IOContainer(DriverType.getDriverType(driver)); } } return FROM_CONFIG_INSTANCE; }</code><technical_language>I synchronize method also. If not, wont thread safe</technical_language>

Target:
public static synchronized IOContainer fromConfig() { if ( FROM_CONFIG_INSTANCE == null ) { String driver = configuration.getStringProperty(CoreConfig.CASSANDRA_DRIVER); FROM_CONFIG_INSTANCE = new IOContainer(DriverType.getDriverType(driver)); } return FROM_CONFIG_INSTANCE; }