Commit Graph

846 Commits

Author SHA1 Message Date
Paul Schaub 9f86eda532
OMEMO: converse.js compatibility 2019-08-04 15:00:25 +02:00
Florian Schmaus efb206f7bd Use Locale.getDefault() to initialize the language 2019-08-03 22:20:05 +02:00
Georg Lukas 6a0e0f0f67 Implement xml:lang support in ConnectionConfiguration and AbstractXMPPConnection
This patch makes it possible to change the stream-level language as part
of the connection configuration, to allow a properly implemented
entities to provide i18n'ed response messages. The Locale type is used
for this configuration, and the effective language string can be
obtained via `ConnectionConfiguration.getXmlLang()`.

This code does not cover XMPPBOSHConnection!

Signed-off-by: Georg Lukas <georg@op-co.de>
2019-08-03 22:19:45 +02:00
Florian Schmaus 12cbeede57 Use Enum.toString() in XmlStringBuilder.element(String, Enum)
as toString() is often overriden by Enums to yield the expected XMPP
wire protocol representation.
2019-08-03 22:15:44 +02:00
Florian Schmaus eecd5b70d3 Merge branch 'master' of github.com:igniterealtime/Smack 2019-07-30 11:35:45 +02:00
Florian Schmaus 8da954f7a4 OpenPGP: Bump Pgpainless to 0.0.1-alpha7
Also unify how new Security Providers are installed.

Thanks to Paul Schaub for helping with this.
2019-07-30 09:37:19 +02:00
Florian Schmaus 96e14471d0
Merge pull request #324 from adiaholic/spellcorrection
Correcting mini typing error
2019-07-28 18:11:56 +02:00
Florian Schmaus 4ca2c7cc69 Enable MissingJavadocPackage and UnnecessaryParentheses checkstyle checks 2019-07-24 09:18:39 +02:00
Florian Schmaus 91ec6cc955 Javadoc changes for Java 11 compatibility 2019-07-19 23:05:46 +02:00
Florian Schmaus 8fa90113c9 Remove finalize() from AbstractXmppNioConnection 2019-07-19 23:05:46 +02:00
adiaholic fe85ab3b83 Correcting mini typing error 2019-07-09 22:12:26 +05:30
Florian Schmaus 658905e1ba Do not check exception message in PacketParserUtilsTest
as it may be localized.

This also makes PacketParserUtilsTest to use Junit5.

Fixes SMACK-874.
2019-07-05 17:40:45 +02:00
Florian Schmaus df5899e72b Introduce SmackConfiguration.SMACK_URL(_STRING) 2019-07-04 15:51:28 +02:00
Florian Schmaus 1b5a264d52 Add assert to IQ.initializeAsResultFor(IQ)
This method is not meant to be used to be invoked with the identity.
2019-07-04 15:48:07 +02:00
Florian Schmaus 870e6c674a Make ExceptionUtil.getStackTrace(Throwable) null safe 2019-07-04 15:47:46 +02:00
Florian Schmaus e3ec422071 Try to lookup QNAME first in XmppElementUtil.getQNameFor() 2019-06-12 22:30:56 +02:00
Florian Schmaus fa0c16d75c Introduce EqualsUtil and HashCode.(Builder|Cache) 2019-06-12 14:51:17 +02:00
Florian Schmaus 818ee8a727 Make Objects.requireNonNull() throw IllegalArgumentException
and not NullPointerException. Altough this differs from
java.util.Objects behavior, throwing an IllegalArgumentException
appears more sensible and makes it easier to catch it in Smack's
parsing function.
2019-06-11 12:47:40 +02:00
Florian Schmaus 6e1193edaf Use QName instead of XmppStringUtils.generateKey() 2019-06-11 12:47:39 +02:00
Florian Schmaus 7d59df9eed Change type of presence priority to 'Byte' 2019-06-11 12:47:39 +02:00
Florian Schmaus e911874e72 Make MultiMap use generics where sensible
I wonder why I orginally did not do it that way…
2019-06-11 12:47:39 +02:00
Florian Schmaus ce70308099 Introduce UInt(16|32) datatypes 2019-06-11 12:47:39 +02:00
Florian Schmaus b834df65e9 Add NumberUtil.requireUShort16(int) 2019-06-11 12:47:39 +02:00
Florian Schmaus b3b242f397 Add TODO comment to XmlStringBuilder 2019-06-11 12:47:39 +02:00
Florian Schmaus 4d36e3b521 Introduce FormFieldChildElement and make FormField immutable 2019-06-11 12:47:39 +02:00
Florian Schmaus 3c306eaff9 Improve comment in SmackReactor 2019-06-05 10:54:07 +02:00
Florian Schmaus 9a2cca2bd3 Merge branch 'master' of github.com:Flowdalic/Smack 2019-06-03 17:41:49 +02:00
Florian Schmaus b288768f77 Introduce util.InternetAddress
and use it where sensible. Also fixes a few unit tests along the way.
2019-06-03 17:41:10 +02:00
Florian Schmaus 4334ca33ff Add missing selector.wakeup() in SmackRactor.schedule()
Without this, newly scheduled runnables would potentially not be
scheduled in case the reactor thread was blocking in select(0)
indefinetly.

