Remove unnecessary assignments

Change-Id: I7890b296474811b16f57e029f9142655df1bc945
This commit is contained in:
alex.ryazantsev
2013-11-18 01:51:58 +04:00
committed by Александр Рязанцев
parent fc798093b8
commit 5c96817e31
15 changed files with 13 additions and 15 deletions

View File

@@ -182,7 +182,6 @@ public class MyPreferencesScreen extends SettingsScreen {
formGrid.setText(row, labelIdx, Util.C.diffViewLabel()); formGrid.setText(row, labelIdx, Util.C.diffViewLabel());
formGrid.setWidget(row, fieldIdx, diffView); formGrid.setWidget(row, fieldIdx, diffView);
row++;
add(formGrid); add(formGrid);

View File

@@ -115,6 +115,6 @@ public class MyProfileScreen extends SettingsScreen {
info.setText(row++, fieldIdx, account.getFullName()); info.setText(row++, fieldIdx, account.getFullName());
info.setText(row++, fieldIdx, account.getPreferredEmail()); info.setText(row++, fieldIdx, account.getPreferredEmail());
info.setText(row++, fieldIdx, mediumFormat(account.getRegisteredOn())); info.setText(row++, fieldIdx, mediumFormat(account.getRegisteredOn()));
info.setText(row++, fieldIdx, account.getId().toString()); info.setText(row, fieldIdx, account.getId().toString());
} }
} }

View File

