From 39962f1bdb7aa3001ae908f0e6e0bea00b9b3e78 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Sun, 11 Oct 2015 20:03:08 +0200 Subject: Bug 479525 - Inline helper method Progress#getMonitor Method is only called once and has only one statement, can be inlined. Change-Id: I595c381a070c6a6e27878cfa7d2c46cde393fe79 Signed-off-by: Lars Vogel --- .../filebuffers/manipulation/GenericFileBufferOperationRunner.java | 5 +++-- .../src/org/eclipse/core/internal/filebuffers/Progress.java | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'org.eclipse.core.filebuffers') diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/manipulation/GenericFileBufferOperationRunner.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/manipulation/GenericFileBufferOperationRunner.java index b141a8849c8..d49c1346c59 100644 --- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/manipulation/GenericFileBufferOperationRunner.java +++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/manipulation/GenericFileBufferOperationRunner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.ISafeRunnable; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.SafeRunner; import org.eclipse.core.runtime.Status; @@ -231,7 +232,7 @@ public class GenericFileBufferOperationRunner { } catch (CoreException x) { try { - releaseFileBuffers(locations, Progress.getMonitor()); + releaseFileBuffers(locations, new NullProgressMonitor()); } catch (CoreException e) { } throw x; diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/Progress.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/Progress.java index 693c3bd3b1f..a56ed1e2331 100644 --- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/Progress.java +++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/Progress.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,7 +28,4 @@ public class Progress { return new SubProgressMonitor(getMonitor(parent), ticks, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); } - public static IProgressMonitor getMonitor() { - return new NullProgressMonitor(); - } } -- cgit v1.2.3