Skip to content

Commit

Permalink
Update javadoc to make JDK8 and doclint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Hansche committed Jan 6, 2016
1 parent 4e6bc2c commit 6d7a5ce
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 164 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/*
* Copyright 2012 MeetMe, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.meetme.plugins.jira.gerrit.data;

import java.io.File;
import java.net.URI;

import com.atlassian.sal.api.pluginsettings.PluginSettings;
import com.atlassian.sal.api.pluginsettings.PluginSettingsFactory;

import java.io.File;
import java.net.URI;

/**
* {@link GerritConfiguration} implementation that uses {@link PluginSettings} to store
* configuration data.
*
* @author Joe Hansche <jhansche@meetme.com>
*
* @author Joe Hansche
*/
public class GerritConfigurationImpl implements GerritConfiguration {
private static final String PLUGIN_STORAGE_KEY = "com.meetme.plugins.jira.gerrit.data";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@
*/
package com.meetme.plugins.jira.gerrit.data;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import net.sf.json.JSONObject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.atlassian.core.user.preferences.Preferences;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.project.Project;
Expand All @@ -34,6 +22,18 @@
import com.sonyericsson.hudson.plugins.gerrit.gerritevents.ssh.Authentication;
import com.sonyericsson.hudson.plugins.gerrit.gerritevents.ssh.SshException;

import net.sf.json.JSONObject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class IssueReviewsImpl implements IssueReviewsManager {
private static final Logger log = LoggerFactory.getLogger(IssueReviewsImpl.class);

Expand Down Expand Up @@ -168,8 +168,8 @@ public TimedCache(final int capacity, final long expiration) {
/**
* Returns true if the requested key has expired from the cache.
*
* @param key
* @return
* @param key the key
* @return whether the associated value exists and has expired
*/
private boolean hasKeyExpired(Object key) {
if (timestamps.containsKey(key)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,70 +1,73 @@
/*
* Copyright 2012 MeetMe, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.meetme.plugins.jira.gerrit.data;

import java.io.IOException;
import java.util.List;

import net.sf.json.JSONObject;

import com.atlassian.core.user.preferences.Preferences;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.project.Project;
import com.meetme.plugins.jira.gerrit.data.dto.GerritChange;
import com.sonyericsson.hudson.plugins.gerrit.gerritevents.GerritQueryException;
import com.sonyericsson.hudson.plugins.gerrit.gerritevents.GerritQueryHandler;

import net.sf.json.JSONObject;

import java.io.IOException;
import java.util.List;

public interface IssueReviewsManager {

/**
* Gets all Gerrit reviews related to the {@link Issue#getKey() issue key}.
*
* @param issueKey
*
* @param issueKey the JIRA issue key
* @return A list of {@link JSONObject}s, as retrieved from Gerrit.
* @throws GerritQueryException If any failure occurs while querying the Gerrit server.
* @see GerritQueryHandler
*/
public abstract List<GerritChange> getReviewsForIssue(String issueKey) throws GerritQueryException;
List<GerritChange> getReviewsForIssue(String issueKey) throws GerritQueryException;

/**
* Gets all Gerrit reviews related to the {@link Project#getKey() project}.
*
* @param issueKey
*
* @param projectKey the JIRA Project key (i.e., {@code JIRA-123}'s projectKey would be {@code JIRA})
* @return A list of {@link JSONObject}s, as retrieved from Gerrit.
* @throws GerritQueryException If any failure occurs while querying the Gerrit server.
* @see GerritQueryHandler
*/
public abstract List<GerritChange> getReviewsForProject(String projectKey) throws GerritQueryException;
List<GerritChange> getReviewsForProject(String projectKey) throws GerritQueryException;

/**
* Performs an approval/review of a change.
*
* @param issueKey
* @param change
* @param args
* @throws IOException
*
* @param issueKey the JIRA issue key
* @param change the Gerrit change
* @param args arguments to add to the approval
* @param prefs the {@link Preferences} for the viewing user
* @return whether the approval was successful
* @throws IOException if so
*/
public abstract boolean doApproval(String issueKey, GerritChange change, String args, Preferences prefs) throws IOException;
boolean doApproval(String issueKey, GerritChange change, String args, Preferences prefs) throws IOException;

/**
* Performs approvals/reviews of all changes.
*
* @param issueKey
* @param change
* @param args
* @param prefs
* @throws IOException
*
* @param issueKey the JIRA issue key
* @param changes the set of Gerrit changes
* @param args arguments to add to each approval
* @param prefs the {@link Preferences} for the viewing user
* @return whether the approvals were successful
* @throws IOException if so
*/
public abstract boolean doApprovals(String issueKey, List<GerritChange> changes, String args, Preferences prefs) throws IOException;
boolean doApprovals(String issueKey, List<GerritChange> changes, String args, Preferences prefs) throws IOException;
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
/*
* Copyright 2012 MeetMe, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.meetme.plugins.jira.gerrit.data.dto;

import static com.meetme.plugins.jira.gerrit.tabpanel.GerritEventKeys.BY;
import static com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.GerritEventKeys.EMAIL;
import static com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.GerritEventKeys.NAME;
import com.atlassian.crowd.embedded.api.User;
import com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.attr.Approval;

import net.sf.json.JSONObject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.atlassian.crowd.embedded.api.User;
import com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.attr.Approval;
import static com.meetme.plugins.jira.gerrit.tabpanel.GerritEventKeys.BY;
import static com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.GerritEventKeys.EMAIL;
import static com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.GerritEventKeys.NAME;

public class GerritApproval extends Approval implements Comparable<GerritApproval> {
private static final Logger log = LoggerFactory.getLogger(GerritApproval.class);
Expand All @@ -40,8 +41,8 @@ public GerritApproval() {

/**
* Creates the PatchSetApproval from a {@link JSONObject}.
*
* @param json
*
* @param json the JSON object with corresponding data.
*/
public GerritApproval(JSONObject json) {
super(json);
Expand Down Expand Up @@ -93,7 +94,7 @@ public static String getUpgradedLabelType(String type) {

/**
* Returns the approver's name.
*
*
* @return Approver's name as a string.
*/
public String getBy() {
Expand All @@ -102,7 +103,7 @@ public String getBy() {

/**
* Sets the approver's name.
*
*
* @param by Approver's name
*/
public void setBy(String by) {
Expand All @@ -111,8 +112,8 @@ public void setBy(String by) {

/**
* Returns the approval score as an integer.
*
* @return
*
* @return the integer approval score
*/
public int getValueAsInt() {
String value = getValue();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
/*
* Copyright 2012 MeetMe, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.meetme.plugins.jira.gerrit.data.dto;

import static com.meetme.plugins.jira.gerrit.tabpanel.GerritEventKeys.LAST_UPDATED;

import java.util.Date;
import com.meetme.plugins.jira.gerrit.tabpanel.GerritEventKeys;
import com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.attr.Change;

import net.sf.json.JSONObject;

import com.meetme.plugins.jira.gerrit.tabpanel.GerritEventKeys;
import com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.attr.Change;
import java.util.Date;

import static com.meetme.plugins.jira.gerrit.tabpanel.GerritEventKeys.LAST_UPDATED;

/**
* @author Joe Hansche
*/
public class GerritChange extends Change implements Comparable<GerritChange> {

/**
* Gerrit review status enumeration, corresponding to the status string in the Gerrit change
* payload.
*
* @author Joe Hansche <jhansche@meetme.com>
*/
public static enum Status
{
Expand All @@ -53,7 +54,7 @@ public GerritChange(JSONObject obj) {

/**
* Sorts {@link GerritChange}s in order by their Gerrit change number.
*
*
* TODO: To be completely accurate, the changes should impose a dependency-tree ordering (via
* <tt>--dependencies</tt> option) to GerritQuery! It is possible for an earlier ChangeId to be
* refactored such that it is then dependent on a <i>later</i> change!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Extension of {@link com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.GerritEventKeys
* sonyericsson.GerritEventKeys} to provide additional missing keys.
*
* @author jhansche
* @author Joe Hansche
*/
public interface GerritEventKeys {
public static final String APPROVALS = "approvals";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
/*
* Copyright 2012 MeetMe, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.meetme.plugins.jira.gerrit.tabpanel;

import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;

import com.atlassian.core.util.map.EasyMap;
import com.atlassian.jira.plugin.issuetabpanel.AbstractIssueAction;
import com.atlassian.jira.plugin.issuetabpanel.IssueAction;
Expand All @@ -27,6 +21,12 @@
import com.meetme.plugins.jira.gerrit.data.dto.GerritApproval;
import com.meetme.plugins.jira.gerrit.data.dto.GerritChange;

import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;

public class GerritReviewIssueAction extends AbstractIssueAction implements IssueAction {
private String baseUrl;
private GerritChange change;
Expand Down Expand Up @@ -69,9 +69,9 @@ public boolean isDisplayActionAllTab() {

/**
* Returns the lowest score below 0 if available; otherwise the highest score above 0.
*
* @param approvals
* @return
*
* @param approvals the approvals found on the Gerrit review
* @return the approval that is deemed the "most significant"
* @deprecated This functionality can now be found in the velocity template
*/
@Deprecated
Expand Down
Loading

0 comments on commit 6d7a5ce

Please sign in to comment.