Make InvalidRevisionException a static class of CreateBranch

CreateBranch is the only place that InvalidRevisionException is
used.

Make it a private static class in GetBranch, and remove the now
unused one from gerrit.common.errors.

Change-Id: I29e412b8f11117a76cb325baab0ef1f08c86786f
This commit is contained in:
David Pursehouse
2016-02-18 18:04:48 +09:00
parent 8e2795f279
commit 87680bb275
2 changed files with 11 additions and 27 deletions

View File

@@ -1,26 +0,0 @@
// Copyright (C) 2009 The Android Open Source Project
//
// 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.google.gerrit.common.errors;
/** Error indicating the revision is invalid as supplied. */
public class InvalidRevisionException extends Exception {
private static final long serialVersionUID = 1L;
public static final String MESSAGE = "Invalid Revision";
public InvalidRevisionException() {
super(MESSAGE);
}
}

View File

@@ -16,7 +16,6 @@ package com.google.gerrit.server.project;
import com.google.common.collect.Iterables;
import com.google.gerrit.common.ChangeHooks;
import com.google.gerrit.common.errors.InvalidRevisionException;
import com.google.gerrit.extensions.api.projects.BranchInfo;
import com.google.gerrit.extensions.restapi.AuthException;
import com.google.gerrit.extensions.restapi.BadRequestException;
@@ -253,4 +252,15 @@ public class CreateBranch implements RestModifyView<ProjectResource, Input> {
throw new InvalidRevisionException();
}
}
/** Error indicating the revision is invalid as supplied. */
private static class InvalidRevisionException extends Exception {
private static final long serialVersionUID = 1L;
public static final String MESSAGE = "Invalid Revision";
public InvalidRevisionException() {
super(MESSAGE);
}
}
}