auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { InputStream in = null; String resourceLocation = getServletConfig().getInitParameter("resource-location"); String outputFormat = getServletConfig().getInitParameter("output-format"); try { in = new FileInputStream(resourceLocation); CertificateFactory cf = CertificateFactory.getInstance("X.509"); Certificate certificate = cf.generateCertificate(in); if (outputFormat.equals("X509-PEM")) { response.setContentType("application/x-x509-ca-cert"); response.getWriter().print( String.format( <START> ( <END> "-----BEGIN CERTIFICATE-----\n" + "%1$s" + "-----END CERTIFICATE-----\n" ), new Base64( 76, new byte[] { (byte)'\n' } ).encodeToString( certificate.getEncoded() ) ) ); } else if (outputFormat.equals("SSH")) { response.setContentType("text/plain"); response.getWriter().print( OpenSSHUtils.getKeyString( certificate.getPublicKey(), getServletConfig().getInitParameter("output-alias") ) ); } else { throw new IllegalArgumentException("Unsupported output format " + outputFormat); } } catch(Exception e) { log.error( String.format( "Cannot send public key resource '%1$s' format '%2$s'", resourceLocation, outputFormat ), e ); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } finally { if (in != null) { in.close(); } } }</code><technical_language>create proper indentation, distinguish parameters</technical_language>

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { InputStream in = null; String resourceLocation = getServletConfig().getInitParameter("resource-location"); String outputFormat = getServletConfig().getInitParameter("output-format"); try { in = new FileInputStream(resourceLocation); CertificateFactory cf = CertificateFactory.getInstance("X.509"); Certificate certificate = cf.generateCertificate(in); if (outputFormat.equals("X509-PEM")) { response.setContentType("application/x-x509-ca-cert"); response.getWriter().print( String.format( ( "-----BEGIN CERTIFICATE-----\n" + "%1$s" + "-----END CERTIFICATE-----\n" ), new Base64( 76, new byte[] { (byte)'\n' } ).encodeToString( certificate.getEncoded() ) ) ); } else if (outputFormat.equals("SSH")) { response.setContentType("text/plain"); response.getWriter().print( String.format( "%1$s\n", OpenSSHUtils.getKeyString( certificate.getPublicKey(), getServletConfig().getInitParameter("output-alias") ) ) ); } else { throw new IllegalArgumentException("Unsupported output format " + outputFormat); } } catch(Exception e) { log.error( String.format( "Cannot send public key resource '%1$s' format '%2$s'", resourceLocation, outputFormat ), e ); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } finally { if (in != null) { in.close(); } } }
Source:
<code><START> public double getZoomCenter() { <END> return zoomCenter; }</code><technical_language>int float. long is outdated & double used</technical_language>

Target:
public float getZoomCenter() { return zoomCenter; }
Source:
<code>protected static String generateMeta(ImportedPatent patent) { <START> if ("non-existing".equals(patent.getPublnNr())) { <END> throw new NoSuchElementException("unable to find element"); } StringBuilder strBuilder = new StringBuilder(); strBuilder.append(patent.getApplnAuth()); strBuilder.append('-'); strBuilder.append(patent.getApplnNr()); strBuilder.append('-'); strBuilder.append(patent.getPublnAuth()); strBuilder.append('-'); strBuilder.append(patent.getPublnNr()); strBuilder.append('-'); strBuilder.append(patent.getPublnKind()); return strBuilder.toString(); }</code><technical_language>IDE says: 'String.equals()' called 'CharSequence' argument. Wants convert contentEquals</technical_language>

Target:
protected static String generateMeta(ImportedPatent patent) { if ("non-existing".contentEquals(patent.getPublnNr())) { throw new NoSuchElementException("unable to find element"); } StringBuilder strBuilder = new StringBuilder(); strBuilder.append(patent.getApplnAuth()); strBuilder.append('-'); strBuilder.append(patent.getApplnNr()); strBuilder.append('-'); strBuilder.append(patent.getPublnAuth()); strBuilder.append('-'); strBuilder.append(patent.getPublnNr()); strBuilder.append('-'); strBuilder.append(patent.getPublnKind()); return strBuilder.toString(); }
Source:
<code>private boolean isInside(int offset, int start, int end) { <START> return offset == start <END> || offset == end || (offset > start && offset < end); }</code><technical_language>I mistaken java return start <= offset && offset <= end;</technical_language>

Target:
private boolean isInside(int offset, int start, int end) { return offset >= start && offset <= end; }
Source:
<code>public static PhoenixJson getInstance(String jsonData) throws SQLException { try { JsonFactory jsonFactory = new JsonFactory(); JsonParser jsonParser = jsonFactory.createJsonParser(jsonData); PhoenixJson phoenixJson = getInstanceInternal(jsonParser); <START> phoenixJson.setJsonAsString(jsonData); <END> return phoenixJson; } catch (IOException x) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.INVALID_JSON_DATA).setRootCause(x) .setMessage(x.getMessage()).build().buildException(); } }</code><technical_language>Pass String PhoenixJson constructor. PhoenixJson immutable</technical_language>

Target:
public static PhoenixJson getInstance(String jsonData) throws SQLException { if (jsonData == null) { return null; } try { JsonFactory jsonFactory = new JsonFactory(); JsonParser jsonParser = jsonFactory.createJsonParser(jsonData); JsonNode jsonNode = getRootJsonNode(jsonParser); return new PhoenixJson(jsonNode, jsonData); } catch (IOException x) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.INVALID_JSON_DATA).setRootCause(x) .setMessage(x.getMessage()).build().buildException(); } }
Source:
<code>public void updatingWithNonRecentValueDoesNotAffectCache() throws InvalidAcceptorCacheKeyException { Map<Client, Long> before = ImmutableMap.<Client, Long>builder() .put(Client.of("client1"), 5L) .put(Client.of("client2"), 6L) .put(Client.of("client3"), 7L) .build(); AcceptorCache cache = cache(before); AcceptorCacheDigest digest = cache.getAllUpdates(); cache.updateSequenceNumbers(ImmutableSet.of( <START> WithSeq.of(10L, Client.of("client1")), <END> WithSeq.of(3L, Client.of("client2")))); AcceptorCacheDigest secondDigest = cache.updatesSinceCacheKey(digest.newCacheKey()).get(); assertThat(secondDigest.updates()) .containsEntry(Client.of("client1"), 10L); cache.updateSequenceNumbers(ImmutableSet.of(WithSeq.of(5L, Client.of("client3")))); assertThat(cache.updatesSinceCacheKey(secondDigest.newCacheKey())) .as("there are no actionable changes, cache is the same") .isEmpty(); assertThat(cache.updatesSinceCacheKey(digest.newCacheKey())) .as("no actionable changes => this is no different from calling updatesSinceCacheKey twice") .contains(secondDigest); }</code><technical_language>ordering is kind of inconsistent. prefer swapping seq in WithSeq</technical_language>

