auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ContactDataBuilder extractContactData(ContactDataBuilder builder, long contactId, Cursor cursor) { final ColumnProcessors processors = new ColumnProcessors(); builder.setContactId(contactId); builder.setPhotoId(processors.forInteger().extract(cursor, Column.PHOTO_ID)); String mimeType = processors.forString().extract(cursor, Column.MIMETYPE); String data = processors.forString().extract(cursor, Column.DATA1); int isPrimary = processors.forInteger().extract(cursor, Column.IS_PRIMARY); if (mimeType.equals(Email.CONTENT_ITEM_TYPE)) { builder.addEmailId(data); } else if (mimeType.equals(Phone.CONTENT_ITEM_TYPE)) { builder.addPhoneNumber(new ContactNumber(data, isPrimary > 0 ? true : false)); } else if (mimeType.equals(StructuredName.CONTENT_ITEM_TYPE)) { <START> PersonNameDataBuilder nameBuilder = new PersonNameDataBuilder(); <END> nameBuilder.setDisplayName(data); data = processors.forString().extract(cursor, Column.DATA2); nameBuilder.setGivenName(data); data = processors.forString().extract(cursor, Column.DATA3); nameBuilder.setFamilyName(data); data = processors.forString().extract(cursor, Column.DATA4); nameBuilder.setPrefix(data); data = processors.forString().extract(cursor, Column.DATA5); nameBuilder.setMiddleName(data); data = processors.forString().extract(cursor, Column.DATA6); nameBuilder.setSuffix(data); builder.setName(nameBuilder.build()); } return builder; }</code><technical_language>do need reuse field data? set in builder</technical_language>

Target:
private ContactDataBuilder extractContactData(ContactDataBuilder builder, long contactId, Cursor cursor) { final ColumnProcessors processors = new ColumnProcessors(); builder.setContactId(contactId); builder.setPhotoId(processors.forInteger().extract(cursor, Column.PHOTO_ID)); String mimeType = processors.forString().extract(cursor, Column.MIMETYPE); String data = processors.forString().extract(cursor, Column.DATA1); int isPrimary = processors.forInteger().extract(cursor, Column.IS_PRIMARY); if (mimeType.equals(Email.CONTENT_ITEM_TYPE)) { builder.addEmailId(data); } else if (mimeType.equals(Phone.CONTENT_ITEM_TYPE)) { builder.addPhoneNumber(new ContactNumber(data, isPrimary > 0 ? true : false)); } else if (mimeType.equals(StructuredName.CONTENT_ITEM_TYPE)) { PersonNameDataBuilder nameBuilder = new PersonNameDataBuilder(); nameBuilder.setDisplayName(data); nameBuilder.setGivenName(processors.forString().extract(cursor, Column.DATA2)); nameBuilder.setFamilyName(processors.forString().extract(cursor, Column.DATA3)); nameBuilder.setPrefix(processors.forString().extract(cursor, Column.DATA4)); nameBuilder.setMiddleName(processors.forString().extract(cursor, Column.DATA5)); nameBuilder.setSuffix(processors.forString().extract(cursor, Column.DATA6)); builder.setName(nameBuilder); } return builder; }
Source:
<code>public GeoNamesCatalogIndexer( CatalogFramework catalogFramework, UuidGenerator uuidGenerator, MetacardType metacardType, FilterBuilder filterBuilder, List<CatalogProvider> catalogProviders) { this.catalogFramework = catalogFramework; this.uuidGenerator = uuidGenerator; this.geoNamesMetacardType = metacardType; this.catalogProviders = catalogProviders; this.filterBuilder = filterBuilder; filter = filterBuilder.allOf( filterBuilder <START> .attribute(METACARD_TAGS) <END> .is() .equalTo() .text(GeoCodingConstants.GEONAMES_TAG), filterBuilder.attribute(METACARD_TAGS).is().equalTo().text(GAZETTEER_METACARD_TAG)); }</code><technical_language>I prefer Core.METACARD_TAGS METACARD_TAGS allows variable context enhances readability. this in a places is a constant Core.CLASSIFICATION a SomeOtherConstantsFile.CLASSIFICATION Is a standard practice for DDF? thoughts</technical_language>

Target:
public GeoNamesCatalogIndexer( CatalogFramework catalogFramework, UuidGenerator uuidGenerator, MetacardType metacardType, FilterBuilder filterBuilder, List<CatalogProvider> catalogProviders) { this.catalogFramework = catalogFramework; this.uuidGenerator = uuidGenerator; this.geoNamesMetacardType = metacardType; this.catalogProviders = catalogProviders; this.filterBuilder = filterBuilder; filter = filterBuilder.allOf( filterBuilder .attribute(Core.METACARD_TAGS) .is() .equalTo() .text(GeoCodingConstants.GEONAMES_TAG), filterBuilder .attribute(Core.METACARD_TAGS) .is() .equalTo() .text(GAZETTEER_METACARD_TAG)); }
Source:
<code>protected boolean validateAction() { <START> return true; <END> }</code><technical_language>need verify conditions expect here. For example, if MDX Lookup Rule a connection ? code line 39 get NPE, ? minimally, need a "shared_olap_connection" for get in this method</technical_language>

Target:
protected boolean validateAction() { return getLookupRule() != null; }
Source:
<code>protected void createViews() { appView.getView().setId(100); appView.getView().setLayoutParams(new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); setContentView(appView.getView()); if (preferences.contains("BackgroundColor")) { try { int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK); appView.getView().setBackgroundColor(backgroundColor); <START> }catch (NumberFormatException e){ <END> System.out.println(e.getMessage()); } } appView.getView().requestFocusFromTouch(); }</code><technical_language>add a white space } catch</technical_language>

