auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void resolveTaxon(Taxonomy taxonomy) throws IndexBuilderException { if (this.resolution != null) return; TaxonResolver resolver = taxonomy.getResolver(); List<TaxonConceptInstance> principals = resolver.principals(this, this.instances); this.resolution = resolver.resolve(this, principals, this.instances); <START> Map<TaxonConceptInstance, TaxonConceptInstance> resolution = new HashMap<>(this.instances.size()); <END> taxonomy.count("count.resolve.taxonConcept"); }</code><technical_language>This is used</technical_language>

Target:
public void resolveTaxon(Taxonomy taxonomy) throws IndexBuilderException { if (this.resolution != null) return; TaxonResolver resolver = taxonomy.getResolver(); List<TaxonConceptInstance> principals = resolver.principals(this, this.instances); this.resolution = resolver.resolve(this, principals, this.instances); taxonomy.count("count.resolve.taxonConcept"); }
Source:
<code>private SchedulerSpaceInterface getSpaceInterface(String sessionId) throws NotConnectedRestException { Session session = sessionStore.get(sessionId); SchedulerSpaceInterface space = session.getSpace(); <START> renewSession(sessionId); <END> return space; }</code><technical_language>renewSession called getSpace()</technical_language>

Target:
private SchedulerSpaceInterface getSpaceInterface(String sessionId) throws NotConnectedRestException { renewSession(sessionId); return sessionStore.get(sessionId).getSpace(); }
Source:
<code>private ItemStack impl$createMapWithSpongeData(World worldIn, int worldX, int worldZ, byte scale, boolean trackingPosition, boolean unlimitedTracking, World worldIn2, PlayerEntity playerIn, Hand handIn) { final Player player = (Player) playerIn; try (final CauseStackManager.StackFrame frame = PhaseTracker.getCauseStackManager().pushCauseFrame()) { <START> frame.pushCause(player); <END> frame.addContext(EventContextKeys.PLAYER, player); final HandType handType = (HandType) (Object) handIn; frame.addContext(EventContextKeys.USED_HAND, handType); frame.addContext(EventContextKeys.USED_ITEM, player.getItemInHand(handType).createSnapshot()); final Set<Value<?>> mapValues = Sets.newHashSet( Value.immutableOf(Keys.MAP_LOCATION.get(), Vector2i.from(worldX, worldZ)), Value.immutableOf(Keys.MAP_WORLD, (org.spongepowered.api.world.World)worldIn), Value.immutableOf(Keys.MAP_TRACKS_PLAYERS, trackingPosition), Value.immutableOf(Keys.MAP_UNLIMITED_TRACKING, unlimitedTracking), Value.immutableOf(Keys.MAP_SCALE, (int)scale) ); final Optional<MapInfo> optMapInfo = MapUtil.fireCreateMapEvent(frame.getCurrentCause(), mapValues); if (!optMapInfo.isPresent()) { return ItemStack.EMPTY; } final int id = ((MapDataBridge) optMapInfo.get()).bridge$getMapId(); final ItemStack newMap = new ItemStack(Items.FILLED_MAP, 1); final CompoundNBT nbt = newMap.getOrCreateTag(); nbt.putInt("map", id); return newMap; } }</code><technical_language>Player ticks/Packet processes push player stack, needed</technical_language>

Target:
private ItemStack impl$createMapWithSpongeData(World worldIn, int worldX, int worldZ, byte scale, boolean trackingPosition, boolean unlimitedTracking, World worldIn2, PlayerEntity playerIn, Hand handIn) { final Player player = (Player) playerIn; try (final CauseStackManager.StackFrame frame = PhaseTracker.getCauseStackManager().pushCauseFrame()) { frame.addContext(EventContextKeys.PLAYER, player); final HandType handType = (HandType) (Object) handIn; frame.addContext(EventContextKeys.USED_HAND, handType); frame.addContext(EventContextKeys.USED_ITEM, player.getItemInHand(handType).createSnapshot()); final Set<Value<?>> mapValues = Sets.newHashSet( Value.immutableOf(Keys.MAP_LOCATION.get(), Vector2i.from(worldX, worldZ)), Value.immutableOf(Keys.MAP_WORLD, ((ServerWorld)worldIn).getKey()), Value.immutableOf(Keys.MAP_TRACKS_PLAYERS, trackingPosition), Value.immutableOf(Keys.MAP_UNLIMITED_TRACKING, unlimitedTracking), Value.immutableOf(Keys.MAP_SCALE, (int)scale) ); final Optional<MapInfo> optMapInfo = SpongeCommonEventFactory.fireCreateMapEvent(frame.getCurrentCause(), mapValues); if (!optMapInfo.isPresent()) { return ItemStack.EMPTY; } final int id = ((MapDataBridge) optMapInfo.get()).bridge$getMapId(); final ItemStack newMap = new ItemStack(Items.FILLED_MAP, 1); final CompoundNBT nbt = newMap.getOrCreateTag(); nbt.putInt("map", id); return newMap; } }
Source:
<code>public void report(MetricNames names, String status, Class<?> execClass, MetricRegistry registry) { String sn = execClass.getSimpleName(); if (getLockWaitTime() > 0) { registry.timer(names.getTxLockWaitTime() + sn).update(getLockWaitTime(), TimeUnit.MILLISECONDS); } registry.timer(names.getTxExecTime() + sn).update(getTime(), TimeUnit.MILLISECONDS); if (getCollisions() > 0) { <START> registry.meter(names.getTxWithCollision() + sn).mark(); <END> registry.meter(names.getTxCollisions() + sn).mark(getCollisions()); } registry.histogram(names.getTxEntriesSet() + sn).update(getEntriesSet()); registry.histogram(names.getTxEntriesRead() + sn).update(getEntriesReturned()); if (getTimedOutLocks() > 0) { registry.meter(names.getTxLocksTimedout() + sn).mark(getTimedOutLocks()); } if (getDeadLocks() > 0) { registry.meter(names.getTxLocksDead() + sn).mark(getDeadLocks()); } registry.meter(names.getTxStatus() + status.toLowerCase() + "." + sn).mark(); }</code><technical_language>mentioned possibility of marking zero, do that</technical_language>

