• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

smartsheet / smartsheet-java-sdk / #44

25 Aug 2023 05:39PM UTC coverage: 50.55% (+0.1%) from 50.427%
#44

push

github-actions

web-flow
Fix remaining Checkstyle violations and Enable Checkstyle (#58)

* Fix remaining Checkstyle violations and Enable Checkstyle

We are now down to `20` checkstyle violations in main and `0` violations in test.

The remaining 20 violations are not trivial to fix, so I've set checkstyle to allow those 20 violations to exist, but to fail the build if we ever exceed 20 violations. This should make the build fail if any new violations are added.

For tests, we do not allow _any_ violations. This means adding a single violation will fail the build. Once the 20 violations in main are cleaned up, we can make main and test have the same config.

Note: This MR also changes our PR pipeline to run `./gradlew clean build` instead of `./gradlew clean test`. The reason for this is that build runs all the tests and performs all the other checks (such as checkstyle), whereas `test` didn't run checkstyle and we wouldn't have noticed violations until we tried to deploy.

148 of 148 new or added lines in 24 files covered. (100.0%)

3448 of 6821 relevant lines covered (50.55%)

0.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/smartsheet/api/internal/json/CellLinkSerializer.java
1
package com.smartsheet.api.internal.json;
2

3
/*
4
 * #[license]
5
 * Smartsheet Java SDK
6
 * %%
7
 * Copyright (C) 2023 Smartsheet
8
 * %%
9
 * Licensed under the Apache License, Version 2.0 (the "License");
10
 * you may not use this file except in compliance with the License.
11
 * You may obtain a copy of the License at
12
 *
13
 *      http://www.apache.org/licenses/LICENSE-2.0
14
 *
15
 * Unless required by applicable law or agreed to in writing, software
16
 * distributed under the License is distributed on an "AS IS" BASIS,
17
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
 * See the License for the specific language governing permissions and
19
 * limitations under the License.
20
 * %[license]
21
 */
22

23
import com.fasterxml.jackson.core.JsonGenerator;
24
import com.fasterxml.jackson.databind.JsonSerializer;
25
import com.fasterxml.jackson.databind.SerializerProvider;
26
import com.smartsheet.api.internal.util.Util;
27
import com.smartsheet.api.models.CellLink;
28

29
import java.io.IOException;
30

31
public class CellLinkSerializer extends JsonSerializer<CellLink> {
32

33
    private final com.fasterxml.jackson.databind.JsonSerializer<Object> defaultSerializer;
34

35
    /**
36
     * Constructor
37
     */
38
    public CellLinkSerializer(JsonSerializer<Object> defaultSerializer) {
×
39
        Util.throwIfNull(defaultSerializer);
×
40
        this.defaultSerializer = defaultSerializer;
×
41
    }
×
42

43
    @Override
44
    public void serialize(CellLink cellLink, JsonGenerator gen, SerializerProvider serializers)
45
            throws IOException {
46

47
        if (cellLink.isNull()) {
×
48
            gen.writeNull();
×
49
        } else {
50
            defaultSerializer.serialize(cellLink, gen, serializers);
×
51
        }
52
    }
×
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc