Commit 6ae0045
committed
Prefer ID for hasTrait lookups
This commit updates all calls to `hasTrait` from using Class based
lookups to use ID based lookups. Traits are stored on a Shape in a
ShapeId-keyed map. Using this will be faster than testing values
via `isInstance`.
The lookup for `hasTrait(ShapeId)` is also updated to do a simple
`containsKey` check on the map. This eliminates using `findTrait`
which creates an intermediate `Optional` only to throw it away.1 parent d251381 commit 6ae0045
File tree
158 files changed
+558
-441
lines changed- buildSrc/src/main/kotlin
- smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi
- smithy-aws-cloudformation-traits/src
- main/java/software/amazon/smithy/aws/cloudformation/traits
- test/java/software/amazon/smithy/aws/cloudformation/traits
- smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy
- mappers
- smithy-aws-iam-traits/src
- main/java/software/amazon/smithy/aws/iam/traits
- test/java/software/amazon/smithy/aws/iam/traits
- smithy-aws-traits/src
- main/java/software/amazon/smithy/aws/traits
- clientendpointdiscovery
- tagging
- test/java/software/amazon/smithy/aws/traits/clientendpointdiscovery
- smithy-build/src/main/java/software/amazon/smithy/build/transforms
- smithy-cli/src/main/java/software/amazon/smithy/cli/commands
- smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed
- smithy-diff/src
- main/java/software/amazon/smithy/diff/evaluators
- test/java/software/amazon/smithy/diff/evaluators
- smithy-docgen/src/main/java/software/amazon/smithy/docgen
- generators
- interceptors
- smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema
- smithy-linters/src/main/java/software/amazon/smithy/linters
- smithy-model/src
- jmh/java/software/amazon/smithy/model/jmh
- main/java/software/amazon/smithy/model
- knowledge
- loader
- neighbor
- shapes
- transform
- plugins
- validation
- node
- suppressions
- validators
- test/java/software/amazon/smithy/model
- loader
- shapes
- transform
- smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits
- validators
- smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy
- protocols
- smithy-rules-engine/src
- main/java/software/amazon/smithy/rulesengine
- analysis
- validators
- test/java/software/amazon/smithy/rulesengine/traits
- smithy-smoke-test-traits/src/main/java/software/amazon/smithy/smoketests/traits
- smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen
- generators
- integrations
- annotations
- core
- idref
- javadoc
- smithy-waiters/src/main/java/software/amazon/smithy/waiters
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
158 files changed
+558
-441
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
| 80 | + | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
| 177 | + | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments