Commit Graph

1046 Commits

Author SHA1 Message Date
Alexander Udalov cc45cf2a4e Rename JavaSignatureResolver to TypeParameterResolver
Also rename 'parameterResolver' field to 'valueParameterResolver'
2013-09-04 21:55:02 +04:00
Alexander Udalov 944d1fc59e Refactor JavaSignatureResolver
Now it has the only method returning Initializer, an object which can be told
to initialize resolved descriptors later, or to obtain these descriptors.
Delete useless methods, combine the remaining ones
2013-09-04 21:55:02 +04:00
Alexander Udalov a1f3a56c25 Refactor TypeVariableResolver
Delete 'context' field which was used only for debugging
2013-09-04 21:55:02 +04:00
Alexander Udalov 04516376c0 Migrate SAMUtils from PSI to JavaElement
- create JavaTypeSubstitutor as a mirror for PsiSubstitutor
- copy-paste MethodSignatureUtil.areSignaturesErasureEqual() and migrate it to
  JavaTypeSubstitutor
- use a pair of method and substitutor instead of
  'MethodSignatureBackedByPsiMethod'
- add JavaClass.getDefaultType() which goes into JavaPsiFacade and creates an
  unsubstituted PsiClassType for the class
- green code

The only PSI usage left is TypeConversionUtil.erasure(), which needs to be
copied and migrated somehow
2013-09-04 21:55:02 +04:00
Alexander Udalov a3d9d4fe66 Move classes around in java-specific parts of compiler
- move JetClsMethod and JetJavaMirrorMarker to 'jetAsJava' package
- move JetClsMethodImpl out of 'wrappers' packages
- move TypeVariableResolver to 'resolver' package, make it package-local
- move MembersCache and NamedMembers to 'scope', make the former package-local
2013-09-04 21:55:02 +04:00
Alexander Udalov c18615f704 Rename JavaCompileTimeConstResolver to AnnotationArgumentResolver 2013-09-04 21:55:02 +04:00
Alexander Udalov f98a949fdd Migrate JavaAnnotationResolver from PSI to JavaElement
Create a bunch of annotation argument classes, which serve as wrappers over
PsiAnnotationMemberValue class, but also have a Name
2013-09-04 21:55:02 +04:00
Alexander Udalov 7b945c2313 Migrate JavaTypeTransformer from PsiType to JavaType
Add more wrapper methods to JavaClassifierType.

Inline the utility method adjustTypeUsageWithMutabilityAnnotations to the two
places where it was used. Also add JavaAnnotationOwner and change signature of
JavaAnnotationResolver to take JavaAnnotationOwner, not PSI
2013-09-04 21:55:01 +04:00
Alexander Udalov 732378d837 Rename JavaClassType to JavaClassifierType 2013-09-04 21:55:01 +04:00
Alexander Udalov c1d40f1e15 Introduce JavaClassifier
JavaClassifier is a common type for JavaClass and JavaTypeParameter. In almost
all of the places JavaClass remains to be JavaClass, except for the resolution
result of JavaClassType, which can be a type parameter. Add an assertion that
JavaClass is created only for a class and not for a type parameter. Delete
different creations of JavaClass in 'idea' (where there can be a type
parameter) by changing the interface of util functions.

Delete JavaModifierListOwnerImpl, extract its methods into JavaElementUtil and
use these implementations for every JavaModifierListOwner

Continue refactoring JavaTypeTransformer to work with JavaType, not PsiType
2013-09-04 21:55:01 +04:00
Alexander Udalov 787d8a5234 Refactor JavaTypeTransformer and ValueParameterResolver
Use an instanceof-chain on a JavaType instance instead of PsiTypeVisitor in
TypeTransformer. Add a special method to handle vararg types, use it in
ValueParameterResolver
2013-09-04 21:55:01 +04:00
Alexander Udalov f669771b7e Introduce JavaType and subclasses
Use JavaType instead of PsiType whenever possible.