Target:
public void report(MetricNames names, String status, Class<?> execClass, MetricRegistry registry) { String sn = execClass.getSimpleName(); if (getLockWaitTime() > 0) { registry.timer(names.getTxLockWaitTime() + sn).update(getLockWaitTime(), TimeUnit.MILLISECONDS); } registry.timer(names.getTxExecTime() + sn).update(getTime(), TimeUnit.MILLISECONDS); if (getCollisions() > 0) { registry.meter(names.getTxWithCollision() + sn).mark(); registry.meter(names.getTxCollisions() + sn).mark(getCollisions()); } registry.meter(names.getTxEntriesSet() + sn).mark(getEntriesSet()); registry.meter(names.getTxEntriesRead() + sn).mark(getEntriesReturned()); if (getTimedOutLocks() > 0) { registry.meter(names.getTxLocksTimedout() + sn).mark(getTimedOutLocks()); } if (getDeadLocks() > 0) { registry.meter(names.getTxLocksDead() + sn).mark(getDeadLocks()); } registry.meter(names.getTxStatus() + status.toLowerCase() + "." + sn).mark(); }
Source:
<code>public static String findFeatureFinderMetabo() throws FeatureFinderMetaboException { if (isFeatureFinderMetaboHere(OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME)) { return OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME; } else { String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0) { for (String s : new File(OPENMS_DEFAULT_LOCATION_WINDOWS).list()) { if (s.toLowerCase().contains("openms")) { String path = OPENMS_DEFAULT_LOCATION_WINDOWS + s + "\\bin\\" + OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME; if (isFeatureFinderMetaboHere(path)) return path; <START> return null; <END> } } } else if (OS.indexOf("mac") >= 0) { for (String s : new File(OPENMS_DEFAULT_LOCATION_MAC).list()) { if (s.toLowerCase().contains("openms")) { String path = OPENMS_DEFAULT_LOCATION_MAC + s + "\\bin\\" + OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME; if (isFeatureFinderMetaboHere(path)) return path; return null; } } } else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0) { for (String s : new File(OPENMS_DEFAULT_LOCATION_LINUX).list()) { if (s.toLowerCase().contains("openms")) { String path = OPENMS_DEFAULT_LOCATION_LINUX + s + "\\bin\\" + OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME; if (isFeatureFinderMetaboHere(path)) return path; return null; } } } else { return null; } } return null; }</code><technical_language>position of this return is suspicious (it return null if other openms folder checked yet). applies other platforms below</technical_language>

Target:
public static String findFeatureFinderMetabo() throws MSDKException { if (isFeatureFinderMetaboHere(OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME)) { return OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME; } final String OS = System.getProperty("os.name").toLowerCase(); if (OS.indexOf("win") >= 0) { for (String s : new File(OPENMS_DEFAULT_LOCATION_WINDOWS).list()) { if (s.toLowerCase().contains("openms")) { String path = "\"" + OPENMS_DEFAULT_LOCATION_WINDOWS + s + "\\bin\\" + OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME + "\""; if (isFeatureFinderMetaboHere(path)) return path; } } } else if (OS.indexOf("mac") >= 0) { for (String s : new File(OPENMS_DEFAULT_LOCATION_MAC).list()) { if (s.toLowerCase().contains("openms")) { String path = "\"" + OPENMS_DEFAULT_LOCATION_MAC + s + "\\bin\\" + OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME + "\""; if (isFeatureFinderMetaboHere(path)) return path; } } } else if (OS.indexOf("nix") >= 0 || OS.indexOf("nux") >= 0 || OS.indexOf("aix") > 0) { for (String s : new File(OPENMS_DEFAULT_LOCATION_LINUX).list()) { if (s.toLowerCase().contains("openms")) { String path = "\"" + OPENMS_DEFAULT_LOCATION_LINUX + s + "\\bin\\" + OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME + "\""; if (isFeatureFinderMetaboHere(path)) return path; } } } return null; }
Source:
<code>public void testTagDetection() { <START> Assert.assertTrue("Valid root tag detection", PropertyMergePostProcessor.looksLikeTag("Some_Root:Tag")); <END> Assert.assertTrue("Valid sub tag detection", PropertyMergePostProcessor.looksLikeTag("Some_Root-123:Tag/Another_Tag456")); Assert.assertFalse("Invalid tag pattern", PropertyMergePostProcessor.looksLikeTag("Some_Root123")); Assert.assertFalse("Spaces check 1", PropertyMergePostProcessor.looksLikeTag("Some Root:Tag")); Assert.assertFalse("Spaces check 2", PropertyMergePostProcessor.looksLikeTag("Some_Root : Tag")); Assert.assertFalse("Spaces check 3", PropertyMergePostProcessor.looksLikeTag("Some_Root:Tag Name")); Assert.assertFalse("Spaces check 4", PropertyMergePostProcessor.looksLikeTag("Some_Root:Tag/Other Tag Name")); }</code><technical_language>Assert.assertTrue("Valid tag namspace detection", PropertyMergePostProcessor.looksLikeTag("Some_Root:")); pass well</technical_language>

Target:
public void testTagDetection() { Assert.assertTrue("Valid root tag detection", PropertyMergePostProcessor.looksLikeTag("Some_Root:")); Assert.assertTrue("Valid root tag detection", PropertyMergePostProcessor.looksLikeTag("Some_Root:Tag")); Assert.assertTrue("Valid sub tag detection", PropertyMergePostProcessor.looksLikeTag("Some_Root-123:Tag/Another_Tag456")); Assert.assertFalse("Invalid tag pattern", PropertyMergePostProcessor.looksLikeTag("Some_Root123")); Assert.assertFalse("Spaces check 1", PropertyMergePostProcessor.looksLikeTag("Some Root:Tag")); Assert.assertFalse("Spaces check 2", PropertyMergePostProcessor.looksLikeTag("Some_Root : Tag")); Assert.assertFalse("Spaces check 3", PropertyMergePostProcessor.looksLikeTag("Some_Root:Tag Name")); Assert.assertFalse("Spaces check 4", PropertyMergePostProcessor.looksLikeTag("Some_Root:Tag/Other Tag Name")); }
Source:
<code>public Path getResourcePacksDirectory() { <START> return fileResourcepacks.toPath(); <END> }</code><technical_language>this</technical_language>

Target:
public Path getResourcePacksDirectory() { return this.fileResourcepacks.toPath(); }
Source:
<code>public void onBuildHeaders(List<Header> target) { if(AdaptionUtil.hasReducedPreferences()) { <START> loadHeadersFromResource(R.xml.preference_headers_without_advanced, target); <END> }else { loadHeadersFromResource(R.xml.preference_headers, target); } }</code><technical_language>I preferences skew quickly if attempt maintain sets. alter this strategy notifications preference programmatically knockout preferences want</technical_language>

