Skip to content

Commit

Permalink
[4.x] Avoid exposing internal functions and properties (#8137)
Browse files Browse the repository at this point in the history
* Avoid exposing internal functions and properties

This is a backport for 4.x branch from f408411.

* More internal modifiers
  • Loading branch information
Goooler committed Dec 24, 2023
1 parent cdf8a6e commit 710bdc1
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 70 deletions.
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package okhttp3.mockwebserver

import java.util.concurrent.TimeUnit
Expand Down
Expand Up @@ -15,6 +15,7 @@
* limitations under the License.
*/

@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package okhttp3.mockwebserver

import java.io.Closeable
Expand Down
8 changes: 4 additions & 4 deletions okcurl/src/main/kotlin/okhttp3/curl/Main.kt
Expand Up @@ -36,7 +36,6 @@ import okhttp3.Protocol
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.curl.Main.Companion.NAME
import okhttp3.internal.format
import okhttp3.internal.http.StatusLine
import okhttp3.internal.http2.Http2
import okhttp3.internal.platform.Platform
Expand All @@ -48,6 +47,7 @@ import picocli.CommandLine.Command
import picocli.CommandLine.IVersionProvider
import picocli.CommandLine.Option
import picocli.CommandLine.Parameters
import java.util.Locale

@Command(name = NAME, description = ["A curl for the next-generation web."],
mixinStandardHelpOptions = true, versionProvider = Main.VersionProvider::class)
Expand Down Expand Up @@ -273,7 +273,7 @@ class Main : Runnable {
level = Level.FINE
formatter = object : SimpleFormatter() {
override fun format(record: LogRecord): String {
return format("%s%n", record.message)
return "%s%n".format(Locale.US, record.message)
}
}
})
Expand All @@ -289,9 +289,9 @@ class Main : Runnable {
override fun format(record: LogRecord): String {
val parameters = record.parameters
if (parameters != null) {
return format("%s%n%s%n", record.message, record.parameters.first())
return "%s%n%s%n".format(Locale.US, record.message, record.parameters.first())
} else {
return format("%s%n", record.message)
return "%s%n".format(Locale.US, record.message)
}
}
}
Expand Down
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package okhttp3.internal.sse

import java.io.IOException
Expand Down
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package okhttp3.internal.sse

import java.io.IOException
Expand Down
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package okhttp3.tls

import java.security.SecureRandom
Expand Down
1 change: 1 addition & 0 deletions okhttp-tls/src/main/kotlin/okhttp3/tls/HeldCertificate.kt
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package okhttp3.tls

import java.math.BigInteger
Expand Down
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package okhttp3.tls.internal

import java.net.Socket
Expand Down
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package okhttp3

import java.io.IOException
Expand Down

0 comments on commit 710bdc1

Please sign in to comment.