auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected List<LiveMigrateVmDisksParameters> getLiveMigrateDisksParametersList() { <START> List<LiveMigrateVmDisksParameters> liveMigrateDisksParametersList = new ArrayList<LiveMigrateVmDisksParameters>(); <END> for (Map.Entry<Guid, List<LiveMigrateDiskParameters>> entry : vmsLiveMigrateParametersMap.entrySet()) { LiveMigrateVmDisksParameters liveMigrateDisksParameters = new LiveMigrateVmDisksParameters(entry.getValue(), entry.getKey()); liveMigrateDisksParameters.setParentCommand(VdcActionType.MoveDisks); liveMigrateDisksParameters.setSessionId(getParameters().getSessionId()); liveMigrateDisksParametersList.add(liveMigrateDisksParameters); } return liveMigrateDisksParametersList; }</code><technical_language>arraylist is created returned here..and a new arraylist is created it..line 53.</technical_language>

Target:
protected ArrayList<VdcActionParametersBase> getLiveMigrateDisksParametersList() { ArrayList<VdcActionParametersBase> liveMigrateDisksParametersList = new ArrayList<VdcActionParametersBase>(); for (Map.Entry<Guid, List<LiveMigrateDiskParameters>> entry : vmsLiveMigrateParametersMap.entrySet()) { LiveMigrateVmDisksParameters liveMigrateDisksParameters = new LiveMigrateVmDisksParameters(entry.getValue(), entry.getKey()); liveMigrateDisksParameters.setParentCommand(VdcActionType.MoveDisks); liveMigrateDisksParameters.setSessionId(getParameters().getSessionId()); liveMigrateDisksParametersList.add(liveMigrateDisksParameters); } return liveMigrateDisksParametersList; }
Source:
<code>public void onConnectionWrapped(ConnectionInformation connectionInformation) { final Metric2Registry metricRegistry = corePlugin.getMetricRegistry(); final TraceContext traceContext = TracingUtils.getTraceContext(); if (connectionInformation.getDataSource() instanceof DataSource && corePlugin.isInitialized() && !traceContext.isEmpty()) { final Span span = traceContext.getCurrentSpan(); DataSource dataSource = (DataSource) connectionInformation.getDataSource(); ensureUrlExistsForDataSource(dataSource, connectionInformation.getConnection()); MetaData metaData = dataSourceUrlMap.get(dataSource); metricRegistry.timer(getConnectionTemplate.build(metaData.serviceName)).update(connectionInformation.getTimeToGetConnectionNs(), TimeUnit.NANOSECONDS); <START> span.setTag("connection_wait_time_ms", connectionInformation.getTimeToGetConnectionNs() / 1000.0D); <END> } }</code><technical_language>if multiple connection request</technical_language>

Target:
public void onConnectionWrapped(ConnectionInformation connectionInformation) { final Metric2Registry metricRegistry = corePlugin.getMetricRegistry(); if (connectionInformation.getDataSource() instanceof DataSource && corePlugin.isInitialized()) { DataSource dataSource = (DataSource) connectionInformation.getDataSource(); ensureUrlExistsForDataSource(dataSource, connectionInformation.getConnection()); MetaData metaData = dataSourceUrlMap.get(dataSource); metricRegistry.timer(getConnectionTemplate.build(metaData.serviceName)).update(connectionInformation.getTimeToGetConnectionNs(), TimeUnit.NANOSECONDS); final Span span = TracingPlugin.getCurrentSpan(); final Long connectionWrappedCountSum = incrementAndGetContextValue(span, CONNECTION_WRAPPED_COUNT_ATTRIBUTE, 1L); span.setTag("jdbc_get_connection_count", connectionWrappedCountSum); final double timeToGetConnectionMs = connectionInformation.getTimeToGetConnectionNs() / MILLISECOND_IN_NANOS; final Double connectionWaitTimeMsSum = incrementAndGetContextValue(span, TIME_TO_GET_CONNECTION_MS_ATTRIBUTE, timeToGetConnectionMs); span.setTag("jdbc_connection_wait_time_ms", connectionWaitTimeMsSum); } }
Source:
<code>public boolean allowsReferenceCallback() { <START> return !isNonDestructive(); <END> }</code><technical_language>? change. internal field allows access field reference7</technical_language>

Target:
public boolean allowsReferenceCallback() { return !nonDestructive; }
Source:
<code>private <U> void doEmit(SubscriptionQueryMessage<?, ?, ?> query, FluxSinkWrapper<?> updateHandler, SubscriptionQueryUpdateMessage<U> update) { MessageMonitor.MonitorCallback monitorCallback = updateMessageMonitor.onMessageIngested(update); try { ((FluxSinkWrapper<SubscriptionQueryUpdateMessage<U>>) updateHandler).next(update); monitorCallback.reportSuccess(); } catch (Exception e) { logger.error(format( <START> "An error happened while trying to emit an update to a query: %s.", <END> query), e); monitorCallback.reportFailure(e); updateHandlers.remove(query); updateHandler.error(e); } }</code><technical_language>nice inform people update handler removed entirely, expect updates this</technical_language>

Target:
private <U> void doEmit(SubscriptionQueryMessage<?, ?, ?> query, FluxSinkWrapper<?> updateHandler, SubscriptionQueryUpdateMessage<U> update) { MessageMonitor.MonitorCallback monitorCallback = updateMessageMonitor.onMessageIngested(update); try { ((FluxSinkWrapper<SubscriptionQueryUpdateMessage<U>>) updateHandler).next(update); monitorCallback.reportSuccess(); } catch (Exception e) { logger.info("An error occurred while trying to emit an update to a query '{}'. " + "The subscription will be cancelled. Exception summary: {}", query.getQueryName(), e.toString(), logger.isDebugEnabled() ? e : ""); monitorCallback.reportFailure(e); updateHandlers.remove(query); emitError(query, e, updateHandler); } }
Source:
<code>public Object getProperty(String key, Object defaultValue) { Object value = null; <START> String prefix = Environment.calculatePrefix(this.prefix, this.id); <END> if (StringUtils.isNotEmpty(prefix)) { value = getInternalProperty(prefix + key); } if (value == null) { value = super.getProperty(key, defaultValue); } return value; }</code><technical_language>I caculatePrefix previous snippet possibly try 2 times in case id empty. new logic applies, try prefix returned in caculatePrefix</technical_language>

Target:
public Object getProperty(String key, Object defaultValue) { Object value = null; if (StringUtils.isNotEmpty(prefix) && StringUtils.isNotEmpty(id)) { value = getInternalProperty(prefix + id + "." + key); } if (value == null && StringUtils.isNotEmpty(prefix)) { value = getInternalProperty(prefix + key); } if (value == null) { value = super.getProperty(key, defaultValue); } return value; }
Source:
<code>public static void renderItemLayerPre(ItemStack stack, int index) { MinecraftForge.EVENT_BUS.post(new RenderItemLayerEvent.Pre(stack, index, currentTransformType)); <START> Tessellator.getInstance().getBuffer().begin(7, DefaultVertexFormats.ITEM); <END> }</code><technical_language>constant GL11.GL_QUADS instead of 7 reading code means</technical_language>

Target:
public static void renderItemLayerPre(ItemStack stack, int index) { if (!isItemInGui && stack.getItem().shouldRenderFullbright(stack, index == -1 ? 0 : index)) { Minecraft.getMinecraft().entityRenderer.disableLightmap(); GlStateManager.disableLighting(); } Tessellator.getInstance().getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM); }
Source:
<code>private void attachAccessibilityDelegateOnBind(ViewHolder holder) { if (isAccessibilityEnabled()) { final View itemView = holder.itemView; if (ViewCompat.getImportantForAccessibility(itemView) == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) { ViewCompat.setImportantForAccessibility(itemView, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); } AccessibilityDelegateCompat delegate = ViewCompat.getAccessibilityDelegate(itemView); if (delegate == null || <START> delegate.isDefaultOrEmptyAccessibilityDelegateCompat()) { <END> holder.addFlags(ViewHolder.FLAG_SET_A11Y_ITEM_DELEGATE); ViewCompat.setAccessibilityDelegate(itemView, mAccessibilityDelegate.getItemDelegate()); } } }</code><technical_language>need add hidden API AccessibilityDelegateCompat replace this line with: delegate.getClass().equals(AccessibilityDelegateCompat.class. arbtration mOriginalDelegate matter here. I wrong</technical_language>

Target:
private void attachAccessibilityDelegateOnBind(ViewHolder holder) { if (isAccessibilityEnabled()) { final View itemView = holder.itemView; if (ViewCompat.getImportantForAccessibility(itemView) == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) { ViewCompat.setImportantForAccessibility(itemView, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); } AccessibilityDelegateCompat delegate = ViewCompat.getAccessibilityDelegate(itemView); if (delegate == null || delegate.getClass().equals(AccessibilityDelegateCompat.class)) { holder.addFlags(ViewHolder.FLAG_SET_A11Y_ITEM_DELEGATE); ViewCompat.setAccessibilityDelegate(itemView, mAccessibilityDelegate.getItemDelegate()); } } }
Source:
<code>public static String normalizeVariableName(String name) { <START> if (normalizationCache.containsKey(name)){ <END> return normalizationCache.get(name); } String normalized = SPACES_PATTERN.matcher( name.trim() ).replaceAll( " " ); normalizationCache.put(name, normalized); return normalized; }</code><technical_language>caching result of application of a regular expression a String here? good reason do this, demonstrate a benchmark, this a bad idea</technical_language>

Target:
public static String normalizeVariableName(String name) { return SPACES_PATTERN.matcher( name.trim() ).replaceAll( " " ); }
Source:
<code>protected void verifyCheckedState() { IDebugTarget[] targets= getDebugTargets(); IDebugTarget target; IThread[] threads; boolean checkedThread; for (IDebugTarget <START> target2 : <END> targets) { target= target2; if (!fThreadViewer.getChecked(target)) { continue; } try { threads= target.getThreads(); } catch (DebugException exception) { JDIDebugUIPlugin.log(exception); continue; } checkedThread= false; for (IThread thread : threads) { if (fThreadViewer.getChecked(thread)) { checkedThread= true; break; } } if (checkedThread) { fPage.setErrorMessage(null); } else { fPage.setErrorMessage(PropertyPageMessages.ThreadFilterEditor_2); } } }</code><technical_language>rename debugTarget</technical_language>

Target:
protected void verifyCheckedState() { IDebugTarget[] targets= getDebugTargets(); IDebugTarget target; IThread[] threads; boolean checkedThread; for (IDebugTarget debugTarget : targets) { target= debugTarget; if (!fThreadViewer.getChecked(target)) { continue; } try { threads= target.getThreads(); } catch (DebugException exception) { JDIDebugUIPlugin.log(exception); continue; } checkedThread= false; for (IThread thread : threads) { if (fThreadViewer.getChecked(thread)) { checkedThread= true; break; } } if (checkedThread) { fPage.setErrorMessage(null); } else { fPage.setErrorMessage(PropertyPageMessages.ThreadFilterEditor_2); } } }
Source:
<code>private VmDevice createMemoryDevice() { Map<String, Object> specParams = new HashMap<>(); Guid guid = Guid.newGuid(); String alias = FeatureSupported.isDomainXMLSupported(getVm().getClusterCompatibilityVersion()) ? <START> String.format("ua-%s", <END> guid.toString()) : ""; specParams.put(DEVICE_SIZE_FIELD_KEY, String.valueOf(getParameters().getMemoryDeviceSizeMb())); specParams.put(DEVICE_NODE_FIELD_KEY, String.valueOf(getParameters().getNumaNode())); return new VmDevice(new VmDeviceId(guid, getVmId()), VmDeviceGeneralType.MEMORY, VmDeviceType.MEMORY.getName(), "", specParams, true, true, false, alias, null, null, null); }</code><technical_language>DomainXmlUtils#USER_ALIAS_PREFIX instead? (just for consistency)</technical_language>

Target:
private VmDevice createMemoryDevice() { Map<String, Object> specParams = new HashMap<>(); Guid guid = Guid.newGuid(); String alias = FeatureSupported.isDomainXMLSupported(getVm().getClusterCompatibilityVersion()) ? String.format("%s%s", DomainXmlUtils.USER_ALIAS_PREFIX, guid) : ""; specParams.put(DEVICE_SIZE_FIELD_KEY, String.valueOf(getParameters().getMemoryDeviceSizeMb())); specParams.put(DEVICE_NODE_FIELD_KEY, String.valueOf(getParameters().getNumaNode())); return new VmDevice(new VmDeviceId(guid, getVmId()), VmDeviceGeneralType.MEMORY, VmDeviceType.MEMORY.getName(), "", specParams, true, true, false, alias, null, null, null); }
Source:
<code>public E next() { <START> I id = index.next(); <END> final Optional<E> loaded = repository.load(id); if (!loaded.isPresent()) { final String idStr = idToString(id); final String errMsg = format("Unable to load entity with ID: %s", idStr); throw new IllegalStateException(errMsg); } final E entity = loaded.get(); return entity; }</code><technical_language>final</technical_language>

Target:
public E next() { final I id = index.next(); final Optional<E> loaded = repository.load(id); if (!loaded.isPresent()) { final String idStr = idToString(id); final String errMsg = format("Unable to load entity with ID: %s", idStr); throw new IllegalStateException(errMsg); } final E entity = loaded.get(); return entity; }
Source:
<code>private int findWordStartingWithAny(String[] words, String ... wordStart) { for (int i=0; i<words.length; ++i) { for (int j=0; j<wordStart.length; ++j) { if (words[i].startsWith(wordStart[j])) { return i; } <START> } <END> } return -1; }</code><technical_language>loop is StringUtils.startsWithAny</technical_language>

Target:
private int findWordStartingWithAny(String[] words, String ... wordStart) { for (int i=0; i<words.length; ++i) { if (StringUtils.startsWithAny(words[i], wordStart)) { return i; } } return -1; }
Source:
<code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String queryString = request.getQueryString(); if (StringUtils.isNotEmpty(queryString)) { if (url.indexOf("?") == -1) { url += "?"; } else { url += "&"; } url += queryString; } <START> response.sendRedirect(response.encodeRedirectURL(url)); <END> }</code><technical_language>I encode query string, result is double encode</technical_language>

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String queryString = request.getQueryString(); if (StringUtils.isNotEmpty(queryString)) { if (url.indexOf("?") == -1) { url += "?"; } else { url += "&"; } url += queryString; } response.sendRedirect(url); }
Source:
<code>private boolean isRepresentationDeletion(Notification notification) { boolean representationDeleted = false; if (notification.getFeature() == ViewpointPackage.Literals.DVIEW__OWNED_REPRESENTATIONS) { int eventType = notification.getEventType(); if (eventType == Notification.REMOVE || eventType == Notification.UNSET || eventType == Notification.REMOVE_MANY) { representationDeleted = isInOldValue(notification, dRepresentation) && <START> !(dRepresentation.eContainer().eContainer() instanceof <END> DView); } } else if (notification.getFeature() == ViewpointPackage.Literals.DANALYSIS__OWNED_VIEWS) { int eventType = notification.getEventType(); if (eventType == Notification.REMOVE || eventType == Notification.UNSET || eventType == Notification.REMOVE_MANY) { representationDeleted = isInOldValue(notification, dRepresentation.eContainer()) && !(dRepresentation.eContainer() != null && dRepresentation.eContainer().eContainer() instanceof DView); } } return representationDeleted; }</code><technical_language>check if eContainer() call return null</technical_language>

