auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testDefaultVaryHeader() { final Response clientResponse = ClientBuilder.newClient().target("http://localhost:" + RULE.getLocalPort() +"/test") .request() .header(ACCEPT_ENCODING, "gzip") .get(); System.out.println("RESPONSE=" + clientResponse); <START> System.out.println("HEADERS=" + clientResponse.getHeaders()); <END> assertThat(clientResponse.getHeaders().get(VARY)).isEqualTo(asList((Object)ACCEPT_ENCODING)); assertThat(clientResponse.getHeaders().get(CONTENT_ENCODING)).isEqualTo(asList((Object) "gzip")); }</code><technical_language>Please remove System.out.println statements</technical_language>

Target:
public void testDefaultVaryHeader() { final Response clientResponse = ClientBuilder.newClient().target("http://localhost:" + RULE.getLocalPort() +"/test") .request() .header(ACCEPT_ENCODING, "gzip") .get(); assertThat(clientResponse.getHeaders().get(VARY)).isEqualTo(asList((Object)ACCEPT_ENCODING)); assertThat(clientResponse.getHeaders().get(CONTENT_ENCODING)).isEqualTo(asList((Object) "gzip")); }
Source:
<code>public static BlobStoreControlAdminRequest readFrom(DataInputStream stream, AdminRequest adminRequest) throws IOException { short versionId = stream.readShort(); short numReplicasCaughtUpPerPartition; BlobStoreControlRequestType controlRequestType; switch (versionId) { case VERSION_V1: numReplicasCaughtUpPerPartition = stream.readShort(); controlRequestType = stream.readByte() == 1 ? BlobStoreControlRequestType.StartStore : BlobStoreControlRequestType.StopStore; break; <START> case VERSION_V2: <END> numReplicasCaughtUpPerPartition = stream.readShort(); controlRequestType = BlobStoreControlRequestType.values()[stream.readByte()]; break; default: throw new IllegalStateException("Unrecognized version for BlobStoreControlAdminRequest: " + versionId); } return new BlobStoreControlAdminRequest(numReplicasCaughtUpPerPartition, controlRequestType, adminRequest); }</code><technical_language>Is VERSION_V2 needed? BlobStoreControlRequestType.values()[stream.readByte()] fully cover VERSION_V1</technical_language>

Target:
public static BlobStoreControlAdminRequest readFrom(DataInputStream stream, AdminRequest adminRequest) throws IOException { Short versionId = stream.readShort(); if (!versionId.equals(VERSION_V1)) { throw new IllegalStateException("Unrecognized version for BlobStoreControlAdminRequest: " + versionId); } short numReplicasCaughtUpPerPartition = stream.readShort(); BlobStoreControlAction controlRequestType = BlobStoreControlAction.values()[stream.readByte()]; return new BlobStoreControlAdminRequest(numReplicasCaughtUpPerPartition, controlRequestType, adminRequest); }
Source:
<code>public List<CriticalComponent> getCriticalComponents() { <START> List<CriticalComponent> componentList = new ArrayList<CriticalComponent>(); <END> for (CriticalComponentImpl cci : this.criticalServiceList) { componentList.add(cci.getCriticalComponent()); } return componentList; }</code><technical_language>return unmodifiable view Collections.unmodifiableList</technical_language>

Target:
public List<CriticalComponent> getCriticalComponents() { List<CriticalComponent> componentList = new ArrayList<>(); for (CriticalComponentImpl cci : this.criticalComponentList) { componentList.add(cci.getCriticalComponent()); } return Collections.unmodifiableList(componentList); }
Source:
<code>private InitialContext getInitialContext(InitialContextLookupType lookupType, String nodeHostName) { final Hashtable<String, String> jndiProperties = new Hashtable<>(); <START> jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); <END> jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory"); if(nodeHostName.contains(":") && !nodeHostName.contains("[")) { nodeHostName = "[" + nodeHostName + "]"; } String lookupProviderUrl = "<see wildfly-config.xml>"; switch(lookupType) { case HTTP: lookupProviderUrl = String.format("http://%s:%s/wildfly-services", nodeHostName, node0Port); jndiProperties.put(Context.PROVIDER_URL, lookupProviderUrl); jndiProperties.put(Context.SECURITY_PRINCIPAL, "user1"); jndiProperties.put(Context.SECURITY_CREDENTIALS, "password1"); break; case REMOTE_HTTP: lookupProviderUrl = String.format("remote+http://%s:%s", nodeHostName, node0Port); jndiProperties.put(Context.PROVIDER_URL, lookupProviderUrl); break; case WILDFLY_CONFIG: default: log.debugf("Not using value '%s' of nodeHostName parameter, " + "wildfly-config.xml defines the URL on its own", nodeHostName); } try { return new InitialContext(jndiProperties); } catch (NamingException ne) { throw new IllegalStateException(String.format( "Cannot create InitialContext with url provider '%s'", lookupProviderUrl), ne); } }</code><technical_language>if this is necessary</technical_language>

Target:
private InitialContext getInitialContext(InitialContextLookupType lookupType, String nodeHostName) { final Hashtable<String, String> jndiProperties = new Hashtable<>(); jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory"); if(nodeHostName.contains(":") && !nodeHostName.contains("[")) { nodeHostName = "[" + nodeHostName + "]"; } String lookupProviderUrl = "<see wildfly-config.xml>"; switch(lookupType) { case HTTP: lookupProviderUrl = String.format("http://%s:%s/wildfly-services", nodeHostName, node0Port); jndiProperties.put(Context.PROVIDER_URL, lookupProviderUrl); jndiProperties.put(Context.SECURITY_PRINCIPAL, "user1"); jndiProperties.put(Context.SECURITY_CREDENTIALS, "password1"); break; case REMOTE_HTTP: lookupProviderUrl = String.format("remote+http://%s:%s", nodeHostName, node0Port); jndiProperties.put(Context.PROVIDER_URL, lookupProviderUrl); break; case WILDFLY_CONFIG: default: log.debugf("Not using value '%s' of nodeHostName parameter, " + "wildfly-config.xml defines the URL on its own", nodeHostName); } try { return new InitialContext(jndiProperties); } catch (NamingException ne) { throw new IllegalStateException(String.format( "Cannot create InitialContext with url provider '%s'", lookupProviderUrl), ne); } }
Source:
<code>private void initListeners() { loginValidatorWatcher = new LoginValidatorWatcher(mUrl, mUsername, mPassword, mDropdownLocation, mLoginButton); mUrl.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean b) { <START> if (StringUtils.notEmpty(mUrl.getText().toString()) && !view.isFocused() && loginValidatorWatcher.isUrlChanged() || (loginValidatorWatcher.isUrlChanged() && loginValidatorWatcher.isLocationErrorOccurred())) { <END> ((LoginFragment) getActivity() .getSupportFragmentManager() .findFragmentById(R.id.loginContentFrame)) .setUrl(mUrl.getText().toString()); loginValidatorWatcher.setUrlChanged(false); } } }); mLoginSyncSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(OpenMRS.getInstance()).edit(); editor.putBoolean("sync", isChecked); editor.commit(); } }); mLoginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mPresenter.login(mUsername.getText().toString(), mPassword.getText().toString(), mUrl.getText().toString(), initialUrl); } }); mForgotPass.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { forgotPassword(); } }); }</code><technical_language>cut this line fit in view ? extract this validation a separate method</technical_language>

