mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-08 20:11:08 +01:00
Add more checkstyle tests
- Lines containing tab(s) after space - Usage of printStackTrace - Usage of println - Add SupressionCommentFilter module SuppressionCommentFilter can be enabled with // CHECKSTYLE:OFF and disabled with // CHECKSTYLE:ON
This commit is contained in:
parent
4f64bb1036
commit
b2221d5483
59 changed files with 382 additions and 202 deletions
|
|
@ -153,7 +153,9 @@ public class ChatManager extends Manager{
|
|||
Message message = (Message) packet;
|
||||
Chat chat;
|
||||
if (message.getThread() == null) {
|
||||
// CHECKSTYLE:OFF
|
||||
chat = getUserChat(message.getFrom());
|
||||
// CHECKSTYLE:ON
|
||||
}
|
||||
else {
|
||||
chat = getThreadChat(message.getThread());
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public class DirectoryRosterStore implements RosterStore {
|
|||
for (File file : fileDir.listFiles(rosterDirFilter)) {
|
||||
Item entry = readEntry(file);
|
||||
if (entry == null) {
|
||||
log("Roster store file '" + file + "' is invalid.");
|
||||
LOGGER.severe("Roster store file '" + file + "' is invalid.");
|
||||
}
|
||||
else {
|
||||
entries.add(entry);
|
||||
|
|
@ -228,7 +228,7 @@ public class DirectoryRosterStore implements RosterStore {
|
|||
groupNames.add(group);
|
||||
}
|
||||
else {
|
||||
log("Invalid group entry in store entry file "
|
||||
LOGGER.severe("Invalid group entry in store entry file "
|
||||
+ file);
|
||||
}
|
||||
}
|
||||
|
|
@ -245,9 +245,7 @@ public class DirectoryRosterStore implements RosterStore {
|
|||
return null;
|
||||
}
|
||||
catch (XmlPullParserException e) {
|
||||
log("Invalid group entry in store entry file "
|
||||
+ file);
|
||||
LOGGER.log(Level.SEVERE, "readEntry()", e);
|
||||
LOGGER.log(Level.SEVERE, "Invalid group entry in store entry file", e);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -264,14 +262,14 @@ public class DirectoryRosterStore implements RosterStore {
|
|||
item.setItemType(RosterPacket.ItemType.valueOf(type));
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
log("Invalid type in store entry file " + file);
|
||||
LOGGER.log(Level.SEVERE, "Invalid type in store entry file " + file, e);
|
||||
return null;
|
||||
}
|
||||
if (status != null) {
|
||||
RosterPacket.ItemStatus itemStatus = RosterPacket.ItemStatus
|
||||
.fromString(status);
|
||||
if (itemStatus == null) {
|
||||
log("Invalid status in store entry file " + file);
|
||||
LOGGER.severe("Invalid status in store entry file " + file);
|
||||
return null;
|
||||
}
|
||||
item.setItemStatus(itemStatus);
|
||||
|
|
@ -304,8 +302,4 @@ public class DirectoryRosterStore implements RosterStore {
|
|||
String encodedJid = Base32.encode(bareJid.toString());
|
||||
return new File(fileDir, ENTRY_PREFIX + encodedJid);
|
||||
}
|
||||
|
||||
private void log(String error) {
|
||||
System.err.println(error);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue