Skip to content

Commit 710bdc1

Browse files
authored
[4.x] Avoid exposing internal functions and properties (#8137)
* Avoid exposing internal functions and properties This is a backport for 4.x branch from f408411. * More internal modifiers
1 parent cdf8a6e commit 710bdc1

File tree

12 files changed

+78
-70
lines changed

12 files changed

+78
-70
lines changed

mockwebserver/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
1617
package okhttp3.mockwebserver
1718

1819
import java.util.concurrent.TimeUnit

mockwebserver/src/main/kotlin/okhttp3/mockwebserver/MockWebServer.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18+
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
1819
package okhttp3.mockwebserver
1920

2021
import java.io.Closeable

okcurl/src/main/kotlin/okhttp3/curl/Main.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import okhttp3.Protocol
3636
import okhttp3.Request
3737
import okhttp3.RequestBody.Companion.toRequestBody
3838
import okhttp3.curl.Main.Companion.NAME
39-
import okhttp3.internal.format
4039
import okhttp3.internal.http.StatusLine
4140
import okhttp3.internal.http2.Http2
4241
import okhttp3.internal.platform.Platform
@@ -48,6 +47,7 @@ import picocli.CommandLine.Command
4847
import picocli.CommandLine.IVersionProvider
4948
import picocli.CommandLine.Option
5049
import picocli.CommandLine.Parameters
50+
import java.util.Locale
5151

5252
@Command(name = NAME, description = ["A curl for the next-generation web."],
5353
mixinStandardHelpOptions = true, versionProvider = Main.VersionProvider::class)
@@ -273,7 +273,7 @@ class Main : Runnable {
273273
level = Level.FINE
274274
formatter = object : SimpleFormatter() {
275275
override fun format(record: LogRecord): String {
276-
return format("%s%n", record.message)
276+
return "%s%n".format(Locale.US, record.message)
277277
}
278278
}
279279
})
@@ -289,9 +289,9 @@ class Main : Runnable {
289289
override fun format(record: LogRecord): String {
290290
val parameters = record.parameters
291291
if (parameters != null) {
292-
return format("%s%n%s%n", record.message, record.parameters.first())
292+
return "%s%n%s%n".format(Locale.US, record.message, record.parameters.first())
293293
} else {
294-
return format("%s%n", record.message)
294+
return "%s%n".format(Locale.US, record.message)
295295
}
296296
}
297297
}

okhttp-sse/src/main/kotlin/okhttp3/internal/sse/RealEventSource.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
1617
package okhttp3.internal.sse
1718

1819
import java.io.IOException

okhttp-sse/src/main/kotlin/okhttp3/internal/sse/ServerSentEventReader.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
1617
package okhttp3.internal.sse
1718

1819
import java.io.IOException

okhttp-tls/src/main/kotlin/okhttp3/tls/HandshakeCertificates.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
1617
package okhttp3.tls
1718

1819
import java.security.SecureRandom

okhttp-tls/src/main/kotlin/okhttp3/tls/HeldCertificate.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
1617
package okhttp3.tls
1718

1819
import java.math.BigInteger

okhttp-tls/src/main/kotlin/okhttp3/tls/internal/InsecureExtendedTrustManager.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
1617
package okhttp3.tls.internal
1718

1819
import java.net.Socket

okhttp-urlconnection/src/main/kotlin/okhttp3/JavaNetCookieJar.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
1617
package okhttp3
1718

1819
import java.io.IOException

0 commit comments

Comments
 (0)