SkygearIO / skygear-SDK-Android

Skygear Android SDK
Other
12 stars 36 forks source link

Lint Issues #114

Open seventhmoon opened 7 years ago

seventhmoon commented 7 years ago

Below listed the lint issues. Will there be a fix?

<?xml version="1.0" encoding="UTF-8"?>
<issues format="4" by="lint 2.3.0">

    <issue
        id="DefaultLocale"
        severity="Warning"
        message="Implicitly using the default locale is a common source of bugs: Use `toLowerCase(Locale)` instead. For strings meant to be internal use `Locale.ROOT`, otherwise `Locale.getDefault()`."
        category="Correctness"
        priority="6"
        summary="Implied default locale in case conversion"
        explanation="Calling `String#toLowerCase()` or `#toUpperCase()` *without specifying an explicit locale* is a common source of bugs. The reason for that is that those methods will use the current locale on the user&apos;s device, and even though the code appears to work correctly when you are developing the app, it will fail in some locales. For example, in the Turkish locale, the uppercase replacement for `i` is *not* `I`.&#xA;&#xA;If you want the methods to just perform ASCII replacement, for example to convert an enum name, call `String#toUpperCase(Locale.US)` instead. If you really want to use the current locale, call `String#toUpperCase(Locale.getDefault())` instead."
        url="http://developer.android.com/reference/java/util/Locale.html#default_locale"
        urls="http://developer.android.com/reference/java/util/Locale.html#default_locale"
        errorLine1="            String levelStringLowerCase = levelString.toLowerCase();"
        errorLine2="                                                      ~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/main/java/io/skygear/skygear/AccessControlSerializer.java"
            line="201"
            column="55"/>
    </issue>

    <issue
        id="TrulyRandom"
        severity="Warning"
        message="Potentially insecure random numbers on Android 4.3 and older. Read https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html for more info."
        category="Security"
        priority="9"
        summary="Weak RNG"
        explanation="Key generation, signing, encryption, and random number generation may not receive cryptographically strong values due to improper initialization of the underlying PRNG on Android 4.3 and below.&#xA;&#xA;If your application relies on cryptographically secure random number generation you should apply the workaround described in https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html .&#xA;&#xA;This lint rule is mostly informational; it does not accurately detect whether cryptographically secure RNG is required, or whether the workaround has already been applied. After reading the blog entry and updating your code if necessary, you can disable this lint issue."
        url="https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html"
        urls="https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html"
        errorLine1="                ctx.init(keyManagers, null, new SecureRandom());"
        errorLine2="                                                ~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/main/java/io/skygear/skygear/WebSocketClientImpl.java"
            line="63"
            column="49"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields (static reference to `Container` which has field `context` pointing to `Context`); this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    private static Container sharedInstance;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/main/java/io/skygear/skygear/Container.java"
            line="13"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Context instrumentationContext;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/ContainerUnitTest.java"
            line="18"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Context instrumentationContext;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/DatabaseUnitTest.java"
            line="18"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields (static reference to `Container` which has field `context` pointing to `Context`); this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Container instrumentationContainer;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/DatabaseUnitTest.java"
            line="19"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Context instrumentationContext;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/PersistentStoreUnitTest.java"
            line="25"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Context instrumentationContext;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/PubsubUnitTest.java"
            line="60"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields (static reference to `Container` which has field `context` pointing to `Context`); this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Container instrumentationContainer;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/PubsubUnitTest.java"
            line="61"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Context instrumentationContext;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/RecordDeleteRequestUnitTest.java"
            line="20"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields (static reference to `Container` which has field `context` pointing to `Context`); this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Container instrumentationContainer;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/RecordDeleteRequestUnitTest.java"
            line="21"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Context instrumentationContext;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/RecordQueryRequestUnitTest.java"
            line="20"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields (static reference to `Container` which has field `context` pointing to `Context`); this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Container instrumentationContainer;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/RecordQueryRequestUnitTest.java"
            line="21"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Context instrumentationContext;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/RecordSaveRequestUnitTest.java"
            line="21"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields (static reference to `Container` which has field `context` pointing to `Context`); this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Container instrumentationContainer;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/RecordSaveRequestUnitTest.java"
            line="22"
            column="5"/>
    </issue>

    <issue
        id="StaticFieldLeak"
        severity="Warning"
        message="Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)"
        category="Performance"
        priority="6"
        summary="Static Field Leaks"
        explanation="A static field will leak contexts."
        errorLine1="    static Context instrumentationContext;"
        errorLine2="    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="/home/travis/build/astri-isns/skygear-SDK-Android/skygear/src/androidTest/java/io/skygear/skygear/RequestManagerUnitTest.java"
            line="39"
            column="5"/>
    </issue>

</issues>
seventhmoon commented 7 years ago

I think #111 is related to this.