Target:
public void updatingWithNonRecentValueDoesNotAffectCache() throws InvalidAcceptorCacheKeyException { Map<Client, Long> before = ImmutableMap.<Client, Long>builder() .put(Client.of("client1"), 5L) .put(Client.of("client2"), 6L) .put(Client.of("client3"), 7L) .build(); AcceptorCache cache = cache(before); AcceptorCacheDigest digest = cache.getAllUpdates(); cache.updateSequenceNumbers(ImmutableSet.of( WithSeq.of(10L, Client.of("client1")), WithSeq.of(3L, Client.of("client2")))); AcceptorCacheDigest secondDigest = cache.updatesSinceCacheKey(digest.newCacheKey()).get(); assertThat(secondDigest.updates()) .containsOnly(entry(Client.of("client1"), 10L)); cache.updateSequenceNumbers(ImmutableSet.of(WithSeq.of(5L, Client.of("client3")))); assertThat(cache.updatesSinceCacheKey(secondDigest.newCacheKey())) .as("there are no actionable changes, cache is the same") .isEmpty(); assertThat(cache.updatesSinceCacheKey(digest.newCacheKey())) .as("no actionable changes => this is no different from calling updatesSinceCacheKey twice") .contains(secondDigest); }
Source:
<code>private DBObject insertDBObject(EntityKeyMetadata entityKeyMetadata, Tuple tuple, WriteConcern writeConcern) { if ( columnNamesAllowBatchInsert( tuple.getColumnNames() ) ) { DBObject dbObject = objectForInsert( tuple, new BasicDBObject( tuple.getColumnNames().size() ) ); getCollection( entityKeyMetadata ).insert( dbObject, writeConcern ); return dbObject; } else { BasicDBObject idObject = new BasicDBObject(); getCollection( entityKeyMetadata ).insert( idObject, writeConcern ); DBObject updater = objectForUpdate( tuple, idObject ); <START> getCollection( entityKeyMetadata ).update( idObject, updater, true, false, writeConcern ); <END> return idObject; } }</code><technical_language>double roundtrip datastore sucks a bit. create a nested hierarchy of DBObjects for representing embeddables instead of passing original dot-separated columns</technical_language>

Target:
private DBObject insertDBObject(EntityKeyMetadata entityKeyMetadata, Tuple tuple, WriteConcern writeConcern) { DBObject dbObject = objectForInsert( tuple, new BasicDBObject( tuple.getColumnNames().size() ) ); getCollection( entityKeyMetadata ).insert( dbObject, writeConcern ); return dbObject; }
Source:
<code>public List<ValidationProvider<?>> getValidationProviders() { List<ValidationProvider<?>> validationProviderList = new ArrayList<ValidationProvider<?>>(); ClassLoader classloader = GetClassLoader.fromContext(); if ( getCachedValidationProviders( classloader ) != null ) { return getCachedValidationProviders( classloader ); <START> } <END> ServiceLoader<ValidationProvider> loader = ServiceLoader.load( ValidationProvider.class, classloader ); Iterator<ValidationProvider> providerIterator = loader.iterator(); if ( !providerIterator.hasNext() ) { classloader = GetClassLoader.fromClass( DefaultValidationProviderResolver.class ); if ( getCachedValidationProviders( classloader ) != null ) { return getCachedValidationProviders( classloader ); } loader = ServiceLoader.load( ValidationProvider.class, classloader ); providerIterator = loader.iterator(); } while ( providerIterator.hasNext() ) { try { validationProviderList.add( providerIterator.next() ); } catch ( ServiceConfigurationError e ) { throw new ValidationException( "Unable to load Bean Validation provider non.existent.ValidationProvider", e ); } } cacheValidationProviders( classloader, validationProviderList ); return validationProviderList; }</code><technical_language>I provider list assigned a variable a strong reference. soft reference GC'ed checking for null returning list</technical_language>

Target:
public List<ValidationProvider<?>> getValidationProviders() { return GetValidationProviderList.getValidationProviderList(); }
Source:
<code>public void populateDAG(DAG dag, Configuration conf) { BlockWriter blockWriter = dag.addOperator("BlockWriter", new BlockWriter()); Synchronizer synchronizer = dag.addOperator("BlockSynchronizer", new Synchronizer()); dag.setInputPortAttribute(blockWriter.input, PortContext.PARTITION_PARALLEL, true); dag.setInputPortAttribute(blockWriter.blockMetadataInput, PortContext.PARTITION_PARALLEL, true); dag.addStream("CompletedBlockmetadata", blockWriter.blockMetadataOutput, synchronizer.blocksMetadataInput); HDFSFileMerger merger = new HDFSFileMerger(); merger = dag.addOperator("FileMerger", merger); dag.addStream("MergeTrigger", synchronizer.trigger, merger.input); merger.setFilePath(outputDirectoryPath); <START> merger.setOverwriteOnConflict(overwriteOnConflict); <END> filesMetadataInput.set(synchronizer.filesMetadataInput); blocksMetadataInput.set(blockWriter.blockMetadataInput); blockData.set(blockWriter.input); }</code><technical_language>java default is false, I guess expect default in feature true, default in module, add some checks if user provided this config</technical_language>

