auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void checkpoint() { <START> if(null == databaseInstance){ <END> throw new IllegalStateException("database is not initialized"); } Cursor c = databaseInstance.query("pragma wal_checkpoint(full)", null); if(c.moveToFirst() && c.getInt(0) == 1) { throw new RuntimeException("Checkpoint was blocked from completing"); } }</code><technical_language>suggestion if (databaseInstance == null) {</technical_language>

Target:
public static void checkpoint() { if (databaseInstance == null) { throw new IllegalStateException("database is not initialized"); } Cursor c = databaseInstance.query("pragma wal_checkpoint(full)", null); if (c.moveToFirst() && c.getInt(0) == 1) { throw new RuntimeException("Checkpoint was blocked from completing"); } }
Source:
<code>public void testAdminConfigsClientOverridesWithAllPolicy() { Map<String, String> props = new HashMap<>(workerProps); props.put("admin.client.id", "testid"); props.put("admin.metadata.max.age.ms", "5000"); WorkerConfig configWithOverrides = new StandaloneConfig(props); Map<String, Object> connConfig = new HashMap<String, Object>(); connConfig.put("metadata.max.age.ms", "10000"); Map<String, String> expectedConfigs = new HashMap<>(); <START> expectedConfigs.putAll(props); <END> expectedConfigs.put("bootstrap.servers", "localhost:9092"); expectedConfigs.put("client.id", "testid"); expectedConfigs.put("metadata.max.age.ms", "10000"); EasyMock.expect(connectorConfig.originalsWithPrefix(ConnectorConfig.CONNECTOR_CLIENT_ADMIN_OVERRIDES_PREFIX)) .andReturn(connConfig); PowerMock.replayAll(); assertEquals(expectedConfigs, Worker.adminConfigs(new ConnectorTaskId("test", 1), configWithOverrides, connectorConfig, null, allConnectorClientConfigOverridePolicy)); }</code><technical_language>admin configs overrides "admin.metadata.max.age.ms", "metadata.max.age.ms", values. I feel confusing debug. include configs start "admin." prefix overridden</technical_language>

Target:
public void testAdminConfigsClientOverridesWithAllPolicy() { Map<String, String> props = new HashMap<>(workerProps); props.put("admin.client.id", "testid"); props.put("admin.metadata.max.age.ms", "5000"); props.put("producer.bootstrap.servers", "cbeauho.com"); props.put("consumer.bootstrap.servers", "localhost:4761"); WorkerConfig configWithOverrides = new StandaloneConfig(props); Map<String, Object> connConfig = new HashMap<String, Object>(); connConfig.put("metadata.max.age.ms", "10000"); Map<String, String> expectedConfigs = new HashMap<>(workerProps); expectedConfigs.put("bootstrap.servers", "localhost:9092"); expectedConfigs.put("client.id", "testid"); expectedConfigs.put("metadata.max.age.ms", "10000"); EasyMock.expect(connectorConfig.originalsWithPrefix(ConnectorConfig.CONNECTOR_CLIENT_ADMIN_OVERRIDES_PREFIX)) .andReturn(connConfig); PowerMock.replayAll(); assertEquals(expectedConfigs, Worker.adminConfigs(new ConnectorTaskId("test", 1), configWithOverrides, connectorConfig, null, allConnectorClientConfigOverridePolicy)); }
Source:
<code>public void onNext(final TaskStart taskStart) { <START> LOG.log(Level.FINE, "Sends a msg to register itself to start subscribing updates in routing table"); <END> sender.sendWorkerRegisterMsg(); }</code><technical_language>I including taskStart.getId() log message more informative</technical_language>

Target:
public void onNext(final TaskStart taskStart) { LOG.log(Level.FINE, "Task {0} sends a msg to register itself to start subscribing updates in routing table", taskStart.getId()); sender.sendWorkerRegisterMsg(); }
Source:
<code>private void addUGI(FileStatus remoteStatus, AclStatus remoteAcl) { if (remoteAcl != null) { addUser(remoteAcl.getOwner()); addGroup(remoteAcl.getGroup()); for (AclEntry entry : remoteAcl.getEntries()) { <START> if (entry.getName() != null) { <END> if (entry.getType() == AclEntryType.USER) { addUser(entry.getName()); } else if (entry.getType() == AclEntryType.GROUP) { addGroup(entry.getName()); } } } } else { addUser(remoteStatus.getOwner()); addGroup(remoteStatus.getGroup()); } }</code><technical_language>Extract getName()</technical_language>

Target:
private void addUGI(FileStatus remoteStatus, AclStatus remoteAcl) { if (remoteAcl != null) { addUser(remoteAcl.getOwner()); addGroup(remoteAcl.getGroup()); for (AclEntry entry : remoteAcl.getEntries()) { String name = entry.getName(); if (name != null) { if (entry.getType() == AclEntryType.USER) { addUser(name); } else if (entry.getType() == AclEntryType.GROUP) { addGroup(name); } } } } else { addUser(remoteStatus.getOwner()); addGroup(remoteStatus.getGroup()); } }
Source:
<code>public void putAttributes( final RepositoryItemUid uid, Attributes attributes ) { final RepositoryItemUidLock uidLock = uid.getAttributeLock(); uidLock.lock( Action.create ); try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Storing attributes on UID=" + uid.toString() ); } try { Attributes onDisk = doGetAttributes( uid ); if ( onDisk != null && ( onDisk.getGeneration() > attributes.getGeneration() ) ) { onDisk.overlayAttributes( attributes ); onDisk.setRepositoryId( uid.getRepository().getId() ); onDisk.setPath( uid.getPath() ); onDisk.setReadable( attributes.isReadable() ); onDisk.setWritable( attributes.isWritable() ); attributes = onDisk; } File target = getFileFromBase( uid ); target.getParentFile().mkdirs(); if ( target.getParentFile().exists() && target.getParentFile().isDirectory() ) { FileOutputStream fos = null; try { fos = new FileOutputStream( target ); attributes.incrementGeneration(); marshaller.marshal( attributes, fos ); } catch ( IOException ex ) { <START> target.delete(); <END> throw ex; } finally { Closeables.closeQuietly( fos ); } } else { getLogger().error( "Could not store attributes on UID=" + uid.toString() + ", parent exists but is not a directory!" ); } } catch ( IOException ex ) { getLogger().error( "Got IOException during store of UID=" + uid.toString(), ex ); } } finally { uidLock.unlock(); } }</code><technical_language>If file is empty delete it. If stick in trash? rename it? (just thoughts/questions)</technical_language>

Target:
public void putAttributes( final RepositoryItemUid uid, Attributes attributes ) { final RepositoryItemUidLock uidLock = uid.getAttributeLock(); uidLock.lock( Action.create ); try { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Storing attributes on UID=" + uid.toString() ); } try { Attributes onDisk = doGetAttributes( uid ); if ( onDisk != null && ( onDisk.getGeneration() > attributes.getGeneration() ) ) { onDisk.overlayAttributes( attributes ); onDisk.setRepositoryId( uid.getRepository().getId() ); onDisk.setPath( uid.getPath() ); onDisk.setReadable( attributes.isReadable() ); onDisk.setWritable( attributes.isWritable() ); attributes = onDisk; } File target = getFileFromBase( uid ); target.getParentFile().mkdirs(); if ( target.getParentFile().exists() && target.getParentFile().isDirectory() ) { FileOutputStream fos = null; try { fos = new FileOutputStream( target ); attributes.incrementGeneration(); marshaller.marshal( attributes, fos ); } catch ( IOException ex ) { if ( target.length() == 0 ) { target.delete(); } throw ex; } finally { Closeables.closeQuietly( fos ); } } else { getLogger().error( "Could not store attributes on UID=" + uid.toString() + ", parent exists but is not a directory!" ); } } catch ( IOException ex ) { getLogger().error( "Got IOException during store of UID=" + uid.toString(), ex ); } } finally { uidLock.unlock(); } }
Source:
<code><START> protected Startpoint() { <END> this.createdTimestamp = Instant.now().toEpochMilli(); }</code><technical_language>createdTimestamp passed argument? read out of store, set is in store current time</technical_language>

Target:
Startpoint() { this(Instant.now().toEpochMilli()); }
Source:
<code>public void testParametrizedUriEmitterConfig() { final Properties props = new Properties(); props.setProperty("druid.emitter", "parametrized"); props.setProperty("druid.emitter.parametrized.recipientBaseUrlPattern", "<LINK_0>{feed}"); props.setProperty("druid.emitter.parametrized.httpEmitting.flushMillis", "1"); props.setProperty("druid.emitter.parametrized.httpEmitting.flushCount", "2"); props.setProperty("druid.emitter.parametrized.httpEmitting.basicAuthentication", "a:b"); props.setProperty("druid.emitter.parametrized.httpEmitting.batchingStrategy", "NEWLINES"); props.setProperty("druid.emitter.parametrized.httpEmitting.maxBatchSize", "4"); props.setProperty("druid.emitter.parametrized.httpEmitting.maxBufferSize", "8"); props.setProperty("druid.emitter.parametrized.httpEmitting.flushTimeOut", "1000"); final Emitter emitter = makeInjectorWithProperties(props).getInstance(Emitter.class); <START> System.out.println(emitter); <END> }</code><technical_language>is this left mistake</technical_language>

Target:
public void testParametrizedUriEmitterConfig() { final Properties props = new Properties(); props.setProperty("druid.emitter", "parametrized"); props.setProperty("druid.emitter.parametrized.recipientBaseUrlPattern", "<LINK_0>{feed}"); props.setProperty("druid.emitter.parametrized.httpEmitting.flushMillis", "1"); props.setProperty("druid.emitter.parametrized.httpEmitting.flushCount", "2"); props.setProperty("druid.emitter.parametrized.httpEmitting.basicAuthentication", "a:b"); props.setProperty("druid.emitter.parametrized.httpEmitting.batchingStrategy", "NEWLINES"); props.setProperty("druid.emitter.parametrized.httpEmitting.maxBatchSize", "4"); props.setProperty("druid.emitter.parametrized.httpEmitting.maxBufferSize", "8"); props.setProperty("druid.emitter.parametrized.httpEmitting.flushTimeOut", "1000"); final Emitter emitter = makeInjectorWithProperties(props).getInstance(Emitter.class); Assert.assertTrue(emitter instanceof ParametrizedUriEmitter); }
Source:
<code>public SnapshotInitiationInfo(Object[] params) throws Exception { m_path = null; m_nonce = null; m_blocking = true; m_format = SnapshotFormat.NATIVE; m_data = null; m_truncationRequest = false; <START> boolean checkNonceValidity = true; <END> switch (params.length) { case 3: parseLegacyParams(params); break; case 1: parseJsonParams(params); break; default: m_nonce = MAGIC_NONCE_PREFIX + System.currentTimeMillis(); m_stype = SnapshotPathType.SNAP_AUTO; m_path = VoltDB.instance().getSnapshotPath(); break; } if (checkNonceValidity && m_nonce != null && (m_nonce.contains("-") || m_nonce.contains(",")) && m_nonce.startsWith(MAGIC_NONCE_PREFIX)) { throw new Exception("Provided nonce " + m_nonce + " contains a prohibited character (- or ,) or starts with " + MAGIC_NONCE_PREFIX); } }</code><technical_language>is this set</technical_language>

Target:
public SnapshotInitiationInfo(Object[] params) throws Exception { m_path = null; m_nonce = null; m_blocking = true; m_format = SnapshotFormat.NATIVE; m_data = null; m_truncationRequest = false; boolean checkNonceValidity = true; switch (params.length) { case 3: parseLegacyParams(params); break; case 1: checkNonceValidity = parseJsonParams(params); break; default: m_nonce = MAGIC_NONCE_PREFIX + System.currentTimeMillis(); m_stype = SnapshotPathType.SNAP_AUTO; m_path = VoltDB.instance().getSnapshotPath(); checkNonceValidity = false; break; } if (checkNonceValidity && m_nonce != null && (m_nonce.contains("-") || m_nonce.contains(",") || m_nonce.startsWith(MAGIC_NONCE_PREFIX))) { throw new IllegalArgumentException("Provided nonce " + m_nonce + " contains a prohibited character (- or ,) or start with " + MAGIC_NONCE_PREFIX); } }
Source:
<code>private int getLatestPacketFailRate() { int failure = 0; int sent = 0; int received = 0; for (Map.Entry<Long, TcpStat> pair : mTcpStats.entrySet()) { failure += (pair.getValue().lost + pair.getValue().retransmit); sent += pair.getValue().sent; received += pair.getValue().received; } updateSentSinceLastRecv(sent, received); if (mSentSinceLastRecv < getMinPacketsThreshold()) return 0; log("getLatestPacketFailRate:" + ((sent != 0) ? (failure * 100 / sent) : 0)); return <START> ((sent != 0) ? (failure * 100 / sent) : 0); <END> }</code><technical_language>Put this in a local avoid copying</technical_language>

Target:
protected int getLatestPacketFailRate() { int failure = 0; int sent = 0; int received = 0; int size = mTcpStats.size(); for (int i = 0; i < size; i++) { long key = mTcpStats.keyAt(i); failure += (mTcpStats.get(key).nLost + mTcpStats.get(key).nRetransmit); sent += mTcpStats.get(key).nSent; received += mTcpStats.get(key).nReceived; } updateSentSinceLastRecv(sent, received); if (getSentSinceLastRecv() < getMinPacketsThreshold()) return 0; int rate = ((sent != 0) ? (failure * 100 / sent) : 0); log("getLatestPacketFailRate:" + rate); return rate; }
Source:
<code>public void start() { cacheName = ByteString.fromString(cache.getName()); hasLoader = cache.getCacheConfiguration().persistence().usingStores(); ClusteringConfiguration clusteringConfiguration = cache.getCacheConfiguration().clustering(); this.maxSegment = clusteringConfiguration.hash().numSegments(); localAddress = rpc.getAddress(); <START> requiresListener = !clusteringConfiguration.cacheMode().isReplicated(); <END> if (requiresListener) { cache.addListener(this); } }</code><technical_language>I a isReplicated field clearer, in some cases a listener</technical_language>

Target:
public void start() { cacheName = ByteString.fromString(cache.getName()); hasLoader = cache.getCacheConfiguration().persistence().usingStores(); ClusteringConfiguration clusteringConfiguration = cache.getCacheConfiguration().clustering(); this.maxSegment = clusteringConfiguration.hash().numSegments(); localAddress = rpc.getAddress(); isReplicated = clusteringConfiguration.cacheMode().isReplicated(); if (isReplicated) { cache.addListener(this); } }
Source:
<code>public static List<String> getComputerNames() { final ArrayList<String> names = new ArrayList<String>(); <START> for (Computer c : Jenkins.getActiveInstance().getComputers()) { <END> if (!c.getName().isEmpty()) { names.add(c.getName()); } } return names; }</code><technical_language>getActiveInstance is deprecated, please good getInstance</technical_language>

Target:
public static List<String> getComputerNames() { final ArrayList<String> names = new ArrayList<String>(); for (Computer c : Jenkins.getInstance().getComputers()) { if (!c.getName().isEmpty()) { names.add(c.getName()); } } return names; }
Source:
<code>private void addSiblingNode(int indexOfNode) { synchronized (latestBranch) { final long splitTime = treeEnd; assert (indexOfNode < latestBranch.size()); if (indexOfNode == 0) { addNewRootNode(); return; } if (((CoreNode) latestBranch.get(indexOfNode - 1)).getNbChildren() == config.getMaxChildren()) { addSiblingNode(indexOfNode - 1); return; } for (int i = indexOfNode; i < latestBranch.size(); i++) { latestBranch.get(i).closeThisNode(splitTime); treeIO.writeNode(latestBranch.get(i)); CoreNode prevNode = (CoreNode) latestBranch.get(i - 1); HTNode newNode; if (latestBranch.get(i).getNodeType() == HTConfig.LEAFNODE_TYPE) { newNode = initNewLeafNode(prevNode.getSequenceNumber(), <START> splitTime + 1); <END> } else { newNode = initNewCoreNode(prevNode.getSequenceNumber(), splitTime + 1); } prevNode.linkNewChild(newNode); latestBranch.set(i, newNode); } } }</code><technical_language>line</technical_language>

Target:
private void addSiblingNode(int indexOfNode) { synchronized (latestBranch) { final long splitTime = treeEnd; assert (indexOfNode < latestBranch.size()); if (indexOfNode == 0) { addNewRootNode(); return; } if (((CoreNode) latestBranch.get(indexOfNode - 1)).getNbChildren() == config.getMaxChildren()) { addSiblingNode(indexOfNode - 1); return; } for (int i = indexOfNode; i < latestBranch.size(); i++) { latestBranch.get(i).closeThisNode(splitTime); treeIO.writeNode(latestBranch.get(i)); CoreNode prevNode = (CoreNode) latestBranch.get(i - 1); HTNode newNode; if (latestBranch.get(i).getNodeType() == HTNode.LEAFNODE_TYPE) { newNode = initNewLeafNode(prevNode.getSequenceNumber(), splitTime + 1); } else { newNode = initNewCoreNode(prevNode.getSequenceNumber(), splitTime + 1); } prevNode.linkNewChild(newNode); latestBranch.set(i, newNode); } } }
Source:
<code>public static Map<String, Object> convertMap(Schema schema, Map<String, Object> value) { Map<String, Schema.Type> fieldToType = schema.getFields().stream() .collect(toMap(Schema.Field::getName, Schema.Field::getType)); boolean fieldNotFound = (schema.getFields().size() != value.keySet().size()) || value.keySet().stream().anyMatch(f -> !(fieldToType.containsKey(f))); if (fieldNotFound) { throw new IllegalArgumentException("Field list doesn't match to output schema."); <START> } <END> return value.entrySet().stream() .collect(toMap(Map.Entry::getKey, e -> convert(fieldToType.get(e.getKey()), e.getValue()))); }</code><technical_language>I this is a nice functionality reused in other places. add some java doc this class does</technical_language>

Target:
public static Map<String, Object> convertMap(Schema schema, Map<String, Object> value) { Map<String, Schema.Type> fieldToType = schema.getFields().stream() .collect(toMap(Schema.Field::getName, Schema.Field::getType)); List<Schema.Field> requiredFields = schema.getFields().stream() .filter(field -> !field.isOptional()).collect(toList()); List<String> fieldsNotFoundInSchema = value.keySet().stream() .filter(f -> !(fieldToType.containsKey(f))).collect(toList()); List<Schema.Field> requiredFieldsNotFoundInValue = requiredFields.stream() .filter(f -> !(value.containsKey(f.getName()))).collect(toList()); if (!fieldsNotFoundInSchema.isEmpty()) { throw new IllegalArgumentException("The value has fields which are not defined in schema: " + fieldsNotFoundInSchema); } if (!requiredFieldsNotFoundInValue.isEmpty()) { throw new IllegalArgumentException("The value doesn't have required fields: " + requiredFieldsNotFoundInValue); } return value.entrySet().stream() .collect(toMap(Map.Entry::getKey, e -> convert(fieldToType.get(e.getKey()), e.getValue()))); }
Source:
<code>protected void process( Void batch, BatchSender sender ) throws Throwable { <START> System.out.println( Thread.currentThread().getName() + " process" ); <END> latch.await(); }</code><technical_language>Oops</technical_language>

Target:
protected void process( Void batch, BatchSender sender ) throws Throwable { latch.await(); }
Source:
<code>public void testSaveSettings() throws BundleException { SettingsDto dto = new SettingsDto(); dto.setTaskPossibleErrors(TASK_POSSIBLE_ERRORS_VALUE); dto.setTaskLogActivities(TASK_LOG_ACTIVITIES_VALUE); controller.saveSettings(dto); verify(settingsFacade, times(1)).setProperty(eq(TASK_LOG_ACTIVITIES_KEY), anyString()); <START> verify(settingsFacade, times(1)).setProperty(eq(TASK_POSSIBLE_ERRORS_KEY), anyString()); <END> }</code><technical_language>predict parameter in setters. "TASK_LOG_ACTIVITES_VALUE" "TASK_POSSIBLE_ERRORS_VALUE"</technical_language>

Target:
public void testSaveSettings() throws BundleException { SettingsDto dto = new SettingsDto(); dto.setTaskPossibleErrors(TASK_POSSIBLE_ERRORS_VALUE); dto.setTaskLogActivities(TASK_LOG_ACTIVITIES_VALUE); controller.saveSettings(dto); verify(settingsFacade, times(1)).setProperty(eq(TASK_LOG_ACTIVITIES_KEY), eq(TASK_LOG_ACTIVITIES_VALUE)); verify(settingsFacade, times(1)).setProperty(eq(TASK_POSSIBLE_ERRORS_KEY), eq(TASK_POSSIBLE_ERRORS_VALUE)); }
Source:
<code>private MenuCell<GlusterTaskSupport> getRebalanceActivityMenu(ApplicationConstants constants) { MenuCell<GlusterTaskSupport> menuCell = new MenuCell<GlusterTaskSupport>() { @Override protected boolean isVisible(GlusterTaskSupport value) { <START> return value.getAsyncTask().getType() == GlusterTaskType.REBALANCE; <END> } }; menuCell.addMenuItem(constants.statusRebalance(), getMainModel().getStatusRebalanceCommand()); menuCell.addMenuItem(constants.stopRebalance(), getMainModel().getStopRebalanceCommand()); return menuCell; }</code><technical_language>need for a null check</technical_language>

Target:
private MenuCell<GlusterTaskSupport> getRebalanceActivityMenu(ApplicationConstants constants) { MenuCell<GlusterTaskSupport> menuCell = new MenuCell<GlusterTaskSupport>() { @Override protected boolean isVisible(GlusterTaskSupport value) { return value.getAsyncTask() != null && value.getAsyncTask().getType() == GlusterTaskType.REBALANCE; } }; menuCell.addMenuItem(constants.statusRebalance(), getMainModel().getStatusRebalanceCommand()); menuCell.addMenuItem(constants.stopRebalance(), getMainModel().getStopRebalanceCommand()); return menuCell; }
Source:
<code>public static void main(String[] args) { final Logger logger = LoggerFactory.getLogger(App.class); var guard = new Guard(); var thief = new Thief(); if (guard instanceof Permission) { guard.enter(); } else { logger.info("You have no permission to enter, please leave this area"); } if (thief instanceof Permission) { <START> thief.doNothing(); <END> } else { thief.doNothing(); } }</code><technical_language>this change if else branches do thing. I leave thief.steal() was</technical_language>

Target:
public static void main(String[] args) { final var logger = LoggerFactory.getLogger(App.class); var guard = new Guard(); var thief = new Thief(); if (guard instanceof Permission) { guard.enter(); } else { logger.info("You have no permission to enter, please leave this area"); } if (thief instanceof Permission) { thief.steal(); } else { thief.doNothing(); } }
Source:
<code>public void testThreadInterruptedDuringLocking() throws Throwable { final Cache<String, String> cache = cache(0, "timestamps"); cache.put("k", "v"); TransactionManager tm = cache.getAdvancedCache().getTransactionManager(); tm.begin(); cache.put("k", "v2"); Transaction tx = tm.suspend(); final List<Throwable> throwables = new LinkedList<Throwable>(); Thread th = new Thread() { public void run() { try { cache.put("k", "v3"); } catch (Throwable th) { throwables.add(th); } } }; th.start(); th.interrupt(); th.join(); tm.resume(tx); tm.rollback(); <START> assert throwables.size() == 1; <END> assert throwables.get(0) instanceof CacheException; assert throwables.get(0).getCause() instanceof InterruptedException; }</code><technical_language>assertEquals instead? information received if fails</technical_language>

Target:
public void testThreadInterruptedDuringLocking() throws Throwable { final Cache<String, String> cache = cache(0, "timestamps"); cache.put("k", "v"); TransactionManager tm = cache.getAdvancedCache().getTransactionManager(); tm.begin(); cache.put("k", "v2"); Transaction tx = tm.suspend(); final List<Throwable> throwables = new LinkedList<Throwable>(); Thread th = new Thread() { public void run() { try { cache.put("k", "v3"); } catch (Throwable th) { throwables.add(th); } } }; th.start(); th.interrupt(); th.join(); tm.resume(tx); tm.rollback(); assertEquals(1, throwables.size()); assertTrue(throwables.get(0) instanceof CacheException); assertTrue(throwables.get(0).getCause() instanceof InterruptedException); }
Source:
<code>public void onApiChange(SyncthingService.State currentState) { if (getActivity() == null || getActivity().isFinishing()) { return; } else if (currentState != SyncthingService.State.ACTIVE) { getActivity().finish(); } if (mIsCreate) { getActivity().setTitle(R.string.add_device); } else { getActivity().setTitle(R.string.edit_device); List<RestApi.Device> devices = mSyncthingService.getApi().getDevices(false); for (int i = 0; i < devices.size(); i++) { if (devices.get(i).DeviceID.equals( getActivity().getIntent().getStringExtra(EXTRA_NODE_ID))) { mDevice = devices.get(i); break; } } mDeviceId.setOnPreferenceClickListener(this); } if (mDevice == null) { Log.d(TAG, "Empty mDevice"); getActivity().finish(); return; <START> } <END> mSyncthingService.getApi().getConnections(DeviceSettingsFragment.this); mDeviceId.setSummary(mDevice.DeviceID); mName.setText((mDevice.Name)); mName.setSummary(mDevice.Name); mAddresses.setText(mDevice.Addresses); mAddresses.setSummary(mDevice.Addresses); mCompression.setValue(mDevice.Compression); mCompression.setSummary(mDevice.Compression); }</code><technical_language>I guess right, want a race condition. A lock more elegant though</technical_language>

Target:
public void onApiChange(SyncthingService.State currentState) { if (getActivity() == null || getActivity().isFinishing()) { return; } else if (currentState != SyncthingService.State.ACTIVE) { getActivity().finish(); } if (mIsCreate) { getActivity().setTitle(R.string.add_device); } else { RestApi.Device device = null; getActivity().setTitle(R.string.edit_device); List<RestApi.Device> devices = mSyncthingService.getApi().getDevices(false); for (int i = 0; i < devices.size(); i++) { if (devices.get(i).DeviceID.equals( getActivity().getIntent().getStringExtra(EXTRA_NODE_ID))) { device = devices.get(i); break; } } if (device == null) { Log.w(TAG, "Device not found in API update"); getActivity().finish(); return; } mDevice = device; mDeviceId.setOnPreferenceClickListener(this); } mSyncthingService.getApi().getConnections(DeviceSettingsFragment.this); mDeviceId.setSummary(mDevice.DeviceID); mName.setText((mDevice.Name)); mName.setSummary(mDevice.Name); mAddresses.setText(mDevice.Addresses); mAddresses.setSummary(mDevice.Addresses); mCompression.setValue(mDevice.Compression); mCompression.setSummary(mDevice.Compression); }
Source:
<code>public ActionsCategory handleSingleNode(ActionsCategory category, ActionsManager manager, Element element) { if (element == null) { return null; } if (element instanceof Package) { copyAction = new CopyAction(element); } if (element instanceof Classifier) { final Classifier classifier = (Classifier) element; validateAction = new ValidateAction(classifier); ontoBehaviorAction = new CreateOntoBehaviorBlocks(classifier, false); <START> specializeStructureAction = new SpecializeStructuresAction(classifier, false, ID_NONRECURSIVE, false, false); <END> specializeStructureRecursiveAction = new SpecializeStructuresAction(classifier, false, ID_RECURSIVE, true, false); createBSTAction = new SpecializeStructuresAction(classifier, false, ID_RECURSIVE_INDIVIDUALLY, true, true); createInstanceMenuAction = new CreateInstanceMenuAction(classifier); aspectAction = new AspectAction(classifier); copyAction = new CopyAction(element); if (classifier instanceof Behavior) { } } else if (element instanceof InstanceSpecification) { final InstanceSpecification instance = (InstanceSpecification) element; validateAction = new ValidateAction(instance); ArrayList<InstanceSpecification> insts = new ArrayList(); insts.add(instance); instance2BSTAction = new Instance2BSTAction(insts); } else { return null; } return category; }</code><technical_language>*ID</technical_language>

Target:
public ActionsCategory handleSingleNode(ActionsCategory category, ActionsManager manager, Element element) { if (element == null) { return null; } if (element instanceof Package) { copyAction = new CopyAction(element); } if (element instanceof Classifier) { final Classifier classifier = (Classifier) element; validateAction = new ValidateAction(classifier); ontoBehaviorAction = new CreateOntoBehaviorBlocks(classifier, false); specializeStructureAction = new SpecializeStructureAction(classifier, false, ID, false, false); specializeStructureRecursiveAction = new SpecializeStructureAction(classifier, false, ID_RECURSIVE, true, false); createBSTAction = new SpecializeStructureAction(classifier, false, ID_RECURSIVE_INDIVIDUAL, true, true); createInstanceMenuAction = new CreateInstanceMenuAction(classifier); aspectAction = new AspectAction(classifier); copyAction = new CopyAction(element); if (classifier instanceof Behavior) { } } else if (element instanceof InstanceSpecification) { final InstanceSpecification instance = (InstanceSpecification) element; validateAction = new ValidateAction(instance); ArrayList<InstanceSpecification> insts = new ArrayList(); insts.add(instance); instance2BSTAction = new Instance2BSTAction(insts); } else { return null; } return category; }
Source:
<code>private void validateEntry(Element element) throws Exception { FileEntry entry = new FileEntry(); NodeList nl = element.getElementsByTagName("td"); int len = nl.getLength(); if (len < 5) { return; } assertEquals(5, len); entry.name = getFilename(nl.item(1)); entry.href = getHref(nl.item(1)); entry.lastModified = getLastModified(nl.item(3)); try { entry.size = getSize(nl.item(4)); <START> } catch (NumberFormatException e) { <END> entry.size = "invalid size"; } for (int ii = 0; ii < entries.length; ++ii) { if (entries[ii] != null && entries[ii].compareTo(entry) == 0) { entries[ii] = null; return; } } fail("Could not find a match for: " + entry.name); }</code><technical_language>this happen getSize() parse integer anymore</technical_language>

Target:
private void validateEntry(Element element) throws Exception { FileEntry entry = new FileEntry(); NodeList nl = element.getElementsByTagName("td"); int len = nl.getLength(); if (len < 5) { return; } assertEquals(5, len); entry.name = getFilename(nl.item(1)); entry.href = getHref(nl.item(1)); entry.lastModified = getLastModified(nl.item(3)); entry.size = getSize(nl.item(4)); for (int ii = 0; ii < entries.length; ++ii) { if (entries[ii] != null && entries[ii].compareTo(entry) == 0) { entries[ii] = null; return; } } fail("Could not find a match for: " + entry.name); }
Source:
<code>public void testSubstitution() { RuntimeMacro runtimeMacro = new RuntimeMacro(); MacroContext macroContext = new DefaultMacroContext(0, TimeZone.getTimeZone("UTC")); Assert.assertEquals("1970-01-01", runtimeMacro.getValue("yyyy-MM-dd", macroContext)); <START> Assert.assertEquals("1970-01-02", runtimeMacro.getValue("yyyy-MM-dd,-1d", macroContext)); <END> macroContext = new DefaultMacroContext(1451606400000L, TimeZone.getTimeZone("UTC")); Assert.assertEquals("2016-01-01", runtimeMacro.getValue("yyyy-MM-dd", macroContext)); Assert.assertEquals("2015-12-31", runtimeMacro.getValue("yyyy-MM-dd,1d", macroContext)); Assert.assertEquals("2015-12-31T00:00:00", runtimeMacro.getValue("yyyy-MM-dd'T'HH:mm:ss,1d", macroContext)); Assert.assertEquals("2015-12-31T12:00:00", runtimeMacro.getValue("yyyy-MM-dd'T'HH:mm:ss,1d-12h", macroContext)); Assert.assertEquals("2015-12-31T11:29:45", runtimeMacro.getValue("yyyy-MM-dd'T'HH:mm:ss,1d-12h+30m+15s", macroContext)); }</code><technical_language>if '0.5d'</technical_language>

Target:
public void testSubstitution() { RuntimeMacro runtimeMacro = new RuntimeMacro(); MacroContext macroContext = new DefaultMacroContext(0, TimeZone.getTimeZone("UTC")); Assert.assertEquals("1970-01-01", runtimeMacro.getValue("yyyy-MM-dd", macroContext)); Assert.assertEquals("1969-12-31", runtimeMacro.getValue("yyyy-MM-dd,1d", macroContext)); Assert.assertEquals("1969-12-31", runtimeMacro.getValue("yyyy-MM-dd,+1d", macroContext)); Assert.assertEquals("1970-01-02", runtimeMacro.getValue("yyyy-MM-dd,-1d", macroContext)); macroContext = new DefaultMacroContext(1451606400000L, TimeZone.getTimeZone("UTC")); Assert.assertEquals("2016-01-01", runtimeMacro.getValue("yyyy-MM-dd", macroContext)); Assert.assertEquals("2015-12-31", runtimeMacro.getValue("yyyy-MM-dd,1d", macroContext)); Assert.assertEquals("2015-12-31T00:00:00", runtimeMacro.getValue("yyyy-MM-dd'T'HH:mm:ss,1d", macroContext)); Assert.assertEquals("2015-12-31T12:00:00", runtimeMacro.getValue("yyyy-MM-dd'T'HH:mm:ss,1d-12h", macroContext)); Assert.assertEquals("2015-12-31T11:29:45", runtimeMacro.getValue("yyyy-MM-dd'T'HH:mm:ss,1d-12h+30m+15s", macroContext)); }
Source:
<code>public MapReduceTask<KIn, VIn, KOut, VOut> usingSharedIntermediateCache(String cacheName, String cacheConfigurationName) { <START> if (cacheConfigurationName == null || cacheConfigurationName.isEmpty()) { <END> throw new IllegalArgumentException("cacheConfigurationName can not be " + cacheConfigurationName + " Make sure to define a valid cache configuration on all nodes where this task will be executed"); } this.customIntermediateCacheName = cacheName; this.intermediateCacheConfigurationName = cacheConfigurationName; this.useIntermediateSharedCache = true; return this; }</code><technical_language>validate cacheName</technical_language>

Target:
public MapReduceTask<KIn, VIn, KOut, VOut> usingSharedIntermediateCache(String cacheName, String cacheConfigurationName) { if (cacheConfigurationName == null || cacheConfigurationName.isEmpty()) { throw new IllegalArgumentException("Invalid configuration name " + cacheConfigurationName + ", cacheConfigurationName cannot be null or empty"); } if (cacheName == null || cacheName.isEmpty()) { throw new IllegalArgumentException("Invalid cache name" + cacheName + ", cache name cannot be null or empty"); } this.customIntermediateCacheName = cacheName; this.intermediateCacheConfigurationName = cacheConfigurationName; this.useIntermediateSharedCache = true; return this; }
Source:
<code>public BatchingLeaderElectionService(LeaderElectionService delegate) { this.delegate = delegate; this.batcher = DisruptorAutobatcher.create(batch -> { try { LeaderElectionService.LeadershipToken leadershipToken = delegate.blockOnBecomingLeader(); batch.forEach(e -> e.result().set(leadershipToken)); } catch (InterruptedException e) { Thread.currentThread().interrupt(); <START> throw new RuntimeException(e); <END> } }); }</code><technical_language>this change behaviour a bit throwing ExecutionExceptions original cause. a problem depending usage of exception higher levels</technical_language>

Target:
public BatchingLeaderElectionService(LeaderElectionService delegate) { this.delegate = delegate; this.batcher = DisruptorAutobatcher.create(this::processBatch); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; <START> if (obj instanceof NetworkStatistics) <END> return false; NetworkStatistics other = (NetworkStatistics) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (receiveDropRate == null) { if (other.receiveDropRate != null) return false; } else if (!receiveDropRate.equals(other.receiveDropRate)) return false; if (receiveRate == null) { if (other.receiveRate != null) return false; } else if (!receiveRate.equals(other.receiveRate)) return false; if (status != other.status) return false; if (transmitDropRate == null) { if (other.transmitDropRate != null) return false; } else if (!transmitDropRate.equals(other.transmitDropRate)) return false; if (transmitRate == null) { if (other.transmitRate != null) return false; } else if (!transmitRate.equals(other.transmitRate)) return false; return true; }</code><technical_language>!(obj instanceof NetworkStatistics)</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof NetworkStatistics)) return false; NetworkStatistics other = (NetworkStatistics) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (receiveDropRate == null) { if (other.receiveDropRate != null) return false; } else if (!receiveDropRate.equals(other.receiveDropRate)) return false; if (receiveRate == null) { if (other.receiveRate != null) return false; } else if (!receiveRate.equals(other.receiveRate)) return false; if (status != other.status) return false; if (transmitDropRate == null) { if (other.transmitDropRate != null) return false; } else if (!transmitDropRate.equals(other.transmitDropRate)) return false; if (transmitRate == null) { if (other.transmitRate != null) return false; } else if (!transmitRate.equals(other.transmitRate)) return false; return true; }
Source:
<code>public void returnsMethod() throws IOException { MatcherAssert.assertThat( <START> new RqMethod.Base(new RqFake(RqMethod.Base.POST)).method(), <END> Matchers.equalTo(RqMethod.Base.POST) ); }</code><technical_language>I RqMethod.POST</technical_language>

Target:
public void returnsMethod() throws IOException { MatcherAssert.assertThat( new RqMethod.Base(new RqFake(RqMethod.POST)).method(), Matchers.equalTo(RqMethod.POST) ); }
Source:
<code><START> public String pipeCommand() { <END> sc.addFile(scriptsDir, true); sc.addFile(projectDbFile); return "bash scripts/run_tara_referenceextraction.sh"; }</code><technical_language>This a simple method returning a command in fact modifies state of SparkContext held internally. is smelly. do is add description class method</technical_language>

Target:
public String pipeCommand() { return "bash scripts/run_tara_referenceextraction.sh"; }
Source:
<code>default List<@Nullable Object> queryOngoing() { List<@Nullable Object> retVal = new ArrayList<>(); for (int attr = 0; attr < getNbAttributes(); attr++) { <START> retVal.add(queryOngoingState(attr).unboxValue()); <END> } return retVal; }</code><technical_language>queryOngoing(int) avoid boxing/unboxing</technical_language>

Target:
default List<@Nullable Object> queryOngoing() { List<@Nullable Object> retVal = new ArrayList<>(); for (int attr = 0; attr < getNbAttributes(); attr++) { retVal.add(queryOngoing(attr)); } return retVal; }
Source:
<code>public Result<K, T> execute(Query<K, T> query) throws GoraException { Collection<String> range = runQuery(query); <START> RedisResult<K, T> redisResult = new RedisResult<>(this, query, range); <END> return redisResult; }</code><technical_language>Return object directly, is need for this variable</technical_language>

Target:
public Result<K, T> execute(Query<K, T> query) throws GoraException { return new RedisResult<>(this, query, runQuery(query)); }
Source:
<code>public List<Connection> getTransitivelyConnectedElements(EObject element, EObject traceModel, int maximumDepth) { <START> ArrayList<Object> accumulator = new ArrayList<>(); <END> return getTransitivelyConnectedElements(element, traceModel, accumulator, -2, maximumDepth); }</code><technical_language>of type List<Object></technical_language>

Target:
public List<Connection> getTransitivelyConnectedElements(EObject element, EObject traceModel, int maximumDepth) { ArrayList<Object> accumulator = new ArrayList<>(); return getTransitivelyConnectedElements(element, traceModel, accumulator, DEFAULT_INITIAL_TRANSITIVITY_DEPTH, maximumDepth); }
Source:
<code>public static void transferStreams(InputStream source, OutputStream destination, String path, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor); try { byte[] buffer = new byte[8192]; while (true) { int bytesRead = -1; try { bytesRead = source.read(buffer); } catch (IOException e) { fail("Failed to read during transferStreams", e); } if (bytesRead == -1) break; try { destination.write(buffer, 0, bytesRead); } catch (IOException e) { fail("Failed to write during transferStreams", e); } <START> subMonitor.split(1); <END> } } finally { try { source.close(); } catch (IOException e) { } finally { try { destination.close(); } catch (IOException e) { } } } }</code><technical_language>pattern in "Unknown progress" section of <LINK_0></technical_language>

