1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 06:12:05 +01:00

[checkstyle] Tighten JavadocMethod checkstyle rule

This commit is contained in:
Florian Schmaus 2020-05-23 22:35:27 +02:00
parent 5bfe789e08
commit ebe5c49e92
12 changed files with 45 additions and 34 deletions

View file

@ -105,10 +105,6 @@
<module name="JavadocMethod"> <module name="JavadocMethod">
<!-- TODO stricten those checks --> <!-- TODO stricten those checks -->
<property name="scope" value="public"/> <property name="scope" value="public"/>
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowMissingJavadoc" value="true"/> <property name="allowMissingJavadoc" value="true"/>
<property name="suppressLoadErrors" value="true"/> <property name="suppressLoadErrors" value="true"/>
</module> </module>

View file

@ -29,6 +29,7 @@ public class ProviderManagerTest {
/** /**
* This test should be run in a clean (e.g. forked) VM * This test should be run in a clean (e.g. forked) VM
* @throws Exception if exception.
*/ */
@Test @Test
public void shouldInitializeSmackTest() throws Exception { public void shouldInitializeSmackTest() throws Exception {

View file

@ -150,6 +150,7 @@ public class DummyConnection extends AbstractXMPPConnection {
* Returns the first stanza that's sent through {@link #sendStanza(Stanza)} * Returns the first stanza that's sent through {@link #sendStanza(Stanza)}
* and that has not been returned by earlier calls to this method. * and that has not been returned by earlier calls to this method.
* *
* @param <P> the top level stream element class.
* @return a sent packet. * @return a sent packet.
*/ */
public <P extends TopLevelStreamElement> P getSentPacket() { public <P extends TopLevelStreamElement> P getSentPacket() {
@ -162,6 +163,8 @@ public class DummyConnection extends AbstractXMPPConnection {
* method will block for up to the specified number of seconds if no packets * method will block for up to the specified number of seconds if no packets
* have been sent yet. * have been sent yet.
* *
* @param wait how long to wait in seconds.
* @param <P> the top level stream element class.
* @return a sent packet. * @return a sent packet.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")

View file

@ -324,8 +324,7 @@ public final class HttpFileUploadManager extends Manager {
* supported by the service. * supported by the service.
* @throws InterruptedException if the calling thread was interrupted. * @throws InterruptedException if the calling thread was interrupted.
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned. * @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
* @throws SmackException.NotConnectedException if the XMPP connection is not connected. * @throws SmackException if smack exception.
* @throws SmackException.NoResponseException if there was no response from the remote entity.
*/ */
public Slot requestSlot(String filename, long fileSize) throws InterruptedException, public Slot requestSlot(String filename, long fileSize) throws InterruptedException,
XMPPException.XMPPErrorException, SmackException { XMPPException.XMPPErrorException, SmackException {
@ -348,7 +347,7 @@ public final class HttpFileUploadManager extends Manager {
* @throws SmackException.NotConnectedException if the XMPP connection is not connected. * @throws SmackException.NotConnectedException if the XMPP connection is not connected.
* @throws InterruptedException if the calling thread was interrupted. * @throws InterruptedException if the calling thread was interrupted.
* @throws XMPPException.XMPPErrorException if there was an XMPP error returned. * @throws XMPPException.XMPPErrorException if there was an XMPP error returned.
* @throws SmackException.NoResponseException if there was no response from the remote entity. * @throws SmackException if smack exception.
*/ */
public Slot requestSlot(String filename, long fileSize, String contentType) throws SmackException, public Slot requestSlot(String filename, long fileSize, String contentType) throws SmackException,
InterruptedException, XMPPException.XMPPErrorException { InterruptedException, XMPPException.XMPPErrorException {

View file

@ -186,8 +186,8 @@ public final class UserTuneElement implements ExtensionElement {
/** /**
* Artist is an optional element in UserTuneElement. * Artist is an optional element in UserTuneElement.
* @param artist. * @param artist the artist.
* @return builder. * @return a reference to this builder.
*/ */
public Builder setArtist(String artist) { public Builder setArtist(String artist) {
this.artist = artist; this.artist = artist;
@ -196,8 +196,8 @@ public final class UserTuneElement implements ExtensionElement {
/** /**
* Length is an optional element in UserTuneElement. * Length is an optional element in UserTuneElement.
* @param length. * @param length the length.
* @return builder. * @return a reference to this builder.
*/ */
public Builder setLength(int length) { public Builder setLength(int length) {
return setLength(UInt16.from(length)); return setLength(UInt16.from(length));
@ -205,8 +205,8 @@ public final class UserTuneElement implements ExtensionElement {
/** /**
* Length is an optional element in UserTuneElement. * Length is an optional element in UserTuneElement.
* @param length. * @param length the length.
* @return builder. * @return a reference to this builder.
*/ */
public Builder setLength(UInt16 length) { public Builder setLength(UInt16 length) {
this.length = length; this.length = length;
@ -215,8 +215,8 @@ public final class UserTuneElement implements ExtensionElement {
/** /**
* Rating is an optional element in UserTuneElement. * Rating is an optional element in UserTuneElement.
* @param rating. * @param rating the rating.
* @return builder. * @return a reference to this builder.
*/ */
public Builder setRating(int rating) { public Builder setRating(int rating) {
this.rating = rating; this.rating = rating;
@ -225,8 +225,8 @@ public final class UserTuneElement implements ExtensionElement {
/** /**
* Source is an optional element in UserTuneElement. * Source is an optional element in UserTuneElement.
* @param source. * @param source the source.
* @return builder. * @return a reference to this builder.
*/ */
public Builder setSource(String source) { public Builder setSource(String source) {
this.source = source; this.source = source;
@ -235,8 +235,8 @@ public final class UserTuneElement implements ExtensionElement {
/** /**
* Title is an optional element in UserTuneElement. * Title is an optional element in UserTuneElement.
* @param title. * @param title the title.
* @return builder. * @return a reference to this builder.
*/ */
public Builder setTitle(String title) { public Builder setTitle(String title) {
this.title = title; this.title = title;
@ -245,8 +245,8 @@ public final class UserTuneElement implements ExtensionElement {
/** /**
* Track is an optional element in UserTuneElement. * Track is an optional element in UserTuneElement.
* @param track. * @param track the track.
* @return builder. * @return a reference to this builder.
*/ */
public Builder setTrack(String track) { public Builder setTrack(String track) {
this.track = track; this.track = track;
@ -255,8 +255,8 @@ public final class UserTuneElement implements ExtensionElement {
/** /**
* URI is an optional element in UserTuneElement. * URI is an optional element in UserTuneElement.
* @param uri. * @param uri the URI.
* @return builder. * @return a reference to this builder.
*/ */
public Builder setUri(URI uri) { public Builder setUri(URI uri) {
this.uri = uri; this.uri = uri;

View file

@ -86,7 +86,7 @@ public class Socks5ProxyTest {
* When inserting new network addresses to the proxy the order should remain in the order they * When inserting new network addresses to the proxy the order should remain in the order they
* were inserted. * were inserted.
* *
* @throws UnknownHostException * @throws UnknownHostException if unknown host.
*/ */
@Test @Test
public void shouldPreserveAddressOrderOnInsertions() throws UnknownHostException { public void shouldPreserveAddressOrderOnInsertions() throws UnknownHostException {
@ -114,7 +114,7 @@ public class Socks5ProxyTest {
* When replacing network addresses of the proxy the order should remain in the order if the * When replacing network addresses of the proxy the order should remain in the order if the
* given list. * given list.
* *
* @throws UnknownHostException * @throws UnknownHostException if unknown host.
*/ */
@Test @Test
public void shouldPreserveAddressOrderOnReplace() throws UnknownHostException { public void shouldPreserveAddressOrderOnReplace() throws UnknownHostException {

View file

@ -95,6 +95,8 @@ public class RosterTest extends InitSmackIm {
* Test a simple roster initialization according to the example in * Test a simple roster initialization according to the example in
* <a href="http://xmpp.org/rfcs/rfc3921.html#roster-login" * <a href="http://xmpp.org/rfcs/rfc3921.html#roster-login"
* >RFC3921: Retrieving One's Roster on Login</a>. * >RFC3921: Retrieving One's Roster on Login</a>.
*
* @throws Exception in case of an exception.
*/ */
@Test @Test
public void testSimpleRosterInitialization() throws Exception { public void testSimpleRosterInitialization() throws Exception {
@ -131,6 +133,8 @@ public class RosterTest extends InitSmackIm {
* Test adding a roster item according to the example in * Test adding a roster item according to the example in
* <a href="http://xmpp.org/rfcs/rfc3921.html#roster-add" * <a href="http://xmpp.org/rfcs/rfc3921.html#roster-add"
* >RFC3921: Adding a Roster Item</a>. * >RFC3921: Adding a Roster Item</a>.
*
* @throws Throwable in case a throwable is thrown.
*/ */
@Test @Test
public void testAddRosterItem() throws Throwable { public void testAddRosterItem() throws Throwable {
@ -203,6 +207,8 @@ public class RosterTest extends InitSmackIm {
* Test updating a roster item according to the example in * Test updating a roster item according to the example in
* <a href="http://xmpp.org/rfcs/rfc3921.html#roster-update" * <a href="http://xmpp.org/rfcs/rfc3921.html#roster-update"
* >RFC3921: Updating a Roster Item</a>. * >RFC3921: Updating a Roster Item</a>.
*
* @throws Throwable in case a throwable is thrown.
*/ */
@Test @Test
public void testUpdateRosterItem() throws Throwable { public void testUpdateRosterItem() throws Throwable {
@ -279,6 +285,7 @@ public class RosterTest extends InitSmackIm {
* Test deleting a roster item according to the example in * Test deleting a roster item according to the example in
* <a href="http://xmpp.org/rfcs/rfc3921.html#roster-delete" * <a href="http://xmpp.org/rfcs/rfc3921.html#roster-delete"
* >RFC3921: Deleting a Roster Item</a>. * >RFC3921: Deleting a Roster Item</a>.
* @throws Throwable if throwable is thrown.
*/ */
@Test @Test
public void testDeleteRosterItem() throws Throwable { public void testDeleteRosterItem() throws Throwable {
@ -327,6 +334,7 @@ public class RosterTest extends InitSmackIm {
* Test a simple roster push according to the example in * Test a simple roster push according to the example in
* <a href="http://xmpp.org/internet-drafts/draft-ietf-xmpp-3921bis-03.html#roster-syntax-actions-push" * <a href="http://xmpp.org/internet-drafts/draft-ietf-xmpp-3921bis-03.html#roster-syntax-actions-push"
* >RFC3921bis-03: Roster Push</a>. * >RFC3921bis-03: Roster Push</a>.
* @throws Throwable in case a throwable is thrown.
*/ */
@Test @Test
public void testSimpleRosterPush() throws Throwable { public void testSimpleRosterPush() throws Throwable {
@ -398,6 +406,7 @@ public class RosterTest extends InitSmackIm {
* Test if adding an user with an empty group is equivalent with providing * Test if adding an user with an empty group is equivalent with providing
* no group. * no group.
* *
* @throws Throwable in case a throwable is thrown.
* @see <a href="http://www.igniterealtime.org/issues/browse/SMACK-294">SMACK-294</a> * @see <a href="http://www.igniterealtime.org/issues/browse/SMACK-294">SMACK-294</a>
*/ */
@Test(timeout = 5000) @Test(timeout = 5000)
@ -466,6 +475,7 @@ public class RosterTest extends InitSmackIm {
* Test processing a roster push with an empty group is equivalent with providing * Test processing a roster push with an empty group is equivalent with providing
* no group. * no group.
* *
* @throws Throwable in case a throwable is thrown.
* @see <a href="http://www.igniterealtime.org/issues/browse/SMACK-294">SMACK-294</a> * @see <a href="http://www.igniterealtime.org/issues/browse/SMACK-294">SMACK-294</a>
*/ */
@Test @Test

View file

@ -97,6 +97,8 @@ public class RosterVersioningTest {
* by all entries of the roster store. * by all entries of the roster store.
* @throws SmackException if Smack detected an exceptional situation. * @throws SmackException if Smack detected an exceptional situation.
* @throws XMPPException if an XMPP protocol error was received. * @throws XMPPException if an XMPP protocol error was received.
* @throws InterruptedException if interrupted.
* @throws IOException if IO exception.
*/ */
@Test(timeout = 300000) @Test(timeout = 300000)
public void testEqualVersionStored() throws InterruptedException, IOException, XMPPException, SmackException { public void testEqualVersionStored() throws InterruptedException, IOException, XMPPException, SmackException {
@ -172,6 +174,7 @@ public class RosterVersioningTest {
/** /**
* Test roster versioning with roster pushes. * Test roster versioning with roster pushes.
* @throws Throwable in case a throwable is thrown.
*/ */
@SuppressWarnings("UndefinedEquals") @SuppressWarnings("UndefinedEquals")
@Test(timeout = 5000) @Test(timeout = 5000)

View file

@ -57,6 +57,7 @@ public class DirectoryRosterStoreTest {
/** /**
* Tests that opening an uninitialized directory fails. * Tests that opening an uninitialized directory fails.
* @throws IOException if IO exception.
*/ */
@Test @Test
public void testStoreUninitialized() throws IOException { public void testStoreUninitialized() throws IOException {
@ -66,6 +67,7 @@ public class DirectoryRosterStoreTest {
/** /**
* Tests that an initialized directory is empty. * Tests that an initialized directory is empty.
* @throws IOException if IO exception.
*/ */
@Test @Test
public void testStoreInitializedEmpty() throws IOException { public void testStoreInitializedEmpty() throws IOException {
@ -80,6 +82,7 @@ public class DirectoryRosterStoreTest {
/** /**
* Tests adding and removing entries. * Tests adding and removing entries.
* @throws IOException if IO exception.
*/ */
@Test @Test
public void testStoreAddRemove() throws IOException { public void testStoreAddRemove() throws IOException {

View file

@ -125,11 +125,7 @@ public class EntityCapsTest extends AbstractSmackIntegrationTest {
/** /**
* Test if entity caps actually prevent a disco info request and reply. * Test if entity caps actually prevent a disco info request and reply.
* *
* @throws XMPPException if an XMPP protocol error was received. * @throws Exception if exception.
* @throws InterruptedException if the calling thread was interrupted.
* @throws NotConnectedException if the XMPP connection is not connected.
* @throws NoResponseException if there was no response from the remote entity.
*
*/ */
@SmackIntegrationTest @SmackIntegrationTest
public void testPreventDiscoInfo() throws Exception { public void testPreventDiscoInfo() throws Exception {

View file

@ -60,7 +60,7 @@ public class SignalOmemoStoreTest extends OmemoStoreTest<IdentityKeyPair, Identi
/** /**
* We are running this Test with multiple available OmemoStore implementations. * We are running this Test with multiple available OmemoStore implementations.
* @return * @return the test parameters.
* @throws IOException if an I/O error occurred. * @throws IOException if an I/O error occurred.
*/ */
@Parameterized.Parameters @Parameterized.Parameters

View file

@ -52,12 +52,12 @@ public class PacketWriterTest {
* interrupt. * interrupt.
* *
* @throws InterruptedException if the calling thread was interrupted. * @throws InterruptedException if the calling thread was interrupted.
* @throws BrokenBarrierException * @throws BrokenBarrierException in case of a broken barrier.
* @throws NotConnectedException if the XMPP connection is not connected. * @throws NotConnectedException if the XMPP connection is not connected.
* @throws XmppStringprepException if the provided string is invalid. * @throws XmppStringprepException if the provided string is invalid.
* @throws SecurityException if there was a security violation. * @throws SecurityException if there was a security violation.
* @throws NoSuchFieldException * @throws NoSuchFieldException if there is no such field.
* @throws IllegalAccessException * @throws IllegalAccessException if there was an illegal access.
* @throws IllegalArgumentException if an illegal argument was given. * @throws IllegalArgumentException if an illegal argument was given.
*/ */
@Test @Test