Target:
protected void createViews() { appView.getView().setId(100); appView.getView().setLayoutParams(new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); setContentView(appView.getView()); if (preferences.contains("BackgroundColor")) { try { int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK); appView.getView().setBackgroundColor(backgroundColor); } catch (NumberFormatException e){ e.printStackTrace(); } } appView.getView().requestFocusFromTouch(); }
Source:
<code>public TmfVertex(TmfVertex node, final long ts) { this.fTimestamp = ts; <START> this.fId = count++; <END> fOutgoingVertical = node.fOutgoingVertical; fIncomingVertical = node.fIncomingVertical; fOutgoingHorizontal = node.fOutgoingHorizontal; fIncomingHorizontal = node.fIncomingHorizontal; }</code><technical_language>synchronized block too</technical_language>

Target:
public TmfVertex(TmfVertex node, final long ts) { fTimestamp = ts; synchronized (TmfVertex.class) { fId = count++; } fOutgoingVertical = node.fOutgoingVertical; fIncomingVertical = node.fIncomingVertical; fOutgoingHorizontal = node.fOutgoingHorizontal; fIncomingHorizontal = node.fIncomingHorizontal; }
Source:
<code>public WebClient() { super(BrowserVersion.FIREFOX_38); setPageCreator(HudsonPageCreator.INSTANCE); clients.add(this); setAjaxController(new AjaxController() { <START> private static final long serialVersionUID = -5844060943564822678L; <END> public boolean processSynchron(HtmlPage page, WebRequest settings, boolean async) { return false; } }); setCssErrorHandler(new ErrorHandler() { final ErrorHandler defaultHandler = new DefaultCssErrorHandler(); public void warning(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.warning(exception); } public void error(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.error(exception); } public void fatalError(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.fatalError(exception); } private boolean ignore(CSSParseException e) { return e.getURI().contains("/yui/"); } }); getJavaScriptEngine().getContextFactory().addListener(new Listener() { public void contextCreated(Context cx) { if (cx.getDebugger() == null) cx.setDebugger(jsDebugger, null); } public void contextReleased(Context cx) { } }); setAlertHandler(new AlertHandler() { public void handleAlert(Page page, String message) { throw new AssertionError("Alert dialog poped up: "+message); } }); }</code><technical_language>update serial</technical_language>

Target:
public WebClient() { super(BrowserVersion.FIREFOX_38); setPageCreator(HudsonPageCreator.INSTANCE); clients.add(this); setAjaxController(new AjaxController() { private static final long serialVersionUID = 6730107519583349963L; public boolean processSynchron(HtmlPage page, WebRequest settings, boolean async) { return false; } }); setCssErrorHandler(new ErrorHandler() { final ErrorHandler defaultHandler = new DefaultCssErrorHandler(); public void warning(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.warning(exception); } public void error(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.error(exception); } public void fatalError(CSSParseException exception) throws CSSException { if (!ignore(exception)) defaultHandler.fatalError(exception); } private boolean ignore(CSSParseException e) { return e.getURI().contains("/yui/"); } }); getJavaScriptEngine().getContextFactory().addListener(new Listener() { public void contextCreated(Context cx) { if (cx.getDebugger() == null) cx.setDebugger(jsDebugger, null); } public void contextReleased(Context cx) { } }); setAlertHandler(new AlertHandler() { public void handleAlert(Page page, String message) { throw new AssertionError("Alert dialog poped up: "+message); } }); }
Source:
<code>public Repo<Master> call(long tid, Master master) throws Exception { VolumeManager fs = master.getFileSystem(); <START> fs.mkdirs(new Path(tableInfo.dir)); <END> if (tableInfo.initialSplitSize > 0) { SortedSet<Text> dirInfo = Utils .getSortedSetFromFile(master.getInputStream(tableInfo.splitDirsFile), false); createTabletDirectories(master.getFileSystem(), dirInfo); } return new PopulateMetadata(tableInfo); }</code><technical_language>I noticed new code checks boolean returned mkdir, existing code not</technical_language>

Target:
public Repo<Master> call(long tid, Master master) throws Exception { VolumeManager fs = master.getFileSystem(); fs.mkdirs(new Path(tableInfo.defaultTabletDir)); if (tableInfo.initialSplitSize > 0) { SortedSet<Text> dirInfo = Utils .getSortedSetFromFile(master.getInputStream(tableInfo.splitDirsFile), false); createTabletDirectories(master.getFileSystem(), dirInfo); } return new PopulateMetadata(tableInfo); }
Source:
<code>public void testAuthentication() { ConfigurationBuilder clientBuilder = initServerAndClient(); clientBuilder.security().authentication().callbackHandler(new TestCallbackHandler("user", "realm", "password".toCharArray())); remoteCacheManager = new RemoteCacheManager(clientBuilder.build()); RemoteCache<String, String> defaultRemote = remoteCacheManager.getCache(); defaultRemote.put("a", "a"); <START> Object o = defaultRemote.get("a"); <END> assertEquals("a", defaultRemote.get("a")); }</code><technical_language>temporary testing code</technical_language>

Target:
public void testAuthentication() { ConfigurationBuilder clientBuilder = initServerAndClient(); clientBuilder.security().authentication().callbackHandler(new TestCallbackHandler("user", "realm", "password".toCharArray())); remoteCacheManager = new RemoteCacheManager(clientBuilder.build()); RemoteCache<String, String> defaultRemote = remoteCacheManager.getCache(); defaultRemote.put("a", "a"); assertEquals("a", defaultRemote.get("a")); }
Source:
<code>public void edit() { if (getWindow() != null) { return; } <START> EditDiskProfileModel model = <END> new EditDiskProfileModel(this, getCompatibilityVersion(), (DiskProfile) getSelectedItem(), getEntity().getStoragePoolId()); setWindow(model); initProfileStorageDomains(model); }</code><technical_language>format</technical_language>