Target:
public void onBuildHeaders(List<Header> target) { loadHeadersFromResource(R.xml.preference_headers, target); Iterator iterator = target.iterator(); while (iterator.hasNext()) { Header header = (Header)iterator.next(); if ((header.titleRes == R.string.pref_cat_advanced) && AdaptionUtil.hasReducedPreferences()){ iterator.remove(); } } }
Source:
<code>public static Optional<HiveBucketFilter> getHiveBucketFilter(Table table, TupleDomain<ColumnHandle> effectivePredicate) { if (!table.getStorage().getBucketProperty().isPresent()) { return Optional.empty(); } Optional<Map<ColumnHandle, NullableValue>> bindings = TupleDomain.extractFixedValues(effectivePredicate); if (!bindings.isPresent()) { return Optional.empty(); } OptionalInt singleBucket = getHiveBucket(table, bindings.get()); if (singleBucket.isPresent()) { return Optional.of(new HiveBucketFilter(ImmutableSet.of(singleBucket.getAsInt()))); } Optional<Map<ColumnHandle, Set<NullableValue>>> columnValueSetBindings = TupleDomain.extractFixedValuesFromRanges(effectivePredicate); if (!columnValueSetBindings.isPresent()) { return Optional.empty(); } Set<Integer> buckets = getHiveBuckets(table, columnValueSetBindings.get()); <START> if (buckets.size() > 0) { <END> return Optional.of(new HiveBucketFilter(buckets)); } if (!effectivePredicate.getDomains().isPresent()) { return Optional.empty(); } Optional<Domain> domain = effectivePredicate.getDomains().get().entrySet().stream() .filter(entry -> ((HiveColumnHandle) entry.getKey()).getName().equals(BUCKET_COLUMN_NAME)) .findFirst() .map(Entry::getValue); if (!domain.isPresent()) { return Optional.empty(); } ValueSet values = domain.get().getValues(); ImmutableSet.Builder<Integer> builder = ImmutableSet.builder(); int bucketCount = table.getStorage().getBucketProperty().get().getBucketCount(); for (int i = 0; i < bucketCount; i++) { if (values.containsValue((long) i)) { builder.add(i); } } return Optional.of(new HiveBucketFilter(builder.build())); }</code><technical_language>@gparai if is match? desired behavior read file. Is this work</technical_language>

Target:
public static Optional<HiveBucketFilter> getHiveBucketFilter(Table table, TupleDomain<ColumnHandle> effectivePredicate) { if (!table.getStorage().getBucketProperty().isPresent()) { return Optional.empty(); } Optional<Map<ColumnHandle, Set<NullableValue>>> bindings = TupleDomain.extractFixedValueSets(effectivePredicate); if (!bindings.isPresent()) { return Optional.empty(); } Optional<Set<Integer>> buckets = getHiveBuckets(table, bindings.get()); if (buckets.isPresent()) { return Optional.of(new HiveBucketFilter(buckets.get())); } if (!effectivePredicate.getDomains().isPresent()) { return Optional.empty(); } Optional<Domain> domain = effectivePredicate.getDomains().get().entrySet().stream() .filter(entry -> ((HiveColumnHandle) entry.getKey()).getName().equals(BUCKET_COLUMN_NAME)) .findFirst() .map(Entry::getValue); if (!domain.isPresent()) { return Optional.empty(); } ValueSet values = domain.get().getValues(); ImmutableSet.Builder<Integer> builder = ImmutableSet.builder(); int bucketCount = table.getStorage().getBucketProperty().get().getBucketCount(); for (int i = 0; i < bucketCount; i++) { if (values.containsValue((long) i)) { builder.add(i); } } return Optional.of(new HiveBucketFilter(builder.build())); }
Source:
<code>public void setUp() { Map<String, String> headers = new HashMap<>(); <START> headers.put("my", "value"); <END> setXmlResponse("clusters", 200, "<clusters/>"); setXmlResponse("clusters/123", 200, "<cluster id=\"123\"><name>test</name></cluster>"); startServer(); connection = (HttpConnection) testConnectionBuilder().header("my", "value").build(); clustersService = connection.systemService().clustersService(); clusterService = clustersService.clusterService("123"); }</code><technical_language>^ lines needed</technical_language>

Target:
public void setUp() { setXmlResponse("clusters", 200, "<clusters/>"); setXmlResponse("clusters/123", 200, "<cluster id=\"123\"><name>test</name></cluster>"); startServer(); connection = (HttpConnection) testConnectionBuilder().header("my", "value").build(); clustersService = connection.systemService().clustersService(); clusterService = clustersService.clusterService("123"); }
Source:
<code>public ThingType(String bindingId, String thingTypeId, String label) throws IllegalArgumentException { <START> this(new ThingTypeUID(bindingId, thingTypeId), null, label, null, false, null, null, null, null); <END> }</code><technical_language>true</technical_language>

Target:
public ThingType(String bindingId, String thingTypeId, String label) throws IllegalArgumentException { this(new ThingTypeUID(bindingId, thingTypeId), null, label, null, true, null, null, null, null); }
Source:
<code>public void testSinkWithTopicListOrTopicPattern(){ ObjectIdentifier objectIdentifier = ObjectIdentifier.of( "default", "default", "sinkTable"); Map<String, String> modifiedOptions = getModifiedOptions( getFullSourceOptions(), options -> { options.put("topic", TOPICS); options.put("scan.startup.mode", "earliest-offset"); options.remove("specific-offsets"); }); CatalogTable sinkTable = createKafkaSinkCatalogTable(modifiedOptions); thrown.expect(ValidationException.class); thrown.expect(containsCause(new ValidationException("Flink Kafka sink currently doesn't support topic list."))); FactoryUtil.createTableSink( null, objectIdentifier, sinkTable, new Configuration(), Thread.currentThread().getContextClassLoader()); modifiedOptions = getModifiedOptions( getFullSourceOptions(), options -> { options.put("topic-pattern", TOPIC_REGEX); }); sinkTable = createKafkaSinkCatalogTable(modifiedOptions); thrown.expect(ValidationException.class); <START> thrown.expect(containsCause(new ValidationException("Flink Kafka sink currently doesn't support 'topic-pattern'."))); <END> FactoryUtil.createTableSink( null, objectIdentifier, sinkTable, new Configuration(), Thread.currentThread().getContextClassLoader()); }</code><technical_language>thrown in test multiple times, triggered</technical_language>

Target:
public void testSinkWithTopicListOrTopicPattern(){ ObjectIdentifier objectIdentifier = ObjectIdentifier.of( "default", "default", "sinkTable"); Map<String, String> modifiedOptions = getModifiedOptions( getFullSourceOptions(), options -> { options.put("topic", TOPICS); options.put("scan.startup.mode", "earliest-offset"); options.remove("specific-offsets"); }); CatalogTable sinkTable = createKafkaSinkCatalogTable(modifiedOptions); String errorMessageTemp = "Flink Kafka sink currently only supports single topic, but got %s: %s."; try { FactoryUtil.createTableSink( null, objectIdentifier, sinkTable, new Configuration(), Thread.currentThread().getContextClassLoader()); } catch (Throwable t) { assertEquals(String.format(errorMessageTemp, "'topic'", String.format("[%s]", String.join(", ", TOPIC_LIST))), t.getCause().getMessage()); } modifiedOptions = getModifiedOptions( getFullSourceOptions(), options -> { options.put("topic-pattern", TOPIC_REGEX); }); sinkTable = createKafkaSinkCatalogTable(modifiedOptions); try { FactoryUtil.createTableSink( null, objectIdentifier, sinkTable, new Configuration(), Thread.currentThread().getContextClassLoader()); } catch (Throwable t) { assertEquals(String.format(errorMessageTemp, "'topic-pattern'", TOPIC_REGEX), t.getCause().getMessage()); } }
Source:
<code>private void copyThenUpload(Uri[] sourceUris, String[] remotePaths) { if (mShowWaitingDialog) { mActivity.showLoadingDialog(mActivity.getResources(). getString(R.string.wait_for_tmp_copy_from_private_storage)); } CopyAndUploadContentUrisTask copyTask = new CopyAndUploadContentUrisTask <START> ((CopyAndUploadContentUrisTask.OnCopyTmpFilesTaskListener)mActivity, mActivity); <END> copyTask.execute( CopyAndUploadContentUrisTask.makeParamsToExecute( mAccount, sourceUris, remotePaths, mActivity.getContentResolver() ) ); }</code><technical_language>casting of parameter in minute is slightly dangerous. avoid adding a separated parameter in constructor receive OnCopyTmpFilesTaskListener instance. Besides, NULL a valid for it. FileDisplayActivity is in onTmpFilesCopied(...), pass a NULL for listener need implement OnCopyTmpFilesTaskListener</technical_language>

Target:
private void copyThenUpload(Uri[] sourceUris, String[] remotePaths) { if (mShowWaitingDialog) { mActivity.showLoadingDialog(mActivity.getResources(). getString(R.string.wait_for_tmp_copy_from_private_storage)); } CopyAndUploadContentUrisTask copyTask = new CopyAndUploadContentUrisTask (mCopyTmpTaskListener, mActivity); FragmentManager fm = mActivity.getSupportFragmentManager(); TaskRetainerFragment taskRetainerFragment = (TaskRetainerFragment) fm.findFragmentByTag(TaskRetainerFragment.FTAG_TASK_RETAINER_FRAGMENT); if (taskRetainerFragment != null) { taskRetainerFragment.setTask(copyTask); } copyTask.execute( CopyAndUploadContentUrisTask.makeParamsToExecute( mAccount, sourceUris, remotePaths, mActivity.getContentResolver() ) ); }
Source:
<code>private void reassignIds() { RelativeLayout.LayoutParams iconLayoutParams = (LayoutParams) mIcon.getLayoutParams(); int[] rules = iconLayoutParams.getRules(); for (int i = 0; i < rules.length; i++) { if (rules[i] == mTextInputLayout.getId()) { if (Build.VERSION.SDK_INT > 23) { rules[i] = mNewIds.get(1); } else { iconLayoutParams.addRule(i, mNewIds.get(1)); } } } mIcon.setLayoutParams(iconLayoutParams); RelativeLayout.LayoutParams editTextLayoutParams = (LayoutParams) mTextInputLayout.getLayoutParams(); rules = editTextLayoutParams.getRules(); for (int i = 0; i < rules.length; i++) { if (rules[i] == mIcon.getId()) { <START> if (Build.VERSION.SDK_INT > 23) { <END> rules[i] = mNewIds.get(0); } else { editTextLayoutParams.addRule(i, mNewIds.get(0)); } } } mTextInputLayout.setLayoutParams(editTextLayoutParams); mIcon.setId(mNewIds.get(0)); mTextInputLayout.setId(mNewIds.get(1)); mEditText.setId(mNewIds.get(2)); }</code><technical_language>constant Build.VERSION_CODES.M instead of hardcoding 23</technical_language>

Target:
private void reassignIds() { RelativeLayout.LayoutParams iconLayoutParams = (LayoutParams) mIcon.getLayoutParams(); int[] rules = iconLayoutParams.getRules(); for (int i = 0; i < rules.length; i++) { if (rules[i] == mTextInputLayout.getId()) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { rules[i] = mNewIds.get(1); } else { iconLayoutParams.addRule(i, mNewIds.get(1)); } } } mIcon.setLayoutParams(iconLayoutParams); RelativeLayout.LayoutParams editTextLayoutParams = (LayoutParams) mTextInputLayout.getLayoutParams(); rules = editTextLayoutParams.getRules(); for (int i = 0; i < rules.length; i++) { if (rules[i] == mIcon.getId()) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { rules[i] = mNewIds.get(0); } else { editTextLayoutParams.addRule(i, mNewIds.get(0)); } } } mTextInputLayout.setLayoutParams(editTextLayoutParams); mIcon.setId(mNewIds.get(0)); mTextInputLayout.setId(mNewIds.get(1)); mEditText.setId(mNewIds.get(2)); }
Source:
<code>private void processStoredUntaggedResponses() throws MessagingException { List<ImapResponse> untaggedResponses = getAndClearStoredUntaggedResponses(); if (K9MailLib.isDebug()) { Timber.i("Processing %d untagged responses from previous commands for %s", untaggedResponses.size(), getLogId()); } <START> for (int i = 0; i < untaggedResponses.size();i++) { <END> ImapResponse response = untaggedResponses.get(i); if ((equalsIgnoreCase(response.get(1), "EXPUNGE") && handleExpungeResponse(response)) || (equalsIgnoreCase(response.get(1), "FETCH") && handleFetchResponse(response)) || (equalsIgnoreCase(response.get(1), "EXISTS") && handleExistsResponse()) || (equalsIgnoreCase(response.get(0), "VANISHED") && handleVanishedResponse(response))) { pushReceiver.syncFolder(getName()); break; } } }</code><technical_language>(code style)</technical_language>