Target:
private boolean isRepresentationDeletion(Notification notification) { boolean representationDeleted = false; if (notification.getFeature() == ViewpointPackage.Literals.DVIEW__OWNED_REPRESENTATIONS && isCurrentDRepresentationRemove(notification, dRepresentation)) { representationDeleted = !(dRepresentation.eContainer() instanceof DView); } else if (notification.getFeature() == ViewpointPackage.Literals.DANALYSIS__OWNED_VIEWS && isCurrentDRepresentationRemove(notification, dRepresentation.eContainer())) { representationDeleted = dRepresentation.eContainer() == null || !(dRepresentation.eContainer() != null && dRepresentation.eContainer().eContainer() instanceof DView); } return representationDeleted; }
Source:
<code>public List<Object> configurations() { <START> return Collections.singletonList(new TooManyLinesInFunctionCheck.Config(max)); <END> }</code><technical_language>here, remove TooManyLinesInFunctionCheck</technical_language>

Target:
public List<Object> configurations() { return Collections.singletonList(new Config(max)); }
Source:
<code>public static String typeStringFromParseSpec(ParseSpec parseSpec) { StringBuilder builder = new StringBuilder("struct<"); builder.append(parseSpec.getTimestampSpec()).append(":string"); if (parseSpec.getDimensionsSpec().getDimensionNames().size() > 0) { builder.append(","); <START> builder.append(StringUtils.join(parseSpec.getDimensionsSpec().getDimensionNames(), ":string,")).append(":string"); <END> } builder.append(">"); return builder.toString(); }</code><technical_language>do need append ":string"</technical_language>