Target:
public void edit() { if (getWindow() != null) { return; } EditDiskProfileModel model = new EditDiskProfileModel(this, (DiskProfile) getSelectedItem(), getEntity().getStoragePoolId()); setWindow(model); initProfileStorageDomains(model); }
Source:
<code>public void run(IAction action) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView( RepositoryUi.ID_VIEW_REPOSITORIES); } catch (PartInitException e) { StatusHandler .log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Can not show Team Repository View", e)); <START> e.printStackTrace(); <END> } }</code><technical_language>printStackTrace. log stack trace</technical_language>

Target:
public void run(IAction action) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView( RepositoryUi.ID_VIEW_REPOSITORIES); } catch (PartInitException e) { StatusHandler .log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Can not show Team Repository View", e)); } }
Source:
<code>public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } <START> final GitHubPushCause other = (GitHubPushCause) obj; <END> if ((this.pushedBy == null) ? (other.pushedBy != null) : !this.pushedBy.equals(other.pushedBy)) { return false; } return true; }</code><technical_language>getClass().isInstance(obj) instead of if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + }</technical_language>

Target:
public boolean equals(Object obj) { if (!getClass().isInstance(obj)) { return false; } final GitHubPushCause other = (GitHubPushCause) obj; if ((this.pushedBy == null) ? (other.pushedBy != null) : !this.pushedBy.equals(other.pushedBy)) { return false; } return true; }
Source:
<code><START> private byte[] subArray(byte[] byteArray, int beginIndex, int length) { <END> byte[] subArray = new byte[length]; System.arraycopy(byteArray, beginIndex, subArray, 0, subArray.length); return subArray; }</code><technical_language>This is a static method. instance method</technical_language>

Target:
private static byte[] subArray(byte[] byteArray, int beginIndex, int length) { byte[] subArray = new byte[length]; System.arraycopy(byteArray, beginIndex, subArray, 0, subArray.length); return subArray; }
Source:
<code>private FluidStack fluidFromBlock(Block block) { <START> if (block instanceof BlockStaticLiquid) <END> { if (block == Blocks.WATER) { return new FluidStack(FluidRegistry.WATER, 1000); } else if (block == Blocks.LAVA) { return new FluidStack(FluidRegistry.LAVA, 1000); } } return null; }</code><technical_language>point if do == anyway</technical_language>

Target:
private FluidStack fluidFromBlock(Block block) { if (block == Blocks.WATER) { return new FluidStack(FluidRegistry.WATER, 1000); } else if (block == Blocks.LAVA) { return new FluidStack(FluidRegistry.LAVA, 1000); } return null; }
Source:
<code>protected Set<String> filterZones(Set<String> zones) { if(System.getProperty("test.live.region")==null){ return zones; } Set<String> zoneFilter = Sets.newHashSet(System.getProperty("test.live.region").split(",")); <START> return Sets.intersection(zones, zoneFilter); <END> }</code><technical_language>like: String zonesToTestList = System.getProperty("test.live.region"); if (zonesToTestList == null) { return zones; // filter applied } Set<String> zonesToTest = Sets.newHashSet(Splitter.on(',').split(zonesToTestList )); return Sets.intersection(zones, zonesToTest); ? Also, fact this returns a set **view** a new **set** problems</technical_language>

Target:
protected Set<String> filterZones(Set<String> zones) { String zonesToList = System.getProperty("test.live.zones"); if(zonesToList == null) { return zones; } Set<String> zoneFilter = Sets.newHashSet(Splitter.on(',').split(zonesToList)); return Sets.intersection(zones, zoneFilter); }
Source:
<code>public Void call() throws IOException { if (task == null) { throw new IOException("The callable " + this + " has been serialized somehow, but it is actually not serializable"); } try { return task.call(); <START> } catch (Exception ex) { <END> if (ex instanceof IOException) { throw (IOException)ex; } throw new IOException(ex); } }</code><technical_language>simpler: } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e); }</technical_language>

Target:
public Void call() throws IOException { if (task == null) { throw new IOException("The callable " + this + " has been serialized somehow, but it is actually not serializable"); } try { return task.call(); } catch (IOException ex) { throw ex; } catch (Exception ex) { throw new IOException(ex); } }
Source:
<code>public void singleFilePut() throws IOException, URISyntaxException, XmlProcessingException, SignatureException { final String bucketName = "java_integration_test"; final String book = "beowulf.txt"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { helpers.ensureBucketExists(bucketName); <START> final Path objFile = ResourceUtils.loadFileResource(Util.RESOURCE_BASE_NAME + book); <END> final String digest = DigestUtils.sha256Hex(Files.newInputStream(objFile)); final Ds3Object obj = new Ds3Object(book, Files.size(objFile)); final Ds3ClientHelpers.Job putJob = helpers.startWriteJob(bucketName, Lists.newArrayList(obj)); putJob.transfer(new ResourceObjectPutter(Util.RESOURCE_BASE_NAME)); final Path tempDir = Files.createTempDirectory("ds3_test_"); final Ds3ClientHelpers.Job getJob = helpers.startReadAllJob(bucketName); getJob.transfer(new FileObjectGetter(tempDir)); final String secondDigest = DigestUtils.sha256Hex(Files.newInputStream(tempDir.resolve(book))); assertThat(secondDigest, is(equalTo(digest))); } finally { Util.deleteAllContents(client, bucketName); } }</code><technical_language>Path is named objFile</technical_language>

Target:
public void singleFilePut() throws IOException, URISyntaxException, XmlProcessingException, SignatureException { final String bucketName = "java_integration_test"; final String book = "beowulf.txt"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { helpers.ensureBucketExists(bucketName); final Path objPath = ResourceUtils.loadFileResource(Util.RESOURCE_BASE_NAME + book); final String digest = DigestUtils.sha256Hex(Files.newInputStream(objPath)); final Ds3Object obj = new Ds3Object(book, Files.size(objPath)); final Ds3ClientHelpers.Job putJob = helpers.startWriteJob(bucketName, Lists.newArrayList(obj)); putJob.transfer(new ResourceObjectPutter(Util.RESOURCE_BASE_NAME)); final Path tempDir = Files.createTempDirectory("ds3_test_"); final Ds3ClientHelpers.Job getJob = helpers.startReadAllJob(bucketName); getJob.transfer(new FileObjectGetter(tempDir)); final String secondDigest = DigestUtils.sha256Hex(Files.newInputStream(tempDir.resolve(book))); assertThat(secondDigest, is(equalTo(digest))); } finally { Util.deleteAllContents(client, bucketName); } }
Source:
<code>public void build(TopologyBuilder bldr, Set<String> stageNames) { if (built) { <START> throw new RuntimeException("Logic Error While building stage: " + getName()); <END> } if (doBuild(bldr, stageNames)) { built = true; for (StreamletImpl<?> streamlet : children) { streamlet.build(bldr, stageNames); } } }</code><technical_language>"stage"</technical_language>

