auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void populate(List<CategoryDTO> categories) { Platform.runLater(() -> { Set<String> themedCategories = Sets.newHashSet( <START> "custom", <END> "development", "games", "graphics", "internet", "multimedia", "office", "other", "science" ); final List<LeftButton> leftButtonList = new ArrayList<>(); for (CategoryDTO category : categories) { if(category.getType() == CategoryDTO.CategoryType.INSTALLERS) { final LeftButton categoryButton = new LeftButton(category.getName()); if (themedCategories.contains(category.getName().toLowerCase())) { final String themeName = new String(category.getName().toLowerCase() + "Button"); categoryButton.getStyleClass().add(themeName); } else { categoryButton.setStyle("-fx-background-image: url('" + category.getIcon() + "');"); } categoryButton.setOnMouseClicked(event -> selectCategory(category)); leftButtonList.add(categoryButton); } } categoryView.setNodes(leftButtonList); showAvailableApps(); }); }</code><technical_language>I categories themed</technical_language>

Target:
public void populate(List<CategoryDTO> categories) { Platform.runLater(() -> { final List<LeftButton> leftButtonList = new ArrayList<>(); for (CategoryDTO category : categories) { if(category.getType() == CategoryDTO.CategoryType.INSTALLERS) { final LeftButton categoryButton = new LeftButton(category.getName()); final String resource = String.format("icons/mainwindow/apps/%s.png", category.getName().toLowerCase()); if (themeManager.resourceExists(resource)) { categoryButton.setStyle("-fx-background-image: url('" + themeManager.getResourceUrl(resource) + "');"); } else { categoryButton.setStyle("-fx-background-image: url('" + category.getIcon() + "');"); } categoryButton.setOnMouseClicked(event -> selectCategory(category)); leftButtonList.add(categoryButton); } } categoryView.setNodes(leftButtonList); showAvailableApps(); }); }
Source:
<code>public Object read(final RecordTwoEvent traceRead) throws InterruptedException { ObjectTransitionSafepoint.INSTANCE.unregister(); if (VmSettings.REPLAY) { Activity reader = TracingActivityThread.currentThread().getActivity(); ChannelReadRecord crr = (ChannelReadRecord) reader.getNextReplayEvent(); assert crr != null : reader; assert channel.getId() == crr.channelId; <START> while (numReads.get() != crr.readNo) { <END> Thread.sleep(5); } } try { synchronized (this) { if (VmSettings.ACTOR_TRACING) { traceRead.record(channel.getId(), numReads.getAndIncrement()); } return cell.take(); } } finally { if (VmSettings.REPLAY) { numReads.incrementAndGet(); } ObjectTransitionSafepoint.INSTANCE.register(); } }</code><technical_language>factor this out a replayDelay(currentId, expectedId, currentChannelId, expectedChannelId) method? consistently for places asserts/loops? I hope this code more readable, avoids undesirable inconsistencies</technical_language>

Target:
public Object read(final RecordTwoEvent traceRead) throws InterruptedException { ObjectTransitionSafepoint.INSTANCE.unregister(); if (VmSettings.REPLAY) { ReplayData.replayDelayNumberedEvent(this, channel.getId()); } try { synchronized (this) { if (VmSettings.ACTOR_TRACING) { traceRead.record(channel.getId(), numReads); numReads++; } return cell.take(); } } finally { if (VmSettings.REPLAY) { numReads++; } ObjectTransitionSafepoint.INSTANCE.register(); } }
Source:
<code>protected ILaunchConfiguration findLaunchConfiguration(IResource resource, String mode) { ILaunchConfiguration configuration = null; ILaunchConfigurationType configType = getLaunchConfigType(); List<ILaunchConfiguration> candidateConfigs = Collections.emptyList(); try { ILaunchConfiguration[] configs = DebugPlugin.getDefault() .getLaunchManager().getLaunchConfigurations(configType); candidateConfigs = new ArrayList<>(configs.length); for (ILaunchConfiguration config : configs) { String sourcePath = config.getAttribute( IBuildDockerImageLaunchConfigurationConstants.SOURCE_PATH_LOCATION, ""); boolean workspaceRelative = config .getAttribute(IBuildDockerImageLaunchConfigurationConstants.SOURCE_PATH_WORKSPACE_RELATIVE_LOCATION, false); <START> IPath dockerfilePath = getPath(sourcePath, workspaceRelative); <END> if (dockerfilePath.equals(resource.getLocation())) { candidateConfigs.add(config); } } } catch (CoreException e) { Activator.log(e); } int candidateCount = candidateConfigs.size(); if (candidateCount < 1) { configuration = createConfiguration(resource, mode, true); } else if (candidateCount == 1) { configuration = candidateConfigs.get(0); } else { configuration = chooseConfiguration(candidateConfigs); } return configuration; }</code><technical_language>For existing launch configurations, this method returns path base directory, path Dockerfile, comparison fails a new configuration is prompted for creation</technical_language>

Target:
protected ILaunchConfiguration findLaunchConfiguration(IResource resource, String mode) { ILaunchConfiguration configuration = null; ILaunchConfigurationType configType = getLaunchConfigType(); List<ILaunchConfiguration> candidateConfigs = Collections.emptyList(); try { ILaunchConfiguration[] configs = DebugPlugin.getDefault() .getLaunchManager().getLaunchConfigurations(configType); candidateConfigs = new ArrayList<>(configs.length); for (ILaunchConfiguration config : configs) { String sourcePath = config.getAttribute( IBuildDockerImageLaunchConfigurationConstants.SOURCE_PATH_LOCATION, ""); boolean workspaceRelative = config .getAttribute(IBuildDockerImageLaunchConfigurationConstants.SOURCE_PATH_WORKSPACE_RELATIVE_LOCATION, false); IPath dockerfilePath = getPath(sourcePath, workspaceRelative); if (dockerfilePath .equals(resource.getLocation().removeLastSegments(1))) { candidateConfigs.add(config); } } } catch (CoreException e) { Activator.log(e); } int candidateCount = candidateConfigs.size(); if (candidateCount < 1) { configuration = createConfiguration(resource, mode, true); } else if (candidateCount == 1) { configuration = candidateConfigs.get(0); } else { configuration = chooseConfiguration(candidateConfigs); } return configuration; }
Source:
<code>private List<DiskInterface> getSupportedDiskInterfaces(int osId, Version version) { List<String> supportedDiskInterfaceNames = getOsRepository().getDiskInterfaces(osId, version); List<DiskInterface> supportedDiskInterfaces = new ArrayList<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { LOG.errorFormat("Can't find the value {0} in the enum DiskInterface. Error: {1}", ((interfaceName == null) ? "null" : interfaceName), <START> e.toString()); <END> } } return supportedDiskInterfaces; }</code><technical_language>interfaceName a null? is added of e.toString here? message contains problematic enum name exception is thrown</technical_language>