Target:
public void populateDAG(DAG dag, Configuration conf) { BlockWriter blockWriter = dag.addOperator("BlockWriter", new BlockWriter()); Synchronizer synchronizer = dag.addOperator("BlockSynchronizer", new Synchronizer()); dag.setInputPortAttribute(blockWriter.input, PortContext.PARTITION_PARALLEL, true); dag.setInputPortAttribute(blockWriter.blockMetadataInput, PortContext.PARTITION_PARALLEL, true); dag.addStream("CompletedBlockmetadata", blockWriter.blockMetadataOutput, synchronizer.blocksMetadataInput); HDFSFileMerger merger = new HDFSFileMerger(); merger = dag.addOperator("FileMerger", merger); dag.addStream("MergeTrigger", synchronizer.trigger, merger.input); merger.setFilePath(outputDirectoryPath); merger.setOverwriteOnConflict(overwriteOnConflict); blockWriter.setBlocksDirectory(blocksDirectory); merger.setBlocksDirectory(blocksDirectory); filesMetadataInput.set(synchronizer.filesMetadataInput); blocksMetadataInput.set(blockWriter.blockMetadataInput); blockData.set(blockWriter.input); }
Source:
<code>private void flush(OutputBuffer outputBuffer) { if (bufferedRowCount == 0) { return; } SliceOutput output = new DynamicSliceOutput(getSerializedBuffersSizeInBytes()); output.writeInt(blockEncodingBuffers.length); for (int i = 0; i < blockEncodingBuffers.length; i++) { blockEncodingBuffers[i].serializeTo(output); } SerializedPage serializedPage = serde.serialize(output.slice(), bufferedRowCount); <START> outputBuffer.enqueue(lifespan, partition, Collections.singletonList(serializedPage)); <END> pagesAdded.incrementAndGet(); rowsAdded.addAndGet(bufferedRowCount); bufferedRowCount = 0; }</code><technical_language>Collections.singletonList -> ImmutableList.of</technical_language>

Target:
private void flush(OutputBuffer outputBuffer) { if (bufferedRowCount == 0) { return; } SliceOutput output = new DynamicSliceOutput(toIntExact(getSerializedBuffersSizeInBytes())); output.writeInt(channelCount); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].serializeTo(output); } SerializedPage serializedPage = serde.serialize(output.slice(), bufferedRowCount); outputBuffer.enqueue(lifespan, partition, ImmutableList.of(serializedPage)); pagesAdded.incrementAndGet(); rowsAdded.addAndGet(bufferedRowCount); if (blockEncodingBuffers != null) { for (int i = 0; i < blockEncodingBuffers.length; i++) { blockEncodingBuffers[i].resetBuffers(); } } bufferedRowCount = 0; }
Source:
<code>AzkabanProjectLoader(final Props props, final ProjectLoader projectLoader, final StorageManager storageManager) { this.props = requireNonNull(props, "Props is null"); this.projectLoader = requireNonNull(projectLoader, "project Loader is null"); this.storageManager = requireNonNull(storageManager, "Storage Manager is null"); tempDir = new File(props.getString("project.temp.dir", "temp")); if (!tempDir.exists()) { log.info("Using temp dir: " + tempDir.getAbsolutePath()); tempDir.mkdirs(); } else { <START> log.info("Creating temp dir: " + tempDir.getAbsolutePath()); <END> } projectVersionRetention = props.getInt("project.version.retention", 3); log.info("Project version retention is set to " + projectVersionRetention); }</code><technical_language>Is this log statement correct</technical_language>

Target:
AzkabanProjectLoader(final Props props, final ProjectLoader projectLoader, final StorageManager storageManager) { this.props = requireNonNull(props, "Props is null"); this.projectLoader = requireNonNull(projectLoader, "project Loader is null"); this.storageManager = requireNonNull(storageManager, "Storage Manager is null"); this.tempDir = new File(props.getString(ConfigurationKeys.PROJECT_TEMP_DIR, "temp")); if (!this.tempDir.exists()) { log.info("Creating temp dir: " + this.tempDir.getAbsolutePath()); this.tempDir.mkdirs(); } else { log.info("Using temp dir: " + this.tempDir.getAbsolutePath()); } this.projectVersionRetention = props.getInt("project.version.retention", 3); log.info("Project version retention is set to " + this.projectVersionRetention); }
Source:
<code>public void start() { for (int i = 0; i < numProcessingQueues; i++) { processingExecutor.scheduleAtFixedRate( new SegmentChangeProcessor(segmentProcessingQueues[i]), 0, <START> config.getCuratorCreateZkNodesRepeatDelay().getMillis(), <END> TimeUnit.MILLISECONDS ); } }</code><technical_language>I figure out is rationale for segment queues repeated runs, **SegmentChangeProcessors** work non-stop single queue</technical_language>

Target:
public void start() { }
Source:
<code>public Map<String, Integer> countEvalGroupsForNodes(String[] nodeIds) { <START> Map<String, Integer> m = new HashMap<String, Integer>(); <END> if (evalHierarchyProvider != null) { m = evalHierarchyProvider.countEvalGroupsForNodes(nodeIds); } for( String nodeId : nodeIds ) { if( !m.containsKey( nodeId ) ) { m.put( nodeId, 0 ); } } Map<String, Set<String>> nodeGroupsMap = getEvalGroupsForNodes( nodeIds ); for( String nodeID : nodeGroupsMap.keySet() ) { m.put( nodeID, nodeGroupsMap.get( nodeID ).size() ); } return m; }</code><technical_language>This "m" variable is repeatedly needs a name</technical_language>

Target:
public Map<String, Integer> countEvalGroupsForNodes(String[] nodeIds) { Map<String, Integer> nodeGroupSizeMap; if (evalHierarchyProvider != null) { nodeGroupSizeMap = evalHierarchyProvider.countEvalGroupsForNodes(nodeIds); } else { nodeGroupSizeMap = new HashMap<>(); } for( String nodeId : nodeIds ) { if( !nodeGroupSizeMap.containsKey( nodeId ) ) { nodeGroupSizeMap.put( nodeId, 0 ); } } Map<String, Set<String>> nodeGroupsMap = getEvalGroupsForNodes( nodeIds ); for( String nodeID : nodeGroupsMap.keySet() ) { nodeGroupSizeMap.put( nodeID, nodeGroupsMap.get( nodeID ).size() ); } return nodeGroupSizeMap; }
Source:
<code>public ProjectAggregate withUncommittedEvents(ProjectId id) { ProjectAggregate aggregate = Given.aggregateOfClass(ProjectAggregate.class) .withId(id) .build(); AggCreateProject.Builder createProject = builderForType(AggCreateProject.class); createProject.setProjectId(id); AggAddTask.Builder addTask = builderForType(AggAddTask.class); addTask.setProjectId(id); AggStartProject.Builder startProject = builderForType(AggStartProject.class); startProject.setProjectId(id); <START> dispatchCommand(aggregate, repository, env(createProject.build())); <END> dispatchCommand(aggregate, repository, env(addTask.build())); dispatchCommand(aggregate, repository, env(startProject.build())); return aggregate; }</code><technical_language>Please consider a method accepts parameter passed env() in calls</technical_language>