Target:
public void build(TopologyBuilder bldr, Set<String> stageNames) { if (built) { throw new RuntimeException("Logic Error While building " + getName()); } if (doBuild(bldr, stageNames)) { built = true; for (StreamletImpl<?> streamlet : children) { streamlet.build(bldr, stageNames); } } }
Source:
<code>public StringDataValue getNullChar(StringDataValue previous, int collationType, int maxSize) throws StandardException { SQLChar ret = null; if (collationType == StringDataValue.COLLATION_TYPE_UCS_BASIC) { <START> ret = (SQLChar) getCharDataValue((String) null); <END> } else { ret = new CollatorSQLChar(getCharacterCollator(collationType)); } ret.setSqlCharSize(maxSize); if (previous != null) previous.setToNull(); return ret; }</code><technical_language>this path consideration passed in argument _previous_ if is null? (I'm comparing existing function getNullChar(StringDataValue, int)</technical_language>

Target:
public StringDataValue getNullChar(StringDataValue previous, int collationType, int maxSize) throws StandardException { if (previous != null) { previous.setToNull(); return previous; } SQLChar ret = null; if (collationType == StringDataValue.COLLATION_TYPE_UCS_BASIC) { ret = (SQLChar) getCharDataValue((String) null); } else { ret = new CollatorSQLChar(getCharacterCollator(collationType)); } ret.setSqlCharSize(maxSize); return ret; }
Source:
<code>private boolean isjPMMLAvailableToClassLoader(ClassLoader classLoader) { try { classLoader.loadClass("org.kie.dmn.jpmml.DMNjPMMLInvocationEvaluator"); return true; <START> } catch (ClassNotFoundException e) { <END> } return false; }</code><technical_language>Please handle this exception. rethrow handle other way</technical_language>

Target:
private boolean isjPMMLAvailableToClassLoader(ClassLoader classLoader) { try { classLoader.loadClass("org.kie.dmn.jpmml.DMNjPMMLInvocationEvaluator"); return true; } catch (ClassNotFoundException e) { return false; } }
Source:
<code>public Object execute(final ExecutionEvent aEvent) { try { IEditorInput activeEditorInput = HandlerUtil.getActiveEditorInput(aEvent); if (activeEditorInput instanceof GerritMultipleInput) { viewer = ((GerritMultipleInput) activeEditorInput).getUpperSection().getDiffTreeViewer(); <START> TreeViewer treeViewer = viewer; <END> IBaseLabelProvider labelProvider = treeViewer .getLabelProvider(CompareUpperSectionColumn.FILE_PATH.ordinal()); if (labelProvider instanceof FileInfoCompareCellLabelProvider) { FileInfoCompareCellLabelProvider infoProvider = (FileInfoCompareCellLabelProvider) labelProvider; infoProvider.setFileNameFirst(!infoProvider.getFileOrder()); treeViewer.refresh(); } } } finally { return Status.OK_STATUS; } }</code><technical_language>Viewer deine line 31</technical_language>

Target:
public Object execute(final ExecutionEvent aEvent) { try { IEditorInput activeEditorInput = HandlerUtil.getActiveEditorInput(aEvent); if (activeEditorInput instanceof GerritMultipleInput) { TreeViewer treeViewer = ((GerritMultipleInput) activeEditorInput).getUpperSection().getDiffTreeViewer(); IBaseLabelProvider labelProvider = treeViewer .getLabelProvider(CompareUpperSectionColumn.FILE_PATH.ordinal()); if (labelProvider instanceof FileInfoCompareCellLabelProvider) { FileInfoCompareCellLabelProvider infoProvider = (FileInfoCompareCellLabelProvider) labelProvider; infoProvider.setFileNameFirst(!infoProvider.getFileOrder()); treeViewer.refresh(); } } } finally { return Status.OK_STATUS; } }
Source:
<code>public void unrevoke(Content content) { <START> if (!(content instanceof Item)) { <END> throw new RuntimeException("content " + content.getCanonicalUri() + " not an item, cannot revoke"); } revocationStore.unrevoke(content.getCanonicalUri()); Item item = (Item) content; Map<String, ItemOnDemandHierarchy> onDemandHierarchies = onDemandHierarchyExpander.expandHierarchy(item); try { for (Entry<String, ItemOnDemandHierarchy> onDemandHierarchy : onDemandHierarchies.entrySet()) { Task task = createTaskFor(content, Action.DELETE, TVAElementType.ONDEMAND, onDemandHierarchy.getKey()); ItemOnDemandHierarchy hierarchy = onDemandHierarchy.getValue(); JAXBElement<TVAMainType> tvaMain = generator.generateOnDemandTVAFrom(hierarchy, onDemandHierarchy.getKey()); YouViewResult uploadResult = client.upload(tvaMain); processDeletionResult(task, item, uploadResult); } } catch (TvaGenerationException e) { throw Throwables.propagate(e); } }</code><technical_language>here. extract this in a checkIsItem method, avoiding duplication method</technical_language>

Target:
public void unrevoke(Content content) { checkArgument(content instanceof Item, "content " + content.getCanonicalUri() + " not an item, cannot unrevoke"); revocationStore.unrevoke(content.getCanonicalUri()); Item item = (Item) content; Map<String, ItemOnDemandHierarchy> onDemandHierarchies = onDemandHierarchyExpander.expandHierarchy(item); try { for (Entry<String, ItemOnDemandHierarchy> onDemandHierarchy : onDemandHierarchies.entrySet()) { Task task = createTaskFor(content, Action.DELETE, TVAElementType.ONDEMAND, onDemandHierarchy.getKey()); ItemOnDemandHierarchy hierarchy = onDemandHierarchy.getValue(); JAXBElement<TVAMainType> tvaMain = generator.generateOnDemandTVAFrom(hierarchy, onDemandHierarchy.getKey()); YouViewResult uploadResult = client.upload(tvaMain); processDeletionResult(task, item, uploadResult); } } catch (TvaGenerationException e) { throw Throwables.propagate(e); } }
Source:
<code>private String deletePrefixes(String ref, String... prefixes) { <START> String result = ref; <END> for (String prefix : prefixes) { if (result.startsWith(prefix)) { result = result.substring(prefix.length()); return result; } } return result; }</code><technical_language>[optional] This variable is needed</technical_language>

Target:
private String deletePrefixes(String ref, String... prefixes) { for (String prefix : prefixes) { if (ref.startsWith(prefix)) { return ref.substring(prefix.length()); } } return ref; }
Source:
<code>public int[] downloadRemovedCohortMembershipData(String[] cohortUuids){ int[] result = new int[4]; try { long startDownloadCohortData = System.currentTimeMillis(); List<CohortData> cohortDataList = cohortController.downloadRemovedCohortData(cohortUuids); long endDownloadCohortData = System.currentTimeMillis(); <START> Log.i(getClass().getSimpleName(), "Removed member cohort data download successful with " + cohortDataList.size() + " cohorts"); <END> for (CohortData cohortData : cohortDataList) { cohortController.deleteCohortMembers(cohortData.getCohortMembers()); } long cohortMemberAndPatientReplaceTime = System.currentTimeMillis(); Log.i(getClass().getSimpleName(), "Cohort data deleted"); Log.d(getClass().getSimpleName(), "In Downloading cohort data: " + (endDownloadCohortData - startDownloadCohortData) / 1000 + " sec\n" + "In Deleting cohort members: " + (cohortMemberAndPatientReplaceTime - endDownloadCohortData) / 1000 + " sec"); result[0] = SUCCESS; result[1] = cohortDataList.size(); } catch (CohortController.CohortDownloadException e) { Log.e(getClass().getSimpleName(), "Exception thrown while downloading cohort data.", e); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; } catch (CohortController.CohortDeleteException e) { Log.e(getClass().getSimpleName(), "Exception thrown while replacing cohort data.", e); result[0] = SyncStatusConstants.REPLACE_ERROR; } return result; }</code><technical_language>remove unnecessary logs class</technical_language>

Target:
public int[] downloadRemovedCohortMembershipData(String[] cohortUuids){ int[] result = new int[4]; try { List<CohortData> cohortDataList = cohortController.downloadRemovedCohortData(cohortUuids); for (CohortData cohortData : cohortDataList) { cohortController.deleteCohortMembers(cohortData.getCohortMembers()); } result[0] = SUCCESS; result[1] = cohortDataList.size(); } catch (CohortController.CohortDownloadException e) { Log.e(getClass().getSimpleName(), "Exception thrown while downloading cohort data.", e); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; } catch (CohortController.CohortDeleteException e) { Log.e(getClass().getSimpleName(), "Exception thrown while replacing cohort data.", e); result[0] = SyncStatusConstants.REPLACE_ERROR; } return result; }
Source:
<code>public static BufferedImage removeAlpha(final BufferedImage inImage) { BufferedImage outImage = inImage; if (inImage.getColorModel().hasAlpha()) { final Stopwatch watch = new Stopwatch(); int newType; switch (inImage.getType()) { case BufferedImage.TYPE_4BYTE_ABGR: newType = BufferedImage.TYPE_INT_BGR; break; default: newType = BufferedImage.TYPE_INT_RGB; break; } outImage = new BufferedImage(inImage.getWidth(), inImage.getHeight(), newType); Graphics2D g = outImage.createGraphics(); try { <START> String bgColor=Configuration.getInstance().getString(FLATTEN_COLOR_CONFIG_KEY); <END> if (bgColor!=null) { g.setBackground(Color.fromString(bgColor)); g.clearRect(0,0,inImage.getWidth(),inImage.getHeight()); } } catch (Exception e) g.drawImage(inImage, 0, 0, null); g.dispose(); logger.debug("removeAlpha(): converted BufferedImage type to " + "RGB in msec", inImage.getType(), watch.timeElapsed()); } return outImage; }</code><technical_language>Processor.BACKGROUND_COLOR_CONFIG_KEY instead</technical_language>

Target:
public static BufferedImage removeAlpha(final BufferedImage inImage) { BufferedImage outImage = inImage; if (inImage.getColorModel().hasAlpha()) { final Stopwatch watch = new Stopwatch(); int newType; switch (inImage.getType()) { case BufferedImage.TYPE_4BYTE_ABGR: newType = BufferedImage.TYPE_INT_BGR; break; default: newType = BufferedImage.TYPE_INT_RGB; break; } outImage = new BufferedImage(inImage.getWidth(), inImage.getHeight(), newType); Graphics2D g = outImage.createGraphics(); String bgColor=Configuration.getInstance().getString(Processor.BACKGROUND_COLOR_CONFIG_KEY); if (bgColor!=null) { g.setBackground(Color.fromString(bgColor)); g.clearRect(0,0,inImage.getWidth(),inImage.getHeight()); } g.drawImage(inImage, 0, 0, null); g.dispose(); logger.debug("removeAlpha(): converted BufferedImage type to " + "RGB in msec", inImage.getType(), watch.timeElapsed()); } return outImage; }
Source:
<code>public void close() { super.close(); final Lock closeLock = receiveCloseLock.writeLock(); closeLock.lock(); <START> try <END> { } finally { closeLock.unlock(); } }</code><technical_language>is try/catch necessary? i assume super.close() prevents new readers coming in, acquiring write lock ensures pre-existing read threads done, acquire write lock unlock it? is try/catch needed prevent a warning jvm optimization something</technical_language>

Target:
public void close() { super.close(); final Lock closeLock = receiveCloseLock.writeLock(); closeLock.lock(); closeLock.unlock(); }
Source:
<code>public AuditLogType getAuditLogTypeValue() { return getSucceeded() <START> ? (haMaintenanceFailed ? <END> AuditLogType.HOST_UPGRADE_MANUAL_HA : AuditLogType.HOST_UPGRADE_FINISHED) : AuditLogType.HOST_UPGRADE_FAILED; }</code><technical_language>I regular if-then statements in lieu of nested ternary operators, hard grasp right away</technical_language>

Target:
public AuditLogType getAuditLogTypeValue() { if(getSucceeded()){ return haMaintenanceFailed ? AuditLogType.HOST_UPGRADE_FINISHED_MANUAL_HA : AuditLogType.HOST_UPGRADE_FINISHED; } return AuditLogType.HOST_UPGRADE_FAILED; }
Source:
<code>public void run() { try { if (!pickledGraphite.isConnected()){ log.debug("trying to connect to graphite server"); pickledGraphite.connect(); } while (eventsQueue.size() > 0 && !exec.isShutdown()) { try { final GraphiteEvent graphiteEvent = eventsQueue.poll(DEFAULT_PUT_GET_TIMEOUT, TimeUnit.MILLISECONDS); if (graphiteEvent != null) { <START> log.info("sent [%s] with value [%s] and time [%s]", graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp()); <END> pickledGraphite.send( graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); } } catch (InterruptedException e) { log.error(e, e.getMessage()); } catch (IOException e) { log.error(e, e.getMessage()); } } pickledGraphite.flush(); } catch (Exception e) { log.error(e, e.getMessage()); } }</code><technical_language>this printed event? a debug</technical_language>

Target:
public void run() { try { if (!pickledGraphite.isConnected()) { log.info("trying to connect to graphite server"); pickledGraphite.connect(); } while (eventsQueue.size() > 0 && !exec.isShutdown()) { try { final GraphiteEvent graphiteEvent = eventsQueue.poll(DEFAULT_PUT_GET_TIMEOUT, TimeUnit.MILLISECONDS); if (graphiteEvent != null) { log.debug( "sent [%s] with value [%s] and time [%s]", graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); pickledGraphite.send( graphiteEvent.getEventPath(), graphiteEvent.getValue(), graphiteEvent.getTimestamp() ); } } catch (InterruptedException | IOException e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } } pickledGraphite.flush(); } catch (Exception e) { log.error(e, e.getMessage()); if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } } }
Source:
<code><START> MCCriteria(String crit) { <END> this.criteria = crit; }</code><technical_language>private, package protected</technical_language>