Target:
public static String typeStringFromParseSpec(ParseSpec parseSpec) { StringBuilder builder = new StringBuilder("struct<"); builder.append(parseSpec.getTimestampSpec().getTimestampColumn()).append(":string"); if (parseSpec.getDimensionsSpec().getDimensionNames().size() > 0) { builder.append(","); builder.append(StringUtils.join(parseSpec.getDimensionsSpec().getDimensionNames(), ":string,")).append(":string"); } builder.append(">"); return builder.toString(); }
Source:
<code>public void testClassCastException() { Thread thread = new Thread(() -> { editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), DESC_NAME, REPRESENTATION_NAME, DDiagram.class); }); thread.start(); bot.waitUntil(Conditions.shellIsActive("Refresh the diagram")); <START> bot.activeShell().bot().button("OK").click(); <END> bot.waitUntil(new DefaultCondition() { @Override public boolean test() throws Exception { return editor != null && editor.isDirty() && editor.getTitle().equals(REPRESENTATION_NAME); } @Override public String getFailureMessage() { return "The editor should be opened and dirty."; } }); }</code><technical_language>check label of shell</technical_language>

Target:
public void testClassCastException() { changeSiriusUIPreference(SiriusUIPreferencesKeys.PREF_REFRESH_ON_REPRESENTATION_OPENING.name(), false); Thread thread = new Thread(() -> { editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), DESC_NAME, REPRESENTATION_NAME, DDiagram.class); }); thread.start(); bot.waitUntil(Conditions.shellIsActive("Refresh the diagram")); bot.activeShell().bot().button("OK").click(); bot.waitUntil(new DefaultCondition() { @Override public boolean test() throws Exception { return editor != null && editor.isDirty() && editor.getTitle().equals(REPRESENTATION_NAME); } @Override public String getFailureMessage() { return "The editor should be opened and dirty."; } }); }
Source:
<code>public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { <START> if ("project".equals(qName)) { <END> projects.add(new Project(attributes.getValue("name"), attributes.getValue("path"))); } else if ("remote".equals(qName)) { remotes.put(attributes.getValue("name"), attributes.getValue("fetch")); } else if ("default".equals(qName)) { defaultRemote = attributes.getValue("remote"); } else if ("copyfile".equals(qName)) { } }</code><technical_language>braces singe line blocks</technical_language>

Target:
public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { if ("project".equals(qName)) projects.add(new Project(attributes.getValue("name"), attributes.getValue("path"))); else if ("remote".equals(qName)) remotes.put(attributes.getValue("name"), attributes.getValue("fetch")); else if ("default".equals(qName)) defaultRemote = attributes.getValue("remote"); else if ("copyfile".equals(qName)) { } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mUploadButton = findViewById(R.id.upload_key_action_upload); mKeyServerSpinner = (Spinner) findViewById(R.id.upload_key_keyserver); mMultiUserIdsFragment = (MultiUserIdsFragment) getSupportFragmentManager().findFragmentById(R.id.multi_user_ids_fragment); mMultiUserIdsFragment.setCheckboxVisibility(false); ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Preferences.getPreferences(this) .getKeyServers() ); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mKeyServerSpinner.setAdapter(adapter); if (adapter.getCount() > 0) { mKeyServerSpinner.setSelection(0); } else { mUploadButton.setEnabled(false); } mUploadButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { uploadKey(); } }); mDataUri = getIntent().getData(); if (mDataUri == null) { Log.e(Constants.TAG, "Intent data missing. Should be Uri of key!"); finish(); return; } <START> <END> }</code><technical_language>this removed</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mUploadButton = findViewById(R.id.upload_key_action_upload); mKeyServerSpinner = (Spinner) findViewById(R.id.upload_key_keyserver); MultiUserIdsFragment mMultiUserIdsFragment = (MultiUserIdsFragment) getSupportFragmentManager().findFragmentById(R.id.multi_user_ids_fragment); mMultiUserIdsFragment.setCheckboxVisibility(false); ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, Preferences.getPreferences(this) .getKeyServers() ); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mKeyServerSpinner.setAdapter(adapter); if (adapter.getCount() > 0) { mKeyServerSpinner.setSelection(0); } else { mUploadButton.setEnabled(false); } mUploadButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { uploadKey(); } }); mDataUri = getIntent().getData(); if (mDataUri == null) { Log.e(Constants.TAG, "Intent data missing. Should be Uri of key!"); finish(); return; } }
Source:
<code>public void patchNotOwnMetadataByNonAdminUser() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .withPassword(password) .build(); EPerson ePerson2 = EPersonBuilder.createEPerson(context) .withNameInMetadata("Jane", "Smith") .withEmail("Janesmith@fake-email.com") .withPassword(password) .build(); String newName = "JohnReplace"; context.restoreAuthSystemState(); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/metadata/eperson.firstname", newName); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(ePerson2.getEmail(), password); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isForbidden()); <START> } <END></code><technical_language>please verify changes applied</technical_language>