Target:
public static void transferStreams(InputStream source, OutputStream destination, String path, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor); try { byte[] buffer = new byte[8192]; while (true) { int bytesRead = -1; try { bytesRead = source.read(buffer); } catch (IOException e) { fail("Failed to read during transferStreams", e); } if (bytesRead == -1) break; try { destination.write(buffer, 0, bytesRead); } catch (IOException e) { fail("Failed to write during transferStreams", e); } subMonitor.setWorkRemaining(100).split(1); } } finally { try { source.close(); } catch (IOException e) { } finally { try { destination.close(); } catch (IOException e) { } } } }
Source:
<code>public void bindExtensions(String[] theExtensions, boolean isRoot) { if (theExtensions == null) { return; } for (String <START> theExtension : <END> theExtensions) { programmaticVisibilityBindings.add(theExtension); if (isRoot) { programmaticRootBindings.add(theExtension); } } notifyClients(); }</code><technical_language>rename 'extension'</technical_language>

Target:
public void bindExtensions(String[] theExtensions, boolean isRoot) { if (theExtensions == null) { return; } for (String extension : theExtensions) { programmaticVisibilityBindings.add(extension); if (isRoot) { programmaticRootBindings.add(extension); } } notifyClients(); }
Source:
<code>public void query(Writer out) throws OrmException, QueryParseException, IOException { if (imp.isDisabled()) { throw new QueryParseException("query disabled"); } if (queries == null) { queries = Collections.singletonList("status:open"); } List<List<ChangeInfo>> res = Lists.newArrayListWithCapacity(queries.size()); for (String query : queries) { List<ChangeData> changes = imp.queryChanges(query, defaultField); boolean moreChanges = imp.getLimit() > 0 && changes.size() > imp.getLimit(); if (moreChanges) { if (reverse) { changes = changes.subList(1, changes.size()); } else { changes = changes.subList(0, imp.getLimit()); } } List<ChangeInfo> info = Lists.newArrayListWithCapacity(changes.size()); for (ChangeData cd : changes) { info.add(toChangeInfo(cd)); } if (moreChanges && !info.isEmpty()) { if (reverse) { info.get(0)._moreChanges = true; } else { info.get(info.size() - 1)._moreChanges = true; } } res.add(info); } if (format.isJson()) { format.newGson().toJson( res.size() == 1 ? res.get(0) : res, new TypeToken<List<ChangeInfo>>() {}.getType(), out); out.write('\n'); } else { for (List<ChangeInfo> info : res) { for (ChangeInfo c : info) { String id = new Change.Key(c.id).abbreviate(); String subject = c.subject; if (subject.length() + id.length() > 80) { subject = subject.substring(0, 80 - id.length()); } out.write(id); out.write(' '); out.write(subject.replace('\n', ' ')); out.write('\n'); <START> } <END> } } }</code><technical_language>[optional] print out visualize result for next query starts (e.g. a blank line)</technical_language>

