1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-29 15:32:06 +01:00
Commit graph

5211 commits

Author SHA1 Message Date
Florian Schmaus
d67262a5e0 [sinttest] Fix indentation 2024-10-17 22:04:45 +02:00
Florian Schmaus
1eb5649123 [sinttest] Provide brief summary of failed tests 2024-10-17 22:04:14 +02:00
Florian Schmaus
0191ed7174 [tcp] Report SM resumption impossible if not instant shutdown
If the connection got not instantanously shut down, then we also
dropped all SM state and should not report that SM resumption is
possible.

This most likely fixes SMACK-954.x
2024-10-17 18:10:54 +02:00
Florian Schmaus
6e6a3ef88d [tcp] Set shutdownTimestamp before queue.shutdown()
In the writer thread, we use shutdownTimestamp to determine if we
should break out of the writer loop. If we set
shutdownTimestamp *after* queue.shutdown(), then there is a brief
period where nextStreamElement() returns 'null' but done() still
returns 'true'. Hence, we switch the logic "setting" those values.
2024-10-17 18:08:31 +02:00
Florian Schmaus
9e5ac5a39a [core] Wrap current connection exception when re-throwing
Instead of directly throwing the current connection exception, wrap
it, so we do not lose the stack trace of the thread invoking
waitForConditionorThrowConnectionException().
2024-10-17 17:34:05 +02:00
Florian Schmaus
3c5fb5810e Smack 4.5.0-beta6-SNAPSHOT 2024-10-15 16:14:14 +02:00
Florian Schmaus
caa479fac4 Smack 4.5.0-beta5 2024-10-15 15:55:58 +02:00
Florian Schmaus
3b0c2f752f [core] Remove NumberFormatException from innermost try/catch in parseAndProcessStanza()
This was added in 02d8f53246 ("[core] Increase resilience against
faulty parser implementions"). However, NumberFormatException is a
subclass of IllegalArgumentException, which is already catched by the
outermost catch.
2024-10-15 15:46:24 +02:00
Florian Schmaus
0ee5acc494 Remove usage of deprecated URL constructor
Although those URL constructors are only deprecated with Java 20, this
already removes their usage.
2024-10-15 15:45:47 +02:00
Florian Schmaus
8b9cd98756 [build-logic] Remove some isJavaXCompatible blocks
Since Smack requires now Java 11, all conditional code for lower Java
versions can be dropped from the build logic.
2024-10-15 13:27:56 +02:00
Florian Schmaus
d3de2d65b9 [xdata] Avoid NPE if form field's name is not set
Do not throw an NPE if an form field without a name, i.e., the 'var'
attribute, is received.

Thanks to Peter Kaul for reporting this.
2024-10-15 12:50:59 +02:00
Florian Schmaus
02d8f53246 [core] Increase resilience against faulty parser implementions
If one of the parser throws a NullPointerException or
NumberFormatException, then this should not lead to a disconnect due
to an unhandled exception. Instead wrap those in an exception that is
handled by the parsing exception callback and ask the user to fill a
bug report for those faulty parsers.

We may adjust the list of exceptions that are wrapped in the future.
2024-10-15 12:50:33 +02:00
Florian Schmaus
5dd08fc215 [android-extensions] Set RECEIVER_NOT_EXPORTED in ServerPingWithAlarmManager
Set RECEIVER_NOT_EXPORTED when registering the receiver in
ServerPingWithAlarmManager, as otherwise this will throw an exception
if the application targets Android API level 34 or higher.

This requires raising the minimum Android API level to 26 for
registerReceiver() with flags.
2024-10-15 12:45:18 +02:00
Florian Schmaus
072761a0ad [xmlparser-xpp3] Switch to codelibs version of xpp3
This version has javax.xml.namespace.QName removed, avoiding the
duplicate declaration conflict with QName from Java 11.
2024-10-15 12:43:09 +02:00
Florian Schmaus
de564689c6 Smack 4.5.0-beta5-SNAPSHOT 2024-10-05 15:01:20 +02:00
Florian Schmaus
fc76f81e95 Smack 4.5.0-beta4 2024-10-05 14:44:30 +02:00
Florian Schmaus
e376f55ea9
Merge pull request #641 from Flowdalic/android
Android improvements
2024-10-04 19:40:00 +00:00
Florian Schmaus
e1cc1a4185 [android-extensions] Mark pending intent immutable in ServerPingWithAlarmManager 2024-10-04 21:37:50 +02:00
Florian Schmaus
34f490ff15 Bump minimum Android SDK level to 23 2024-10-04 21:37:49 +02:00
Florian Schmaus
c35443928c
Merge pull request #640 from Flowdalic/coveralls
[gradle] Configure correct jacoco report path for coveralls plugin
2024-09-26 19:00:11 +00:00
Florian Schmaus
95900ea41f [github ci] Use overallsapp/github-action@v2 to report coverage stats 2024-09-26 20:47:03 +02:00
Florian Schmaus
b0f0ee2330 Revert "[build] Downgrade bnd gradle plugin to 6.4.0"
This reverts commit d217c32e72.

Since the new error prone version requires Java 17, we can also use
the bnd gradle plugin version that requires Java 17.
2024-09-26 18:25:45 +02:00
Florian Schmaus
4c7ec625c0 Smack 4.5.0-beta4-SNAPSHOT 2024-09-26 16:30:25 +02:00
Florian Schmaus
9a04224bd6 Smack 4.5.0-beta3 2024-09-26 13:26:14 +02:00
Florian Schmaus
73c935cf95 [gradle] Commit gradle.properties with XML parser workaround 2024-09-26 13:26:14 +02:00
Florian Schmaus
ea8e15d10f
Merge pull request #639 from Flowdalic/ci-revert-java-11
Revert "[ci] Add java 11 to build matrix"
2024-09-25 19:58:21 +00:00
akrherz
8bd88180be Revert "[ci] Add java 11 to build matrix"
This reverts commit 6857ac6b87.

The setup-android@v3 task installing android-21 requires Java 17.
2024-09-25 21:57:05 +02:00
Florian Schmaus
220faa9d3d
Merge pull request #637 from Flowdalic/drop-gradle-plugin
[build] Drop unused freefair maven-plugin
2024-09-25 19:50:24 +00:00
Florian Schmaus
1fffb90783 [build] Drop unused freefair maven-plugin 2024-09-25 21:50:04 +02:00
Florian Schmaus
c5e9e4832d
Merge pull request #635 from akrherz/aqute_version
[build] Downgrade bnd gradle plugin to 6.4.0
2024-09-25 19:35:32 +00:00
akrherz
6857ac6b87
[ci] Add java 11 to build matrix 2024-09-25 14:34:45 -05:00
Florian Schmaus
c4d16a6d6c
Merge pull request #636 from Flowdalic/bump-error-prone
[build] Bump error prone from 2.9.0 to 2.32.0
2024-09-25 19:32:58 +00:00
Florian Schmaus
beacb5eb8e [build] Bump error prone from 2.9.0 to 2.32.0 2024-09-25 21:32:17 +02:00
akrherz
d217c32e72
[build] Downgrade bnd gradle plugin to 6.4.0
7.0.0 requires Java 17
2024-09-25 12:51:02 -05:00
Florian Schmaus
55400633c8
Merge pull request #634 from Flowdalic/rename-java8-to-java11
Rename smack-java8(-full) to smack-java11(-full)
2024-09-25 13:29:59 +00:00
Florian Schmaus
07d9d694da Rename smack-java8(-full) to smack-java11(-full)
To denote that Smack now requires at least Java 11 to run. Fixes
SMACK-953.
2024-09-25 15:28:55 +02:00
Florian Schmaus
5d2ca5d7d3
Merge pull request #633 from Flowdalic/ci-java-21
[github ci] Build also with Java 21
2024-09-25 13:18:39 +00:00
Florian Schmaus
2eddf1949a [github ci] Build also with Java 21 2024-09-25 15:15:04 +02:00
Florian Schmaus
348a3ab091
Merge pull request #630 from guusdk/sint_formtest-smack-4.5.0-beta2
[sint] Fix compatibility with Smack 4.5.0-beta2
2024-09-25 10:59:09 +00:00
Florian Schmaus
f59d7f3257
Merge pull request #632 from Flowdalic/smack-gradle-bump
Bump to Gradle 8.10.2, require Java 11
2024-09-25 10:58:39 +00:00
Florian Schmaus
1e5d34eacf Bump to Gradle 8.10.2, require Java 11
Bump Gradle from 6.8.3 to 8.10.2 and increase the minimum required
Java version from 8 to 11 (SMACK-953).

The switch from Java 8 to 11 caused some Bytecode portability issues
regarding NIO Buffers. Java changed with version 9 the return type of
some subclasses of Buffer to return the specific Buffer type instead
of the Buffer superclass [JDK-4774077]. For example, ByteBuffer.filp()
previously returned Buffer, while it does return ByteBuffer now.

This sensible change was not reflected by the Android API [1], which
means that AnimalSniffer rightfully started to complain that there is
no method "ByteBuffer ByteBuffer.flip()" in Android, there is only
"Buffer ByteBuffer.flip()", and those are incompatible methods on
Java's Bytecode layer.

As workaround, this changes

    return charBuffer.flip().toString();

to

    ((java.nio.Buffer) charBuffer).flip();
    return charBuffer.toString();

to restore the Bytecode portability between Android and Java.

Errorprone also got new checks, of which JavaUtilDate and JdkObsolete
are wroth mentioning.

JavaUtilData basically strongly recommends to use Java's newer time
API over java.util.Date. But since Smack was Java 8 until now,
j.u.Date is widely used.

Similar JdkObsolete mentions obsolete JDK APIs, like data structures
like Vector and Stack. But mostly LinkedList, which should usually be
replaced by ArrayList. And this is what this commit largely does.

JDK-4774077: https://bugs.openjdk.org/browse/JDK-4774077
1: https://issuetracker.google.com/issues/369219141
2024-09-25 12:08:50 +02:00
Guus der Kinderen
e4fcdb6879 [sint] Fix compatibility with Smack 4.5.0-beta2
Due to a change in Smack 4.5.0-beta2, test execution of (all) SINT tests is aborted when `FormTest` is executed.

It appears that Smack now has more strict argument validation when setting thread IDs on message stanzas. This validation should not fail for the tests that are shipped with Smack.

This is the stack trace when executing the failing test (which no longer occurs after the change in this commit is applied):

```
Exception in thread "main" java.lang.IllegalArgumentException: thread must not be null nor empty
	at org.jivesoftware.smack.util.StringUtils.requireNotNullNorEmpty(StringUtils.java:533)
	at org.jivesoftware.smack.packet.Message$Thread.<init>(Message.java:326)
	at org.jivesoftware.smack.packet.MessageBuilder.setThread(MessageBuilder.java:70)
	at org.jivesoftware.smack.packet.MessageBuilder.setThread(MessageBuilder.java:66)
	at org.jivesoftware.smackx.xdata.FormTest.testFilloutForm(FormTest.java:133)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.lambda$runTests$0(SmackIntegrationTestFramework.java:476)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.runConcreteTest(SmackIntegrationTestFramework.java:556)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework$PreparedTest.run(SmackIntegrationTestFramework.java:764)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.runTests(SmackIntegrationTestFramework.java:544)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.run(SmackIntegrationTestFramework.java:277)
	at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.main(SmackIntegrationTestFramework.java:115)
```
2024-09-19 10:51:10 +02:00
Florian Schmaus
d8d066b831 [github ci] Install Android SDK 21 2024-09-16 08:59:04 +02:00
Florian Schmaus
5a822a6631 Smack 4.5.0-beta3-SNAPSHOT 2024-09-15 20:00:57 +02:00
Florian Schmaus
fd1f692031 Smack 4.5.0-beta2 2024-09-15 19:50:40 +02:00
Florian Schmaus
ab16e1a32c Bump jxmpp version to 1.1.0-beta1 2024-09-15 19:45:15 +02:00
Florian Schmaus
8d7952cec3 Bump MiniDNS version to 1.1.0-alpha3 2024-09-15 19:44:46 +02:00
Florian Schmaus
1c1f57d9ff [core] Refine javadoc for ConnectionConfiguration.getLanguage() 2024-09-15 19:10:14 +02:00
Florian Schmaus
49379afd3f [core] Correctly handle BCP 42 language tag creation from Locale for xml:lang
Fixes SMACK-952
2024-09-15 19:09:45 +02:00
Florian Schmaus
94375e3208 Bump minimum Android SDK version to 21
Fixes SMACK-951
2024-09-15 19:09:19 +02:00