Target:
public void patchNotOwnMetadataByNonAdminUser() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@example.com") .withPassword(password) .build(); EPerson ePerson2 = EPersonBuilder.createEPerson(context) .withNameInMetadata("Jane", "Smith") .withEmail("Janesmith@example.com") .withPassword(password) .build(); String newName = "JohnReplace"; context.restoreAuthSystemState(); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/metadata/eperson.firstname", newName); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token2 = getAuthToken(ePerson2.getEmail(), password); String token = getAuthToken(ePerson.getEmail(), password); getClient(token2).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isForbidden()); getClient(token).perform(get("/api/eperson/epersons/" + ePerson.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", hasJsonPath("$.metadata", allOf( matchMetadata("eperson.firstname", "John"))))); }
Source:
<code>private static void deleteDirectory(File file) { if (file.isDirectory()) for (File subFile : file.listFiles()) { deleteDirectory(subFile); } <START> file.delete(); <END> }</code><technical_language>useful if i file deleted for reason. add Logcat error</technical_language>

Target:
private static void deleteDirectory(File file) { if (file.isDirectory()) for (File subFile : file.listFiles()) { deleteDirectory(subFile); } if (!file.delete()) { Log.e(TAG, "Failed to delete file: " + file.getPath()); } }
Source:
<code>private static Properties loadProperties() { <START> Path path = Paths.get(System.getProperty("user.home"), "cosmos-v4.properties"); <END> Properties properties = new Properties(System.getProperties()); if (Files.exists(path)) { try (InputStream in = Files.newInputStream(path)) { properties.load(in); } catch (Exception e) { logger.error("loading properties failed", path, e); } } return properties; }</code><technical_language>default file cosmos-v4.properties in project directory , dev need change instead of creating new in local</technical_language>

Target:
private static Properties loadProperties() { Path root = FileSystems.getDefault().getPath("").toAbsolutePath(); Path propertiesInProject = Paths.get(root.toString(),"../cosmos-v4.properties"); Properties props = loadFromPathIfExists(propertiesInProject); if (props != null) { return props; } Path propertiesInUserHome = Paths.get(System.getProperty("user.home"), "cosmos-v4.properties"); props = loadFromPathIfExists(propertiesInUserHome); if (props != null) { return props; } return System.getProperties(); }
Source:
<code>public Registration next() { try (Jedis j = pool.getResource()) { <START> if (!hasNext()) { <END> throw new NoSuchElementException(); } return scanResult.remove(0); } }</code><technical_language>This try (Jedis j = pool.getResource()){} useful</technical_language>

Target:
public Registration next() { if (!hasNext()) { throw new NoSuchElementException(); } return scanResult.remove(0); }
Source:
<code><START> protected int <END> findDefaultTrafficStatsTag(String url) { if (url != null && !TextUtils.isEmpty(url)) { Uri uri = Uri.parse(url); if (uri != null) { String host = uri.getHost(); if (host != null) { return host.hashCode(); } } } return 0; }</code><technical_language>private, static</technical_language>

Target:
private static int findDefaultTrafficStatsTag(String url) { if (!TextUtils.isEmpty(url)) { Uri uri = Uri.parse(url); if (uri != null) { String host = uri.getHost(); if (host != null) { return host.hashCode(); } } } return 0; }
Source:
<code>public static String ConvertToStandardDuration(Long timeInMilliseconds){ <START> return timeInMilliseconds !=null? String.format("%dm:%ds:%dms", <END> timeInMilliseconds / 60000, timeInMilliseconds / 1000, timeInMilliseconds % 1000) : ""; }</code><technical_language>need for m,s,ms. 0:23:132 is good enough. show 10-20 seconds in orange 20-60 in red? e.g. 0:23:132 in red</technical_language>

Target:
public static String ConvertToStandardDuration(Long timeInMilliseconds){ return timeInMilliseconds !=null? String.format("%d:%d:%d", timeInMilliseconds / 60000, timeInMilliseconds / 1000, timeInMilliseconds % 1000) : ""; }
Source:
<code>public boolean isLoaded() { <START> return gpxFile.modifiedTime != 0; <END> }</code><technical_language>1 if is used. 0 is system time</technical_language>

Target:
public boolean isLoaded() { return gpxFile.modifiedTime != -1; }
Source:
<code>protected MutableBoundedValue<Integer> constructValue(Integer defaultValue) { return SpongeValueBuilder.boundedBuilder(Keys.PASSED_BURN_TIME) .minimum(0) <START> .maximum(1000) END> .defaultValue(defaultValue) .build(); }</code><technical_language>This is correct - 1000 in contexts this, access actual furnace</technical_language>

Target:
protected MutableBoundedValue<Integer> constructValue(Integer defaultValue) { return SpongeValueBuilder.boundedBuilder(Keys.PASSED_BURN_TIME) .minimum(0) .maximum(1600) .defaultValue(defaultValue) .build(); }
Source:
<code>public static List<GerritProject> fetch(String gerritTriggerConfigUrl, String serverName) throws IOException, ParseException { <START> URL url = new URL(gerritTriggerConfigUrl); <END> URLConnection connection = url.openConnection(); connection.setReadTimeout(SOCKET_READ_TIMEOUT); connection.setDoInput(true); InputStream instream = null; BufferedReader reader = null; try { instream = connection.getInputStream(); reader = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); return readAndParseTriggerConfig(reader, serverName); } finally { if (reader != null) { reader.close(); } else if (instream != null) { instream.close(); } } }</code><technical_language>I reason remove this, another MalformedURLException thrown URL constructor a more cryptic message</technical_language>

Target:
public static List<GerritProject> fetch(String gerritTriggerConfigUrl, String serverName) throws IOException, ParseException { if (gerritTriggerConfigUrl == null) { throw new MalformedURLException("The gerritTriggerConfigUrl is null"); } if (gerritTriggerConfigUrl.isEmpty()) { throw new MalformedURLException("The gerritTriggerConfigUrl is empty"); } URL url = new URL(gerritTriggerConfigUrl); URLConnection connection = url.openConnection(); connection.setReadTimeout(SOCKET_READ_TIMEOUT); connection.setDoInput(true); InputStream instream = null; BufferedReader reader = null; try { instream = connection.getInputStream(); reader = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); return readAndParseTriggerConfig(reader, serverName); } finally { if (reader != null) { reader.close(); } else if (instream != null) { instream.close(); } } }
Source:
<code>private Connection<CL> getConnection(BaseOperation<CL, ?> op, Long token, int duration, TimeUnit unit) throws NoAvailableHostsException, PoolExhaustedException { HostConnectionPool<CL> hostPool = null; DynoConnectException lastEx = null; boolean useFallback = false; try { hostPool = (op != null) ? localSelector.getPoolForOperation(op) : localSelector.getPoolForToken(token); useFallback = !isConnectionPoolActive(hostPool); } catch (NoAvailableHostsException e) { lastEx = e; useFallback = true; } if (!useFallback) { try { return hostPool.borrowConnection(duration, unit); } catch (DynoConnectException e) { <START> if (e instanceof PoolExhaustedException && replicationFactor.get() == 3) { <END> throw e; } lastEx = e; cpMonitor.incOperationFailure(null, e); useFallback = true; } } if (useFallback && cpConfig.getMaxFailoverCount() > 0) { cpMonitor.incFailover(null, null); int numRemotes = remoteDCNames.getEntireList().size(); if (numRemotes == 0) { if (lastEx != null) { cpMonitor.incOperationFailure(null,lastEx); throw lastEx; } else { PoolOfflineException poe = new PoolOfflineException(hostPool.getHost(), "host pool is offline and no Racks available for fallback"); cpMonitor.incOperationFailure(null, poe); throw poe; } } else { hostPool = getFallbackHostPool(op, token); } } else if (useFallback && cpConfig.getMaxFailoverCount() == 0) { cpMonitor.incOperationFailure(null, lastEx); } if (hostPool == null) { throw new NoAvailableHostsException("Found no hosts when using fallback Rack"); } return hostPool.borrowConnection(duration, unit); }</code><technical_language>is 3 here? if RF = 2 5</technical_language>