Target:
public ProjectAggregate withUncommittedEvents(ProjectId id) { ProjectAggregate givenProject = Given.aggregateOfClass(ProjectAggregate.class) .withId(id) .build(); AggCreateProject.Builder createProject = builderForType(AggCreateProject.class); createProject.setProjectId(id); AggAddTask.Builder addTask = builderForType(AggAddTask.class); addTask.setProjectId(id); AggStartProject.Builder startProject = builderForType(AggStartProject.class); startProject.setProjectId(id); new ToProject(givenProject) .dispatch(createProject.build()) .dispatch(addTask.build()) .dispatch(startProject.build()); return givenProject; }
Source:
<code>private static boolean removeVideoDevice(VmDeviceType whenGraphicsExists, VmDeviceType videoToRemove, Map<Guid, VmDevice> managedDevicesMap) { <START> for (Map.Entry<Guid, VmDevice> videoDevice : managedDevicesMap.entrySet()) { <END> if (whenGraphicsExists.getName().equals(videoDevice.getValue().getDevice())) { for (Map.Entry<Guid, VmDevice> graphicsDevice : managedDevicesMap.entrySet()) { if (videoToRemove.getName().equals(graphicsDevice.getValue().getDevice())) { managedDevicesMap.remove(graphicsDevice.getKey()); return true; } } } } return false; }</code><technical_language>1. need entrySet() here, key, value. values() enough. 2. need nested loop here, outer loop is check existence. separate loops more clear. 3. similar methods in VmDeviceCommonUtils for device type/generalType (findVmDeviceByType()/isVmDeviceExists()). adding another pair for name</technical_language>

Target:
private static boolean removeVideoDevice(VmDeviceType whenGraphicsExists, VmDeviceType videoToRemove, Map<Guid, VmDevice> managedDevicesMap) { if (VmDeviceCommonUtils.isVmDeviceExists(managedDevicesMap, whenGraphicsExists)) { Guid key = null; for (Map.Entry<Guid, VmDevice> graphicsDevice : managedDevicesMap.entrySet()) { if (videoToRemove.getName().equals(graphicsDevice.getValue().getDevice())) { key = graphicsDevice.getKey(); break; } } if (key != null) { managedDevicesMap.remove(key); return true; } } return false; }
Source:
<code>public void bind(int position) { UploadableFile uploadableFile = uploadableFiles.get(position); Uri uri = uploadableFile.getMediaUri(); background.setImageURI(Uri.fromFile(new File(String.valueOf(uri)))); if (position == callback.getCurrentSelectedFilePosition()) { GradientDrawable border = new GradientDrawable(); border.setShape(GradientDrawable.RECTANGLE); border.setStroke(10, context.getResources().getColor(R.color.primaryColor)); rlContainer.setEnabled(true); rlContainer.setClickable(true); rlContainer.setAlpha(1.0f); <START> rlContainer.setForeground(border); <END> if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { rlContainer.setElevation(10); } } else { rlContainer.setEnabled(false); rlContainer.setClickable(false); rlContainer.setAlpha(0.7f); rlContainer.setForeground(null); if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { rlContainer.setElevation(0); } } }</code><technical_language>setForeground for this. Android Studio supported API 23 app supports API 19 above. a matter of fact, app crashes for I try share multiple images app. I Android 5.1.1 device</technical_language>

Target:
public void bind(int position) { UploadableFile uploadableFile = uploadableFiles.get(position); Uri uri = uploadableFile.getMediaUri(); background.setImageURI(Uri.fromFile(new File(String.valueOf(uri)))); if (position == callback.getCurrentSelectedFilePosition()) { GradientDrawable border = new GradientDrawable(); border.setShape(GradientDrawable.RECTANGLE); border.setStroke(8, context.getResources().getColor(R.color.primaryColor)); rlContainer.setEnabled(true); rlContainer.setClickable(true); rlContainer.setAlpha(1.0f); rlContainer.setBackground(border); if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { rlContainer.setElevation(10); } } else { rlContainer.setEnabled(false); rlContainer.setClickable(false); rlContainer.setAlpha(0.7f); rlContainer.setBackground(null); if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { rlContainer.setElevation(0); } } }
Source:
<code>public String getAlgorithm() { <START> return "ED25519-SK"; <END> }</code><technical_language>Please this a public literal constant of this class</technical_language>

Target:
public String getAlgorithm() { return ALGORITHM; }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { onBackPressed(); return true; <START> } else if (mFollowMenuItem != null && item.equals(mFollowMenuItem)) { <END> toggleFollowStatus(); } return super.onOptionsItemSelected(item); }</code><technical_language>nitpick; need check if mFollowMenuItem here, .equals care of that</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { onBackPressed(); return true; } else if (item.equals(mFollowMenuItem)) { toggleFollowStatus(); } return super.onOptionsItemSelected(item); }
Source:
<code>public void bundleChanged(BundleEvent event) { int eventType = event.getType(); synchronized (this) { if (eventType == BundleEvent.STARTED) { <START> progressMonitor.split(4); <END> String symbolicName = event.getBundle().getSymbolicName(); String taskName = NLS.bind(WorkbenchMessages.Startup_Loading, symbolicName); progressMonitor.subTask(taskName); } } }</code><technical_language>4? I 25% early startup bundles in Eclipse. expensive obtain front correct number? Is undue effort</technical_language>

Target:
public void bundleChanged(BundleEvent event) { int eventType = event.getType(); if (eventType == BundleEvent.STARTED) { progressMonitor.split(10); String symbolicName = event.getBundle().getSymbolicName(); String taskName = NLS.bind(WorkbenchMessages.Startup_Loading, symbolicName); progressMonitor.subTask(taskName); } }
Source:
<code>public AccessDatastore(String name, String filename) { super(name); if(filename == null){ <START> throw new NullPointerException("dilename cannot be null"); <END> } _filename = filename; }</code><technical_language>typo</technical_language>

