Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
49,500
Vector<FileType> (Project project) { final Vector<FileType> v = new Vector<>(); final FileType[] fileTypes = FileTypeManager.getInstance().getRegisteredFileTypes(); for (FileType fileType : fileTypes) { // get rid of file types useless for highlighting if (fileType == StdFileTypes.CLASS || fileType == ProjectFileType.I...
getFileTypes
49,501
void (XsltRunConfiguration s) { myXsltFile.setText(s.getXsltFile()); myXmlInputFile.getComboBox().setSelectedItem(s.getXmlInputFile()); final VirtualFile xmlInputFile = s.findXmlInputFile(); if (xmlInputFile != null) { final Module contextModule = ProjectRootManager.getInstance(s.getProject()).getFileIndex().getModuleF...
resetFrom
49,502
void () { myOutputFile.setEnabled(mySaveToFile.isSelected()); myOpenOutputFile.setEnabled(mySaveToFile.isEnabled() && mySaveToFile.isSelected()); myOpenInBrowser.setEnabled(mySaveToFile.isEnabled() && mySaveToFile.isSelected()); final int selectedIndex = getSelectedIndex(myOutputOptions); final boolean b = selectedInde...
updateOutputState
49,503
void () { myModule.setEnabled(getSelectedIndex(myJdkOptions) == XsltRunConfiguration.JdkChoice.FROM_MODULE.ordinal()); myJDK.setEnabled(getSelectedIndex(myJdkOptions) == XsltRunConfiguration.JdkChoice.JDK.ordinal()); }
updateJdkState
49,504
Module () { final Object selectedItem = myModule.getSelectedItem(); return selectedItem instanceof Module ? (Module)selectedItem : null; }
getModule
49,505
String () { final JComboBox comboBox = myXmlInputFile.getComboBox(); final Object currentItem = comboBox.getEditor().getItem(); String s = (String)(currentItem != null ? currentItem : comboBox.getSelectedItem()); return s != null ? s : ""; }
getXmlInputFile
49,506
void (ButtonGroup group, int i) { final Enumeration<AbstractButton> buttons = group.getElements(); for (int j = 0; buttons.hasMoreElements(); j++) { group.setSelected(buttons.nextElement().getModel(), i == j); } }
setSelectedIndex
49,507
int (ButtonGroup group) { final ButtonModel selection = group.getSelection(); if (selection == null) return -1; final Enumeration<AbstractButton> buttons = group.getElements(); for (int i = 0; buttons.hasMoreElements(); i++) { final AbstractButton button = buttons.nextElement(); if (group.isSelected(button.getModel()))...
getSelectedIndex
49,508
void (@NotNull SdkComboBox comboBox, @Nullable Sdk sdk) { if (sdk == null) { comboBox.setSelectedItem(comboBox.showNoneSdkItem()); } else { comboBox.setSelectedSdk(sdk); } }
setSelectedSdkOrNone
49,509
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final Param param = (Param)o; return name.equals(param.name) && value.equals(param.value); }
equals
49,510
int () { int result = name.hashCode(); result = 29 * result + value.hashCode(); return result; }
hashCode
49,511
int () { return myParams.size(); }
getRowCount
49,512
int () { return 2; }
getColumnCount
49,513
String (int column) { return column == 0 ? XPathBundle.message("attribute.descriptor.name") : XPathBundle.message("value"); }
getColumnName
49,514
boolean (int rowIndex, int columnIndex) { return true; }
isCellEditable
49,515
void (Object aValue, int rowIndex, int columnIndex) { // can happen if param is deleted while editing it if (rowIndex >= myParams.size()) return; final Param param = myParams.get(rowIndex); final String value = (String)aValue; if (columnIndex == 0) { param.name = value; } else { param.value = value; } fireTableCellUpda...
setValueAt
49,516
Object (int rowIndex, int columnIndex) { final Param param = myParams.get(rowIndex); return columnIndex == 0 ? param.name : param.value; }
getValueAt
49,517
void () { myParams.add(new Param("Param" + (myParams.size() + 1), null)); fireTableRowsInserted(myParams.size() - 1, myParams.size() - 1); }
addParam
49,518
void (int selectedRow) { myParams.remove(selectedRow); fireTableRowsDeleted(selectedRow, selectedRow); }
removeParam
49,519
JComponent () { return myComponent; }
getComponent
49,520
void (@NotNull XsltRunConfiguration s) { myEditor.resetFrom(s); }
resetEditorFrom
49,521
JComponent () { myEditor = new Editor(myProject); return myEditor.getComponent(); }
createEditor
49,522
void () { myEditor = null; }
disposeEditor
49,523
void (String expression) { if (expression == null || "".equals(expression.trim())) { throw new InvalidExpressionException("expression == null or empty"); } expression = substituteMacrosesWithRegexps(expression); Pattern.compile(expression, Pattern.MULTILINE); }
validate
49,524
String (String expression) { int filePathIndex = expression.indexOf(FILE_PATH_MACROS); int lineIndex = expression.indexOf(LINE_MACROS); int columnIndex = expression.indexOf(COLUMN_MACROS); if (filePathIndex == -1) { throw new InvalidExpressionException("Expression must contain " + FILE_PATH_MACROS + " macros."); } expr...
substituteMacrosesWithRegexps
49,525
Result (@NotNull final String line, final int entireLength) { final Matcher matcher = myPattern.matcher(line); if (matcher.find()) { return createResult(matcher, entireLength - line.length()); } return null; }
applyFilter
49,526
Result (final Matcher matcher, final int entireLen) { final String filePath = matcher.group(myFileRegister); String lineNumber = "0"; String columnNumber = "0"; if (myLineRegister != -1) { lineNumber = matcher.group(myLineRegister); } if (myColumnRegister != -1) { columnNumber = matcher.group(myColumnRegister); } int l...
createResult
49,527
HyperlinkInfo (String fileName, final int line, int column) { if ((fileName == null || fileName.length() == 0)) { if (myBase != null) { fileName = myBase.getPresentableUrl(); } else { return null; } } fileName = fileName.replace(File.separatorChar, '/'); VirtualFile file; // try to interpret the filename as URL if (URL...
createOpenFileHyperlink
49,528
String[] () { return new String[] {FILE_PATH_MACROS, LINE_MACROS, COLUMN_MACROS}; }
getMacrosName
49,529
SettingsEditor<XsltRunConfiguration> () { return new XsltRunSettingsEditor(getProject()); }
getConfigurationEditor
49,530
void (final AdditionalTabComponentManager manager, ProcessHandler startedProcess) { if (myOutputType == OutputType.CONSOLE) { final HighlightingOutputConsole console = new HighlightingOutputConsole(getProject(), myFileType); XsltCommandLineState state = startedProcess.getUserData(XsltCommandLineState.STATE); boolean de...
createAdditionalTabComponents
49,531
RunConfiguration () { final XsltRunConfiguration configuration = (XsltRunConfiguration)super.clone(); configuration.myParameters = new ArrayList<>(myParameters); if (myXsltFile != null) configuration.myXsltFile = VirtualFilePointerManager.getInstance().duplicate(myXsltFile, getProject(), null); if (myXmlInputFile != nu...
clone
49,532
boolean (String file) { return file == null || file.length() == 0; }
isEmpty
49,533
FileType (String value) { if (value == null) return null; return FileTypeManager.getInstance().findFileTypeByName(value); }
getFileType
49,534
void (List<Pair<String, String>> params) { myParameters.clear(); myParameters.addAll(params); }
setParameters
49,535
String () { return myVmArguments; }
getVmArguments
49,536
void (String vmArguments) { myVmArguments = vmArguments; }
setVmArguments
49,537
void (@NotNull String xsltFile) { if (isEmpty(xsltFile)) { myXsltFile = null; } else { myXsltFile = VirtualFilePointerManager.getInstance().create(VfsUtilCore.pathToUrl(xsltFile).replace(File.separatorChar, '/'), getProject(), null); } }
setXsltFile
49,538
void (VirtualFile virtualFile) { myXsltFile = VirtualFilePointerManager.getInstance().create(virtualFile, getProject(), null); }
setXsltFile
49,539
VirtualFile () { return myXsltFile != null ? myXsltFile.getFile() : null; }
findXsltFile
49,540
VirtualFile () { return myXmlInputFile != null ? myXmlInputFile.getFile() : null; }
findXmlInputFile
49,541
FileType () { return myFileType; }
getFileType
49,542
void (@Nullable FileType fileType) { myFileType = fileType; }
setFileType
49,543
Module () { return myModule != null ? ModuleManager.getInstance(getProject()).findModuleByName(myModule) : null; }
getModule
49,544
Sdk () { return myJdk != null ? ProjectJdkTable.getInstance().findJdk(myJdk) : null; }
getJdk
49,545
void (@NotNull String xmlInputFile) { if (isEmpty(xmlInputFile)) { myXmlInputFile = null; } else { myXmlInputFile = VirtualFilePointerManager.getInstance().create(VfsUtilCore.pathToUrl(xmlInputFile).replace(File.separatorChar, '/'), getProject(), null); } }
setXmlInputFile
49,546
void (VirtualFile xmlInputFile) { myXmlInputFile = VirtualFilePointerManager.getInstance().create(xmlInputFile, getProject(), null); }
setXmlInputFile
49,547
void (Module module) { myModule = module != null ? module.getName() : null; }
setModule
49,548
void (Sdk projectJdk) { myJdk = projectJdk != null ? projectJdk.getName() : null; }
setJDK
49,549
OutputType () { return myOutputType; }
getOutputType
49,550
void (@NotNull OutputType outputType) { myOutputType = outputType; }
setOutputType
49,551
boolean () { return mySaveToFile; }
isSaveToFile
49,552
void (boolean saveToFile) { mySaveToFile = saveToFile; }
setSaveToFile
49,553
JdkChoice () { return myJdkChoice; }
getJdkChoice
49,554
void (@NotNull JdkChoice jdkChoice) { myJdkChoice = jdkChoice; }
setJdkChoice
49,555
Sdk () { if (myJdkChoice == JdkChoice.JDK) { return myJdk != null ? ProjectJdkTable.getInstance().findJdk(myJdk) : null; } Sdk jdk = null; final Module module = getEffectiveModule(); if (module != null) { jdk = ModuleRootManager.getInstance(module).getSdk(); } if (jdk == null) { jdk = ProjectRootManager.getInstance(get...
getEffectiveJDK
49,556
Module () { //assert myJdkChoice == JdkChoice.FROM_MODULE; Module module = myJdkChoice == JdkChoice.FROM_MODULE ? getModule() : null; if (module == null && myXsltFile != null) { final VirtualFile file = myXsltFile.getFile(); if (file != null) { final ProjectFileIndex index = ProjectRootManager.getInstance(getProject())...
getEffectiveModule
49,557
String () { return mySuggestedName; }
suggestedName
49,558
XsltRunConfiguration (@NotNull XmlFile file) { assert XsltSupport.isXsltFile(file) : "Not an XSLT file: " + file.getName(); mySuggestedName = file.getName(); setName(mySuggestedName); final VirtualFile virtualFile = file.getVirtualFile(); assert virtualFile != null : "No VirtualFile for " + file.getName(); setXsltFile(...
initFromFile
49,559
void (AnnotationHolder annotationHolder, PsiFile file) { final XPathExpression expression = ((XPathFile)file).getExpression(); if (expression != null) { if (!checkPattern(expression)) { annotationHolder.newAnnotation(HighlightSeverity.ERROR, XPathBundle.message("annotator.error.bad.pattern")).range(expression).create()...
validate
49,560
boolean (XPathExpression element) { if (element instanceof XPathBinaryExpression expression) { if (expression.getOperator() == XPathTokenTypes.UNION) { if (checkPattern(expression.getLOperand()) && checkPattern(expression.getROperand())) { return true; } } } else if (element instanceof XPathLocationPath) { return check...
checkPattern
49,561
boolean (XPathLocationPath locationPath) { final XPathStep step = locationPath.getFirstStep(); // missing step is already flagged by parser return step == null || checkStep(step); }
checkLocationPathPattern
49,562
boolean (XPathStep step) { XPathExpression prev = step.getPreviousStep(); if (prev instanceof XPathFilterExpression) { prev = ((XPathFilterExpression)prev).getExpression(); if (prev != null && !(prev instanceof XPathStep)) { // stuff like key('', '')[1]/xxx is invalid: "The filtered expression in a pattern must be a si...
checkStep
49,563
boolean (PsiElement child) { if (child instanceof XPathFunctionCall call) { final XPathExpression[] arguments = call.getArgumentList(); if ("id".equals(call.getFunctionName())) { if (arguments.length != 1) return false; return isIdValue(arguments[0]) ; } else if ("key".equals(call.getFunctionName())) { if (arguments.le...
checkIdKeyPattern
49,564
boolean (XPathExpression argument) { if (argument.getXPathContext() instanceof Xslt2ContextProvider) { return argument instanceof XPathString || argument instanceof XPathVariableReference; } else { return argument instanceof XPathString; } }
isIdValue
49,565
boolean (XPathExpression argument) { if (argument.getXPathContext() instanceof Xslt2ContextProvider) { return argument instanceof XPathString || argument instanceof XPathNumber || argument instanceof XPathVariableReference; } else { return argument instanceof XPathString; } }
isKeyValue
49,566
TextAttributesKey (String namespace, XmlElement context) { if (!(context instanceof XmlTag)) return null; if (XsltSupport.XSLT_NS.equals(((XmlTag)context).getNamespace())) return XsltSupport.XSLT_DIRECTIVE; return null; }
getKeyForNamespace
49,567
void (XsltVariable variable, ProblemsHolder holder) { if (variable instanceof XsltParameter) { if (((XsltParameter)variable).isAbstract()) { return; } } else { if (variable.isVoid()) { return; } } final XmlTag tag = variable.getTag(); final XmlTag templateTag = XsltCodeInsightUtil.getTemplateTag(tag, false); if (templa...
checkUnusedVariable
49,568
boolean (PsiElement obj, Query<PsiReference> query) { if (obj instanceof XsltParameter) { final Collection<PsiReference> references = query.findAll(); int n = references.size(); for (PsiReference reference : references) { final PsiElement element = reference.getElement(); if (element instanceof XmlAttributeValue) { fin...
isUnused
49,569
CachedValue<DeclarationChecker> (final XmlFile file, final Void p) { return CachedValuesManager.getManager(file.getProject()).createCachedValue(() -> { final DeclarationChecker holder = new DeclarationChecker(file); holder.check(file); return CachedValueProvider.Result.create(holder, file); }, false); }
compute
49,570
boolean (@NotNull PsiElement element) { if (element instanceof XmlTag) { return process((XmlTag)element); } return true; }
execute
49,571
boolean () { return false; }
followImport
49,572
void (XmlTag t) { final String n = t.getAttributeValue("name"); if (n != null) { myProcessingState.processTemplate(n, t); } // template contents from included files are not relevant if (!isInclude()) { myProcessingState.enterTemplate(); try { processChildren(t); } finally { myProcessingState.leaveTemplate(); } } }
processTemplate
49,573
void (XmlTag t) { final String n = t.getAttributeValue("name"); if (n != null) { myProcessingState.processVariable(n, t); } processChildren(t); }
processVarOrParam
49,574
boolean () { return true; }
shouldContinue
49,575
XmlTag (XmlTag var) { return myShadows.get(var); }
getShadowedVariable
49,576
XmlTag (XmlTag var) { return myDuplications.get(var); }
getDuplicatedSymbol
49,577
void (XmlTag tag) { if (myProcessingState.insideTemplate()) { processChildren(tag); } }
processTag
49,578
void (XmlTag t) { final XmlTag[] subTags = t.getSubTags(); for (XmlTag subTag : subTags) { process(subTag); } }
processChildren
49,579
void (XmlFile file) { final XmlTag rootTag = file.getRootTag(); if (rootTag != null) { myProcessingState = new State(); try { rootTag.processElements(this, rootTag); } finally { myProcessingState = null; } } }
check
49,580
DeclarationChecker (XmlFile file) { return CACHE.get(file, null).getValue(); }
getInstance
49,581
void () { myVariableDeclarations = myLocalVariables; }
enterTemplate
49,582
void () { myLocalVariables.clear(); myVariableDeclarations = myTopLevelVariables; }
leaveTemplate
49,583
boolean () { return myVariableDeclarations == myLocalVariables; }
insideTemplate
49,584
void (final String name, XmlTag tag) { ResolveUtil.treeWalkUp(new ElementProcessor<>(tag) { boolean myContinue = true; @Override protected void processTemplate(XmlTag tag) { myContinue = false; } @Override protected void processVarOrParam(XmlTag tag) { if (tag != myRoot && name.equals(tag.getAttributeValue("name"))) { ...
processVariable
49,585
void (XmlTag tag) { myContinue = false; }
processTemplate
49,586
void (XmlTag tag) { if (tag != myRoot && name.equals(tag.getAttributeValue("name"))) { assert myContinue; if (XsltSupport.getXsltLanguageLevel(tag.getContainingFile()) == XsltChecker.LanguageLevel.V2) { myShadows.put(myRoot, tag); } else { myDuplications.put(myRoot, tag); } } }
processVarOrParam
49,587
boolean () { return myContinue; }
shouldContinue
49,588
boolean () { return false; }
followImport
49,589
void (String name, XmlTag tag) { final XmlTag templ = myTemplateDeclarations.get(name); if (templ != null) { myDuplications.put(tag, templ); } myTemplateDeclarations.put(name, tag); }
processTemplate
49,590
void (@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) { final boolean isXslt = ContextProvider.getContextProvider(psiElement) instanceof XsltContextProviderBase; if (isXslt) { if (psiElement instanceof XPathFile) { visitXPathFile((XPathFile) psiElement, holder); } else if (psiElement instanceof XPathT...
annotate
49,591
void (XPathFile file, AnnotationHolder holder) { final XmlAttribute context = PsiTreeUtil.getContextOfType(file, XmlAttribute.class, true); if (context != null) { if (XsltSupport.isPatternAttribute(context)) { XsltPatternValidator.validate(holder, file); } else { if (file.getText().trim().length() == 0 && file.getExpre...
visitXPathFile
49,592
void (XPathToken token, AnnotationHolder holder) { if (XPathTokenTypes.REL_OPS.contains(token.getTokenType())) { if (token.textContains('<')) { holder.newAnnotation(HighlightSeverity.ERROR, XPathBundle.message("annotator.less.than.must.be.escaped.as.ampersand.lt.in.xslt.documents")) .withFix(new ConvertToEntityFix(toke...
visitXPathToken
49,593
void (@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) { try { myHolder = holder; psiElement.accept(this); } finally { myHolder = null; } }
annotate
49,594
void (final @NotNull XmlAttributeValue value) { final PsiElement parent = value.getParent(); if (parent instanceof XmlAttribute) { if (!XsltSupport.isXsltFile(parent.getContainingFile())) { return; } final String s = value.getValue(); if (s.isEmpty()) { if (XsltSupport.isXPathAttribute((XmlAttribute)parent)) { Injected...
visitXmlAttributeValue
49,595
List<Integer> (String s) { List<Integer> singleBraces = null; int i = -1; while ((i = getAVTEndOffset(s, i)) != -1) { if (singleBraces == null) { singleBraces = new SmartList<>(); } if (i == 0 || s.charAt(i - 1) != '{') { singleBraces.add(i); } } return singleBraces; } private static int getAVTEndOffset(String value, i...
collectClosingBraceOffsets
49,596
int (String value, int i) { while (true) { i = value.indexOf('}', i + 1); if (i != -1 && i == value.indexOf("}
getAVTEndOffset
49,597
String () { return XPathBundle.message("configurable.xslt.display.name"); }
getDisplayName
49,598
String () { return """ <xsl><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"></xsl> <xsl><xsl:template match="/hello-world"></xsl> <html> <body> <xsl><xsl:value-of select="greeting"/></xsl> </body> </html> <xsl></xsl:template></xsl> <xsl></xsl:stylesheet></xsl>"""; }
getDemoText
49,599
boolean (LocalInspectionTool tool, PsiElement element) { final XmlTag tag = PsiTreeUtil.getContextOfType(element, XmlTag.class, true); if (isSuppressedAt(tag, tool)) { return true; } final XmlTag tmpl = XsltCodeInsightUtil.getTemplateTag(element, true); if (isSuppressedAt(tmpl, tool)) { return true; } final XmlDocument...
isSuppressed