Target:
private static List<DiskInterface> getSupportedDiskInterfaces(int osId, Version version) { List<String> supportedDiskInterfaceNames = SimpleDependecyInjector.getInstance().get(OsRepository.class).getDiskInterfaces(osId, version); List<DiskInterface> supportedDiskInterfaces = new ArrayList<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { log.errorFormat("Can't find the value {0} in the enum DiskInterface.", interfaceName); } } return supportedDiskInterfaces; }
Source:
<code>public void getMetaDataParams(AMFPacket metaDataPacket, IMediaStream stream) { WMSProperties props = stream.getProperties(); AMFDataList dataList = new AMFDataList(metaDataPacket.getData()); IMediaStreamActionNotify2 actionNotify; if (dataList.size() < 2) return; if (dataList.get(1).getType() == AMFData.DATA_TYPE_OBJECT) { AMFDataObj obj = (AMFDataObj) dataList.get(1); String videocodec, audiocodec; if (obj.containsKey(ONMETADATA_VIDEOCODECID)){ try { videocodec = FLVUtils.videoCodecToString(obj.getInt(ONMETADATA_VIDEOCODECID)); } catch (NumberFormatException e){ videocodec = obj.getString(ONMETADATA_VIDEOCODECID); } obj.put(ONMETADATA_VIDEOCODECIDSTR, videocodec); } if (obj.containsKey(ONMETADATA_AUDIOCODECID)){ try{ audiocodec = FLVUtils.audioCodecToString(obj.getInt(ONMETADATA_AUDIOCODECID)); } catch (NumberFormatException e){ audiocodec = obj.getString(ONMETADATA_VIDEOCODECID); } obj.put(ONMETADATA_AUDIOCODECIDSTR, audiocodec); } synchronized (props) { props.put(AMFSETDATAFRAME, obj); actionNotify = (IMediaStreamActionNotify2) stream.getProperties().get("streamActionNotifier"); } if (actionNotify != null) { <START> stream.removeClientListener(actionNotify); <END> logger.info("removeClientListener: " + stream.getSrc()); } } }</code><technical_language>is calling removeClientListener thread safe</technical_language>

Target:
public void getMetaDataParams(AMFPacket metaDataPacket, IMediaStream stream) { AMFDataList dataList = new AMFDataList(metaDataPacket.getData()); for (int i = 0 ; i < dataList.size(); i++ ){ logger.debug("[" + stream.getName() +" ] Found DATA_TYPE_OBJECT"); AMFData amfData = dataList.get(i); if (amfData.getType() == AMFData.DATA_TYPE_OBJECT) { AMFDataObj obj = (AMFDataObj) amfData; String videocodec, audiocodec; if (obj.containsKey(ONMETADATA_VIDEOCODECID)){ try { videocodec = FLVUtils.videoCodecToString(obj.getInt(ONMETADATA_VIDEOCODECID)); } catch (NumberFormatException e){ videocodec = obj.getString(ONMETADATA_VIDEOCODECID); } obj.put(ONMETADATA_VIDEOCODECIDSTR, videocodec); } if (obj.containsKey(ONMETADATA_AUDIOCODECID)){ try{ audiocodec = FLVUtils.audioCodecToString(obj.getInt(ONMETADATA_AUDIOCODECID)); } catch (NumberFormatException e){ audiocodec = obj.getString(ONMETADATA_VIDEOCODECID); } obj.put(ONMETADATA_AUDIOCODECIDSTR, audiocodec); } WMSProperties props = stream.getProperties(); synchronized (props) { props.put(AMFSETDATAFRAME, obj); } removeListener(stream); return; } } logger.warn("[" + stream.getName() +" ] metadata not found"); }
Source:
<code>public void evaluate() throws Throwable { IBeforeTest before = null; log.debug("Run before class extensions for test class " + testClass.getJavaClass().getName()); try { befores.sort(new PriorityComparator()); for (IBeforeTest bfr : befores) { before = bfr; if (before.hasToRun()){ log.debug("Run method runBeforeTestClass() of class " + before.getClass().getCanonicalName()); before.runBeforeTestClass(config, testClass); } } } catch (Throwable e) { <START> log.error("Run method runBeforeTestClass() of class " + before.getClass().getCanonicalName() + " failed", e); <END> if (isScreenshotRequired(e)) { createScreenshot("BeforeClassExt", before.getClass()); } throw e; } nextStatement.evaluate(); }</code><technical_language>move error log condition body</technical_language>

Target:
public void evaluate() throws Throwable { IBeforeTest before = null; log.debug("Run before class extensions for test class " + testClass.getJavaClass().getName()); try { befores.sort(new PriorityComparator()); for (IBeforeTest bfr : befores) { before = bfr; if (before.hasToRun()){ log.debug("Run method runBeforeTestClass() of class " + before.getClass().getCanonicalName()); before.runBeforeTestClass(config, testClass); } } } catch (Throwable e) { if(ScreenshotCapturer.shouldCaptureScreenshotOnException(e)){ log.error("Run method runBeforeTestClass() of class " + before.getClass().getCanonicalName() + " failed", e); createScreenshot("BeforeClassExt", before.getClass()); } throw e; } nextStatement.evaluate(); }
Source:
<code>int foo() throws InterruptedException { int x = 1; int a = 2; while (true) { try { if (x > 0) { break; } else if (x < 0) { ; } else { break; } switch (a) { case 1: { <START> break; <END> } case (1 + 2): { break; } case 0: break; default: break; } } catch (Exception e) { break; } finally { break; } } synchronized (this) { do { x = 2; } while (x == 2); } synchronized (this) { do while (x == 2); } for (int k = 0; k < 1; k++) { String innerBlockVariable = ""; } for (int k = 0; k < 1; k++) return a; }</code><technical_language>@Vladlis This sense. expanding case of issue, please update original issue this too. Release notes issue title, if update users including default too</technical_language>