Target:
public void query(Writer out) throws OrmException, QueryParseException, IOException { if (imp.isDisabled()) { throw new QueryParseException("query disabled"); } if (queries == null || queries.isEmpty()) { queries = Collections.singletonList("status:open"); } else if (queries.size() > 10) { throw new QueryParseException("limit of 10 queries"); } List<List<ChangeInfo>> res = Lists.newArrayListWithCapacity(queries.size()); for (String query : queries) { List<ChangeData> changes = imp.queryChanges(query); boolean moreChanges = imp.getLimit() > 0 && changes.size() > imp.getLimit(); if (moreChanges) { if (reverse) { changes = changes.subList(1, changes.size()); } else { changes = changes.subList(0, imp.getLimit()); } } List<ChangeInfo> info = Lists.newArrayListWithCapacity(changes.size()); for (ChangeData cd : changes) { info.add(toChangeInfo(cd)); } if (moreChanges && !info.isEmpty()) { if (reverse) { info.get(0)._moreChanges = true; } else { info.get(info.size() - 1)._moreChanges = true; } } res.add(info); } if (format.isJson()) { format.newGson().toJson( res.size() == 1 ? res.get(0) : res, new TypeToken<List<ChangeInfo>>() {}.getType(), out); out.write('\n'); } else { boolean firstQuery = true; for (List<ChangeInfo> info : res) { if (firstQuery) { firstQuery = false; } else { out.write('\n'); } for (ChangeInfo c : info) { String id = new Change.Key(c.id).abbreviate(); String subject = c.subject; if (subject.length() + id.length() > 80) { subject = subject.substring(0, 80 - id.length()); } out.write(id); out.write(' '); out.write(subject.replace('\n', ' ')); out.write('\n'); } } } }
Source:
<code>public static FunctionDefinition createFunctionDefinition( String name, String className, FunctionLanguage functionLanguage, ReadableConfig config) { <START> switch (functionLanguage) { <END> case PYTHON: return createPythonFunctionDefinition(name, className, config); default: return createJavaFunctionDefinition(name, className); } }</code><technical_language>complains in IDE switch case labels. resolve this warning</technical_language>

