Commit Graph

15 Commits

Author SHA1 Message Date
Florian Schmaus ce1cddc722 More checkstyle whitespace related checks 2017-05-24 14:42:38 +02:00
Florian Schmaus 2ac0fc72ba Handle NameNotFoundException in smack-resolver-javax 2017-01-24 20:14:01 +01:00
Florian Schmaus f31cc6e043 Fix IllegalArgumentException on DNS lookup if XMPP domain is wrong
Fixes the following exception thrown if the user had entered a non-existend XMPP domain:
java.lang.IllegalArgumentException: Must provide at least one InetAddress
     at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:55)
     at org.jivesoftware.smack.util.dns.DNSResolver.lookupHostAddress(DNSResolver.java: 56)
     at org.jivesoftware.smack.util.DNSUtil.resolveDomain(DNSUtil.java:209)
     at org.jivesoftware.smack.util.DNSUtil.resolveXMPPServiceDomain(DNSUtil.java:136)
     at org.jivesoftware.smack.AbstractXMPPConnection.populateHostAddresses(AbstractXMP PConnection.java:626)
     at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPC onnection.java:556)
     at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection. java:888)
     at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.ja va:377)

Thanks to Grigory Fedorov for reporting.
2017-01-12 13:39:11 +01:00
Florian Schmaus e9bbe9a475 Fix OOB exception when setHostAddress(InetAddress) is used.
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  at java.lang.String.charAt(String.java:658)
  at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:48)
  at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:62)
2017-01-04 15:35:47 +01:00
Florian Schmaus 3129165a1c Add ConnectionConfiguration.setHostAddress(InetAddress)
In previous Smack versions, it was possible to set the host's IP
address via setHost(String), this is no longer possible (since the
support for DNSSEC was introduced). The new
setHostAddress(InetAddress) allows it again to explicitly specifiy the
XMPP service's host IP.
2016-12-28 23:18:28 +01:00
Florian Schmaus a1630d033e Add support for DNSSEC/DANE
This closes the cycle which started with a GSOC 2015 project under the
umbrella of the XSF adding DNSSEC/DANE support to MiniDNS.

Fixes SMACK-366.
2016-10-31 10:45:38 +01:00
Florian Schmaus 7a8d66e9e6 Improve logging of failed connection attempts
also improve XMPPTCPConnection.connectUsingConfiguration(): Try further
hostAddresses if getAllByName failes.

Fixes SMACK-711
2016-01-10 18:34:54 +01:00
Florian Schmaus de528eee67 Add JavadocPackage checkstyle
change from package.html to package-info.java. Add missing
package-info.java with a placeholder description.
2015-04-04 17:16:47 +02:00
Florian Schmaus 64d134052d Enable javadoc checkstyle
and fix violations.
2015-03-29 12:29:32 +02:00
Florian Schmaus 0fde39fa45 's;^\s+$;;' on all source files
And add checkstyle test for lines containing only whitespace characters.
2015-03-17 11:33:02 +01:00
Florian Schmaus 86ea027301 Add StringUtils.requireNotNullOrEmpty and Objects.requireNonNull
and use this in a few places.
2015-01-26 20:47:09 +01:00
Florian Schmaus 9ae66cc747 Use Exception.getString in HostAddress
instead of getMessage(), because some Exceptions, e.g. Android's
NetworkOnMainThreadException, will return null on
getMessage(). Exception.toString() does what we want, i.e. returns
- the exception class name
- and the return value of getLocalizedMessage()
2015-01-18 19:21:58 +01:00
Florian Schmaus 46f4a553e0 Add javadoc to SmackException.ConnectionException
and HostAddress
2014-06-17 13:17:15 +02:00
Florian Schmaus 02651c668f Improve HostAddress, make some members final
also
- add getException()
- improve constructor logic
2014-06-17 11:00:46 +02:00
Florian Schmaus 91fd15ad86 Prefix subprojects with 'smack-'
instead of using the old baseName=smack appendix=project.name approach,
we are now going convention over configuration and renaming the
subprojects directories to the proper name.

Having a prefix is actually very helpful, because the resulting
libraries will be named like the subproject. And a core-4.0.0-rc1.jar is
not as explicit about what it actually *is* as a
smack-core-4.0.0-rc1.jar.

SMACK-265
2014-04-28 19:44:14 +02:00