Target:
int foo() throws InterruptedException { int x = 1; int a = 2; while (true) { try { if (x > 0) { break; } else if (x < 0) { ; } else { break; } switch (a) { case 0: break; default: break; } } catch (Exception e) { break; } finally { break; } } synchronized (this) { do { x = 2; } while (x == 2); } synchronized (this) { do while (x == 2); } for (int k = 0; k < 1; k++) { String innerBlockVariable = ""; } for (int k = 0; k < 1; k++) return a; }
Source:
<code>private void validateOptions(char role) throws IllegalArgumentException { if (role == 'P') { if (!ObjectHelper.isEmpty(consumerType) || persistentTailTracking || !ObjectHelper.isEmpty(tailTrackDb) || !ObjectHelper.isEmpty(tailTrackCollection) || !ObjectHelper.isEmpty(tailTrackField) || cursorRegenerationDelay != 1000L) { throw new IllegalArgumentException("consumerType, tailTracking, cursorRegenerationDelay options cannot appear on a producer endpoint"); } } else if (role == 'C') { if (!ObjectHelper.isEmpty(operation) || dynamicity || outputType != null) { throw new IllegalArgumentException("operation, dynamicity, outputType " + "options cannot appear on a consumer endpoint"); } if (consumerType == MongoDbConsumerType.tailable) { if (tailTrackIncreasingField == null) { throw new IllegalArgumentException("tailTrackIncreasingField option must be set for tailable cursor MongoDB consumer endpoint"); } if (persistentTailTracking && (ObjectHelper.isEmpty(persistentId))) { throw new IllegalArgumentException("persistentId is compulsory for persistent tail tracking"); } <START> if (persistentTailTracking && (ObjectHelper.isEmpty(persistentId))) { <END> throw new IllegalArgumentException("persistentId is compulsory for persistent tail tracking"); } } } else { throw new IllegalArgumentException("Unknown endpoint role"); } }</code><technical_language>Is specific reason for times check</technical_language>

Target:
private void validateOptions(char role) throws IllegalArgumentException { if (role == 'P') { if (!ObjectHelper.isEmpty(consumerType) || persistentTailTracking || !ObjectHelper.isEmpty(tailTrackDb) || !ObjectHelper.isEmpty(tailTrackCollection) || !ObjectHelper.isEmpty(tailTrackField) || cursorRegenerationDelay != 1000L) { throw new IllegalArgumentException("consumerType, tailTracking, cursorRegenerationDelay options cannot appear on a producer endpoint"); } } else if (role == 'C') { if (!ObjectHelper.isEmpty(operation) || dynamicity || outputType != null) { throw new IllegalArgumentException("operation, dynamicity, outputType " + "options cannot appear on a consumer endpoint"); } if (consumerType == MongoDbConsumerType.tailable) { if (tailTrackIncreasingField == null) { throw new IllegalArgumentException("tailTrackIncreasingField option must be set for tailable cursor MongoDB consumer endpoint"); } if (persistentTailTracking && (ObjectHelper.isEmpty(persistentId))) { throw new IllegalArgumentException("persistentId is compulsory for persistent tail tracking"); } } } else { throw new IllegalArgumentException("Unknown endpoint role"); } }
Source:
<code>private boolean matchesVersionInternal(Element element) { String schemaLocation = element.getAttributeNS("<LINK_0>", "schemaLocation"); <START> return schemaLocation.matches("(?m).*spring-security-3\\.[12].*.xsd.*") <END> || schemaLocation.matches("(?m).*spring-security.xsd.*") || !schemaLocation.matches("(?m).*spring-security.*"); }</code><technical_language>Historically Spring Security's namespace support supports current version, this match 3.2. I convinced support other versions, if want do this a distinct JIRA / commit</technical_language>

Target:
private boolean matchesVersionInternal(Element element) { String schemaLocation = element.getAttributeNS("<LINK_0>", "schemaLocation"); return schemaLocation.matches("(?m).*spring-security-3\\.2.*.xsd.*") || schemaLocation.matches("(?m).*spring-security.xsd.*") || !schemaLocation.matches("(?m).*spring-security.*"); }
Source:
<code>public String display(Type type, Object value) throws HTMLDisplayerException { <START> return display(type, value, new HashMap<>()); <END> }</code><technical_language>Collections.emptyMap() for performances (not created a new object)</technical_language>

Target:
public String display(Type type, Object value) throws HTMLDisplayerException { return display(type, value, Collections.emptyMap()); }
Source:
<code>private void generateScript(String scriptName, AutomationConfiguration configuration) { Path scriptDirPath = configuration.getScriptLocation().orElseThrow(() -> new BriefcaseException("No script location directory defined")); String storageDir = appPreferences.getBriefcaseDir().orElseThrow(() -> new BriefcaseException("")).getParent().toString(); <START> String template = "java -jar briefcase.jar --export --form_id {0} --storage_directory " + <END> storageDir + " --export_directory /tmp --export_filename {1}.csv"; try { PrintWriter writer = new PrintWriter(scriptDirPath.toFile() + File.pathSeparator + scriptName); List<BriefcaseFormDefinition> forms = formCache.getForms(); System.out.println(forms.size()); System.out.println(storageDir); for (BriefcaseFormDefinition form: forms) { Object[] params = new Object[]{form.getFormId(), form.getFormName()}; String command = MessageFormat.format(template, params); writer.println(command); writer.close(); } writer.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } }</code><technical_language>a {N} param for could/will change: jar file, storage dir export directory. cleaner leave in template change {N} params for moving part</technical_language>

Target:
private void generateScript(String scriptName, AutomationConfiguration configuration) { Path scriptDirPath = configuration.getScriptLocation().orElseThrow(BriefcaseException::new); Path storageDir = appPreferences.getBriefcaseDir().orElseThrow(BriefcaseException::new).getParent(); String exportTemplate = "java -jar {0} --export --form_id {1} --storage_directory {2} --export_directory {3} --export_filename {4}.csv"; String template = "java -jar {0} --form_id {1} --storage_directory {2}{3}"; List<String> scriptLines = new ArrayList<>(); String jarInstructions = writeBriefcaseJarToScript(); scriptLines.add(jarInstructions); String briefcaseJar = isWindows() ? "%JAR%" : "$JAR"; List<String> pullInstructions = forms.getPullSelectedForms() .stream() .map(form -> MessageFormat.format( template, briefcaseJar, form.getFormDefinition().getFormId(), storageDir.toString(), getParams(pullSource.orElseThrow(BriefcaseException::new).getPullCliParams()) )).collect(toList()); scriptLines.addAll(pullInstructions); List<String> exportInstructions = forms.getExportSelectedForms() .stream() .map(form -> MessageFormat.format( exportTemplate, briefcaseJar, form.getFormDefinition().getFormId(), storageDir.toString(), "/tmp", form.getFormName() )) .collect(Collectors.toList()); scriptLines.add(""); scriptLines.add(""); scriptLines.addAll(exportInstructions); List<String> pushInstructions = forms.getPushSelectedForms() .stream() .map(form -> MessageFormat.format( template, briefcaseJar, form.getFormDefinition().getFormId(), storageDir.toString(), getParams(pushSource.orElseThrow(BriefcaseException::new).getPushCliParams()) )).collect(toList()); scriptLines.add(""); scriptLines.add(""); scriptLines.addAll(pushInstructions); try { Files.write( scriptDirPath.resolve(scriptName), scriptLines, CREATE, TRUNCATE_EXISTING ); view.showConfirmation(); } catch (IOException e) { throw new BriefcaseException(e); } }
Source:
<code>@Test void testAggregateCaseToFilter() { final String sql = "select\n" + " sum(sal) as sum_sal,\n" + " count(distinct case\n" + " when job = 'CLERK'\n" + " then deptno else null end) as count_distinct_clerk,\n" + " sum(case when deptno = 10 then sal end) as sum_sal_d10,\n" + " sum(case when deptno = 20 then sal else 0 end) as sum_sal_d20,\n" + " sum(case when deptno = 30 then 1 else 0 end) as count_d30,\n" <START> + " sum(case when deptno = 40 then 1 end) as count_d40,\n" <END> + " count(case when deptno = 50 then 'x' end) as count_d50,\n" + " count(case when deptno = 20 then 1 end) as count_d20\n" + "from emp"; sql(sql).withRule(CoreRules.AGGREGATE_CASE_TO_FILTER).check(); }</code><technical_language>alias is count function is sum</technical_language>

Target:
@Test void testAggregateCaseToFilter() { final String sql = "select\n" + " sum(sal) as sum_sal,\n" + " count(distinct case\n" + " when job = 'CLERK'\n" + " then deptno else null end) as count_distinct_clerk,\n" + " sum(case when deptno = 10 then sal end) as sum_sal_d10,\n" + " sum(case when deptno = 20 then sal else 0 end) as sum_sal_d20,\n" + " sum(case when deptno = 30 then 1 else 0 end) as count_d30,\n" + " sum(case when deptno = 40 then 1 end) as count_d40,\n" + " sum(case when deptno = 50 then 1 else null end) as count_d50,\n" + " sum(case when deptno = 60 then null end) as sum_null_d60,\n" + " sum(case when deptno = 70 then null else 1 end) as sum_null_d70,\n" + " count(case when deptno = 10 then 'x' end) as count_d10,\n" + " count(case when deptno = 20 then 1 end) as count_d20\n" + "from emp"; sql(sql).withRule(CoreRules.AGGREGATE_CASE_TO_FILTER).check(); }
Source:
<code>private void dataCenterWithClusterSelectedItemChanged(Object sender, EventArgs args) { String selectedTimeZone = ""; Integer selectedOsId = null; <START> <END> if (getTimeZone().getSelectedItem() != null) { selectedTimeZone = getTimeZone().getSelectedItem().getTimeZoneKey().toString(); } if (getOSType().getSelectedItem() != null) { selectedOsId = getOSType().getSelectedItem(); } behavior.dataCenterWithClusterSelectedItemChanged(); refreshMigrationPolicies(); updateMigrationRelatedFields(); DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster != null && dataCenterWithCluster.getDataCenter() != null) { getDisksAllocationModel().setQuotaEnforcementType(dataCenterWithCluster.getDataCenter() .getQuotaEnforcementType()); } updateMigrationOptions(); handleQxlClusterLevel(); updateWatchdogModels(); updateBootMenu(); getInstanceImages().updateActionsAvailability(); initGraphicsConsoles(); updateSoundCard(); updateResumeBehavior(); updateBiosType(); if (selectedOsId != null) { getBehavior().updateOSValue(selectedOsId); } if (!selectedTimeZone.isEmpty()) { getBehavior().updateTimeZone(selectedTimeZone); } }</code><technical_language>Please, separate methods for this, discussed</technical_language>

Target:
private void dataCenterWithClusterSelectedItemChanged(Object sender, EventArgs args) { String selectedTimeZone = ""; Integer selectedOsId = null; if (getTimeZone().getSelectedItem() != null) { selectedTimeZone = getBehavior().getSelectedTimeZone(); } if (getOSType().getSelectedItem() != null) { selectedOsId = getBehavior().getSelectedOSType(); } behavior.dataCenterWithClusterSelectedItemChanged(); refreshMigrationPolicies(); updateMigrationRelatedFields(); DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster != null && dataCenterWithCluster.getDataCenter() != null) { getDisksAllocationModel().setQuotaEnforcementType(dataCenterWithCluster.getDataCenter() .getQuotaEnforcementType()); } updateMigrationOptions(); handleQxlClusterLevel(); updateWatchdogModels(); updateBootMenu(); getInstanceImages().updateActionsAvailability(); initGraphicsConsoles(); updateSoundCard(); updateResumeBehavior(); updateBiosType(); getBehavior().updateOSValue(selectedOsId); if (!selectedTimeZone.isEmpty()) { getBehavior().updateTimeZone(selectedTimeZone); } }
Source:
<code><START> public List<Menu> getMenuItems() { <END> MenuItem[] items = ml.getItemsFromMenu(mh.getMenuFromMenuItem(menuItem)); List<Menu> menus = new ArrayList<>(items.length); for (MenuItem item : items){ String title = mh.getMenuItemText(item); if(title.isEmpty()) continue; List<String> path = mh.getMenuPath(item); menus.add(new ShellMenu(path.toArray(new String[1]))); } return menus; }</code><technical_language>this method defined in Menu interface</technical_language>

