Commit Graph

319 Commits

Author SHA1 Message Date
Tagir Valeev
1f3b821f82 [java-annotations] Remove 'io' mutation annotation from methods that read file-system only
Despite the benign side effect, it's still ok to use them in assert statements, etc.

GitOrigin-RevId: 5d20dd9bd2b8191217ea71190942adcd1c618428
2024-07-08 09:43:22 +00:00
Tagir Valeev
d52f6c789f [java-dfa] IDEA-355908 Add new mutation contract option: io
GitOrigin-RevId: 206fae268d8444d475a4feac6ebc5ef96ffc57bb
2024-07-04 21:05:23 +00:00
Tagir Valeev
fcab6d8eef [java-annotations] IDEA-354204 java.lang.Integer.valueOf overloads should be externally annotated to return not-null result
GitOrigin-RevId: 000b7250ae122937fc668fd25458ea6fbad431f2
2024-06-03 16:18:36 +00:00
Tagir Valeev
c446f2c4d0 [java] String.format, formatted NotNull external annotation (IDEA-350263)
GitOrigin-RevId: e6ad9c6fca8653c45939271ed4e9ffc1b7dfee42
2024-04-03 19:43:21 +00:00
Alexey Kudravtsev
f9ba4d0cec cleanup
GitOrigin-RevId: 2a421924d23670a98903ad244394223000944fb1
2024-03-09 01:36:33 +00:00
Tagir Valeev
cab1be81ee [java-annotations] Contract and NotNull annotations on intermediate operations
GitOrigin-RevId: 3a67415f4b28a87ebe597258dab1dd039488c047
2024-02-12 19:13:08 +00:00
Tagir Valeev
9a274d4f01 [java-annotations] MouseWheelEvent methods marked as pure
GitOrigin-RevId: 2d87dc8fdba945bf4940e09cdd6e90ff549a4ca6
2024-02-09 21:17:16 +00:00
Tagir Valeev
6be9a50aaf [java-annotations] Purity contracts for Button methods
GitOrigin-RevId: 361eea2509f578029f7465c1165ec300d146f1af
2024-02-07 19:29:08 +00:00
Tagir Valeev
7d41efea2b [java-annotations] Iterator.next(): mutates itself
GitOrigin-RevId: 7acd79a299004cc4ddb1c473243cd7e4f8a526a1
2024-02-07 19:29:02 +00:00
Tagir Valeev
7805cdf70f [java-annotations] Purity contracts for InputEvent
GitOrigin-RevId: f2d37351adc29f5856faf3eb03b6f967da4ba7a7
2024-02-07 19:28:57 +00:00
Tagir Valeev
cd808051e2 [java-annotations] java.lang.CharSequence methods are annotated as pure
GitOrigin-RevId: c2f04a10a14cd36ecc731164f40b8fc1b62c8a2b
2024-02-07 19:28:37 +00:00
Tagir Valeev
eed5037d8f [java] Annotate java.time parse methods
GitOrigin-RevId: 61d86579eafec120e59985886094bcb0a7a32ac1
2023-12-14 15:51:20 +00:00
Tagir Valeev
70ec96cc40 Annotations for KeyEvent, MouseEvent, InputEvent
GitOrigin-RevId: 97c7b0be6f13e33c96c105a18e3ee7fe4dab2510
2023-12-14 15:51:13 +00:00
Alexey Kudravtsev
4355ee6a0b notnull
GitOrigin-RevId: 3e9f444a08027f094aefdbf7d991afdfc137b63e
2023-08-17 19:19:26 +00:00
Tagir Valeev
7a7e094d2d [java-dfa] IDEA-326613 Support constant evaluation of Integer.parseInt and friends
GitOrigin-RevId: 178e0b4309a84b07a1f01c5fc782a49f03feeb79
2023-07-28 09:45:33 +00:00
Dmitry Batrak
413c946dc5 IDEA-322100 IDE suggests using incorrect AWT event constants
GitOrigin-RevId: b8f76637d0d899011b1d591d3f47d7fa970ed1af
2023-06-08 18:28:42 +00:00
Tagir Valeev
e4b04b1e6a [java] External annotations of Java 11+ String methods (IDEA-308603)
GitOrigin-RevId: f1273bc4c87b91f2b1f2d519f37c3b0822c2637c
2023-06-05 16:00:38 +00:00
Mikhail Pyltsin
54fbbea987 [java-inspections] IDEA-288121 Disable spell-checking in Java date format patterns
GitOrigin-RevId: 420d6b71602992a963ea7bf68185b60480ed3dda
2023-04-20 16:09:09 +00:00
Mikhail Pyltsin
14f1d350a3 [java-inspections] IDEA-288121 Disable spell-checking in Java date format patterns
GitOrigin-RevId: 4d05d95a8df627cdffc7949afce77b821ae20346
2023-04-20 16:09:02 +00:00
Tagir Valeev
fca3c9d95c [java-analysis] Fix annotations for java.io.File (IDEA-316165)
GitOrigin-RevId: 1dfb1d40707212767116fc7dfea9473e6d80a8fb
2023-04-14 10:47:35 +00:00
Tagir Valeev
039f18ae61 [java-analysis] Annotate some methods from java.io.File as pure (IDEA-316165)
GitOrigin-RevId: 67fd7dbddcacc20d02089776ab713937f57ca7c3
2023-04-14 10:47:30 +00:00
Tagir Valeev
b4192f3376 [java-annotations] Contracts for Set.of/Map.of/List.of
GitOrigin-RevId: 6451b2c76236ffc052db73a76bffac678937be3f
2023-03-21 19:50:41 +00:00
Stefan Kranich
5b45313f5a Fix @Range annotations for OffsetDateTime.of
The second and third parameters of

    public static OffsetDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset)

