Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
29,600
void (PsiField field, StringBuilder buffer) { buffer.append(" = ").append(field.getName()).append(" != +0.0d ? Double.doubleToLongBits("); buffer.append(field.getName()); buffer.append(") : 0L\n"); }
addTempForDoubleInitialization
29,601
String (StringBuilder buffer) { for (PsiField hashCodeField : myHashCodeFields) { if (PsiTypes.doubleType().equals(hashCodeField.getType())) { final String name = getUniqueLocalVarName(TEMP_VARIABLE, myHashCodeFields); buffer.append("long ").append(name).append("\n"); return name; } } return null; }
addTempDeclaration
29,602
String (PsiField field, StringBuilder buffer) { if (PsiTypes.doubleType().equals(field.getType())) { final String name = getUniqueLocalVarName(TEMP_VARIABLE, myHashCodeFields); JavaCodeStyleSettings settings = JavaCodeStyleSettings.getInstance(myFile); if (settings.GENERATE_FINAL_LOCALS) { buffer.append("final "); } bu...
addTempForOneField
29,603
void (StringBuilder buffer, PsiField field, String tempName) { MessageFormat format = PRIMITIVE_HASHCODE_FORMAT.get(field.getType().getCanonicalText()); buffer.append(format.format(new Object[]{field.getName(), tempName})); }
addPrimitiveFieldHashCode
29,604
void (StringBuilder buffer, PsiField field) { final String name = field.getName(); if (myNonNullSet.contains(field)) { adjustHashCodeToArrays(buffer, field, name); } else { buffer.append("("); buffer.append(name); buffer.append(" != null ? "); adjustHashCodeToArrays(buffer, field, name); buffer.append(" : 0)"); } }
addFieldHashCode
29,605
void (StringBuilder buffer, final PsiField field, final String name) { if (field.getType() instanceof PsiArrayType && LanguageLevel.JDK_1_5.compareTo(PsiUtil.getLanguageLevel(field)) <= 0) { buffer.append("Arrays.hashCode("); buffer.append(name); buffer.append(")"); } else { buffer.append(name); buffer.append(".hashCod...
adjustHashCodeToArrays
29,606
void (StringBuilder buffer) { if (mySuperHasHashCode) { buffer.append("super.hashCode()"); } else { buffer.append("0"); } }
addSuperHashCode
29,607
PsiMethod (PsiClass aClass, MethodSignature signature) { return MethodSignatureUtil.findMethodBySignature(aClass, signature, false); }
findMethod
29,608
int (PsiField f1, PsiField f2) { if (f1.getType() instanceof PsiPrimitiveType && !(f2.getType() instanceof PsiPrimitiveType)) return -1; if (!(f1.getType() instanceof PsiPrimitiveType) && f2.getType() instanceof PsiPrimitiveType) return 1; final String name1 = f1.getName(); final String name2 = f2.getName(); return nam...
compare
29,609
void () { PRIMITIVE_HASHCODE_FORMAT.put("byte", new MessageFormat("(int) {0}")); PRIMITIVE_HASHCODE_FORMAT.put("short", new MessageFormat("(int) {0}")); PRIMITIVE_HASHCODE_FORMAT.put("int", new MessageFormat("{0}")); PRIMITIVE_HASHCODE_FORMAT.put("long", new MessageFormat("(int) ({0} ^ ({0} >>> 32))")); PRIMITIVE_HASHC...
initPrimitiveHashcodeFormats
29,610
boolean (PsiType aType) { if (!(aType instanceof PsiArrayType)) return false; final PsiType componentType = ((PsiArrayType) aType).getComponentType(); return componentType instanceof PsiArrayType; }
isNestedArray
29,611
boolean (PsiType aType) { if (!(aType instanceof PsiArrayType)) return false; final PsiType componentType = ((PsiArrayType) aType).getComponentType(); final PsiClass psiClass = PsiUtil.resolveClassInType(componentType); if (psiClass == null) return false; final String qName = psiClass.getQualifiedName(); return CommonC...
isArrayOfObjects
29,612
MethodSignature () { return MethodSignatureUtil.createMethodSignature("hashCode", PsiType.EMPTY_ARRAY, PsiTypeParameter.EMPTY_ARRAY, PsiSubstitutor.EMPTY); }
getHashCodeSignature
29,613
MethodSignature (Project project, GlobalSearchScope scope) { final PsiClassType javaLangObject = PsiType.getJavaLangObject(PsiManager.getInstance(project), scope); return MethodSignatureUtil .createMethodSignature("equals", new PsiType[]{javaLangObject}, PsiTypeParameter.EMPTY_ARRAY, PsiSubstitutor.EMPTY); }
getEqualsSignature
29,614
String () { return GroovyBundle.message("Equals"); }
getCommandName
29,615
ClassMember[] (PsiClass aClass) { return ClassMember.EMPTY_ARRAY; }
getAllOriginalMembers
29,616
void () { super.cleanup(); myEqualsFields = null; myHashCodeFields = null; myNonNullFields = null; }
cleanup
29,617
String () { return GroovyBundle.message("property.missing"); }
getCommandName
29,618
String () { return GroovyBundle.message("property.missing"); }
getCommandName
29,619
ClassMember[] (PsiClass aClass) { return ClassMember.EMPTY_ARRAY; }
getAllOriginalMembers
29,620
GrMethod (PsiClass aClass, FileTemplate template) { Properties properties = FileTemplateManager.getInstance(aClass.getProject()).getDefaultProperties(); properties.setProperty(FileTemplate.ATTRIBUTE_RETURN_TYPE, "java.lang.Object"); properties.setProperty(FileTemplate.ATTRIBUTE_DEFAULT_RETURN_VALUE, "null"); properties...
genMethod
29,621
boolean (PsiParameter parameter) { return parameter.getType().equalsToText(CommonClassNames.JAVA_LANG_STRING) || parameter.getType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT); }
isNameParam
29,622
ClassMember[] (PsiClass aClass) { return ClassMember.EMPTY_ARRAY; }
getAllOriginalMembers
29,623
GrMethod (PsiClass aClass, FileTemplate template) { Properties properties = FileTemplateManager.getInstance(aClass.getProject()).getDefaultProperties(); properties.setProperty(FileTemplate.ATTRIBUTE_RETURN_TYPE, "java.lang.Object"); properties.setProperty(FileTemplate.ATTRIBUTE_DEFAULT_RETURN_VALUE, "null"); properties...
genGetter
29,624
GrMethod (PsiClass aClass, FileTemplate template) { Properties properties = FileTemplateManager.getInstance(aClass.getProject()).getDefaultProperties(); properties.setProperty(FileTemplate.ATTRIBUTE_RETURN_TYPE, "void"); properties.setProperty(FileTemplate.ATTRIBUTE_DEFAULT_RETURN_VALUE, ""); properties.setProperty(Fil...
genSetter
29,625
boolean (PsiParameter parameter) { return parameter.getType().equalsToText(CommonClassNames.JAVA_LANG_STRING) || parameter.getType().equalsToText(CommonClassNames.JAVA_LANG_OBJECT); }
isNameParam
29,626
void (@NotNull Runnable listener) { super.addChangeListener(listener); scriptPath.getChildComponent().getDocument().addDocumentListener( new DocumentAdapter() { @Override protected void textChanged(@NotNull DocumentEvent e) { listener.run(); } } ); }
addChangeListener
29,627
void (@NotNull DocumentEvent e) { listener.run(); }
textChanged
29,628
void (@NotNull GroovyScriptRunConfiguration configuration) { myScriptPathComponent.getComponent().setText(configuration.getScriptPath()); myCommonJavaParametersPanel.reset(configuration); myModulesComboBoxComponent.getComponent().setModules(configuration.getValidModules()); myModulesComboBoxComponent.getComponent().set...
resetEditorFrom
29,629
JComponent () { return myMainPanel; }
createEditor
29,630
JComponent () { return myAnchor; }
getAnchor
29,631
void (JComponent anchor) { myAnchor = anchor; myScriptPathComponent.setAnchor(anchor); myCommonJavaParametersPanel.setAnchor(anchor); myModulesComboBoxComponent.setAnchor(anchor); myJrePathEditor.setAnchor(anchor); }
setAnchor
29,632
String () { return GroovyBundle.message("script.runner.display.name"); }
getDisplayName
29,633
String () { return GroovyBundle.message("script.runner.description"); }
getConfigurationTypeDescription
29,634
Icon () { return JetgroovyIcons.Groovy.Groovy_16x16; }
getIcon
29,635
String () { return "GroovyScriptRunConfiguration"; }
getId
29,636
ConfigurationFactory () { return myConfigurationFactory; }
getConfigurationFactory
29,637
ConfigurationFactory[] () { return new ConfigurationFactory[]{myConfigurationFactory}; }
getConfigurationFactories
29,638
String () { return "reference.dialogs.rundebug.GroovyScriptRunConfiguration"; }
getHelpTopic
29,639
GroovyScriptRunConfigurationType () { return ConfigurationTypeUtil.findConfigurationType(GroovyScriptRunConfigurationType.class); }
getInstance
29,640
String () { return "Groovy"; }
getId
29,641
RunConfiguration (@NotNull Project project) { return new GroovyScriptRunConfiguration("Groovy Script", project, this); }
createTemplateConfiguration
29,642
String (PsiClass aClass, RunConfigurationModule module) { String qualifiedName = aClass.getQualifiedName(); Project project = module.getProject(); if (qualifiedName == null) { return module.getModuleName(); } PsiClass psiClass = JavaPsiFacade.getInstance(project).findClass(qualifiedName.replace('$', '.'), GlobalSearchS...
getConfigurationName
29,643
boolean (@NotNull Module module) { return LibrariesUtil.hasGroovySdk(module); }
isValidModule
29,644
void (final JavaParameters params, final VirtualFile scriptFile, Module module) { Charset charset = EncodingProjectManager.getInstance(module.getProject()).getEncoding(scriptFile, true); if (charset == null) { charset = EncodingManager.getInstance().getDefaultCharset(); if (!Comparing.equal(CharsetToolkit.getDefaultSys...
addScriptEncodingSettings
29,645
Icon () { return JetgroovyIcons.Groovy.GroovyFile; }
getScriptIcon
29,646
GroovyScriptRunner () { return new DefaultGroovyScriptRunner(); }
getRunner
29,647
boolean (@NotNull PsiFile file, GroovyScriptType scriptType) { if (!(file instanceof GroovyFile)) return false; if (!((GroovyFile)file).isScript()) return false; return isSpecificScriptFile((GroovyFile)file, scriptType); }
isSpecificScriptFile
29,648
boolean (@NotNull GroovyFile script, GroovyScriptType scriptType) { assert script.isScript(); if (scriptType == DEFAULT_TYPE) { return getScriptType(script) == DEFAULT_TYPE; } for (GroovyScriptTypeDetector detector : GroovyScriptTypeDetector.EP_NAME.getExtensions()) { if (detector.getScriptType() == scriptType) { if (d...
isSpecificScriptFile
29,649
GroovyRunnableScriptType (@NotNull GroovyFile script) { GroovyScriptType scriptType = GroovyScriptTypeDetector.getScriptType(script); return scriptType == null ? DEFAULT_TYPE : (GroovyRunnableScriptType)scriptType; }
getScriptType
29,650
boolean (@NotNull GroovyFile script) { return GroovyScriptTypeDetector.getScriptType(script) == null; }
isPlainGroovyScript
29,651
Module () { Module module = getConfigurationModule().getModule(); if (module != null) return module; return getFirstValidModule(); }
getModule
29,652
Module () { final GroovyScriptRunner scriptRunner = getScriptRunner(); Module[] modules = ModuleManager.getInstance(getProject()).getModules(); if (scriptRunner == null) { return modules[0]; } for (Module module : modules) { if (scriptRunner.isValidModule(module)) { return module; } } return null; }
getFirstValidModule
29,653
Collection<Module> () { Module[] modules = ModuleManager.getInstance(getProject()).getModules(); final GroovyScriptRunner scriptRunner = getScriptRunner(); if (scriptRunner == null) { return Arrays.asList(modules); } ArrayList<Module> res = new ArrayList<>(); for (Module module : modules) { if (scriptRunner.isValidModu...
getValidModules
29,654
GroovyScriptRunner () { final VirtualFile scriptFile = ScriptFileUtil.findScriptFileByPath(getScriptPath()); if (scriptFile == null) return null; final PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(scriptFile); if (!(psiFile instanceof GroovyFile groovyFile)) return null; if (groovyFile.isScript()) { ...
getScriptRunner
29,655
void (@NotNull Element element) { super.readExternal(element); scriptPath = ExternalizablePath.localPathValue(JDOMExternalizer.readString(element, "path")); vmParams = JDOMExternalizer.readString(element, "vmparams"); scriptParams = JDOMExternalizer.readString(element, "params"); final String wrk = JDOMExternalizer.rea...
readExternal
29,656
RunProfileState (@NotNull Executor executor, @NotNull ExecutionEnvironment environment) { final VirtualFile scriptFile = ScriptFileUtil.findScriptFileByPath(getScriptPath()); if (scriptFile == null) return null; final GroovyScriptRunner scriptRunner = getScriptRunner(); if (scriptRunner == null) return null; return new...
getState
29,657
void (@NotNull ProcessEvent event) { if (!ApplicationManager.getApplication().isDisposed()) { VirtualFileManager.getInstance().asyncRefresh(); } }
processTerminated
29,658
String () { return null; }
getProgramParameters
29,659
RefactoringElementListener (PsiElement element) { if (scriptPath == null || !scriptPath.equals(getPathByElement(element))) { return null; } final PsiClass classToRun = GroovyRunnerPsiUtil.getRunningClass(element); if (element instanceof GroovyFile) { return new RefactoringElementAdapter() { @Override protected void ele...
getRefactoringElementListener
29,660
void (@NotNull PsiElement newElement) { if (newElement instanceof GroovyFile file) { setScriptPath(ScriptFileUtil.getScriptFilePath(file.getVirtualFile())); } }
elementRenamedOrMoved
29,661
void (@NotNull PsiElement newElement, @NotNull String oldQualifiedName) { elementRenamedOrMoved(newElement); }
undoElementMovedOrRenamed
29,662
void (@NotNull PsiElement newElement) { setName(((PsiClass)newElement).getName()); }
elementRenamedOrMoved
29,663
void (@NotNull PsiElement newElement, @NotNull String oldQualifiedName) { elementRenamedOrMoved(newElement); }
undoElementMovedOrRenamed
29,664
String (@NotNull PsiElement element) { PsiFile file = element.getContainingFile(); if (file == null) return null; VirtualFile vfile = file.getVirtualFile(); if (vfile == null) return null; return vfile.getPath(); }
getPathByElement
29,665
JavaParameters (@Nullable Module module) { JavaParameters params = new JavaParameters(); params.setCharset(null); if (module != null) { final Sdk sdk = ModuleRootManager.getInstance(module).getSdk(); if (sdk != null && sdk.getSdkType() instanceof JavaSdkType) { params.setJdk(sdk); } } if (params.getJdk() == null) { par...
createJavaParametersWithSdk
29,666
void (@Nullable String value) { vmParams = value; }
setVMParameters
29,667
String () { return vmParams; }
getVMParameters
29,668
boolean () { return myAlternativeJrePathEnabled; }
isAlternativeJrePathEnabled
29,669
void (boolean alternativeJrePathEnabled) { myAlternativeJrePathEnabled = alternativeJrePathEnabled; }
setAlternativeJrePathEnabled
29,670
String () { return myAlternativeJrePath; }
getAlternativeJrePath
29,671
void (@Nullable String alternativeJrePath) { myAlternativeJrePath = alternativeJrePath; }
setAlternativeJrePath
29,672
String () { return null; }
getRunClass
29,673
String () { return null; }
getPackage
29,674
void (@Nullable String value) { scriptParams = value; }
setProgramParameters
29,675
String () { return scriptParams; }
getProgramParameters
29,676
void (@Nullable String value) { workDir = value; }
setWorkingDirectory
29,677
String () { return workDir; }
getWorkingDirectory
29,678
void (@NotNull Map<String, String> envs) { this.envs.clear(); this.envs.putAll(envs); }
setEnvs
29,679
void (boolean passParentEnvs) { this.passParentEnv = passParentEnvs; }
setPassParentEnvs
29,680
boolean () { return passParentEnv; }
isPassParentEnvs
29,681
boolean () { return isDebugEnabled; }
isDebugEnabled
29,682
void (boolean debugEnabled) { isDebugEnabled = debugEnabled; }
setDebugEnabled
29,683
boolean () { return isAddClasspathToTheRunner; }
isAddClasspathToTheRunner
29,684
void (boolean addClasspathToTheRunner) { isAddClasspathToTheRunner = addClasspathToTheRunner; }
setAddClasspathToTheRunner
29,685
void (@Nullable String scriptPath) { this.scriptPath = scriptPath; }
setScriptPath
29,686
GlobalSearchScope () { GlobalSearchScope superScope = super.getSearchScope(); String path = getScriptPath(); if (path == null) return superScope; VirtualFile scriptFile = LocalFileSystem.getInstance().findFileByPath(path); if (scriptFile == null) return superScope; GlobalSearchScope fileScope = GlobalSearchScope.fileSc...
getSearchScope
29,687
int (@NotNull VirtualFile file1, @NotNull VirtualFile file2) { if (file1.equals(scriptFile)) return 1; if (file2.equals(scriptFile)) return -1; return super.compare(file1, file2); }
compare
29,688
boolean () { return false; }
shouldRefreshAfterFinish
29,689
String (final String groovyHomePath) { String confpath = FileUtil.toSystemDependentName(groovyHomePath + "/conf/groovy-starter.conf"); if (new File(confpath).exists()) { return confpath; } return null; }
getConfPath
29,690
String (String fileName) { try { final String jarPath = PathUtil.getJarPathForClass(GroovyLanguage.class); if (new File(jarPath).isFile()) { //jar; distribution mode return new File(jarPath, "../" + fileName).getCanonicalPath(); } //else, it's directory in out, development mode return new File(jarPath, "conf/" + fileNa...
getPathInConf
29,691
void (JavaParameters params, @NotNull String groovyHome) { params.getVMParametersList().add("-Dgroovy.home=" + groovyHome); if (groovyHome.contains("grails")) { //a bit of a hack params.getVMParametersList().add("-Dgrails.home=" + groovyHome); } if (groovyHome.contains("griffon")) { //a bit of a hack params.getVMParame...
setGroovyHome
29,692
void (JavaParameters params) { Sdk jdk = params.getJdk(); if (jdk != null && jdk.getSdkType() instanceof JavaSdkType) { String toolsPath = ((JavaSdkType)jdk.getSdkType()).getToolsPath(jdk); if (toolsPath != null) { params.getVMParametersList().add("-Dtools.jar=" + toolsPath); } } }
setToolsJar
29,693
VirtualFile (@NotNull Module module) { final VirtualFile[] files = OrderEnumerator.orderEntries(module).getAllLibrariesAndSdkClassesRoots(); for (VirtualFile root : files) { if (GroovyConfigUtils.GROOVY_JAR_PATTERN.matcher(root.getName()).matches() || GroovyConfigUtils.matchesGroovyAll(root.getName())) { return root; }...
findGroovyJar
29,694
boolean (@NotNull String name, Project project) { return GroovyRefactoringUtil.KEYWORDS.contains(name); }
isKeyword
29,695
boolean (@NotNull String name, Project project) { return GroovyRefactoringUtil.isCorrectReferenceName(name, project); }
isIdentifier
29,696
void (@NotNull Consumer<LookupElement> consumer, @NotNull PrefixMatcher matcher) { GrCodeReferenceElement ref = myAnnotation.getClassReference(); PsiElement resolved = ref.resolve(); if (resolved instanceof PsiClass) { final PsiAnnotation annotationCollector = GrAnnotationCollector.findAnnotationCollector((PsiClass)res...
process
29,697
Set<String> (@NotNull GrReferenceExpression refExpr, @NotNull PrefixMatcher matcher, @Nullable GrExpression qualifier) { return new CompleteReferencesWithSameQualifier(refExpr, matcher, qualifier).getVariantsWithSameQualifierImpl(); }
getVariantsWithSameQualifier
29,698
Set<String> () { if (myQualifier != null && myQualifier.getType() != null) return Collections.emptySet(); final PsiElement scope = PsiTreeUtil.getParentOfType(myRefExpr, GrMember.class, PsiFile.class); Set<String> result = new LinkedHashSet<>(); if (scope != null) { addVariantsWithSameQualifier(scope, result); } return...
getVariantsWithSameQualifierImpl
29,699
void (@NotNull PsiElement element, @NotNull Set<String> result) { if (element instanceof GrReferenceExpression refExpr && element != myRefExpr && !PsiUtil.isLValue((GroovyPsiElement)element)) { final String refName = refExpr.getReferenceName(); if (refName != null && !result.contains(refName) && myMatcher.prefixMatches...
addVariantsWithSameQualifier