Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
25,900 | String () { return myVariable; } | getVariable |
25,901 | String () { return myRelatedPath; } | getRelatedPath |
25,902 | void (final List<? super String> paths, final String rootPath, @Nullable Processor<? super String> progressUpdater) { if (progressUpdater != null) { progressUpdater.process(rootPath); } final String project = findProjectName(rootPath); if (project != null) { paths.add(rootPath); } final File root = new File(rootPath); if (root.isDirectory()) { final File[] files = root.listFiles(); if (files != null) { for (File file : files) { findModuleRoots(paths, file.getPath(), progressUpdater); } } } } | findModuleRoots |
25,903 | String (String rootPath) { String name = null; final File file = new File(rootPath, DOT_PROJECT_EXT); if (file.isFile()) { try { name = JDOMUtil.load(file).getChildText(NAME_TAG); if (StringUtil.isEmptyOrSpaces(name)) { return null; } name = name.replace("\n", " ").trim(); } catch (JDOMException | IOException e) { return null; } } return name; } | findProjectName |
25,904 | LinkedResource (@NotNull String projectPath, @NotNull String relativePath) { String independentPath = FileUtil.toSystemIndependentName(relativePath); @NotNull String resourceName = independentPath; final int idx = independentPath.indexOf('/'); if (idx != -1) { resourceName = independentPath.substring(0, idx); } final File file = new File(projectPath, DOT_PROJECT_EXT); if (file.isFile()) { try { for (Element o : JDOMUtil.load(file).getChildren(LINKED_RESOURCES)) { for (Element l : o.getChildren(LINK)) { if (Comparing.strEqual(l.getChildText(NAME_TAG), resourceName)) { LinkedResource linkedResource = new LinkedResource(); final String relativeToLinkedResourcePath = independentPath.length() > resourceName.length() ? independentPath.substring(resourceName.length()) : ""; final Element locationURI = l.getChild("locationURI"); if (locationURI != null) { linkedResource.setURI(FileUtil.toSystemIndependentName(locationURI.getText()) + relativeToLinkedResourcePath); } final Element location = l.getChild("location"); if (location != null) { linkedResource.setLocation(FileUtil.toSystemIndependentName(location.getText()) + relativeToLinkedResourcePath); } return linkedResource; } } } } catch (Exception ignore) { } } return null; } | findLinkedResource |
25,905 | String () { final int idx = myURI.indexOf('/'); return idx > -1 ? myURI.substring(0, idx) : myURI; } | getVariableName |
25,906 | String () { final int idx = myURI.indexOf('/'); return idx > -1 && idx + 1 < myURI.length() ? myURI.substring(idx + 1) : null; } | getRelativeToVariablePath |
25,907 | boolean () { return myURI != null; } | containsPathVariable |
25,908 | void (String URI) { myURI = URI; } | setURI |
25,909 | String () { return myLocation; } | getLocation |
25,910 | void (String location) { myLocation = location; } | setLocation |
25,911 | String (String path) { int secondSlIdx = path.indexOf('/', 1); return secondSlIdx > 1 ? path.substring(1, secondSlIdx) : path.substring(1); } | getRelativeModuleName |
25,912 | String (String path) { final int secondSlIdx = path.indexOf('/', 1); return secondSlIdx != -1 && secondSlIdx + 1 < path.length() ? path.substring(secondSlIdx + 1) : null; } | getRelativeToModulePath |
25,913 | String (final @NotNull List<String> currentRoots, final @NotNull String rootPath, final @Nullable String relativeToRootPath) { for (String currentRoot : currentRoots) { if (currentRoot.endsWith(rootPath) || Comparing.strEqual(rootPath, EclipseProjectFinder.findProjectName(currentRoot))) { //rootPath = content_root <=> applicable root: abs_path/content_root if (relativeToRootPath == null) { return pathToUrl(currentRoot); } final File relativeToOtherModuleFile = new File(currentRoot, relativeToRootPath); if (relativeToOtherModuleFile.exists()) { return pathToUrl(relativeToOtherModuleFile.getPath()); } } } return null; } | expandEclipseRelative2ContentRoots |
25,914 | void (Element root, T model, @Nullable SdkType projectSdkType) { setupJdk(root, model, projectSdkType); setupCompilerOutputs(root, model); readContentEntry(root, model); } | updateEntries |
25,915 | void (Element root, T model) { List<Element> entriesElements = root.getChildren(IdeaXml.CONTENT_ENTRY_TAG); if (entriesElements.isEmpty()) { // todo C[] entries = getEntries(model); if (entries.length > 0) { readContentEntry(root, entries[0], model); } } else { for (Element element : entriesElements) { readContentEntry(element, createContentEntry(model, element.getAttributeValue(IdeaXml.URL_ATTR)), model); } } } | readContentEntry |
25,916 | void (Element root, @NotNull Map<String, String> levels) { } | readLibraryLevels |
25,917 | void (@NotNull JpsModule module, @Nullable String classpathDir, @NotNull String baseModulePath, JpsMacroExpander expander, List<String> paths, JpsSdkType<?> projectSdkType) { final JpsDependenciesList dependenciesList = module.getDependenciesList(); dependenciesList.clear(); try { if (classpathDir == null) classpathDir = baseModulePath; final File classpathFile = new File(classpathDir, EclipseXml.DOT_CLASSPATH_EXT); if (!classpathFile.exists()) return; //no classpath file - no compilation final String eml = module.getName() + EclipseXml.IDEA_SETTINGS_POSTFIX; final File emlFile = new File(baseModulePath, eml); final Map<String, String> levels = new HashMap<>(); final JpsIdeaSpecificSettings settings; final Element root; if (emlFile.isFile()) { root = JDOMUtil.load(emlFile); settings = new JpsIdeaSpecificSettings(expander); settings.initLevels(root, module, levels); } else { settings = null; root = null; } final JpsEclipseClasspathReader reader = new JpsEclipseClasspathReader(classpathDir, paths, new HashSet<>(), levels); reader.readClasspath(module, null, JDOMUtil.load(classpathFile), expander);//todo if (settings != null) { settings.updateEntries(root, module, projectSdkType); } } catch (Exception e) { LOG.info(e); throw new RuntimeException(e); } } | loadClasspath |
25,918 | JpsModuleClasspathSerializer () { return CLASSPATH_SERIALIZER; } | getClasspathSerializer |
25,919 | String (String url) { //strip path inside jar final String jarSeparator = "!/"; final int localPathEndIdx = url.indexOf(jarSeparator); if (localPathEndIdx > -1) { return url.substring(0, localPathEndIdx + jarSeparator.length()); } return url; } | prepareValidUrlInsideJar |
25,920 | void (JpsModule rootModel, Collection<? super String> unknownLibraries, boolean exported, String name, boolean applicationLevel) { if (LOG.isDebugEnabled()) { LOG.debug("loading " + rootModel.getName() + ": adding " + (applicationLevel ? "application" : "project") + " library '" + name + "'"); } JpsElementFactory factory = JpsElementFactory.getInstance(); JpsLibraryReference libraryReference; final String level = myLibLevels.get(name); libraryReference = level != null ? factory.createLibraryReference(name, JpsLibraryTableSerializer.createLibraryTableReference(level)) : factory.createLibraryReference(name, factory.createGlobalReference()); final JpsLibraryDependency dependency = rootModel.getDependenciesList().addLibraryDependency(libraryReference); setLibraryEntryExported(dependency, exported); } | addNamedLibrary |
25,921 | void (JpsModule rootModel, boolean exported, String moduleName) { final JpsElementFactory elementFactory = JpsElementFactory.getInstance(); final JpsDependenciesList dependenciesList = rootModel.getDependenciesList(); final JpsModuleDependency dependency = dependenciesList.addModuleDependency(elementFactory.createModuleReference(moduleName)); final JpsJavaDependencyExtension extension = getService().getOrCreateDependencyExtension(dependency); extension.setExported(exported); } | addInvalidModuleEntry |
25,922 | void (JpsModule rootModel, Collection<? super String> unknownJdks, EclipseModuleManager eclipseModuleManager, String jdkName) { if (LOG.isDebugEnabled()) { LOG.debug("loading " + rootModel.getName() + ": set module jdk " + jdkName); } rootModel.getDependenciesList().addSdkDependency(JpsJavaSdkType.INSTANCE); } | setUpModuleJdk |
25,923 | void (JpsModule rootModel, String srcUrl, boolean testFolder) { rootModel.addSourceRoot(srcUrl, testFolder ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE); } | addSourceFolder |
25,924 | void (JpsModule rootModel, String srcUrl, boolean testFolder) { rootModel.addSourceRoot(srcUrl, testFolder ? JavaSourceRootType.TEST_SOURCE : JavaSourceRootType.SOURCE); } | addSourceFolderToCurrentContentRoot |
25,925 | void (JpsModule rootModel, String junitName, ExpandMacroToPathMap macroMap) { final @NonNls String ideaHome = macroMap.substitute("$APPLICATION_HOME_DIR$", SystemInfo.isFileSystemCaseSensitive); final FilenameFilter junitFilter = (dir, name) -> name.startsWith("junit"); File[] junitJars = new File(ideaHome, "lib").listFiles(junitFilter); if (junitJars == null || junitJars.length == 0) { junitJars = new File(new File(ideaHome, "community"), "lib").listFiles(junitFilter); } if (junitJars != null && junitJars.length > 0) { final boolean isJUnit4 = junitName.contains("4"); File junitJar = null; for (File jar : junitJars) { final boolean isCurrentJarV4 = jar.getName().contains("4"); if (isCurrentJarV4 && isJUnit4 || !isCurrentJarV4 && !isJUnit4) { junitJar = jar; break; } } if (junitJar != null) { final JpsLibrary jpsLibrary = rootModel.addModuleLibrary(junitName, JpsJavaLibraryType.INSTANCE); jpsLibrary.addRoot(pathToUrl(junitJar.getPath()), JpsOrderRootType.COMPILED); final JpsDependenciesList dependenciesList = rootModel.getDependenciesList(); dependenciesList.addLibraryDependency(jpsLibrary); } } } | addJUnitDefaultLib |
25,926 | void (JpsModule rootModel, Element element, boolean exported, String libName, String url, String srcUrl, String nativeRoot, ExpandMacroToPathMap macroMap) { final JpsLibrary jpsLibrary = rootModel.addModuleLibrary(libName, JpsJavaLibraryType.INSTANCE); final JpsDependenciesList dependenciesList = rootModel.getDependenciesList(); final JpsLibraryDependency dependency = dependenciesList.addLibraryDependency(jpsLibrary); url = StringUtil.trimStart(url, "file://"); final String linked = expandLinkedResourcesPath(url, macroMap); if (linked != null) { url = pathToUrl(linked); } else { url = expandEclipsePath2Url(rootModel, url); } LOG.debug("loading " + rootModel.getName() + ": adding module library " + libName + ": " + url); jpsLibrary.addRoot(url, JpsOrderRootType.COMPILED); setLibraryEntryExported(dependency, exported); } | addModuleLibrary |
25,927 | String (JpsModule rootModel, String path) { String url = null; if (new File(path).exists()) { //absolute path url = pathToUrl(path); } else { final String relativePath = new File(myRootPath, path).getPath(); //inside current project final File file = new File(relativePath); if (file.exists()) { url = pathToUrl(relativePath); } else if (path.startsWith("/")) { //relative to other project final String moduleName = EPathCommonUtil.getRelativeModuleName(path); final String relativeToRootPath = EPathCommonUtil.getRelativeToModulePath(path); url = EPathCommonUtil.expandEclipseRelative2ContentRoots(myCurrentRoots, moduleName, relativeToRootPath); } } if (url == null) { url = pathToUrl(path); } return prepareValidUrlInsideJar(url); } | expandEclipsePath2Url |
25,928 | Set<String> () { return Collections.emptySet(); } | getDefinedCons |
25,929 | int (JpsModule rootModel) { return 0; } | rearrange |
25,930 | String (final String path, ExpandMacroToPathMap expander) { final EclipseProjectFinder.LinkedResource linkedResource = EclipseProjectFinder.findLinkedResource(myRootPath, path); if (linkedResource != null) { if (linkedResource.containsPathVariable()) { final String toPathVariableFormat = getVariableRelatedPath(linkedResource.getVariableName(), linkedResource.getRelativeToVariablePath()); return expander.substitute(toPathVariableFormat, SystemInfo.isFileSystemCaseSensitive); } return linkedResource.getLocation(); } return null; } | expandLinkedResourcesPath |
25,931 | void (JpsModule rootModel, final String path) { final JpsJavaModuleExtension extension = getService().getOrCreateModuleExtension(rootModel); String outputUrl = pathToUrl(path); extension.setOutputUrl(outputUrl); extension.setTestOutputUrl(outputUrl); //extension.setInheritOutput(false); rootModel.getDependenciesList().addModuleSourceDependency(); } | setupOutput |
25,932 | void (final JpsDependencyElement dependency, boolean exported) { final JpsJavaDependencyExtension extension = getService().getOrCreateDependencyExtension(dependency); extension.setExported(exported); } | setLibraryEntryExported |
25,933 | JpsJavaExtensionService () { return JpsJavaExtensionService.getInstance(); } | getService |
25,934 | void (Element root, @NotNull Map<String, String> levels) { final Element levelsElement = root.getChild("levels"); if (levelsElement != null) { for (Element element : levelsElement.getChildren("level")) { String libName = element.getAttributeValue("name"); String libLevel = element.getAttributeValue("value"); if (libName != null && libLevel != null) { levels.put(libName, libLevel); } } } } | readLibraryLevels |
25,935 | String[] (JpsModule model) { return ArrayUtilRt.toStringArray(model.getContentRootsList().getUrls()); } | getEntries |
25,936 | String (JpsModule model, String url) { model.getContentRootsList().addUrl(url); return url; } | createContentEntry |
25,937 | void (Element root, JpsModule model) {} | setupLibraryRoots |
25,938 | void (Element root, JpsModule model, @Nullable JpsSdkType<?> projectSdkType) { final String inheritJdk = root.getAttributeValue("inheritJdk"); final JpsDependenciesList dependenciesList = model.getDependenciesList(); if (inheritJdk != null && Boolean.parseBoolean(inheritJdk)) { dependenciesList.addSdkDependency(projectSdkType != null ? projectSdkType : JpsJavaSdkType.INSTANCE); } else { final String jdkName = root.getAttributeValue("jdk"); if (jdkName != null) { String jdkType = root.getAttributeValue("jdk_type"); JpsSdkType<?> sdkType = null; if (jdkType != null) { sdkType = JpsSdkTableSerializer.getSdkType(jdkType); } if (sdkType == null) { sdkType = JpsJavaSdkType.INSTANCE; } dependenciesList.addSdkDependency(sdkType); JpsSdkTableSerializer.setSdkReference(model.getSdkReferencesTable(), jdkName, sdkType); if (sdkType instanceof JpsJavaSdkTypeWrapper) { dependenciesList.addSdkDependency(JpsJavaSdkType.INSTANCE); } } } } | setupJdk |
25,939 | void (Element root, JpsModule model) { final JpsJavaModuleExtension extension = getService().getOrCreateModuleExtension(model); final Element testOutputElement = root.getChild(IdeaXml.OUTPUT_TEST_TAG); if (testOutputElement != null) { extension.setTestOutputUrl(testOutputElement.getAttributeValue(IdeaXml.URL_ATTR)); } final String inheritedOutput = root.getAttributeValue(JpsJavaModelSerializerExtension.INHERIT_COMPILER_OUTPUT_ATTRIBUTE); if (inheritedOutput != null && Boolean.parseBoolean(inheritedOutput)) { extension.setInheritOutput(true); } extension.setExcludeOutput(root.getChild(IdeaXml.EXCLUDE_OUTPUT_TAG) != null); } | setupCompilerOutputs |
25,940 | void (Element root, JpsModule model) { final String languageLevel = root.getAttributeValue("LANGUAGE_LEVEL"); final JpsJavaModuleExtension extension = getService().getOrCreateModuleExtension(model); if (languageLevel != null) { extension.setLanguageLevel(LanguageLevel.valueOf(languageLevel)); } } | readLanguageLevel |
25,941 | void (Element root, JpsModule model) { myExpander.substitute(root, SystemInfo.isFileSystemCaseSensitive); } | expandElement |
25,942 | void (Element root, JpsModule model) {} | overrideModulesScopes |
25,943 | void (Element root, String contentUrl, JpsModule model) { for (Element o : root.getChildren(IdeaXml.TEST_FOLDER_TAG)) { final String url = o.getAttributeValue(IdeaXml.URL_ATTR); JpsModuleSourceRoot folderToBeTest = null; for (JpsModuleSourceRoot folder : model.getSourceRoots()) { if (Comparing.strEqual(folder.getUrl(), url)) { folderToBeTest = folder; break; } } if (folderToBeTest != null) { model.removeSourceRoot(folderToBeTest.getUrl(), JavaSourceRootType.SOURCE); } model.addSourceRoot(url, JavaSourceRootType.TEST_SOURCE); } for (Element o : root.getChildren(IdeaXml.EXCLUDE_FOLDER_TAG)) { final String excludeUrl = o.getAttributeValue(IdeaXml.URL_ATTR); if (FileUtil.isAncestor(new File(contentUrl), new File(excludeUrl), false)) { model.getExcludeRootsList().addUrl(excludeUrl); } } for (Element ppElement : root.getChildren(IdeaXml.PACKAGE_PREFIX_TAG)) { final String prefix = ppElement.getAttributeValue(IdeaXml.PACKAGE_PREFIX_VALUE_ATTR); final String url = ppElement.getAttributeValue(IdeaXml.URL_ATTR); for (JpsModuleSourceRoot sourceRoot : model.getSourceRoots()) { if (Comparing.strEqual(sourceRoot.getUrl(), url)) { JpsElement properties = sourceRoot.getProperties(); if (properties instanceof JavaSourceRootProperties) { ((JavaSourceRootProperties)properties).setPackagePrefix(prefix); } break; } } } } | readContentEntry |
25,944 | JpsJavaExtensionService () { return JpsJavaExtensionService.getInstance(); } | getService |
25,945 | void (Format newFormat) { this.userFormat = newFormat; this.currentFormat = userFormat; } | setFormat |
25,946 | Format () { return (Format)userFormat; } | getFormat |
25,947 | String (Document doc) { StringWriter out = new StringWriter(); try { output(doc, out); // output() flushes } catch (IOException e) { } return out.toString(); } | outputString |
25,948 | String (DocType doctype) { StringWriter out = new StringWriter(); try { output(doctype, out); // output() flushes } catch (IOException e) { } return out.toString(); } | outputString |
25,949 | String (Element element) { StringWriter out = new StringWriter(); try { output(element, out); // output() flushes } catch (IOException e) { } return out.toString(); } | outputString |
25,950 | String (List list) { StringWriter out = new StringWriter(); try { output(list, out); // output() flushes } catch (IOException e) { } return out.toString(); } | outputString |
25,951 | String (CDATA cdata) { StringWriter out = new StringWriter(); try { output(cdata, out); // output() flushes } catch (IOException e) { } return out.toString(); } | outputString |
25,952 | String (Text text) { StringWriter out = new StringWriter(); try { output(text, out); // output() flushes } catch (IOException e) { } return out.toString(); } | outputString |
25,953 | String (EntityRef entity) { StringWriter out = new StringWriter(); try { output(entity, out); // output() flushes } catch (IOException e) { } return out.toString(); } | outputString |
25,954 | int (List content, int start) { if (start < 0) { start = 0; } int index = start; int size = content.size(); //if (currentFormat.mode == Format.TextMode.TRIM_FULL_WHITE // || currentFormat.mode == Format.TextMode.NORMALIZE // || currentFormat.mode == Format.TextMode.TRIM) { while (index < size) { if (!isAllWhitespace(content.get(index))) { return index; } index++; } //} return index; } | skipLeadingWhite |
25,955 | int (List content, int start) { int size = content.size(); if (start > size) { start = size; } int index = start; //if (currentFormat.mode == Format.TextMode.TRIM_FULL_WHITE // || currentFormat.mode == Format.TextMode.NORMALIZE // || currentFormat.mode == Format.TextMode.TRIM) { while (index >= 0) { if (!isAllWhitespace(content.get(index - 1))) { break; } --index; } //} return index; } | skipTrailingWhite |
25,956 | int (List content, int start) { if (start < 0) { start = 0; } int index = start; int size = content.size(); while (index < size) { Object node = content.get(index); if (!((node instanceof Text) || (node instanceof EntityRef))) { return index; } index++; } return size; } | nextNonText |
25,957 | boolean (Object obj) { String str = null; if (obj instanceof String) { str = (String)obj; } else if (obj instanceof Text) { str = ((Text)obj).getText(); } else if (obj instanceof EntityRef) { return false; } else { return false; } for (int i = 0; i < str.length(); i++) { if (!isWhitespace(str.charAt(i))) { return false; } } return true; } | isAllWhitespace |
25,958 | boolean (String str) { if ((str != null) && (str.length() > 0) && isWhitespace(str.charAt(0))) { return true; } return false; } | startsWithWhite |
25,959 | boolean (String str) { if ((str != null) && (str.length() > 0) && isWhitespace(str.charAt(str.length() - 1))) { return true; } return false; } | endsWithWhite |
25,960 | boolean (char c) { if (c == ' ' || c == '\n' || c == '\t' || c == '\r') { return true; } return false; } | isWhitespace |
25,961 | String (String str) { StringBuffer buffer; char ch; String entity; //EscapeStrategy strategy = currentFormat.escapeStrategy; buffer = null; for (int i = 0; i < str.length(); i++) { ch = str.charAt(i); switch (ch) { case '<': entity = "<"; break; case '>': entity = ">"; break; /* case '\'' : entity = "'"; break; */ case '\"': entity = """; break; case '&': entity = "&"; break; case '\r': entity = "
"; break; case '\t': entity = "	"; break; case '\n': entity = "
"; break; default: //if (strategy.shouldEscape(ch)) { // entity = "&#x" + Integer.toHexString(ch) + ";"; //} //else { entity = null; //} break; } if (buffer == null) { if (entity != null) { // An entity occurred, so we'll have to use StringBuffer // (allocate room for it plus a few more entities). buffer = new StringBuffer(str.length() + 20); // Copy previous skipped characters and fall through // to pickup current character buffer.append(str, 0, i); buffer.append(entity); } } else { if (entity == null) { buffer.append(ch); } else { buffer.append(entity); } } } // If there were any entities, return the escaped characters // that we put in the StringBuffer. Otherwise, just return // the unmodified input string. return (buffer == null) ? str : buffer.toString(); } | escapeAttributeEntities |
25,962 | String (String str) { if (escapeOutput == false) return str; StringBuffer buffer; char ch; String entity; //EscapeStrategy strategy = currentFormat.escapeStrategy; buffer = null; for (int i = 0; i < str.length(); i++) { ch = str.charAt(i); switch (ch) { case '<': entity = "<"; break; case '>': entity = ">"; break; case '&': entity = "&"; break; case '\r': entity = "
"; break; case '\n': entity = getLineSeparator(); break; default: //if (strategy.shouldEscape(ch)) { // entity = "&#x" + Integer.toHexString(ch) + ";"; //} //else { entity = null; //} break; } if (buffer == null) { if (entity != null) { // An entity occurred, so we'll have to use StringBuffer // (allocate room for it plus a few more entities). buffer = new StringBuffer(str.length() + 20); // Copy previous skipped characters and fall through // to pickup current character buffer.append(str, 0, i); buffer.append(entity); } } else { if (entity == null) { buffer.append(ch); } else { buffer.append(entity); } } } // If there were any entities, return the escaped characters // that we put in the StringBuffer. Otherwise, just return // the unmodified input string. return (buffer == null) ? str : buffer.toString(); } | escapeElementEntities |
25,963 | Object () { // Implementation notes: Since all state of an XMLOutputter is // embodied in simple private instance variables, Object.clone // can be used. Note that since Object.clone is totally // broken, we must catch an exception that will never be // thrown. try { return super.clone(); } catch (java.lang.CloneNotSupportedException e) { // even though this should never ever happen, it's still // possible to fool Java into throwing a // CloneNotSupportedException. If that happens, we // shouldn't swallow it. throw new RuntimeException(e.toString()); } } | clone |
25,964 | String () { StringBuilder buffer = new StringBuilder(); for (int i = 0; i < userFormat.lineSeparator.length(); i++) { char ch = userFormat.lineSeparator.charAt(i); switch (ch) { case '\r': buffer.append("\\r"); break; case '\n': buffer.append("\\n"); break; case '\t': buffer.append("\\t"); break; default: buffer.append("[" + ((int)ch) + "]"); break; } } return ( "XMLOutputter[omitDeclaration = " + false + ", " + "encoding = " + CharsetToolkit.UTF8 + ", " + "omitEncoding = " + false + ", " + "indent = '" + "\t" + "'" + ", " + "expandEmptyElements = " + userFormat.expandEmptyElements + ", " + "lineSeparator = '" + buffer.toString() + "', " + "textMode = " + userFormat.mode + "]" ); } | toString |
25,965 | EclipseNamespaceStack () { // actually returns a XMLOutputter.NamespaceStack (see below) return new EclipseNamespaceStack(); } | createNamespaceStack |
25,966 | String () { return prefix + "&" + uri; } | toString |
25,967 | void (Namespace ns) { myNamespaces.push(new NamespaceInfo(ns.getPrefix(), ns.getURI())); } | push |
25,968 | String () { return myNamespaces.pop().prefix; } | pop |
25,969 | int () { return myNamespaces.size(); } | size |
25,970 | String (String prefix) { Iterator<NamespaceInfo> iterator = myNamespaces.descendingIterator(); while (iterator.hasNext()) { NamespaceInfo ns = iterator.next(); if (ns.prefix.equals(prefix)) { return ns.uri; } } return null; } | getURI |
25,971 | String () { StringBuilder buf = new StringBuilder(); String sep = System.lineSeparator(); buf.append("Stack: ").append(myNamespaces.size()).append(sep); for (NamespaceInfo info : myNamespaces) { buf.append(info).append(sep); } return buf.toString(); } | toString |
25,972 | EclipseXMLOutputter (String lineSeparator) { EclipseXMLOutputter xmlOutputter = new EclipseXMLOutputter(lineSeparator); Format format = Format.getCompactFormat(). setIndent("\t"). setTextMode(Format.TextMode.NORMALIZE). setEncoding(CharsetToolkit.UTF8). setOmitEncoding(false). setOmitDeclaration(false); xmlOutputter.setFormat(format); return xmlOutputter; } | createOutputter |
25,973 | void () { defaultImpl = null; } | release |
25,974 | void (Level level, @NonNls String module, @NonNls String context, @NonNls String message) { if (defaultImpl != null) { defaultImpl.report(level, module, context, message); } } | report |
25,975 | void (Level level, @NonNls String module, @NonNls String context, Exception e) { String message = e.getMessage(); report(level, module, context, message == null ? e.getClass().toString() : FileUtil.toSystemIndependentName(message)); } | report |
25,976 | String (@NotNull String path) { path = FileUtil.toSystemIndependentName(path); path = StringUtil.trimEnd(path, "/"); while (path.contains("/./")) { path = path.replace("/./", "/"); } path = StringUtil.trimStart(path, "./"); path = StringUtil.trimEnd(path, "/."); while (true) { int index = path.indexOf("/.."); if (index < 0) break; int slashIndex = path.substring(0, index).lastIndexOf('/'); if (slashIndex < 0) break; path = path.substring(0, slashIndex) + path.substring(index + 3); } return path; } | normalize |
25,977 | String (@NotNull String baseRoot, @NotNull String path) { baseRoot = normalize(baseRoot); path = normalize(path); int prefix = findCommonPathPrefixLength(baseRoot, path); if (prefix != 0) { baseRoot = baseRoot.substring(prefix); path = path.substring(prefix); if (!baseRoot.isEmpty()) { return normalize(revertRelativePath(baseRoot.substring(1)) + path); } else if (!path.isEmpty()) { return path.substring(1); } else { return "."; } } if (FileUtil.isAbsolute(path)) { return path; } return normalize(revertRelativePath(baseRoot) + "/" + path); } | getRelative |
25,978 | int (@NotNull String path1, @NotNull String path2) { int end = -1; do { int beg = end + 1; int new_end = endOfToken(path1, beg); if (new_end != endOfToken(path2, beg) || !path1.substring(beg, new_end).equals(path2.substring(beg, new_end))) { break; } end = new_end; } while (end != path1.length()); return Math.max(end, 0); } | findCommonPathPrefixLength |
25,979 | int (String s, int index) { index = s.indexOf('/', index); return index == -1 ? s.length() : index; } | endOfToken |
25,980 | String (@NotNull String path) { if (path.equals(".")) { return path; } else { StringBuilder sb = new StringBuilder(); sb.append(".."); int count = normalize(path).split("/").length; while (--count > 0) { sb.append("/.."); } return sb.toString(); } } | revertRelativePath |
25,981 | String () { return JpsEclipseClasspathSerializer.CLASSPATH_STORAGE_ID; } | getID |
25,982 | String () { return getDescr(); } | getDescription |
25,983 | void (@NotNull Module module) { EclipseModuleManagerImpl.getInstance(module).setDocumentSet(null); updateEntitySource(module, source -> ((EclipseProjectFile)source).getInternalSource()); } | detach |
25,984 | void (Module module, Function<? super EntitySource, ? extends EntitySource> updateSource) { ModuleBridge moduleBridge = (ModuleBridge)module; EntityStorage moduleEntityStorage = moduleBridge.getEntityStorage().getCurrent(); ModuleEntity moduleEntity = ModuleBridgeUtils.findModuleEntity(moduleBridge, moduleEntityStorage); if (moduleEntity != null) { EntitySource entitySource = moduleEntity.getEntitySource(); ModuleManagerBridgeImpl .changeModuleEntitySource(moduleBridge, moduleEntityStorage, updateSource.apply(entitySource), moduleBridge.getDiff()); } } | updateEntitySource |
25,985 | void (@NotNull ModuleRootModel model) { updateEntitySource(model.getModule(), source -> { VirtualFileUrlManager virtualFileUrlManager = VirtualFileUrls.getVirtualFileUrlManager(model.getModule().getProject()); String contentRoot = getContentRoot(model); String classpathFileUrl = VfsUtilCore.pathToUrl(contentRoot) + "/" + EclipseXml.CLASSPATH_FILE; return new EclipseProjectFile(virtualFileUrlManager.fromUrl(classpathFileUrl), (JpsFileEntitySource)source); }); } | attach |
25,986 | String (@NotNull ModuleRootModel model) { VirtualFile contentRoot = EPathUtil.getContentRoot(model); return contentRoot == null ? model.getContentRoots()[0].getPath() : contentRoot.getPath(); } | getContentRoot |
25,987 | void (@NotNull Module module) { final EclipseModuleManagerImpl moduleManager = EclipseModuleManagerImpl.getInstance(module); if (moduleManager != null) { moduleManager.setDocumentSet(null); } } | modulePathChanged |
25,988 | CachedXmlDocumentSet (@NotNull Module module) { EclipseModuleManagerImpl moduleManager = EclipseModuleManagerImpl.getInstance(module); CachedXmlDocumentSet fileCache = moduleManager != null ? moduleManager.getDocumentSet() : null; if (fileCache == null) { fileCache = new CachedXmlDocumentSet(); if (moduleManager != null) { moduleManager.setDocumentSet(fileCache); } String storageRoot = ClasspathStorage.getStorageRootFromOptions(module); fileCache.register(EclipseXml.CLASSPATH_FILE, storageRoot); fileCache.register(EclipseXml.PROJECT_FILE, storageRoot); fileCache.register(EclipseXml.PLUGIN_XML_FILE, storageRoot); fileCache.register(module.getName() + EclipseXml.IDEA_SETTINGS_POSTFIX, ModuleUtilCore.getModuleDirPath(module)); } return fileCache; } | getFileCache |
25,989 | void (@NotNull Module module, @NotNull String oldName, @NotNull String newName) { try { CachedXmlDocumentSet fileSet = getFileCache(module); VirtualFile root = LocalFileSystem.getInstance().findFileByPath(ModuleUtilCore.getModuleDirPath(module)); VirtualFile source = root == null ? null : root.findChild(oldName + EclipseXml.IDEA_SETTINGS_POSTFIX); if (source != null && source.isValid()) { WriteAction.run(() -> source.rename(this, newName + EclipseXml.IDEA_SETTINGS_POSTFIX)); } DotProjectFileHelper.saveDotProjectFile(module, fileSet.getParent(EclipseXml.PROJECT_FILE)); fileSet.unregister(oldName + EclipseXml.IDEA_SETTINGS_POSTFIX); fileSet.register(newName + EclipseXml.IDEA_SETTINGS_POSTFIX, ModuleUtilCore.getModuleDirPath(module)); } catch (IOException e) { EclipseClasspathWriter.LOG.warn(e); } } | moduleRenamed |
25,990 | String () { return "Eclipse"; } | getName |
25,991 | String () { return EclipseBundle.message("filetype.eclipse.description"); } | getDescription |
25,992 | String () { return EclipseBundle.message("filetype.eclipse.display.name"); } | getDisplayName |
25,993 | String () { return EclipseXml.CLASSPATH_EXT; } | getDefaultExtension |
25,994 | Icon () { return AllIcons.Providers.Eclipse; } | getIcon |
25,995 | boolean () { return false; } | isBinary |
25,996 | String (@NotNull VirtualFile file, final byte @NotNull [] content) { return CharsetToolkit.UTF8; } | getCharset |
25,997 | EclipseModuleManagerImpl (Module module) { return module.getService(EclipseModuleManagerImpl.class); } | getInstance |
25,998 | boolean (@NotNull Module module) { return JpsEclipseClasspathSerializer.CLASSPATH_STORAGE_ID.equals(ClassPathStorageUtil.getStorageType(module)); } | isEclipseStorage |
25,999 | void (String invalidJdk) { myInvalidJdk = invalidJdk; } | setInvalidJdk |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.