Target:
private void processStoredUntaggedResponses() throws MessagingException { while (true) { List<ImapResponse> untaggedResponses = getAndClearStoredUntaggedResponses(); if (untaggedResponses.isEmpty()) { break; } if (K9MailLib.isDebug()) { Timber.i("Processing %d untagged responses from previous commands for %s", untaggedResponses.size(), getLogId()); } processUntaggedResponses(untaggedResponses); } }
Source:
<code>public void handle(Request request, Response response) throws Exception { userSession.checkLoggedIn(); String projectKey = request.mandatoryParam(PARAM_PROJECT); <START> String branchKey = request.mandatoryParam(PARAM_BRANCH); <END> try (DbSession dbSession = dbClient.openSession(false)) { ComponentDto project = componentFinder.getRootComponentByUuidOrKey(dbSession, null, projectKey); checkPermission(project); BranchDto branch = checkFoundWithOptional(dbClient.branchDao().selectByUuid(dbSession, project.uuid()), "Project '%s' not found", projectKey); dbClient.branchDao().updateMainBranchName(dbSession, branch.getUuid(), branchKey); dbSession.commit(); response.noContent(); } }</code><technical_language>need for this check, anonymous admin rights</technical_language>

Target:
public void handle(Request request, Response response) throws Exception { userSession.checkLoggedIn(); String projectKey = request.mandatoryParam(PARAM_PROJECT); String branchKey = request.mandatoryParam(PARAM_BRANCH); try (DbSession dbSession = dbClient.openSession(false)) { ComponentDto project = componentFinder.getRootComponentByUuidOrKey(dbSession, null, projectKey); checkPermission(project); Optional<BranchDto> branch = dbClient.branchDao().selectByKey(dbSession, project.uuid(), BranchKeyType.BRANCH, branchKey); if (branch.isPresent() && !branch.get().isMain()) { throw new IllegalArgumentException("Impossible to update branch name: a branch with name \"" + branchKey + "\" already exists in the project."); } dbClient.branchDao().updateMainBranchName(dbSession, project.uuid(), branchKey); dbSession.commit(); response.noContent(); } }
Source:
<code>protected void executeCommand() { registerRollbackHandler((TransactionRollbackListener)() -> <START> TransactionSupport.executeInNewTransaction( <END> (TransactionMethod<Void>) () -> { macPoolPerCluster.createPool(oldMacPool); return null; } )); macPoolDao.update(getMacPoolEntity()); macPoolPerCluster.modifyPool(getMacPoolEntity()); setSucceeded(true); getReturnValue().setActionReturnValue(getMacPoolId()); }</code><technical_language>This is required in AddMacPoolCommand RemoveMacPoolCommand, too</technical_language>

Target:
protected void executeCommand() { registerRollbackHandler((TransactionRollbackListener)() -> macPoolPerCluster.modifyPool(oldMacPool)); macPoolDao.update(getMacPoolEntity()); macPoolPerCluster.modifyPool(getMacPoolEntity()); setSucceeded(true); getReturnValue().setActionReturnValue(getMacPoolId()); }
Source:
<code>public String toString() { return "BasicDistributionSummary{config=" + config + ", totalAmount=" + totalAmount + ", count=" + count + ", max=" + max + ", min=" + min + <START> ", monitors=" + monitors + <END> '}'; }</code><technical_language>intentional add monitors list toString output? redundant count, min, max fields there</technical_language>

Target:
public String toString() { return "BasicDistributionSummary{config=" + config + ", totalAmount=" + totalAmount + ", count=" + count + ", max=" + max + ", min=" + min + '}'; }
Source:
<code>public ExternalIdentity(final Provider provider, final String providerUserId, final String accessToken, final String refreshToken) { <START> setMeta(new Meta()); <END> this.setMeta(new Meta()); this.provider = provider; this.providerUserId = providerUserId; this.accessToken = accessToken; this.refreshToken = refreshToken; }</code><technical_language>I setMeta calls needed</technical_language>

Target:
public ExternalIdentity(final Provider provider, final String providerUserId, final String accessToken, final String refreshToken) { this.provider = provider; this.providerUserId = providerUserId; this.accessToken = accessToken; this.refreshToken = refreshToken; }
Source:
<code>public LatLng getGoogleMapsLocation() { <START> ParseGeoPoint pGP = (ParseGeoPoint) get("location"); <END> return new LatLng(pGP.getLatitude(), pGP.getLongitude()); }</code><technical_language>this changed getParseGeoPoint()</technical_language>

Target:
public LatLng getGoogleMapsLocation() { ParseGeoPoint pGP = getLocation(); LatLng latlng = null; if (pGP != null) { latlng = new LatLng(pGP.getLatitude(), pGP.getLongitude()); } return latlng; }
Source:
<code>public int getHeuristicSearchStepLimit(SearchStepSemantics requestedSemantics, int numQIs) { if (this.heuristicSearchStepLimit == null) { this.heuristicSearchStepLimit = Integer.MAX_VALUE; } if (this.heuristicSearchStepLimit == Integer.MAX_VALUE || requestedSemantics == this.searchStepSemantics) { return this.heuristicSearchStepLimit; } <START> if (this.searchStepSemantics == SearchStepSemantics.CHECKS) { <END> return this.heuristicSearchStepLimit / numQIs; } else { return this.heuristicSearchStepLimit * numQIs; } }</code><technical_language>Switch, exception for default</technical_language>

Target:
public int getHeuristicSearchStepLimit(SearchStepSemantics requestedSemantics, int numQIs) { if (this.heuristicSearchStepLimit == null) { this.heuristicSearchStepLimit = Integer.MAX_VALUE; } if (this.heuristicSearchStepLimit == Integer.MAX_VALUE || requestedSemantics == this.searchStepSemantics) { return this.heuristicSearchStepLimit; } switch (requestedSemantics) { case CHECKS: return this.heuristicSearchStepLimit * numQIs; case EXPANSIONS: return this.heuristicSearchStepLimit / numQIs; default: throw new RuntimeException("The search step semantic " + requestedSemantics + " is not supported"); } }
Source:
<code>public void verifyDefaultKfsAccountForAwsXmlCanBeMarshalled() throws JAXBException, IOException { String marshalledXml = cUMarshalService.marshalObjectToXmlString( DefaultKfsAccountForAwsWrapperFixture.generateExpectedDefaultKfsAccountForAwsResultWrapperObject()); marshalledXml = removeWhitespace(marshalledXml.substring(marshalledXml.indexOf('\n') + 1)); String expectedXmlExample = DefaultKfsAccountForAwsWrapperFixture.getXmlFromExampleFile(); expectedXmlExample = removeWhitespace(expectedXmlExample); <START> assertTrue("The Marshalled XML should be equal to the example XML", marshalledXml.equalsIgnoreCase(expectedXmlExample)); <END> }</code><technical_language>StringUtils.equalsIgnoreCase avoid NPEs</technical_language>

Target:
public void verifyDefaultKfsAccountForAwsXmlCanBeMarshalled() throws JAXBException, IOException, ParseException { String marshalledXml = cUMarshalService.marshalObjectToXmlString( DefaultKfsAccountForAwsWrapperFixture.generateExpectedDefaultKfsAccountForAwsResultWrapper()); marshalledXml = removeWhitespace(marshalledXml.substring(marshalledXml.indexOf('\n') + 1)); String expectedXmlExample = DefaultKfsAccountForAwsWrapperFixture.getXmlFromExampleFile(); expectedXmlExample = removeWhitespace(expectedXmlExample); assertTrue("The Marshalled XML should be equal to the example XML", StringUtils.equalsIgnoreCase(marshalledXml, expectedXmlExample)); }
Source:
<code>protected void dispose() { <START> super.dispose(); <END> synchronized (this) { List<Closeable> list = new ArrayList<>(openStreams); for (Closeable closable : list) { try { closable.close(); } catch (IOException e) { } } inputStream = null; } final IDocument document = partitioner.getDocument(); document.setDocumentPartitioner(null); partitioner.disconnect(); }</code><technical_language>mentioned : is highly unusual suoer.dispose() is called *before* child dispose. Surely change, I if sense cleanup this too</technical_language>

Target:
protected void dispose() { synchronized (this) { List<Closeable> list = new ArrayList<>(openStreams); for (Closeable closable : list) { try { closable.close(); } catch (IOException e) { } } inputStream = null; } final IDocument document = partitioner.getDocument(); document.setDocumentPartitioner(null); partitioner.disconnect(); super.dispose(); }
Source:
<code>public void createPartControl(Composite parent) { parent.setLayout(new FillLayout(SWT.HORIZONTAL)); Composite queryRegistryContainer = new Composite(parent, SWT.NONE); queryRegistryContainer.setLayout(new GridLayout(1, false)); initializeQueryTreeViewer(queryRegistryContainer); <START> initializeToolBar(); <END> initializeMenu(); }</code><technical_language>toolbar menu initialization calls required? Especially Actions Commands</technical_language>

Target:
public void createPartControl(Composite parent) { parent.setLayout(new FillLayout(SWT.HORIZONTAL)); Composite queryRegistryContainer = new Composite(parent, SWT.NONE); queryRegistryContainer.setLayout(new GridLayout(1, false)); initializeQueryTreeViewer(queryRegistryContainer); }
Source:
<code>public FunApplyBlock(FunctionInfo funInfo, CustomUIPane pane) { super(pane); this.loadFXML("FunApplyBlock"); this.funInfo = funInfo; this.functionInfo.setText(funInfo.getName()); this.inputs = new ArrayList<>(); this.output = new OutputAnchor(this, new Binder("res")); this.resTypeLabel = new Label(""); this.resTypeLabel.setMinWidth(USE_PREF_SIZE); this.resTypeLabel.getStyleClass().add("resultType"); VBox outputSpace = new VBox(this.resTypeLabel, this.output); outputSpace.setAlignment(Pos.CENTER); Type t = funInfo.getFreshSignature(); while (t instanceof FunType) { FunType ft = (FunType) t; FunInputAnchor ia = new FunInputAnchor(); this.inputs.add(ia); t = ft.getResult(); } Pane inputSpace = new HBox(10, this.inputs.toArray(new Node[this.inputs.size()])); this.bodySpace.getChildren().addAll(inputSpace, outputSpace); outputSpace.layoutYProperty().bind(inputSpace.heightProperty()); <START> outputSpace.layoutXProperty().bind(inputSpace.widthProperty().divide(2).subtract(resTypeLabel.widthProperty().divide(2))); <END> }</code><technical_language>is this do</technical_language>

Target:
public FunApplyBlock(FunctionInfo funInfo, CustomUIPane pane) { super(pane); this.loadFXML("FunApplyBlock"); this.funInfo = funInfo; this.functionInfo.setText(funInfo.getName()); this.inputs = new ArrayList<>(); this.output = new OutputAnchor(this, new Binder("res")); this.resTypeLabel = new Label(""); this.resTypeLabel.setMinWidth(USE_PREF_SIZE); this.resTypeLabel.getStyleClass().add("resultType"); VBox outputSpace = new VBox(this.resTypeLabel, this.output); outputSpace.setAlignment(Pos.CENTER); Type t = funInfo.getFreshSignature(); while (t instanceof FunType) { FunType ft = (FunType) t; FunInputAnchor ia = new FunInputAnchor(); this.inputs.add(ia); t = ft.getResult(); } Pane inputSpace = new HBox(10, this.inputs.toArray(new Node[this.inputs.size()])); this.curriedOutput = new Pane() { @Override public double computePrefWidth(double heigth) { return Math.max(inputSpace.prefWidth(heigth), outputSpace.getLayoutX()+resTypeLabel.prefWidth(heigth)); } }; this.curriedOutput.setVisible(false); this.curriedOutput.getStyleClass().add("curriedOutput"); this.bodySpace.getChildren().addAll(this.curriedOutput, inputSpace, outputSpace); outputSpace.layoutYProperty().bind(inputSpace.heightProperty()); outputSpace.layoutXProperty().bind(inputSpace.widthProperty().divide(2).subtract(resTypeLabel.widthProperty().divide(2))); this.curriedOutput.layoutYProperty().bind(inputSpace.heightProperty().divide(2)); this.curriedOutput.prefHeightProperty().bind(inputSpace.heightProperty()); this.curriedOutput.translateYProperty().bind(outputSpace.translateYProperty()); }
Source:
<code><START> public void testDelete() throws SQLException{ <END> String name = "TEST_RETROSPECTIVE_NAME"; String description = "TEST_RETROSPECTIVE_DESCRIPTION"; long sprintId = mCS.getSprintsId().get(0); long projectId = mCP.getAllProjects().get(0).getId(); int type = RetrospectiveObject.TYPE_GOOD; RetrospectiveObject retrospective = new RetrospectiveObject(projectId); retrospective.setName(name) .setSprintId(sprintId) .setDescription(description) .setType(type) .save(); assertNotSame(-1, retrospective.getId()); retrospective.delete(); IQueryValueSet valueSet = new MySQLQuerySet(); valueSet.addTableName(RetrospectiveEnum.TABLE_NAME); valueSet.addEqualCondition(RetrospectiveEnum.ID, retrospective.getId()); String query = valueSet.getSelectQuery(); ResultSet result = mControl.executeQuery(query); RetrospectiveObject retrospectiveCreated = null; if (result.next()) { retrospectiveCreated = RetrospectiveDAO.convert(result); } closeResultSet(result); assertNull(retrospectiveCreated); }</code><technical_language>remove throws SQLException</technical_language>