Target:
private void initListeners() { mLoginSyncButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(OpenMRS.getInstance()); boolean syncState = prefs.getBoolean("sync", true); SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(OpenMRS.getInstance()).edit(); editor.putBoolean("sync", !syncState); editor.commit(); setSyncButtonState(!syncState); } }); loginValidatorWatcher = new LoginValidatorWatcher(mUrl, mUsername, mPassword, mDropdownLocation, mLoginButton); mUrl.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean b) { if (StringUtils.notEmpty(mUrl.getText().toString()) && !view.isFocused() && loginValidatorWatcher.isUrlChanged() || (loginValidatorWatcher.isUrlChanged() && loginValidatorWatcher.isLocationErrorOccurred())) { ((LoginFragment) getActivity() .getSupportFragmentManager() .findFragmentById(R.id.loginContentFrame)) .setUrl(mUrl.getText().toString()); loginValidatorWatcher.setUrlChanged(false); } } }); mLoginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mPresenter.login(mUsername.getText().toString(), mPassword.getText().toString(), mUrl.getText().toString(), initialUrl); } }); mForgotPass.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { forgotPassword(); } }); }
Source:
<code>private static void sendZipUsingMap(ZipOutputStream zos, VirtualFile dir, Map<String, VirtualFile> nameToVirtualFiles) throws IOException { for (Map.Entry<String, VirtualFile> entry : nameToVirtualFiles.entrySet()) { String n = entry.getKey(); <START> String relativePath; <END> relativePath = dir.getName() + '/' + n; VirtualFile f = entry.getValue(); sendOneZipEntry(zos, f, relativePath); } }</code><technical_language>join declaration assignment</technical_language>

Target:
private static void sendZipUsingMap(ZipOutputStream zos, VirtualFile dir, Map<String, VirtualFile> nameToVirtualFiles) throws IOException { for (Map.Entry<String, VirtualFile> entry : nameToVirtualFiles.entrySet()) { String n = entry.getKey(); String relativePath = dir.getName() + '/' + n; VirtualFile f = entry.getValue(); sendOneZipEntry(zos, f, relativePath); } }
Source:
<code>public void parse(InputStream in) throws IOException { BufferedReader br = asReader(in); String txt; while ((txt = br.readLine()) != null) { txt = txt.trim(); if (txt.length() > 0 && !txt.startsWith("#")) { <START> int patternEnd = txt.indexOf(' '); <END> if(txt.length() > patternEnd) rules.add(new AttributesRule(txt.substring(0, patternEnd), txt.substring(patternEnd + 1).trim())); } } }</code><technical_language>file name patterns space tab. tab is useful if them, if filename contains a space</technical_language>

Target:
public void parse(InputStream in) throws IOException { BufferedReader br = asReader(in); String txt; while ((txt = br.readLine()) != null) { txt = txt.trim(); if (txt.length() > 0 && !txt.startsWith("#")) { int patternEnd = txt.indexOf(' '); if (patternEnd > -1) rules.add(new AttributesRule(txt.substring(0, patternEnd), txt.substring(patternEnd + 1).trim())); } } }
Source:
<code>protected void onDestroy() { super.onDestroy(); if (getHierarchyTask != null) { getHierarchyTask.cancel(true); getHierarchyTask = null; } <START> isDestroyed = true; <END> }</code><technical_language>This field in either, removed</technical_language>

Target:
protected void onDestroy() { super.onDestroy(); if (getHierarchyTask != null) { getHierarchyTask.cancel(true); getHierarchyTask = null; } }
Source:
<code>public void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageGroupId())); Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); VDSReturnValue vdsReturnValue = null; try { <START> vdsReturnValue = runVdsCommand(VDSCommandType.DestroyImage, <END> createVDSParameters()); } catch (EngineException e) { log.error("Failed to delete image {}/{}. Retrying ...", getParameters().getImageGroupId(), getParameters().getImageList().stream().findFirst(), e); setSucceeded(true); setCommandStatus(CommandStatus.ACTIVE); return; } if (vdsReturnValue != null && vdsReturnValue.getCreationInfo() != null) { getParameters().setVdsmTaskIds(new ArrayList<>()); Guid result = createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId()); getReturnValue().getInternalVdsmTaskIdList().add(result); getReturnValue().getVdsmTaskIdList().add(result); getParameters().getVdsmTaskIds().add(result); setSucceeded(vdsReturnValue.getSucceeded()); setCommandStatus(CommandStatus.SUCCEEDED); log.info("Successfully started task to remove orphaned volumes resulting from live merge"); } }</code><technical_language>please format</technical_language>