Target:
public List<Menu> getMenuItems() { MenuItem[] items = ml.getItemsFromMenu(mh.getMenuFromMenuItem(menuItem)); List<Menu> menus = new ArrayList<>(items.length); for (MenuItem item : items){ if(mh.getMenuItemText(item).isEmpty()) continue; menus.add(new DefaultMenu(item)); } return menus; }
Source:
<code><START> public ContentTypeManager() { <END> super(null, InstanceScope.INSTANCE); }</code><technical_language>constructor private</technical_language>

Target:
private ContentTypeManager() { super(null, InstanceScope.INSTANCE); }
Source:
<code>private String formProfileUrl(String clusterId, String volumeId, boolean isBrickProfileSelected) { String apiMatrixParam = !isBrickProfileSelected ? ";nfsStatistics=true" : ""; return <START> StringFormat.format("/ovirt-engine/api/clusters/%s/glustervolumes/%s/profilestatistics%s?accept=text/plain", <END> clusterId, volumeId, apiMatrixParam); }</code><technical_language>text/plain a supported content type of API. work, stop working point. supported content types application/xml application/json</technical_language>

Target:
private String formProfileUrl(String clusterId, String volumeId, boolean isBrickProfileSelected) { String apiMatrixParam = !isBrickProfileSelected ? ";nfsStatistics=true" : ""; return StringFormat.format("/ovirt-engine/api/clusters/%s/glustervolumes/%s/profilestatistics%s?accept=application/json", clusterId, volumeId, apiMatrixParam); }
Source:
<code>private boolean isOfAcceptedType(Object o) { for (Class<?> <START> fAcceptedType : <END> fAcceptedTypes) { if (fAcceptedType.isInstance(o)) { return true; } } return false; }</code><technical_language>rename type</technical_language>

Target:
private boolean isOfAcceptedType(Object o) { for (Class<?> type : fAcceptedTypes) { if (type.isInstance(o)) { return true; } } return false; }
Source:
<code>protected void recvCommands() throws IOException { for (;;) { String line; try { <START> line = pckIn.readStringRaw(); <END> } catch (EOFException eof) { if (commands.isEmpty()) return; throw eof; } if (line == PacketLineIn.END) break; if (line.length() >= 48 && line.startsWith("shallow ")) { clientShallowCommits.add(ObjectId.fromString(line.substring(8, 48))); continue; } if (commands.isEmpty()) { final FirstLine firstLine = new FirstLine(line); enabledCapabilities = firstLine.getCapabilities(); line = firstLine.getLine(); if (line.equals(GitProtocolConstants.OPTION_PUSH_CERT)) pushCertificateParser.receiveHeader(pckIn, !isBiDirectionalPipe()); } if (line.equals("-----BEGIN PGP SIGNATURE-----\n")) pushCertificateParser.receiveSignature(pckIn); if (pushCertificateParser.enabled()) pushCertificateParser.addCommand(line); if (line.length() < 83) { final String m = JGitText.get().errorInvalidProtocolWantedOldNewRef; sendError(m); throw new PackProtocolException(m); } final ReceiveCommand cmd = parseCommand(line); if (cmd.getRefName().equals(Constants.HEAD)) { cmd.setResult(Result.REJECTED_CURRENT_BRANCH); } else { cmd.setRef(refs.get(cmd.getRefName())); } commands.add(cmd); } }</code><technical_language>this changed readString() strips LF</technical_language>

Target:
protected void recvCommands() throws IOException { for (;;) { String rawLine; try { rawLine = pckIn.readStringRaw(); } catch (EOFException eof) { if (commands.isEmpty()) return; throw eof; } if (rawLine == PacketLineIn.END) { break; } String line = chomp(rawLine); if (line.length() >= 48 && line.startsWith("shallow ")) { clientShallowCommits.add(ObjectId.fromString(line.substring(8, 48))); continue; } if (commands.isEmpty()) { final FirstLine firstLine = new FirstLine(line); enabledCapabilities = firstLine.getCapabilities(); line = firstLine.getLine(); if (line.equals(GitProtocolConstants.OPTION_PUSH_CERT)) pushCertificateParser.receiveHeader(pckIn, !isBiDirectionalPipe()); } if (line.equals("-----BEGIN PGP SIGNATURE-----\n")) pushCertificateParser.receiveSignature(pckIn); if (pushCertificateParser.enabled()) { pushCertificateParser.addCommand(rawLine); } if (line.length() < 83) { final String m = JGitText.get().errorInvalidProtocolWantedOldNewRef; sendError(m); throw new PackProtocolException(m); } final ReceiveCommand cmd = parseCommand(line); if (cmd.getRefName().equals(Constants.HEAD)) { cmd.setResult(Result.REJECTED_CURRENT_BRANCH); } else { cmd.setRef(refs.get(cmd.getRefName())); } commands.add(cmd); } }
Source:
<code>public final byte[] getTREs(final TaggedRecordExtensionHandler handler, final TreSource source) throws NitfFormatException, IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (Tre tre : handler.getTREsRawStructure().getTREsForSource(source)) { String name = padStringToLength(tre.getName(), TreConstants.TAG_LENGTH); baos.write(name.getBytes(StandardCharsets.ISO_8859_1)); if (tre.getRawData() != null) { String tagLen = padIntegerToLength(tre.getRawData().length, TreConstants.TAGLEN_LENGTH); baos.write(tagLen.getBytes(StandardCharsets.ISO_8859_1)); baos.write(tre.getRawData()); } else { byte[] treData = serializeTRE(tre); baos.write(padIntegerToLength(treData.length, TreConstants.TAGLEN_LENGTH).getBytes(StandardCharsets.ISO_8859_1)); baos.write(treData); } <START> } <END> return baos.toByteArray(); }</code><technical_language>I static imports</technical_language>