Target:
public void testDelete() { String name = "TEST_RETROSPECTIVE_NAME"; String description = "TEST_RETROSPECTIVE_DESCRIPTION"; long sprintId = mCS.getSprintsId().get(0); long projectId = mCP.getAllProjects().get(0).getId(); int type = RetrospectiveObject.TYPE_GOOD; RetrospectiveObject retrospective = new RetrospectiveObject(projectId); retrospective.setName(name) .setSprintId(sprintId) .setDescription(description) .setType(type) .save(); assertNotSame(-1, retrospective.getId()); boolean isDeleteSuccess = retrospective.delete(); assertTrue(isDeleteSuccess); RetrospectiveObject retrospectiveCreated = RetrospectiveDAO.getInstance().get(retrospective.getId()); assertNull(retrospectiveCreated); }
Source:
<code>public void addRoutingTableChangeListener( final RoutingTableChangeListener routingTableChangeListener, Object context) { _routingTableChangeListenerMap.put(routingTableChangeListener, new ListenerContext(context)); logger.info("Attach RoutingTableProviderChangeListener {}", routingTableChangeListener.getClass().getName()); <START> if (_sourceDataTypeMap.isEmpty()) { <END> routingTableChangeListener.onRoutingTableChange(getRoutingTableSnapshot(), context); } else { for (PropertyType propertyType : _sourceDataTypeMap.keySet()) { switch (propertyType) { case EXTERNALVIEW: case TARGETEXTERNALVIEW: case CURRENTSTATES: routingTableChangeListener .onRoutingTableChange(getRoutingTableSnapshot(propertyType), context); break; case CUSTOMIZEDVIEW: for (String customizedStateType : _sourceDataTypeMap .getOrDefault(PropertyType.CUSTOMIZEDVIEW, Collections.emptyList())) { routingTableChangeListener.onRoutingTableChange( getRoutingTableSnapshot(PropertyType.CUSTOMIZEDVIEW, customizedStateType), context); } break; default: logger.warn("Unsupported source data type: {}, stop triggering callback!", propertyType); } } } }</code><technical_language>This is initial call adding listener. concern is returning empty data a good signal for user? This changes behavior. Some users relying snapshot content. a API give option user choose it</technical_language>

Target:
public void addRoutingTableChangeListener( final RoutingTableChangeListener routingTableChangeListener, Object context) { addRoutingTableChangeListener(routingTableChangeListener, context, false); }
Source:
<code>public String calculateChecksum(InputStream inputStream) throws IOException, NoSuchAlgorithmException { if (inputStream == null) { throw new IllegalArgumentException("InputStream cannot be null"); } try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { <START> byte[] buffer = new byte[1028]; <END> int len; while ((len = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, len); } MessageDigest md = MessageDigest.getInstance(DIGEST_ALGORITHM); byte[] md5Checksum = md.digest(outputStream.toByteArray()); return new String(Hex.encodeHex(md5Checksum)); } }</code><technical_language>Adler32 provider allocates more space for reading stream. byte[] buf = new byte[4096]; Is 1028 enough</technical_language>

Target:
public String calculateChecksum(InputStream inputStream) throws IOException, NoSuchAlgorithmException { if (inputStream == null) { throw new IllegalArgumentException("InputStream cannot be null"); } return DigestUtils.sha256Hex(inputStream); }
Source:
<code>public Note cloneNote(String sourceNoteID, String newNoteName, AuthenticationInfo subject) throws IOException, CloneNotSupportedException, IllegalArgumentException { Note sourceNote = getNote(sourceNoteID); if (sourceNote == null) { throw new IllegalArgumentException(sourceNoteID + "not found"); } Note newNote = createNote(subject); if (newNoteName != null) { newNote.setName(newNoteName); } else { <START> newNote.setName("Note " + newNote.getId()); <END> } List<String> boundInterpreterSettingsIds = getBindedInterpreterSettingsIds(sourceNote.id()); bindInterpretersToNote(newNote.id(), boundInterpreterSettingsIds); List<Paragraph> paragraphs = sourceNote.getParagraphs(); for (Paragraph p : paragraphs) { newNote.addCloneParagraph(p); } notebookIndex.addIndexDoc(newNote); newNote.persist(subject); return newNote; }</code><technical_language>newNote.id()</technical_language>

Target:
public Note cloneNote(String sourceNoteID, String newNoteName, AuthenticationInfo subject) throws IOException, CloneNotSupportedException, IllegalArgumentException { Note sourceNote = getNote(sourceNoteID); if (sourceNote == null) { throw new IllegalArgumentException(sourceNoteID + "not found"); } Note newNote = createNote(subject); if (newNoteName != null) { newNote.setName(newNoteName); } else { newNote.setName("Note " + newNote.getId()); } List<String> boundInterpreterSettingsIds = getBindedInterpreterSettingsIds(sourceNote.getId()); bindInterpretersToNote(newNote.getId(), boundInterpreterSettingsIds); List<Paragraph> paragraphs = sourceNote.getParagraphs(); for (Paragraph p : paragraphs) { newNote.addCloneParagraph(p); } notebookIndex.addIndexDoc(newNote); newNote.persist(subject); return newNote; }
Source:
<code>public List<RuntimeWorkspaceDto> getRuntimeWorkspaces(@DefaultValue("0") @QueryParam("skipCount") Integer skipCount, @DefaultValue("30") @QueryParam("maxItems") Integer maxItems) throws BadRequestException { return workspaceManager.getRuntimeWorkspaces(getCurrentUserId()) .stream() <START> .map(this::asRuntimeWorkspaceDto) <END> .collect(toList()); }</code><technical_language>DtoConverter here</technical_language>

