Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 283 for Initializer (0.04 sec)

  1. okhttp/src/androidMain/kotlin/okhttp3/internal/platform/PlatformInitializer.kt

     * limitations under the License.
     */
    package okhttp3.internal.platform
    
    import android.content.Context
    import androidx.startup.Initializer
    
    /**
     * Androidx Startup initializer to ensure that the AndroidPlatform has access to the application context.
     */
    class PlatformInitializer : Initializer<Platform> {
      override fun create(context: Context): Platform {
        PlatformRegistry.applicationContext = context
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Dec 31 14:50:53 UTC 2024
    - 1K bytes
    - Viewed (1)
  2. okhttp/src/androidMain/kotlin/okhttp3/OkHttp.android.kt

      /**
       * Configure the ApplicationContext. Not needed unless the AndroidX Startup [Initializer] is disabled, or running
       * a robolectric test.
       *
       * The functionality that will fail without a valid Context is primarily Cookies and URL Domain handling, but
       * may expand in the future.
       */
      fun initialize(applicationContext: Context) {
        if (PlatformRegistry.applicationContext == null) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  3. okhttp/src/androidMain/kotlin/okhttp3/internal/publicsuffix/AssetPublicSuffixList.kt

              "Platform applicationContext not initialized. " +
                "Possibly running Android unit test without Robolectric. " +
                "Android tests should run with Robolectric " +
                "and call OkHttp.initialize before test",
            )
          } else {
            throw IOException(
              "Platform applicationContext not initialized. " +
                "Startup Initializer possibly disabled, " +
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  4. android-test/src/test/kotlin/okhttp/android/test/DisabledInitialiserTest.kt

          hasMessage("Unable to load PublicSuffixDatabase.list resource.")
          cause().isNotNull().all {
            hasMessage(
              "Platform applicationContext not initialized. " +
                "Startup Initializer possibly disabled, " +
                "call OkHttp.initialize before test.",
            )
            hasClass<IOException>()
          }
        }
      }
    
      companion object {
        @AfterClass
        @JvmStatic
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 16:25:39 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  5. okhttp-idna-mapping-table/src/main/kotlin/okhttp3/internal/idn/GenerateIdnaMappingTableCode.kt

      return FileSpec
        .builder(packageName, "IdnaMappingTableInstance")
        .addProperty(
          PropertySpec
            .builder("IDNA_MAPPING_TABLE", idnaMappingTable)
            .addModifiers(KModifier.INTERNAL)
            .initializer(
              """
              |%T(⇥
              |sections = "%L",
              |ranges = "%L",
              |mappings = "%L",
              |⇤)
              """.trimMargin(),
              idnaMappingTable,
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Mar 19 19:25:20 UTC 2025
    - 2.8K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/escape/ArrayBasedUnicodeEscaper.java

      }
    
      /**
       * Creates a new ArrayBasedUnicodeEscaper instance with the given replacement map and specified
       * safe range. If {@code safeMax < safeMin} then no code points are considered safe. This
       * initializer is useful when explicit instances of ArrayBasedEscaperMap are used to allow the
       * sharing of large replacement mappings.
       *
       * <p>If a code point has no mapped replacement then it is checked against the safe range. If it
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Feb 13 15:45:16 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  7. guava/src/com/google/common/hash/LittleEndianByteArray.java

      }
    
      /**
       * The only reference to Unsafe is in this nested class. We set things up so that if
       * Unsafe.theUnsafe is inaccessible, the attempt to load the nested class fails, and the outer
       * class's static initializer can fall back on a non-Unsafe version.
       */
      @SuppressWarnings("SunApi") // b/345822163
      @VisibleForTesting
      enum UnsafeByteArray implements LittleEndianBytes {
        // Do *not* change the order of these constants!
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Feb 12 03:49:18 UTC 2025
    - 12.3K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureFallbackAtomicHelperTest.java

     *
     * <p>On different platforms AbstractFuture uses different strategies for its core synchronization
     * primitives. The strategies are all implemented as subtypes of AtomicHelper and the strategy is
     * selected in the static initializer of AbstractFuture. This is convenient and performant but
     * introduces some testing difficulties. This test exercises the fallback strategies.
     *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 8.1K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/AggregateFutureStateFallbackAtomicHelperTest.java

     *
     * <p>On different platforms AggregateFutureState uses different strategies for its core
     * synchronization primitives. The strategies are all implemented as subtypes of AtomicHelper and
     * the strategy is selected in the static initializer of AggregateFutureState. This is convenient
     * and performant but introduces some testing difficulties. This test exercises the two fallback
     * strategies.
     *
     * <ul>
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 6.5K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/reflect/Invokable.java

          } else {
            // Strictly, this doesn't necessarily indicate a hidden 'this' in the case of
            // static initializer. But there seems no way to tell in that case. :(
            // This may cause issues when an anonymous class is created inside a static initializer,
            // and the class's constructor's first parameter happens to be the enclosing class.
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Mar 17 20:26:29 UTC 2025
    - 18.4K bytes
    - Viewed (0)
Back to top