1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!-- FindBugs exclude list for Jakarta Mail -->
<FindBugsFilter>
<!--
FindBugs *really* wants us to use zero length arrays instead
of null. Unfortunately, there's a bunch of places we can't
do this for various reasons:
- The API specifies null and we can't make an incompatible change.
- We use null to indicate no header and an empty array to indicate
the header exists but has no entries.
- We use null to indicate NIL in the protocol and an empty array
to indicate an empty list "()" in the protocol.
This error occurs often enough that we just ignore it everywhere.
-->
<Match>
<Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
</Match>
<!--
There are a bunch of places where FindBugs complains about
exposing internal representations. We exclude cases where
this only happens in internal classes that are never visible
through the public Jakarta Mail API, or cases where the user
passes in an object (usually an array) and can only hurt
themselves by modifying the array while a method is in progress,
or where the implementation is passing the data back to the user
(e.g., in an Exception) and never uses it again.
-->
<Match>
<Or>
<Class name="jakarta.mail.SendFailedException"/>
<Class name="jakarta.mail.event.MessageCountEvent"/>
<Class name="jakarta.mail.event.TransportEvent"/>
<Class name="com.sun.mail.iap.ByteArray"/>
<Class name="com.sun.mail.imap.MessageVanishedEvent"/>
<Class name="com.sun.mail.imap.protocol.FetchResponse"/>
</Or>
<Or>
<Bug pattern="EI_EXPOSE_REP"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Or>
</Match>
<Match>
<Class name="com.sun.mail.smtp.SMTPTransport"/>
<Method name="sendMessage"/>
<!-- passed in Address array -->
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="jakarta.mail.internet.MimeBodyPart"/>
<Method name="<init>"/> <!-- match constructor -->
<!-- passed in byte array -->
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="jakarta.mail.util.ByteArrayDataSource"/>
<Method name="<init>"/> <!-- match constructor -->
<!-- passed in byte array -->
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="com.sun.mail.util.MailSSLSocketFactory"/>
<Method name="setTrustManagers"/>
<!-- passed in TrustManager array -->
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="com.sun.mail.util.MailSSLSocketFactory"/>
<Method name="getTrustManagers"/>
<!-- returned TrustManager array -->
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="com.sun.mail.imap.protocol.INTERNALDATE"/>
<Method name="getDate"/>
<!--
Returned Date object; it's only ever stored in
IMAPMessage.receivedDate and is always used to
construct a new Date object before returning to
users.
-->
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="com.sun.mail.imap.CopyUID"/>
<Method name="<init>"/> <!-- match constructor -->
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<!--
A few places where it complains about wait not being in a loop.
This purposely doesn't loop so that the application
calling idle can check whether the idle should continue.
-->
<Match>
<!-- an anonymous inner class of the idle method -->
<Class name="~com\.sun\.mail\.imap\.IMAPFolder.*"/>
<Method name="doCommand"/>
<Bug pattern="WA_NOT_IN_LOOP"/>
</Match>
<Match>
<Class name="com.sun.mail.imap.IMAPStore"/>
<Method name="idle"/>
<Bug pattern="WA_NOT_IN_LOOP"/>
</Match>
<!--
A few places where we catch Exception even though it's not
explicitly thrown. We need to make sure that if anything
goes wrong we clean things up. Perhaps these should be
converted to a finally block and a boolean "success" flag?
Most of these are related to reflection or ClassLoader
operations, which can fail for all sorts of unexpected reasons.
Some of these could be converted to use multi-catch with JDK 1.7.
-->
<Match>
<Class name="com.sun.mail.imap.IMAPStore"/>
<Or>
<Method name="<init>"/> <!-- match constructor -->
<Method name="getProtocol"/>
<Method name="getStoreProtocol"/>
<Method name="newIMAPFolder"/>
</Or>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<Match>
<Class name="com.sun.mail.imap.protocol.IMAPProtocol"/>
<Or>
<Method name="authlogin"/>
<Method name="authntlm"/>
<Method name="authplain"/>
<Method name="authoauth2"/>
<Method name="sasllogin"/>
</Or>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<Match>
<Class name="com.sun.mail.imap.protocol.IMAPSaslAuthenticator"/>
<Method name="authenticate"/>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<Match>
<Class name="com.sun.mail.pop3.POP3Store"/>
<Method name="<init>"/> <!-- match constructor -->
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<Match>
<Class name="com.sun.mail.smtp.SMTPTransport"/>
<Or>
<Method name="isConnected"/>
<Method name="sasllogin"/>
</Or>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<Match>
<Class name="com.sun.mail.pop3.POP3Folder"/>
<Method name="createMessage"/>
<Or>
<Bug pattern="REC_CATCH_EXCEPTION"/>
<Bug pattern="DE_MIGHT_IGNORE"/>
</Or>
</Match>
<Match>
<Class name="com.sun.mail.util.SocketFetcher"/>
<Or>
<Method name="getSocket"/>
<Method name="startTLS"/>
<Method name="matchCert"/>
</Or>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<Match>
<Class name="com.sun.mail.util.MimeUtil"/>
<Method name="cleanContentType"/>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<Match>
<Class name="jakarta.mail.Session"/>
<Or>
<Method name="getService"/>
<Method name="loadAllResources"/>
</Or>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<Match>
<Class name="jakarta.mail.internet.MimeUtility"/>
<Or>
<Method name="<clinit>"/> <!-- match static initializer -->
<Method name="getEncoding"/>
</Or>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<Match>
<Class name="com.sun.mail.imap.IMAPFolder"/>
<Method name="handleIdle"/>
<Bug pattern="DE_MIGHT_IGNORE"/>
</Match>
<!--
FindBugs complains about a possible double check of headersLoaded,
but it seems to be just wrong; I don't see it.
-->
<Match>
<Class name="com.sun.mail.imap.IMAPMessage"/>
<Method name="loadHeaders"/>
<Bug pattern="DC_DOUBLECHECK"/>
</Match>
<!--
These IMAP-specific subclasses of standard classes don't override
equals because all they add are constructors and optimized access
methods; everything else, including the way to test for equality,
is the same.
-->
<Match>
<Class name="com.sun.mail.imap.protocol.FLAGS"/>
<Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
</Match>
<Match>
<Class name="com.sun.mail.imap.protocol.IMAPAddress"/>
<!-- defined in ENVELOPE.java -->
<Bug pattern="EQ_DOESNT_OVERRIDE_EQUALS"/>
</Match>
<!--
FindBugs complains of an unitialized read of the "capabilities"
field. Since the superclass might initialize the field (via a
call into the overridden processGreeting method), any initialization
done in the IMAPProtocol class will undo any initialization done
as a side effect of calling the superclass constructor. Thus, we
need to depend on the field being initialized to the default value.
-->
<Match>
<Class name="com.sun.mail.imap.protocol.IMAPProtocol"/>
<Method name="<init>"/> <!-- match constructor -->
<Bug pattern="UR_UNINIT_READ"/>
</Match>
<!--
This use of string concatenation only occurs when creating a
string for an error message in an exception. The simpler code
is better here; performance is not an issue.
-->
<Match>
<Class name="com.sun.mail.util.BASE64DecoderStream"/>
<Method name="recentChars"/>
<Bug pattern="SBSC_USE_STRINGBUFFER_CONCATENATION"/>
</Match>
<!--
Yes, the "next" element in my linked list isn't ever actually
used, but it feels weird to only have a "prev" element.
-->
<Match>
<Class name="jakarta.mail.EventQueue$QueueElement"/>
<Field name="next"/>
<Bug pattern="URF_UNREAD_FIELD"/>
</Match>
<!--
Stupid Serializable EventObject class causes FindBugs to complain
about transient fields in subclasses. I don't know why it's
complaining about these fields but not others, but since I don't
really expect anyone to serialize these events I'm just ignoring
this complaint. Ditto Exception fields.
-->
<Match>
<Class name="jakarta.mail.event.TransportEvent"/>
<Or>
<Field name="invalid"/>
<Field name="validSent"/>
<Field name="validUnsent"/>
</Or>
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED"/>
</Match>
<Match>
<Class name="jakarta.mail.event.FolderEvent"/>
<Or>
<Field name="folder"/>
<Field name="newFolder"/>
</Or>
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED"/>
</Match>
<Match>
<Class name="jakarta.mail.event.MessageChangedEvent"/>
<Field name="msg"/>
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED"/>
</Match>
<Match>
<Class name="jakarta.mail.event.MessageCountEvent"/>
<Field name="msgs"/>
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED"/>
</Match>
<Match>
<Class name="jakarta.mail.event.TransportEvent"/>
<Field name="msg"/>
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED"/>
</Match>
<Match>
<Class name="jakarta.mail.SendFailedException"/>
<Or>
<Field name="invalid"/>
<Field name="validSent"/>
<Field name="validUnsent"/>
</Or>
<Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED"/>
</Match>
<!--
These string comparisons are just optimizations.
-->
<Match>
<Or>
<Class name="jakarta.mail.URLName"/>
<Class name="jakarta.mail.internet.InternetAddress"/>
</Or>
<Method name="equals"/>
<Bug pattern="ES_COMPARING_STRINGS_WITH_EQ"/>
</Match>
<!--
This string comparison using == is to determine whether the
String object is a different String object.
-->
<Match>
<Class name="jakarta.mail.internet.MimeUtility"/>
<Method name="decodeText"/>
<Bug pattern="ES_COMPARING_STRINGS_WITH_EQ"/>
</Match>
<!--
This string comparison using == is to determine whether the
String object is the original default String object.
-->
<Match>
<Class name="com.sun.mail.smtp.SMTPTransport"/>
<Method name="authenticate"/>
<Bug pattern="ES_COMPARING_STRINGS_WITH_EQ"/>
</Match>
<!--
ByteArrayInputStream.available guarantees to return the full number
of bytes left in the buffer, and ByteArrayInputStream.read guarantees
to read all the bytes, so we don't really need to check the return
value. Ignore this complaint.
-->
<Match>
<Class name="com.sun.mail.util.ASCIIUtility"/>
<Method name="getBytes"/>
<Bug pattern="DLS_DEAD_LOCAL_STORE"/>
</Match>
<!--
We extract the "lang" field of an encoded string but we don't
currently do anything with it. Ignore this complaint.
-->
<Match>
<Class name="jakarta.mail.internet.ParameterList"/>
<Method name="decodeValue"/>
<Bug pattern="DLS_DEAD_LOCAL_STORE"/>
</Match>
<!--
The call ParameterList.set(null, "DONE") is a kludge used by the
IMAP provider to indicate that it's done setting parameters.
In other cases we *want* a null name to cause a NullPointerException.
-->
<Match>
<Class name="jakarta.mail.internet.ParameterList"/>
<Method name="set"/>
<Bug pattern="NP_NULL_ON_SOME_PATH"/>
</Match>
<!--
We purposely don't close these streams, which are just wrappers
around the original stream that needs to remain open.
-->
<Match>
<Class name="jakarta.mail.internet.MimeMultipart"/>
<Or>
<Method name="parse"/>
<Method name="parsebm"/>
</Or>
<Bug pattern="OS_OPEN_STREAM"/>
</Match>
<!--
When deleting the temp file fails, there's really nothing to be done.
-->
<Match>
<Class name="com.sun.mail.pop3.TempFile"/>
<Method name="close"/>
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
</Match>
<!--
In IMAPFolder.close, I believe the protocol field can be set to null
as a result of a protocol error that invokes a callback that calls
cleanup, thus I don't believe these null checks are redundant.
-->
<Match>
<Class name="com.sun.mail.imap.IMAPFolder"/>
<Method name="close"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Match>
<!--
Can't fix these errors in toString until JavaMail 1.5 because
it's part of the spec. Sigh.
-->
<Match>
<Or>
<Class name="jakarta.mail.internet.ContentDisposition"/>
<Class name="jakarta.mail.internet.ContentType"/>
</Or>
<Method name="toString"/>
<Bug pattern="NP_TOSTRING_COULD_RETURN_NULL"/>
</Match>
<!--
IMAPFolder.uidTable is only ever manipulated when the
messageCacheLock is held, but FindBugs can't figure that out.
-->
<Match>
<Class name="com.sun.mail.imap.IMAPFolder"/>
<Field name="uidTable"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<!--
IMAPFolder.doExpungeNotification is only ever manipulated when the
messageCacheLock is held, but FindBugs can't figure that out.
-->
<Match>
<Class name="com.sun.mail.imap.IMAPFolder"/>
<Field name="doExpungeNotification"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<!--
The static mailDateFormat field is only used to access the parse
method, which is known to be thread safe, so we can ignore this error.
-->
<Match>
<Class name="com.sun.mail.imap.protocol.INTERNALDATE"/>
<Bug pattern="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE"/>
</Match>
<!--
These errors are in code imported from the JDK, where it seems
to be purposely using the platform default encoding. It's safer
to just leave this alone and ignore the errors.
-->
<Match>
<Class name="jakarta.mail.URLName"/>
<Bug pattern="DM_DEFAULT_ENCODING"/>
</Match>
<!--
We're purposely using the platform default encoding because
we're trying to discover what the platform default encoding *is*!
-->
<Match>
<Class name="jakarta.mail.internet.MimeUtility"/>
<Method name="getDefaultJavaCharset"/>
<Bug pattern="DM_DEFAULT_ENCODING"/>
</Match>
<!--
We're purposely using the platform default encoding when a
charset hasn't been specified.
-->
<Match>
<Class name="jakarta.mail.internet.ParameterList"/>
<Method name="combineMultisegmentNames"/>
<Bug pattern="DM_DEFAULT_ENCODING"/>
</Match>
<!--
We're purposely using the platform default encoding because
we're converting bytes that were written using the platform
default encoding back to a String.
-->
<Match>
<Class name="com.sun.mail.util.LogOutputStream"/>
<Method name="logBuf"/>
<Bug pattern="DM_DEFAULT_ENCODING"/>
</Match>
<!--
MimeBodyPart.headers is set in the constructor. IMAPBodyPart has
perhaps paranoid defensive code to set it if it's not set. That
code is protected by the object lock, but all of the reads of the
field are not, thus FindBugs complains. For now I think it's
better to leave the defensive code in and ignore this error.
-->
<Match>
<Class name="jakarta.mail.internet.MimeBodyPart"/>
<Field name="headers"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<!--
Refactoring these anonymous inner classes to be static classes
makes the code less readable. Too bad there's no way for an
anonymous inner class to be static.
XXX - these class names aren't going to be stable as the code changes
-->
<Match>
<Or>
<Class name="com.sun.mail.imap.DefaultFolder$1"/>
<Class name="com.sun.mail.imap.DefaultFolder$2"/>
<Class name="com.sun.mail.imap.IMAPFolder$1"/>
<Class name="com.sun.mail.imap.IMAPFolder$4"/>
<Class name="com.sun.mail.imap.IMAPFolder$7"/>
<Class name="com.sun.mail.imap.IMAPFolder$13"/>
<Class name="com.sun.mail.imap.IMAPFolder$20"/>
<Class name="com.sun.mail.imap.IdleManager$2"/>
</Or>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
</Match>
<!--
SpotBugs doesn't recognize the anonymous inner classes above.
https://github.com/spotbugs/discuss/issues/22
This regular expression version has the same effect, and
avoids the potential issue with the class names changing.
-->
<Match>
<Or>
<Class name="~com\.sun\.mail\.imap\.DefaultFolder.*"/>
<Class name="~com\.sun\.mail\.imap\.IMAPFolder.*"/>
<Class name="~com\.sun\.mail\.imap\.IdleManager.*"/>
</Or>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
</Match>
<!--
Even though only this array reference is volatile, the array is
used in such a way that it's safe. The aray elements are created
and initialized before the array is assigned to this array
reference, and after being assigned neither the array nor the
array elements are changed.
-->
<Match>
<Class name="com.sun.mail.imap.IMAPFolder"/>
<Field name="attributes"/>
<Bug pattern="VO_VOLATILE_REFERENCE_TO_ARRAY"/>
</Match>
<!--
This code is easier to understand with empty "if" clauses;
the "match" method is being called for its side effects.
-->
<Match>
<Class name="com.sun.mail.imap.protocol.FetchResponse"/>
<Method name="parseItem"/>
<Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
</Match>
<!--
Even though these fields are unread for now, we'll keep them
since they represent data in the protocol message being parsed.
-->
<Match>
<Or>
<Class name="com.sun.mail.imap.protocol.ENVELOPE"/>
<Class name="com.sun.mail.imap.protocol.INTERNALDATE"/>
<Class name="com.sun.mail.imap.protocol.RFC822SIZE"/>
</Or>
<Field name="msgno"/>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
</Match>
<Match>
<Class name="com.sun.mail.imap.protocol.MailboxInfo"/>
<Field name="first"/>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
</Match>
<!--
These unread fields are part of the public API.
-->
<Match>
<Class name="jakarta.mail.Service"/>
<Field name="debug"/>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
</Match>
<Match>
<Class name="jakarta.mail.Quota$Resource"/>
<Field name="usage"/>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
</Match>
<!--
We use a static MailDateFormat instance, which uses a static
GregorianCalendar instance. The MailDateFormat.parse method
uses only local data except for the GregorianCalendar instance,
which is invoked through a static synchronized method.
-->
<Match>
<Class name="com.sun.mail.imap.protocol.ENVELOPE"/>
<Bug pattern="STCAL_INVOKE_ON_STATIC_DATE_FORMAT_INSTANCE"/>
</Match>
<!--
A special String instance is used to indicate that the POP3
UID is unknown. The uid field is initialized to this String
instance, which we then compare with later to see if the uid
has been set.
-->
<Match>
<Class name="com.sun.mail.pop3.POP3Folder"/>
<Method name="getUID"/>
<Bug pattern="ES_COMPARING_STRINGS_WITH_EQ"/>
</Match>
<!--
As above, a special String instance is used to indicate whether
certain fields have been set.
-->
<Match>
<Class name="com.sun.mail.smtp.SMTPTransport"/>
<Or>
<Method name="getAuthorizationId"/>
<Method name="getNTLMDomain"/>
<Method name="getSASLRealm"/>
</Or>
<Bug pattern="ES_COMPARING_STRINGS_WITH_EQ"/>
</Match>
<!--
I know Exception.toString is never supposed to return null,
but this extra check is cheap insurance.
-->
<Match>
<Class name="jakarta.mail.MessagingException"/>
<Method name="toString"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>
<!--
I know ClassLoader.getResources is never supposed to return null,
but this extra check is cheap insurance.
-->
<Match>
<Class name="~javax\.mail\.Session\$.*"/>
<Method name="run"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>
<!--
These names may be confusing, but we're stuck with them.
-->
<Match>
<Class name="jakarta.mail.PasswordAuthentication"/>
<Method name="getUserName"/>
<Bug pattern="NM_CONFUSING"/>
</Match>
<!--
This trivial inner class extends ArrayList, but is never serialized,
so it doesn't really need a serialVersionUID.
-->
<Match>
<Class name="jakarta.mail.internet.ParameterList$MultiValue"/>
<Bug pattern="SE_NO_SERIALVERSIONID"/>
</Match>
<!--
These array references are declared volatile because they're
treated as copy-on-write.
-->
<Match>
<Class name="com.sun.mail.util.logging.LogManagerProperties"/>
<Field name="REFLECT_NAMES"/>
<Bug pattern="VO_VOLATILE_REFERENCE_TO_ARRAY"/>
</Match>
<Match>
<Class name="com.sun.mail.util.logging.MailHandler"/>
<Field name="attachmentFilters"/>
<Bug pattern="VO_VOLATILE_REFERENCE_TO_ARRAY"/>
</Match>
<!--
The Authenticator fields are only accessible by subclasses,
which are only called through the one synchronized public
method, assuming the subclass doesn't do something crazy and
expose them itself.
-->
<Match>
<Class name="jakarta.mail.Authenticator"/>
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
</Match>
<!--
Ignore failures to close connection.
-->
<Match>
<Class name="com.sun.mail.smtp.SMTPTransport"/>
<Method name="protocolConnect"/>
<Bug pattern="DE_MIGHT_IGNORE"/>
</Match>
<!--
This inner class doesn't need "this", but it creates another
inner class that *does* need "this".
-->
<Match>
<Class name="com.sun.mail.smtp.SMTPTransport$BDATOutputStream"/>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_NEEDS_THIS"/>
</Match>
</FindBugsFilter>
|