Target:
private MCCriteria(String crit) { criteria = crit; }
Source:
<code>public void canRebalanceOnDistributedVolumeWithBricksDown() { GlusterVolumeEntity volumeEntity = getDistributedVolume(volumeId1, 5); volumeEntity.getBricks().get(3).setStatus(GlusterStatus.DOWN); ValidationResult validationResult = brickValidator.canRebalance(volumeEntity); assertFalse(validationResult.isValid()); volumeEntity.getBricks().get(4).setStatus(GlusterStatus.DOWN); <START> assertFalse(validationResult.isValid()); <END> volumeEntity.getBricks().get(3).setStatus(GlusterStatus.UP); assertFalse(validationResult.isValid()); }</code><technical_language>checking calling validator</technical_language>

Target:
public void canRebalanceOnDistributedVolumeWithBricksDown() { GlusterVolumeEntity volumeEntity = getDistributedVolume(volumeId1, 5); volumeEntity.getBricks().get(3).setStatus(GlusterStatus.DOWN); ValidationResult validationResult = brickValidator.canRebalance(volumeEntity); assertFalse(validationResult.isValid()); volumeEntity.getBricks().get(4).setStatus(GlusterStatus.DOWN); validationResult = brickValidator.canRebalance(volumeEntity); assertFalse(validationResult.isValid()); volumeEntity.getBricks().get(3).setStatus(GlusterStatus.UP); validationResult = brickValidator.canRebalance(volumeEntity); assertFalse(validationResult.isValid()); }
Source:
<code>public OutputStream createFile(final Path path, final FileSystem.Statistics statistics, final boolean overwrite, final FsPermission permission, final FsPermission umask) throws AzureBlobFileSystemException { try (AbfsPerfInfo perfInfo = startTracking("createFile", "createPath")) { boolean isNamespaceEnabled = getIsNamespaceEnabled(); LOG.debug("createFile filesystem: path: overwrite: permission: umask: isNamespaceEnabled: {}", client.getFileSystem(), path, overwrite, permission.toString(), umask.toString(), isNamespaceEnabled); boolean appendBlob = false; if (isAppendBlobKey(path.toString())) { appendBlob = true; } client.createPath(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), true, overwrite, isNamespaceEnabled ? getOctalNotation(permission) : null, isNamespaceEnabled ? getOctalNotation(umask) : null, <START> appendBlob); <END> return new AbfsOutputStream( client, statistics, AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), 0, abfsConfiguration.getWriteBufferSize(), abfsConfiguration.isFlushEnabled(), abfsConfiguration.isOutputStreamFlushDisabled(), abfsConfiguration.isAppendWithFlushEnabled(), appendBlob); } }</code><technical_language>perfInfo.registerResult(op.getResult()).registerSuccess(true); removed</technical_language>