Target:
public void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageGroupId())); Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand()); VDSReturnValue vdsReturnValue = null; try { vdsReturnValue = runVdsCommand(VDSCommandType.DestroyImage, createVDSParameters()); } catch (EngineException e) { log.error("Failed to delete image {}/{}", getParameters().getImageGroupId(), getParameters().getImageList().stream().findFirst(), e); } if (vdsReturnValue != null && vdsReturnValue.getCreationInfo() != null) { getParameters().setVdsmTaskIds(new ArrayList<>()); Guid result = createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId()); getReturnValue().getInternalVdsmTaskIdList().add(result); getReturnValue().getVdsmTaskIdList().add(result); getParameters().getVdsmTaskIds().add(result); setSucceeded(vdsReturnValue.getSucceeded()); setCommandStatus(CommandStatus.SUCCEEDED); log.info("Successfully started task to remove orphaned volumes resulting from live merge"); } else { log.info("Retrying deleting image {}/{}", getParameters().getImageGroupId(), getParameters().getImageList().stream().findFirst()); setSucceeded(true); setCommandStatus(CommandStatus.ACTIVE); } }
Source:
<code>protected CoverageAgendaListener createCoverageAgendaListenerWithData(Map<String, Integer> rulesToNumberOfTimes) { CoverageAgendaListener coverageAgendaListener = new CoverageAgendaListener(); for (Map.Entry<String, Integer> ruleToNumberOfTimes : rulesToNumberOfTimes.entrySet()) { BeforeMatchFiredEvent beforeMatchFiredEventMock = createBeforeMatchFiredEventMock(ruleToNumberOfTimes.getKey()); IntStream.range(0, ruleToNumberOfTimes.getValue()).forEach(i -> coverageAgendaListener.beforeMatchFired(beforeMatchFiredEventMock)); } <START> ; <END> return coverageAgendaListener; }</code><technical_language>Typo</technical_language>

Target:
protected CoverageAgendaListener createCoverageAgendaListenerWithData(Map<String, Integer> rulesToNumberOfTimes) { CoverageAgendaListener coverageAgendaListener = new CoverageAgendaListener(); for (Map.Entry<String, Integer> ruleToNumberOfTimes : rulesToNumberOfTimes.entrySet()) { BeforeMatchFiredEvent beforeMatchFiredEventMock = createBeforeMatchFiredEventMock(ruleToNumberOfTimes.getKey()); IntStream.range(0, ruleToNumberOfTimes.getValue()).forEach(i -> coverageAgendaListener.beforeMatchFired(beforeMatchFiredEventMock)); } return coverageAgendaListener; }
Source:
<code>public double[] getTagRatioOfHtml(String html) { html = html.replaceAll("(?s)<!--.*?-->", ""); html = html.replaceAll("(?s)<script.*?>.*?</script>", ""); html = html.replaceAll("(?s)<SCRIPT.*?>.*?</SCRIPT>", ""); html = html.replaceAll("(?s)<style.*?>.*?</style>", ""); try{ Parser p = new Parser(html); NodeList nl = p.parse(null); BufferedReader br = new BufferedReader(new StringReader(nl.toHtml())); int numLines = 0; while (br.readLine() != null) { numLines++; } br.close(); linkTagList = new double[numLines]; HashMap<String, String> metaTagsMap = new HashMap<String, String>(); String line; double threshold = 10; StringBuffer sb = new StringBuffer(); double tagRatio = 0.0; int count = 0; br = new BufferedReader(new StringReader(nl.toHtml())); for (int i = 0; i < linkTagList.length; i++) { line = br.readLine(); line = line.trim(); if (line.equals("")) { continue; } linkTagList[i] = computeTextToTagRatio(line); populateMetaTags(line, metaTagsMap); if(linkTagList[i] != 0 && linkTagList[i] >= threshold){ sb.append(line); sb.append("\n"); tagRatio += linkTagList[i]; count++; } } JSONObject obj = new JSONObject(); obj.put("avgTagRatio", (tagRatio/count)); obj.put("content", sb.toString()); JSONArray array = new JSONArray(); array.put(metaTagsMap); obj.put("meta-tags", array); br.close(); }catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParserException e) { e.printStackTrace(); return linkTagList; <START> } <END> return linkTagList; }</code><technical_language>readability improved making compact code, Checkout [multi-catch](<LINK_0></technical_language>

Target:
public double[] getTagRatioOfHtml(String html) throws MalformedURLException { html = html.replaceAll("(?s)<!--.*?-->", ""); html = html.replaceAll("(?s)<script.*?>.*?</script>", ""); html = html.replaceAll("(?s)<SCRIPT.*?>.*?</SCRIPT>", ""); html = html.replaceAll("(?s)<style.*?>.*?</style>", ""); try{ Parser p = new Parser(html); NodeList nl = p.parse(null); BufferedReader br = new BufferedReader(new StringReader(nl.toHtml())); int numLines = 0; while (br.readLine() != null) { numLines++; } br.close(); linkTagList = new double[numLines]; HashMap<String, String> metaTagsMap = new HashMap<String, String>(); String line; double threshold = 10; StringBuffer sb = new StringBuffer(); double tagRatio = 0.0; int count = 0; br = new BufferedReader(new StringReader(nl.toHtml())); for (int i = 0; i < linkTagList.length; i++) { line = br.readLine(); line = line.trim(); if (line.equals("")) { continue; } linkTagList[i] = computeTextToTagRatio(line); populateMetaTags(line, metaTagsMap); if(linkTagList[i] != 0 && linkTagList[i] >= threshold){ sb.append(line); sb.append("\n"); tagRatio += linkTagList[i]; count++; } } JSONObject obj = new JSONObject(); obj.put("avgTagRatio", (tagRatio/count)); obj.put("content", sb.toString()); JSONArray array = new JSONArray(); array.put(metaTagsMap); obj.put("meta-tags", array); br.close(); }catch (IOException|ParserException e) { e.printStackTrace(); } return linkTagList; }
Source:
<code>public void changePlotType(PlotPreferences.PlotType plotType) { try { <START> preferences.getSedPreferences(currentSed).getPlotPreferences().setPlotType(plotType); <END> env.setValue(PlotPreferences.X_LOG, preferences.getSedPreferences(currentSed).getPlotPreferences().getXlog()); env.setValue(PlotPreferences.Y_LOG, preferences.getSedPreferences(currentSed).getPlotPreferences().getYlog()); setupForPlotDisplayChange(); display = createPlotComponent(env, false); } catch (EnumConstantNotPresentException ex) { logger.log(Level.WARNING, ex.getMessage()); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } updatePlotDisplay(); }</code><technical_language>built in method for</technical_language>

Target:
public void changePlotType(PlotPreferences.PlotType plotType) { try { this.getPlotPreferences().setPlotType(plotType); reset(currentSed, DATA_MAY_CHANGE); } catch (EnumConstantNotPresentException ex) { logger.log(Level.WARNING, ex.getMessage()); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>private JsonNode mapDataObjectToInputColumnsByName(JsonNode item, List<ConfiguredPropertyDescriptor> inputColProperties) { JsonNodeFactory json = Serializator.getJacksonObjectMapper().getNodeFactory(); ArrayNode values = json.arrayNode(); ITER: for(ConfiguredPropertyDescriptor inputColPropDesc: inputColProperties) { JsonNode value = item.get(inputColPropDesc.getName()); if(value != null) { values.add(value); continue; } String[] aliases = inputColPropDesc.getAliases(); if(aliases != null) { for (String alias : aliases) { value = item.get(alias); if(value != null) { values.add(value); <START> continue ITER; <END> } } } values.add(json.nullNode()); } return values; }</code><technical_language>sorry, a "nope", a good reason a labeled continue. values.add(json.nullNode()); in else break? a sign a findAlias method a good idea</technical_language>

Target:
private JsonNode mapDataObjectToInputColumnsByName(JsonNode item, List<ConfiguredPropertyDescriptor> inputColProperties) { final JsonNodeFactory json = Serializator.getJacksonObjectMapper().getNodeFactory(); final ArrayNode values = json.arrayNode(); for (ConfiguredPropertyDescriptor inputColPropDesc: inputColProperties) { JsonNode value = findPropertyByColumnNameOrAlias(item, inputColPropDesc); if (value == null) { value = json.nullNode(); } values.add(value); } return values; }
Source:
<code>public String generateTOTPToken(String secretKey) throws TOTPException { long token = 0; byte[] secretkey; String encoding = "Base32"; try { encoding = TOTPUtil.getEncodingMethod(); <START> } catch (IdentityApplicationManagementException e) { <END> log.error("Error when fetching the encoding method"); } if ("Base32".equals(encoding)) { Base32 codec32 = new Base32(); secretkey = codec32.decode(secretKey); } else { Base64 code64 = new Base64(); secretkey = code64.decode(secretKey); } try { token = getCode(secretkey, getTimeIndex()); } catch (NoSuchAlgorithmException e) { throw new TOTPException("TOTPTokenGenerator can't find the configured hashing algorithm", e); } catch (InvalidKeyException e) { throw new TOTPException("Secret key is not valid", e); } return Long.toString(token); }</code><technical_language>Wrap exception</technical_language>

Target:
public String generateTOTPToken(String secretKey) throws TOTPException { long token = 0; byte[] secretkey; String encoding = "Base32"; try { encoding = TOTPUtil.getEncodingMethod(); } catch (IdentityApplicationManagementException e) { throw new TOTPException("Error when fetching the encoding method",e); } if ("Base32".equals(encoding)) { Base32 codec32 = new Base32(); secretkey = codec32.decode(secretKey); } else { Base64 code64 = new Base64(); secretkey = code64.decode(secretKey); } try { token = getCode(secretkey, getTimeIndex()); } catch (NoSuchAlgorithmException e) { throw new TOTPException("TOTPTokenGenerator can't find the configured hashing algorithm", e); } catch (InvalidKeyException e) { throw new TOTPException("Secret key is not valid", e); } return Long.toString(token); }
Source:
<code>private Diagram getGMFDiagram(Notification notification) { Diagram gmfDiagram = null; DDiagram dDiagram = null; Object notifier = notification.getNotifier(); if (notifier instanceof DDiagram) { dDiagram = (DDiagram) notifier; } else if (notifier instanceof DDiagramElement && ((EObject) notifier).eContainer() != null) { dDiagram = ((DDiagramElement) notifier).getParentDiagram(); } else if (notification.getOldValue() instanceof DDiagramElement) { DDiagramElement oldValue = (DDiagramElement) notification.getOldValue(); dDiagram = DDiagramElementSpecOperations.getParentDiagram(oldValue); } if (dDiagram != null && <START> dDiagram.eResource() != <END> null) { DiagramCreationUtil diagramCreationUtil = new DiagramCreationUtil(dDiagram); if (diagramCreationUtil.findAssociatedGMFDiagram()) { gmfDiagram = diagramCreationUtil.getAssociatedGMFDiagram(); } else { Resource diagramResource = dDiagram.eResource(); gmfDiagram = getDiagramFromResource(dDiagram, diagramResource); } } return gmfDiagram; }</code><technical_language>try compute resource once</technical_language>

Target:
private Diagram getGMFDiagram(Notification notification) { Diagram gmfDiagram = null; DDiagram dDiagram = null; Object notifier = notification.getNotifier(); if (notifier instanceof DDiagram) { dDiagram = (DDiagram) notifier; } else if (notifier instanceof DDiagramElement && ((EObject) notifier).eContainer() != null) { dDiagram = ((DDiagramElement) notifier).getParentDiagram(); } else if (notification.getOldValue() instanceof DDiagramElement) { DDiagramElement oldValue = (DDiagramElement) notification.getOldValue(); dDiagram = DDiagramElementSpecOperations.getParentDiagram(oldValue); } Resource diagramResource = dDiagram.eResource(); if (dDiagram != null && diagramResource != null) { DiagramCreationUtil diagramCreationUtil = new DiagramCreationUtil(dDiagram); if (diagramCreationUtil.findAssociatedGMFDiagram()) { gmfDiagram = diagramCreationUtil.getAssociatedGMFDiagram(); } else { gmfDiagram = getDiagramFromResource(dDiagram, diagramResource); } } return gmfDiagram; }
Source:
<code>public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, sessionName); ICommandResult result = executeCommand(command, monitor, false); List<String> errorOutput = result.getErrorOutput(); <START> if (isError(result) && (errorOutput.size() > 0)) { <END> if (ignoredPattern(errorOutput, LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { return; } throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + result.toString()); } Document doc = getDocumentFromStrings(result.getOutput()); NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); if (sessions.getLength() != 1) { throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); } Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); if (rawSessionName == null) { throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); } if (!rawSessionName.getTextContent().equals(sessionName)) { throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); } }</code><technical_language>isEmpty</technical_language>