are month and dayOfMonth respectively. Their ranges should be 1-12 and 1-31, not vice versa.

closes https://github.com/JetBrains/intellij-community/pull/2337

GitOrigin-RevId: a6e9bc2465d177220c8f5f4b5fb162dd2ad577ea
2023-03-01 12:43:27 +00:00
Alexey Kudravtsev
7a279cde28 notnull some swing methods
GitOrigin-RevId: 07b31df54906e62d6380c27b48291fe2d67c970f
2023-02-23 15:00:39 +00:00
Tagir Valeev
eedf57b793 [java-annotations] MouseInfo#getPointerInfo: unknown nullability
Since JBR 17.0.6, getPointerInfo was simplified and always returns non-null value which is inferred. However, in previous versions it could return null. To make the API stable, we will force UnknownNullability annotation

GitOrigin-RevId: 6c8776911bb9661c7e120c3c33995c322d441b57
2023-02-21 18:53:48 +00:00
Mikhail Pyltsin
be1a34935e IJ-CR-102511 [java-inspections] added new external annotations for java.time. Added pure annotations
GitOrigin-RevId: 3065fe19aca42b16a77eb2cb4f5aeb264826db19
2023-02-08 19:56:45 +00:00
Mikhail Pyltsin
8cbce9d471 [java-inspections] added new external annotations for java.time
GitOrigin-RevId: 951b8defbc6e82210ac07239a83c2066d2375819
2023-02-07 15:15:27 +00:00
Tagir Valeev
26e3be308e [jdk-annotations] IDEA-309980 Incorrect java contract for Boolean.logicalXor
GitOrigin-RevId: 290f5e31786fe8a683c052dc15ba65cda001187d
2023-01-09 14:57:10 +00:00
Alexey Kudravtsev
22eb86abd3 annotate with correct Event constants
GitOrigin-RevId: 375f75e3c38532f993422727ff366935a32609a8
2022-12-16 16:51:08 +00:00
pyltsin
561e2d81d0 [java-dfa] IDEA-300181 Report when the same stream is consumed more than once.
Co-authored-by: Tagir Valeev <tagir.valeev@jetbrains.com>

GitOrigin-RevId: 929f69d8e22285cae8906761df6b39ec46ce985c
2022-09-30 12:10:32 +00:00
Tagir Valeev
f8bd662378 [java-inspections] Mark standard collection constructors as pure
IDEA-299423 NPE false positive in static analysis involving collection emptiness check

GitOrigin-RevId: c15b5117e0c58ebbe5617d221db66ecf969f5204
2022-08-08 14:16:01 +00:00
pyltsin-m
105b015e65 [java-inspections] IDEA-299009 add new annotations for dates
GitOrigin-RevId: fc7e2e0076fa9666657272da64864a04373636a4
2022-08-02 18:40:28 +00:00
Tagir Valeev
72418bf470 [jdk-annotations] Remove NotNull from Node.getAttributes() (may legally return null)
Fixes IDEA-297812 org.w3c.dom.Node#getAttributes() is erroneous annotated as 'NotNull'

