Fix build warnings (#1562)

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
This commit is contained in:
Eduard Heimbuch
2021-03-01 09:08:01 +01:00
committed by GitHub
parent 0695ca3bac
commit 7852d1034e
46 changed files with 188 additions and 566 deletions

View File

@@ -21,29 +21,21 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package sonia.scm.plugin;
//~--- non-JDK imports --------------------------------------------------------
package sonia.scm.plugin;
import com.google.common.base.Charsets;
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.io.Files;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sonia.scm.lifecycle.classloading.ClassLoaderLifeCycle;
import sonia.scm.util.IOUtil;
//~--- JDK imports ------------------------------------------------------------
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Set;
/**
@@ -59,27 +51,8 @@ public final class PluginsInternal
private static final Logger logger =
LoggerFactory.getLogger(PluginsInternal.class);
//~--- constructors ---------------------------------------------------------
/**
* Constructs ...
*
*/
private PluginsInternal() {}
//~--- methods --------------------------------------------------------------
/**
* Method description
*
*
* @param classLoader
* @param directory
*
* @return
*
* @throws IOException
*/
public static Set<InstalledPlugin> collectPlugins(ClassLoaderLifeCycle classLoaderLifeCycle,
Path directory)
throws IOException
@@ -89,15 +62,6 @@ public final class PluginsInternal
return processor.collectPlugins(classLoaderLifeCycle.getBootstrapClassLoader());
}
/**
* Method description
*
*
* @param parent
* @param plugin
*
* @return
*/
public static File createPluginDirectory(File parent, InstalledPluginDescriptor plugin)
{
PluginInformation info = plugin.getInformation();
@@ -105,18 +69,6 @@ public final class PluginsInternal
return new File(parent, info.getName());
}
/**
* Method description
*
*
* @param archive
* @param checksum
* @param directory
* @param checksumFile
* @param core
*
* @throws IOException
*/
public static void extract(SmpArchive archive, String checksum,
File directory, File checksumFile, boolean core)
throws IOException
@@ -144,56 +96,21 @@ public final class PluginsInternal
}
}
/**
* Method description
*
*
* @param wrapped
*
* @return
*/
public static Iterable<InstalledPluginDescriptor> unwrap(Iterable<InstalledPlugin> wrapped)
{
return Iterables.transform(wrapped, new Unwrap());
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @param pluginDirectory
*
* @return
*/
public static File getChecksumFile(File pluginDirectory)
{
return new File(pluginDirectory, PluginConstants.FILE_CHECKSUM);
}
//~--- inner classes --------------------------------------------------------
/**
* Class description
*
*
* @version Enter version here..., 14/06/05
* @author Enter your name here...
*/
private static class Unwrap implements Function<InstalledPlugin, InstalledPluginDescriptor>
{
/**
* Method description
*
*
* @param wrapper
*
* @return
*/
@Override
public InstalledPluginDescriptor apply(InstalledPlugin wrapper)
@Override
public InstalledPluginDescriptor apply(InstalledPlugin wrapper)
{
return wrapper.getDescriptor();
}