Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
28,900
File () { return myDescriptor.getRootFile(); }
getRootFile
28,901
Set<File> () { return myDescriptor.getExcludedRoots(); }
getExcludedRoots
28,902
void (@NotNull JpsProject project, @NotNull Element componentTag) { JpsGroovySettings configuration = XmlSerializer.deserialize(componentTag, JpsGroovySettings.class); configuration.initExcludes(); project.getContainer().setChild(JpsGroovySettings.ROLE, configuration); }
loadExtension
28,903
void (@NotNull JpsProject project, @NotNull Element componentTag) { GreclipseSettings settings = XmlSerializer.deserialize(componentTag, GreclipseSettings.class); GreclipseJpsCompilerSettings component = new GreclipseJpsCompilerSettings(settings); project.getContainer().setChild(GreclipseJpsCompilerSettings.ROLE, compo...
loadExtension
28,904
void (@NotNull JpsProject project) { GreclipseJpsCompilerSettings component = new GreclipseJpsCompilerSettings(new GreclipseSettings()); project.getContainer().setChild(GreclipseJpsCompilerSettings.ROLE, component); }
loadExtensionWithDefaultSettings
28,905
String () { return myModule.getName(); }
getId
28,906
GroovyResourceRootDescriptor (@NotNull String rootId, @NotNull BuildRootIndex rootIndex) { List<GroovyResourceRootDescriptor> descriptors = rootIndex.getRootDescriptors(new File(rootId), Collections.singletonList((Type)getTargetType()), null); return ContainerUtil.getFirstItem(descriptors); }
findRootDescriptor
28,907
String () { return "Check Groovy Resources for '" + myModule.getName() + "' " + (isTests() ? "tests" : "production"); }
getPresentableName
28,908
List<GroovyResourceRootDescriptor> (@NotNull JpsModel model, @NotNull ModuleExcludeIndex index, @NotNull IgnoredFileIndex ignoredFileIndex, @NotNull BuildDataPaths dataPaths) { ResourcesTarget target = new ResourcesTarget(myModule, ResourcesTargetType.getInstance(isTests())); List<ResourceRootDescriptor> resources = ta...
computeRootDescriptors
28,909
Collection<File> (@NotNull CompileContext context) { return Collections.singletonList(getOutputRoot(context)); }
getOutputRoots
28,910
JpsModule () { return myModule; }
getModule
28,911
boolean (Object o) { if (this == o) return true; if (!(o instanceof CheckResourcesTarget)) return false; CheckResourcesTarget target = (CheckResourcesTarget)o; if (!myModule.equals(target.myModule)) return false; if (!getTargetType().equals(target.getTargetType())) return false; return true; }
equals
28,912
int () { return myModule.hashCode() + 31 * getTargetType().hashCode(); }
hashCode
28,913
List<CheckResourcesTarget> (@NotNull JpsModel model) { return ContainerUtil.map(model.getProject().getModules(), module -> new CheckResourcesTarget(module, this)); }
computeAllTargets
28,914
BuildTargetLoader<CheckResourcesTarget> (@NotNull JpsModel model) { final Map<String, JpsModule> modules = new HashMap<>(); for (JpsModule module : model.getProject().getModules()) { modules.put(module.getName(), module); } return new BuildTargetLoader<CheckResourcesTarget>() { @Nullable @Override public CheckResources...
createLoader
28,915
CheckResourcesTarget (@NotNull String targetId) { JpsModule module = modules.get(targetId); return module != null ? new CheckResourcesTarget(module, Type.this) : null; }
createTarget
28,916
void (int version, int access, String name, String signature, String superName, String[] interfaces) { nameRef.set(name.replace('/', '.')); }
visit
28,917
void (final List<CompilerMessage> parsedMessages, final StringBuilder sb) { if (sb.length() > 0) { ContainerUtil.addIfNotNull(parsedMessages, parseMessage(sb.toString())); } }
handleCurrentMessage
28,918
CompilerMessage (@NlsSafe String msgText) { // message should look like this: // 1. WARNING in /Users/andrew/git-repos/foo/src/main/java/packAction.java (at line 47) // public abstract class AbstractScmTagAction extends TaskAction implements BuildBadgeAction { // ^^^^^^^^^^^^^^^^^^^^ // But there will also be messages ...
parseMessage
28,919
boolean (String path) { return super.acceptsFileType(path) || path.endsWith(".java"); }
acceptsFileType
28,920
ClassLoader (@Nullable String jar) { if (StringUtil.isEmpty(jar)) return null; if (jar.equals(myGreclipseJar)) { return myGreclipseLoader; } try { URL[] urls = { new File(jar).toURI().toURL(), Objects.requireNonNull(PathManager.getJarForClass(GreclipseMain.class)).toUri().toURL() }; ClassLoader loader = new URLClassLoa...
createGreclipseLoader
28,921
List<String> () { return Arrays.asList("groovy", "java"); }
getCompilableFileExtensions
28,922
boolean (CompileContext context) { JpsProject project = context.getProjectDescriptor().getProject(); return ID.equals(JpsJavaExtensionService.getInstance().getCompilerConfiguration(project).getJavaCompilerId()); }
useGreclipse
28,923
boolean (List<String> vmOptions, List<String> args, StringWriter out, StringWriter err, Map<String, List<String>> outputs, CompileContext context, ModuleChunk chunk) { String bytecodeTarget = JpsGroovycRunner.getBytecodeTarget(context, chunk); if (bytecodeTarget != null && System.getProperty(GroovyRtConstants.GROOVY_TA...
performCompilation
28,924
boolean (List<String> vmOptions, List<String> args, StringWriter out, StringWriter err, Map<String, List<String>> outputs, CompileContext context, ModuleChunk chunk) { final ClassLoader jpsLoader = Thread.currentThread().getContextClassLoader(); try { // We have to set context class loader in order because greclipse wi...
performCompilationInner
28,925
void (@NotNull String text, @NotNull Key outputType) { if (outputType == ProcessOutputType.STDERR) { err.append(text); } if (outputType == ProcessOutputType.STDOUT) { out.append(text); } }
notifyTextAvailable
28,926
List<String> (CompileContext context, ModuleChunk chunk, List<File> srcFiles, String mainOutputDir, @Nullable ProcessorConfigProfile profile, GreclipseSettings settings) { final List<String> args = new ArrayList<>(); args.add("-cp"); args.add(getClasspathString(chunk)); JavaBuilder.addCompilationOptions(args, context, ...
createCommandLine
28,927
List<String> (ModuleChunk chunk, String args, String rawVmOptions) { List<String> params = ParametersListUtil.parse(args); List<String> vmOptions = new ArrayList<>(ParametersListUtil.parse(rawVmOptions)); for (Iterator<String> iterator = params.iterator(); iterator.hasNext(); ) { String option = iterator.next(); if ("-...
discoverVmOptions
28,928
String (ModuleChunk chunk, String agentClassName) { Collection<File> files = ProjectPaths.getCompilationClasspathFiles(chunk, chunk.containsTests(), false, false); URL[] urls = new URL[files.size()]; int i = 0; for (File file : files) { try { urls[i] = file.toURI().toURL(); ++i; } catch (MalformedURLException e) { LOG....
locateAgentJar
28,929
String (ModuleChunk chunk) { final Set<String> cp = new LinkedHashSet<>(); for (File file : ProjectPaths.getCompilationClasspathFiles(chunk, chunk.containsTests(), false, false)) { if (file.exists()) { cp.add(FileUtil.toCanonicalPath(file.getPath())); } } return StringUtil.join(cp, File.pathSeparator); }
getClasspathString
28,930
String () { return GroovyJpsBundle.message("compiler.name.greclipse"); }
getPresentableName
28,931
long () { return 100; }
getExpectedBuildTime
28,932
JpsGroovySettings () { return new JpsGroovySettings(this); }
createCopy
28,933
void (@NotNull JpsGroovySettings modified) { }
applyChanges
28,934
JpsGroovySettings (@NotNull JpsProject project) { JpsGroovySettings settings = project.getContainer().getChild(ROLE); return settings == null ? new JpsGroovySettings() : settings; }
getSettings
28,935
boolean (File file) { return myExcludeFromStubGeneration != null && myExcludeFromStubGeneration.isExcluded(file); }
isExcludedFromStubGeneration
28,936
Set<ModuleBuildTarget> (ModuleChunk chunk) { return chunk.getTargets(); }
getTargets
28,937
JavaSourceRootDescriptor (CompileContext context, File srcFile) { return context.getProjectDescriptor().getBuildRootIndex().findJavaRootDescriptor(context, srcFile); }
findRoot
28,938
void (CompileContext context, Map<ModuleBuildTarget, String> generationOutputs, MultiMap<ModuleBuildTarget, OutputItem> compiled) { addStubRootsToJavacSourcePath(context, generationOutputs); rememberStubSources(context, compiled); }
stubsGenerated
28,939
void (CompileContext context, Map<ModuleBuildTarget, String> generationOutputs) { final BuildRootIndex rootsIndex = context.getProjectDescriptor().getBuildRootIndex(); for (ModuleBuildTarget target : generationOutputs.keySet()) { File root = new File(generationOutputs.get(target)); rootsIndex.associateTempRoot(context,...
addStubRootsToJavacSourcePath
28,940
void (CompileContext context, MultiMap<ModuleBuildTarget, OutputItem> compiled) { Map<String, String> stubToSrc = GroovyBuilder.STUB_TO_SRC.get(context); if (stubToSrc == null) { GroovyBuilder.STUB_TO_SRC.set(context, stubToSrc = new HashMap<>()); } for (OutputItem item : compiled.values()) { stubToSrc.put(FileUtil.toS...
rememberStubSources
28,941
boolean () { for (CompilerMessage message : myCompilerMessages) { String text = message.getMessageText(); if (text.contains("java.lang.NoClassDefFoundError") || text.contains("java.lang.TypeNotPresentException") || text.contains("unable to resolve class")) { JpsGroovycRunner.LOG.debug("Resolve issue: " + message); retu...
shouldRetry
28,942
GreclipseJpsCompilerSettings () { return new GreclipseJpsCompilerSettings(mySettings); }
createCopy
28,943
void (@NotNull GreclipseJpsCompilerSettings modified) { mySettings = modified.mySettings; }
applyChanges
28,944
GreclipseSettings (@NotNull JpsProject project) { GreclipseJpsCompilerSettings extension = project.getContainer().getChild(ROLE); return extension != null ? extension.mySettings : null; }
getSettings
28,945
void (final String text, final Key outputType) { if (LOG.isDebugEnabled()) { LOG.debug("Received from groovyc " + outputType + ": " + text); } if (outputType == ProcessOutputTypes.SYSTEM) { return; } if (outputType == ProcessOutputTypes.STDERR && !isSafeStderr(text)) { stdErr.append(StringUtil.convertLineSeparators(tex...
notifyTextAvailable
28,946
boolean (String line) { return line.startsWith("SLF4J:") || line.startsWith("Picked up JAVA_TOOL_OPTIONS"); }
isSafeStderr
28,947
void (@Nls @NotNull String status) { myContext.processMessage(new ProgressMessage( GroovyJpsBundle.message("status.0.chunk.name.1", status, myChunk.getPresentableShortName()) )); }
updateStatus
28,948
void (String text) { final String trimmed = text.trim(); if (trimmed.startsWith(GroovyRtConstants.PRESENTABLE_MESSAGE)) { String message = trimmed.substring(GroovyRtConstants.PRESENTABLE_MESSAGE.length()); updateStatus(message); return; } if (GroovyRtConstants.CLEAR_PRESENTABLE.equals(trimmed)) { updateStatus(GroovyJps...
parseOutput
28,949
String (String startMarker, String endMarker) { final int start = outputBuffer.indexOf(startMarker); final int end = outputBuffer.indexOf(endMarker); if (start > end) { throw new AssertionError("Malformed Groovyc output: " + outputBuffer); } String text = outputBuffer.substring(start + startMarker.length(), end); outpu...
handleOutputBuffer
28,950
List<String> (String compiled) { return ContainerUtil.map(StringUtil.split(compiled, GroovyRtConstants.SEPARATOR), s -> s.trim()); }
splitAndTrim
28,951
List<CompilerMessage> () { ArrayList<CompilerMessage> messages = new ArrayList<>(compilerMessages); final StringBuffer unparsedBuffer = getStdErr(); if (unparsedBuffer.length() != 0) { String msg = unparsedBuffer.toString(); if (msg.contains(GroovyRtConstants.NO_GROOVY)) { messages.add(reportNoGroovy(msg)); } else { me...
getCompilerMessages
28,952
StringBuffer () { return stdErr; }
getStdErr
28,953
void () { myCompiledItems.clear(); compilerMessages.clear(); stdErr.setLength(0); outputBuffer.setLength(0); }
onContinuation
28,954
GroovyCompilerResult () { return new GroovyCompilerResult(myCompiledItems, getCompilerMessages()); }
result
28,955
boolean (@NotNull File file) { return GroovyBuilder.isGroovyFile(file.getAbsolutePath()); }
shouldHonorFileEncodingForCompilation
28,956
String () { return myCategory; }
getCategory
28,957
String () { return myMessage; }
getMessage
28,958
String () { return myUrl; }
getUrl
28,959
int () { return myLineNum; }
getLineNum
28,960
int () { return myColumnNum; }
getColumnNum
28,961
String () { return "OutputItem{" + "outputPath='" + outputPath + '\'' + ", sourcePath='" + sourcePath + '\'' + '}'; }
toString
28,962
List<String> (File jpsPluginRoot, boolean addClassLoaderJar) { List<String> result = new ArrayList<>(); addGroovyRtJarPath(jpsPluginRoot, "groovy-rt.jar", Collections.singletonList("intellij.groovy.rt"), "groovy-rt", result); addGroovyRtJarPath(jpsPluginRoot, "groovy-constants-rt.jar", Collections.singletonList("intell...
getGroovyRtRoots
28,963
void (File jpsPluginClassesRoot, String jarNameInDistribution, List<String> moduleNames, String mavenArtifactNamePrefix, List<String> to) { File parentDir = jpsPluginClassesRoot.getParentFile(); if (jpsPluginClassesRoot.isFile()) { String fileName; if (jpsPluginClassesRoot.getName().equals("groovy-jps.jar")) { fileName...
addGroovyRtJarPath
28,964
void (String options, Instrumentation inst) { // Handle duplicate agents if (initialized) { return; } initialized = true; inst.addTransformer(new ClassFileTransformer() { public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer...
premain
28,965
boolean (byte[] array, byte[] subArray, int start) { for (int i = 1; i < subArray.length; i++) { if (array[start + i] != subArray[i]) { return false; } } return true; }
matches
28,966
boolean (byte[] array, byte[] subArray) { int maxLength = array.length - subArray.length; for (int i = 0; i < maxLength; i++) { if (array[i] == subArray[0] && matches(array, subArray, i)) { return true; } } return false; }
containsSubArray
28,967
byte[] (byte[] newBytes) { if (!containsSubArray(newBytes, timeStampFieldStartBytes)) { return null; } final boolean[] changed = new boolean[]{false}; final ClassWriter writer = new ClassWriter(0); new ClassReader(newBytes).accept(new TimestampFieldRemover(writer, changed), 0); if (changed[0]) { return writer.toByteArr...
removeTimestampField
28,968
FieldVisitor (int i, String name, String s1, String s2, Object o) { if (name.startsWith(timeStampFieldStart)) { //remove the field changed[0] = true; return null; } return super.visitField(i, name, s1, s2, o); }
visitField
28,969
MethodVisitor (int i, String name, String s1, String s2, String[] strings) { final MethodVisitor mw = super.visitMethod(i, name, s1, s2, strings); if ("<clinit>".equals(name)) { //remove field's static initialization return new MethodAdapter(mw) { @Override public void visitFieldInsn(int opCode, String s, String name, ...
visitMethod
28,970
void (int opCode, String s, String name, String desc) { if (name.startsWith(timeStampFieldStart) && opCode == Opcodes.PUTSTATIC) { visitInsn(Type.LONG_TYPE.getDescriptor().equals(desc) ? Opcodes.POP2 : Opcodes.POP); } else { super.visitFieldInsn(opCode, s, name, desc); } }
visitFieldInsn
28,971
boolean (@NotNull String newName, @NotNull PsiElement element, @NotNull ProcessingContext context) { return GroovyRefactoringUtil.isCorrectReferenceName(newName, element.getProject()); }
isInputValid
28,972
String () { return GroovyFileType.DEFAULT_EXTENSION; }
getFileExtension
28,973
String (CharSequence text) { Lexer lexer = new GroovyLexer(); lexer.start(text); skipWhitespacesAndComments(lexer); final IElementType firstToken = lexer.getTokenType(); if (firstToken != GroovyTokenTypes.kPACKAGE) { return ""; } lexer.advance(); skipWhitespacesAndComments(lexer); final StringBuilder buffer = new Strin...
getPackageName
28,974
void (Lexer lexer) { while(TokenSets.ALL_COMMENT_TOKENS.contains(lexer.getTokenType()) || TokenSets.WHITE_SPACES_SET.contains(lexer.getTokenType())) { lexer.advance(); } }
skipWhitespacesAndComments
28,975
boolean (@NotNull PsiReference reference, @NotNull JavaCallHierarchyData data) { PsiClass originalClass = data.getOriginalClass(); PsiMethod method = data.getMethod(); Set<? extends PsiMethod> methodsToFind = data.getMethodsToFind(); PsiMethod methodToFind = data.getMethodToFind(); PsiClassType originalType = data.getO...
process
28,976
JComponent () { myPanel = new JPanel(new BorderLayout(10, 5)); final JPanel contentPanel = new JPanel(new BorderLayout(4, 0)); myPanel.add(contentPanel, BorderLayout.NORTH); contentPanel.add(new JLabel(GroovyBundle.message("framework.0.home.label", myFrameworkName)), BorderLayout.WEST); myPathField = new TextFieldWithB...
createComponent
28,977
boolean (@Nullable VirtualFile file) { return file != null && isSdkHome(file); }
isFileSelectable
28,978
boolean () { return !(myPathField.getText().equals(StringUtil.notNullize(getStateText()))); }
isModified
28,979
void () { myPathField.setText(getStateText()); }
reset
28,980
void () { myPathField = null; myPanel = null; }
disposeUIResources
28,981
String () { return getHelpTopic(); }
getId
28,982
int (Editor editor, int tailOffset) { CommonCodeStyleSettings styleSettings = CodeStyle.getLocalLanguageSettings(editor, tailOffset); Document document = editor.getDocument(); CharSequence chars = document.getCharsSequence(); int textLength = chars.length(); if (tailOffset < textLength - 1 && chars.charAt(tailOffset) =...
processTail
28,983
String (final SourcePosition position) { PsiElement element = findElementAt(position); while (true) { element = PsiTreeUtil.getParentOfType(element, GrTypeDefinition.class, PsiClassImpl.class); if (element == null || (element instanceof GrTypeDefinition && !((GrTypeDefinition)element).isAnonymous()) || (element instanc...
findEnclosingName
28,984
String (final PsiClass aClass) { final PsiClass psiClass = aClass.getContainingClass(); if (psiClass != null) { return getClassNameForJvm(psiClass) + "$" + aClass.getName(); } return aClass.getQualifiedName(); }
getClassNameForJvm
28,985
String (final SourcePosition position) { return ReadAction.compute(()->{ PsiElement element = findElementAt(position); if (element == null) return null; PsiElement sourceImage = PsiTreeUtil.getParentOfType(element, GrClosableBlock.class, GrTypeDefinition.class, PsiClassImpl.class); if (sourceImage instanceof PsiClass) ...
getOuterClassName
28,986
PsiElement (SourcePosition position) { PsiFile file = position.getFile(); if (!(file instanceof GroovyFileBase) && !(file instanceof PsiJavaFile)) return null; return file.findElementAt(position.getOffset()); }
findElementAt
28,987
boolean (ReferenceType ownerClass, ReferenceType aClass) { String name = aClass.name(); String ownerClassName = ownerClass.name(); // return name == ownerClassName + "$$" + /[A-Za-z0-9]{8}/ return name.length() == ownerClassName.length() + 2 + 8 && name.startsWith(ownerClassName) && GENERATED_CLASS_NAME.matcher(name.su...
isSpringLoadedGeneratedClass
28,988
void (Set<ReferenceType> res, ReferenceType fromClass, int line) { if (!fromClass.isPrepared()) return; List<ReferenceType> nestedTypes = fromClass.nestedTypes(); ReferenceType springLoadedGeneratedClass = null; for (ReferenceType nested : nestedTypes) { if (!nested.isPrepared()) continue; if (isSpringLoadedGeneratedCl...
findNested
28,989
PositionManager (@NotNull final DebugProcess process) { return usesSpringLoaded(process) ? new SpringLoadedPositionManager(process) : null; }
createPositionManager
28,990
boolean (@NotNull final DebugProcess process) { Boolean force = process.getProcessHandler().getUserData(FORCE_SPRINGLOADED); if (force == Boolean.TRUE) return true; if (ReadAction.compute(()->{ JavaPsiFacade facade = JavaPsiFacade.getInstance(process.getProject()); if (facade.findPackage("com.springsource.loaded") != n...
usesSpringLoaded
28,991
List<TargetTypeBuildScope> (@NotNull CompileScope baseScope, @NotNull Project project, boolean forceBuild) { Boolean checkResourcesRebuild = baseScope.getUserData(GroovyResourceChecker.CHECKING_RESOURCES_REBUILD); if (checkResourcesRebuild == null) return Collections.emptyList(); forceBuild |= checkResourcesRebuild; re...
getBuildTargetScopes
28,992
TargetTypeBuildScope (@NotNull Project project, boolean forceBuild, final JavaResourceRootType rootType, final CheckResourcesTarget.Type targetType) { List<Module> withResources = getModulesWithGroovyResources(project, rootType); return withResources.isEmpty() ? null : CmdlineProtoUtil.createTargetsScope(targetType.get...
createTargets
28,993
List<Module> (@NotNull Project project, @NotNull JpsModuleSourceRootType<?> rootType) { return ContainerUtil.filter(ModuleManager.getInstance(project).getModules(), module -> containsGroovyResources(rootType, module, false)); }
getModulesWithGroovyResources
28,994
boolean (@NotNull JpsModuleSourceRootType<?> rootType, Module module, boolean isSmartMode) { return ContainerUtil .exists(ModuleRootManager.getInstance(module).getSourceRoots(rootType), root -> containsGroovyResources(module, root, isSmartMode)); }
containsGroovyResources
28,995
boolean (Module module, VirtualFile root, boolean isSmartMode) { if (isSmartMode) { Collection<?> files = FileTypeIndex.getFiles(GroovyFileType.GROOVY_FILE_TYPE, GlobalSearchScopes.directoryScope(module.getProject(), root, true)); return !files.isEmpty(); } else { return !ModuleRootManager.getInstance(module).getFileIn...
containsGroovyResources
28,996
JpsGroovySettings () { final JpsGroovySettings bean = new JpsGroovySettings(); bean.configScript = myConfigScript; bean.invokeDynamic = myInvokeDynamic; bean.transformsOk = transformsOk; myExcludeFromStubGeneration.writeExternal(bean.excludes); return bean; }
getState
28,997
ExcludesConfiguration (Project project) { return getInstance(project).myExcludeFromStubGeneration; }
getExcludeConfiguration
28,998
ExcludesConfiguration () { return myExcludeFromStubGeneration; }
getExcludeFromStubGeneration
28,999
void (@NotNull JpsGroovySettings state) { myConfigScript = state.configScript; myInvokeDynamic = state.invokeDynamic; transformsOk = state.transformsOk; myExcludeFromStubGeneration.readExternal(state.excludes); }
loadState