Target:
public List<RuntimeWorkspaceDto> getRuntimeWorkspaces(@DefaultValue("0") @QueryParam("skipCount") Integer skipCount, @DefaultValue("30") @QueryParam("maxItems") Integer maxItems) throws BadRequestException { return workspaceManager.getRuntimeWorkspaces(getCurrentUserId()) .stream() .map(this::asDto) .collect(toList()); }
Source:
<code>private <T> Set<Class<? extends T>> load(Class<T> serviceClass, ClassLoader loader) { String serviceFile = SERVICES + "/" + serviceClass.getName(); <START> LinkedHashSet<Class<? extends T>> providers = new LinkedHashSet<Class<? extends T>>(); <END> LinkedHashSet<Class<? extends T>> vetoedProviders = new LinkedHashSet<Class<? extends T>>(); try { Enumeration<URL> enumeration = loader.getResources(serviceFile); while (enumeration.hasMoreElements()) { final URL url = enumeration.nextElement(); final InputStream is = url.openStream(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); String line = reader.readLine(); while (null != line) { line = skipCommentAndTrim(line); if (line.length() > 0) { try { boolean mustBeVetoed = line.startsWith("!"); if (mustBeVetoed) { line = line.substring(1); } Class<? extends T> provider = loader.loadClass(line).asSubclass(serviceClass); if (mustBeVetoed) { vetoedProviders.add(provider); } if (vetoedProviders.contains(provider)) { providers.remove(provider); } else { providers.add(provider); } } catch (ClassCastException e) { throw new IllegalStateException("Service " + line + " does not implement expected type " + serviceClass.getName()); } } line = reader.readLine(); } } finally { if (reader != null) { reader.close(); } } } } catch (Exception e) { throw new RuntimeException("Could not load services for " + serviceClass.getName(), e); } return providers; }</code><technical_language>concrete class instead of Set</technical_language>

Target:
private <T> Set<Class<? extends T>> load(Class<T> serviceClass, ClassLoader loader) { String serviceFile = SERVICES + "/" + serviceClass.getName(); Set<Class<? extends T>> providers = new LinkedHashSet<Class<? extends T>>(); Set<Class<? extends T>> vetoedProviders = new LinkedHashSet<Class<? extends T>>(); try { Enumeration<URL> enumeration = loader.getResources(serviceFile); while (enumeration.hasMoreElements()) { final URL url = enumeration.nextElement(); final InputStream is = url.openStream(); BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); String line = reader.readLine(); while (null != line) { line = skipCommentAndTrim(line); if (line.length() > 0) { try { boolean mustBeVetoed = line.startsWith("!"); if (mustBeVetoed) { line = line.substring(1); } Class<? extends T> provider = loader.loadClass(line).asSubclass(serviceClass); if (mustBeVetoed) { vetoedProviders.add(provider); } if (vetoedProviders.contains(provider)) { providers.remove(provider); } else { providers.add(provider); } } catch (ClassCastException e) { throw new IllegalStateException("Service " + line + " does not implement expected type " + serviceClass.getName()); } } line = reader.readLine(); } } finally { if (reader != null) { reader.close(); } } } } catch (Exception e) { throw new RuntimeException("Could not load services for " + serviceClass.getName(), e); } return providers; }
Source:
<code>public Response previewSnapshot(Action action) { TryBackToAllSnapshotsOfVmParameters tryBackParams = new TryBackToAllSnapshotsOfVmParameters(guid, asGuid(action.getSnapshot().getId())); <START> Response response = doAction(VdcActionType.TryBackToAllSnapshotsOfVm, <END> tryBackParams, action); return response; }</code><technical_language>calling performAction() doAction()</technical_language>

Target:
public Response previewSnapshot(Action action) { TryBackToAllSnapshotsOfVmParameters tryBackParams = new TryBackToAllSnapshotsOfVmParameters(guid, asGuid(action.getSnapshot().getId())); Response response = performAction(VdcActionType.TryBackToAllSnapshotsOfVm, tryBackParams, action); return response; }
Source:
<code>public DocumentReferenceSearchProjectionBuilder documentReference() { return new DocumentReferenceSearchProjectionBuilder() { @Override public SearchProjection<DocumentReference> build() { <START> return null; <END> } }; }</code><technical_language>please return new StubSearchProjection<>()? stub mapper close real mappers possible... a constant a raw type (private static final StubSearchProjection RESULT;) cast it, matter, return null null is expected</technical_language>

Target:
public DocumentReferenceSearchProjectionBuilder documentReference() { return new DocumentReferenceSearchProjectionBuilder() { @SuppressWarnings("unchecked") @Override public SearchProjection<DocumentReference> build() { return (SearchProjection<DocumentReference>) PROJECTION; } }; }
Source:
<code>private List<ChangeSet> parsePollingLogOutput(ByteArrayOutputStream output) throws IOException { List<ChangeSet> incoming = new ArrayList<ChangeSet>(); BufferedReader in = new BufferedReader(new InputStreamReader( new ByteArrayInputStream(output.toByteArray()))); ChangeSet changeSet = null; String line; while ((line = in.readLine()) != null) { Matcher matcher = FILES_LINE.matcher(line); if (matcher.matches()) { for (String s : matcher.group(1).split(":")) { if (s.length() > 0) { changeSet.files.add(s); } } } if (line.startsWith("id:")) { String id = line.substring(3); changeSet = new ChangeSet(id); incoming.add(changeSet); } if (line.startsWith("branch:")) { String branch = line.substring(7); <START> if (branch == null) { <END> branch = "default"; } changeSet.branch = branch; } } return incoming; }</code><technical_language>String.substring return null. indentation is weird. miss a brace something</technical_language>

Target:
private List<ChangeSet> parsePollingLogOutput(ByteArrayOutputStream output) throws IOException { List<ChangeSet> incoming = new ArrayList<ChangeSet>(); BufferedReader in = new BufferedReader(new InputStreamReader( new ByteArrayInputStream(output.toByteArray()))); ChangeSet changeSet = null; String line; while ((line = in.readLine()) != null) { Matcher matcher = FILES_LINE.matcher(line); if (matcher.matches()) { for (String s : matcher.group(1).split(":")) { if (s.length() > 0) { changeSet.files.add(s); } } } if (line.startsWith("id:")) { String id = line.substring(3); changeSet = new ChangeSet(id); incoming.add(changeSet); } if (line.startsWith("branch:")) { String branch = line.substring(7); changeSet.branch = branch; } } return incoming; }