Target:
public static FunctionDefinition createFunctionDefinition( String name, String className, FunctionLanguage functionLanguage, ReadableConfig config) { if (functionLanguage == FunctionLanguage.PYTHON) { return createPythonFunctionDefinition(name, className, config); } else { return createJavaFunctionDefinition(name, className); } }
Source:
<code>private void doBulkFileRepositoryLookup(List<AbstractFile> files) throws TskCoreException { try { BulkExistenceResult results = FileRepository.exists(files); for (AbstractFile file : files) { BulkExistenceEnum result = results.getResult(file); <START> if (result != null && result.equals(BulkExistenceEnum.TRUE)) { <END> fileRepositoryLookupCache.put(file.getId(), FileRepoState.EXISTS); } else if (result != null && result.equals(BulkExistenceEnum.FALSE)) { fileRepositoryLookupCache.put(file.getId(), FileRepoState.DOES_NOT_EXIST); } } } catch (IOException | FileRepositoryException ex) { throw new TskCoreException("Error looking up file in file repository"); } }</code><technical_language>Hmm, BulkExistenceEnum EXISTS, DOES_NOT_EXIST, INVALID_HASH, instead of True, False, Invalid</technical_language>

Target:
private void doBulkFileRepositoryLookup(List<AbstractFile> files) throws TskCoreException { try { BulkExistenceResult results = FileRepository.exists(files); for (AbstractFile file : files) { BulkExistenceEnum result = results.getResult(file); if (result != null && result.equals(BulkExistenceEnum.TRUE)) { fileRepositoryLookupCache.put(file.getId(), FileRepoState.EXISTS); } else if (result != null && result.equals(BulkExistenceEnum.FALSE)) { fileRepositoryLookupCache.put(file.getId(), FileRepoState.DOES_NOT_EXIST); } } } catch (IOException | FileRepositoryException ex) { throw new TskCoreException("Error looking up file in file repository", ex); } }
Source:
<code><START> private static String splitCamelCase(@NotNull String string) { <END> StringBuilder sb = new StringBuilder(2 * string.length()); int n = string.length(); boolean lastWasUpperCase = Character.isUpperCase(string.charAt(0)); boolean capitalizeNext = true; for (int i = 0; i < n; i++) { char c = string.charAt(i); boolean isUpperCase = Character.isUpperCase(c); if (isUpperCase && !lastWasUpperCase) { sb.append(' '); capitalizeNext = true; } lastWasUpperCase = isUpperCase; if (capitalizeNext) { c = Character.toUpperCase(c); capitalizeNext = false; } else { c = Character.toLowerCase(c); } sb.append(c); } return sb.toString(); }</code><technical_language>name reflect enforces camel casing? (knocking multiple capital letters)</technical_language>