Target:
public final byte[] getTREs(final TaggedRecordExtensionHandler handler, final TreSource source) throws NitfFormatException, IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (Tre tre : handler.getTREsRawStructure().getTREsForSource(source)) { String name = padStringToLength(tre.getName(), TAG_LENGTH); baos.write(name.getBytes(StandardCharsets.ISO_8859_1)); if (tre.getRawData() != null) { String tagLen = padIntegerToLength(tre.getRawData().length, TAGLEN_LENGTH); baos.write(tagLen.getBytes(StandardCharsets.ISO_8859_1)); baos.write(tre.getRawData()); } else { byte[] treData = serializeTRE(tre); baos.write(padIntegerToLength(treData.length, TAGLEN_LENGTH).getBytes(StandardCharsets.ISO_8859_1)); baos.write(treData); } } return baos.toByteArray(); }
Source:
<code>private void addContentProposalToUriText(Text uriTextField) { KeyStroke keyStroke; try { keyStroke = KeyStroke.getInstance("M1+Space"); } catch (ParseException e) { return; } ControlDecoration dec = new ControlDecoration(uriTextField, SWT.TOP | SWT.LEFT); if (Platform.isRunning()) { dec.setImage(FieldDecorationRegistry.getDefault() .getFieldDecoration( FieldDecorationRegistry.DEC_CONTENT_PROPOSAL) .getImage()); } dec.setShowOnlyOnFocus(true); dec.setShowHover(true); dec.setDescriptionText(NLS.bind( UIText.RepositorySelectionPage_ShowPrevisousURIs_Tooltip, keyStroke.format())); IContentProposalProvider cp = new IContentProposalProvider() { <START> public IContentProposal[] getProposals(String contents, int position) { <END> List<IContentProposal> resultList = new ArrayList<IContentProposal>(); Set<String> uriStrings = getUrisFromPrefs(); for (final String uriString : uriStrings) { IContentProposal propsal = new IContentProposal() { public String getLabel() { return null; } public String getDescription() { return null; } public int getCursorPosition() { return 0; } public String getContent() { return uriString; } }; resultList.add(propsal); } return resultList.toArray(new IContentProposal[resultList .size()]); } }; new ContentProposalAdapter(uriTextField, new TextContentAdapter(), cp, keyStroke, new char[0]) .setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); }</code><technical_language>content of input field filter list of proposals. list of proposals long</technical_language>

Target:
private void addContentProposalToUriText(Text uriTextField) { ControlDecoration dec = new ControlDecoration(uriTextField, SWT.TOP | SWT.LEFT); if (Platform.isRunning()) { dec.setImage(FieldDecorationRegistry.getDefault() .getFieldDecoration( FieldDecorationRegistry.DEC_CONTENT_PROPOSAL) .getImage()); } dec.setShowOnlyOnFocus(true); dec.setShowHover(true); dec.setDescriptionText(UIText.RepositorySelectionPage_ShowPreviousURIs_HoverText); IContentProposalProvider cp = new IContentProposalProvider() { public IContentProposal[] getProposals(String contents, int position) { List<IContentProposal> resultList = new ArrayList<IContentProposal>(); String patternString = contents.replaceAll("\\x2A", ".*"); if (!patternString.endsWith(".*")) { patternString = patternString + ".*"; } Pattern pattern; try { pattern = Pattern.compile(patternString, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { pattern = null; } Set<String> uriStrings = getUrisFromPrefs(); for (final String uriString : uriStrings) { if (pattern!=null && !pattern.matcher(uriString).matches()) continue; IContentProposal propsal = new IContentProposal() { public String getLabel() { return null; } public String getDescription() { return null; } public int getCursorPosition() { return 0; } public String getContent() { return uriString; } }; resultList.add(propsal); } return resultList.toArray(new IContentProposal[resultList .size()]); } }; new ContentProposalAdapter(uriTextField, new TextContentAdapter(), cp, null, null) .setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE); }
Source:
<code>public int compareTo(PickerMilestone milestone) { if (isSelected != milestone.isSelected()) { return isSelected ? -1 : 1; } if (this.isOpen() != milestone.isOpen()) { return this.isOpen() ? -1 : 1; } if (!this.getDueDate().isPresent()) return 1; if (!milestone.getDueDate().isPresent()) return -1; LocalDate thisDueDate = this.getDueDate().get(); LocalDate otherDueDate = milestone.getDueDate().get(); if (!thisDueDate.isEqual(otherDueDate)) { return thisDueDate.isBefore(otherDueDate) ? -1 : 1; } <START> return this.getTitle().compareTo(milestone.getTitle()); <END> }</code><technical_language>Removing equality top introduce a bug, e.g. if milestones due date - currently, other milestone treated smaller. Is this intended behaviour? In opinion, for consistency, if milestones due date due date, compare titles</technical_language>

Target:
public int compareTo(PickerMilestone milestone) { if (isSelected != milestone.isSelected()) { return isSelected ? -1 : 1; } if (this.isOpen() != milestone.isOpen()) { return this.isOpen() ? -1 : 1; } if (this.getDueDate().equals(milestone.getDueDate())) { return this.getTitle().compareTo(milestone.getTitle()); } if (!this.getDueDate().isPresent()) return 1; if (!milestone.getDueDate().isPresent()) return -1; return this.getDueDate().get().isBefore(milestone.getDueDate().get()) ? -1 : 1; }
Source:
<code>public static Optional<DBMSType> fromString(String typeName) { if (typeName == null) { return Optional.empty(); } else { <START> try { <END> return Optional.of(Enum.valueOf(DBMSType.class, typeName.toUpperCase(Locale.ENGLISH))); } catch (IllegalArgumentException exception) { return Optional.empty(); } } }</code><technical_language>DBMSType.values().stream().filter(...equalsIgnoreCase...).findFirst() is more readable in opinion</technical_language>

Target:
public static Optional<DBMSType> fromString(String typeName) { return Arrays.stream(DBMSType.values()).filter(dbmsType -> dbmsType.type.equalsIgnoreCase(typeName)).findAny(); }
Source:
<code>public void setupFieldLayout() { if (this.field.isShowLabel()) { if (labelTextView != null) { labelTextView.setText(this.field.getLabel()); labelTextView.setVisibility(VISIBLE); if (this.field.isRequired()) { Spannable requiredAlert = ThemeUtil.getRequiredSpannable(getContext()); labelTextView.append(requiredAlert); } } } else { if (labelTextView != null) { labelTextView.setVisibility(GONE); } } if (this.field.getPlaceHolder() != null && !this.field.getPlaceHolder().isEmpty()) { textEditText.setHint(this.field.getPlaceHolder()); } <START> if (this.field.getTip() != null && !this.field.getTip().isEmpty()) { <END> hintTextView.setText(this.field.getTip()); hintTextView.setVisibility(VISIBLE); } }</code><technical_language>This a perfect case for a kotlin extension, think? this.field.getTip().isNullOrEmpty() :) (just idea)</technical_language>