Target:
public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException { List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, sessionName); ICommandResult result = executeCommand(command, monitor, false); List<String> errorOutput = result.getErrorOutput(); if (isError(result)) { if (ignoredPattern(errorOutput, LTTngControlServiceConstants.SESSION_NOT_FOUND_ERROR_PATTERN)) { return; } throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + result.toString()); } Document doc = getDocumentFromStrings(result.getOutput()); NodeList sessions = doc.getElementsByTagName(MIStrings.SESSION); if (sessions.getLength() != 1) { throw new ExecutionException(NLS.bind(Messages.TraceControl_MiInvalidNumberOfElementError, MIStrings.SESSION)); } Node rawSessionName = getFirstOf(sessions.item(0).getChildNodes(), MIStrings.NAME); if (rawSessionName == null) { throw new ExecutionException(Messages.TraceControl_MiMissingRequiredError); } if (!rawSessionName.getTextContent().equals(sessionName)) { throw new ExecutionException(NLS.bind(Messages.TraceControl_UnexpectedValueError, rawSessionName.getTextContent(), sessionName)); } }
Source:
<code>private void sleep() { try { <START> Thread.sleep(this.delay); <END> } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IllegalStateException(ex); } }</code><technical_language>@HDouss TimeUnit.MILLISECONDS.sleep(this.delay)? clear ms</technical_language>

Target:
private void sleep() { try { TimeUnit.MILLISECONDS.sleep(this.delay); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); throw new IllegalStateException( "Unexpected interruption while retrying to process request", ex ); } }
Source:
<code>public void testParseAndConstructUnifiedXmlFile(Path config) throws IOException { String[] parts = config.getFileName().toString().split("\\."); int major = Integer.parseInt(parts[0]); <START> int minor = Integer.parseInt(parts[1]); <END> withCacheManager(new CacheManagerCallable( TestCacheManagerFactory.fromXml(config.toString(), true, false, false)) { @Override public void call() { for(ParserVersionCheck check : ParserVersionCheck.values()) { if (check.isIncludedBy(major, minor)) { check.check(cm); } } } }); }</code><technical_language>check file for latest version exists</technical_language>

Target:
public void testParseAndConstructUnifiedXmlFile(Path config) throws IOException { String[] parts = config.getFileName().toString().split("\\."); int major = Integer.parseInt(parts[0]); int minor = Integer.parseInt(parts[1]); ParserRegistry parserRegistry = new ParserRegistry(Thread.currentThread().getContextClassLoader(), false); try (InputStream is = FileLookupFactory.newInstance().lookupFileStrict(config.toString(), Thread.currentThread().getContextClassLoader())) { ConfigurationBuilderHolder holder = parserRegistry.parse(is); for(ParserVersionCheck check : ParserVersionCheck.values()) { if (check.isIncludedBy(major, minor)) { check.check(holder); } } } }
Source:
<code>public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { { 0, "0" }, { 3, "3" }, { 975, "975" }, { 1000, "1 k" }, { 4000, "4 k" }, { -4000, "-4 k" }, { 4000L, "4 k" }, { 4000.0, "4 k" }, { 12345678, "12.3 M" }, { Integer.MAX_VALUE, "2.1 G" }, { Integer.MIN_VALUE, "-2.1 G" }, { Long.MAX_VALUE, "9223.4 P" }, { 98765432.123456, "98.8 M" }, { -98765432.123456, "-98.8 M" }, { 555555555555L, "555.6 G" }, { 555555555555555L, "555.6 T" }, { 100100000, "100.1 M" }, { 0.1, "100 m" }, { 0.001, "1 m" }, { 0.000001, "1 µ" }, { 0.000000001, "1 n" }, { 0.000000000001, "1 p" }, { -0.04, "-40 m" }, { 0.002, "2 m" }, { 0.0555, "55.5 m" }, { 0.0004928373928, "492.8 µ" }, { 0.000000251, "251 n"}, { 0.000000000043, "43 p"}, { 0.000000045643, "45.6 n"}, <START> { Double.MAX_VALUE, "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 P" }, <END> { Double.POSITIVE_INFINITY, "∞" }, { Double.MIN_NORMAL, "0" }, { Double.NEGATIVE_INFINITY, "-∞" }, { Double.NaN, "�" }, { Double.MIN_NORMAL, "0" }, }); }</code><technical_language>I love this</technical_language>

Target:
public static Iterable<Object[]> getParameters() { return Arrays.asList(new Object[][] { { 0, "0" }, { 3, "3" }, { 975, "975" }, { 1000, "1 k" }, { 4000, "4 k" }, { -4000, "-4 k" }, { 4000L, "4 k" }, { 4000.0, "4 k" }, { 12345678, "12.3 M" }, { Integer.MAX_VALUE, "2.1 G" }, { Integer.MIN_VALUE, "-2.1 G" }, { Long.MAX_VALUE, "9223.4 P" }, { 98765432.123456, "98.8 M" }, { -98765432.123456, "-98.8 M" }, { 555555555555L, "555.6 G" }, { 555555555555555L, "555.6 T" }, { 100100000, "100.1 M" }, { 0.1, "100 m" }, { 0.001, "1 m" }, { 0.000001, "1 µ" }, { 0.000000001, "1 n" }, { 0.000000000001, "1 p" }, { -0.04, "-40 m" }, { 0.002, "2 m" }, { 0.0555, "55.5 m" }, { 0.0004928373928, "492.8 µ" }, { 0.000000251, "251 n"}, { 0.000000000043, "43 p"}, { 0.000000045643, "45.6 n"}, { Double.MAX_VALUE, "179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 P" }, { Double.POSITIVE_INFINITY, "∞" }, { Double.MIN_NORMAL, "0" }, { Double.NEGATIVE_INFINITY, "-∞" }, { Double.NaN, "�" }, }); }
Source:
<code>public OvernightIndexRates overnightIndexRates(OvernightIndex index) { Curve curve = marketData.getValue(OvernightIndexCurveKey.of(index)); <START> if (curve == null) { <END> throw new IllegalArgumentException("Unable to find forward curve: " + index); } return OvernightIndexRates.of(index, getValuationDate(), curve, timeSeries(index)); }</code><technical_language>MarketData.getValue returns null</technical_language>

Target:
public OvernightIndexRates overnightIndexRates(OvernightIndex index) { Curve curve = marketData.getValue(OvernightIndexCurveKey.of(index)); return OvernightIndexRates.of(index, getValuationDate(), curve, timeSeries(index)); }
Source:
<code>public void onConfirmation(Serializable extra, int buttonClicked) { if (buttonClicked == DialogInterface.BUTTON_POSITIVE && extra.equals("upload")) runAsyncTask(); <START> else if (buttonClicked == DialogInterface.BUTTON_POSITIVE && extra.equals("rerun")) <END> reRunTest(); }</code><technical_language>extra is</technical_language>

Target:
public void onConfirmation(Serializable extra, int buttonClicked) { if (buttonClicked == DialogInterface.BUTTON_POSITIVE && extra.equals(UPLOAD_KEY)) runAsyncTask(); else if (buttonClicked == DialogInterface.BUTTON_POSITIVE && extra.equals(RERUN_KEY)) reTestWebsites(); else if (buttonClicked == DialogInterface.BUTTON_NEUTRAL) startActivity(TextActivity.newIntent(this, TextActivity.TYPE_UPLOAD_LOG, (String)extra)); }
Source:
<code>public Deferred<Void> initialize(Span span) { return super.initialize(span) .addCallback( arg -> { for (QueryNode node : (Collection<QueryNode>) this.downstream) { if (node instanceof TimeSeriesDataSource) { TimeSeriesDataSource timeSeriesDataSource = (TimeSeriesDataSource) node; TimeSeriesDataSourceConfig config = (TimeSeriesDataSourceConfig) timeSeriesDataSource.config(); List<QueryNodeConfig> pushDownNodes = config.getPushDownNodes(); for (QueryNodeConfig queryNodeConfig : pushDownNodes) { if(queryNodeConfig instanceof DownsampleConfig) { downsampleConfig = (DownsampleConfig) queryNodeConfig; break; } } break; <START> } <END> } return null; }); }</code><technical_language>For HBase case, check if node is instance of Downsample grab config there</technical_language>

Target:
public Deferred<Void> initialize(Span span) { return super.initialize(span) .addCallback( arg -> { for (QueryNode node : (Collection<QueryNode>) this.downstream) { if (node instanceof TimeSeriesDataSource) { TimeSeriesDataSource timeSeriesDataSource = (TimeSeriesDataSource) node; TimeSeriesDataSourceConfig config = (TimeSeriesDataSourceConfig) timeSeriesDataSource.config(); List<QueryNodeConfig> pushDownNodes = config.getPushDownNodes(); for (QueryNodeConfig queryNodeConfig : pushDownNodes) { if(queryNodeConfig instanceof DownsampleConfig) { downsampleConfig = (DownsampleConfig) queryNodeConfig; break; } } break; } if(node instanceof Downsample){ Downsample downsample = (Downsample) node; downsampleConfig = (DownsampleConfig) downsample.config(); break; } } return null; }); }
Source:
<code>protected void refreshVisuals() { boolean isHash = 0 == ((MultiplicityElement) getUMLElement()).getLower(); getPrimaryShape().setHashed(isHash); boolean stack = 1 < ((MultiplicityElement) getUMLElement()).getUpper(); getPrimaryShape().setStack(stack); <START> getPrimaryShape().setLayerNumber(1); <END> getPrimaryShape().setXOffSet(2); getPrimaryShape().setYOffSet(-2); getPrimaryShape().setPathPattern(PATTERN_PATH); super.refreshVisuals(); }</code><technical_language>here, constants</technical_language>

Target:
protected void refreshVisuals() { boolean isHash = 0 == ((MultiplicityElement) getUMLElement()).getLower(); getPrimaryShape().setHashed(isHash); boolean stack = 1 < ((MultiplicityElement) getUMLElement()).getUpper(); getPrimaryShape().setStack(stack); getPrimaryShape().setLayerNumber(LAYER_NUMBER); getPrimaryShape().setXOffSet(X_OFFSET); getPrimaryShape().setYOffSet(Y_OFFSET); getPrimaryShape().setPathPattern(PATTERN_PATH); getPrimaryShape().setLayerOpacity(LAYER_OPACITY); super.refreshVisuals(); }
Source:
<code>public List<String> peerCapabilities() { <START> final String capabilitiesList = prop.getProperty("peer.capabilities", DEFAULT_PROTOCOL_LIST); <END> return Arrays.asList(capabilitiesList.split(",")); }</code><technical_language>need for a final local var in this context</technical_language>