Thanks to Eng ChongMeng for reporting this.
2019-06-03 09:28:52 +02:00
Florian Schmaus 027cae3bd0 Remove unnecessary synchronization in SmackReater.schedule()
The DelayQueue 'scheduledActions' is already thread-safe.
2019-06-03 09:27:28 +02:00
Florian Schmaus 619b8e6f4a Add secure(OnlineAttackSafe|Unique|OfflineAttackSafe)RandomString()
and replace usages of java.util.UUID in Smack with
secureUniqueRandomString() because it uses a thread-local secure random
number generator.
2019-06-02 20:08:03 +02:00
Florian Schmaus 839e347676 Rename NumberUtil.checkIfInUInt32Range() to requireUInt32 2019-06-02 10:46:53 +02:00
Florian Schmaus 726a2de273 Deprecate ParserUtils.getQName() 2019-06-02 10:44:50 +02:00
Florian Schmaus 9352225f44 Rework SOCKS5 unit tests so that they can be run in parallel
As result it is now also possible to start multiple local SOCKS5
proxies with different port, which is usually not necessary in real
life but useful for unit tests.
2019-06-02 10:38:19 +02:00
adiaholic f91044657f Generic Exception replaced with Type Specific Exceptions.
'parseAndProcessStanza()' throws generic Exceptions.
Since there are plenty of exceptions that should not be
catched by smack, it's better to throw Type Specific Exceptions.
This Commit is was in response to SMACK-839.
2019-05-19 17:09:01 +05:30
Florian Schmaus 04238bd36a Add CloseableUtil.maybeClose(Closeable) 2019-05-18 13:25:31 +02:00
Florian Schmaus f7762c5db7 Add "whitespace after comma" checkstyle rule 2019-05-17 21:56:46 +02:00
Florian Schmaus 7e25c3ada5 Merge branch '4.3' 2019-05-16 20:52:27 +02:00
Florian Schmaus 381190a45c Add ConnectionConfiguration.getXmppServiceDomainAsDnsNameIfPossible()
in preperation of SMACK-870, so that the DNS name can be used for the
certificate verification.
2019-05-16 14:02:28 +02:00
Florian Schmaus 04f1d79d72 Try GC in MemoryLeakTestUtil.assertReferencesQueueSize()
It appears that we observe a partion GC run on some systems,
especially ones with few resources. Hopefully this increases the
chances to observe the expected GC affects so that the unit test
passes also on those systems.
2019-05-09 12:33:43 +02:00
Florian Schmaus 2dedd75cd7 Add comment about Thread.yield() in MemoryLeakTestUtil 2019-05-09 12:06:01 +02:00
Florian Schmaus edcde28ecd Set UncaughtExceptionHandler for CACHED_EXECUTOR_SERVICE
In order to avoid uncaught exceptions from terminating the
program (SMACK-896).
2019-05-09 11:04:26 +02:00
Florian Schmaus 49f4de0cdb Replace 'key' with QName 2019-05-08 21:10:39 +02:00
Florian Schmaus f6be434f66 Remove deprecated methods in StanzaCollector 2019-05-08 20:42:08 +02:00
Florian Schmaus 32429bcb9c Add message to InterruptedException if blocking queue was shut down 2019-05-08 15:19:10 +02:00
Florian Schmaus d20a2675a8 Make StanzaCollector final 2019-05-08 12:44:48 +02:00
Florian Schmaus f8de22478b Double the timeout to 120s in MemoryLeakTestUtil
Because an failing test on Travis was observered using a timeout of
60s:

org.jivesoftware.smackx.muc.MucMemoryLeakTest > mucMemoryLeakTest FAILED
    java.lang.AssertionError: No reference found after 60000ms
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertNotNull(Assert.java:712)
        at org.jivesoftware.smack.util.MemoryLeakTestUtil.assertReferencesQueueSize(MemoryLeakTestUtil.java:110)
        at org.jivesoftware.smack.util.MemoryLeakTestUtil.noResourceLeakTest(MemoryLeakTestUtil.java:103)
        at org.jivesoftware.smackx.muc.MucMemoryLeakTest.mucMemoryLeakTest(MucMemoryLeakTest.java:29)
2019-05-08 12:44:48 +02:00
Florian Schmaus d2f5efcb20 Use StandardCharsets.(UTF_8|US_ASCII)
This also gets rid of a ton of UnsupportedEncodingException s.
2019-05-08 12:44:48 +02:00
Florian Schmaus 7f0dc72dab Update errorprone(-plugin) and make Unused(Variable|Method) an error 2019-05-07 23:09:00 +02:00
Florian Schmaus 68d7d738b6 Remove all tabs and add checkstyle rule that enforces no-tabs
Fixes SMACK-866.
2019-05-07 21:24:00 +02:00