Skip to content

Cleanup names and enforce naming conventions #2084

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

Merged
merged 6 commits into from
Apr 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Maven Install (skipTests)
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean install -DskipTests --file pom.xml
run: mvn -B clean install -Djapicmp.skip=true -DskipTests --file pom.xml
- uses: actions/upload-artifact@v4
with:
name: maven-target-directory
Expand All @@ -59,7 +59,7 @@ jobs:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
# running install site seems to more closely imitate real site deployment,
# more likely to prevent failed deployment
run: mvn -B clean install site -DskipTests --file pom.xml
run: mvn -B clean install site -Djapicmp.skip=true -DskipTests --file pom.xml
test-bridged:
name: build-and-test Bridged (Java 17)
# Does not require build output, but orders execution to prevent launching test workflows when simple build fails
Expand All @@ -78,7 +78,8 @@ jobs:
- name: Maven Install (skipTests)
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean install -Pbridged -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
#skipping japicmp check for bridged artifact until after next release
run: mvn -B clean install -Djapicmp.skip=true -Pbridged -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
test:
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
# Does not require build output, but orders execution to prevent launching test workflows when simple build fails
Expand Down Expand Up @@ -107,7 +108,8 @@ jobs:
if: matrix.os != 'windows'
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean install -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
# Disable japicmp until next release
run: mvn -B clean install -Djapicmp.skip=true -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
- name: Save coverage data
if: matrix.os == 'ubuntu' && matrix.java == '17'
uses: actions/upload-artifact@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish_release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Maven Install and Site with Code Coverage
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B clean install site -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
run: mvn -B clean install site -Djapicmp.skip=true -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"

- uses: actions/upload-artifact@v4
with:
Expand All @@ -49,15 +49,15 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish package
run: mvn -B clean deploy -DskipTests -Prelease
run: mvn -B clean deploy -Djapicmp.skip=true -DskipTests -Prelease
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }}