Target:
public OutputStream createFile(final Path path, final FileSystem.Statistics statistics, final boolean overwrite, final FsPermission permission, final FsPermission umask) throws AzureBlobFileSystemException { try (AbfsPerfInfo perfInfo = startTracking("createFile", "createPath")) { boolean isNamespaceEnabled = getIsNamespaceEnabled(); LOG.debug("createFile filesystem: path: overwrite: permission: umask: isNamespaceEnabled: {}", client.getFileSystem(), path, overwrite, permission.toString(), umask.toString(), isNamespaceEnabled); boolean isAppendBlob = false; if (isAppendBlobKey(path.toString())) { isAppendBlob = true; } final AbfsRestOperation op = client.createPath(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), true, overwrite, isNamespaceEnabled ? getOctalNotation(permission) : null, isNamespaceEnabled ? getOctalNotation(umask) : null, isAppendBlob); perfInfo.registerResult(op.getResult()).registerSuccess(true); return new AbfsOutputStream( client, statistics, AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), 0, populateAbfsOutputStreamContext(isAppendBlob)); } }
Source:
<code>private Registration getAndSetRegistration(final HttpServletRequest request) { String registrationOID = (String) request.getAttribute("registrationOID"); if (StringUtils.isEmpty(registrationOID)) { registrationOID = request.getParameter("registrationOID"); } final Registration registration = FenixFramework.getDomainObject(registrationOID); <START> if (!getUserView(request).getPerson().getStudent().getAllRegistrations().contains(registration)) { <END> return null; } request.setAttribute("registration", registration); request.setAttribute("registrationOID", registration.getExternalId().toString()); return registration; }</code><technical_language>Avoid calling getAllRegistrations() method. poor performance</technical_language>

