Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
16,700
PsiTypeVariable (final Constraint c) { return (PsiTypeVariable)c.getRight(); }
getVar
16,701
void (final Constraint x, final Constraint y) { reduceSideVar(x, y, new Reducer() { @Override public LinkedList<Pair<PsiType, Binding>> unify(final PsiType x, final PsiType y) { return myBindingFactory.union(x, y); } @Override public Constraint create(final PsiTypeVariable var, final PsiType type) { return new Subtype(...
reduceVarType
16,702
Constraint (final PsiTypeVariable var, final PsiType type) { return new Subtype(var, type); }
create
16,703
PsiType (final Constraint c) { return c.getRight(); }
getType
16,704
PsiTypeVariable (final Constraint c) { return (PsiTypeVariable)c.getLeft(); }
getVar
16,705
void (final Constraint x, final Constraint y, final Reducer reducer) { final PsiTypeVariable var = reducer.getVar(x); final PsiType xType = reducer.getType(x); final PsiType yType = reducer.getType(y); final LinkedList<Pair<PsiType, Binding>> union = reducer.unify(xType, yType); if (union.isEmpty()) { return; } myConst...
reduceSideVar
16,706
void () { reduce(); if (mySons.length > 0) { for (int i = 0; i < mySons.length; i++) { if (mySons[i] != null) { mySons[i].resolve(); if (!mySettings.exhaustive() && mySettings.cookToWildcards() && mySons[i].mySolutionFound) break; mySons[i] = null; } } } else { if (myConstraints.isEmpty()) { logSolution(); mySolutions....
resolve
16,707
Binding () { return mySolutions.getBestSolution(); }
getBestSolution
16,708
int () { return 1; }
method1
16,709
int (boolean value) { return value ? 2 : 3; // will be a partially covered line }
method2
16,710
int () { return 3; }
method3
16,711
int () { return 4; }
method4
16,712
int () { return 5; }
method5
16,713
void () { }
uncoveredMethod1
16,714
void () { }
uncoveredMethod2
16,715
void () { }
uncoveredMethod3
16,716
void () { }
uncoveredMethod4
16,717
void () { new FooClass().method1(); }
testMethod1
16,718
void () { new FooClass().method2(true); }
testMethod2
16,719
void () { new BarClass().method3(); }
testMethod3
16,720
void (String[] args) { System.out.println(""); }
main
16,721
void (String[] args) { System.out.println(""); }
main
16,722
String (String className, String methodName) { return className + "," + sanitize(methodName, className.length()); }
sanitize
16,723
String (String name, int length) { StringBuilder result = new StringBuilder(); for (int i = 0; i < name.length(); i++) { final char ch = name.charAt(i); if (ch > 0 && ch < 255) { if (Character.isJavaIdentifierPart(ch) || ch == ' ' || ch == '@' || ch == '-') { result.append(ch); } else { result.append("_"); } } } int me...
sanitize
16,724
Object () { try { return Class.forName("com.intellij.rt.coverage.data.ProjectData").getMethod("getProjectData", EMPTY_CLASS_ARRAY).invoke(null); } catch (Exception e) { return null; //should not happen } }
getData
16,725
void (final ITestResult iTestResult) { final Object data = getData(); if (data != null) { ((ProjectData)data).testStarted(getSanitizeTestName(iTestResult)); } }
onTestStart
16,726
String (ITestResult iTestResult) { return sanitize(iTestResult.getTestClass().getName(), iTestResult.getName()); }
getSanitizeTestName
16,727
void (final ITestResult iTestResult) { final Object data = getData(); if (data != null) { ((ProjectData)data).testEnded(getSanitizeTestName(iTestResult)); } }
onTestSuccess
16,728
void (final ITestResult iTestResult) { final Object data = getData(); if (data != null) { ((ProjectData)data).testEnded(getSanitizeTestName(iTestResult)); } }
onTestFailure
16,729
void (final ITestResult iTestResult) { final Object data = getData(); if (data != null) { ((ProjectData)data).testEnded(getSanitizeTestName(iTestResult)); } }
onTestSkipped
16,730
void (final ITestResult iTestResult) { }
onTestFailedButWithinSuccessPercentage
16,731
void (final ITestContext iTestContext) { }
onStart
16,732
void (final ITestContext iTestContext) { }
onFinish
16,733
void (String className, String methodName) { final Object data = getData(); ((com.intellij.rt.coverage.data.ProjectData)data).testStarted(sanitize(className, methodName)); }
testStarted
16,734
void (String className, String methodName) { final Object data = getData(); ((com.intellij.rt.coverage.data.ProjectData)data).testEnded(sanitize(className, methodName)); }
testFinished
16,735
boolean (@NotNull PsiFile sourceFile, PsiClass[] classes, Set<String> names) { return false; }
suggestQualifiedName
16,736
boolean (@NotNull final PsiFile srcFile, @Nullable final VirtualFile output, @Nullable final VirtualFile testoutput, @NotNull final CoverageSuitesBundle suite, @NotNull final Set<File> classFiles) { return false; }
collectOutputFiles
16,737
Module (@NotNull Module module) { return null; }
getModuleWithOutput
16,738
String (Editor editor, PsiFile file, int lineNumber, int startOffset, int endOffset, LineData lineData) { return null; }
generateBriefReport
16,739
boolean (RunConfigurationBase<?> runConfiguration) { return false; }
isSourceMapNeeded
16,740
boolean (CoverageSuitesBundle bundle, File classFile) { return false; }
ignoreCoverageForClass
16,741
boolean (CoverageSuitesBundle bundle, File classFile) { return false; }
keepCoverageInfoForClassWithoutSource
16,742
void (String @Nullable [] filters) { myIncludeFilters = filters; }
setIncludeFilters
16,743
void (String @Nullable [] patterns) { myExcludePatterns = patterns; }
setExcludePatterns
16,744
boolean () { return mySkipUnloadedClassesAnalysis; }
isSkipUnloadedClassesAnalysis
16,745
void (boolean skipUnloadedClassesAnalysis) { mySkipUnloadedClassesAnalysis = skipUnloadedClassesAnalysis; }
setSkipUnloadedClassesAnalysis
16,746
String[] (String[] filters) { if (filters == null || filters.length == 0) return ArrayUtilRt.EMPTY_STRING_ARRAY; List<String> result = new ArrayList<>(); for (String filter : filters) { if (filter.equals("*")) { result.add(""); //default package } else if (filter.endsWith(".*")) result.add(filter.substring(0, filter.le...
getPackageNames
16,747
String[] (Element element, final String tagName) { final List<Element> children = element.getChildren(tagName); List<String> filters = new ArrayList<>(); for (Element child : children) { filters.add(child.getValue()); } return filters.isEmpty() ? null : ArrayUtilRt.toStringArray(filters); }
readFilters
16,748
void (Element element, final String[] filters, final String tagName) { if (filters != null) { for (String filter : filters) { final Element filterElement = new Element(tagName); filterElement.setText(filter); element.addContent(filterElement); } } }
writeFilters
16,749
CoverageEngine () { return myCoverageEngine; }
getCoverageEngine
16,750
boolean (final String classFQName) { return isClassFiltered(classFQName, getFilteredClassNames()); }
isClassFiltered
16,751
boolean (String classFQName, String[] classPatterns) { for (String className : classPatterns) { if (className.equals(classFQName) || classFQName.startsWith(className) && classFQName.charAt(className.length()) == '$') { return true; } } return false; }
isClassFiltered
16,752
boolean (final String packageFQName) { for (String name : getExcludedPackageNames()) { if (packageFQName.equals(name) || packageFQName.startsWith(name + ".")) return false; } final String[] filteredPackageNames = getFilteredPackageNames(); for (final String packName : filteredPackageNames) { if (packName.isEmpty() || P...
isPackageFiltered
16,753
List<PsiPackage> (final Project project) { return ReadAction.compute(() -> { final List<PsiPackage> packages = new ArrayList<>(); final PsiManager psiManager = PsiManager.getInstance(project); final String[] filters = getFilteredPackageNames(); if (filters.length == 0) { if (getFilteredClassNames().length > 0) return C...
getCurrentSuitePackages
16,754
boolean (String[] filters, String filter) { for (String supPackageFilter : filters) { if (filter.startsWith(supPackageFilter + ".")) { return true; } } return false; }
isSubPackage
16,755
List<PsiClass> (final Project project) { final List<PsiClass> classes = new ArrayList<>(); final String[] classNames = getFilteredClassNames(); if (classNames.length > 0) { final DumbService dumbService = DumbService.getInstance(project); for (final String className : classNames) { ThrowableComputable<PsiClass, Runtime...
getCurrentSuiteClasses
16,756
ProjectData (@NotNull final File sessionDataFile, @Nullable final CoverageSuite coverageSuite) { ProjectData projectData = ProjectDataLoader.load(sessionDataFile); File sourceMapFile = new File(JavaCoverageEnabledConfiguration.getSourceMapPath(sessionDataFile.getPath())); if (sourceMapFile.exists()) { try { CoverageRep...
loadCoverageData
16,757
void (String sessionDataFilePath, String @Nullable [] patterns, SimpleJavaParameters parameters, boolean testTracking, boolean branchCoverage) { appendCoverageArgument(sessionDataFilePath, patterns, null, parameters, testTracking, branchCoverage, null, null); }
appendCoverageArgument
16,758
void (final String sessionDataFilePath, final String[] patterns, final String[] excludePatterns, final SimpleJavaParameters javaParameters, final boolean testTracking, final boolean branchCoverage, @Nullable String sourceMapPath, @Nullable final Project project) { final String agentPath = getAgentPath(); if (agentPath ...
appendCoverageArgument
16,759
String () { final String userDefinedAgentPath = System.getProperty(COVERAGE_AGENT_PATH_PROPERTY); final String bundledAgentPath = PathUtil.getJarPathForClass(ProjectData.class); final String agentPath = userDefinedAgentPath != null ? userDefinedAgentPath : bundledAgentPath; return handleSpacesInAgentPath(agentPath); }
getAgentPath
16,760
JavaTargetParameter (String agentPath, String sessionDataFilePath, String @Nullable [] patterns, String[] excludePatterns, String[] excludeAnnotations, boolean testTracking, boolean branchCoverage, String sourceMapPath) { try { final File tempFile = createTempFile(); tempFile.deleteOnExit(); Ref<Boolean> writeOnceRef =...
createArgumentTargetParameter
16,761
void (@NotNull String sessionDataFilePath) { File file = new File(sessionDataFilePath); FileUtil.createIfDoesntExist(file); try { new FileOutputStream(file).close(); } catch (IOException e) { LOG.error(e); } }
createFileOrClearExisting
16,762
String[] (@Nullable Project project) { if (project == null) return null; final JavaCoverageOptionsProvider optionsProvider = JavaCoverageOptionsProvider.getInstance(project); return ArrayUtil.toStringArray(optionsProvider.getExcludeAnnotationPatterns()); }
getExcludeAnnotations
16,763
String () { return "IntelliJ IDEA"; }
getPresentableName
16,764
String () { return "idea"; }
getId
16,765
String () { return "ic"; }
getDataFileExtension
16,766
boolean () { return true; }
isCoverageByTestApplicable
16,767
void (Project project, ProjectData projectData) { final JavaCoverageOptionsProvider optionsProvider = JavaCoverageOptionsProvider.getInstance(project); try { final String[] patterns = ArrayUtil.toStringArray(optionsProvider.getExcludeAnnotationPatterns()); final String[] regexps = convertToPatterns(patterns); projectDa...
setExcludeAnnotations
16,768
List<Pattern> (CoverageSuitesBundle currentSuiteBundle) { final List<Pattern> includePatterns = new ArrayList<>(); for (CoverageSuite currentSuite : currentSuiteBundle.getSuites()) { for (String pattern : ((JavaCoverageSuite)currentSuite).getFilteredPackageNames()) { includePatterns.add(Pattern.compile(pattern + ".*"))...
obtainPatternsFromSuite
16,769
Collection<ClassPathEntry> () { final Collection<ClassPathEntry> entries = new HashSet<>(); final Module[] modules = ModuleManager.getInstance(myProject).getModules(); final CoverageDataManager coverageManager = CoverageDataManager.getInstance(myProject); for (Module module : modules) { final VirtualFile[] roots = Java...
getClassPathEntries
16,770
CoverageNotifications (Project project) { return project.getService(CoverageNotifications.class); }
getInstance
16,771
void () { replaceAndExpireNotification(null); }
beforeSuiteChosen
16,772
void (Notification newNotification) { replaceAndExpireNotification(newNotification); }
addNotification
16,773
void (Notification newNotification) { final Notification notification = myProjectOutOfDateNotification.getAndSet(newNotification); if (notification != null) { notification.expire(); notification.hideBalloon(); } }
replaceAndExpireNotification
16,774
void () { }
dispose
16,775
ProjectData (@NotNull File sessionDataFile, @Nullable CoverageSuite baseCoverageSuite) { final ProjectData data = new ProjectData(); try { final Project project = baseCoverageSuite instanceof BaseCoverageSuite ? baseCoverageSuite.getProject() : null; if (project != null) { var configuration = ((BaseCoverageSuite)baseCo...
loadCoverageData
16,776
void (@NotNull File sessionDataFile, IOException e) { final String path = sessionDataFile.getAbsolutePath(); if ("Invalid execution data file.".equals(e.getMessage())) { Notifications.Bus.notify(new Notification("Coverage", CoverageBundle.message("coverage.error.loading.report"), JavaCoverageBundle.message("coverage.er...
processError
16,777
FileVisitResult (Path path, BasicFileAttributes attrs) { String internalName = StringUtil.trimEnd(rootPath.relativize(path).toString(), ".class"); String fqn = AnalysisUtils.internalNameToFqn(internalName); if (JavaCoverageSuite.isClassFiltered(fqn, suite.getExcludedClassNames()) || (!suite.isClassFiltered(fqn) && !sui...
visitFile
16,778
Module[] (@Nullable Module mainModule, @NotNull Project project) { final Module[] modules; if (mainModule != null) { HashSet<Module> mainModuleWithDependencies = new HashSet<>(); ReadAction.run(() -> ModuleUtilCore.getDependencies(mainModule, mainModuleWithDependencies)); modules = mainModuleWithDependencies.toArray(Mo...
getModules
16,779
void (String sessionDataFilePath, String @Nullable [] patterns, SimpleJavaParameters parameters, boolean testTracking, boolean branchCoverage) { appendCoverageArgument(sessionDataFilePath, patterns, null, parameters, testTracking, branchCoverage, null, null); }
appendCoverageArgument
16,780
void (String sessionDataFilePath, String @Nullable [] patterns, String[] excludePatterns, SimpleJavaParameters javaParameters, boolean testTracking, boolean branchCoverage, String sourceMapPath, @Nullable Project project) { String path; try { path = AgentJar.extractToTempLocation().getAbsolutePath(); } catch (IOExcepti...
appendCoverageArgument
16,781
JavaTargetParameter (String agentPath, String sessionDataFilePath, String @Nullable [] patterns, String[] excludePatterns) { HashSet<String> uploadPaths = ContainerUtil.newHashSet(agentPath); HashSet<String> downloadPaths = ContainerUtil.newHashSet(sessionDataFilePath); var builder = new JavaTargetParameter.Builder(upl...
createArgumentTargetValue
16,782
JavaTargetParameter (@NotNull JavaTargetParameter.Builder builder, String @Nullable [] patterns, String[] excludePatterns, String sessionDataFilePath, String agentPath) { builder .fixed("-javaagent:") .resolved(agentPath) .fixed("=destfile=") .resolved(sessionDataFilePath) .fixed(",append=false"); if (!ArrayUtil.isEmpt...
doCreateCoverageArgument
16,783
boolean (boolean branchCoverage) { return true; }
isBranchInfoAvailable
16,784
String () { return "JaCoCo"; }
getPresentableName
16,785
String () { return "jacoco"; }
getId
16,786
String () { return "exec"; }
getDataFileExtension
16,787
void (ProjectViewNode node, PresentationData data) { final Project project = node.getProject(); if (project == null) { return; } final CoverageDataManager coverageDataManager = getCoverageDataManager(project); CoverageSuitesBundle javaSuite = getJavaSuite(coverageDataManager, project); // This decorator is applicable o...
decorate
16,788
CoverageSuitesBundle (@Nullable CoverageDataManager dataManager, @NotNull Project project) { if (dataManager == null) { return null; } for (CoverageSuitesBundle bundle : dataManager.activeSuites()) { final CoverageAnnotator coverageAnnotator = bundle.getAnnotator(project); if (coverageAnnotator instanceof JavaCoverageA...
getJavaSuite
16,789
JavaCoverageEngine () { return EP_NAME.findExtensionOrFail(JavaCoverageEngine.class); }
getInstance
16,790
boolean (@NotNull final RunConfigurationBase conf) { if (conf instanceof CommonJavaRunConfigurationParameters) { return true; } if (RunTargetsEnabled.get() && conf instanceof TargetEnvironmentAwareRunProfile && willRunOnTarget((TargetEnvironmentAwareRunProfile)conf)) { return false; } for (JavaCoverageEngineExtension e...
isApplicableTo
16,791
boolean (@NotNull final TargetEnvironmentAwareRunProfile configuration) { Project project = ((RunConfigurationBase<?>)configuration).getProject(); return TargetEnvironmentConfigurations.getEffectiveTargetName(configuration, project) != null || isProjectUnderWsl(project); }
willRunOnTarget
16,792
boolean (@NotNull Project project) { Sdk projectSdk = ProjectRootManager.getInstance(project).getProjectSdk(); if (projectSdk == null) { return false; } String projectSdkHomePath = projectSdk.getHomePath(); return projectSdkHomePath != null && WslPath.isWslUncPath(projectSdkHomePath); }
isProjectUnderWsl
16,793
boolean (@NotNull RunConfigurationBase conf) { return !(conf instanceof ApplicationConfiguration) && conf instanceof CommonJavaRunConfigurationParameters; }
canHavePerTestCoverage
16,794
Set<String> (Project project, CoverageSuitesBundle bundle, String classFQName, int lineNumber) { return extractTracedTests(bundle, classFQName, lineNumber); }
getTestsForLine
16,795
boolean (Project project, CoverageSuitesBundle bundle) { File[] files = getTraceFiles(bundle); return files != null && files.length > 0; }
wasTestDataCollected
16,796
Set<String> (CoverageSuitesBundle bundle, final String classFQName, final int lineNumber) { Set<String> tests = new HashSet<>(); final File[] traceFiles = getTraceFiles(bundle); if (traceFiles == null) return tests; for (File traceFile : traceFiles) { DataInputStream in = null; try { in = new DataInputStream(new FileIn...
extractTracedTests
16,797
File (CoverageSuite coverageSuite) { final String filePath = coverageSuite.getCoverageDataFileName(); final String dirName = FileUtilRt.getNameWithoutExtension(new File(filePath).getName()); final File parentDir = new File(filePath).getParentFile(); return new File(parentDir, dirName); }
getTracesDirectory
16,798
void (List<String> sanitizedTestNames, CoverageSuite suite, Map<String, Set<Integer>> executionTrace) { final File tracesDir = getTracesDirectory(suite); for (String testName : sanitizedTestNames) { final File file = new File(tracesDir, testName + ".tr"); if (file.exists()) { try (DataInputStream in = new DataInputStre...
collectTestLines
16,799
void (CoverageSuite suite) { if (suite.isBranchCoverage()) { File tracesDirectory = getTracesDirectory(suite); if (tracesDirectory.exists()) { FileUtil.delete(tracesDirectory); } } }
deleteAssociatedTraces