Target:
private Connection<CL> getConnection(BaseOperation<CL, ?> op, Long token, int duration, TimeUnit unit) throws NoAvailableHostsException, PoolExhaustedException { HostConnectionPool<CL> hostPool = null; DynoConnectException lastEx = null; boolean useFallback = false; try { hostPool = (op != null) ? localSelector.getPoolForOperation(op) : localSelector.getPoolForToken(token); useFallback = !isConnectionPoolActive(hostPool); } catch (NoAvailableHostsException e) { lastEx = e; useFallback = true; } if (!useFallback) { try { return hostPool.borrowConnection(duration, unit); } catch (DynoConnectException e) { if (e instanceof PoolExhaustedException) { throw e; } lastEx = e; cpMonitor.incOperationFailure(null, e); useFallback = true; } } if (useFallback && cpConfig.getMaxFailoverCount() > 0) { cpMonitor.incFailover(null, null); int numRemotes = remoteDCNames.getEntireList().size(); if (numRemotes == 0) { if (lastEx != null) { cpMonitor.incOperationFailure(null,lastEx); throw lastEx; } else { PoolOfflineException poe = new PoolOfflineException(hostPool.getHost(), "host pool is offline and no Racks available for fallback"); cpMonitor.incOperationFailure(null, poe); throw poe; } } else { hostPool = getFallbackHostPool(op, token); } } else if (useFallback && cpConfig.getMaxFailoverCount() == 0) { cpMonitor.incOperationFailure(null, lastEx); } if (hostPool == null) { throw new NoAvailableHostsException("Found no hosts when using fallback Rack"); } return hostPool.borrowConnection(duration, unit); }
Source:
<code>public void explains_when_constructor_cannot_be_found() { try { new ConstructorInstantiator(null).newInstance(SomeClass2.class); fail(); } catch (InstantiationException e) { assertThat(e).hasMessageContaining("Unable to create instance of 'SomeClass2'.\n" + <START> "Please ensure that it has a constructor that matches these arguments: []"); <END> } }</code><technical_language>I previous exception a bit clearer. logic presents cleaner exception cost of a bit of conditional complexity. In Mockito strive super clean exception messages users need - troubleshooting</technical_language>

Target:
public void explains_when_constructor_cannot_be_found() { try { new ConstructorInstantiator(false, new Object[0]).newInstance(SomeClass2.class); fail(); } catch (InstantiationException e) { assertThat(e).hasMessageContaining("Unable to create instance of 'SomeClass2'.\n" + "Please ensure that the target class has a 0-arg constructor."); } }
Source:
<code>public void provision( WorkspaceConfigImpl workspaceConfig, String environmentType, List<HasMetadata> toolObjects, Map<String, MachineConfigImpl> machines) throws DevfileException, DevfileRecipeFormatException { String defaultEnv = workspaceConfig.getDefaultEnv(); EnvironmentImpl environment = workspaceConfig.getEnvironments().get(defaultEnv); if (environment == null) { checkItemsHasUniqueKindToName(toolObjects); RecipeImpl recipe = new RecipeImpl(environmentType, YAML_CONTENT_TYPE, asYaml(toolObjects), null); String envName = "default"; EnvironmentImpl env = new EnvironmentImpl(recipe, emptyMap()); env.getMachines().putAll(machines); workspaceConfig.getEnvironments().put(envName, env); workspaceConfig.setDefaultEnv(envName); } else { RecipeImpl envRecipe = environment.getRecipe(); environment.getMachines().putAll(machines); if (OPENSHIFT_TOOL_TYPE.equals(environmentType) && KubernetesEnvironment.TYPE.equals(envRecipe.getType())) { envRecipe.setType(OpenShiftEnvironment.TYPE); } List<HasMetadata> envObjects = unmarshalDefaultEnvObjects(workspaceConfig); envObjects.addAll(toolObjects); <START> <END> envRecipe.setContent(asYaml(envObjects)); } }</code><technical_language>Is important if machine names conflict other</technical_language>