Target:
private Registration getAndSetRegistration(final HttpServletRequest request) { String registrationOID = (String) request.getAttribute("registrationOID"); if (StringUtils.isEmpty(registrationOID)) { registrationOID = request.getParameter("registrationOID"); } final Registration registration = FenixFramework.getDomainObject(registrationOID); if (!getUserView(request).getPerson().getStudent().getRegistrationStream().anyMatch(r -> r.equals(registration))) { return null; } request.setAttribute("registration", registration); request.setAttribute("registrationOID", registration.getExternalId().toString()); return registration; }
Source:
<code>public void testPersistedJobGraphWhenDispatcherIsShutDown() throws Exception { final TestingJobGraphStore submittedJobGraphStore = TestingJobGraphStore.newBuilder().build(); submittedJobGraphStore.start(null); haServices.setJobGraphStore(submittedJobGraphStore); dispatcher = new TestingDispatcherBuilder() .setJobGraphWriter(submittedJobGraphStore) .build(); dispatcher.start(); jobMasterLeaderElectionService.isLeader(UUID.randomUUID()); final DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); dispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); <START> CommonTestUtils.waitUntilJobManagerIsInitialized(() -> dispatcherGateway.requestJobStatus(jobGraph.getJobID(), TIMEOUT).get()); <END> assertThat(dispatcher.getNumberJobs(TIMEOUT).get(), Matchers.is(1)); dispatcher.close(); assertThat(submittedJobGraphStore.contains(jobGraph.getJobID()), Matchers.is(true)); }</code><technical_language>do wait for this here</technical_language>

Target:
public void testPersistedJobGraphWhenDispatcherIsShutDown() throws Exception { final TestingJobGraphStore submittedJobGraphStore = TestingJobGraphStore.newBuilder().build(); submittedJobGraphStore.start(null); haServices.setJobGraphStore(submittedJobGraphStore); dispatcher = new TestingDispatcherBuilder() .setJobGraphWriter(submittedJobGraphStore) .build(); dispatcher.start(); final DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); dispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); assertThat(dispatcher.getNumberJobs(TIMEOUT).get(), Matchers.is(1)); dispatcher.close(); assertThat(submittedJobGraphStore.contains(jobGraph.getJobID()), Matchers.is(true)); }
Source:
<code>GoCounting (String boardString) { String[] lines = boardString.split("\n"); board = new int[lines[0].length()][lines.length]; <START> for(int i = 0; i < lines.length; i++) { <END> for(int j = 0; j < lines[i].length(); j++) { if(lines[i].charAt(j) == 'B') { board[j][i] = BLACK; } else if(lines[i].charAt(j) == 'W') { board[j][i] = WHITE; } else { board[j][i] = NONE; } } } }</code><technical_language>Minor nitpick: a space for if, e.g. for (int i = 0; i < lines.length; i++) {</technical_language>

Target:
GoCounting (String boardString) { String[] lines = boardString.split("\n"); board = new Player[lines[0].length()][lines.length]; for (int i = 0; i < lines.length; i++) { for (int j = 0; j < lines[i].length(); j++) { if (lines[i].charAt(j) == 'B') { board[j][i] = Player.BLACK; } else if (lines[i].charAt(j) == 'W') { board[j][i] = Player.WHITE; } else { board[j][i] = Player.NONE; } } } }
Source:
<code>public void subscribeActual(Subscriber<? super R> s) { Publisher<? extends T>[] a = array; int n; if (a == null) { <START> assert iterable != null; END> n = 0; a = new Publisher[8]; Iterator<? extends Publisher<? extends T>> it; try { it = ObjectHelper.requireNonNull(iterable.iterator(), "The iterator returned is null"); } catch (Throwable e) { Exceptions.throwIfFatal(e); EmptySubscription.error(e, s); return; } for (;;) { boolean b; try { b = it.hasNext(); } catch (Throwable e) { Exceptions.throwIfFatal(e); EmptySubscription.error(e, s); return; } if (!b) { break; } Publisher<? extends T> p; try { p = ObjectHelper.requireNonNull(it.next(), "The publisher returned by the iterator is null"); } catch (Throwable e) { Exceptions.throwIfFatal(e); EmptySubscription.error(e, s); return; } if (n == a.length) { Publisher<? extends T>[] c = new Publisher[n + (n >> 2)]; System.arraycopy(a, 0, c, 0, n); a = c; } a[n++] = p; } } else { n = a.length; } if (n == 0) { EmptySubscription.complete(s); return; } if (n == 1) { new FlowableMap<T, R>((Publisher<T>)a[0], new Function<T, R>() { @Override public R apply(T t) throws Exception { return combiner.apply(new Object[] { t }); } }).subscribe(s); return; } CombineLatestCoordinator<T, R> coordinator = new CombineLatestCoordinator<T, R>(s, combiner, n, bufferSize, delayErrors); s.onSubscribe(coordinator); coordinator.subscribe(a, n); }</code><technical_language>Asserts default increase bytecode size; besides assert anyway</technical_language>

Target:
public void subscribeActual(Subscriber<? super R> s) { Publisher<? extends T>[] a = array; int n; if (a == null) { n = 0; a = new Publisher[8]; Iterator<? extends Publisher<? extends T>> it; try { it = ObjectHelper.requireNonNull(iterable.iterator(), "The iterator returned is null"); } catch (Throwable e) { Exceptions.throwIfFatal(e); EmptySubscription.error(e, s); return; } for (;;) { boolean b; try { b = it.hasNext(); } catch (Throwable e) { Exceptions.throwIfFatal(e); EmptySubscription.error(e, s); return; } if (!b) { break; } Publisher<? extends T> p; try { p = ObjectHelper.requireNonNull(it.next(), "The publisher returned by the iterator is null"); } catch (Throwable e) { Exceptions.throwIfFatal(e); EmptySubscription.error(e, s); return; } if (n == a.length) { Publisher<? extends T>[] c = new Publisher[n + (n >> 2)]; System.arraycopy(a, 0, c, 0, n); a = c; } a[n++] = p; } } else { n = a.length; } if (n == 0) { EmptySubscription.complete(s); return; } if (n == 1) { new FlowableMap<T, R>((Publisher<T>)a[0], new Function<T, R>() { @Override public R apply(T t) throws Exception { return combiner.apply(new Object[] { t }); } }).subscribe(s); return; } CombineLatestCoordinator<T, R> coordinator = new CombineLatestCoordinator<T, R>(s, combiner, n, bufferSize, delayErrors); s.onSubscribe(coordinator); coordinator.subscribe(a, n); }
Source:
<code>public void configure(final Config conf) { this.timeout = ConfUtils.getInt(conf, "http.timeout", 10000); this.proxyHost = ConfUtils.getString(conf, "http.proxy.host", null); this.proxyPort = ConfUtils.getInt(conf, "http.proxy.port", 8080); this.useProxy = (proxyHost != null && proxyHost.length() > 0); this.maxContent = ConfUtils.getInt(conf, "http.content.limit", 64 * 1024); this.userAgent = getAgentString( ConfUtils.getString(conf, "http.agent.name"), ConfUtils.getString(conf, "http.agent.version"), ConfUtils.getString(conf, "http.agent.description"), ConfUtils.getString(conf, "http.agent.url"), ConfUtils.getString(conf, "http.agent.email")); this.responseTime = ConfUtils.getBoolean(conf, "http.store.responsetime", true); this.skipRobots = ConfUtils.getBoolean(conf, "http.skip.robots", false); robots = new HttpRobotRulesParser(conf); <START> } <END></code><technical_language>IMO configure defined method. More logical</technical_language>

Target:
public void configure(final Config conf) { this.maxContent = ConfUtils.getInt(conf, "http.content.limit", 64 * 1024); String userAgent = getAgentString( ConfUtils.getString(conf, "http.agent.name"), ConfUtils.getString(conf, "http.agent.version"), ConfUtils.getString(conf, "http.agent.description"), ConfUtils.getString(conf, "http.agent.url"), ConfUtils.getString(conf, "http.agent.email")); this.responseTime = ConfUtils.getBoolean(conf, "http.store.responsetime", true); this.skipRobots = ConfUtils.getBoolean(conf, "http.skip.robots", false); robots = new HttpRobotRulesParser(conf); builder = HttpClients.custom().setUserAgent(userAgent) .setConnectionManager(CONNECTION_MANAGER); String proxyHost = ConfUtils.getString(conf, "http.proxy.host", null); int proxyPort = ConfUtils.getInt(conf, "http.proxy.port", 8080); boolean useProxy = (proxyHost != null && proxyHost.length() > 0); if (useProxy) { HttpHost proxy = new HttpHost(proxyHost, proxyPort); DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner( proxy); builder.setRoutePlanner(routePlanner); } int timeout = ConfUtils.getInt(conf, "http.timeout", 10000); requestConfig = RequestConfig.custom().setSocketTimeout(timeout) .setConnectTimeout(timeout).build(); }
Source:
<code>protected String getAuthorizationBaseUrl() { <START> return PROTOCOL + hostName + AUTHORIZE_URL; <END> }</code><technical_language>move this String concats constructor? private final String accessTokenUrl; private final String authorizationBaseUrl; protected SalesforceApi(String hostName) { accessTokenUrl = PROTOCOL + hostName + ACCESS_URL; authorizationBaseUrl = PROTOCOL + hostName + AUTHORIZE_URL; .... }</technical_language>

Target:
protected String getAuthorizationBaseUrl() { return authorizationBaseUrl; }
Source:
<code>private void traverseClass(Node n, Node parent) { Preconditions.checkState(n.getChildCount() == 3, n); Preconditions.checkState(n.isClass()); final Node className = n.getFirstChild(); <START> boolean isClassExpression = (parent != null) <END> && NodeUtil.isClassExpression(n); if (!isClassExpression) { traverseBranch(className, n); } curNode = n; pushScope(n); if (isClassExpression) { traverseBranch(className, n); } final Node extendsClause = className.getNext(); final Node body = extendsClause.getNext(); traverseBranch(extendsClause, n); traverseBranch(body, n); popScope(); }</code><technical_language>this occur? (CLASS node null parent) impossible in a full AST</technical_language>

Target:
private void traverseClass(Node n, Node parent) { Preconditions.checkState(n.getChildCount() == 3, n); Preconditions.checkState(n.isClass()); final Node className = n.getFirstChild(); boolean isClassExpression = NodeUtil.isClassExpression(n); if (!isClassExpression) { traverseBranch(className, n); } curNode = n; pushScope(n); if (isClassExpression) { traverseBranch(className, n); } final Node extendsClause = className.getNext(); final Node body = extendsClause.getNext(); traverseBranch(extendsClause, n); traverseBranch(body, n); popScope(); }
Source:
<code>protected void addChallenge(Challenge challenge) { if (challenge == null) { throw new IllegalArgumentException("challenge not valid"); } if (challenges == null) { challenges = new ArrayList<>(); } <START> challenges.add(challenge); <END> }</code><technical_language>challenge.setTask(this); adding non-owning side work</technical_language>

Target:
protected void addChallenge(Challenge challenge) { if (challenges == null) { challenges = new ArrayList<>(); } challenges.add(challenge); }