Skip to content

Commit 955816e

Browse files
Update many dependencies and plugins. (#2364)
* Bump Kotlin version, fix some warnings. * Update some dependencies to fix some bugs. * Update SpotBugs; update suppressions accordingly (and fix some bugs it found). * Bump maven-source-plugin version. * Bump maven-compiler-plugin version. * Bump maven-assembly-plugin version. * Bump maven-enforcer-plugin version. * Bump jacoco version. * Bump spotbugs-maven-plugin version. * Bump maven-surefire-plugin version. * Bump exec-maven-plugin version. * Bump build-helper-maven-plugin version. * Bump Kotlin version again. * Bump maven-jar-plugin version. * Set a phase for attach-sources action. Otherwise it complains if you pass maven multiple targets. * Use variables for plugin versions used in more than one pom file.
1 parent 52bd14b commit 955816e

File tree

29 files changed

+80
-115
lines changed

29 files changed

+80
-115
lines changed

jitsi-media-transform/pom.xml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependencies>
1717
<dependency>
1818
<groupId>org.jetbrains.kotlin</groupId>
19-
<artifactId>kotlin-stdlib-jdk8</artifactId>
19+
<artifactId>kotlin-stdlib</artifactId>
2020
<version>${kotlin.version}</version>
2121
</dependency>
2222
<dependency>
@@ -92,6 +92,12 @@
9292
<version>3.0.10</version>
9393
<scope>test</scope>
9494
</dependency>
95+
<dependency>
96+
<groupId>org.junit.platform</groupId>
97+
<artifactId>junit-platform-launcher</artifactId>
98+
<version>${junit.platform.version}</version>
99+
<scope>test</scope>
100+
</dependency>
95101
<dependency>
96102
<groupId>io.kotest</groupId>
97103
<artifactId>kotest-runner-junit5-jvm</artifactId>
@@ -169,7 +175,7 @@
169175
<!-- To try and get both java and kotlin sources in the sources jar -->
170176
<groupId>org.codehaus.mojo</groupId>
171177
<artifactId>build-helper-maven-plugin</artifactId>
172-
<version>3.6.0</version>
178+
<version>${build-helper-maven-plugin.version}</version>
173179
<executions>
174180
<execution>
175181
<phase>generate-sources</phase>
@@ -188,10 +194,11 @@
188194
<plugin>
189195
<groupId>org.apache.maven.plugins</groupId>
190196
<artifactId>maven-source-plugin</artifactId>
191-
<version>3.1.0</version>
197+
<version>${maven-source-plugin.version}</version>
192198
<executions>
193199
<execution>
194200
<id>attach-sources</id>
201+
<phase>verify</phase>
195202
<goals>
196203
<goal>jar</goal>
197204
</goals>
@@ -203,7 +210,7 @@
203210
<plugin>
204211
<groupId>org.apache.maven.plugins</groupId>
205212
<artifactId>maven-compiler-plugin</artifactId>
206-
<version>3.5.1</version>
213+
<version>${maven-compiler-plugin.version}</version>
207214
<executions>
208215
<!-- Replacing default-compile as it is treated specially by maven -->
209216
<execution>
@@ -233,7 +240,7 @@
233240
</plugin>
234241
<plugin>
235242
<artifactId>maven-surefire-plugin</artifactId>
236-
<version>3.5.2</version>
243+
<version>${maven-surefire-plugin.version}</version>
237244
<configuration>
238245
<systemPropertyVariables>
239246
<kotest.framework.classpath.scanning.autoscan.disable>true</kotest.framework.classpath.scanning.autoscan.disable>
@@ -283,7 +290,7 @@
283290
<plugin>
284291
<groupId>com.github.spotbugs</groupId>
285292
<artifactId>spotbugs-maven-plugin</artifactId>
286-
<version>4.8.5.0</version>
293+
<version>${spotbugs-maven-plugin.version}</version>
287294
<configuration>
288295
<excludeFilterFile>${project.basedir}/spotbugs-exclude.xml</excludeFilterFile>
289296
<includeTests>true</includeTests>
@@ -335,9 +342,6 @@
335342
<profiles>
336343
<profile>
337344
<id>coverage</id>
338-
<properties>
339-
<jacoco.version>0.8.8</jacoco.version>
340-
</properties>
341345
<build>
342346
<plugins>
343347
<plugin>

jitsi-media-transform/spotbugs-exclude.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
<!-- We expose arrays in multiple places on purpose. -->
1212
<Bug pattern="EI_EXPOSE_REP"/>
1313
<Bug pattern="EI_EXPOSE_REP2"/>
14-
14+
<!-- We throw from constructors on illegal arguments, i.e. programming errors. -->
15+
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
16+
<!-- We don't expect to run on 32-bit platforms. -->
17+
<Bug pattern="AT_NONATOMIC_64BIT_PRIMITIVE"/>
1518
</Or>
1619
</Match>
1720

@@ -30,6 +33,7 @@
3033
<Bug pattern="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE"/>
3134
<!-- False positives with kotlin's "when" -->
3235
<Bug pattern="SF_SWITCH_NO_DEFAULT"/>
36+
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
3337
<!-- False positives with lazy vals -->
3438
<Bug pattern="NP_NULL_ON_SOME_PATH"/>
3539
<!-- False positives with lazy vals -->
@@ -44,11 +48,12 @@
4448
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
4549
<Bug pattern="UR_UNINIT_READ"/>
4650
<Bug pattern="UC_USELESS_OBJECT"/>
51+
<Bug pattern="AT_STALE_THREAD_WRITE_OF_PRIMITIVE"/>
52+
<Bug pattern="MS_EXPOSE_REP"/>
4753
</Or>
4854
<Source name="~.*\.kt" />
4955
</Match>
5056

51-
5257
<!-- Tests -->
5358
<Match>
5459
<Or>

jitsi-media-transform/src/main/java/org/jitsi_modified/impl/neomedia/rtp/remotebitrateestimator/RateControlInput.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
*/
1616
package org.jitsi_modified.impl.neomedia.rtp.remotebitrateestimator;
1717

18+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
19+
1820
/**
1921
* webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h
2022
*
2123
* @author Lyubomir Marinov
2224
*/
25+
@SuppressFBWarnings("PA_PUBLIC_PRIMITIVE_ATTRIBUTE")
2326
class RateControlInput
2427
{
2528
public BandwidthUsage bwState;

jitsi-media-transform/src/main/kotlin/org/jitsi/nlj/MediaSourceDesc.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.jitsi.nlj
1717

18-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
1918
import org.jitsi.nlj.rtp.VideoRtpPacket
2019
import org.jitsi.nlj.util.Bandwidth
2120
import org.jitsi.nlj.util.bps
@@ -35,10 +34,6 @@ import java.util.TreeMap
3534
*
3635
* @author George Politis
3736
*/
38-
@SuppressFBWarnings(
39-
value = ["NP_ALWAYS_NULL"],
40-
justification = "False positives with 'lateinit'."
41-
)
4237
class MediaSourceDesc
4338
@JvmOverloads constructor(
4439
/**

jitsi-media-transform/src/main/kotlin/org/jitsi/nlj/RtpLayerDesc.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ abstract class RtpLayerDesc(
192192
/**
193193
* Get a string description of a layer index.
194194
*/
195-
@JvmStatic
196195
fun indexString(index: Int): String = if (index == SUSPENDED_INDEX) {
197196
"SUSP"
198197
} else {

jitsi-media-transform/src/main/kotlin/org/jitsi/nlj/dtls/DtlsConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import org.jitsi.metaconfig.ConfigException
2222
import org.jitsi.metaconfig.config
2323
import java.time.Duration
2424

25-
class DtlsConfig {
25+
class DtlsConfig private constructor() {
2626
val handshakeTimeout: Duration by config {
2727
"jmt.dtls.handshake-timeout".from(JitsiConfig.newConfig)
2828
}

jitsi-media-transform/src/main/kotlin/org/jitsi/nlj/dtls/DtlsUtils.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@ class DtlsUtils {
5959
Security.addProvider(BouncyCastleProvider())
6060
}
6161

62-
val config = DtlsConfig()
63-
6462
fun generateCertificateInfo(): CertificateInfo {
6563
val cn = generateCN("TODO-APP-NAME", "TODO-APP-VERSION")
6664
val keyPair = generateEcKeyPair()
6765
val x509certificate = generateCertificate(cn, keyPair)
68-
val localFingerprintHashFunction = config.localFingerprintHashFunction
66+
val localFingerprintHashFunction = DtlsConfig.config.localFingerprintHashFunction
6967
val localFingerprint = x509certificate.getFingerprint(localFingerprintHashFunction)
7068

7169
val certificate = org.bouncycastle.tls.Certificate(
@@ -188,7 +186,7 @@ class DtlsUtils {
188186
* preferred hash function (out of those offered by the peer) and verify
189187
* that each certificate used matches one fingerprint out of that set.
190188
*/
191-
config.acceptedFingerprintHashFunctions.forEach { hashFunction ->
189+
DtlsConfig.config.acceptedFingerprintHashFunctions.forEach { hashFunction ->
192190
val fingerprints = remoteFingerprints[hashFunction] ?: return@forEach
193191

194192
val certificateFingerprint = certificate.getFingerprint(hashFunction)
@@ -204,7 +202,7 @@ class DtlsUtils {
204202
/* If we got here none of our accepted fingerprint functions were listed. */
205203
throw DtlsException(
206204
"No fingerprint declared over the signaling path with any of the accepted hash functions: " +
207-
config.acceptedFingerprintHashFunctions.joinToString()
205+
DtlsConfig.config.acceptedFingerprintHashFunctions.joinToString()
208206
)
209207
}
210208

jitsi-media-transform/src/main/kotlin/org/jitsi/nlj/dtls/TlsClientImpl.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.jitsi.nlj.dtls
1717

18-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
1918
import org.bouncycastle.crypto.util.PrivateKeyFactory
2019
import org.bouncycastle.tls.Certificate
2120
import org.bouncycastle.tls.CertificateRequest
@@ -49,10 +48,6 @@ import java.util.Hashtable
4948
/**
5049
* Implementation of [DefaultTlsClient].
5150
*/
52-
@SuppressFBWarnings(
53-
value = ["NP_ALWAYS_NULL"],
54-
justification = "False positives with 'lateinit'."
55-
)
5651
class TlsClientImpl(
5752
private val certificateInfo: CertificateInfo,
5853
/**
@@ -72,6 +67,7 @@ class TlsClientImpl(
7267
* Only set after a handshake has completed
7368
*/
7469
lateinit var srtpKeyingMaterial: ByteArray
70+
private set
7571

7672
var chosenSrtpProtectionProfile: Int = 0
7773

@@ -133,7 +129,7 @@ class TlsClientImpl(
133129

134130
override fun getCipherSuites() = DtlsConfig.config.cipherSuites.toIntArray()
135131

136-
override fun getHandshakeTimeoutMillis(): Int = DtlsUtils.config.handshakeTimeout.toMillis().toInt()
132+
override fun getHandshakeTimeoutMillis(): Int = DtlsConfig.config.handshakeTimeout.toMillis().toInt()
137133

138134
override fun notifyHandshakeComplete() {
139135
super.notifyHandshakeComplete()

jitsi-media-transform/src/main/kotlin/org/jitsi/nlj/dtls/TlsServerImpl.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.jitsi.nlj.dtls
1818

19-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
2019
import org.bouncycastle.crypto.util.PrivateKeyFactory
2120
import org.bouncycastle.tls.Certificate
2221
import org.bouncycastle.tls.CertificateRequest
@@ -47,10 +46,6 @@ import java.nio.ByteBuffer
4746
import java.util.Hashtable
4847
import java.util.Vector
4948

50-
@SuppressFBWarnings(
51-
value = ["NP_ALWAYS_NULL"],
52-
justification = "False positives with 'lateinit'."
53-
)
5449
class TlsServerImpl(
5550
private val certificateInfo: CertificateInfo,
5651
/**
@@ -68,6 +63,7 @@ class TlsServerImpl(
6863
* Only set after a handshake has completed
6964
*/
7065
lateinit var srtpKeyingMaterial: ByteArray
66+
private set
7167

7268
var chosenSrtpProtectionProfile: Int = 0
7369

@@ -124,7 +120,7 @@ class TlsServerImpl(
124120
return CertificateRequest(shortArrayOf(ClientCertificateType.ecdsa_sign), signatureAlgorithms, null)
125121
}
126122

127-
override fun getHandshakeTimeoutMillis(): Int = DtlsUtils.config.handshakeTimeout.toMillis().toInt()
123+
override fun getHandshakeTimeoutMillis(): Int = DtlsConfig.config.handshakeTimeout.toMillis().toInt()
128124

129125
override fun notifyHandshakeComplete() {
130126
super.notifyHandshakeComplete()

jitsi-media-transform/src/main/kotlin/org/jitsi/nlj/rtcp/NackHandler.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.jitsi.nlj.rtcp
1717

18-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
1918
import org.jitsi.nlj.PacketHandler
2019
import org.jitsi.nlj.PacketInfo
2120
import org.jitsi.nlj.PacketOrigin
@@ -36,10 +35,6 @@ import java.time.Instant
3635
* When a nack packet is received, the [NackHandler] will try to retrieve the
3736
* nacked packets from the cache and then send them to the RTX output pipeline.
3837
*/
39-
@SuppressFBWarnings(
40-
value = ["RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"],
41-
justification = "False positives."
42-
)
4338
class NackHandler(
4439
private val packetCache: PacketCache,
4540
private val onNackedPacketsReady: PacketHandler,

0 commit comments

Comments
 (0)