Target:
public void provision( WorkspaceConfigImpl workspaceConfig, String environmentType, List<HasMetadata> toolObjects, Map<String, MachineConfigImpl> machines) throws DevfileException, DevfileRecipeFormatException { String defaultEnv = workspaceConfig.getDefaultEnv(); EnvironmentImpl environment = workspaceConfig.getEnvironments().get(defaultEnv); if (environment == null) { checkItemsHasUniqueKindToName(toolObjects); RecipeImpl recipe = new RecipeImpl(environmentType, YAML_CONTENT_TYPE, asYaml(toolObjects), null); String envName = "default"; EnvironmentImpl env = new EnvironmentImpl(recipe, emptyMap()); env.getMachines().putAll(machines); workspaceConfig.getEnvironments().put(envName, env); workspaceConfig.setDefaultEnv(envName); } else { RecipeImpl envRecipe = environment.getRecipe(); for (Entry<String, MachineConfigImpl> machineEntry : machines.entrySet()) { if (environment.getMachines().put(machineEntry.getKey(), machineEntry.getValue()) != null) { throw new DevfileException( format("Environment already contains machine '%s'", machineEntry.getKey())); } } environment.getMachines().putAll(machines); if (OPENSHIFT_TOOL_TYPE.equals(environmentType) && KubernetesEnvironment.TYPE.equals(envRecipe.getType())) { envRecipe.setType(OpenShiftEnvironment.TYPE); } List<HasMetadata> envObjects = unmarshalObjects(envRecipe); envObjects.addAll(toolObjects); envRecipe.setContent(asYaml(envObjects)); } }
Source:
<code>public void onPageLoadComplete() { <START> editHandler.setPage(model.getPage()); <END> refreshView.setEnabled(true); refreshView.setRefreshing(false); requireActivity().invalidateOptionsMenu(); initPageScrollFunnel(); if (model.getReadingListPage() != null) { final ReadingListPage page = model.getReadingListPage(); final PageTitle title = model.getTitle(); disposables.add(Completable.fromAction(() -> { if (!TextUtils.equals(page.thumbUrl(), title.getThumbUrl()) || !TextUtils.equals(page.description(), title.getDescription())) { page.thumbUrl(title.getThumbUrl()); page.description(title.getDescription()); ReadingListDbHelper.instance().updatePage(page); } }).subscribeOn(Schedulers.io()).subscribe()); } if (!errorState) { setupToC(model, pageFragmentLoadState.isFirstPage()); editHandler.setPage(model.getPage()); webView.setVisibility(View.VISIBLE); } checkAndShowBookmarkOnboarding(); maybeShowAnnouncement(); }</code><technical_language>out is purged issue</technical_language>

Target:
public void onPageLoadComplete() { editHandler.setPage(model.getPage()); refreshView.setEnabled(true); refreshView.setRefreshing(false); requireActivity().invalidateOptionsMenu(); initPageScrollFunnel(); if (model.getReadingListPage() != null) { final ReadingListPage page = model.getReadingListPage(); final PageTitle title = model.getTitle(); disposables.add(Completable.fromAction(() -> { if (!TextUtils.equals(page.thumbUrl(), title.getThumbUrl()) || !TextUtils.equals(page.description(), title.getDescription())) { page.thumbUrl(title.getThumbUrl()); page.description(title.getDescription()); ReadingListDbHelper.instance().updatePage(page); } }).subscribeOn(Schedulers.io()).subscribe()); } if (!errorState) { setupToC(model, pageFragmentLoadState.isFirstPage()); editHandler.setPage(model.getPage()); webView.setVisibility(View.VISIBLE); } bridge.evaluate(JavaScriptActionHandler.getRevision(), revision -> this.revision = Long.parseLong(revision.replace("\"", ""))); checkAndShowBookmarkOnboarding(); maybeShowAnnouncement(); }
Source:
<code>public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View layout = inflater.inflate(R.layout.feeditem_pager_fragment, container, false); Toolbar toolbar = layout.findViewById(R.id.toolbar); toolbar.setTitle(""); ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar); feedItems = getArguments().getLongArray(ARG_FEEDITEMS); int feedItemPos = getArguments().getInt(ARG_FEEDITEM_POS); ViewPager2 pager = layout.findViewById(R.id.pager); int newId = ViewCompat.generateViewId(); pager.setId(newId); <START> pager.setAdapter(new ItemPagerAdapter(this)); <END> pager.setCurrentItem(feedItemPos); loadItem(feedItems[feedItemPos]); pager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { @Override public void onPageSelected(int position) { loadItem(feedItems[position]); } }); EventBus.getDefault().register(this); return layout; }</code><technical_language>clicking episode (not in list), I animation scrolling pages of other episodes. do that</technical_language>

Target:
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View layout = inflater.inflate(R.layout.feeditem_pager_fragment, container, false); Toolbar toolbar = layout.findViewById(R.id.toolbar); toolbar.setTitle(""); ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar); feedItems = getArguments().getLongArray(ARG_FEEDITEMS); int feedItemPos = getArguments().getInt(ARG_FEEDITEM_POS); ViewPager2 pager = layout.findViewById(R.id.pager); int newId = ViewCompat.generateViewId(); pager.setId(newId); pager.setAdapter(new ItemPagerAdapter(this)); pager.setCurrentItem(feedItemPos, false); loadItem(feedItems[feedItemPos]); pager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { @Override public void onPageSelected(int position) { loadItem(feedItems[position]); } }); EventBus.getDefault().register(this); return layout; }
Source:
<code>protected int compare(Number number) { if ( number instanceof Double ) { return NumberComparatorHelper.compare( (Double) number, maxValue, InfinityNumberComparatorHelper.GREATER_THAN ); } if ( number instanceof Float ) { return NumberComparatorHelper.compare( (Float) number, maxValue, InfinityNumberComparatorHelper.GREATER_THAN ); <START> } <END> return NumberComparatorHelper.compare( number, maxValue ); }</code><technical_language>Is a reason split this logic in two? I put in NumberComparatorHelper#compare(Number, long)</technical_language>

Target:
protected int compare(Number number) { return NumberComparatorHelper.compare( number, maxValue, InfinityNumberComparatorHelper.GREATER_THAN ); }
Source:
<code>public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; String fromPath = args[1]; String toPath = args[2]; Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); ForkJoinPool pool = new ForkJoinPool(50); long t1 = System.currentTimeMillis(); downloadTo(context, fromPath, Paths.get(toPath), props -> true, pool); long t2 = System.currentTimeMillis(); <START> LOG.info("Download took " + (t2-t1) + " mS"); <END> }</code><technical_language>This is designed a cmd line class, this System.out</technical_language>

Target:
public static void main(String[] args) throws Exception { Crypto crypto = Crypto.initJava(); NetworkAccess network = NetworkAccess.buildJava(new URL("<LINK_0>")).get(); String username = args[0]; String fromPath = args[1]; String toPath = args[2]; Console console = System.console(); String password = new String(console.readPassword("Enter password for " + username + ":")); UserContext context = UserContext.signIn(username, password, network, crypto).get(); ForkJoinPool pool = new ForkJoinPool(50); long t1 = System.currentTimeMillis(); downloadTo(context, fromPath, Paths.get(toPath), props -> true, pool); long t2 = System.currentTimeMillis(); System.out.println("Download took " + (t2-t1) + " mS"); }
Source:
<code>public CharSequence getHost() { <START> return host; <END> }</code><technical_language>check for wss://</technical_language>

Target:
public CharSequence getHost() { return uri.getHost(); }
Source:
<code>void valid() { try { int aaa = this.field; final int twelveletter = ++aaa; <START> final int id = -1; <END> } catch (final IllegalStateException ise) { throw ise; } catch (final IllegalArgumentException ex) { throw ex; } }</code><technical_language>@jrdalpra need negative test cases e.g. is allowed</technical_language>

Target:
void valid() { try { int aaa = this.field; int id = ++aaa; final int ise = 0; final int twelveletter = ++aaa + ++id; } catch (final IllegalStateException ise) { throw ise; } catch (final IllegalArgumentException ex) { throw ex; } }
Source:
<code>public void onClick(View v) { if (v.getId() == R.id.upload_files_btn_cancel) { setResult(RESULT_CANCELED); finish(); } <START> else if (v.getId() == R.id.upload_files_btn_upload) { <END> new CheckAvailableSpaceTask().execute(); } }</code><technical_language>Move this else if }</technical_language>

Target:
public void onClick(View v) { if (v.getId() == R.id.upload_files_btn_cancel) { setResult(RESULT_CANCELED); finish(); } else if (v.getId() == R.id.upload_files_btn_upload) { new CheckAvailableSpaceTask(null).execute(); } }
Source:
<code>private void appendRows(Map<Integer, Map<Integer, String>> rowsMap) { if (!rowsMap.isEmpty()) { <START> rowsMap.forEach((rowIndex, cellValueMap) -> { <END> model.insertRow(rowIndex, new ScenarioGridRow()); cellValueMap.forEach((columnIndex, cellValue) -> model.setCell(rowIndex, columnIndex, () -> new ScenarioGridCell(new ScenarioGridCellValue(cellValue)))); }); } }</code><technical_language>I forEach ensures is done if collection is empty. remove outer if</technical_language>

Target:
private void appendRows(Map<Integer, Map<Integer, String>> rowsMap) { rowsMap.forEach((rowIndex, cellValueMap) -> { model.insertRow(rowIndex, new ScenarioGridRow()); cellValueMap.forEach((columnIndex, cellValue) -> model.setCell(rowIndex, columnIndex, () -> new ScenarioGridCell(new ScenarioGridCellValue(cellValue)))); }); }
Source:
<code>private File createXmlFile(int numberOfTags, String fileName) throws Exception { init(false, temporaryFolder.getRoot()); File file = temporaryFolder.newFile(fileName); String simpleTag = "<tag1 attr=\"val1\">text</tag1>\n"; String xml = "<?xml version=\"1.0\"?><root>\n"; StringBuilder str = new StringBuilder(xml); <START> for (int i = 0; i < numberOfTags; i++) { <END> str.append(simpleTag); } str.append("</root>"); FileUtils.write(file, str.toString()); fs.add(createInputFile(file.getAbsolutePath())); return file; }</code><technical_language>nitpick: replace > IntStream.range(0, numberOfTags).forEach(i -> str.append(simpleTag));</technical_language>

Target:
private File createXmlFile(int numberOfTags, String fileName) throws IOException { File file = temporaryFolder.newFile(fileName); StringBuilder str = new StringBuilder("<?xml version=\"1.0\"?><root>\n"); IntStream.range(0, numberOfTags).forEach(iteration -> str.append("<tag1 attr=\"val1\">text</tag1>\n")); str.append("</root>"); FileUtils.write(file, str.toString()); return file; }
Source:
<code>public String buildZipFinishContext(VelocityPortlet portlet, Context context, RunData data, SessionState state) { logger.debug(this + ".buildZipFinishContext()"); context.put("tlang",trb); context.put ("collectionId", state.getAttribute (STATE_COLLECTION_ID) ); context.put ("collectionPath", state.getAttribute (STATE_COLLECTION_PATH)); List zipItems = (List) state.getAttribute(STATE_DELETE_SET); context.put ("zipItems", zipItems); if (RESOURCES_MODE_RESOURCES.equalsIgnoreCase((String) state.getAttribute(STATE_MODE_RESOURCES))) { <START> context.put("dropboxMode", Boolean.FALSE); <END> } else if (RESOURCES_MODE_DROPBOX.equalsIgnoreCase((String) state.getAttribute(STATE_MODE_RESOURCES))) { context.put("dropboxMode", Boolean.TRUE); } context.put("homeCollection", (String) state.getAttribute (STATE_HOME_COLLECTION_ID)); context.put("siteTitle", state.getAttribute(STATE_SITE_TITLE)); context.put ("resourceProperties", ContentHostingService.newResourceProperties ()); return TEMPLATE_ZIP_FINISH; }</code><technical_language>dropboxMode in template</technical_language>

Target:
public String buildZipFinishContext(VelocityPortlet portlet, Context context, RunData data, SessionState state) { logger.debug(this + ".buildZipFinishContext()"); context.put("tlang",trb); context.put ("collectionId", state.getAttribute (STATE_COLLECTION_ID) ); context.put ("collectionPath", state.getAttribute (STATE_COLLECTION_PATH)); List zipItems = (List) state.getAttribute(STATE_DELETE_SET); context.put ("zipItems", zipItems); context.put("homeCollection", state.getAttribute(STATE_HOME_COLLECTION_ID)); return TEMPLATE_ZIP_FINISH; }