-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #986 #1072
base: main
Are you sure you want to change the base?
Fix #986 #1072
Commits on Nov 9, 2024
-
Adds files generated during test execution to .gitignore
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 7a51c27 - Browse repository at this point
Copy the full SHA 7a51c27View commit details -
Adds test in SettingsTest to confirm the issue
of ignoring nested generic type arguments. Considering a class such as List<List<Double>>, the generic type argument is List<Double>, but it was being parsed as List. - Adds toString(), equals() and hashCode() to Settings.GenericName inner class to make tests easier. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 909fb17 - Browse repository at this point
Copy the full SHA 909fb17View commit details -
Use Assertions static import to simplify code Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 8ca83d2 - Browse repository at this point
Copy the full SHA 8ca83d2View commit details -
Add SettingsTest.testLoadPrimitiveOrRegularClass
- Makes Settings.loadPrimitiveOrRegularClass protected to allow it to be tested Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 5a15007 - Browse repository at this point
Copy the full SHA 5a15007View commit details -
Adds new tests to CustomTypeMappingTest to confirm the issue
of ignoring the generic type argument and mapping every type that matches the raw class name to the mapped type. For instance, if we configure the plugin to map List<BigDecimal> to number[], it will map every List attribute to the target type. Even a List<String> will be mapped to number[] in this example. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for a209962 - Browse repository at this point
Copy the full SHA a209962View commit details -
Stores an empty list by default in Settings.GenericName.typeParameter…
…s instead of null - Storing null required always checking that to avoid NullPointerException, making the code dirty. - Replacing the value by an empty list removes those checks and makes it easier to implement the fix for the current issue. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e3f46d4 - Browse repository at this point
Copy the full SHA e3f46d4View commit details -
Updates the regex in Settings.parseGenericName
That enables the correct parse of nested generic type arguments. If we have a type such as Class<T1<T2>, T3>, type arguments won't be parsed as T1 and T3 anymore, but as T1<T2> and T3. The Class[T1[T2], T3] syntax also works. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for bc9f2e1 - Browse repository at this point
Copy the full SHA bc9f2e1View commit details -
Fix the issue of custom type mapping not loading a class that has gen…
…eric type arguments The classLoader.loadClass() method requires the raw class name to find the class to load (that is the class name without the generic type arguments). The Settings.loadPrimitiveOrRegularClass now removes the generic parameters from the class name to load the class correctly. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 125ec31 - Browse repository at this point
Copy the full SHA 125ec31View commit details -
Fix the issue in CustomMappingTypeProcessor that was mapping every ty…
…pe that matches the class raw name, ignoring the generic parameters - If we had a mapping List<BigInteger>:number[], every kind of list was being mapped to number[], even List<String> and any other kind of list. - Update the CustomMappingTypeProcessor.processType() to filter by the generic type arguments after checking the raw class name, to confirm the exact type (such as List<BigInteger> instead of just List) before mapping. - The previous change in the default value of Settings.GenericName.typeParameters to an empty list makes the filter easier and NPE-safe. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 79f83da - Browse repository at this point
Copy the full SHA 79f83daView commit details -
Update the ModelCompiler.isValidIdentifierPart() to include more vali…
…d chars Since now the class CustomMappingTypeProcessor correctly extracts each generic type argument (even nested ones), a generic type can have some special chars. For instance, in a type such as java.util.List<java.util.List<String>>, the generic type argument is java.util.List<String>, which has the characters: . < > Previously, the class was indicating this as an invalid identifier for the type. But this is a valid one, even for Java or TypeScript. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 3f9878c - Browse repository at this point
Copy the full SHA 3f9878cView commit details -
Refactor GenericsResolverTest add Assertions static import to make te…
…st simpler. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 1540086 - Browse repository at this point
Copy the full SHA 1540086View commit details -
Add tests for the new GenericsResolver.typeParameterNameList but I do…
…n't know how to make the test work yet. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for a5b6c3b - Browse repository at this point
Copy the full SHA a5b6c3bView commit details -
Update Settings.loadPrimitiveOrRegularClass comment
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e5f5404 - Browse repository at this point
Copy the full SHA e5f5404View commit details -
Update Settings.loadPrimitiveOrRegularClass to use positive condition
It doen't change behaviour. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 06f534f - Browse repository at this point
Copy the full SHA 06f534fView commit details