Target:
public List<String> peerCapabilities() { String capabilitiesList = prop.getProperty("peer.capabilities", DEFAULT_PROTOCOL_LIST); return Arrays.asList(capabilitiesList.split(",")); }
Source:
<code>public static Iterable<ITmfEventAspect<?>> getEventAspects(ITmfTrace trace, Class<? extends ITmfEventAspect<?>> aspectClass) { <START> return StreamSupport.stream(Iterables.concat(trace.getEventAspects(), EXTRA_ASPECTS).spliterator(), false) .filter(aspect -> aspectClass.isAssignableFrom(aspect.getClass())) .collect(Collectors.toList()); <END> }</code><technical_language>Iterables.filter(Iterables.concat(bob), isAssignabe)). iterables methods iterables</technical_language>

Target:
public static Iterable<ITmfEventAspect<?>> getEventAspects(ITmfTrace trace, Class<? extends ITmfEventAspect<?>> aspectClass) { return Iterables.filter(Iterables.concat(trace.getEventAspects(), EXTRA_ASPECTS), aspect -> aspectClass.isAssignableFrom(aspect.getClass())); }
Source:
<code>protected void buildVmBootSequence() { if (managedDevices != null) { VmDeviceCommonUtils.updateVmDevicesBootOrder(vm.getStaticData(), managedDevices, vm.getboot_sequence(), VmDeviceCommonUtils.isOldClusterVersion(vm.getvds_group_compatibility_version())); for (VmDevice vmDevice : managedDevices) { <START> for (int i = 0; i < devices.size(); i++) { <END> XmlRpcStruct struct = (XmlRpcStruct) devices.get(i); Object o = struct.getItem(VdsProperties.SpecParams); if (o instanceof Map<?, ?>) { if (StringUtils.map2String((Map<String, String>) o).indexOf(vmDevice.getDeviceId().toString()) > 0) { struct.add(VdsProperties.BootOrder, String.valueOf(vmDevice.getBootOrder())); break; } } } } } }</code><technical_language>I recommend a foreach loop here, if possible</technical_language>

Target:
protected void buildVmBootSequence() { if (managedDevices != null) { VmDeviceCommonUtils.updateVmDevicesBootOrder(vm.getStaticData(), managedDevices, vm.getboot_sequence(), VmDeviceCommonUtils.isOldClusterVersion(vm.getvds_group_compatibility_version())); for (VmDevice vmDevice : managedDevices) { for (int i = 0; i < devices.size(); i++) { XmlRpcStruct struct = (XmlRpcStruct) devices.get(i); Object o = struct.getItem(VdsProperties.SpecParams); if (o instanceof Map<?, ?>) { if (StringUtils.map2String((Map<String, String>) o).contains(vmDevice.getDeviceId().toString())) { struct.add(VdsProperties.BootOrder, String.valueOf(vmDevice.getBootOrder())); break; } } else { log.errorFormat("Improper value of spec_params for VM {0} : {1}", vm.getvm_name(), o.toString()); } } } } }
Source:
<code><START> private static void updateOption(VdcOption option) { <END> Map<String, Object> values = null; if ((values = _vdcOptionCache.get(option.getoption_name())) != null) { values.put(option.getversion(), GetValue(option)); } else { values = new HashMap<String, Object>(); values.put(option.getversion(), GetValue(option)); _vdcOptionCache.put(option.getoption_name(), values); } }</code><technical_language>This code called RefreshVdcOptionCache() method too, instead of written also</technical_language>

Target:
private static void updateOption(VdcOption option) { Map<String, Object> values = _vdcOptionCache.get(option.getoption_name()); if (values != null) { values.put(option.getversion(), GetValue(option)); } else { values = new HashMap<String, Object>(); values.put(option.getversion(), GetValue(option)); _vdcOptionCache.put(option.getoption_name(), values); } }
Source:
<code>public Set<Connection> getConnections() { Set<Connection> conns = new HashSet<>(); for (VoltNetwork vn : m_networks) { Set<Connection> connsForNetwork; try { <START> connsForNetwork = vn.getConnections().get(); <END> } catch (InterruptedException | ExecutionException e) { connsForNetwork = new HashSet<>(); } conns.addAll(connsForNetwork); } return conns; }</code><technical_language>faster save Futures iterate get final results in another loop below. submit work network threads waiting</technical_language>

Target:
public Set<Connection> getConnections() { List<Future<Set<Connection>>> futures = new ArrayList<>(m_networks.length); for (VoltNetwork vn : m_networks) { futures.add(vn.getConnections()); } Set<Connection> conns = new HashSet<>(); for (Future<Set<Connection>> fut : futures) { Set<Connection> connsForNetwork; try { connsForNetwork = fut.get(); } catch (InterruptedException | ExecutionException e) { connsForNetwork = new HashSet<>(); } conns.addAll(connsForNetwork); } return conns; }
Source:
<code>private static Object getValue(Type type, Object value) { if (type.equals(BIGINT)) { return value; } <START> else if (type.equals(INTEGER)) { <END> return ((Number) value).intValue(); } else if (type.equals(DOUBLE)) { return value; } else if (type.equals(VARCHAR)) { return ((Slice) value).toStringUtf8(); } else if (type.equals(BOOLEAN)) { return value; } throw new UnsupportedOperationException("Query Builder can't handle type: " + type); }</code><technical_language>return in branch, need elses</technical_language>

Target:
private static Object getValue(Type type, Object value) { if (type.equals(BIGINT)) { return value; } if (type.equals(INTEGER)) { return ((Number) value).intValue(); } if (type.equals(DOUBLE)) { return value; } if (type.equals(VARCHAR)) { return ((Slice) value).toStringUtf8(); } if (type.equals(BOOLEAN)) { return value; } throw new IllegalArgumentException("Unhandled type: " + type); }
Source:
<code>public void testParallelWait() throws InterruptedException { final ExecutorAllCompletionService service = createService(2); for (int i = 0; i < 300; ++i) { service.submit(new WaitRunnable(10), null); } List<Thread> threads = new ArrayList<>(10); for (int i = 0; i < 10; ++i) { Thread t = new Thread(() -> { service.waitUntilAllCompleted(); <START> assert service.isAllCompleted(); <END> assert !service.isExceptionThrown(); }); threads.add(t); t.start(); } for (Thread t : threads) { t.join(); } assert service.isAllCompleted(); assert !service.isExceptionThrown(); }</code><technical_language>AssertJunit instead</technical_language>