In this commit the logic of checking whether a loaded parameter is a vararg
changed: instead of checking if the corresponding PsiType is PsiEllipsisType we
now check if the containing method has the ACC_VARARG modifier
2013-09-04 21:55:01 +04:00
Alexander Udalov 998e598846 Refactor JavaConstructorResolver
Extract methods, fix warnings, use JavaClass/JavaMethod instead of Psi
2013-09-04 21:55:01 +04:00
Alexander Udalov 62868421cf Minor, green code & move type transformer to "resolver/" 2013-09-04 21:55:01 +04:00
Alexander Udalov 78f9cb7203 Get rid of PsiMemberWrapper
Continue migration, use the new Java* classes instead everywhere
2013-09-04 21:55:01 +04:00
Alexander Udalov 245b9d1ab1 Minor, change method parameter from String to JvmClassName 2013-09-04 21:55:00 +04:00
Alexander Udalov 55af245867 Migrate JavaClassResolver from PSI to JavaClass
Several places are still left and need special handling.  The overall behavior
of the resolver should not change in this commit (except for maybe different
small operations like creating names, fq-names, ...)
2013-09-04 21:55:00 +04:00
Alexander Udalov de54f7d732 JavaClass, JavaPackage, JavaAnnotation
Create dumb wrappers over PSI elements, will be used for loading descriptors
from JVM reflection later (instead of PSI)
2013-09-04 21:55:00 +04:00
Alexander Udalov eaacff4566 Remove RuntimeHandleClassesMode
There were two usages of RuntimeHandleClassesMode.REPORT_ERROR: first in tests,
where it never occurred, second in JavaClassResolver, where it's now inlined
2013-09-04 21:55:00 +04:00
Alexander Udalov 4eb9f28312 Remove useless PsiClass parameter
It was used only for a debug message and an assertion that never happened
2013-09-04 21:55:00 +04:00
Alexander Udalov cc81d12b55 Remove useless methods from PsiClassFinder
Their only implementations called methods on a parameter + a utility. Move the
utility to DescriptorResolverUtils
2013-09-04 21:55:00 +04:00
Alexander Udalov 175a598e6d Delete JavaBaseScope.getPsiElement() 2013-09-04 21:55:00 +04:00
Alexander Udalov d84ab4423f Support enums as annotation arguments in deserialized Kotlin descriptors 2013-08-29 16:48:09 +04:00
Alexander Udalov de062274e9 Extract getEnumEntriesScope utility method 2013-08-29 16:48:09 +04:00
Pavel V. Talanov e0c9328969 Remove unused DependencyClassByQualifiedNameResolver#resolveNamespace 2013-08-26 22:15:08 +04:00
Pavel V. Talanov 881a633ba0 Get rid of DescriptorSearchRule.ERROR_IF_FOUND_IN_KOTLIN
Rename other constants in DescriptorSearchRule
Inline methods with default values for DescriptorSearchRule
2013-08-26 22:07:36 +04:00
Pavel V. Talanov b634792356 Use VirtualFileFinder in AnnotationDescriptorDeserializer 2013-08-26 17:58:50 +04:00
Pavel V. Talanov 7d50a8c6ea Use VirtualFileFinder in JavaNamespaceResolver 2013-08-26 17:58:49 +04:00
Pavel V. Talanov e4988f9dba Use VirtualFileFinder in JavaClassResolver
HACK: determine whether fqname is a name for class contained in class or namespace based on virtual file name
This commit introduces code duplication which is hard to avoid without major refactoring
2013-08-26 17:58:48 +04:00
Pavel V. Talanov 52de4215b5 Introduce VirtualFileFinder interface
Provide different implementations in Cli and Ide
2013-08-26 17:58:47 +04:00
Pavel V. Talanov 4e29aad1c1 Rework invalid abi version reporting
KotlinClassFileHeader is aware of older annotations
Psi is not used to report invalid Abi version in CLI
2013-08-26 17:58:44 +04:00
Pavel V. Talanov e0e2d50143 KotlinClassFileHeader now saves JvmClassName for processed class
Add utility methods
Refactor static method to member methods
2013-08-26 16:00:15 +04:00
Alexander Udalov fb07a4c1ab Move SAM utils from MembersCache to SAMUtils 2013-08-26 16:00:09 +04:00
Alexander Udalov c5e37cc3de Move classes around in frontend.java
Move Java<->Kotlin class mapping to 'mapping' package, move method mapping to
'kotlinSignature' (and make it package local), delete unused methods
2013-08-26 16:00:08 +04:00
Alexander Udalov ea7036d808 Minor, move utilities to where they are used 2013-08-26 16:00:07 +04:00
Alexander Udalov 85e7b87ccd Move java visibilities to JavaVisibilities class
Move related utilities to where they're used
2013-08-26 16:00:06 +04:00
Alexander Udalov e1a10eb419 Delete JavaInnerClassResolver
Move its two methods to the place where they are used
2013-08-26 16:00:05 +04:00
Alexander Udalov 86013aacde Delete PsiDeclarationProvider
And its two subclasses. Replace it by package-local MembersProvider, which is
used only in java scopes, and two factory methods (for package & for class)
2013-08-26 16:00:03 +04:00
Alexander Udalov e2d6234c9c Simplify PsiDeclarationProvider
- simplify hierarchy, now there's only two kinds of providers: for packages and
  for classes