Target:
public AccessDatastore(String name, String filename) { super(name); if(filename == null){ throw new NullPointerException("Filename cannot be null"); } _filename = filename; }
Source:
<code>protected GuidedDecisionTableEditorPresenter getPresenter() { return new GuidedDecisionTableEditorPresenter(view, <START> dtServiceCaller, <END> docks, mock(PerspectiveManager.class), notification, decisionTableSelectedEvent, validationPopup, resourceType, editMenuBuilder, viewMenuBuilder, insertMenuBuilder, radarMenuBuilder, modeller, beanManager, placeManager, columnsPage, saveAndRenameCommandBuilder, alertsButtonMenuItemBuilder, downloadMenuItem) { @Override protected Command getSaveAndRenameCommand() { return mock(Command.class); } }; }</code><technical_language>@Mock mock(..) good reason?</technical_language>

Target:
protected GuidedDecisionTableEditorPresenter getPresenter() { return new GuidedDecisionTableEditorPresenter(view, dtServiceCaller, docks, perspectiveManager, notification, decisionTableSelectedEvent, validationPopup, resourceType, editMenuBuilder, viewMenuBuilder, insertMenuBuilder, radarMenuBuilder, modeller, beanManager, placeManager, columnsPage, saveAndRenameCommandBuilder, alertsButtonMenuItemBuilder, downloadMenuItem) { @Override protected Command getSaveAndRenameCommand() { return mock(Command.class); } }; }
Source:
<code>public static Tree findAncestorWithKind(Tree tree, Collection<Tree.Kind> kinds) { Tree parent = tree; while (parent != null && !kinds.contains(parent.getKind())) { parent = parent.getParent(); } <START> if (parent != null) { <END> return parent; } return null; }</code><technical_language>return parent</technical_language>

Target:
public static Tree findAncestorWithKind(Tree tree, Collection<Tree.Kind> kinds) { Tree parent = tree; while (parent != null && !kinds.contains(parent.getKind())) { parent = parent.getParent(); } return parent; }
Source:
<code>public final boolean classicNotification() { <START> return mPreferences.getBoolean(CLASSIC_NOTIFICATION, true); <END> }</code><technical_language>return mPreferences.getBoolean(CLASSIC_NOTIFICATION, false); preference is disabled default (it is defaultValue="false" in pref_notification.xml)? Currently fresh install classic notification, while is disabled in settings</technical_language>

Target:
public final boolean classicNotification() { return mPreferences.getBoolean(CLASSIC_NOTIFICATION, false); }
Source:
<code>public void testGetOutOfDateRowsForViewSqlFileView() { long viewTypeMask = ViewTypeMask.File.getMask() ; String sql = SQLUtils.getOutOfDateRowsForViewSql(tableId, viewTypeMask); String expected = "WITH DELTAS (ID, MISSING) AS (" + " SELECT R.OBJECT_ID, V.ROW_ID FROM OBJECT_REPLICATION R" + " LEFT JOIN T999 V ON (" + " R.OBJECT_TYPE = :objectType" <START> + " AND R.OBJECT_ID = V.ROW_ID" <END> + " AND R.ETAG = V.ROW_ETAG" + " AND R.BENEFACTOR_ID = V.ROW_BENEFACTOR)" + " WHERE R.OBJECT_TYPE = :objectType AND R.PARENT_ID IN (:scopeIds) AND R.SUBTYPE IN ('file')" + " UNION ALL" + " SELECT V.ROW_ID, R.OBJECT_ID FROM OBJECT_REPLICATION R" + " RIGHT JOIN T999 V ON (" + " R.OBJECT_TYPE = :objectType" + " AND R.OBJECT_ID = V.ROW_ID" + " AND R.ETAG = V.ROW_ETAG" + " AND R.BENEFACTOR_ID = V.ROW_BENEFACTOR" + " AND R.PARENT_ID IN (:scopeIds) AND R.SUBTYPE IN ('file'))" + ")" + "SELECT ID FROM DELTAS WHERE MISSING IS NULL ORDER BY ID DESC LIMIT :limitParam"; assertEquals(expected, sql); }</code><technical_language>remove condition clause</technical_language>

