Skip to content

Commit a1c634b

Browse files
committed
Fix javadoc and suppress false-positive sonar warnings
1 parent 6a457bd commit a1c634b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/main/java/com/kobylynskyi/graphql/codegen/mapper/ValueMapper.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,20 @@ private static String mapBoolean(BooleanValue value) {
3939
return value.isValue() ? "true" : "false";
4040
}
4141

42-
//TODO It should also be abstracted. Different languages have different default values(It is now implemented in
43-
// templates (templates are extremely complex))
42+
/**
43+
* Map value of GraphQL Int type to a value that will be present in a generated code.
44+
* TODO: should also be abstracted because different languages have different default values
45+
*
46+
* @param mappingContext Global mapping context
47+
* @param value GraphQL Value
48+
* @param graphQLType GraphQL Type
49+
* @return formatted value
50+
*/
4451
private static String mapInt(MappingContext mappingContext, IntValue value, Type<?> graphQLType) {
45-
//default java basic type is `int`. so, default value like 123 that must wrap or append suffix `L` when it be
52+
// default java basic type is `int`. so, default value like 123 that must wrap or append suffix `L` when it be
4653
// defined as `int` in graphql schema.
47-
//`int` cannot assign to `Long`, also `double` cannot assign to `Float`, but graphql Float default mapping is
48-
// Double in java, so, not modify `mapFloat`.
54+
// `int` cannot assign to `Long`, also `double` cannot assign to `Float`, but graphql Float default mapping is
55+
// Double in java, so, not modify `mapFloat`.
4956
if (graphQLType instanceof TypeName) {
5057
String customType = mappingContext.getCustomTypesMapping().get("Long");
5158
String typeName = ((TypeName) graphQLType).getName();

src/main/java/com/kobylynskyi/graphql/codegen/model/MultiLanguageDeprecated.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ private MultiLanguageDeprecated() {
2424
* @param directive GraphQL @deprecated directive
2525
* @return a definition of a deprecation having reason and annotation
2626
*/
27+
@SuppressWarnings({"java:S1133", "java:S1123"}) // sonar treats this is a deprecated method
2728
public static DeprecatedDefinition getLanguageDeprecated(GeneratedLanguage generatedLanguage, Directive directive) {
2829
String msg = null;
2930
if (directive.getArguments().stream().anyMatch(argument -> argument.getName().equals(REASON))) {

0 commit comments

Comments
 (0)