- remove getters from providers and thus almost get rid of dependencies on them
  from the outside resolver (the only usages left are those that call
  getMembersCache)
2013-08-26 16:00:02 +04:00
Alexander Udalov d708dc6ed4 Delete JavaSemanticServices
Almost in all places only JavaDescriptorResolver was needed. The only exception
is JavaPackageScope which needs PsiClassFinder, that is now passed as a
constructor argument.

Also merge JavaPackageScopeWithoutMembers into its superclass JavaPackageScope
2013-08-26 16:00:01 +04:00
Alexander Udalov a0cbe80aca Delete JavaSemanticServices.getTypeTransformer()
Two clients can depend on JavaTypeTransformer directly instead of
JavaSemanticServices
2013-08-26 16:00:00 +04:00
Alexander Udalov dbf324667f Delete PsiDeclarationProviderFactory 2013-08-26 15:59:58 +04:00
Alexander Udalov 2d7a5ebf36 Simplify injectors for frontend.java
- delete InjectorForJavaSemanticServices, replace its usages with
  InjectorForJavaDescriptorResolver
- delete unneeded fields and parameters of InjectorForJavaDescriptorResolver
2013-08-26 15:59:57 +04:00
Alexander Udalov 763572663e Delete almost all code related to signature writing
Delete org.jetbrains.jet.rt.signature and jet.typeinfo packages from runtime,
refactor BothSignatureWriter so that it now writes only java generic signature
and saves parameter types and kinds
2013-08-26 15:59:54 +04:00
Alexander Udalov 5d647cac94 Delete ScopeUtils, move its only method 2013-08-26 15:59:52 +04:00
Alexander Udalov 78bd6faffc Minor, refactor JetFilesProvider 2013-08-26 15:59:51 +04:00
Alexander Udalov 155f3b3b96 Simplify TypeVariableResolver 2013-08-26 15:59:50 +04:00
Alexander Udalov cbdc157743 Delete PsiAnnotationWrapper
Merge its logic into KotlinSignatureAnnotation, move the latter to
resolve/java/kotlinSignature, delete resolve/java/kt package
2013-08-26 15:59:49 +04:00
Alexander Udalov bd54e070bb Get rid of dependency on PsiClass from deserialized resolver 2013-08-26 15:59:48 +04:00
Alexander Udalov 8746ee2895 Report ABI errors without PsiClass 2013-08-26 15:59:46 +04:00