Target:
public void testGetOutOfDateRowsForViewSqlFileView() { long viewTypeMask = ViewTypeMask.File.getMask() ; String sql = SQLUtils.getOutOfDateRowsForViewSql(tableId, viewTypeMask); String expected = "WITH DELTAS (ID, MISSING) AS (" + " SELECT R.OBJECT_ID, V.ROW_ID FROM OBJECT_REPLICATION R" + " LEFT JOIN T999 V ON (" + " R.OBJECT_ID = V.ROW_ID" + " AND R.ETAG = V.ROW_ETAG" + " AND R.BENEFACTOR_ID = V.ROW_BENEFACTOR)" + " WHERE R.OBJECT_TYPE = :objectType AND R.PARENT_ID IN (:scopeIds) AND R.SUBTYPE IN ('file')" + " UNION ALL" + " SELECT V.ROW_ID, R.OBJECT_ID FROM OBJECT_REPLICATION R" + " RIGHT JOIN T999 V ON (" + " R.OBJECT_TYPE = :objectType" + " AND R.OBJECT_ID = V.ROW_ID" + " AND R.ETAG = V.ROW_ETAG" + " AND R.BENEFACTOR_ID = V.ROW_BENEFACTOR" + " AND R.PARENT_ID IN (:scopeIds) AND R.SUBTYPE IN ('file'))" + ")" + "SELECT ID FROM DELTAS WHERE MISSING IS NULL ORDER BY ID DESC LIMIT :limitParam"; assertEquals(expected, sql); }
Source:
<code>public void flush() throws IOException { if (started.get()) { Future future = exec.schedule(new ConsumerRunnable(), 0, TimeUnit.MILLISECONDS); try { future.get(FLUSH_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { if (e instanceof InterruptedException) { throw new RuntimeException("interrupted flushing elements from queue", e); } <START> log.error(e, e.getMessage()); <END> } } }</code><technical_language>this log message</technical_language>

Target:
public void flush() throws IOException { synchronized (started) { if (started.get()) { Future future = exec.schedule(new ConsumerRunnable(), 0, TimeUnit.MILLISECONDS); try { future.get(DEFAULT_FLUSH_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { if (e instanceof InterruptedException) { throw new RuntimeException("interrupted flushing elements from queue", e); } } } } }
Source:
<code>public void onStartup(final ServletContext servletContext) throws ServletException { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); Context initialContext; try { initialContext = new InitialContext(); final String logLocation = (String) initialContext .lookup("java:comp/env/osgp/AdapterDomainCore/log-config"); LogbackConfigurer.initLogging(logLocation); } catch (final NameNotFoundException | FileNotFoundException | JoranException e) { <START> LOGGER.info("Using classpath logback.xml"); <END> } catch (final NamingException e) { throw new ServletException("naming exception", e); } final AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.register(ApplicationContext.class); servletContext.addListener(new ContextLoaderListener(rootContext)); }</code><technical_language>Handling exceptions in WebApplicationInitializer implementations consistent. If errors caused misconfiguration in context, helpful if exception included in log</technical_language>

Target:
public void onStartup(final ServletContext servletContext) throws ServletException { startUp(servletContext); }
Source:
<code><START> public static String reflogComments(List<ReflogEntry> entries) { <END> StringBuffer b = new StringBuffer(); for (ReflogEntry e : entries) { b.append(e.getComment()).append(";"); } return b.toString(); }</code><technical_language>this method need public</technical_language>

Target:
private static String reflogComments(List<ReflogEntry> entries) { StringBuffer b = new StringBuffer(); for (ReflogEntry e : entries) { b.append(e.getComment()).append(";"); } return b.toString(); }
Source:
<code>public Points getDataToRollup(final Locator locator, RollupType rollupType, Range range, String columnFamilyName) throws IOException, CacheException { Timer.Context ctx = Instrumentation.getReadTimerContext(columnFamilyName); try { DAbstractMetricIO io; if( columnFamilyName.equals( CassandraModel.CF_METRICS_FULL_NAME) ) { io = simpleIO; } else <START> io = rollupTypeToIO.get(rollupType); <END> Table<Locator, Long, Object> locatorTimestampRollup = io.getRollupsForLocator(locator, columnFamilyName, range); Points points = new Points(); for (Table.Cell<Locator, Long, Object> cell : locatorTimestampRollup.cellSet()) { points.add( createPoint( cell.getColumnKey(), cell.getValue())); } return points; } finally { ctx.stop(); } }</code><technical_language>getIO() here</technical_language>

Target:
public Points getDataToRollup(final Locator locator, RollupType rollupType, Range range, String columnFamilyName) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext(columnFamilyName); try { DAbstractMetricIO io = getIO( rollupType.name().toLowerCase(), CassandraModel.getGranularity( columnFamilyName ) ); Table<Locator, Long, Object> locatorTimestampRollup = io.getRollupsForLocator( locator, columnFamilyName, range ); Points points = new Points(); for (Table.Cell<Locator, Long, Object> cell : locatorTimestampRollup.cellSet()) { points.add( createPoint( cell.getColumnKey(), cell.getValue())); } return points; } catch( Exception e ) { Instrumentation.markReadError(); LOG.error( String.format( "Unable to read locator=%s rolluptype=%s columnFamilyName=%s for rollup", locator, rollupType.name(), columnFamilyName ), e ); throw new IOException( e ); } finally { ctx.stop(); } }
Source:
<code>public void testImportUnrelatedDeploymentChangesWhilePushing() throws Exception { System.out.println("Deployment changes that don't affect importers should not result in them restarting."); <START> CountDownLatch dataGenerationAwaiter = asyncPushDataToImporters(4000, 3); <END> updateDeploymentFile(true, true); Thread.sleep(1000); updateDeploymentFile(true, false); dataGenerationAwaiter.await(); verifyData(m_client, 12000); }</code><technical_language>this is full proof need intermix UAC socket write</technical_language>

Target:
public void testImportUnrelatedDeploymentChangesWhilePushing() throws Exception { System.out.println("Deployment changes that don't affect importers should not result in them restarting."); asyncPushDataToImporters(0, 3); updateDeploymentFile(true, true); updateDeploymentFile(true, false); waitForData(); }
Source:
<code>public byte[] get(String key) { byte[] aggregatedZNodeValues = new byte[0]; for (int segmentIndex = 0;; ++segmentIndex) { String zkPath = getZkPath(key, segmentIndex); byte[] zNodeValue = zkClient.readData(zkPath, true); if (zNodeValue == null) { break; } aggregatedZNodeValues = Bytes.concat(aggregatedZNodeValues, zNodeValue); } if (aggregatedZNodeValues.length > 0) { byte[] value = ArrayUtils.subarray(aggregatedZNodeValues, 0, aggregatedZNodeValues.length - CHECKSUM_SIZE_IN_BYTES); byte[] checkSum = ArrayUtils.subarray(aggregatedZNodeValues, aggregatedZNodeValues.length - CHECKSUM_SIZE_IN_BYTES, aggregatedZNodeValues.length); <START> byte[] expectedCheckSum = getCRCChecksum(value); <END> if (!Arrays.equals(checkSum, expectedCheckSum)) { throw new IllegalStateException("Expected checksum of value did not match the actual checksum"); } return value; } return null; }</code><technical_language>Nitpick: 'expectedChecksum' (capitalization)</technical_language>

Target:
public byte[] get(String key) { byte[] aggregatedZNodeValues = new byte[0]; for (int segmentIndex = 0;; ++segmentIndex) { String zkPath = getZkPath(key, segmentIndex); byte[] zNodeValue = zkClient.readData(zkPath, true); if (zNodeValue == null) { break; } aggregatedZNodeValues = Bytes.concat(aggregatedZNodeValues, zNodeValue); } if (aggregatedZNodeValues.length > 0) { byte[] value = ArrayUtils.subarray(aggregatedZNodeValues, 0, aggregatedZNodeValues.length - CHECKSUM_SIZE_IN_BYTES); byte[] checkSum = ArrayUtils.subarray(aggregatedZNodeValues, aggregatedZNodeValues.length - CHECKSUM_SIZE_IN_BYTES, aggregatedZNodeValues.length); byte[] expectedChecksum = getCRCChecksum(value); if (!Arrays.equals(checkSum, expectedChecksum)) { String exceptionMessage = String.format("Expected checksum: %s did not match the actual checksum: %s for value: %s", Arrays.toString(expectedChecksum), Arrays.toString(value), Arrays.toString(checkSum)); LOG.error(exceptionMessage); throw new IllegalStateException(exceptionMessage); } return value; } return null; }
Source:
<code>private WebElement getCategory(List<WebElement> categoryList, final String categoryName) { List<WebElement> foundCategories = categoryList.stream() .filter(element -> element .getAttribute("innerText") .trim() .equalsIgnoreCase(categoryName) ) .collect(Collectors.toList()); if (foundCategories.isEmpty()) { <START> return null; <END> } else if (foundCategories.size() == 1) { return foundCategories.get(0) ; } else { return foundCategories .stream() .filter(WebElement::isDisplayed) .collect(Collectors.toList()) .get(0); } }</code><technical_language>throw exception here</technical_language>

Target:
private WebElement getCategory(List<WebElement> categoryList, final String categoryName) throws NotFoundException { List<WebElement> foundCategories = categoryList.stream() .filter(element -> element .getAttribute("innerText") .trim() .equalsIgnoreCase(categoryName) ) .collect(Collectors.toList()); if (foundCategories.isEmpty()) { throw new NotFoundException("Could not find any categories on the list"); } else if (foundCategories.size() == 1) { return foundCategories.get(0) ; } else { return foundCategories .stream() .filter(WebElement::isDisplayed) .collect(Collectors.toList()) .get(0); } }
Source:
<code>public void modifyAST(IIndex index, IMarker marker) { try { IASTTranslationUnit ast = getTranslationUnitViaEditor(marker).getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS); int markerStart = marker.getAttribute(IMarker.CHAR_START, -1); int markerEnd = marker.getAttribute(IMarker.CHAR_END, -1); if (markerStart == -1 || markerEnd == -1 || markerStart >= markerEnd) return; IASTNodeSelector nodeSelector = ast.getNodeSelector(null); IASTNode containedNode = nodeSelector.findEnclosingNode(markerStart, markerEnd - markerStart); if (containedNode instanceof IASTBinaryExpression) { IASTBinaryExpression expr = (IASTBinaryExpression) containedNode; IASTNodeLocation[] leftSubexprLocations = expr.getOperand1().getNodeLocations(); if (leftSubexprLocations.length != 1) return; IASTNodeLocation leftSubexprLocation = leftSubexprLocations[0]; int leftSubexprEnd = leftSubexprLocation.getNodeOffset() + leftSubexprLocation.getNodeLength(); <START> FindReplaceDocumentAdapter dad = new FindReplaceDocumentAdapter(getDocument()); <END> dad.find(leftSubexprEnd, "=", true, false, false, false); dad.replace("==", false ); } } catch (CoreException e) { CheckersUiActivator.log(e); } catch (BadLocationException e) { CheckersUiActivator.log(e); } }</code><technical_language>name "dad" predated this change, good change stay cryptic abbreviations</technical_language>

Target:
public void modifyAST(IIndex index, IMarker marker) { try { IASTTranslationUnit ast = getTranslationUnitViaEditor(marker).getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS); int markerStart = marker.getAttribute(IMarker.CHAR_START, -1); int markerEnd = marker.getAttribute(IMarker.CHAR_END, -1); if (markerStart == -1 || markerEnd == -1 || markerStart >= markerEnd) return; IASTNodeSelector nodeSelector = ast.getNodeSelector(null); IASTNode containedNode = nodeSelector.findEnclosingNode(markerStart, markerEnd - markerStart); if (containedNode instanceof IASTBinaryExpression) { IASTBinaryExpression expr = (IASTBinaryExpression) containedNode; IASTNodeLocation[] leftSubexprLocations = expr.getOperand1().getNodeLocations(); if (leftSubexprLocations.length != 1) return; IASTNodeLocation leftSubexprLocation = leftSubexprLocations[0]; int leftSubexprEnd = leftSubexprLocation.getNodeOffset() + leftSubexprLocation.getNodeLength(); FindReplaceDocumentAdapter adapter = new FindReplaceDocumentAdapter(getDocument()); adapter.find(leftSubexprEnd, "=", true, false, false, false); adapter.replace("==", false ); } } catch (CoreException e) { CheckersUiActivator.log(e); } catch (BadLocationException e) { CheckersUiActivator.log(e); } }
Source:
<code>protected void appendChangeTimestampToDescription(StringBuilder description, JiraSite site, long timestamp) { DateFormat df = null; <START> if (!StringUtils.isBlank(site.getDateTimePattern())) { <END> df = new SimpleDateFormat(site.getDateTimePattern()); } else { df = new SimpleDateFormat("d/M/yy hh:mm a", Locale.getDefault()); } Date changeDate = new Date(timestamp); String dateTimeString = df.format(changeDate); description.append(dateTimeString); }</code><technical_language>nit: invert statement while - positive conditions easier understand</technical_language>