- name: Publish package with bridge methods
run: mvn -B clean deploy -DskipTests -Prelease -Pbridged
run: mvn -B clean deploy -Djapicmp.skip=true -DskipTests -Prelease -Pbridged
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
MAVEN_USERNAME: ${{ secrets.OSSRH_TOKEN_USERNAME }}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHAppInstallationToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public GHAppInstallationToken() {
private String token;

/** The expires at. */
protected String expires_at;
protected String expiresAt;
private Map<String, String> permissions;
private List<GHRepository> repositories;
private GHRepositorySelection repositorySelection;
Expand Down Expand Up @@ -71,6 +71,6 @@ public GHRepositorySelection getRepositorySelection() {
*/
@WithBridgeMethods(value = Date.class, adapterMethod = "instantToDate")
public Instant getExpiresAt() {
return GitHubClient.parseInstant(expires_at);
return GitHubClient.parseInstant(expiresAt);
}
}
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHAppInstallationsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Represents the one page of GHAppInstallations.
*/
class GHAppInstallationsPage {
private int total_count;
private int totalCount;
private GHAppInstallation[] installations;

/**
Expand All @@ -14,7 +14,7 @@
* @return the total count
*/
public int getTotalCount() {
return total_count;
return totalCount;

Check warning on line 17 in src/main/java/org/kohsuke/github/GHAppInstallationsPage.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/kohsuke/github/GHAppInstallationsPage.java#L17

Added line #L17 was not covered by tests
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/kohsuke/github/GHArtifactsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
class GHArtifactsPage {
private int total_count;
private int totalCount;
private GHArtifact[] artifacts;

/**
Expand All @@ -18,7 +18,7 @@
* @return the total count
*/
public int getTotalCount() {
return total_count;
return totalCount;

Check warning on line 21 in src/main/java/org/kohsuke/github/GHArtifactsPage.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/kohsuke/github/GHArtifactsPage.java#L21

Added line #L21 was not covered by tests
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/kohsuke/github/GHAsset.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
private String name;
private String label;
private String state;
private String content_type;
private String contentType;
private long size;
private long download_count;
private String browser_download_url;
private long downloadCount;
private String browserDownloadUrl;

/**
* Gets content type.
*
* @return the content type
*/
public String getContentType() {
return content_type;
return contentType;
}

/**
Expand All @@ -47,7 +47,7 @@
*/
public void setContentType(String contentType) throws IOException {
edit("content_type", contentType);
this.content_type = contentType;
this.contentType = contentType;

Check warning on line 50 in src/main/java/org/kohsuke/github/GHAsset.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/kohsuke/github/GHAsset.java#L50

Added line #L50 was not covered by tests
}

/**
Expand All @@ -56,7 +56,7 @@
* @return the download count
*/
public long getDownloadCount() {
return download_count;
return downloadCount;
}

/**
Expand Down Expand Up @@ -124,7 +124,7 @@
* @return the browser download url
*/
public String getBrowserDownloadUrl() {
return browser_download_url;
return browserDownloadUrl;
}

private void edit(String key, Object value) throws IOException {
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/kohsuke/github/GHAuthorization.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ public GHAuthorization() {

private List<String> scopes;
private String token;
private String token_last_eight;
private String hashed_token;
private String tokenLastEight;
private String hashedToken;
private App app;
private String note;
private String note_url;
private String noteUrl;
private String fingerprint;
// TODO add some user class for https://developer.github.com/v3/oauth_authorizations/#check-an-authorization ?
// private GHUser user;
Expand Down Expand Up @@ -112,7 +112,7 @@ public String getToken() {
* @return the token last eight
*/
public String getTokenLastEight() {
return token_last_eight;
return tokenLastEight;
}

/**
Expand All @@ -121,7 +121,7 @@ public String getTokenLastEight() {
* @return the hashed token
*/
public String getHashedToken() {
return hashed_token;
return hashedToken;
}

/**
Expand Down Expand Up @@ -157,7 +157,7 @@ public String getNote() {
* @return the note url
*/
public URL getNoteUrl() {
return GitHubClient.parseURL(note_url);
return GitHubClient.parseURL(noteUrl);
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/kohsuke/github/GHAutolink.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
public class GHAutolink {

private int id;
private String key_prefix;
private String url_template;
private boolean is_alphanumeric;
private String keyPrefix;
private String urlTemplate;
private boolean isAlphanumeric;
private GHRepository owner;

/**
Expand All @@ -41,7 +41,7 @@ public int getId() {
* @return the key prefix string
*/
public String getKeyPrefix() {
return key_prefix;
return keyPrefix;
}

/**
Expand All @@ -50,7 +50,7 @@ public String getKeyPrefix() {
* @return the URL template string
*/
public String getUrlTemplate() {
return url_template;
return urlTemplate;
}

/**
Expand All @@ -59,7 +59,7 @@ public String getUrlTemplate() {
* @return true if alphanumeric, false otherwise
*/
public boolean isAlphanumeric() {
return is_alphanumeric;
return isAlphanumeric;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/kohsuke/github/GHBranch.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class GHBranch extends GitHubInteractiveObject {
private Commit commit;
@JsonProperty("protected")
private boolean protection;
private String protection_url;
private String protectionUrl;

/**
* Instantiates a new GH branch.
Expand Down Expand Up @@ -94,7 +94,7 @@ public boolean isProtected() {
* @return API URL that deals with the protection of this branch.
*/
public URL getProtectionUrl() {
return GitHubClient.parseURL(protection_url);
return GitHubClient.parseURL(protectionUrl);
}

/**
Expand All @@ -105,7 +105,7 @@ public URL getProtectionUrl() {
* the io exception
*/
public GHBranchProtection getProtection() throws IOException {
return root().createRequest().setRawUrlPath(protection_url).fetch(GHBranchProtection.class);
return root().createRequest().setRawUrlPath(protectionUrl).fetch(GHBranchProtection.class);
}

/**
Expand All @@ -124,7 +124,7 @@ public String getSHA1() {
* if disabling protection fails
*/
public void disableProtection() throws IOException {
root().createRequest().method("DELETE").setRawUrlPath(protection_url).send();
root().createRequest().method("DELETE").setRawUrlPath(protectionUrl).send();
}

/**
Expand Down
28 changes: 14 additions & 14 deletions src/main/java/org/kohsuke/github/GHCheckRunBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,14 @@
public static final class Annotation {

private final String path;
private final int start_line;
private final int end_line;
private final String annotation_level;
private final int startLine;
private final int endLine;
private final String annotationLevel;
private final String message;
private Integer start_column;
private Integer end_column;
private Integer startColumn;
private Integer endColumn;
private String title;
private String raw_details;
private String rawDetails;

/**
* Instantiates a new annotation.
Expand Down Expand Up @@ -411,9 +411,9 @@
@NonNull GHCheckRun.AnnotationLevel annotationLevel,
@NonNull String message) {
this.path = path;
start_line = startLine;
end_line = endLine;
annotation_level = annotationLevel.toString().toLowerCase(Locale.ROOT);
this.startLine = startLine;
this.endLine = endLine;
this.annotationLevel = annotationLevel.toString().toLowerCase(Locale.ROOT);
this.message = message;
}

Expand All @@ -425,7 +425,7 @@
* @return the annotation
*/
public @NonNull Annotation withStartColumn(@CheckForNull Integer startColumn) {
start_column = startColumn;
this.startColumn = startColumn;

Check warning on line 428 in src/main/java/org/kohsuke/github/GHCheckRunBuilder.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/kohsuke/github/GHCheckRunBuilder.java#L428

Added line #L428 was not covered by tests
return this;
}

Expand All @@ -437,7 +437,7 @@
* @return the annotation
*/
public @NonNull Annotation withEndColumn(@CheckForNull Integer endColumn) {
end_column = endColumn;
this.endColumn = endColumn;

Check warning on line 440 in src/main/java/org/kohsuke/github/GHCheckRunBuilder.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/kohsuke/github/GHCheckRunBuilder.java#L440

Added line #L440 was not covered by tests
return this;
}

Expand All @@ -461,7 +461,7 @@
* @return the annotation
*/
public @NonNull Annotation withRawDetails(@CheckForNull String rawDetails) {
raw_details = rawDetails;
this.rawDetails = rawDetails;

Check warning on line 464 in src/main/java/org/kohsuke/github/GHCheckRunBuilder.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/kohsuke/github/GHCheckRunBuilder.java#L464

Added line #L464 was not covered by tests
return this;
}

Expand All @@ -476,7 +476,7 @@
public static final class Image {

private final String alt;
private final String image_url;
private final String imageUrl;
private String caption;

/**
Expand All @@ -489,7 +489,7 @@
*/
public Image(@NonNull String alt, @NonNull String imageURL) {
this.alt = alt;
image_url = imageURL;
this.imageUrl = imageURL;
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/kohsuke/github/GHCheckRunsPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
class GHCheckRunsPage {
private int total_count;
private GHCheckRun[] check_runs;
private int totalCount;
private GHCheckRun[] checkRuns;

/**
* Gets the total count.
*
* @return the total count
*/
public int getTotalCount() {
return total_count;
return totalCount;

Check warning on line 21 in src/main/java/org/kohsuke/github/GHCheckRunsPage.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/kohsuke/github/GHCheckRunsPage.java#L21

Added line #L21 was not covered by tests
}

/**
Expand All @@ -29,9 +29,9 @@
* @return the check runs
*/
GHCheckRun[] getCheckRuns(GHRepository owner) {
for (GHCheckRun check_run : check_runs) {
check_run.wrap(owner);
for (GHCheckRun checkRun : checkRuns) {
checkRun.wrap(owner);
}
return check_runs;
return checkRuns;
}
}
Loading