HuntBugs report

All warnings (12)
All warnings (12)
Unconditional wait
(WaitUnconditional [x])
Category:Multithreading
Score:65
Location:BotSession.java:186
Class:org/telegram/telegrambots/updatesreceivers/BotSession$HandlerThread
Method:run
Unconditional BotSession.access$700() call in BotSession.HandlerThread.run().
This method contains a call to BotSession.access$700() which is not guarded by conditional control flow. The code should verify that condition it intends to wait for is not already satisfied before calling wait; any previous notifications will be ignored.
Method with Boolean return type returns explicit null
(BooleanReturnNull [x])
Category:BadPractice
Score:50
Location:AnswerCallbackQuery.java:87
Class:org/telegram/telegrambots/api/methods/AnswerCallbackQuery
Method:deserializeResponse
Method AnswerCallbackQuery.deserializeResponse() with Boolean return type returns null.
A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException.
Method with Boolean return type returns explicit null
(BooleanReturnNull [x])
Category:BadPractice
Score:50
Location:AnswerInlineQuery.java:143
Class:org/telegram/telegrambots/api/methods/AnswerInlineQuery
Method:deserializeResponse
Method AnswerInlineQuery.deserializeResponse() with Boolean return type returns null.
A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException.
Method with Boolean return type returns explicit null
(BooleanReturnNull [x])
Category:BadPractice
Score:50
Location:KickChatMember.java:73
Class:org/telegram/telegrambots/api/methods/groupadministration/KickChatMember
Method:deserializeResponse
Method KickChatMember.deserializeResponse() with Boolean return type returns null.
A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException.
Method with Boolean return type returns explicit null
(BooleanReturnNull [x])
Category:BadPractice
Score:50
Location:LeaveChat.java:55
Class:org/telegram/telegrambots/api/methods/groupadministration/LeaveChat
Method:deserializeResponse
Method LeaveChat.deserializeResponse() with Boolean return type returns null.
A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException.
Method with Boolean return type returns explicit null
(BooleanReturnNull [x])
Category:BadPractice
Score:50
Location:UnbanChatMember.java:69
Class:org/telegram/telegrambots/api/methods/groupadministration/UnbanChatMember
Method:deserializeResponse
Method UnbanChatMember.deserializeResponse() with Boolean return type returns null.
A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException.
Method with Boolean return type returns explicit null
(BooleanReturnNull [x])
Category:BadPractice
Score:50
Location:SendChatAction.java:81
Class:org/telegram/telegrambots/api/methods/send/SendChatAction
Method:deserializeResponse
Method SendChatAction.deserializeResponse() with Boolean return type returns null.
A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException.
Naked call to notify() or notifyAll()
(NotifyNaked [x])
Category:Multithreading
Score:50
Location:BotSession.java:148
Class:org/telegram/telegrambots/updatesreceivers/BotSession$ReaderThread
Method:run
Naked BotSession.access$700() call in BotSession.ReaderThread.run().
A call to BotSession.access$700() was made without any (apparent) accompanying modification to mutable object state. In general, calling a notify method on a monitor is done because some condition another thread is waiting for has become true. However, for the condition to be meaningful, it must involve a heap object that is visible to both threads.
This bug does not necessarily indicate an error, since the change to mutable object state may have taken place in a method which then called the method containing the notification.
String concatenation in a loop
(StringConcatInLoop [x])
Category:Performance
Score:50
Location:FileFormatter.java:48
Class:org/telegram/telegrambots/logging/FileFormatter
Method:logThrowableToFile
Variable:throwableLog
Variable throwableLog is concatenated in loop.
This code concatenates a string (stored in variable throwableLog) in a loop. This could be really inefficient. Consider using StringBuilder instead.
Private or package-private field is used, but never written
(UnwrittenPrivateField [x])
Category:Correctness
Score:50
Location:TelegramApiException.java:34
Class:org/telegram/telegrambots/TelegramApiException
Method:toString
Field:errorCode
Private or package-private field TelegramApiException.errorCode is used, but never written.
The field TelegramApiException.errorCode is used, but never written, so it always has default value. If it's intended to be written (injected) via reflection, consider annotating it with some annotation to avoid confusion.
Unconditional wait
(WaitUnconditional [x])
Category:Multithreading
Score:50
Location:BotSession.java:153; 166
Class:org/telegram/telegrambots/updatesreceivers/BotSession$ReaderThread
Method:run
Variable:this
Unconditional Object.wait() call in BotSession.ReaderThread.run().
This method contains a call to Object.wait() which is not guarded by conditional control flow. The code should verify that condition it intends to wait for is not already satisfied before calling wait; any previous notifications will be ignored.
Constructor invokes Thread.start()
(StartInConstructor [x])
Category:Multithreading
Score:40
Location:BotSession.java:85; 89
Class:org/telegram/telegrambots/updatesreceivers/BotSession
Method:<init>
Constructor invokes Thread.start() in BotSession.
The constructor starts a thread. This is likely to be wrong if the class is ever extended/subclassed, since the thread will be started before the subclass constructor is started.
Added (0)
Changed (0)
Score raised (0)
Score lowered (0)
Fixed (0)