Target:
protected void appendChangeTimestampToDescription(StringBuilder description, JiraSite site, long timestamp) { DateFormat df = null; if (StringUtils.isBlank(site.getDateTimePattern())) { df = new SimpleDateFormat("d/M/yy hh:mm a", Locale.getDefault()); } else { df = new SimpleDateFormat(site.getDateTimePattern()); } Date changeDate = new Date(timestamp); String dateTimeString = df.format(changeDate); description.append(dateTimeString); }
Source:
<code>public void testWith() throws DatabaseEngineException { <START> if (this.engine instanceof MySqlEngine) { <END> return; } test5Columns(); engine.persist("TEST", entry().set("COL1", 1).set("COL5", "manuel") .build()); engine.persist("TEST", entry().set("COL1", 2).set("COL5", "ana") .build()); engine.persist("TEST", entry().set("COL1", 3).set("COL5", "rita") .build()); engine.persist("TEST", entry().set("COL1", 4).set("COL5", "rui") .build()); final With with = with("friends", select(all()) .from(table("TEST"))) .then( select(column("COL5").alias("name")) .from(table("friends")) .where(eq(column("COL1"), k(1)))); final List<Map<String, ResultColumn>> result = engine.query(with); assertEquals("Name must be 'manuel'", "manuel", result.get(0).get("name").toString()); }</code><technical_language>This is cool this is abstract test. I thought this class abstract engine extend I realize this is true. said, I suggest comparing this.engine config.engine is a string remove dependency. again, this is cool. :/</technical_language>

Target:
public void testWith() throws DatabaseEngineException { test5Columns(); engine.persist("TEST", entry().set("COL1", 1).set("COL5", "manuel") .build()); engine.persist("TEST", entry().set("COL1", 2).set("COL5", "ana") .build()); engine.persist("TEST", entry().set("COL1", 3).set("COL5", "rita") .build()); engine.persist("TEST", entry().set("COL1", 4).set("COL5", "rui") .build()); final With with = with("friends", select(all()) .from(table("TEST"))) .then( select(column("COL5").alias("name")) .from(table("friends")) .where(eq(column("COL1"), k(1)))); if (config.engine.contains("MySqlEngine")) { exception.expect(OperationNotSupportedRuntimeException.class);; } final List<Map<String, ResultColumn>> result = engine.query(with); assertEquals("Name must be 'manuel'", "manuel", result.get(0).get("name").toString()); }
Source:
<code><START> private void addSubscriptions(String... notifications) { <END> NuxeoPrincipal principal = session.getPrincipal(); String subscriber = NotificationConstants.USER_PREFIX + principal.getName(); for (String notif : notifications) { notificationService.addSubscription(subscriber, notif, commentedDocumentModel, false, principal, notif); } }</code><technical_language>private accessor</technical_language>

Target:
protected void addSubscriptions(String... notifications) { NuxeoPrincipal principal = session.getPrincipal(); String subscriber = NotificationConstants.USER_PREFIX + principal.getName(); for (String notif : notifications) { notificationService.addSubscription(subscriber, notif, commentedDocumentModel, false, principal, notif); } }
Source:
<code>private K processConjuncts(ConjunctiveFormula conjunct) { <START> if (conjunct.klabel().toString().equals(KLabels.AND)) { <END> List<K> kList = conjunct.items(); List<K> flatList = new ArrayList(); flattenList(kList, flatList); flatList = flatList.stream().map(this::kApplyConversion).collect(Collectors.toList()); return flatList.stream().reduce(BoolToken.TRUE, (x, y) -> KORE.KApply(KORE.KLabel(KLabels.AND), x, y)); } return KORE.KApply(KORE.KLabel(KLabels.AND), kApplyConversion(conjunct.toKore()), BoolToken.TRUE); }</code><technical_language>same, toString</technical_language>

Target:
private K processConjuncts(ConjunctiveFormula conjunct) { if (conjunct.klabel().name().equals(KLabels.AND)) { List<K> kList = conjunct.items(); List<K> flatList = new ArrayList(); flattenList(kList, flatList); flatList = flatList.stream().map(this::kApplyConversion).collect(Collectors.toList()); return flatList.stream().reduce(KORE.KApply(KORE.KLabel(KLabels.ML_TRUE)), (x, y) -> KORE.KApply(KORE.KLabel(KLabels.ML_AND), x, y)); } return KORE.KApply(KORE.KLabel(KLabels.ML_AND), kApplyConversion(conjunct.toKore()), KORE.KApply(KORE.KLabel(KLabels.ML_TRUE))); }
Source:
<code>public void setStatus(int sc, String sm) { <START> if (super.getStatus() == OK) { <END> super.setStatus(sc, sm); } status = sc; }</code><technical_language>I this check happen applying wrapper (i.e. if current status code is 200 apply wrapper, if is 200 modified). if multiple calls setStatus work fail</technical_language>

Target:
public void setStatus(int sc, String sm) { status = sc; }
Source:
<code>Class getClassWithName(String classname) { for (String pkg : packages) { String name; if (pkg.isEmpty()) { name = classname; } else { name = pkg + '.' + classname; } try { return Class.forName(name); } catch (ClassNotFoundException e) { } } <START> System.out.println( <END> "Could not load class '" + classname + "'; looked in the following packages: " + packages); return null; }</code><technical_language>System.err? Util.error is better</technical_language>

Target:
Class getClassWithName(String classname) { for (String pkg : packages) { String name; if (pkg.isEmpty()) { name = classname; } else { name = pkg + '.' + classname; } try { return Class.forName(name); } catch (ClassNotFoundException e) { } } Util.fatalError( "Could not load class '" + classname + "'; looked in the following packages: " + packages); return null; }
Source:
<code>public static Stream getByName(ZulipApp app, String name) { Stream stream = null; try { RuntimeExceptionDao<Stream, Object> streams = app.getDao(Stream.class); stream = streams.queryBuilder().where() .eq(Stream.NAME_FIELD, new SelectArg(name)).queryForFirst(); if (stream == null) { Log.w("Stream.getByName", "We received a stream message for a stream we don't have data for. Fake it until you make it."); <START> stream = app.getDao(Stream.class).createIfNotExists(new Stream(name)); } <END> } catch (SQLException e) { throw new RuntimeException(e); } return stream; }</code><technical_language>do need generate IDs for Stream objects? Streams ID backend... I guess fixing harder fix..</technical_language>

Target:
public static Stream getByName(ZulipApp app, String name) { Stream stream = null; try { RuntimeExceptionDao<Stream, Object> streams = app.getDao(Stream.class); stream = streams.queryBuilder().where() .eq(Stream.NAME_FIELD, new SelectArg(name)).queryForFirst(); if (stream == null) { Log.w("Stream.getByName", "We received a stream message for a stream we don't have data for. Fake it until you make it."); stream = new Stream(name); app.getDao(Stream.class).createIfNotExists(stream); } } catch (SQLException e) { throw new RuntimeException(e); } return stream; }
Source:
<code>public static CommentInfo createRange(String path, Side side, int line, String in_reply_to, String message, CommentRange range) { CommentInfo info = createFile(path, side, in_reply_to, message); <START> info.setLine(line); <END> info.setRange(range); return info; }</code><technical_language>Line range.startLine if range != null</technical_language>

Target:
public static CommentInfo createRange(String path, Side side, int line, String in_reply_to, String message, CommentRange range) { CommentInfo info = createFile(path, side, in_reply_to, message); info.setRange(range); info.setLine(range == null ? line : range.end_line()); return info; }
Source:
<code><START> public Asset getAsset(final String assetId) throws IOException, BadVersionException, RequestFailureException { <END> Asset ass = readJson(assetId); ass.set_id(assetId); WlpInformation wlpInfo = ass.getWlpInformation(); if (wlpInfo == null) { wlpInfo = new WlpInformation(); ass.setWlpInformation(wlpInfo); } if (wlpInfo.getAppliesToFilterInfo() == null) { wlpInfo.setAppliesToFilterInfo(Collections.<AppliesToFilterInfo> emptyList()); } return ass; }</code><technical_language>split this methods: getAsset(String assetId) calls getAsset(File assetFile) Line 82 call File version</technical_language>

Target:
public Asset getAsset(final String assetId) throws IOException, BadVersionException, RequestFailureException { return getAsset(new File(assetId)); }