Target:
public void setupFieldLayout() { if (this.field.isShowLabel()) { if (labelTextView != null) { labelTextView.setText(this.field.getLabel()); labelTextView.setVisibility(VISIBLE); if (this.field.isRequired()) { Spannable requiredAlert = ThemeUtil.getRequiredSpannable(getContext()); labelTextView.append(requiredAlert); } } } else { if (labelTextView != null) { labelTextView.setVisibility(GONE); } } if (this.field.getPlaceHolder() != null && !this.field.getPlaceHolder().isEmpty()) { textEditText.setHint(this.field.getPlaceHolder()); } if (!StringUtils.isNullOrEmpty(this.field.getTip())) { hintTextView.setText(this.field.getTip()); hintTextView.setVisibility(VISIBLE); } }
Source:
<code>public synchronized void updatePartitionStatistics(String databaseName, String tableName, String partitionName, Function<PartitionStatistics, PartitionStatistics> update) { <START> PartitionStatistics originalStatistics = requireNonNull( <END> getPartitionStatistics(databaseName, tableName, ImmutableSet.of(partitionName)).get(partitionName), "getPartitionStatistics() returned null"); PartitionStatistics updatedStatistics = update.apply(originalStatistics); Table table = getRequiredTable(databaseName, tableName); List<String> partitionValues = extractPartitionKeyValues(partitionName); Path partitionDirectory = getPartitionMetadataDirectory(table, partitionValues); PartitionMetadata partitionMetadata = readSchemaFile("partition", partitionDirectory, partitionCodec) .orElseThrow(() -> new PartitionNotFoundException(new SchemaTableName(databaseName, tableName), partitionValues)); PartitionMetadata updatedMetadata = partitionMetadata .withParameters(updateStatisticParameters(partitionMetadata.getParameters(), updatedStatistics.getBasicStatistics())) .withColumnStatistics(updatedStatistics.getColumnStatistics()); writeSchemaFile("partition", partitionDirectory, partitionCodec, updatedMetadata, true); }</code><technical_language>This is wrong error message. HIVE_PARTITION_DROPPED_DURING_QUERY? a generic HIVE_METASTORE_ERROR</technical_language>

Target:
public synchronized void updatePartitionStatistics(String databaseName, String tableName, String partitionName, Function<PartitionStatistics, PartitionStatistics> update) { PartitionStatistics originalStatistics = getPartitionStatistics(databaseName, tableName, ImmutableSet.of(partitionName)).get(partitionName); if (originalStatistics == null) { throw new PrestoException(HIVE_PARTITION_DROPPED_DURING_QUERY, "Statistics result does not contain entry for partition: " + partitionName); } PartitionStatistics updatedStatistics = update.apply(originalStatistics); Table table = getRequiredTable(databaseName, tableName); List<String> partitionValues = extractPartitionKeyValues(partitionName); Path partitionDirectory = getPartitionMetadataDirectory(table, partitionValues); PartitionMetadata partitionMetadata = readSchemaFile("partition", partitionDirectory, partitionCodec) .orElseThrow(() -> new PartitionNotFoundException(new SchemaTableName(databaseName, tableName), partitionValues)); PartitionMetadata updatedMetadata = partitionMetadata .withParameters(updateStatisticsParameters(partitionMetadata.getParameters(), updatedStatistics.getBasicStatistics())) .withColumnStatistics(updatedStatistics.getColumnStatistics()); writeSchemaFile("partition", partitionDirectory, partitionCodec, updatedMetadata, true); }
Source:
<code>public boolean supports(DataHolder dataHolder) { <START> return dataHolder instanceof ItemStack && ((ItemStack) dataHolder).getItem().equals(Item.getItemFromBlock(Blocks.sponge)); <END> }</code><technical_language>wolves</technical_language>

Target:
public boolean supports(DataHolder dataHolder) { return dataHolder instanceof EntityWolf || ((dataHolder instanceof ItemStack) && ((ItemStack) dataHolder).getItem().equals(ItemTypes.SPONGE)); }
Source:
<code>public void testBuildWithPull() throws Exception { final String dockerDirectory = Resources.getResource("dockerDirectory").getPath(); final String pullMsg = "Pulling from"; sut.build(Paths.get(dockerDirectory)); final AtomicBoolean pulled = new AtomicBoolean(false); sut.build(Paths.get(dockerDirectory), "test", new ProgressHandler() { @Override public void progress(ProgressMessage message) throws DockerException { if (message.stream().contains(pullMsg)) { pulled.set(true); } } }, PULL); <START> assertTrue(pulled.get()); <END> }</code><technical_language>try message.status() instead? running docker 1.7.1 for me</technical_language>

Target:
public void testBuildWithPull() throws Exception { assumeTrue("We need Docker API >= v1.19 to run this test." + "This Docker API is " + sut.version().apiVersion(), versionCompare(sut.version().apiVersion(), "1.19") >= 0); final String dockerDirectory = Resources.getResource("dockerDirectory").getPath(); final String pullMsg = "Pulling from"; sut.build(Paths.get(dockerDirectory)); final AtomicBoolean pulled = new AtomicBoolean(false); sut.build(Paths.get(dockerDirectory), "test", new ProgressHandler() { @Override public void progress(ProgressMessage message) throws DockerException { if (message.status().contains(pullMsg)) { pulled.set(true); } } }, PULL_NEWER_IMAGE); assertTrue(pulled.get()); }
Source:
<code><START> private Boolean hasUnavailableModifier(final List<SwiftParser.AttributeContext> attributes) { <END> return attributes.stream().anyMatch(atr -> AVAILABLE_UNAVAILABLE.equals(atr.getText())); }</code><technical_language>do need a boxed primitive here</technical_language>

Target:
private boolean hasUnavailableModifier(final List<SwiftParser.AttributeContext> attributes) { return attributes.stream().anyMatch(atr -> AVAILABLE_UNAVAILABLE.equals(atr.getText())); }
Source:
<code>public void testFromProductName() { assertThat(fromProductName("HSQL Database Engine")).isEqualTo(HSQL); assertThat(fromProductName("Oracle")).isEqualTo(ORACLE); assertThat(fromProductName("PostgreSQL")).isEqualTo(POSTGRES); assertThat(fromProductName("MySQL")).isEqualTo(MYSQL); <START> assertThat(fromProductName("MariaDB")).isEqualTo(MYSQL); <END> }</code><technical_language>leave assertEquals add MariaDB check making global change assertj 2.1.x</technical_language>

Target:
public void testFromProductName() { assertEquals(HSQL, fromProductName("HSQL Database Engine")); assertEquals(ORACLE, fromProductName("Oracle")); assertEquals(POSTGRES, fromProductName("PostgreSQL")); assertEquals(MYSQL, fromProductName("MySQL")); assertEquals(MYSQL, fromProductName("MariaDB")); }
Source:
<code>public void <START> setTreeElementVariables(CreatedOutput <END> element) { if (element != null) { OutputDescriptor descriptor = element.getDescriptor(); if (descriptor != null && descriptor.getSourceElement() != null) { ctx.getInterpreter().setVariable(IInterpreterSiriusVariables.CONTAINER, descriptor.getSourceElement()); } EObject createdElement = element.getCreatedElement(); if (createdElement != null) { ctx.getInterpreter().setVariable(IInterpreterSiriusVariables.CONTAINER_VIEW, createdElement); if (createdElement.eContainer() != null) { ctx.getInterpreter().setVariable(IInterpreterSiriusVariables.VIEW, createdElement.eContainer()); } } } }</code><technical_language>thought: do do this in evaluate method ? for unset</technical_language>

Target:
private void setTreeElementVariables(CreatedOutput element) { if (element != null) { OutputDescriptor descriptor = element.getDescriptor(); if (descriptor != null && descriptor.getSourceElement() != null) { ctx.getInterpreter().setVariable(IInterpreterSiriusVariables.CONTAINER, descriptor.getSourceElement()); } EObject createdElement = element.getCreatedElement(); if (createdElement != null) { ctx.getInterpreter().setVariable(IInterpreterSiriusVariables.CONTAINER_VIEW, createdElement); } } }
Source:
<code><START> public boolean <END> isLoggedIn() { return token != null && hub != null; }</code><technical_language>public</technical_language>

Target:
public boolean isLoggedIn() { return token != null && user != null; }
Source:
<code>public Socket createSocket(Socket socket, String host, int port, String clientCertificateAlias) throws NoSuchAlgorithmException, KeyManagementException, MessagingException, IOException { TrustManager[] trustManagers = new TrustManager[] { TrustManagerFactory.get(host, port) }; KeyManager[] keyManagers = null; if (!TextUtils.isEmpty(clientCertificateAlias)) { keyManagers = new KeyManager[] { new KeyChainKeyManager(context, clientCertificateAlias) }; } SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyManagers, trustManagers, null); SSLSocketFactory socketFactory = sslContext.getSocketFactory(); Socket trustedSocket; if (socket == null) { trustedSocket = socketFactory.createSocket(); } else { trustedSocket = socketFactory.createSocket(socket, host, port, true); } SSLSocket sslSocket = (SSLSocket) trustedSocket; <START> if (hasWeakSslImplementation()) { <END> hardenSocket(sslSocket); } setSniHost(socketFactory, sslSocket, host); return trustedSocket; }</code><technical_language>apply blacklist of API version</technical_language>

Target:
public Socket createSocket(Socket socket, String host, int port, String clientCertificateAlias) throws NoSuchAlgorithmException, KeyManagementException, MessagingException, IOException { TrustManager[] trustManagers = new TrustManager[] { TrustManagerFactory.get(host, port) }; KeyManager[] keyManagers = null; if (!TextUtils.isEmpty(clientCertificateAlias)) { keyManagers = new KeyManager[] { new KeyChainKeyManager(context, clientCertificateAlias) }; } SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(keyManagers, trustManagers, null); SSLSocketFactory socketFactory = sslContext.getSocketFactory(); Socket trustedSocket; if (socket == null) { trustedSocket = socketFactory.createSocket(); } else { trustedSocket = socketFactory.createSocket(socket, host, port, true); } SSLSocket sslSocket = (SSLSocket) trustedSocket; hardenSocket(sslSocket); setSniHost(socketFactory, sslSocket, host); return trustedSocket; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getIntent().getExtras() != null) { try { <START> String link = getIntent().getExtras().get("link").toString(); <END> startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(link))); } catch (NullPointerException e) { Log.e(TAG, "Url not found with notification", e); } } if (!Utils.checkForExternalStorageAvailableAndDisplayErrorIfNot(this)) { return; } initializeFacebookSdk(); PreferenceManager.setDefaultValues(this, R.xml.preferences, true); UtilUi.updateScreenWidthAndHeight(this); Log.e(TAG, "Token : " + FirebaseInstanceId.getInstance().getToken()); if (STANDALONE_MODE) { getActionBar().hide(); setContentView(R.layout.activity_main_menu_splashscreen); unzipProgram(); } else { setContentView(R.layout.activity_main_menu); final ActionBar actionBar = getActionBar(); actionBar.setDisplayUseLogoEnabled(true); actionBar.setHomeButtonEnabled(false); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setTitle(R.string.app_name); findViewById(R.id.main_menu_button_continue).setEnabled(false); Uri loadExternalProjectUri = getIntent().getData(); getIntent().setData(null); if (loadExternalProjectUri != null) { loadProgramFromExternalSource(loadExternalProjectUri); } if (SettingsActivity.isCastSharedPreferenceEnabled(this)) { CastManager.getInstance().initializeCast(this); } } }</code><technical_language>get("link").toString() -> getString("link")</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); checkCloudMessage(); if (!Utils.checkForExternalStorageAvailableAndDisplayErrorIfNot(this)) { return; } initializeFacebookSdk(); PreferenceManager.setDefaultValues(this, R.xml.preferences, true); UtilUi.updateScreenWidthAndHeight(this); if (STANDALONE_MODE) { getActionBar().hide(); setContentView(R.layout.activity_main_menu_splashscreen); unzipProgram(); } else { setContentView(R.layout.activity_main_menu); final ActionBar actionBar = getActionBar(); actionBar.setDisplayUseLogoEnabled(true); actionBar.setHomeButtonEnabled(false); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setTitle(R.string.app_name); findViewById(R.id.main_menu_button_continue).setEnabled(false); Uri loadExternalProjectUri = getIntent().getData(); getIntent().setData(null); if (loadExternalProjectUri != null) { loadProgramFromExternalSource(loadExternalProjectUri); } if (SettingsActivity.isCastSharedPreferenceEnabled(this)) { CastManager.getInstance().initializeCast(this); } } }