Target:
static String splitCamelCase(@NotNull String string) { StringBuilder sb = new StringBuilder(2 * string.length()); int n = string.length(); boolean lastWasUpperCase = Character.isUpperCase(string.charAt(0)); boolean capitalizeNext = true; for (int i = 0; i < n; i++) { char c = string.charAt(i); boolean isUpperCase = Character.isUpperCase(c); if (isUpperCase && !lastWasUpperCase) { sb.append(' '); capitalizeNext = true; } lastWasUpperCase = isUpperCase; if (capitalizeNext) { c = Character.toUpperCase(c); capitalizeNext = false; } else { c = Character.toLowerCase(c); } sb.append(c); } return sb.toString(); }
Source:
<code>public ExtendDeclaration(String name, String fqname, String documentation, List<MessageType.Field> fields) { this.name = name; this.fqname = fqname; this.documentation = documentation; <START> this.fields = fields; <END> }</code><technical_language>This list currently in mutable is exposed a getter below. copy wrap unmodifiable in calling code</technical_language>

Target:
public ExtendDeclaration(String name, String fqname, String documentation, List<MessageType.Field> fields) { this.name = name; this.fqname = fqname; this.documentation = documentation; this.fields = Collections.unmodifiableList(new ArrayList<MessageType.Field>(fields)); }
Source:
<code>private static String convertParamType(final String type) { <START> if (type.startsWith("com.spectralogic.s3.common.dao.domain")) { <END> final String[] packageParts = type.split("\\."); return MODELS_PACKAGE + packageParts[packageParts.length - 1]; } return type; }</code><technical_language>this string a constant</technical_language>

Target:
private static String convertParamType(final String type) { if (type.startsWith(CONTRACT_PACKAGE)) { final String[] packageParts = type.split("\\."); return MODELS_PACKAGE + packageParts[packageParts.length - 1]; } return type; }