Lightweight library allowing to introspect basic stuff about Kotlin symbols

Overview

Kotlin Kotlin Slack

kotlinx.reflect.lite

This library provides an API to introspect Kotlin symbols at runtime. Its main feature is the small size which makes it possible to use it on memory-constrained devices.

Download

Maven

Add jcenter repository (if you don't have it yet)

<repository>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
    <id>central</id>
    <name>bintray</name>
    <url>https://jcenter.bintray.com</url>
</repository>

Add a dependency:

<dependency>
    <groupId>org.jetbrains.kotlinx</groupId>
    <artifactId>kotlinx.reflect.lite</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle

jcenter is configured by default in gradle however you may need to include it in some cases

repositories {
    jcenter()
}

Add a dependency:

compile 'org.jetbrains.kotlinx:kotlinx.reflect.lite:1.0.0'

FAQ

Why not just use Java reflection instead?

Java reflection cannot figure out Kotlin-specific features of the introspected program. For example, nullability of Kotlin types is erased in JVM bytecode.

Also parameter names were not supported in Java reflection until Java 8.

Why not just use Kotlin reflection instead?

While Kotlin has its own reflection library, its size is currently above 2Mb which may be unacceptable in some circumstances, for example on Android.

The size of the minimized version of this library is about 100Kb plus the dependency on protobuf-java.

What is supported?

Currently the only supported features are names of parameters and nullability of their types.

Comments
  • Improve kotlinx.reflect.lite and rewrite it to use kotlinx.metadata.jvm under the hood

    Improve kotlinx.reflect.lite and rewrite it to use kotlinx.metadata.jvm under the hood

    This pull request prepares the kotlinx.reflect.lite for a new release 1.1.0, ~the main feature of which is the ability to introspect not only the java.lang.Class objects, but also .class files~ [1]. Some new API has been added (requested in KT-11386). All of the existing API has been documented (no API docs yet though, unfortunately), and an example has been added to the ReadMe.

    [1]: UPD: As noted in KT-11386, making kotlinx.reflect.lite understand .class files without the context of Java reflection is no longer necessary because it can be achieved via kotlinx.metadata.jvm. This pull request has since been repurposed to only contain reimplementation of kotlinx.reflect.lite based on kotlinx.metadata.jvm, and requested improvements in the API.

    opened by udalov 19
  • Support subset needed by Moshi

    Support subset needed by Moshi

    If kotlinx.reflect.lite could support the subset needed by Moshi, could make Moshi with reflection a more viable option.

    https://github.com/square/moshi/blob/master/kotlin/reflect/src/main/java/com/squareup/moshi/kotlin/reflect/KotlinJsonAdapter.kt

    import kotlin.reflect.full.findAnnotation
    import kotlin.reflect.full.memberProperties
    import kotlin.reflect.full.primaryConstructor
    import kotlin.reflect.jvm.isAccessible
    import kotlin.reflect.jvm.javaField
    import kotlin.reflect.jvm.javaType
    
    opened by yogurtearl 5
  • Duplicate class a.a.a.c.a found in kotlinx.reflect.lite-1.0.0.jar

    Duplicate class a.a.a.c.a found in kotlinx.reflect.lite-1.0.0.jar

    Hi, I'm facing this exception with one of my dependency provided by a vendor. Is there a way to fix this?

    Duplicate class a.a.a.c.a found in kotlinx.reflect.lite-1.0.0.jar

    opened by SaqibJDev 2
  • Errors with the old version in the classpath

    Errors with the old version in the classpath

    IDE indexing doesn't like the 1038 versino

    Error while indexing /Users/jminard/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx.reflect.lite/1.0.0-beta-1038/da6b747014cae64c86606d8627cb4ee5c35d4148/kotlinx.reflect.lite-1.0.0-beta-1038.jar!/a/a/a/a/a/a.class
    To reindex this file IDEA has to be restarted: Could not find class data for nested class Companion of class a/a/a/a/a/a
    java.lang.AssertionError: Could not find class data for nested class Companion of class a/a/a/a/a/a
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilder.createNestedClassStub(ClassClsStubBuilder.kt:237)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilder.createCompanionObjectStub(ClassClsStubBuilder.kt:171)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilder.createClassBodyAndMemberStubs(ClassClsStubBuilder.kt:160)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilder.build(ClassClsStubBuilder.kt:74)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilderKt.createClassStub(ClassClsStubBuilder.kt:43)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClsStubBuildingKt.createTopLevelClassStub(clsStubBuilding.kt:44)
        at org.jetbrains.kotlin.idea.decompiler.classFile.KotlinClsStubBuilder.doBuildFileStub(KotlinClsStubBuilder.kt:90)
        at org.jetbrains.kotlin.idea.decompiler.classFile.KotlinClsStubBuilder.buildFileStub(KotlinClsStubBuilder.kt:57)
        at com.intellij.psi.impl.compiled.ClassFileStubBuilder.buildStubTree(ClassFileStubBuilder.java:58)
        at com.intellij.psi.impl.compiled.ClassFileStubBuilder.buildStubTree(ClassFileStubBuilder.java:38)
        at com.intellij.psi.stubs.StubTreeBuilder.buildStubTree(StubTreeBuilder.java:63)
        at com.intellij.psi.stubs.StubUpdatingIndex$3$1.run(StubUpdatingIndex.java:127)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:947)
        at com.intellij.psi.stubs.StubUpdatingIndex$3.map(StubUpdatingIndex.java:124)
        at com.intellij.psi.stubs.StubUpdatingIndex$3.map(StubUpdatingIndex.java:118)
        at com.intellij.util.indexing.MapReduceIndex.update(MapReduceIndex.java:398)
        at com.intellij.util.indexing.FileBasedIndexImpl.updateSingleIndex(FileBasedIndexImpl.java:1815)
        at com.intellij.util.indexing.FileBasedIndexImpl$23.run(FileBasedIndexImpl.java:1744)
        at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyIn(FileTypeManagerImpl.java:504)
        at com.intellij.util.indexing.FileBasedIndexImpl.a(FileBasedIndexImpl.java:1702)
        at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1687)
        at com.intellij.util.indexing.UnindexedFilesUpdater$2.consume(UnindexedFilesUpdater.java:108)
        at com.intellij.util.indexing.UnindexedFilesUpdater$2.consume(UnindexedFilesUpdater.java:105)
        at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable$1.run(CacheUpdateRunner.java:233)
        at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1180)
        at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable$2.run(CacheUpdateRunner.java:253)
        at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
        at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:446)
        at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:443)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
        at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.run(CacheUpdateRunner.java:247)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:169)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jetbrains.ide.PooledThreadExecutor$2$1.run(PooledThreadExecutor.java:71)
    
    
    
    java.lang.AssertionError: Could not find class data for nested class PropertySignature of class a/a/a/c/b/v
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilder.createNestedClassStub(ClassClsStubBuilder.kt:237)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilder.createInnerAndNestedClasses(ClassClsStubBuilder.kt:230)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilder.createClassBodyAndMemberStubs(ClassClsStubBuilder.kt:162)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilder.build(ClassClsStubBuilder.kt:74)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClassClsStubBuilderKt.createClassStub(ClassClsStubBuilder.kt:43)
        at org.jetbrains.kotlin.idea.decompiler.stubBuilder.ClsStubBuildingKt.createTopLevelClassStub(clsStubBuilding.kt:44)
        at org.jetbrains.kotlin.idea.decompiler.classFile.KotlinClsStubBuilder.doBuildFileStub(KotlinClsStubBuilder.kt:90)
        at org.jetbrains.kotlin.idea.decompiler.classFile.KotlinClsStubBuilder.buildFileStub(KotlinClsStubBuilder.kt:57)
        at com.intellij.psi.impl.compiled.ClassFileStubBuilder.buildStubTree(ClassFileStubBuilder.java:58)
        at com.intellij.psi.impl.compiled.ClassFileStubBuilder.buildStubTree(ClassFileStubBuilder.java:38)
        at com.intellij.psi.stubs.StubTreeBuilder.buildStubTree(StubTreeBuilder.java:63)
        at com.intellij.psi.stubs.StubUpdatingIndex$3$1.run(StubUpdatingIndex.java:127)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:947)
        at com.intellij.psi.stubs.StubUpdatingIndex$3.map(StubUpdatingIndex.java:124)
        at com.intellij.psi.stubs.StubUpdatingIndex$3.map(StubUpdatingIndex.java:118)
        at com.intellij.util.indexing.MapReduceIndex.update(MapReduceIndex.java:398)
        at com.intellij.util.indexing.FileBasedIndexImpl.updateSingleIndex(FileBasedIndexImpl.java:1815)
        at com.intellij.util.indexing.FileBasedIndexImpl$23.run(FileBasedIndexImpl.java:1744)
        at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyIn(FileTypeManagerImpl.java:504)
        at com.intellij.util.indexing.FileBasedIndexImpl.a(FileBasedIndexImpl.java:1702)
        at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1687)
        at com.intellij.util.indexing.UnindexedFilesUpdater$2.consume(UnindexedFilesUpdater.java:108)
        at com.intellij.util.indexing.UnindexedFilesUpdater$2.consume(UnindexedFilesUpdater.java:105)
        at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable$1.run(CacheUpdateRunner.java:233)
        at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1180)
        at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable$2.run(CacheUpdateRunner.java:253)
        at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
        at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:446)
        at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:443)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
        at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.run(CacheUpdateRunner.java:247)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:169)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jetbrains.ide.PooledThreadExecutor$2$1.run(PooledThreadExecutor.java:71)
    
    
    
    
    
    opened by apatrida 2
  • Add `Kover` plugin and set up basic rules

    Add `Kover` plugin and set up basic rules

    Will add koverReport as a build step in TeamCity after this gets merged, and will add codecov.io integration later this week if everyone's fine with JaCoCo engine

    Targeting master to mitigate build failures after it's added as a step in TC (the alternative is branch-specific settings, but imho that overcomplicates things)

    opened by IgnatBeresnev 1
  • Bump kotlin-stdlib from 1.0.3 to 1.6.0

    Bump kotlin-stdlib from 1.0.3 to 1.6.0

    Bumps kotlin-stdlib from 1.0.3 to 1.6.0.

    Release notes

    Sourced from kotlin-stdlib's releases.

    Kotlin 1.6.0

    Changelog

    Android

    • KT-48019 Bundle Kotlin Tooling Metadata into apk artifacts
    • KT-47733 JVM / IR: Android Synthetic don't generate _findCachedViewById function

    Compiler

    New Features

    • KT-47984 In-place arguments inlining for @​InlineOnly functions
    • KT-12794 Allow runtime retention repeatable annotations when compiling under Java 8
    • KT-43714 Support annotations on class type parameters (AnnotationTarget.TYPE_PARAMETER)
    • KT-45949 Kotlin/Native: Improve bound check elimination
    • KT-43919 Support loading Java annotations on base classes and implementing interfaces' type arguments
    • KT-48194 Try to resolve calls where we don't have enough type information, using the builder inference despite the presence of the annotation
    • KT-47736 Support conversion from regular functional types to suspending ones in JVM IR
    • KT-39055 Support property delegate created via synthetic method instead of field

    Performance Improvements

    • KT-45185 FIR2IR: get rid of IrBuiltIns usages
    • KT-47918 JVM / IR: Performance degradation with const-bound for-cycles
    • KT-33835 Bytecode including unnecessary null checks for safe calls where left-hand side is non-nullable
    • KT-41510 Compilation of kotlin html DSL is still too slow
    • KT-48211 We spend a lot of time in ExpectActual declaration checker when there is very small amount of actual/expect declaration
    • KT-39054 Optimize delegated properties which call get/set on the given KProperty instance on JVM
    • KT-46615 Don't generate nullability assertions in methods for directly invoked lambdas

    Fixes

    • KT-49613 JVM / IR: "Exception during IR lowering" with java fun interface and it's non-trivial usage
    • KT-49548 "ClassCastException: java.util.ArrayList$Itr cannot be cast to kotlin.collections.IntIterator" with Iterable inside let
    • KT-22562 Deprecate calls to "suspend" named functions with single dangling lambda argument
    • KT-47120 JVM IR: NoClassDefFoundError when there are an extension and a regular function with the same name
    • KT-49477 Has ran into recursion problem with two interdependant delegates
    • KT-49442 ClassCastException on reporting [EXPOSED_FROM_PRIVATE_IN_FILE] Deprecation: private-in-file class should not expose 'private-in-class'
    • KT-49371 JVM / IR: "NoSuchMethodError" with multiple inheritance
    • KT-44843 PSI2IR: "org.jetbrains.kotlin.psi2ir.generators.ErrorExpressionException: null: KtCallExpression" with delegate who has name or parameter with the same name as a property
    • KT-49294 Turning FlowCollector into 'fun interface' leads to AbstractMethodError
    • KT-18282 Companion object referencing it's own method during construction compiles successfully but fails at runtime with VerifyError
    • KT-25289 Prohibit access to class members in the super constructor call of its companion and nested object
    • KT-32753 Prohibit @​JvmField on property in primary constructor that overrides interface property
    • KT-43433 Suspend conversion is disabled message in cases where it is not supported and quickfix to update language version is suggested
    • KT-49399 Building repeatable annotation with Container nested class fails with ISE: "Repeatable annotation class should have a container generated"
    • KT-49209 Default upper bound for type variables should be non-null
    • KT-49335 NPE in RepeatedAnnotationLowering.wrapAnnotationEntriesInContainer when using @Repeatable annotation from different file
    • KT-48876 java.lang.UnsupportedOperationException: org.jetbrains.kotlin.ir.expressions.impl.IrReturnableBlockImpl@4a729df2

    ... (truncated)

    Changelog

    Sourced from kotlin-stdlib's changelog.

    1.6.0

    Android

    • KT-48019 Bundle Kotlin Tooling Metadata into apk artifacts
    • KT-47733 JVM / IR: Android Synthetic don't generate _findCachedViewById function

    Compiler

    New Features

    • KT-47984 In-place arguments inlining for @​InlineOnly functions
    • KT-12794 Allow runtime retention repeatable annotations when compiling under Java 8
    • KT-43714 Support annotations on class type parameters (AnnotationTarget.TYPE_PARAMETER)
    • KT-45949 Kotlin/Native: Improve bound check elimination
    • KT-43919 Support loading Java annotations on base classes and implementing interfaces' type arguments
    • KT-48194 Try to resolve calls where we don't have enough type information, using the builder inference despite the presence of the annotation
    • KT-47736 Support conversion from regular functional types to suspending ones in JVM IR
    • KT-39055 Support property delegate created via synthetic method instead of field

    Performance Improvements

    • KT-45185 FIR2IR: get rid of IrBuiltIns usages
    • KT-47918 JVM / IR: Performance degradation with const-bound for-cycles
    • KT-33835 Bytecode including unnecessary null checks for safe calls where left-hand side is non-nullable
    • KT-41510 Compilation of kotlin html DSL is still too slow
    • KT-48211 We spend a lot of time in ExpectActual declaration checker when there is very small amount of actual/expect declaration
    • KT-39054 Optimize delegated properties which call get/set on the given KProperty instance on JVM
    • KT-46615 Don't generate nullability assertions in methods for directly invoked lambdas

    Fixes

    • KT-49613 JVM / IR: "Exception during IR lowering" with java fun interface and it's non-trivial usage
    • KT-49548 "ClassCastException: java.util.ArrayList$Itr cannot be cast to kotlin.collections.IntIterator" with Iterable inside let
    • KT-22562 Deprecate calls to "suspend" named functions with single dangling lambda argument
    • KT-47120 JVM IR: NoClassDefFoundError when there are an extension and a regular function with the same name
    • KT-49477 Has ran into recursion problem with two interdependant delegates
    • KT-49442 ClassCastException on reporting [EXPOSED_FROM_PRIVATE_IN_FILE] Deprecation: private-in-file class should not expose 'private-in-class'
    • KT-49371 JVM / IR: "NoSuchMethodError" with multiple inheritance
    • KT-44843 PSI2IR: "org.jetbrains.kotlin.psi2ir.generators.ErrorExpressionException: null: KtCallExpression" with delegate who has name or parameter with the same name as a property
    • KT-49294 Turning FlowCollector into 'fun interface' leads to AbstractMethodError
    • KT-18282 Companion object referencing it's own method during construction compiles successfully but fails at runtime with VerifyError
    • KT-25289 Prohibit access to class members in the super constructor call of its companion and nested object
    • KT-32753 Prohibit @​JvmField on property in primary constructor that overrides interface property
    • KT-43433 Suspend conversion is disabled message in cases where it is not supported and quickfix to update language version is suggested
    • KT-49399 Building repeatable annotation with Container nested class fails with ISE: "Repeatable annotation class should have a container generated"
    • KT-49209 Default upper bound for type variables should be non-null
    • KT-49335 NPE in RepeatedAnnotationLowering.wrapAnnotationEntriesInContainer when using @Repeatable annotation from different file
    • KT-48876 java.lang.UnsupportedOperationException: org.jetbrains.kotlin.ir.expressions.impl.IrReturnableBlockImpl@4a729df2
    • KT-48131 IAE "Repeatable annotation container value must be a class reference" on using Kotlin-repeatable annotation from dependency

    ... (truncated)

    Commits
    • 829d1d8 Add changelog for 1.6.0
    • 99b69ae Merge KT-MR-4942: Mark packages for relocation to fix classpath interferring ...
    • 583488e [scripting] Fix NPE in aether.kt
    • 0d1f362 Fix PureAndroidAndJavaConsumeMppLibIT working with test project
    • 46af453 JVM KT-49613 don't generate indy reference to protected constructor
    • d5275aa Mark packages for relocation to fix classpath interferring in main-kts
    • a3820d4 JVM KT-49548 progression iterators can be tainted
    • 63044b1 Update -Xjvm-default description
    • e8e3c72 Update INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER message
    • ddd02fe JvmDefault. Allow non default inheritance with special flag
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump protobuf-java from 2.5.0 to 3.16.1

    Bump protobuf-java from 2.5.0 to 3.16.1

    Bumps protobuf-java from 2.5.0 to 3.16.1.

    Release notes

    Sourced from protobuf-java's releases.

    Protocol Buffers v3.16.1

    Java

    • Improve performance characteristics of UnknownFieldSet parsing (#9371)

    Protocol Buffers v3.16.0

    C++

    • Fix compiler warnings issue found in conformance_test_runner #8189 (#8190)
    • Fix MinGW-w64 build issues. (#8286)
    • [Protoc] C++ Resolved an issue where NO_DESTROY and CONSTINIT are in incorrect order (#8296)
    • Fix PROTOBUF_CONSTINIT macro redefinition (#8323)
    • Delete StringPiecePod (#8353)
    • Fix gcc error: comparison of unsigned expression in '>= 0' is always … (#8309)
    • Fix cmake install on iOS (#8301)
    • Create a CMake option to control whether or not RTTI is enabled (#8347)
    • Fix endian.h location on FreeBSD (#8351)
    • Refactor util::Status (#8354)
    • Make util::Status more similar to absl::Status (#8405)
    • Fix -Wsuggest-destructor-override for generated C++ proto classes. (#8408)
    • Refactor StatusOr and StringPiece (#8406)
    • Refactor uint128 (#8416)
    • The ::pb namespace is no longer exposed due to conflicts.
    • Allow MessageDifferencer::TreatAsSet() (and friends) to override previous calls instead of crashing.
    • Reduce the size of generated proto headers for protos with string or bytes fields.
    • Move arena() operation on uncommon path to out-of-line routine
    • For iterator-pair function parameter types, take both iterators by value.
    • Code-space savings and perhaps some modest performance improvements in RepeatedPtrField.
    • Eliminate nullptr check from every tag parse.
    • Remove unused _$name$cached_byte_size fields.
    • Serialize extension ranges together when not broken by a proto field in the middle.
    • Do out-of-line allocation and deallocation of string object in ArenaString.
    • Streamline ParseContext::ParseMessage to avoid code bloat and improve performance.
    • New member functions RepeatedField::Assign, RepeatedPtrField::{Add, Assign}.
    • Fix undefined behavior warning due to innocuous uninitialization of value on an error path.
    • Avoid expensive inlined code space for encoding message length for messages

      = 128 bytes and instead do a procedure call to a shared out-of-line routine.

    • util::DefaultFieldComparator will be final in a future version of protobuf. Subclasses should inherit from SimpleFieldComparator instead.

    C#

    • Add .NET 5 target and improve WriteString performance with SIMD (#8147)

    Java

    • deps: update JUnit and Truth (#8319)
    • Detect invalid overflow of byteLimit and return InvalidProtocolBufferException as documented.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump junit from 4.12 to 4.13.1

    Bump junit from 4.12 to 4.13.1

    Bumps junit from 4.12 to 4.13.1.

    Release notes

    Sourced from junit's releases.

    JUnit 4.13.1

    Please refer to the release notes for details.

    JUnit 4.13

    Please refer to the release notes for details.

    JUnit 4.13 RC 2

    Please refer to the release notes for details.

    JUnit 4.13 RC 1

    Please refer to the release notes for details.

    JUnit 4.13 Beta 3

    Please refer to the release notes for details.

    JUnit 4.13 Beta 2

    Please refer to the release notes for details.

    JUnit 4.13 Beta 1

    Please refer to the release notes for details.

    Commits
    • 1b683f4 [maven-release-plugin] prepare release r4.13.1
    • ce6ce3a Draft 4.13.1 release notes
    • c29dd82 Change version to 4.13.1-SNAPSHOT
    • 1d17486 Add a link to assertThrows in exception testing
    • 543905d Use separate line for annotation in Javadoc
    • 510e906 Add sub headlines to class Javadoc
    • 610155b Merge pull request from GHSA-269g-pwp5-87pp
    • b6cfd1e Explicitly wrap float parameter for consistency (#1671)
    • a5d205c Fix GitHub link in FAQ (#1672)
    • 3a5c6b4 Deprecated since jdk9 replacing constructor instance of Double and Float (#1660)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Performance improvement of KCallableImpl.callBy

    Performance improvement of KCallableImpl.callBy

    // TODO here we can avoid extra arguments copy by allocating an array of precise size if // varargs are not present and win some performance

    This PR is intended to resolve the TODO comments here. (I am a little unsure if this improvement is really what the comment intended, since I did not understand the meaning of "if vararg are not present"...)

    This PR is based on the following https://github.com/JetBrains/kotlin/pull/4840

    Because some processes were difficult to port directly, we omitted the caching of the default argument setting process.


    The local benchmark results are as follows

    Before:

    Benchmark                                 Mode  Cnt  Score   Error   Units
    CallByBenchmark.callByLite               thrpt    5  6.996 ± 0.115  ops/us
    CallByBenchmark.callByLiteWithLookup     thrpt    5  5.019 ± 0.055  ops/us
    CallByBenchmark.callByReflect            thrpt    5  5.868 ± 0.127  ops/us
    CallByBenchmark.callByReflectWithLookup  thrpt    5  4.327 ± 0.031  ops/us
    

    After:

    Benchmark                                 Mode  Cnt  Score   Error   Units
    CallByBenchmark.callByLite               thrpt    5  7.843 ± 0.218  ops/us
    CallByBenchmark.callByLiteWithLookup     thrpt    5  5.606 ± 0.041  ops/us
    CallByBenchmark.callByReflect            thrpt    5  5.386 ± 0.107  ops/us
    CallByBenchmark.callByReflectWithLookup  thrpt    5  4.520 ± 0.121  ops/us
    

    It was faster, or at least not slower.

    opened by k163377 1
Releases(1.1.0)
  • 1.1.0(Sep 5, 2022)

    • Support for basic introspection of K* reflection entities available in kotlin.reflect
    • Partial support of reflect.full API: callSuspend, KCallable<*>.isAccessible, KClass<T>.primaryConstructor
    • Bi-directional mappings between Java and Kotlin reflection
    • KCallable support
    • Update kotlinx.metadata to 0.5.0
    • Update Kotlin to 1.7.10
    Source code(tar.gz)
    Source code(zip)
Owner
Kotlin
Kotlin Tools and Libraries
Kotlin
Some basic samples of Kotlin for Android

android-kotlin-samples Some basic samples of Kotlin for Android Samples HttpUrlConnection and AsyncTask ListView with BaseAdapter and Data Object OkHt

Irontec 300 Dec 28, 2022
Basic app to use different type of observables StateFlow, Flow, SharedFlow, LiveData, State, Channel...

stateflow-flow-sharedflow-livedata Basic app to use different type of observables StateFlow, Flow, SharedFlow, LiveData, State, Channel... StateFlow,

Raheem 5 Dec 21, 2022
A mobile application developed for *Android* devices, aimed at 11th grade students in which they can take some basic training tests for presentation of external tests.

ApliKTest11 Application with Kit of questions and Knowledge Test for the preparation of the Saber Test. Description A mobile application developed for

Mike Molina 0 Dec 13, 2021
Basic Android app to use Jetpack WorkManager API features

jetpack-work-manager-playground Basic Android app to use Jetpack WorkManager API features Jetpack WorkManager Playground Demo app Jetpack WorkManager

Raheem 0 Dec 9, 2021
A basic application demonstrating IPFS for collaborative data analysis, from the perspective of a Data Analysis Provider.

Spacebox A basic application demonstrating IPFS for collaborative data analysis, from the perspective of a Data Analysis Provider. Description This pr

null 0 Jan 15, 2022
A lightweight cache library written in Kotlin

[NEW] Released to Maven Central: 'com.github.yundom:kache:1.x.x' Kache A runtime in-memory cache. Installation Put this in your build.gradle implemen

Dennis 22 Nov 19, 2022
Easy lightweight SharedPreferences library for Android in Kotlin using delegated properties

Easy lightweight SharedPreferences library for Android in Kotlin using delegated properties Idea Delegated properties in Kotlin allow you to execute a

null 25 Dec 27, 2022
Koi, a lightweight kotlin library for Android Development.

Koi - A lightweight Kotlin library for Android Koi include many useful extensions and functions, they can help reducing the boilerplate code in Androi

Hello World 514 Nov 29, 2022
🚟 Lightweight, and simple scheduling library made for Kotlin (JVM)

Haru ?? Lightweight, and simple scheduling library made for Kotlin (JVM) Why did you build this? I built this library as a personal usage library to h

Noel 13 Dec 16, 2022
Lightweight Kotlin DSL dependency injection library

Warehouse DSL Warehouse is a lightweight Kotlin DSL dependency injection library this library has an extremely faster learning curve and more human fr

Osama Raddad 18 Jul 17, 2022
A lightweight and simple Kotlin library for deep link handling on Android 🔗.

A lightweight and simple Kotlin library for deep link handling on Android ??.

Jeziel Lago 101 Aug 14, 2022
A fast, lightweight, entity component system library written in Kotlin.

Fleks A fast, lightweight, entity component system library written in Kotlin. Motivation When developing my hobby games using LibGDX, I always used As

Simon 66 Dec 28, 2022
Kotools Types - a lightweight library that provides commonly used types for Kotlin

Kotools Types is a lightweight library that provides commonly used types for Kotlin

Kotools 1 Dec 23, 2022
Lightweight compiler plugin intended for Kotlin/JVM library development and symbol visibility control.

Restrikt A Kotlin/JVM compiler plugin to restrict symbols access, from external project sources. This plugin offers two ways to hide symbols: An autom

Lorris Creantor 18 Nov 24, 2022
A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space.

Pdf Viewer For Android A Simple PDF Viewer library which only occupies around 125kb while most of the Pdf viewer occupies upto 16MB space. How to inte

Rajat 362 Dec 29, 2022
Lightweight data loading and caching library for android

ColdStorage A lightweight data loading and caching library for android Quicklinks Feature requests: Got a new requirement? Request it here and it will

Cryptic Minds 41 Oct 17, 2022
A lightweight, simple, smart and powerful Android routing library.

RxRouter Read this in other languages: 中文, English A lightweight, simple, smart and powerful Android routing library. Getting started Setting up the d

Season 323 Nov 10, 2022
Clickstream - A Modern, Fast, and Lightweight Android Library Ingestion Platform.

Clickstream is an event agnostic, real-time data ingestion platform. Clickstream allows apps to maintain a long-running connection to send data in real-time.

Gojek 60 Dec 24, 2022
StaticLog - super lightweight static logging for Kotlin, Java and Android

StaticLog StaticLog is a super lightweight logging library implemented in pure Kotlin (https://kotlinlang.org). It is designed to be used in Kotlin, J

Julian Pfeifer 28 Oct 3, 2022