Target:
public void testParallelWait() throws InterruptedException { final ExecutorAllCompletionService service = createService(2); for (int i = 0; i < 300; ++i) { service.submit(new WaitRunnable(10), null); } List<Thread> threads = new ArrayList<>(10); for (int i = 0; i < 10; ++i) { Thread t = new Thread(() -> { service.waitUntilAllCompleted(); assertTrue(service.isAllCompleted()); assertFalse(service.isExceptionThrown()); }); threads.add(t); t.start(); } for (Thread t : threads) { t.join(); } assertTrue(service.isAllCompleted()); assertFalse(service.isExceptionThrown()); }
Source:
<code>public String getPeerUserAgent() { <START> Set<String> clientCapabilities = currentRequest == null ? null <END> : currentRequest.getClientCapabilities(); return UserAgent.getAgent(clientCapabilities, userAgent); }</code><technical_language>tempted return currentRequest == null ? userAgent : UserAgent.getAgent(currentRequest.getClientCapabilities(), userAgent); equivalent "if"</technical_language>

Target:
public String getPeerUserAgent() { Set<String> clientCapabilities = currentRequest == null ? null : currentRequest.getClientCapabilities(); if (currentRequest == null) { return userAgent; } return UserAgent.getAgent(clientCapabilities, userAgent); }
Source:
<code>private FanoutBucket asFanout(InMemoryNoteBucket bucket) { if (bucket == null) return EMPTY_FANOUT; if (bucket instanceof FanoutBucket) return (FanoutBucket) bucket; <START> FanoutBucket fanoutBucket = ((LeafBucket) bucket).split(); <END> return fanoutBucket; }</code><technical_language>dropped writeTree call, need this local variable anymore instead return result of split()</technical_language>

Target:
private FanoutBucket asFanout(InMemoryNoteBucket bucket) { if (bucket == null) return EMPTY_FANOUT; if (bucket instanceof FanoutBucket) return (FanoutBucket) bucket; return ((LeafBucket) bucket).split(); }
Source:
<code>private void processSystemFunctions(ArtifactReadable functionsFolder, ISheetWriter writer) throws IOException { writer.startSheet("report", columnHeadings.length); writer.writeRow((Object[]) columnHeadings); for (ArtifactReadable systemFunction : functionsFolder.getDescendants()) { if (systemFunction.isOfType(CoreArtifactTypes.SystemFunction)) { writer.writeCell(systemFunction.getName()); accumulator.reset(systemFunction); accumulator.buildSubsystemsRequirementsMap(systemFunction); String criticality; if (systemFunction.getAttributes(CoreAttributeTypes.SafetyCriticality).size() != 1) { <START> System.out.println(String.format("found too many attributes on %s", systemFunction.toString())); <END> criticality = systemFunction.getAttributes(CoreAttributeTypes.SafetyCriticality).iterator().next().getDisplayableString(); } else { criticality = systemFunction.getSoleAttributeAsString(CoreAttributeTypes.SafetyCriticality); } writer.writeCell(criticality); writer.writeCell(getSFHAHazards(systemFunction)); for (ArtifactReadable systemRequirement : systemFunction.getRelated(CoreRelationTypes.Design__Requirement)) { writer.writeCell(systemRequirement.getSoleAttributeAsString(CoreAttributeTypes.ParagraphNumber, ""), SYSTEM_REQUIREMENT_INDEX); writer.writeCell(systemRequirement.getName()); accumulator.output(); } writer.endRow(); } } writer.endSheet(); }</code><technical_language>Do print statements show webpage output? place for these</technical_language>

Target:
private void processSystemFunctions(ArtifactReadable functionsFolder, ISheetWriter writer) throws IOException { writer.startSheet("report", columnHeadings.length); writer.writeRow((Object[]) columnHeadings); for (ArtifactReadable systemFunction : functionsFolder.getDescendants()) { if (systemFunction.isOfType(CoreArtifactTypes.SystemFunction)) { writer.writeCell(systemFunction.getName()); accumulator.reset(systemFunction); accumulator.buildSubsystemsRequirementsMap(systemFunction); String criticality; if (systemFunction.getAttributes(CoreAttributeTypes.SafetyCriticality).size() != 1) { logger.debug("found too many attributes on %s", systemFunction.toString()); criticality = systemFunction.getAttributes(CoreAttributeTypes.SafetyCriticality).iterator().next().getDisplayableString(); } else { criticality = systemFunction.getSoleAttributeAsString(CoreAttributeTypes.SafetyCriticality); } writer.writeCell(criticality); writer.writeCell(getSFHAHazards(systemFunction)); for (ArtifactReadable systemRequirement : systemFunction.getRelated(CoreRelationTypes.Design__Requirement)) { writer.writeCell(systemRequirement.getSoleAttributeAsString(CoreAttributeTypes.ParagraphNumber, ""), SYSTEM_REQUIREMENT_INDEX); writer.writeCell(systemRequirement.getName()); accumulator.output(); } writer.endRow(); } } writer.endSheet(); }
Source:
<code>private Object getNextDiff(TreeItem start) { return getNextDataWhichSatisfies(start, new Predicate<EObject>() { public boolean apply(EObject input) { <START> return input instanceof Diff; <END> } }); }</code><technical_language>This predicate extracted added class EMFComparePredicates if exist (below is predicate duplicated)</technical_language>

Target:
private Object getNextDiff(TreeItem start) { return getNextData(start, Predicates.alwaysTrue()); }