@@ -108,7 +108,7 @@ public class PatchSetSelectBox extends Composite {
linkPanel.add(sideMarker); linkPanel.add(sideMarker);
} }
Anchor baseLink = null; Anchor baseLink;
if (detail.getInfo().getParents().size() > 1) { if (detail.getInfo().getParents().size() > 1) {
baseLink = createLink(PatchUtil.C.patchBaseAutoMerge(), null); baseLink = createLink(PatchUtil.C.patchBaseAutoMerge(), null);
} else { } else {

View File

@@ -29,7 +29,7 @@ class CookieBase64 {
o = fill(enc, o, 'A', 'Z'); o = fill(enc, o, 'A', 'Z');
o = fill(enc, o, '0', '9'); o = fill(enc, o, '0', '9');
enc[o++] = '-'; enc[o++] = '-';
enc[o++] = '.'; enc[o] = '.';
} }
private static int fill(final char[] out, int o, final char f, final int l) { private static int fill(final char[] out, int o, final char f, final int l) {

View File

@@ -126,7 +126,7 @@ class PatchDetailServiceImpl extends BaseServiceImplementation implements
final AsyncCallback<ChangeDetail> callback) { final AsyncCallback<ChangeDetail> callback) {
run(callback, new Action<ChangeDetail>() { run(callback, new Action<ChangeDetail>() {
public ChangeDetail run(ReviewDb db) throws OrmException, Failure { public ChangeDetail run(ReviewDb db) throws OrmException, Failure {
ReviewResult result = null; ReviewResult result;
try { try {
result = deleteDraftPatchSetFactory.create(psid).call(); result = deleteDraftPatchSetFactory.create(psid).call();
if (result.getErrors().size() > 0) { if (result.getErrors().size() > 0) {

View File

@@ -853,7 +853,7 @@ public class ChangeHookRunner implements ChangeHooks, LifecycleListener {
output = new StringWriter(); output = new StringWriter();
InputStreamReader input = new InputStreamReader(is); InputStreamReader input = new InputStreamReader(is);
char[] buffer = new char[4096]; char[] buffer = new char[4096];
int n = 0; int n;
while ((n = input.read(buffer)) != -1) { while ((n = input.read(buffer)) != -1) {
output.write(buffer, 0, n); output.write(buffer, 0, n);
} }

View File

@@ -135,7 +135,7 @@ public class CherryPick extends SubmitStrategy {
final PatchSetApproval submitAudit = final PatchSetApproval submitAudit =
args.mergeUtil.getSubmitter(n.change.currentPatchSetId()); args.mergeUtil.getSubmitter(n.change.currentPatchSetId());
PersonIdent cherryPickCommitterIdent = null; PersonIdent cherryPickCommitterIdent;
if (submitAudit != null) { if (submitAudit != null) {
cherryPickCommitterIdent = cherryPickCommitterIdent =
args.identifiedUserFactory.create(submitAudit.getAccountId()) args.identifiedUserFactory.create(submitAudit.getAccountId())

View File

@@ -279,7 +279,7 @@ public class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
} }
}); });
boolean couldMerge = false; boolean couldMerge;
try { try {
couldMerge = m.merge(b.getParents()); couldMerge = m.merge(b.getParents());
} catch (IOException e) { } catch (IOException e) {

View File

@@ -117,7 +117,7 @@ public class PermissionCollection {
for (PermissionRule rule : permission.getRules()) { for (PermissionRule rule : permission.getRules()) {
SeenRule s = new SeenRule(section, permission, rule); SeenRule s = new SeenRule(section, permission, rule);
boolean addRule = false; boolean addRule;
if (rule.isBlock()) { if (rule.isBlock()) {
addRule = seenBlockingRules.add(s); addRule = seenBlockingRules.add(s);
} else { } else {

View File

@@ -265,7 +265,6 @@ public class QueryProcessor {
for (ChangeDataSource s : sources) { for (ChangeDataSource s : sources) {
matches.add(s.read()); matches.add(s.read());
} }
sources = null;
List<List<ChangeData>> out = Lists.newArrayListWithCapacity(cnt); List<List<ChangeData>> out = Lists.newArrayListWithCapacity(cnt);
for (int i = 0; i < cnt; i++) { for (int i = 0; i < cnt; i++) {

View File

@@ -97,7 +97,7 @@ public class SubmoduleSectionParser {
} }
final String urlExtractedPath = new URI(url).getPath(); final String urlExtractedPath = new URI(url).getPath();
String projectName = urlExtractedPath; String projectName;
int fromIndex = urlExtractedPath.length() - 1; int fromIndex = urlExtractedPath.length() - 1;
while (fromIndex > 0) { while (fromIndex > 0) {
fromIndex = urlExtractedPath.lastIndexOf('/', fromIndex - 1); fromIndex = urlExtractedPath.lastIndexOf('/', fromIndex - 1);

View File

@@ -210,7 +210,7 @@ public class SubmoduleSectionParserTest extends LocalDiskRepositoryTestCase {
section.getBranch()); section.getBranch());
if (THIS_SERVER.equals(new URI(section.getUrl()).getHost())) { if (THIS_SERVER.equals(new URI(section.getUrl()).getHost())) {
String projectNameCandidate = null; String projectNameCandidate;
final String urlExtractedPath = new URI(section.getUrl()).getPath(); final String urlExtractedPath = new URI(section.getUrl()).getPath();
int fromIndex = urlExtractedPath.length() - 1; int fromIndex = urlExtractedPath.length() - 1;
while (fromIndex > 0) { while (fromIndex > 0) {

View File

@@ -75,7 +75,7 @@ public class LsUserRefs extends SshCommand {
@Override @Override
protected void run() throws Failure { protected void run() throws Failure {
Account userAccount = null; Account userAccount;
try { try {
userAccount = accountResolver.find(userName); userAccount = accountResolver.find(userName);
} catch (OrmException e) { } catch (OrmException e) {

View File

@@ -411,7 +411,7 @@ public class ReviewCommand extends SshCommand {
} }
for (LabelType type : allProjectsControl.getLabelTypes().getLabelTypes()) { for (LabelType type : allProjectsControl.getLabelTypes().getLabelTypes()) {
String usage = ""; String usage;
usage = "score for " + type.getName() + "\n"; usage = "score for " + type.getName() + "\n";
for (LabelValue v : type.getValues()) { for (LabelValue v : type.getValues()) {

View File

@@ -287,7 +287,7 @@ final class SetAccountCommand extends BaseCommand {
private List<String> readSshKey(final List<String> sshKeys) private List<String> readSshKey(final List<String> sshKeys)
throws UnsupportedEncodingException, IOException { throws UnsupportedEncodingException, IOException {
if (!sshKeys.isEmpty()) { if (!sshKeys.isEmpty()) {
String sshKey = ""; String sshKey;
int idx = sshKeys.indexOf("-"); int idx = sshKeys.indexOf("-");
if (idx >= 0) { if (idx >= 0) {
sshKey = ""; sshKey = "";