GitOrigin-RevId: ead3485f11991bab33358437c845995272a48b3f
2022-07-13 19:29:02 +00:00
Tagir Valeev
2aba234a85 [annotations] System.arraycopy mutation contract
GitOrigin-RevId: bb513f66a360f52fec85d3713d9447d368a96d3e
2022-06-28 09:42:06 +00:00
Tagir Valeev
340a56e8af [java-dfa] Optional.orElse parameter is nullable (IDEA-291604)
GitOrigin-RevId: 1f352520c9e231004f06b6724bba2e00d5377ff4
2022-04-22 10:22:42 +00:00
Tagir Valeev
d835f029d4 [jdk-annotations] Reformat XML
GitOrigin-RevId: 2dd72ef3be73e433513854e777bd75844d6f4879
2022-02-16 14:32:14 +00:00
Tagir Valeev
ad43f22e41 [jdk-annotations] Ranges for java.time APIs
Fixes IDEA-288868 Check date time parameters validness in java.time API

GitOrigin-RevId: bd2ceb20b19d84a082c7e1ad154665f63eeacc7a
2022-02-16 14:32:11 +00:00
Tagir Valeev
473f0998cc [annotations] Map.size() is pure
GitOrigin-RevId: d0fde0e37b70902281285eec890a1a3b73d0835a
2022-02-10 14:48:54 +00:00
Tagir Valeev
d2e2a474ad [java-dfa] First class support for Collection.removeIf()
Fixes IDEA-286737 Side-effects from removeIf predicate are not taken into account

GitOrigin-RevId: 6efc71f98d10824a288e4510a209da34ad381bbb
2022-01-18 15:44:01 +00:00
Bas Leijdekkers
fc0f9fd6fa Annotate JPassWordField.setText() argument as @NonNls
GitOrigin-RevId: a54363b3d51e566eff8e268e4f5f733f96720bdd
2021-12-14 08:32:51 +00:00
Ivan Semenov
e582c728e0 [jdk-annotations] do not allow nulls in StyleSheet.addStyleSheet and StyleSheet.removeStyleSheet
Adding null stylesheet throws NPE later when the rule is retrieved in StyleSheet.createResolvedStyle

This is not an issue in JBR, but it is in coretto, so debugging could be a huge pain

IJ-MR-17903

GitOrigin-RevId: 66efd3936c178903ff9dcd11594ecde115d29b3c
2021-11-29 15:01:30 +00:00
Alexey Kudravtsev
6f791ba57c annotate AbstractCollection.*All methods notnull to avoid warnings when override AbstractCollection and Collection at the same time
GitOrigin-RevId: 7f132298b9cfc3edee2ba881192f60bd7109bc0a
2021-11-06 23:39:49 +00:00
Tagir Valeev
05243fc065 Annotations for org.w3c.dom Node/Element
GitOrigin-RevId: b8d3d679f309d7dede6d72f35d3bf6e5d839e3fd
2021-09-27 14:15:55 +00:00
Tagir Valeev
528416102b [java-dfa] Support explanation for constructor contracts; ArrayBlockingQueueContract constructor contracts
GitOrigin-RevId: 641b8569630c8f22d0bfa806f3cd5a54c3290ba4
2021-09-14 15:25:04 +00:00
Tagir Valeev
4262da61f8 Annotate URL.toString and URI.toString as Nls (can be displayed in UI)
Fixes IDEA-271658 Hardcoded string false positive for toString() method

GitOrigin-RevId: 2eef86abf72d4b858b6443ae5eb8a200222f5b33
2021-08-17 10:37:48 +00:00
Tagir Valeev
f817697bce Objects.equals: annotate parameters as nullable (IDEA-273923)
GitOrigin-RevId: 9b52e441a0a08bae3562b4ae40e0cf59b2c3fc2d
2021-08-06 11:01:59 +00:00
Sergey Malenkov
51f94218c1 Fix I18nInspectionsTest for DefaultTreeUI.java and DialogWrapper.java
GitOrigin-RevId: e90e207039305c2e51a33d91915e6091bdedf414
2021-07-06 20:57:00 +00:00
Dmitry Jemerov
312dd6a347 Annotate propertyName parameter in firePropertyChange as @NonNls
GitOrigin-RevId: 3b0ffa106ee86f2d2c09d5549c65e91e98e95013
2021-06-30 16:56:13 +00:00
Tagir Valeev
0f0932c3f8 Thread.sleep parameter ranges (IDEA-271027)
GitOrigin-RevId: 51c7bdb5428f7dbcd57b8354357046fad0bc1a9c
2021-06-09 09:56:28 +00:00
Tagir Valeev
d39f35d50e Range for TreePath.getPathCount
GitOrigin-RevId: 4498ee4913c8ec32fb91d3f7ce3c8cc2bbd85cfa
2021-05-24 07:24:17 +00:00