Skip to content
Open
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
2 changes: 1 addition & 1 deletion git-hook/src/com/verigreen/hook/BranchOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private VerigreenNeeded checkIfVerigreenNeeded(
String newrev,
String committer) {

VerigreenNeeded ret = null;
VerigreenNeeded ret;
String vgBranchName = VerigreenUtils.getVerigreenBranchName(newrev);
try {
RestClientResponse clientResponse =
Expand Down
14 changes: 7 additions & 7 deletions verigreen-collector-api/src/com/verigreen/jgit/JGitOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void setEmail_Address(String email_Address) {
@Override
public String createBranch(String commitId, String branchName) {

Ref result = null;
Ref result;
CreateBranchCommand branchCreate = _git.branchCreate();
branchCreate.setName(branchName);
branchCreate.setStartPoint(commitId);
Expand All @@ -114,7 +114,7 @@ public String createBranch(String commitId, String branchName) {

public RevCommit getRevCommit(String commitId) {

RevCommit ret = null;
RevCommit ret;
RevWalk walk = new RevWalk(_repo);
try {
ret = walk.parseCommit(_repo.resolve(commitId));
Expand All @@ -129,7 +129,7 @@ public RevCommit getRevCommit(String commitId) {

public Ref getRef(String ref) {

Ref ans = null;
Ref ans;
try {
ans = _repo.getRef(ref);
} catch (Throwable e) {
Expand All @@ -145,7 +145,7 @@ public String fetch(String localBranchName, String remoteBranchName) {
RefSpec spec = new RefSpec().setSourceDestination(localBranchName, remoteBranchName);
FetchCommand command = _git.fetch();
command.setRefSpecs(spec);
FetchResult result = null;
FetchResult result;
try {
result = command.call();
} catch (Throwable e) {
Expand Down Expand Up @@ -181,7 +181,7 @@ public String checkout(
if (useBranchNameAsStartPoint) {
command.setStartPoint(REFS_REMOTES + branchName);
}
Ref ref = null;
Ref ref;
try {
ref = command.call();
} catch (Throwable e) {
Expand All @@ -203,7 +203,7 @@ public String checkout(String branchName, boolean createBranchIfNotExists, boole
public boolean rebase(String upStreamBranchName) {

RebaseCommand command = _git.rebase();
RebaseResult result = null;
RebaseResult result;
try {
command.setUpstream(upStreamBranchName);
result = command.call();
Expand Down Expand Up @@ -385,7 +385,7 @@ public void add(String itemToAdd) {
@Override
public String commit(String author, String email, String message) {

RevCommit revCommit = null;
RevCommit revCommit;
CommitCommand command = _git.commit();
command.setCommitter(author, email);
command.setMessage(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public static void triggerJob(CommitItem commitItem) {

public static String getBuildUrl(int buildNumber) {

String buildUrl = null;
String buildUrl;
buildUrl = job2Verify.getUrl()+Integer.toString(buildNumber)+"/";

return buildUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void notifyCommiter(
String protectedBranch,
String parentCommitId,
String tempBranch){
String link = "";
String link;

StringBuilder status =
new StringBuilder();
Expand Down Expand Up @@ -195,7 +195,7 @@ protected void send(String subject, String messageText, String[] recipients, Str
}
}
private String checkVerificationStatus(VerificationStatus result){
String property = "";
String property;
String link = "";
if(_offlineMode.equals("false"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private VerigreenNeededLogic(String protectedBranches, String permittedUsers, St

@SuppressWarnings("unchecked")
private void getHistory() throws IOException {
StringBuilder stringBuilder = null;
StringBuilder stringBuilder;
JSONArray keyValues;
List<JSONObject> values;
if (!new File(historyJsonPath).exists()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Watchdir implements Runnable{

@Override
public void run() {
FileReader reader = null;
FileReader reader;
Properties properties = new Properties();

for(;;){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ProtectedBranchesDecisionMaker {
public Collection<List<Decision>> decide() {

Collection<List<Decision>> ret = new ArrayList<>();
CommitItem item = null;
CommitItem item;
try {
ArrayList<CommitItem> notStarted = new ArrayList<CommitItem>(CommitItemUtils.filterItems(CommitItemUtils.getNotDone(), VerificationStatus.NOT_STARTED));
Collection<CommitItem> notDone = CommitItemUtils.getNotDone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ private void deleteBranches() {

private List <String> branchesToBeDelete(List <String> branchesList){
List<String> result = new ArrayList<String>();
Repository repo = null;
Repository repo;
Map<String, List <String>> branchesMap = new HashMap<String, List <String>>();
for (String branch : branchesList) {
List<String> values = null;
List<String> values;
if (!branchesMap.containsKey(branch.subSequence(0, 10))){
values = new ArrayList<String>();
values.add(branch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private Map<String, MinJenkinsJob> parsingJSON(String json) throws JSONException
JsonParser parser = new JsonParser();
JsonObject mainJson = (JsonObject) parser.parse(json);

JsonObject parameterJsonObjectArray = null;
JsonObject parameterJsonObjectArray;

JsonArray jsonBuildsArray = mainJson.getAsJsonArray("builds");
for (int i = 0; i < jsonBuildsArray.size(); i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class BranchResource {


public Response post(BranchDescriptor branch, @QueryParam("password") String password) {
CommitItem commitItem = null;
CommitItem commitItem;
if (password == null || password.isEmpty()){
commitItem = findCommitItem(branch);
if (commitItem == null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Response get(
@QueryParam("branchId") final String branchId,
@QueryParam("commitId") final String commitId) {

Response ret = null;
Response ret;
if ((protectedBranch == null) && (branchId == null)) {
ret = getAllCommits();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ public void changeConfigFileRepositoryPath(String repo) throws IOException

BufferedReader reader = new BufferedReader(new InputStreamReader(input));
StringBuilder out = new StringBuilder();
String line, row = null;
String line, row;
while ((line = reader.readLine()) != null) {
row = line.toString();
if(line.toString().contains("git.repositoryLocation")){
Expand Down Expand Up @@ -810,7 +810,7 @@ public void changeConfigFileJobName(String job) throws IOException

BufferedReader reader = new BufferedReader(new InputStreamReader(input));
StringBuilder out = new StringBuilder();
String line, row = null;
String line, row;
while ((line = reader.readLine()) != null) {
row = line.toString();
if(line.toString().contains("jenkins.jobName")){
Expand Down Expand Up @@ -1225,7 +1225,7 @@ public void testCommiterNameChangesInRT() throws IOException, InterruptedExcepti
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
StringBuilder out = new StringBuilder();
StringBuilder outOriginal = new StringBuilder();
String line, row = null;
String line, row;
while ((line = reader.readLine()) != null) {
row = line.toString();
outOriginal.append(row + "\n");
Expand Down Expand Up @@ -1284,7 +1284,7 @@ public void testProtectedBranchesChangesInRT() throws IOException, InterruptedEx
BufferedReader reader = new BufferedReader(new InputStreamReader(input));
StringBuilder out = new StringBuilder();
StringBuilder outOriginal = new StringBuilder();
String line, row = null;
String line, row;
while ((line = reader.readLine()) != null) {
row = line.toString();
outOriginal.append(row + "\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public TEQCommandParameters deserialize(String params) {

private Class<? extends TEQCommandParameters> getParamsClass(String[] split) {

Class<? extends TEQCommandParameters> paramsClass = null;
Class<? extends TEQCommandParameters> paramsClass;
try {
paramsClass = RuntimeUtils.cast(Class.forName(split[0]));
} catch (ClassNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ private static void readDirectoryEntries(URL location, Map<String, URL> resource
private static void readJarEntries(URL location, String basePath, Map<String, URL> resources)
throws IOException {
JarURLConnection conn = (JarURLConnection) location.openConnection();
JarFile jarfile = null;
JarFile jarfile;
jarfile = conn.getJarFile();

Enumeration<JarEntry> entries = jarfile.entries();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static <T> boolean isEquals(T x, T y) {

private static boolean isObjEquals(Object x, Object y) {

boolean ret = false;
boolean ret;
if (x == null) {
if (y == null) {
ret = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void setAuthentcation(String userName, String password) {
private void checkResponse(javax.ws.rs.core.Response response) throws RestClientException {

if (response.getStatusInfo().getFamily() != Family.SUCCESSFUL) {
String responseStr = "";
String responseStr;
try (Scanner scanner =
new Scanner((InputStream) response.getEntity(), CharEncoding.UTF_8)) {
responseStr = scanner.useDelimiter("\\A").next();
Expand Down