You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2018/12/27 10:01:17 UTC
[01/20] tomee git commit: added JavaDoc and use of diamond operator
Repository: tomee
Updated Branches:
refs/heads/master df8d80edc -> 0866dbe45
added JavaDoc and use of diamond operator
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/298cdee7
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/298cdee7
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/298cdee7
Branch: refs/heads/master
Commit: 298cdee7d52c9d048264d5e82558988e966413fe
Parents: 42605b7
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 21:38:07 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 21:38:07 2018 +0100
----------------------------------------------------------------------
.../openejb/loader/BasicURLClassPath.java | 12 ++
.../apache/openejb/loader/ContextClassPath.java | 14 ++
.../org/apache/openejb/loader/Embedder.java | 2 +-
.../org/apache/openejb/loader/FileUtils.java | 55 +++++-
.../java/org/apache/openejb/loader/Files.java | 163 +++++++++++++++-
.../main/java/org/apache/openejb/loader/IO.java | 191 ++++++++++++++++++-
6 files changed, 421 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/298cdee7/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
index e8acf96..c78f223 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
@@ -67,6 +67,12 @@ public abstract class BasicURLClassPath implements ClassPath {
});
}
+ /**
+ *
+ * @param dir
+ * @param loader
+ * @throws Exception
+ */
protected synchronized void addJarsToPath(final File dir, final URLClassLoader loader) throws Exception {
if (dir == null || !dir.exists()) {
return;
@@ -111,6 +117,12 @@ public abstract class BasicURLClassPath implements ClassPath {
}
}
+ /**
+ *
+ * @param loader
+ * @return Object
+ * @throws Exception
+ */
protected Object getURLClassPath(final URLClassLoader loader) throws Exception {
final Field ucpField = this.getUcpField();
if (ucpField == null) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/298cdee7/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
index 71c4aa2..68cfdae 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
@@ -26,11 +26,20 @@ import java.net.URLClassLoader;
public class ContextClassPath extends BasicURLClassPath {
+ /**
+ *
+ * @return the context ClassLoader for this Thread or null
+ */
@Override
public ClassLoader getClassLoader() {
return getContextClassLoader();
}
+ /**
+ *
+ * @param dir
+ * @throws Exception
+ */
@Override
public void addJarsToPath(final File dir) throws Exception {
final ClassLoader contextClassLoader = getContextClassLoader();
@@ -40,6 +49,11 @@ public class ContextClassPath extends BasicURLClassPath {
}
}
+ /**
+ *
+ * @param jar
+ * @throws Exception
+ */
@Override
public void addJarToPath(final URL jar) throws Exception {
final ClassLoader contextClassLoader = getContextClassLoader();
http://git-wip-us.apache.org/repos/asf/tomee/blob/298cdee7/container/openejb-loader/src/main/java/org/apache/openejb/loader/Embedder.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Embedder.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Embedder.java
index a9554a3..2cf2329 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Embedder.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Embedder.java
@@ -80,7 +80,7 @@ public class Embedder {
final Object value = init.invoke(instance, properties);
return value;
} catch (final NoSuchMethodException e) {
- throw (IllegalStateException) new IllegalStateException("Signatures for Loader are no longer correct.").initCause(e);
+ throw new IllegalStateException("Signatures for Loader are no longer correct.", e);
} catch (final InvocationTargetException e) {
final Throwable cause = e.getCause();
if (cause instanceof Error) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/298cdee7/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
index 8437ff4..e710136 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
@@ -24,7 +24,7 @@ import java.util.Hashtable;
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
public class FileUtils {
- private static final java.util.Random _random = new java.util.Random();
+ private static final java.util.Random RANDOM = new java.util.Random();
private File home;
@@ -32,6 +32,12 @@ public class FileUtils {
this(homeDir, defaultDir, SystemInstance.get().getProperties());
}
+ /**
+ *
+ * @param homeDir
+ * @param defaultDir
+ * @param env
+ */
@SuppressWarnings("UseOfObsoleteCollectionType")
public FileUtils(final String homeDir, final String defaultDir, final Hashtable env) {
@@ -59,6 +65,12 @@ public class FileUtils {
}
}
+ /**
+ *
+ * @param path
+ * @return File
+ * @throws IOException
+ */
public File getDirectory(final String path) throws IOException {
return getDirectory(path, false);
}
@@ -72,6 +84,13 @@ public class FileUtils {
return this.getDirectory().equals(that.getDirectory());
}
+ /**
+ *
+ * @param path
+ * @param create
+ * @return File
+ * @throws IOException
+ */
public File getDirectory(final String path, final boolean create) throws IOException {
File dir = new File(home, path);
dir = dir.getCanonicalFile();
@@ -92,18 +111,39 @@ public class FileUtils {
return dir;
}
+ /**
+ *
+ * @return File
+ */
public File getDirectory() {
return home;
}
+ /**
+ *
+ * @param dir
+ */
public void setDirectory(final File dir) {
this.home = dir;
}
+ /**
+ *
+ * @param path
+ * @return File
+ * @throws IOException
+ */
public File getFile(final String path) throws IOException {
return getFile(path, true);
}
+ /**
+ *
+ * @param path
+ * @param validate
+ * @return File
+ * @throws IOException
+ */
public File getFile(final String path, final boolean validate) throws IOException {
File file = new File(path);
@@ -120,10 +160,16 @@ public class FileUtils {
return file;
}
+ /**
+ *
+ * @param pathPrefix
+ * @return File
+ * @throws IOException
+ */
public static File createTempDirectory(final String pathPrefix) throws IOException {
for (int maxAttempts = 100; maxAttempts > 0; --maxAttempts) {
- final String path = pathPrefix + _random.nextLong();
+ final String path = pathPrefix + RANDOM.nextLong();
final File tmpDir = new File(path);
if (!tmpDir.exists() && tmpDir.mkdirs()) {
@@ -133,6 +179,11 @@ public class FileUtils {
throw new IOException("Cannot create temporary directory at: " + pathPrefix);
}
+ /**
+ *
+ * @return File
+ * @throws IOException
+ */
public static File createTempDirectory() throws IOException {
final String prefix = System.getProperty("java.io.tmpdir", File.separator + "tmp") + File.separator + "openejb";
return createTempDirectory(prefix);
http://git-wip-us.apache.org/repos/asf/tomee/blob/298cdee7/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
index 9a2dc5b..e622851 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
@@ -46,6 +46,11 @@ public class Files {
private static final Map<String, MessageDigest> DIGESTS = new HashMap<String, MessageDigest>();
private static final boolean IS_WINDOWS = System.getProperty("os.name", "unknown").toLowerCase(Locale.ENGLISH).startsWith("win");
+ /**
+ *
+ * @param parts String...
+ * @return File
+ */
public static File path(final String... parts) {
File dir = null;
for (final String part : parts) {
@@ -59,6 +64,12 @@ public class Files {
return null != dir ? dir.getAbsoluteFile() : dir;
}
+ /**
+ *
+ * @param dir File
+ * @param parts String...
+ * @return File
+ */
public static File path(final File dir, final String... parts) {
File base = dir;
int idx = 0;
@@ -77,17 +88,34 @@ public class Files {
return base.getAbsoluteFile();
}
+ /**
+ *
+ * @param dir File
+ * @param regex String
+ * @return List of Files
+ */
public static List<File> collect(final File dir, final String regex) {
return collect(dir, Pattern.compile(regex));
}
+ /**
+ *
+ * @param dir File
+ * @param pattern Pattern
+ * @return List of Files
+ */
public static List<File> collect(final File dir, final Pattern pattern) {
return collect(dir, new PatternFileFilter(pattern));
}
-
+ /**
+ *
+ * @param dir File
+ * @param filter FileFilter
+ * @return List of Files
+ */
public static List<File> collect(final File dir, final FileFilter filter) {
- final List<File> accepted = new ArrayList<File>();
+ final List<File> accepted = new ArrayList<>();
if (filter.accept(dir)) {
accepted.add(dir);
}
@@ -102,6 +130,13 @@ public class Files {
return accepted;
}
+ /**
+ *
+ * @param file File
+ * @param s String
+ * @return File
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File exists(final File file, final String s) {
if (!file.exists()) {
throw new FileDoesNotExistException(s + " does not exist: " + file.getAbsolutePath());
@@ -109,6 +144,12 @@ public class Files {
return file;
}
+ /**
+ *
+ * @param file File
+ * @return File
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File exists(final File file) {
if (!file.exists()) {
throw new FileDoesNotExistException("Does not exist: " + file.getAbsolutePath());
@@ -116,6 +157,12 @@ public class Files {
return file;
}
+ /**
+ *
+ * @param file File
+ * @return File
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File dir(final File file) {
if (!file.isDirectory()) {
throw new FileRuntimeException("Not a directory: " + file.getAbsolutePath());
@@ -124,6 +171,13 @@ public class Files {
return file;
}
+ /**
+ *
+ * @param file File
+ * @return File
+ * @throws IOException
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File touch(final File file) throws IOException {
if (!file.createNewFile()) {
throw new FileRuntimeException("Cannot create file: " + file.getAbsolutePath());
@@ -131,6 +185,12 @@ public class Files {
return file;
}
+ /**
+ *
+ * @param file File
+ * @return File
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File file(final File file) {
exists(file);
if (!file.isFile()) {
@@ -139,6 +199,12 @@ public class Files {
return file;
}
+ /**
+ *
+ * @param file File
+ * @return File
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File notHidden(final File file) {
exists(file);
if (file.isHidden()) {
@@ -147,6 +213,12 @@ public class Files {
return file;
}
+ /**
+ *
+ * @param file File
+ * @return File
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File writable(final File file) {
if (!file.canWrite()) {
throw new FileRuntimeException("Not writable: " + file.getAbsolutePath());
@@ -154,6 +226,12 @@ public class Files {
return file;
}
+ /**
+ *
+ * @param file File
+ * @return File
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File readable(final File file) {
if (!file.canRead()) {
throw new FileRuntimeException("Not readable: " + file.getAbsolutePath());
@@ -161,10 +239,21 @@ public class Files {
return file;
}
+ /**
+ *
+ * @param file File
+ * @return File
+ */
public static File readableFile(final File file) {
return readable(file(file));
}
+ /**
+ *
+ * @param file File
+ * @return File
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File mkdir(final File file) {
if (file.exists()) {
return file;
@@ -185,10 +274,21 @@ public class Files {
}
}
+ /**
+ *
+ * @param file file
+ * @param name String
+ * @return File
+ */
public static File mkdir(final File file, final String name) {
return mkdir(new File(file, name));
}
+ /**
+ *
+ * @return File
+ * @Throws IOException on failure at any point
+ */
public static File tmpdir() {
try {
File file;
@@ -223,11 +323,22 @@ public class Files {
}
}
+ /**
+ *
+ * @param file File
+ * @return File
+ */
public static File mkparent(final File file) {
mkdirs(file.getParentFile());
return file;
}
+ /**
+ *
+ * @param file File
+ * @return File
+ * @Throws FileRuntimeException on failure at any point
+ */
public static File mkdirs(final File file) {
if (!file.exists()) {
@@ -245,8 +356,8 @@ public class Files {
}
- // Shutdown hook for recursive delete on tmp directories
- static final List<String> delete = new ArrayList<String>();
+ // Shutdown hook for recursive DELETE on tmp directories
+ static final List<String> DELETE = new ArrayList<String>();
static {
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
@@ -263,11 +374,19 @@ public class Files {
}
}
+ /**
+ *
+ * @param file File
+ */
public static void deleteOnExit(final File file) {
- delete.add(file.getAbsolutePath());
+ DELETE.add(file.getAbsolutePath());
flagForDeleteOnExit(file);
}
+ /**
+ *
+ * @param file File
+ */
public static void flagForDeleteOnExit(final File file) {
if (file.exists()) {
if (file.isDirectory()) {
@@ -288,14 +407,14 @@ public class Files {
}
private static void delete() {
- for (final String path : delete) {
+ for (final String path : DELETE) {
delete(new File(path));
}
}
/**
* Delete a file and all contents if specified file is a directory.
- * If the delete fails then the file/s are flagged for delete on exit.
+ * If the DELETE fails then the file/s are flagged for DELETE on exit.
*
* @param file File
*/
@@ -350,9 +469,16 @@ public class Files {
}
}
+ /**
+ *
+ * @param dir File
+ * @param pattern String
+ * @return File
+ * @Throws IllegalStateException on failure at any point
+ */
public static File select(final File dir, final String pattern) {
final List<File> matches = collect(dir, pattern);
- if (matches.size() == 0) {
+ if (matches.isEmpty()) {
throw new IllegalStateException(String.format("Missing '%s'", pattern));
}
if (matches.size() > 1) {
@@ -362,7 +488,7 @@ public class Files {
}
private static String join(final String delimiter, final Collection<File> collection) {
- if (collection.size() == 0) {
+ if (collection.isEmpty()) {
return "";
}
final StringBuilder sb = new StringBuilder();
@@ -374,6 +500,11 @@ public class Files {
// return the token as url if simply a path otheriwse if ending by *.jar returning the list of
// files in the folder
+ /**
+ *
+ * @param path String
+ * @return List of files in the folder
+ */
public static Set<URL> listJars(final String path) {
final Set<URL> set = new HashSet<>();
@@ -423,6 +554,12 @@ public class Files {
return set;
}
+ /**
+ *
+ * @param url URL
+ * @return File
+ * @Throws IllegalStateException on failure at any point
+ */
public static File toFile(final URL url) {
if ("jar".equals(url.getProtocol())) {
try {
@@ -451,8 +588,14 @@ public class Files {
}
}
+ /**
+ *
+ * @param urls Set<URL>
+ * @param algo String
+ * @return String
+ */
public static String hash(final Set<URL> urls, final String algo) {
- final Collection<File> files = new ArrayList<File>();
+ final Collection<File> files = new ArrayList<>();
for (final URL u : urls) {
final File file = toFile(u);
http://git-wip-us.apache.org/repos/asf/tomee/blob/298cdee7/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
index 1a5f477..e73f2b5 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
@@ -68,6 +68,12 @@ public class IO {
MAX_TIMEOUT = timeout;
}
+ /**
+ *
+ * @param uri URI
+ * @return String
+ * @throws IOException
+ */
public static String readFileAsString(final URI uri) throws IOException {
final StringBuilder builder = new StringBuilder("");
for (final Proxy proxy : ProxySelector.getDefault().select(uri)) {
@@ -95,18 +101,44 @@ public class IO {
return builder.toString();
}
+ /**
+ *
+ * @param resource URL
+ * @return Properties
+ * @throws IOException
+ */
public static Properties readProperties(final URL resource) throws IOException {
return readProperties(resource, new Properties());
}
+ /**
+ *
+ * @param resource URL
+ * @param properties Properties
+ * @return Properties
+ * @throws IOException
+ */
public static Properties readProperties(final URL resource, final Properties properties) throws IOException {
return readProperties(read(resource), properties);
}
+ /**
+ *
+ * @param resource File
+ * @return Properties
+ * @throws IOException
+ */
public static Properties readProperties(final File resource) throws IOException {
return readProperties(resource, new Properties());
}
+ /**
+ *
+ * @param resource File
+ * @param properties Properties
+ * @return Properties
+ * @throws IOException
+ */
public static Properties readProperties(final File resource, final Properties properties) throws IOException {
return readProperties(read(resource), properties);
}
@@ -134,6 +166,12 @@ public class IO {
return properties;
}
+ /**
+ *
+ * @param url URL
+ * @return String
+ * @throws IOException
+ */
public static String readString(final URL url) throws IOException {
final InputStream in = url.openStream();
try {
@@ -144,6 +182,12 @@ public class IO {
}
}
+ /**
+ *
+ * @param file File
+ * @return String
+ * @throws IOException
+ */
public static String readString(final File file) throws IOException {
final FileReader in = new FileReader(file);
try {
@@ -154,23 +198,46 @@ public class IO {
}
}
+ /**
+ *
+ * @param file File
+ * @return String
+ * @throws IOException
+ */
public static String slurp(final File file) throws IOException {
try (final InputStream is = read(file)) {
return slurp(is);
}
}
-
+ /**
+ *
+ * @param url URL
+ * @return String
+ * @throws IOException
+ */
public static String slurp(final URL url) throws IOException {
return slurp(url.openStream());
}
+ /**
+ *
+ * @param in InputStream
+ * @return String
+ * @throws IOException
+ */
public static String slurp(final InputStream in) throws IOException {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
copy(in, out);
return new String(out.toByteArray());
}
+ /**
+ *
+ * @param file File
+ * @param string String
+ * @throws IOException
+ */
public static void writeString(final File file, final String string) throws IOException {
final FileWriter out = new FileWriter(file);
try {
@@ -186,6 +253,12 @@ public class IO {
}
}
+ /**
+ *
+ * @param from File
+ * @param to File
+ * @throws IOException
+ */
public static void copy(final File from, final File to) throws IOException {
if (!from.isDirectory()) {
final FileOutputStream fos = new FileOutputStream(to);
@@ -199,6 +272,12 @@ public class IO {
}
}
+ /**
+ *
+ * @param srcDir File
+ * @param destDir File
+ * @throws IOException
+ */
public static void copyDirectory(final File srcDir, final File destDir) throws IOException {
if (srcDir == null) {
throw new NullPointerException("Source must not be null");
@@ -221,7 +300,7 @@ public class IO {
if (destDir.getCanonicalPath().startsWith(srcDir.getCanonicalPath())) {
final File[] srcFiles = srcDir.listFiles();
if (srcFiles != null && srcFiles.length > 0) {
- exclusionList = new ArrayList<String>(srcFiles.length);
+ exclusionList = new ArrayList<>(srcFiles.length);
for (final File srcFile : srcFiles) {
final File copiedFile = new File(destDir, srcFile.getName());
exclusionList.add(copiedFile.getCanonicalPath());
@@ -260,6 +339,12 @@ public class IO {
}
}
+ /**
+ *
+ * @param from File
+ * @param to OutputStream
+ * @throws IOException
+ */
public static void copy(final File from, final OutputStream to) throws IOException {
final InputStream read = read(from);
try {
@@ -269,6 +354,12 @@ public class IO {
}
}
+ /**
+ *
+ * @param from URL
+ * @param to OutputStream
+ * @throws IOException
+ */
public static void copy(final URL from, final OutputStream to) throws IOException {
final InputStream read = read(from);
try {
@@ -278,6 +369,12 @@ public class IO {
}
}
+ /**
+ *
+ * @param from InputStream
+ * @param to File
+ * @throws IOException
+ */
public static void copy(final InputStream from, final File to) throws IOException {
final OutputStream write = write(to);
try {
@@ -287,6 +384,13 @@ public class IO {
}
}
+ /**
+ *
+ * @param from InputStream
+ * @param to File
+ * @param append boolean
+ * @throws IOException
+ */
public static void copy(final InputStream from, final File to, final boolean append) throws IOException {
final OutputStream write = write(to, append);
try {
@@ -296,6 +400,12 @@ public class IO {
}
}
+ /**
+ *
+ * @param from InputStream
+ * @param to OutputStream
+ * @throws IOException
+ */
public static void copy(final InputStream from, final OutputStream to) throws IOException {
final byte[] buffer = new byte[1024];
int length;
@@ -305,24 +415,52 @@ public class IO {
to.flush();
}
+ /**
+ *
+ * @param from byte[]
+ * @param to File
+ * @throws IOException
+ */
public static void copy(final byte[] from, final File to) throws IOException {
copy(new ByteArrayInputStream(from), to);
}
+ /**
+ *
+ * @param from byte[]
+ * @param to OutputStream
+ * @throws IOException
+ */
public static void copy(final byte[] from, final OutputStream to) throws IOException {
copy(new ByteArrayInputStream(from), to);
}
+ /**
+ *
+ * @param file File
+ * @return ZipOutputStream
+ * @throws IOException
+ */
public static ZipOutputStream zip(final File file) throws IOException {
final OutputStream write = write(file);
return new ZipOutputStream(write);
}
+ /**
+ *
+ * @param file File
+ * @return ZipInputStream
+ * @throws IOException
+ */
public static ZipInputStream unzip(final File file) throws IOException {
final InputStream read = read(file);
return new ZipInputStream(read);
}
+ /**
+ *
+ * @param closeable Closeable
+ */
public static void close(final Closeable closeable) {
if (closeable == null) {
return;
@@ -341,45 +479,92 @@ public class IO {
}
}
+ /**
+ *
+ * @param file File
+ * @return boolean
+ */
public static boolean delete(final File file) {
if (file == null) {
return false;
}
if (!file.delete()) {
- Logger.getLogger(IO.class.getName()).log(Level.WARNING, "Delete failed on: " + file.getAbsolutePath());
+ Logger.getLogger(IO.class.getName()).log(Level.WARNING, "Delete failed on: {0}", file.getAbsolutePath());
return false;
}
return true;
}
+ /**
+ *
+ * @param destination File
+ * @return OutputStream
+ * @throws FileNotFoundException
+ */
public static OutputStream write(final File destination) throws FileNotFoundException {
final OutputStream out = new FileOutputStream(destination);
return new BufferedOutputStream(out, 32768);
}
+ /**
+ *
+ * @param destination File
+ * @param append boolean
+ * @return OutputStream
+ * @throws FileNotFoundException
+ */
public static OutputStream write(final File destination, final boolean append) throws FileNotFoundException {
final OutputStream out = new FileOutputStream(destination, append);
return new BufferedOutputStream(out, 32768);
}
+ /**
+ *
+ * @param source File
+ * @return InputStream
+ * @throws FileNotFoundException
+ */
public static InputStream read(final File source) throws FileNotFoundException {
final InputStream in = new FileInputStream(source);
return new BufferedInputStream(in, 32768);
}
+ /**
+ *
+ * @param content String
+ * @return InputStream
+ */
public static InputStream read(final String content) {
return read(content.getBytes());
}
+ /**
+ *
+ * @param content String
+ * @param encoding String
+ * @return InputStream
+ * @throws UnsupportedEncodingException
+ */
public static InputStream read(final String content, final String encoding) throws UnsupportedEncodingException {
return read(content.getBytes(encoding));
}
+ /**
+ *
+ * @param content byte[]
+ * @return InputStream
+ */
public static InputStream read(final byte[] content) {
return new ByteArrayInputStream(content);
}
+ /**
+ *
+ * @param url URL
+ * @return InputStream
+ * @throws IOException
+ */
public static InputStream read(final URL url) throws IOException {
return url.openStream();
}
[11/20] tomee git commit: use diamond op.
Posted by jl...@apache.org.
use diamond op.
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/5e3feac1
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/5e3feac1
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/5e3feac1
Branch: refs/heads/master
Commit: 5e3feac1683a83ddc1fa9e3ad2c1e267b266dd8d
Parents: b5acec2
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 23:57:50 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 23:57:50 2018 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/openejb/loader/Files.java | 2 +-
.../src/main/java/org/apache/openejb/loader/Options.java | 2 +-
.../src/main/java/org/apache/openejb/observer/ObserverManager.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/5e3feac1/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
index f19b1cb..1b6d86f 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
@@ -43,7 +43,7 @@ import static org.apache.openejb.loader.JarLocation.decode;
* @version $Rev$ $Date$
*/
public class Files {
- private static final Map<String, MessageDigest> DIGESTS = new HashMap<String, MessageDigest>();
+ private static final Map<String, MessageDigest> DIGESTS = new HashMap<>();
private static final boolean IS_WINDOWS = System.getProperty("os.name", "unknown").toLowerCase(Locale.ENGLISH).startsWith("win");
/**
http://git-wip-us.apache.org/repos/asf/tomee/blob/5e3feac1/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
index 8b6c14d..9d0b9cd 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
@@ -364,7 +364,7 @@ public class Options {
* @return
*/
public static <T extends Enum<T>> T valueOf(final Class<T> enumType, final String name) {
- final Map<String, T> map = new HashMap<String, T>();
+ final Map<String, T> map = new HashMap<>();
for (final T t : enumType.getEnumConstants()) {
map.put(t.name().toUpperCase(), t);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/5e3feac1/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
index c255367..53fb577 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
@@ -51,7 +51,7 @@ public class ObserverManager {
};
// lazy init since it is used in SystemInstance
- private static final AtomicReference<Logger> LOGGER = new AtomicReference<Logger>();
+ private static final AtomicReference<Logger> LOGGER = new AtomicReference<>();
private final Set<Observer> observers = new LinkedHashSet<>();
private final Map<Class, Invocation> methods = new ConcurrentHashMap<>();
[18/20] tomee git commit: remove unused imports and use diamond op
Posted by jl...@apache.org.
remove unused imports and use diamond op
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/3bf930d8
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/3bf930d8
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/3bf930d8
Branch: refs/heads/master
Commit: 3bf930d861cefcd6efc5e7585b2e0cd8f8ce3ed5
Parents: 2fdabc5
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Thu Dec 13 21:38:45 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Thu Dec 13 21:38:45 2018 +0100
----------------------------------------------------------------------
.../org/apache/openejb/loader/FilesTest.java | 23 ++++++++++----------
.../apache/openejb/observer/EventSpeedTest.java | 6 ++---
.../openejb/observer/ObserverFeaturesTest.java | 4 ++--
.../openejb/observer/ObserverListTest.java | 2 +-
4 files changed, 17 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/3bf930d8/container/openejb-loader/src/test/java/org/apache/openejb/loader/FilesTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/test/java/org/apache/openejb/loader/FilesTest.java b/container/openejb-loader/src/test/java/org/apache/openejb/loader/FilesTest.java
index 7430a5b..daca321 100644
--- a/container/openejb-loader/src/test/java/org/apache/openejb/loader/FilesTest.java
+++ b/container/openejb-loader/src/test/java/org/apache/openejb/loader/FilesTest.java
@@ -22,7 +22,6 @@ import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
-import java.util.logging.LogManager;
import java.util.logging.Logger;
import static org.junit.Assert.assertFalse;
@@ -30,7 +29,7 @@ import static org.junit.Assert.assertTrue;
public class FilesTest {
- private final static File file = new File("target/test/foo.jar");
+ private final static File FILE = new File("target/test/foo.jar");
@Test
public void testDelete() throws Exception {
@@ -49,26 +48,26 @@ public class FilesTest {
for (int i = 0; i < 20; i++) {
if (remove) {
- Files.remove(file);
+ Files.remove(FILE);
} else {
- Files.delete(file);
+ Files.delete(FILE);
}
- Files.mkdirs(file.getParentFile());
- assertTrue(file.createNewFile());
- assertTrue(file.exists());
+ Files.mkdirs(FILE.getParentFile());
+ assertTrue(FILE.createNewFile());
+ assertTrue(FILE.exists());
}
- assertTrue(file.getParentFile().exists());
+ assertTrue(FILE.getParentFile().exists());
if (remove) {
- Files.remove(file.getParentFile());
+ Files.remove(FILE.getParentFile());
} else {
- Files.delete(file.getParentFile());
+ Files.delete(FILE.getParentFile());
}
- assertFalse(file.exists());
- assertFalse(file.getParentFile().exists());
+ assertFalse(FILE.exists());
+ assertFalse(FILE.getParentFile().exists());
final long time = TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS);
Logger.getLogger(this.getClass().getName()).log(Level.INFO, String.format("Completed File.%1$s in %2$sms" , remove ? "remove" : "delete", String.valueOf(time)));
http://git-wip-us.apache.org/repos/asf/tomee/blob/3bf930d8/container/openejb-loader/src/test/java/org/apache/openejb/observer/EventSpeedTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/test/java/org/apache/openejb/observer/EventSpeedTest.java b/container/openejb-loader/src/test/java/org/apache/openejb/observer/EventSpeedTest.java
index 17e3b90..8db41ed 100644
--- a/container/openejb-loader/src/test/java/org/apache/openejb/observer/EventSpeedTest.java
+++ b/container/openejb-loader/src/test/java/org/apache/openejb/observer/EventSpeedTest.java
@@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit;
public class EventSpeedTest extends Assert {
- private static final String format = "%10s %5s %5s %3.0f%%";
+ private static final String FORMAT = "%10s %5s %5s %3.0f%%";
@Test
public void test() throws Exception {
@@ -31,7 +31,7 @@ public class EventSpeedTest extends Assert {
final long start = System.nanoTime();
long events = 0;
- System.out.println(String.format(format, "Events", "Obsvs", "Avg", 0d));
+ System.out.println(String.format(FORMAT, "Events", "Obsvs", "Avg", 0d));
Stats previous = null;
for (int i = 1; i < (64 / 4 + 1); i *= 2) {
final Stats stats = time(i);
@@ -108,7 +108,7 @@ public class EventSpeedTest extends Assert {
public String compare(final Stats previous) {
final double change = change(previous);
- return String.format(format, events, observers, eventAverage(), change);
+ return String.format(FORMAT, events, observers, eventAverage(), change);
}
private double change(final Stats previous) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/3bf930d8/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverFeaturesTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverFeaturesTest.java b/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverFeaturesTest.java
index e8b8983..212523d 100644
--- a/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverFeaturesTest.java
+++ b/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverFeaturesTest.java
@@ -314,8 +314,8 @@ public class ObserverFeaturesTest {
}, 42);
}
- private final List<Boolean> conditions = new ArrayList<Boolean>();
- private final List<String> invocations = new ArrayList<String>();
+ private final List<Boolean> conditions = new ArrayList<>();
+ private final List<String> invocations = new ArrayList<>();
@Before
public void init() {
http://git-wip-us.apache.org/repos/asf/tomee/blob/3bf930d8/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverListTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverListTest.java b/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverListTest.java
index 8dc71fc..629acf7 100644
--- a/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverListTest.java
+++ b/container/openejb-loader/src/test/java/org/apache/openejb/observer/ObserverListTest.java
@@ -55,7 +55,7 @@ public class ObserverListTest {
}
};
- final List<String> invoked = new ArrayList<String>();
+ final List<String> invoked = new ArrayList<>();
final ObserverManager observers = new ObserverManager();
observers.addObserver(new Object() {
public void observe(@Observes final ObserverAdded o) {
[02/20] tomee git commit: JavaDocs and use of isEmpty()
Posted by jl...@apache.org.
JavaDocs and use of isEmpty()
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/0d70b3c3
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/0d70b3c3
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/0d70b3c3
Branch: refs/heads/master
Commit: 0d70b3c3081704d9556eb7b10775c038a67fe869
Parents: 298cdee
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 21:52:37 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 21:52:37 2018 +0100
----------------------------------------------------------------------
.../org/apache/openejb/loader/ClassPath.java | 10 +
.../apache/openejb/loader/ClassPathFactory.java | 6 +
.../apache/openejb/loader/ContextClassPath.java | 4 +-
.../org/apache/openejb/loader/FileUtils.java | 22 +--
.../org/apache/openejb/loader/JarLocation.java | 32 +++-
.../java/org/apache/openejb/loader/Loader.java | 5 +
.../openejb/loader/LoaderRuntimeException.java | 10 +
.../apache/openejb/loader/OpenEJBInstance.java | 13 ++
.../java/org/apache/openejb/loader/Options.java | 185 ++++++++++++++++++-
9 files changed, 270 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/0d70b3c3/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
index 6cdb335..3baef29 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
@@ -23,7 +23,17 @@ public interface ClassPath {
ClassLoader getClassLoader();
+ /**
+ *
+ * @param dir File
+ * @throws Exception
+ */
void addJarsToPath(File dir) throws Exception;
+ /**
+ *
+ * @param dir URL
+ * @throws Exception
+ */
void addJarToPath(URL dir) throws Exception;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/0d70b3c3/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java
index 6eb20bb..4201bab 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java
@@ -21,6 +21,12 @@ import java.net.URLClassLoader;
import static java.lang.ClassLoader.getSystemClassLoader;
public class ClassPathFactory {
+
+ /**
+ *
+ * @param name String
+ * @return ClassPath
+ */
@SuppressWarnings("checkstyle:needbraces")
public static ClassPath createClassPath(final String name) {
if (name.equalsIgnoreCase("tomcat")) return new TomcatClassPath();
http://git-wip-us.apache.org/repos/asf/tomee/blob/0d70b3c3/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
index 68cfdae..fe92b6f 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
@@ -37,7 +37,7 @@ public class ContextClassPath extends BasicURLClassPath {
/**
*
- * @param dir
+ * @param dir File
* @throws Exception
*/
@Override
@@ -51,7 +51,7 @@ public class ContextClassPath extends BasicURLClassPath {
/**
*
- * @param jar
+ * @param jar URL
* @throws Exception
*/
@Override
http://git-wip-us.apache.org/repos/asf/tomee/blob/0d70b3c3/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
index e710136..6a5ea98 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
@@ -34,9 +34,9 @@ public class FileUtils {
/**
*
- * @param homeDir
- * @param defaultDir
- * @param env
+ * @param homeDir String
+ * @param defaultDir String
+ * @param env Hashtable
*/
@SuppressWarnings("UseOfObsoleteCollectionType")
public FileUtils(final String homeDir, final String defaultDir, final Hashtable env) {
@@ -67,7 +67,7 @@ public class FileUtils {
/**
*
- * @param path
+ * @param path String
* @return File
* @throws IOException
*/
@@ -86,8 +86,8 @@ public class FileUtils {
/**
*
- * @param path
- * @param create
+ * @param path String
+ * @param create boolean
* @return File
* @throws IOException
*/
@@ -121,7 +121,7 @@ public class FileUtils {
/**
*
- * @param dir
+ * @param dir File
*/
public void setDirectory(final File dir) {
this.home = dir;
@@ -129,7 +129,7 @@ public class FileUtils {
/**
*
- * @param path
+ * @param path String
* @return File
* @throws IOException
*/
@@ -139,8 +139,8 @@ public class FileUtils {
/**
*
- * @param path
- * @param validate
+ * @param path String
+ * @param validate boolean
* @return File
* @throws IOException
*/
@@ -162,7 +162,7 @@ public class FileUtils {
/**
*
- * @param pathPrefix
+ * @param pathPrefix String
* @return File
* @throws IOException
*/
http://git-wip-us.apache.org/repos/asf/tomee/blob/0d70b3c3/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
index 4294e3a..7e6509f 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
@@ -26,14 +26,29 @@ import java.net.URL;
*/
public class JarLocation {
+ /**
+ *
+ * @return File
+ */
public static File get() {
return jarLocation(JarLocation.class);
}
+ /**
+ *
+ * @param resourceName String
+ * @return File
+ */
public static File jarFromResource(final String resourceName) {
return jarFromResource(Thread.currentThread().getContextClassLoader(), resourceName);
}
+ /**
+ *
+ * @param loader ClassLoader
+ * @param resourceName String
+ * @return File
+ */
public static File jarFromResource(final ClassLoader loader, final String resourceName) {
try {
URL url = loader.getResource(resourceName);
@@ -68,6 +83,11 @@ public class JarLocation {
}
}
+ /**
+ *
+ * @param clazz Class
+ * @return File
+ */
public static File jarLocation(final Class clazz) {
try {
final String classFileName = clazz.getName().replace(".", "/") + ".class";
@@ -80,13 +100,23 @@ public class JarLocation {
}
}
+ /**
+ *
+ * @param classFileName String
+ * @param url URL
+ * @return File
+ */
public static File toFile(final String classFileName, final URL url) {
String path = url.getFile();
path = path.substring(0, path.length() - classFileName.length());
return new File(decode(path));
}
-
+ /**
+ *
+ * @param fileName String
+ * @return String
+ */
public static String decode(final String fileName) {
if (fileName.indexOf('%') == -1) {
return fileName;
http://git-wip-us.apache.org/repos/asf/tomee/blob/0d70b3c3/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java
index 2ebadbb..635f30b 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java
@@ -20,6 +20,11 @@ import java.util.Properties;
public interface Loader {
+ /**
+ *
+ * @param properties Properties
+ * @throws Exception
+ */
void init(Properties properties) throws Exception;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/0d70b3c3/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java
index e894074..b9fc239 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java
@@ -17,10 +17,20 @@
package org.apache.openejb.loader;
public class LoaderRuntimeException extends RuntimeException {
+
+ /**
+ *
+ * @param str String
+ * @param e Throwable
+ */
public LoaderRuntimeException(final String str, final Throwable e) {
super(str, e);
}
+ /**
+ *
+ * @param e Exception
+ */
public LoaderRuntimeException(final Exception e) {
super(e);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/0d70b3c3/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
index c1dc806..43ab11c 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
@@ -25,12 +25,21 @@ public class OpenEJBInstance {
private final Method init;
private final Method isInitialized;
+ /**
+ *
+ * @throws Exception
+ */
public OpenEJBInstance() throws Exception {
final Class<?> openejb = loadOpenEJBClass();
this.init = openejb.getMethod("init", Properties.class);
this.isInitialized = openejb.getMethod("isInitialized");
}
+ /**
+ *
+ * @param props Properties
+ * @throws Exception
+ */
public void init(final Properties props) throws Exception {
try {
init.invoke(null, props);
@@ -44,6 +53,10 @@ public class OpenEJBInstance {
}
}
+ /**
+ *
+ * @return boolean
+ */
public boolean isInitialized() {
try {
return (Boolean) isInitialized.invoke(null);
http://git-wip-us.apache.org/repos/asf/tomee/blob/0d70b3c3/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
index d6e2482..c0fcf19 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
@@ -73,37 +73,76 @@ public class Options {
private final Options parent;
private final TomEEPropertyAdapter properties;
+ /**
+ *
+ * @param properties Properties
+ */
public Options(final Properties properties) {
this(properties, new NullOptions());
}
+ /**
+ *
+ * @param properties Properties
+ * @param parent Options
+ */
public Options(final Properties properties, final Options parent) {
this.parent = parent;
this.properties = new TomEEPropertyAdapter(properties);
}
+ /**
+ *
+ * @return Properties
+ */
public Properties getProperties() {
return properties.delegate;
}
+ /**
+ *
+ * @param logger Log
+ */
public void setLogger(final Log logger) {
parent.setLogger(logger);
}
+ /**
+ *
+ * @return Log
+ */
public Log getLogger() {
return parent.getLogger();
}
+ /**
+ *
+ * @param property String
+ * @return boolean
+ */
public boolean has(final String property) {
return properties.containsKey(property) || parent.has(property);
}
+ /**
+ *
+ * @param property String
+ * @param defaultValue String
+ * @return String
+ */
public String get(final String property, final String defaultValue) {
final String value = properties.getProperty(property);
return value != null ? log(property, value) : parent.get(property, defaultValue);
}
+ /**
+ *
+ * @param <T>
+ * @param property String
+ * @param defaultValue T
+ * @return
+ */
@SuppressWarnings("unchecked")
public <T> T get(final String property, final T defaultValue) {
if (defaultValue == null) {
@@ -128,6 +167,12 @@ public class Options {
}
}
+ /**
+ *
+ * @param property String
+ * @param defaultValue int
+ * @return int
+ */
public int get(final String property, final int defaultValue) {
final String value = properties.getProperty(property);
@@ -143,6 +188,12 @@ public class Options {
}
}
+ /**
+ *
+ * @param property String
+ * @param defaultValue long
+ * @return long
+ */
public long get(final String property, final long defaultValue) {
final String value = properties.getProperty(property);
@@ -158,6 +209,12 @@ public class Options {
}
}
+ /**
+ *
+ * @param property String
+ * @param defaultValue boolean
+ * @return boolean
+ */
public boolean get(final String property, final boolean defaultValue) {
final String value = properties.getProperty(property);
@@ -173,6 +230,12 @@ public class Options {
}
}
+ /**
+ *
+ * @param property String
+ * @param defaultValue
+ * @return
+ */
public Class<?> get(final String property, final Class<?> defaultValue) {
final String className = properties.getProperty(property);
@@ -189,6 +252,13 @@ public class Options {
}
}
+ /**
+ *
+ * @param <T>
+ * @param property String
+ * @param defaultValue
+ * @return
+ */
public <T extends Enum<T>> T get(final String property, final T defaultValue) {
final String value = properties.getProperty(property);
@@ -210,11 +280,25 @@ public class Options {
}
}
+ /**
+ *
+ * @param <T>
+ * @param property String
+ * @param defaultValue T...
+ * @return
+ */
public <T extends Enum<T>> Set<T> getAll(final String property, final T... defaultValue) {
final EnumSet<T> defaults = EnumSet.copyOf(Arrays.asList(defaultValue));
return getAll(property, defaults);
}
+ /**
+ *
+ * @param <T>
+ * @param property String
+ * @param defaultValue
+ * @return
+ */
public <T extends Enum<T>> Set<T> getAll(final String property, final Set<T> defaultValue) {
final Class<T> enumType;
try {
@@ -227,6 +311,13 @@ public class Options {
return getAll(property, defaultValue, enumType);
}
+ /**
+ *
+ * @param <T>
+ * @param property String
+ * @param enumType
+ * @return
+ */
public <T extends Enum<T>> Set<T> getAll(final String property, final Class<T> enumType) {
return getAll(property, Collections.EMPTY_SET, enumType);
}
@@ -310,6 +401,13 @@ public class Options {
return value;
}
+ /**
+ *
+ * @param <T>
+ * @param property String
+ * @param value
+ * @return
+ */
public <T extends Enum<T>> Set<T> logAll(final String property, final Set<T> value) {
if (!getLogger().isInfoEnabled()) {
return value;
@@ -320,7 +418,12 @@ public class Options {
return value;
}
-
+ /**
+ *
+ * @param <T>
+ * @param items
+ * @return
+ */
protected static <T extends Enum<T>> String[] lowercase(final T... items) {
final String[] values = new String[items.length];
for (int i = 0; i < items.length; i++) {
@@ -329,6 +432,12 @@ public class Options {
return values;
}
+ /**
+ *
+ * @param <T>
+ * @param items
+ * @return
+ */
protected static <T extends Enum<T>> String[] lowercase(final Collection<T> items) {
final String[] values = new String[items.size()];
int i = 0;
@@ -338,16 +447,32 @@ public class Options {
return values;
}
+ /**
+ *
+ * @param <V>
+ * @param v
+ * @return
+ */
protected static <V extends Enum<V>> String possibleValues(final V v) {
final Class<? extends Enum> enumType = v.getClass();
return possibleValues(enumType);
}
+ /**
+ *
+ * @param enumType
+ * @return
+ */
protected static String possibleValues(final Class<? extends Enum> enumType) {
return join(", ", lowercase(enumType.getEnumConstants()));
}
-
+ /**
+ *
+ * @param delimiter String
+ * @param collection Object...
+ * @return String
+ */
public static String join(final String delimiter, final Object... collection) {
final StringBuilder sb = new StringBuilder();
for (final Object obj : collection) {
@@ -422,7 +547,7 @@ public class Options {
final String defaultValues;
- if (defaults.size() == 0) {
+ if (defaults.isEmpty()) {
defaultValues = "NONE";
} else if (defaults.size() == enumType.getEnumConstants().length) {
defaultValues = "ALL";
@@ -469,10 +594,19 @@ public class Options {
public static final int OPENEJB_PREFIX_LENGHT = "openejb.".length();
private final Properties delegate;
+ /**
+ *
+ * @param properties Properties
+ */
public TomEEPropertyAdapter(final Properties properties) {
this.delegate = properties;
}
+ /**
+ *
+ * @param key String
+ * @return String
+ */
public String getProperty(final String key) {
String value = delegate.getProperty(key);
@@ -483,6 +617,11 @@ public class Options {
return value;
}
+ /**
+ *
+ * @param key String
+ * @return boolean
+ */
public boolean containsKey(final String key) {
return delegate.containsKey(key)
|| delegate.containsKey(getTomeeKey(key));
@@ -514,41 +653,81 @@ public class Options {
}
public static class NullLog implements Log {
+
+ /**
+ *
+ * @return boolean
+ */
@Override
public boolean isDebugEnabled() {
return false;
}
+ /**
+ *
+ * @return boolean
+ */
@Override
public boolean isInfoEnabled() {
return false;
}
+ /**
+ *
+ * @return boolean
+ */
@Override
public boolean isWarningEnabled() {
return false;
}
+ /**
+ *
+ * @param message String
+ * @param t Throwable
+ */
@Override
public void warning(final String message, final Throwable t) {
}
+ /**
+ *
+ * @param message String
+ */
@Override
public void warning(final String message) {
}
+ /**
+ *
+ * @param message String
+ * @param t Throwable
+ */
@Override
public void debug(final String message, final Throwable t) {
}
+ /**
+ *
+ * @param message String
+ */
@Override
public void debug(final String message) {
}
+ /**
+ *
+ * @param message String
+ * @param t Throwable
+ */
@Override
public void info(final String message, final Throwable t) {
}
+ /**
+ *
+ * @param message String
+ */
@Override
public void info(final String message) {
}
[20/20] tomee git commit: This closes #262. Thanks cicekhayri.
Posted by jl...@apache.org.
This closes #262. Thanks cicekhayri.
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/0866dbe4
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/0866dbe4
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/0866dbe4
Branch: refs/heads/master
Commit: 0866dbe4552c98f1f79e2802120c8afa4e7ce24c
Parents: df8d80e 0f64bd7
Author: Jean-Louis Monteiro <je...@gmail.com>
Authored: Thu Dec 27 11:01:02 2018 +0100
Committer: Jean-Louis Monteiro <je...@gmail.com>
Committed: Thu Dec 27 11:01:02 2018 +0100
----------------------------------------------------------------------
.../openejb/loader/BasicURLClassPath.java | 6 +++
.../apache/openejb/loader/ClassPathFactory.java | 1 +
.../org/apache/openejb/loader/Embedder.java | 2 +-
.../org/apache/openejb/loader/FileUtils.java | 5 +--
.../java/org/apache/openejb/loader/Files.java | 26 ++++++-----
.../main/java/org/apache/openejb/loader/IO.java | 13 +-----
.../org/apache/openejb/loader/JarLocation.java | 1 -
.../openejb/loader/LoaderRuntimeException.java | 1 +
.../apache/openejb/loader/OpenEJBInstance.java | 2 +-
.../java/org/apache/openejb/loader/Options.java | 7 ++-
.../apache/openejb/loader/SystemInstance.java | 30 ++++++-------
.../apache/openejb/loader/TomcatClassPath.java | 2 +-
.../apache/openejb/loader/WebAppClassPath.java | 1 +
.../java/org/apache/openejb/loader/Zips.java | 1 +
.../provisining/ProvisioningResolverAware.java | 1 +
.../openejb/observer/ObserverManager.java | 46 ++++++++++----------
.../org/apache/openejb/loader/FilesTest.java | 23 +++++-----
.../apache/openejb/observer/EventSpeedTest.java | 6 +--
.../openejb/observer/ObserverFeaturesTest.java | 4 +-
.../openejb/observer/ObserverListTest.java | 2 +-
20 files changed, 90 insertions(+), 90 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/0866dbe4/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
----------------------------------------------------------------------
[04/20] tomee git commit: JavaDoc and use of diamond operator
Posted by jl...@apache.org.
JavaDoc and use of diamond operator
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/7ffcb012
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/7ffcb012
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/7ffcb012
Branch: refs/heads/master
Commit: 7ffcb01291a9cb369d1e5ddd1612bdf9f196698c
Parents: 5af81aa
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 22:13:18 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 22:13:18 2018 +0100
----------------------------------------------------------------------
.../openejb/loader/event/ComponentAdded.java | 13 +++
.../openejb/loader/event/ComponentRemoved.java | 13 +++
.../loader/provisining/HttpResolver.java | 5 ++
.../loader/provisining/MavenResolver.java | 10 +++
.../provisining/ProvisiningResolverCreated.java | 9 ++
.../provisining/ProvisioningResolver.java | 28 +++++++
.../provisining/ProvisioningResolverAware.java | 5 ++
.../openejb/observer/ObserverManager.java | 88 +++++++++++++++-----
.../openejb/observer/event/ObserverAdded.java | 8 ++
.../openejb/observer/event/ObserverFailed.java | 23 +++++
.../openejb/observer/event/ObserverRemoved.java | 8 ++
11 files changed, 188 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
index 5370107..9568d87 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
@@ -27,15 +27,28 @@ public class ComponentAdded<T> {
private final Class<T> type;
private final T component;
+ /**
+ *
+ * @param type
+ * @param component
+ */
public ComponentAdded(final Class<T> type, final T component) {
this.type = type;
this.component = component;
}
+ /**
+ *
+ * @return
+ */
public Class<T> getType() {
return type;
}
+ /**
+ *
+ * @return
+ */
public T getComponent() {
return component;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
index 095aece..aae7ba2 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
@@ -27,15 +27,28 @@ public class ComponentRemoved<T> {
private final Class<T> type;
private final T component;
+ /**
+ *
+ * @param type
+ * @param component
+ */
public ComponentRemoved(final Class<T> type, final T component) {
this.type = type;
this.component = component;
}
+ /**
+ *
+ * @return
+ */
public Class<T> getType() {
return type;
}
+ /**
+ *
+ * @return
+ */
public T getComponent() {
return component;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java
index db8139f..34d625f 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java
@@ -57,6 +57,11 @@ public class HttpResolver implements ArchiveResolver {
return lastPart(rawLocation.replace(':', '/'));
}
+ /**
+ *
+ * @param location String
+ * @return String
+ */
public static String lastPart(final String location) {
int idx = location.lastIndexOf('/');
if (idx <= 0) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
index 2f8c60d..e753b4f 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
@@ -93,6 +93,12 @@ public class MavenResolver implements ArchiveResolver, ProvisioningResolverAware
return Objects.requireNonNull(SystemInstance.get().getComponent(ProvisioningResolver.class)).resolveStream(repo1Url);
}
+ /**
+ *
+ * @param raw String
+ * @return String
+ * @throws MalformedURLException
+ */
public String quickMvnUrl(final String raw) throws MalformedURLException {
final String base;
if (raw.contains(SNAPSHOT_SUFFIX) && raw.contains("apache")) {
@@ -289,6 +295,10 @@ public class MavenResolver implements ArchiveResolver, ProvisioningResolverAware
return defaultVersion;
}
+ /**
+ *
+ * @param resolver ProvisioningResolver
+ */
@Override
public void setResolver(final ProvisioningResolver resolver) {
this.resolver = resolver;
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java
index fbdc767..421f887 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java
@@ -22,10 +22,19 @@ import org.apache.openejb.observer.Event;
public class ProvisiningResolverCreated {
private final ProvisioningResolver resolver;
+ /**
+ *
+ * @param provisioningResolver ProvisioningResolver
+ */
public ProvisiningResolverCreated(final ProvisioningResolver provisioningResolver) {
resolver = provisioningResolver;
}
+ /**
+ *
+ * @param resolver ArchiveResolver
+ * @return ProvisiningResolverCreated
+ */
public ProvisiningResolverCreated register(final ArchiveResolver resolver) {
this.resolver.addResolver(resolver);
return this;
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
index 0d881fc..698b002 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
@@ -74,16 +74,29 @@ public class ProvisioningResolver {
}
}
+ /**
+ *
+ * @param resolver ArchiveResolver
+ */
public void addResolver(final ArchiveResolver resolver) {
if (resolvers.put(resolver.prefix(), resolver) != null) {
Logger.getLogger(ProvisioningResolver.class.getName()).warning("Overriding resolver " + resolver.prefix() + " with " + resolver);
}
}
+ /**
+ *
+ * @param resolver ArchiveResolver
+ */
public void removeResolver(final ArchiveResolver resolver) {
resolvers.remove(resolver.prefix());
}
+ /**
+ *
+ * @param rawLocation String
+ * @return
+ */
public Set<String> realLocation(final String rawLocation) {
// if direct file path then use it
final File file = new File(rawLocation);
@@ -158,6 +171,12 @@ public class ProvisioningResolver {
}
}
+ /**
+ *
+ * @param rawLocation String
+ * @return InputStream
+ * @throws MalformedURLException
+ */
public InputStream resolveStream(final String rawLocation) throws MalformedURLException {
final File file = new File(rawLocation);
if (file.exists()) {
@@ -172,10 +191,19 @@ public class ProvisioningResolver {
return null;
}
+ /**
+ *
+ * @return String
+ */
public static String cache() {
return System.getProperty(OPENEJB_DEPLOYER_CACHE_FOLDER, TEMP_DIR);
}
+ /**
+ *
+ * @param path String
+ * @return File
+ */
public static File cacheFile(final String path) {
final String cache = cache();
if (new File(cache).isAbsolute()) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java
index 9b290d8..7fc4dd3 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java
@@ -21,5 +21,10 @@ package org.apache.openejb.loader.provisining;
//
// ex: mvn delegates to http if the archive is not found locally
public interface ProvisioningResolverAware {
+
+ /**
+ *
+ * @param resolver ProvisioningResolver
+ */
void setResolver(ProvisioningResolver resolver);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
index ebd16de..462a46c 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
@@ -43,18 +43,23 @@ import java.util.logging.Logger;
public class ObserverManager {
- private static final ThreadLocal<Set<Invocation>> seen = new ThreadLocal<Set<Invocation>>() {
+ private static final ThreadLocal<Set<Invocation>> SEEN = new ThreadLocal<Set<Invocation>>() {
@Override
protected Set<Invocation> initialValue() {
- return new HashSet<Invocation>();
+ return new HashSet<>();
}
};
// lazy init since it is used in SystemInstance
private static final AtomicReference<Logger> LOGGER = new AtomicReference<Logger>();
- private final Set<Observer> observers = new LinkedHashSet<Observer>();
- private final Map<Class, Invocation> methods = new ConcurrentHashMap<Class, Invocation>();
+ private final Set<Observer> observers = new LinkedHashSet<>();
+ private final Map<Class, Invocation> methods = new ConcurrentHashMap<>();
+ /**
+ *
+ * @param observer Object
+ * @return boolean
+ */
public boolean addObserver(final Object observer) {
if (observer == null) {
throw new IllegalArgumentException("observer cannot be null");
@@ -74,6 +79,11 @@ public class ObserverManager {
}
}
+ /**
+ *
+ * @param observer Object
+ * @return boolean
+ */
public boolean removeObserver(final Object observer) {
if (observer == null) {
throw new IllegalArgumentException("listener cannot be null");
@@ -99,7 +109,7 @@ public class ObserverManager {
try {
return doFire(event);
} finally {
- seen.remove();
+ SEEN.remove();
}
}
@@ -168,17 +178,13 @@ public class ObserverManager {
}
}
- if (list.getInvocations().size() == 0) {
-
- return IGNORE;
-
- } else if (list.getInvocations().size() == 1) {
-
- return list.getInvocations().get(0);
-
- } else {
-
- return list;
+ switch (list.getInvocations().size()) {
+ case 0:
+ return IGNORE;
+ case 1:
+ return list.getInvocations().get(0);
+ default:
+ return list;
}
}
@@ -187,9 +193,9 @@ public class ObserverManager {
*/
public class Observer {
- private final Map<Class, Invocation> before = new ConcurrentHashMap<Class, Invocation>();
- private final Map<Class, Invocation> methods = new ConcurrentHashMap<Class, Invocation>();
- private final Map<Class, Invocation> after = new ConcurrentHashMap<Class, Invocation>();
+ private final Map<Class, Invocation> before = new ConcurrentHashMap<>();
+ private final Map<Class, Invocation> methods = new ConcurrentHashMap<>();
+ private final Map<Class, Invocation> after = new ConcurrentHashMap<>();
private final Object observer;
public Observer(final Object observer) {
@@ -197,7 +203,7 @@ public class ObserverManager {
throw new IllegalArgumentException("observer cannot be null");
}
- final Set<Method> methods = new HashSet<Method>();
+ final Set<Method> methods = new HashSet<>();
methods.addAll(Arrays.asList(observer.getClass().getMethods()));
methods.addAll(Arrays.asList(observer.getClass().getDeclaredMethods()));
@@ -315,14 +321,30 @@ public class ObserverManager {
}
}
+ /**
+ *
+ * @param event Phase
+ * @param eventType Class
+ * @return Invocation
+ */
public Invocation get(final Phase event, final Class eventType) {
return get(map(event), eventType);
}
+ /**
+ *
+ * @param eventType Class
+ * @return Invocation
+ */
public Invocation getAfter(final Class eventType) {
return get(after, eventType);
}
+ /**
+ *
+ * @param eventType Class
+ * @return
+ */
public Invocation getBefore(final Class eventType) {
return get(before, eventType);
}
@@ -395,17 +417,26 @@ public class ObserverManager {
private final Method method;
private final Object observer;
+ /**
+ *
+ * @param method Method
+ * @param observer Object
+ */
public MethodInvocation(final Method method, final Object observer) {
this.method = method;
this.observer = observer;
}
+ /**
+ *
+ * @param event Object
+ */
@Override
public void invoke(final Object event) {
try {
method.invoke(observer, event);
} catch (final InvocationTargetException e) {
- if (!seen.get().add(this)) {
+ if (!SEEN.get().add(this)) {
return;
}
@@ -505,16 +536,29 @@ public class ObserverManager {
public static class InvocationList implements Invocation {
- private final List<Invocation> invocations = new LinkedList<Invocation>();
+ private final List<Invocation> invocations = new LinkedList<>();
+ /**
+ *
+ * @param invocation Invocation
+ * @return boolean
+ */
public boolean add(final Invocation invocation) {
return invocations.add(invocation);
}
+ /**
+ *
+ * @return
+ */
public List<Invocation> getInvocations() {
return invocations;
}
+ /**
+ *
+ * @param event Object
+ */
@Override
public void invoke(final Object event) {
for (final Invocation invocation : invocations) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
index 87dbd74..279a17e 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
@@ -26,10 +26,18 @@ public class ObserverAdded {
private final Object observer;
+ /**
+ *
+ * @param observer Object
+ */
public ObserverAdded(final Object observer) {
this.observer = observer;
}
+ /**
+ *
+ * @return Object
+ */
public Object getObserver() {
return observer;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
index 83beb49..dabec53 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
@@ -34,6 +34,13 @@ public class ObserverFailed {
private final Throwable throwable;
+ /**
+ *
+ * @param observer Object
+ * @param method Method
+ * @param event Object
+ * @param throwable Throwable
+ */
public ObserverFailed(final Object observer, final Method method, final Object event, final Throwable throwable) {
this.observer = observer;
this.event = event;
@@ -41,18 +48,34 @@ public class ObserverFailed {
this.throwable = throwable;
}
+ /**
+ *
+ * @return Method
+ */
public Method getMethod() {
return method;
}
+ /**
+ *
+ * @return Object
+ */
public Object getObserver() {
return observer;
}
+ /**
+ *
+ * @return Object
+ */
public Object getEvent() {
return event;
}
+ /**
+ *
+ * @return Throwable
+ */
public Throwable getThrowable() {
return throwable;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/7ffcb012/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
index f33efa3..d06eba1 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
@@ -26,10 +26,18 @@ public class ObserverRemoved {
private final Object observer;
+ /**
+ *
+ * @param observer Object
+ */
public ObserverRemoved(final Object observer) {
this.observer = observer;
}
+ /**
+ *
+ * @return Object
+ */
public Object getObserver() {
return observer;
}
[06/20] tomee git commit: update JavaDoc
Posted by jl...@apache.org.
update JavaDoc
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d815cee9
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d815cee9
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d815cee9
Branch: refs/heads/master
Commit: d815cee954f0deb03a831920d5f5047712f4f1a1
Parents: c479023
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 22:23:00 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 22:23:00 2018 +0100
----------------------------------------------------------------------
.../openejb/loader/BasicURLClassPath.java | 25 +++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/d815cee9/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
index c78f223..b9bf5df 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
@@ -27,6 +27,11 @@ import java.security.PrivilegedAction;
import java.util.Locale;
public abstract class BasicURLClassPath implements ClassPath {
+
+ /**
+ *
+ * @return ClassLoader
+ */
public static ClassLoader getContextClassLoader() {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
@@ -39,6 +44,12 @@ public abstract class BasicURLClassPath implements ClassPath {
private Field ucpField;
private boolean ucpFieldErrorLogged;
+ /**
+ *
+ * @param jar URL
+ * @param loader URLClassLoader
+ * @throws Exception
+ */
protected void addJarToPath(final URL jar, final URLClassLoader loader) throws Exception {
final Object cp = getURLClassPath(loader);
if (cp == null && CustomizableURLClassLoader.class.isInstance(loader)) {
@@ -69,8 +80,8 @@ public abstract class BasicURLClassPath implements ClassPath {
/**
*
- * @param dir
- * @param loader
+ * @param dir File
+ * @param loader URLClassLoader
* @throws Exception
*/
protected synchronized void addJarsToPath(final File dir, final URLClassLoader loader) throws Exception {
@@ -119,7 +130,7 @@ public abstract class BasicURLClassPath implements ClassPath {
/**
*
- * @param loader
+ * @param loader URLClassLoader
* @return Object
* @throws Exception
*/
@@ -159,10 +170,18 @@ public abstract class BasicURLClassPath implements ClassPath {
ClassLoader.registerAsParallelCapable();
}
+ /**
+ *
+ * @param parent ClassLoader
+ */
public CustomizableURLClassLoader(final ClassLoader parent) {
super(new URL[0], parent);
}
+ /**
+ *
+ * @param url URL
+ */
public void add(final URL url) {
super.addURL(url);
}
[08/20] tomee git commit: remove empty JavaDoc
Posted by jl...@apache.org.
remove empty JavaDoc
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/421065ef
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/421065ef
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/421065ef
Branch: refs/heads/master
Commit: 421065ef68a89a31ec3bbfe7305b9ce668f802eb
Parents: cdb9e44
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 23:08:31 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 23:08:31 2018 +0100
----------------------------------------------------------------------
.../loader/provisining/ProvisioningResolver.java | 4 ----
.../apache/openejb/observer/ObserverManager.java | 4 ----
.../openejb/observer/event/ObserverAdded.java | 4 ----
.../openejb/observer/event/ObserverFailed.java | 16 ----------------
.../openejb/observer/event/ObserverRemoved.java | 4 ----
5 files changed, 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/421065ef/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
index 698b002..ebe8dff 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
@@ -191,10 +191,6 @@ public class ProvisioningResolver {
return null;
}
- /**
- *
- * @return String
- */
public static String cache() {
return System.getProperty(OPENEJB_DEPLOYER_CACHE_FOLDER, TEMP_DIR);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/421065ef/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
index 8abab63..c255367 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
@@ -549,10 +549,6 @@ public class ObserverManager {
return invocations.add(invocation);
}
- /**
- *
- * @return
- */
public List<Invocation> getInvocations() {
return invocations;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/421065ef/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
index 279a17e..361ee0a 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
@@ -34,10 +34,6 @@ public class ObserverAdded {
this.observer = observer;
}
- /**
- *
- * @return Object
- */
public Object getObserver() {
return observer;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/421065ef/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
index dabec53..9d27b68 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
@@ -48,34 +48,18 @@ public class ObserverFailed {
this.throwable = throwable;
}
- /**
- *
- * @return Method
- */
public Method getMethod() {
return method;
}
- /**
- *
- * @return Object
- */
public Object getObserver() {
return observer;
}
- /**
- *
- * @return Object
- */
public Object getEvent() {
return event;
}
- /**
- *
- * @return Throwable
- */
public Throwable getThrowable() {
return throwable;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/421065ef/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
index d06eba1..a685757 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
@@ -34,10 +34,6 @@ public class ObserverRemoved {
this.observer = observer;
}
- /**
- *
- * @return Object
- */
public Object getObserver() {
return observer;
}
[12/20] tomee git commit: revert back to Random
Posted by jl...@apache.org.
revert back to Random
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/40dc3201
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/40dc3201
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/40dc3201
Branch: refs/heads/master
Commit: 40dc320128f21666752b39052c78444776d7d6fc
Parents: 5e3feac
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Sun Dec 9 10:21:09 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Sun Dec 9 10:21:09 2018 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/openejb/loader/FileUtils.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/40dc3201/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
index 965af03..747f7c8 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
@@ -20,12 +20,11 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Hashtable;
-import java.util.concurrent.ThreadLocalRandom;
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
public class FileUtils {
- private static final ThreadLocalRandom RANDOM = ThreadLocalRandom.current();
+ private static final java.util.Random RANDOM = new java.util.Random();
private File home;
[13/20] tomee git commit: use ThreadLocalRandom
Posted by jl...@apache.org.
use ThreadLocalRandom
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/6450b2b4
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/6450b2b4
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/6450b2b4
Branch: refs/heads/master
Commit: 6450b2b4b68c0bc06a7e32ebcc80573aa71be69a
Parents: 40dc320
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Mon Dec 10 13:32:27 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Mon Dec 10 13:32:27 2018 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/openejb/loader/FileUtils.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/6450b2b4/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
index 747f7c8..f6f15cd 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
@@ -20,12 +20,11 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Hashtable;
+import java.util.concurrent.ThreadLocalRandom;
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
public class FileUtils {
- private static final java.util.Random RANDOM = new java.util.Random();
-
private File home;
private FileUtils(final String homeDir, final String defaultDir) {
@@ -165,7 +164,7 @@ public class FileUtils {
public static File createTempDirectory(final String pathPrefix) throws IOException {
for (int maxAttempts = 100; maxAttempts > 0; --maxAttempts) {
- final String path = pathPrefix + RANDOM.nextLong();
+ final String path = pathPrefix + ThreadLocalRandom.current().nextLong();
final File tmpDir = new File(path);
if (!tmpDir.exists() && tmpDir.mkdirs()) {
[16/20] tomee git commit: Add JavaDoc
Posted by jl...@apache.org.
Add JavaDoc
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/37f8bcb3
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/37f8bcb3
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/37f8bcb3
Branch: refs/heads/master
Commit: 37f8bcb368b0b28006cd20c35a1ce9eefd609ad7
Parents: 743ae60
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Tue Dec 11 21:43:20 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Tue Dec 11 21:43:20 2018 +0100
----------------------------------------------------------------------
.../java/org/apache/openejb/observer/ObserverManager.java | 4 ++--
.../org/apache/openejb/observer/event/ObserverAdded.java | 10 ++++++++++
.../apache/openejb/observer/event/ObserverRemoved.java | 10 ++++++++++
3 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/37f8bcb3/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
index 29a44be..22be6c6 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
@@ -56,7 +56,7 @@ public class ObserverManager {
private final Map<Class, Invocation> methods = new ConcurrentHashMap<>();
/**
- * Add Object to Observer
+ * Add the provided object to be observable
*
* @param observer Object
* @return boolean
@@ -81,7 +81,7 @@ public class ObserverManager {
}
/**
- * Remove Object from Observer
+ * Remove the observable object so this object doesn't have any observers
*
* @param observer Object
* @return boolean
http://git-wip-us.apache.org/repos/asf/tomee/blob/37f8bcb3/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
index 87dbd74..0848ab5 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
@@ -26,10 +26,20 @@ public class ObserverAdded {
private final Object observer;
+ /**
+ * Add the provided object to be observable
+ *
+ * @param observer
+ */
public ObserverAdded(final Object observer) {
this.observer = observer;
}
+ /**
+ * Return the observable object
+ *
+ * @return
+ */
public Object getObserver() {
return observer;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/37f8bcb3/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
index f33efa3..2c07bf2 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
@@ -26,10 +26,20 @@ public class ObserverRemoved {
private final Object observer;
+ /**
+ * Remove the observable object so this object doesn't have any observers
+ *
+ * @param observer
+ */
public ObserverRemoved(final Object observer) {
this.observer = observer;
}
+ /**
+ * Return the observable object
+ *
+ * @return
+ */
public Object getObserver() {
return observer;
}
[10/20] tomee git commit: use diamond op.
Posted by jl...@apache.org.
use diamond op.
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/b5acec20
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/b5acec20
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/b5acec20
Branch: refs/heads/master
Commit: b5acec204b7c65c17a5c64ae2beafe71ee2a6a04
Parents: 49effbf
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 23:52:41 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 23:52:41 2018 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/openejb/loader/FileUtils.java | 4 ++--
.../src/main/java/org/apache/openejb/loader/Files.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/b5acec20/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
index b9ef77f..965af03 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
@@ -25,7 +25,7 @@ import java.util.concurrent.ThreadLocalRandom;
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
public class FileUtils {
- private static final ThreadLocalRandom _random = ThreadLocalRandom.current();
+ private static final ThreadLocalRandom RANDOM = ThreadLocalRandom.current();
private File home;
@@ -166,7 +166,7 @@ public class FileUtils {
public static File createTempDirectory(final String pathPrefix) throws IOException {
for (int maxAttempts = 100; maxAttempts > 0; --maxAttempts) {
- final String path = pathPrefix + _random.nextLong();
+ final String path = pathPrefix + RANDOM.nextLong();
final File tmpDir = new File(path);
if (!tmpDir.exists() && tmpDir.mkdirs()) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/b5acec20/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
index e622851..f19b1cb 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
@@ -357,7 +357,7 @@ public class Files {
// Shutdown hook for recursive DELETE on tmp directories
- static final List<String> DELETE = new ArrayList<String>();
+ private static final List<String> DELETE = new ArrayList<>();
static {
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
[19/20] tomee git commit: removed javadocs, which doesnt add anything
Posted by jl...@apache.org.
removed javadocs, which doesnt add anything
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/0f64bd7e
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/0f64bd7e
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/0f64bd7e
Branch: refs/heads/master
Commit: 0f64bd7e238786e2ac950a0e371c170ce3287398
Parents: 3bf930d
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Thu Dec 27 10:30:55 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Thu Dec 27 10:30:55 2018 +0100
----------------------------------------------------------------------
.../openejb/loader/BasicURLClassPath.java | 20 --
.../org/apache/openejb/loader/ClassPath.java | 14 --
.../apache/openejb/loader/ContextClassPath.java | 12 --
.../org/apache/openejb/loader/FileUtils.java | 48 -----
.../java/org/apache/openejb/loader/Files.java | 141 -------------
.../main/java/org/apache/openejb/loader/IO.java | 198 -------------------
.../org/apache/openejb/loader/JarLocation.java | 19 --
.../java/org/apache/openejb/loader/Options.java | 26 ---
.../apache/openejb/loader/SystemInstance.java | 32 ---
.../java/org/apache/openejb/loader/Zips.java | 23 ---
.../provisining/ProvisioningResolver.java | 21 --
.../openejb/observer/ObserverManager.java | 12 --
.../openejb/observer/event/ObserverAdded.java | 10 -
.../openejb/observer/event/ObserverRemoved.java | 10 -
14 files changed, 586 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
index caba783..eed9457 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
@@ -28,11 +28,6 @@ import java.util.Locale;
public abstract class BasicURLClassPath implements ClassPath {
- /**
- * Returns the context ClassLoader for this Thread or null
- *
- * @return ClassLoader ClassLoader
- */
public static ClassLoader getContextClassLoader() {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
@@ -45,14 +40,6 @@ public abstract class BasicURLClassPath implements ClassPath {
private Field ucpField;
private boolean ucpFieldErrorLogged;
- /**
- * Add Jar to the URLClassPath
- *
- * Throws Exception if fails any
- * @param jar URL
- * @param loader URLClassLoader
- * @throws Exception
- */
protected void addJarToPath(final URL jar, final URLClassLoader loader) throws Exception {
final Object cp = getURLClassPath(loader);
if (cp == null && CustomizableURLClassLoader.class.isInstance(loader)) {
@@ -81,13 +68,6 @@ public abstract class BasicURLClassPath implements ClassPath {
});
}
- /**
- * Adds Jars to the URLClassPath
- *
- * @param dir File
- * @param loader URLClassLoader
- * @throws Exception
- */
protected synchronized void addJarsToPath(final File dir, final URLClassLoader loader) throws Exception {
if (dir == null || !dir.exists()) {
return;
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
index 4a12085..6cdb335 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
@@ -23,21 +23,7 @@ public interface ClassPath {
ClassLoader getClassLoader();
- /**
- * Add Jars to the URL ClassPath
- * Throws Exception if it fails
- *
- * @param dir File
- * @throws Exception
- */
void addJarsToPath(File dir) throws Exception;
- /**
- * Add Jar to the URL ClassPath
- * Throws Exception if it fails
- *
- * @param dir URL
- * @throws Exception
- */
void addJarToPath(URL dir) throws Exception;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
index af0bfef..71c4aa2 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
@@ -31,12 +31,6 @@ public class ContextClassPath extends BasicURLClassPath {
return getContextClassLoader();
}
- /**
- * Add Jars to URLClassPath
- *
- * @param dir File
- * @throws Exception
- */
@Override
public void addJarsToPath(final File dir) throws Exception {
final ClassLoader contextClassLoader = getContextClassLoader();
@@ -46,12 +40,6 @@ public class ContextClassPath extends BasicURLClassPath {
}
}
- /**
- * Add Jar to URLClassPath
- *
- * @param jar URL
- * @throws Exception
- */
@Override
public void addJarToPath(final URL jar) throws Exception {
final ClassLoader contextClassLoader = getContextClassLoader();
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
index c182b8e..7030146 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
@@ -58,14 +58,6 @@ public class FileUtils {
}
}
- /**
- * Returns the cannonical pathname
- *
- *
- * @param path String
- * @return File
- * @throws IOException if an I/O error occurs
- */
public File getDirectory(final String path) throws IOException {
return getDirectory(path, false);
}
@@ -79,14 +71,6 @@ public class FileUtils {
return this.getDirectory().equals(that.getDirectory());
}
- /**
- * Returns canonical form of the specified path
- *
- * @param path String
- * @param create boolean
- * @return File
- * @throws IOException if an I/O error occurs
- */
public File getDirectory(final String path, final boolean create) throws IOException {
File dir = new File(home, path);
dir = dir.getCanonicalFile();
@@ -115,25 +99,10 @@ public class FileUtils {
this.home = dir;
}
- /**
- * Returns File at specified path String
- *
- * @param path String
- * @return File
- * @throws IOException
- */
public File getFile(final String path) throws IOException {
return getFile(path, true);
}
- /**
- * Returns File at specified path String
- *
- * @param path String
- * @param validate boolean
- * @return File
- * @throws IOException if and I/O error occurs
- */
public File getFile(final String path, final boolean validate) throws IOException {
File file = new File(path);
@@ -150,15 +119,6 @@ public class FileUtils {
return file;
}
- /**
- * Creates Temp Directory
- *
- * Throws IOException if directory doesn't exists and if it fails to create directories
- *
- * @param pathPrefix path prefix
- * @return File File
- * @throws IOException
- */
public static File createTempDirectory(final String pathPrefix) throws IOException {
for (int maxAttempts = 100; maxAttempts > 0; --maxAttempts) {
@@ -172,14 +132,6 @@ public class FileUtils {
throw new IOException("Cannot create temporary directory at: " + pathPrefix);
}
- /**
- * Creates Temp Directory
- *
- * Throws IOException if directory doesn't exists and if it fails to create directories
- *
- * @return File File
- * @throws IOException
- */
public static File createTempDirectory() throws IOException {
final String prefix = System.getProperty("java.io.tmpdir", File.separator + "tmp") + File.separator + "openejb";
return createTempDirectory(prefix);
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
index 6b247ec..ff3f32d 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
@@ -46,12 +46,6 @@ public class Files {
private static final Map<String, MessageDigest> DIGESTS = new HashMap<>();
private static final boolean IS_WINDOWS = System.getProperty("os.name", "unknown").toLowerCase(Locale.ENGLISH).startsWith("win");
- /**
- * Returns the absolute path of the File Object
- *
- * @param parts String...
- * @return File
- */
public static File path(final String... parts) {
File dir = null;
for (final String part : parts) {
@@ -65,13 +59,6 @@ public class Files {
return null != dir ? dir.getAbsoluteFile() : dir;
}
- /**
- * Returns the absolute path of the File Object
- *
- * @param dir File
- * @param parts String...
- * @return File
- */
public static File path(final File dir, final String... parts) {
File base = dir;
int idx = 0;
@@ -90,35 +77,14 @@ public class Files {
return base.getAbsoluteFile();
}
- /**
- * Returns a List of pathnames for File Objects
- *
- * @param dir File
- * @param regex String
- * @return List of Files
- */
public static List<File> collect(final File dir, final String regex) {
return collect(dir, Pattern.compile(regex));
}
- /**
- * Returns a List of pathnames for File Objects
- *
- * @param dir File
- * @param pattern Pattern
- * @return List of Files
- */
public static List<File> collect(final File dir, final Pattern pattern) {
return collect(dir, new PatternFileFilter(pattern));
}
- /**
- * Returns a List of pathnames for File Objects
- *
- * @param dir File
- * @param filter FileFilter
- * @return List of Files
- */
public static List<File> collect(final File dir, final FileFilter filter) {
final List<File> accepted = new ArrayList<>();
if (filter.accept(dir)) {
@@ -135,14 +101,6 @@ public class Files {
return accepted;
}
- /**
- * Method to check if the file or direcotory exists
- *
- * @param file File
- * @param s String
- * @return File
- * @Throws FileRuntimeException on failure at any point
- */
public static File exists(final File file, final String s) {
if (!file.exists()) {
throw new FileDoesNotExistException(s + " does not exist: " + file.getAbsolutePath());
@@ -150,13 +108,6 @@ public class Files {
return file;
}
- /**
- * Method to check if the file or direcotory exists
- *
- * @param file File
- * @return File
- * @Throws FileRuntimeException on failure at any point
- */
public static File exists(final File file) {
if (!file.exists()) {
throw new FileDoesNotExistException("Does not exist: " + file.getAbsolutePath());
@@ -164,13 +115,6 @@ public class Files {
return file;
}
- /**
- * Method to check if it is a directory
- *
- * @param file File
- * @return File
- * @Throws FileRuntimeException on failure at any point
- */
public static File dir(final File file) {
if (!file.isDirectory()) {
throw new FileRuntimeException("Not a directory: " + file.getAbsolutePath());
@@ -179,14 +123,6 @@ public class Files {
return file;
}
- /**
- * Method to create a file
- *
- * @param file File
- * @return File
- * @throws IOException if an I/O error occurs
- * @Throws FileRuntimeException on failure at any point
- */
public static File touch(final File file) throws IOException {
if (!file.createNewFile()) {
throw new FileRuntimeException("Cannot create file: " + file.getAbsolutePath());
@@ -194,13 +130,6 @@ public class Files {
return file;
}
- /**
- * Method to check if the specified File Object is a File
- *
- * @param file File
- * @return File
- * @Throws FileRuntimeException on failure at any point
- */
public static File file(final File file) {
exists(file);
if (!file.isFile()) {
@@ -209,13 +138,6 @@ public class Files {
return file;
}
- /**
- * Method to check if File Object is hidden
- *
- * @param file File
- * @return File
- * @Throws FileRuntimeException on failure at any point
- */
public static File notHidden(final File file) {
exists(file);
if (file.isHidden()) {
@@ -224,13 +146,6 @@ public class Files {
return file;
}
- /**
- * Method to check if File Object is writeable
- *
- * @param file File
- * @return File
- * @Throws FileRuntimeException on failure at any point
- */
public static File writable(final File file) {
if (!file.canWrite()) {
throw new FileRuntimeException("Not writable: " + file.getAbsolutePath());
@@ -238,13 +153,6 @@ public class Files {
return file;
}
- /**
- * Method to check if File Object is readable
- *
- * @param file File
- * @return File
- * @Throws FileRuntimeException on failure at any point
- */
public static File readable(final File file) {
if (!file.canRead()) {
throw new FileRuntimeException("Not readable: " + file.getAbsolutePath());
@@ -252,23 +160,10 @@ public class Files {
return file;
}
- /**
- * File Object is readble
- *
- * @param file File
- * @return File
- */
public static File readableFile(final File file) {
return readable(file(file));
}
- /**
- * Create directory by the specified path
- *
- * @param file File
- * @return File
- * @Throws FileRuntimeException if it fails to create directory
- */
public static File mkdir(final File file) {
if (file.exists()) {
return file;
@@ -289,23 +184,10 @@ public class Files {
}
}
- /**
- * Create directory by the specified parent pathname and child pathname
- *
- * @param file file
- * @param name String
- * @return File
- */
public static File mkdir(final File file, final String name) {
return mkdir(new File(file, name));
}
- /**
- * Method to create tmp directory
- *
- * @return File
- * @Throws IOException if an I/O error occurs
- */
public static File tmpdir() {
try {
File file;
@@ -340,24 +222,11 @@ public class Files {
}
}
- /**
- * Create parent pathname by the specified pathname
- *
- * @param file File
- * @return File
- */
public static File mkparent(final File file) {
mkdirs(file.getParentFile());
return file;
}
- /**
- * Create directories by the specified pathname
- *
- * @param file File
- * @return File
- * @Throws FileRuntimeException on failure at any point
- */
public static File mkdirs(final File file) {
if (!file.exists()) {
@@ -393,21 +262,11 @@ public class Files {
}
}
- /**
- * Delete File Object when exit
- *
- * @param file File
- */
public static void deleteOnExit(final File file) {
DELETE.add(file.getAbsolutePath());
flagForDeleteOnExit(file);
}
- /**
- * Delete File Objects when exit
- *
- * @param file File
- */
public static void flagForDeleteOnExit(final File file) {
if (file.exists()) {
if (file.isDirectory()) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
index f7b9b15..157aaa5 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
@@ -68,13 +68,6 @@ public class IO {
MAX_TIMEOUT = timeout;
}
- /**
- * Method for reading files as String
- *
- * @param uri URI
- * @return String
- * @throws IOException if an I/O error occurs
- */
public static String readFileAsString(final URI uri) throws IOException {
final StringBuilder builder = new StringBuilder("");
for (final Proxy proxy : ProxySelector.getDefault().select(uri)) {
@@ -102,60 +95,22 @@ public class IO {
return builder.toString();
}
- /**
- * Method for reading Properties
- *
- * @param resource URL
- * @return Properties
- * @throws IOException if an I/O error occurs
- */
public static Properties readProperties(final URL resource) throws IOException {
return readProperties(resource, new Properties());
}
- /**
- * Reading Properties
- *
- * @param resource URL
- * @param properties Properties
- * @return Properties
- * @throws IOException if and I/O error occurs
- */
public static Properties readProperties(final URL resource, final Properties properties) throws IOException {
return readProperties(read(resource), properties);
}
- /**
- * Read properties of the specified pathname
- *
- * @param resource File
- * @return Properties
- * @throws IOException if an I/O error occurs
- */
public static Properties readProperties(final File resource) throws IOException {
return readProperties(resource, new Properties());
}
- /**
- * Read properties of the specified pathname
- *
- * @param resource File
- * @param properties Properties
- * @return Properties
- * @throws IOException if an I/O error occurs
- */
public static Properties readProperties(final File resource, final Properties properties) throws IOException {
return readProperties(read(resource), properties);
}
- /**
- * Reads and closes the input stream
- *
- * @param in InputStream
- * @param properties Properties
- * @return Properties
- * @throws IOException
- */
public static Properties readProperties(final InputStream in, final Properties properties) throws IOException {
if (in == null) {
throw new NullPointerException("InputStream is null");
@@ -171,13 +126,6 @@ public class IO {
return properties;
}
- /**
- * Method for reading the String of the specified pathname
- *
- * @param url URL
- * @return String
- * @throws IOException if an I/O error occurs
- */
public static String readString(final URL url) throws IOException {
final InputStream in = url.openStream();
try {
@@ -188,13 +136,6 @@ public class IO {
}
}
- /**
- * Method for reading the String of the specified pathname
- *
- * @param file File
- * @return String
- * @throws IOException if an I/O error occurs
- */
public static String readString(final File file) throws IOException {
final FileReader in = new FileReader(file);
try {
@@ -205,50 +146,22 @@ public class IO {
}
}
- /**
- * Method to read the entire File into a String
- *
- * @param file File
- * @return String
- * @throws IOException if an I/O error occurs
- */
public static String slurp(final File file) throws IOException {
try (final InputStream is = read(file)) {
return slurp(is);
}
}
- /**
- * Method to read the entire specified pathname into a String
- *
- * @param url URL
- * @return String
- * @throws IOException if an I/O error occurs
- */
public static String slurp(final URL url) throws IOException {
return slurp(url.openStream());
}
- /**
- * Method to read the entire InputStream into a String
- *
- * @param in InputStream
- * @return String
- * @throws IOException if an I/O error occurs
- */
public static String slurp(final InputStream in) throws IOException {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
copy(in, out);
return new String(out.toByteArray());
}
- /**
- * Method to write the specified String to File
- *
- * @param file File
- * @param string String
- * @throws IOException if an I/O error occurs
- */
public static void writeString(final File file, final String string) throws IOException {
final FileWriter out = new FileWriter(file);
try {
@@ -264,13 +177,6 @@ public class IO {
}
}
- /**
- * Method to copy File object
- *
- * @param from File
- * @param to File
- * @throws IOException if an I/O error occurs
- */
public static void copy(final File from, final File to) throws IOException {
if (!from.isDirectory()) {
final FileOutputStream fos = new FileOutputStream(to);
@@ -284,13 +190,6 @@ public class IO {
}
}
- /**
- * Method to copy directory
- *
- * @param srcDir File
- * @param destDir File
- * @throws IOException if an I/O error occurs
- */
public static void copyDirectory(final File srcDir, final File destDir) throws IOException {
if (srcDir == null) {
throw new NullPointerException("Source must not be null");
@@ -352,13 +251,6 @@ public class IO {
}
}
- /**
- * Method to copy File to OutputStream
- *
- * @param from File
- * @param to OutputStream
- * @throws IOException if an I/O error occurs
- */
public static void copy(final File from, final OutputStream to) throws IOException {
final InputStream read = read(from);
try {
@@ -368,13 +260,6 @@ public class IO {
}
}
- /**
- * Method to copy from specified pathname to OutputStream
- *
- * @param from URL
- * @param to OutputStream
- * @throws IOException if an I/O error occurs
- */
public static void copy(final URL from, final OutputStream to) throws IOException {
final InputStream read = read(from);
try {
@@ -384,13 +269,6 @@ public class IO {
}
}
- /**
- * Method to copy from InputStream to File
- *
- * @param from InputStream
- * @param to File
- * @throws IOException if an I/O error occurs
- */
public static void copy(final InputStream from, final File to) throws IOException {
final OutputStream write = write(to);
try {
@@ -400,14 +278,6 @@ public class IO {
}
}
- /**
- * Method to copy InputStream to File and append
- *
- * @param from InputStream
- * @param to File
- * @param append boolean
- * @throws IOException if an I/O error occurs
- */
public static void copy(final InputStream from, final File to, final boolean append) throws IOException {
final OutputStream write = write(to, append);
try {
@@ -434,25 +304,11 @@ public class IO {
copy(new ByteArrayInputStream(from), to);
}
- /**
- * Method for writing specified File as ZIP file format
- *
- * @param file File
- * @return ZipOutputStream ZipOutputStream
- * @throws IOException if an I/O error occurs
- */
public static ZipOutputStream zip(final File file) throws IOException {
final OutputStream write = write(file);
return new ZipOutputStream(write);
}
- /**
- * Method to unzip ZIP file
- *
- * @param file File
- * @return ZipInputStream
- * @throws IOException if an I/O error occurs
- */
public static ZipInputStream unzip(final File file) throws IOException {
final InputStream read = read(file);
return new ZipInputStream(read);
@@ -476,12 +332,6 @@ public class IO {
}
}
- /**
- * Delete file
- *
- * @param file File
- * @return boolean if file successfully deleted
- */
public static boolean delete(final File file) {
if (file == null) {
return false;
@@ -494,81 +344,33 @@ public class IO {
return true;
}
- /**
- * Write data to the specified File destination
- *
- * @param destination File
- * @return OutputStream
- * @throws FileNotFoundException if the file is not found
- */
public static OutputStream write(final File destination) throws FileNotFoundException {
final OutputStream out = new FileOutputStream(destination);
return new BufferedOutputStream(out, 32768);
}
- /**
- * Write data to the specified File destination and append
- *
- * @param destination File
- * @param append boolean
- * @return OutputStream
- * @throws FileNotFoundException if the file is not found
- */
public static OutputStream write(final File destination, final boolean append) throws FileNotFoundException {
final OutputStream out = new FileOutputStream(destination, append);
return new BufferedOutputStream(out, 32768);
}
- /**
- * Read data from the specified File source
- *
- * @param source File
- * @return InputStream
- * @throws FileNotFoundException if the file is not found
- */
public static InputStream read(final File source) throws FileNotFoundException {
final InputStream in = new FileInputStream(source);
return new BufferedInputStream(in, 32768);
}
- /**
- * Read the next byte from the specified String to input stream
- *
- * @param content String
- * @return InputStream
- */
public static InputStream read(final String content) {
return read(content.getBytes());
}
- /**
- * Read the next byte from the specified String to input stream using encoding
- *
- * @param content String
- * @param encoding String
- * @return InputStream
- * @throws UnsupportedEncodingException
- */
public static InputStream read(final String content, final String encoding) throws UnsupportedEncodingException {
return read(content.getBytes(encoding));
}
- /**
- * Read the data from byte array
- *
- * @param content byte[]
- * @return InputStream
- */
public static InputStream read(final byte[] content) {
return new ByteArrayInputStream(content);
}
- /**
- * Open connection to the specified URL and return InputStream for reading from the connection
- * @param url URL
- * @return InputStream
- * @throws IOException
- */
public static InputStream read(final URL url) throws IOException {
return url.openStream();
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
index dba00e8..1963cd3 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
@@ -30,23 +30,10 @@ public class JarLocation {
return jarLocation(JarLocation.class);
}
- /**
- * Return jar from the specified resource name
- *
- * @param resourceName String
- * @return File
- */
public static File jarFromResource(final String resourceName) {
return jarFromResource(Thread.currentThread().getContextClassLoader(), resourceName);
}
- /**
- * Return jar from the specified resource name
- *
- * @param loader ClassLoader
- * @param resourceName String
- * @return File
- */
public static File jarFromResource(final ClassLoader loader, final String resourceName) {
try {
URL url = loader.getResource(resourceName);
@@ -81,12 +68,6 @@ public class JarLocation {
}
}
- /**
- * Return jar location
- *
- * @param clazz Class
- * @return File
- */
public static File jarLocation(final Class clazz) {
try {
final String classFileName = clazz.getName().replace(".", "/") + ".class";
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
index 2c7e4f7..200855e 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
@@ -94,23 +94,10 @@ public class Options {
return parent.getLogger();
}
- /**
- * Method to check if properties contains the specified String property
- *
- * @param property String
- * @return boolean
- */
public boolean has(final String property) {
return properties.containsKey(property) || parent.has(property);
}
- /**
- * Return property by the specified String property
- *
- * @param property String
- * @param defaultValue String
- * @return String
- */
public String get(final String property, final String defaultValue) {
final String value = properties.getProperty(property);
@@ -355,23 +342,10 @@ public class Options {
return possibleValues(enumType);
}
- /**
- * Check possible values of enum and return concatenated string
- *
- * @param enumType
- * @return
- */
protected static String possibleValues(final Class<? extends Enum> enumType) {
return join(", ", lowercase(enumType.getEnumConstants()));
}
- /**
- * Concatenates the given elements with the delimiter and returns string
- *
- * @param delimiter String
- * @param collection Object...
- * @return String
- */
public static String join(final String delimiter, final Object... collection) {
final StringBuilder sb = new StringBuilder();
for (final Object obj : collection) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
index 609119a..6084943 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
@@ -134,22 +134,10 @@ public final class SystemInstance {
return observerManager.fireEvent(event);
}
- /**
- * Add the specified Object to Observer
- *
- * @param observer Object
- * @return boolean
- */
public boolean addObserver(final Object observer) {
return observerManager.addObserver(observer);
}
- /**
- * Remove the specified Object from Observer
- *
- * @param observer Object
- * @return boolean
- */
public boolean removeObserver(final Object observer) {
return observerManager.removeObserver(observer);
}
@@ -167,24 +155,10 @@ public final class SystemInstance {
return internalProperties;
}
- /**
- * Return the property by the specified String key
- *
- * @param key String
- * @return String
- */
public String getProperty(final String key) {
return internalProperties.getProperty(key);
}
- /**
- * Return the property by the specified String key
- * if the key is not found the default value will be returned
- *
- * @param key String
- * @param defaultValue String
- * @return String
- */
public String getProperty(final String key, final String defaultValue) {
return internalProperties.getProperty(key, defaultValue);
}
@@ -340,12 +314,6 @@ public final class SystemInstance {
addSystemProperties(file);
}
- /**
- * Returns the conf by the specified pathname
- *
- * @param subPath String
- * @return File
- */
public File getConf(final String subPath) {
File conf = null;
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
index 3893549..e1aa249 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
@@ -27,25 +27,10 @@ import java.util.zip.ZipInputStream;
*/
public class Zips {
- /**
- * Unzip the specified ZIP file to the specified destination
- *
- * @param zipFile File
- * @param destination File
- * @throws IOException
- */
public static void unzip(final File zipFile, final File destination) throws IOException {
unzip(zipFile, destination, false);
}
- /**
- * Unzip the specified ZIP file to the specified destination
- *
- * @param zipFile File
- * @param destination File
- * @param noparent boolean
- * @throws IOException
- */
public static void unzip(final File zipFile, final File destination, final boolean noparent) throws IOException {
Files.dir(destination);
@@ -62,14 +47,6 @@ public class Zips {
}
}
- /**
- * Method to unzip ZIP files
- *
- * @param read InputStream
- * @param destination File
- * @param noparent boolean
- * @throws IOException
- */
public static void unzip(final InputStream read, final File destination, final boolean noparent) throws IOException {
try {
// Open the ZIP file
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
index 20dfc8a..0d881fc 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
@@ -74,32 +74,16 @@ public class ProvisioningResolver {
}
}
- /**
- * Add ArchiveResolver to resolvers
- *
- * @param resolver ArchiveResolver
- */
public void addResolver(final ArchiveResolver resolver) {
if (resolvers.put(resolver.prefix(), resolver) != null) {
Logger.getLogger(ProvisioningResolver.class.getName()).warning("Overriding resolver " + resolver.prefix() + " with " + resolver);
}
}
- /**
- * Remove resolver
- *
- * @param resolver ArchiveResolver
- */
public void removeResolver(final ArchiveResolver resolver) {
resolvers.remove(resolver.prefix());
}
- /**
- * Real path location of the specified location
- *
- * @param rawLocation String
- * @return
- */
public Set<String> realLocation(final String rawLocation) {
// if direct file path then use it
final File file = new File(rawLocation);
@@ -192,11 +176,6 @@ public class ProvisioningResolver {
return System.getProperty(OPENEJB_DEPLOYER_CACHE_FOLDER, TEMP_DIR);
}
- /**
- * Cache the specified String pathname
- * @param path String
- * @return File
- */
public static File cacheFile(final String path) {
final String cache = cache();
if (new File(cache).isAbsolute()) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
index 22be6c6..ac87398 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
@@ -55,12 +55,6 @@ public class ObserverManager {
private final Set<Observer> observers = new LinkedHashSet<>();
private final Map<Class, Invocation> methods = new ConcurrentHashMap<>();
- /**
- * Add the provided object to be observable
- *
- * @param observer Object
- * @return boolean
- */
public boolean addObserver(final Object observer) {
if (observer == null) {
throw new IllegalArgumentException("observer cannot be null");
@@ -80,12 +74,6 @@ public class ObserverManager {
}
}
- /**
- * Remove the observable object so this object doesn't have any observers
- *
- * @param observer Object
- * @return boolean
- */
public boolean removeObserver(final Object observer) {
if (observer == null) {
throw new IllegalArgumentException("listener cannot be null");
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
index 0848ab5..87dbd74 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
@@ -26,20 +26,10 @@ public class ObserverAdded {
private final Object observer;
- /**
- * Add the provided object to be observable
- *
- * @param observer
- */
public ObserverAdded(final Object observer) {
this.observer = observer;
}
- /**
- * Return the observable object
- *
- * @return
- */
public Object getObserver() {
return observer;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/0f64bd7e/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
index 2c07bf2..f33efa3 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
@@ -26,20 +26,10 @@ public class ObserverRemoved {
private final Object observer;
- /**
- * Remove the observable object so this object doesn't have any observers
- *
- * @param observer
- */
public ObserverRemoved(final Object observer) {
this.observer = observer;
}
- /**
- * Return the observable object
- *
- * @return
- */
public Object getObserver() {
return observer;
}
[03/20] tomee git commit: JavaDoc added
Posted by jl...@apache.org.
JavaDoc added
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/5af81aa4
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/5af81aa4
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/5af81aa4
Branch: refs/heads/master
Commit: 5af81aa473c441fedd0aa0fee2d7e53264f33852
Parents: 0d70b3c
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 22:00:37 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 22:00:37 2018 +0100
----------------------------------------------------------------------
.../apache/openejb/loader/ProvisioningUtil.java | 10 ++
.../apache/openejb/loader/SystemClassPath.java | 4 +
.../apache/openejb/loader/SystemInstance.java | 103 ++++++++++++++++---
.../apache/openejb/loader/TomcatClassPath.java | 19 +++-
.../apache/openejb/loader/WebAppClassPath.java | 5 +
.../java/org/apache/openejb/loader/Zips.java | 21 ++++
6 files changed, 146 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/5af81aa4/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
index f7540ca..b1d20aa 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
@@ -43,6 +43,11 @@ public final class ProvisioningUtil {
// no-op
}
+ /**
+ *
+ * @return
+ * @throws IOException
+ */
public static Collection<File> addAdditionalLibraries() throws IOException {
final File conf = SystemInstance.get().getConf(ADDITIONAL_LIB_CONFIG);
if (conf == null || !conf.exists()) {
@@ -143,6 +148,11 @@ public final class ProvisioningUtil {
return libs;
}
+ /**
+ *
+ * @param location String
+ * @return
+ */
public static Set<String> realLocation(final String location) {
final boolean initialized = SystemInstance.isInitialized();
if (!initialized) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/5af81aa4/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
index 16f14ef..2491afc 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
@@ -51,6 +51,10 @@ public class SystemClassPath extends BasicURLClassPath {
}
}
+ /**
+ *
+ * @return ClassLoader
+ */
@Override
public ClassLoader getClassLoader() {
try {
http://git-wip-us.apache.org/repos/asf/tomee/blob/5af81aa4/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
index 1474c43..1b8725a 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
@@ -29,8 +29,8 @@ import java.util.Properties;
import java.util.concurrent.atomic.AtomicReference;
/**
- * This class aims to be the one and only static in the entire system
- * A static, singleton, instance of this class can be created with the {@link #init(Properties)} method
+ * This class aims to be the one and only static in the entire SYSTEM
+ A static, singleton, instance of this class can be created with the {@link #init(Properties)} method
* <p/>
* It is assumed that only one singleton per classloader is possible in any given VM
* Thus loading this instance in a classloader will mean there can only be one OpenEJB
@@ -60,9 +60,9 @@ public final class SystemInstance {
private final ObserverManager observerManager = new ObserverManager();
private SystemInstance(final Properties properties) {
- this.components = new HashMap<Class, Object>();
+ this.components = new HashMap<>();
- // import JVM system property config (if a resource/container/... is set through this way)
+ // import JVM SYSTEM property config (if a resource/container/... is set through this way)
for (final String key : System.getProperties().stringPropertyNames()) {
if (key.startsWith("sun.")) {
continue;
@@ -130,35 +130,74 @@ public final class SystemInstance {
System.setProperty("derby.system.home", System.getProperty("derby.system.home", baseDirCanonicalPath));
}
+ /**
+ *
+ * @param <E>
+ * @param event
+ * @return
+ */
public <E> E fireEvent(final E event) {
return observerManager.fireEvent(event);
}
+ /**
+ *
+ * @param observer Object
+ * @return boolean
+ */
public boolean addObserver(final Object observer) {
return observerManager.addObserver(observer);
}
+ /**
+ *
+ * @param observer Object
+ * @return boolean
+ */
public boolean removeObserver(final Object observer) {
return observerManager.removeObserver(observer);
}
+ /**
+ *
+ * @return long
+ */
@SuppressWarnings("unused")
public long getStartTime() {
return startTime;
}
+ /**
+ *
+ * @return Options
+ */
public Options getOptions() {
return options;
}
+ /**
+ *
+ * @return Properties
+ */
public Properties getProperties() {
return internalProperties;
}
+ /**
+ *
+ * @param key String
+ * @return String
+ */
public String getProperty(final String key) {
return internalProperties.getProperty(key);
}
+ /**
+ *
+ * @param key String
+ * @param defaultValue String
+ * @return String
+ */
public String getProperty(final String key, final String defaultValue) {
return internalProperties.getProperty(key, defaultValue);
}
@@ -180,6 +219,10 @@ public final class SystemInstance {
return internalProperties.setProperty(key, value);
}
+ /**
+ *
+ * @return FileUtils
+ */
public FileUtils getHome() {
if (!isInitialized()) {
return new FileUtils("openejb.home", "user.dir", System.getProperties());
@@ -187,6 +230,10 @@ public final class SystemInstance {
return home;
}
+ /**
+ *
+ * @return FileUtils
+ */
public FileUtils getBase() {
if (!isInitialized()) {
return new FileUtils("openejb.base", "openejb.home", System.getProperties());
@@ -194,10 +241,18 @@ public final class SystemInstance {
return base;
}
+ /**
+ *
+ * @return ClassPath
+ */
public ClassPath getClassPath() {
return classPath;
}
+ /**
+ *
+ * @return ClassLoader
+ */
public ClassLoader getClassLoader() {
return classLoader;
}
@@ -263,7 +318,7 @@ public final class SystemInstance {
return removed;
}
- private static final AtomicReference<SystemInstance> system = new AtomicReference<SystemInstance>();
+ private static final AtomicReference<SystemInstance> SYSTEM = new AtomicReference<SystemInstance>();
static {
reset();
@@ -278,18 +333,23 @@ public final class SystemInstance {
public static synchronized void reset() {
try {
System.clearProperty("openejb.loader");
- system.set(new SystemInstance(new Properties())); // don't put system properties here, it is already done
+ SYSTEM.set(new SystemInstance(new Properties())); // don't put SYSTEM properties here, it is already done
initialized = false;
} catch (final Exception e) {
throw new LoaderRuntimeException("Failed to create default instance of SystemInstance", e);
}
}
+ /**
+ *
+ * @param properties Properties
+ * @throws Exception
+ */
public static synchronized void init(final Properties properties) throws Exception {
if (initialized) {
return;
}
- system.set(new SystemInstance(properties));
+ SYSTEM.set(new SystemInstance(properties));
// WARNING: reverse order since we don't overwrite existing entries
readSystemProperties(get().currentProfile());
readSystemProperties();
@@ -297,7 +357,7 @@ public final class SystemInstance {
// if the user read System.getProperties() instead of our properties, used in bval-tomee tck for instance
- System.getProperties().putAll(system.get().getProperties());
+ System.getProperties().putAll(SYSTEM.get().getProperties());
initialized = true;
get().setProperty("openejb.profile.custom", Boolean.toString(!get().isDefaultProfile()));
@@ -306,7 +366,7 @@ public final class SystemInstance {
}
private static void initDefaultComponents() {
- system.get().components.put(ProvisioningResolver.class, new ProvisioningResolver());
+ SYSTEM.get().components.put(ProvisioningResolver.class, new ProvisioningResolver());
}
private static void readUserSystemProperties() {
@@ -314,10 +374,15 @@ public final class SystemInstance {
addSystemProperties(file);
}
+ /**
+ *
+ * @param subPath String
+ * @return File
+ */
public File getConf(final String subPath) {
File conf = null;
- final FileUtils base = system.get().getBase();
+ final FileUtils base = SYSTEM.get().getBase();
try {
conf = base.getDirectory("conf");
@@ -351,7 +416,7 @@ public final class SystemInstance {
}
// Read in and apply the conf/system.properties
- final File conf = system.get().getConf(completePrefix + "system.properties");
+ final File conf = SYSTEM.get().getConf(completePrefix + "system.properties");
if (conf != null && conf.exists()) {
addSystemProperties(conf);
}
@@ -374,23 +439,31 @@ public final class SystemInstance {
}
for (final String key : systemProperties.stringPropertyNames()) {
- final SystemInstance systemInstance = system.get();
+ final SystemInstance systemInstance = SYSTEM.get();
if (systemInstance.getProperty(key) == null) {
systemInstance.setProperty(key, systemProperties.getProperty(key));
}
}
- // don't override system props
- // system.getProperties().putAll(systemProperties);
+ // don't override SYSTEM props
+ // SYSTEM.getProperties().putAll(systemProperties);
}
public static SystemInstance get() {
- return system.get();
+ return SYSTEM.get();
}
+ /**
+ *
+ * @return String
+ */
public String currentProfile() {
return getProperty(PROFILE_PROP, DEFAULT_PROFILE);
}
+ /**
+ *
+ * @return boolean
+ */
public boolean isDefaultProfile() {
return DEFAULT_PROFILE.equals(currentProfile());
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/5af81aa4/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
index a092485..c5df72f 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
@@ -48,6 +48,10 @@ public class TomcatClassPath extends BasicURLClassPath {
this(getCommonLoader(getContextClassLoader()));
}
+ /**
+ *
+ * @param classLoader ClassLoader
+ */
public TomcatClassPath(final ClassLoader classLoader) {
this.commonLoader = classLoader;
@@ -89,12 +93,20 @@ public class TomcatClassPath extends BasicURLClassPath {
}
}
+ /**
+ *
+ * @return ClassLoader
+ */
@Override
public ClassLoader getClassLoader() {
return (serverLoader != null) ? serverLoader : commonLoader;
// return commonLoader;
}
+ /**
+ *
+ * @return ClassLoader
+ */
@SuppressWarnings("UnusedDeclaration")
public ClassLoader getCommonLoader() {
return commonLoader;
@@ -125,6 +137,11 @@ public class TomcatClassPath extends BasicURLClassPath {
rebuild();
}
+ /**
+ *
+ * @param jar URL
+ * @throws Exception
+ */
public void _addJarToPath(final URL jar) throws Exception {
ClassLoader classLoader = commonLoader;
@@ -218,7 +235,7 @@ public class TomcatClassPath extends BasicURLClassPath {
}
return method;
} catch (final Exception e2) {
- throw (IllegalStateException) new IllegalStateException("Unable to find or access the addRepository method in StandardClassLoader").initCause(e2);
+ throw new IllegalStateException("Unable to find or access the addRepository method in StandardClassLoader", e2);
}
}
});
http://git-wip-us.apache.org/repos/asf/tomee/blob/5af81aa4/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java
index c0ac8a0..1b45361 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java
@@ -22,10 +22,15 @@ public class WebAppClassPath extends TomcatClassPath {
this(getContextClassLoader());
}
+ /**
+ *
+ * @param classLoader ClassLoader
+ */
public WebAppClassPath(final ClassLoader classLoader) {
super(classLoader);
}
+ @Override
protected void rebuild() {
}
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/5af81aa4/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
index cdfd67a..6b52322 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
@@ -26,10 +26,24 @@ import java.util.zip.ZipInputStream;
* @version $Rev$ $Date$
*/
public class Zips {
+
+ /**
+ *
+ * @param zipFile File
+ * @param destination File
+ * @throws IOException
+ */
public static void unzip(final File zipFile, final File destination) throws IOException {
unzip(zipFile, destination, false);
}
+ /**
+ *
+ * @param zipFile File
+ * @param destination File
+ * @param noparent boolean
+ * @throws IOException
+ */
public static void unzip(final File zipFile, final File destination, final boolean noparent) throws IOException {
Files.dir(destination);
@@ -46,6 +60,13 @@ public class Zips {
}
}
+ /**
+ *
+ * @param read InputStream
+ * @param destination File
+ * @param noparent boolean
+ * @throws IOException
+ */
public static void unzip(final InputStream read, final File destination, final boolean noparent) throws IOException {
try {
// Open the ZIP file
[17/20] tomee git commit: remove empyt JavaDocs
Posted by jl...@apache.org.
remove empyt JavaDocs
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/2fdabc5f
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/2fdabc5f
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/2fdabc5f
Branch: refs/heads/master
Commit: 2fdabc5f5005c410f3a78331a84eb1a99d1e0f40
Parents: 37f8bcb
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Thu Dec 13 21:36:30 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Thu Dec 13 21:36:30 2018 +0100
----------------------------------------------------------------------
.../org/apache/openejb/loader/BasicURLClassPath.java | 6 ------
.../org/apache/openejb/loader/ContextClassPath.java | 4 ----
.../src/main/java/org/apache/openejb/loader/IO.java | 4 ----
.../main/java/org/apache/openejb/loader/Options.java | 12 ------------
.../loader/provisining/ProvisioningResolver.java | 2 +-
5 files changed, 1 insertion(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/2fdabc5f/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
index 9e56c27..caba783 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
@@ -132,12 +132,6 @@ public abstract class BasicURLClassPath implements ClassPath {
}
}
- /**
- *
- * @param loader URLClassLoader
- * @return Object
- * @throws Exception
- */
protected Object getURLClassPath(final URLClassLoader loader) throws Exception {
final Field ucpField = this.getUcpField();
if (ucpField == null) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/2fdabc5f/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
index 320a02e..af0bfef 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
@@ -26,10 +26,6 @@ import java.net.URLClassLoader;
public class ContextClassPath extends BasicURLClassPath {
- /**
- *
- * @return the context ClassLoader for this Thread or null
- */
@Override
public ClassLoader getClassLoader() {
return getContextClassLoader();
http://git-wip-us.apache.org/repos/asf/tomee/blob/2fdabc5f/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
index 481d03c..f7b9b15 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
@@ -458,10 +458,6 @@ public class IO {
return new ZipInputStream(read);
}
- /**
- *
- * @param closeable Closeable
- */
public static void close(final Closeable closeable) {
if (closeable == null) {
return;
http://git-wip-us.apache.org/repos/asf/tomee/blob/2fdabc5f/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
index dae22b7..2c7e4f7 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
@@ -86,18 +86,10 @@ public class Options {
return properties.delegate;
}
- /**
- *
- * @param logger Log
- */
public void setLogger(final Log logger) {
parent.setLogger(logger);
}
- /**
- *
- * @return Log
- */
public Log getLogger() {
return parent.getLogger();
}
@@ -582,10 +574,6 @@ public class Options {
public void info(final String message, final Throwable t) {
}
- /**
- *
- * @param message String
- */
@Override
public void info(final String message) {
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/2fdabc5f/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
index 4bbe082..20dfc8a 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
@@ -86,7 +86,7 @@ public class ProvisioningResolver {
}
/**
- * Remove ArchiveResolver
+ * Remove resolver
*
* @param resolver ArchiveResolver
*/
[15/20] tomee git commit: add JavaDoc
Posted by jl...@apache.org.
add JavaDoc
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/743ae604
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/743ae604
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/743ae604
Branch: refs/heads/master
Commit: 743ae604345d9a530a8b6f6b09821aa7b95b9b68
Parents: 4c643f7
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Tue Dec 11 21:27:32 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Tue Dec 11 21:27:32 2018 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/openejb/loader/Options.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/743ae604/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
index 96bb761..dae22b7 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
@@ -364,7 +364,8 @@ public class Options {
}
/**
- *
+ * Check possible values of enum and return concatenated string
+ *
* @param enumType
* @return
*/
@@ -373,7 +374,8 @@ public class Options {
}
/**
- *
+ * Concatenates the given elements with the delimiter and returns string
+ *
* @param delimiter String
* @param collection Object...
* @return String
[09/20] tomee git commit: remove empty JavaDoc
Posted by jl...@apache.org.
remove empty JavaDoc
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/49effbf1
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/49effbf1
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/49effbf1
Branch: refs/heads/master
Commit: 49effbf13c9cd88cd60e1d603c4ab5d979887087
Parents: 421065e
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 23:11:40 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 23:11:40 2018 +0100
----------------------------------------------------------------------
.../org/apache/openejb/loader/JarLocation.java | 4 ---
.../apache/openejb/loader/OpenEJBInstance.java | 8 -----
.../java/org/apache/openejb/loader/Options.java | 12 -------
.../apache/openejb/loader/SystemClassPath.java | 4 ---
.../apache/openejb/loader/SystemInstance.java | 36 --------------------
.../apache/openejb/loader/TomcatClassPath.java | 8 -----
.../openejb/loader/event/ComponentAdded.java | 8 -----
.../openejb/loader/event/ComponentRemoved.java | 8 -----
8 files changed, 88 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/49effbf1/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
index 7e6509f..2d274cf 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
@@ -26,10 +26,6 @@ import java.net.URL;
*/
public class JarLocation {
- /**
- *
- * @return File
- */
public static File get() {
return jarLocation(JarLocation.class);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/49effbf1/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
index 43ab11c..d352a66 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
@@ -25,10 +25,6 @@ public class OpenEJBInstance {
private final Method init;
private final Method isInitialized;
- /**
- *
- * @throws Exception
- */
public OpenEJBInstance() throws Exception {
final Class<?> openejb = loadOpenEJBClass();
this.init = openejb.getMethod("init", Properties.class);
@@ -53,10 +49,6 @@ public class OpenEJBInstance {
}
}
- /**
- *
- * @return boolean
- */
public boolean isInitialized() {
try {
return (Boolean) isInitialized.invoke(null);
http://git-wip-us.apache.org/repos/asf/tomee/blob/49effbf1/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
index c0fcf19..8b6c14d 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
@@ -654,28 +654,16 @@ public class Options {
public static class NullLog implements Log {
- /**
- *
- * @return boolean
- */
@Override
public boolean isDebugEnabled() {
return false;
}
- /**
- *
- * @return boolean
- */
@Override
public boolean isInfoEnabled() {
return false;
}
- /**
- *
- * @return boolean
- */
@Override
public boolean isWarningEnabled() {
return false;
http://git-wip-us.apache.org/repos/asf/tomee/blob/49effbf1/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
index 2491afc..16f14ef 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
@@ -51,10 +51,6 @@ public class SystemClassPath extends BasicURLClassPath {
}
}
- /**
- *
- * @return ClassLoader
- */
@Override
public ClassLoader getClassLoader() {
try {
http://git-wip-us.apache.org/repos/asf/tomee/blob/49effbf1/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
index 47baafc..70a5e01 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
@@ -158,27 +158,15 @@ public final class SystemInstance {
return observerManager.removeObserver(observer);
}
- /**
- *
- * @return long
- */
@SuppressWarnings("unused")
public long getStartTime() {
return startTime;
}
- /**
- *
- * @return Options
- */
public Options getOptions() {
return options;
}
- /**
- *
- * @return Properties
- */
public Properties getProperties() {
return internalProperties;
}
@@ -219,10 +207,6 @@ public final class SystemInstance {
return internalProperties.setProperty(key, value);
}
- /**
- *
- * @return FileUtils
- */
public FileUtils getHome() {
if (!isInitialized()) {
return new FileUtils("openejb.home", "user.dir", System.getProperties());
@@ -230,10 +214,6 @@ public final class SystemInstance {
return home;
}
- /**
- *
- * @return FileUtils
- */
public FileUtils getBase() {
if (!isInitialized()) {
return new FileUtils("openejb.base", "openejb.home", System.getProperties());
@@ -241,18 +221,10 @@ public final class SystemInstance {
return base;
}
- /**
- *
- * @return ClassPath
- */
public ClassPath getClassPath() {
return classPath;
}
- /**
- *
- * @return ClassLoader
- */
public ClassLoader getClassLoader() {
return classLoader;
}
@@ -452,18 +424,10 @@ public final class SystemInstance {
return SYSTEM.get();
}
- /**
- *
- * @return String
- */
public String currentProfile() {
return getProperty(PROFILE_PROP, DEFAULT_PROFILE);
}
- /**
- *
- * @return boolean
- */
public boolean isDefaultProfile() {
return DEFAULT_PROFILE.equals(currentProfile());
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/49effbf1/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
index c5df72f..5869814 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
@@ -93,20 +93,12 @@ public class TomcatClassPath extends BasicURLClassPath {
}
}
- /**
- *
- * @return ClassLoader
- */
@Override
public ClassLoader getClassLoader() {
return (serverLoader != null) ? serverLoader : commonLoader;
// return commonLoader;
}
- /**
- *
- * @return ClassLoader
- */
@SuppressWarnings("UnusedDeclaration")
public ClassLoader getCommonLoader() {
return commonLoader;
http://git-wip-us.apache.org/repos/asf/tomee/blob/49effbf1/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
index 9568d87..acb91fc 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
@@ -37,18 +37,10 @@ public class ComponentAdded<T> {
this.component = component;
}
- /**
- *
- * @return
- */
public Class<T> getType() {
return type;
}
- /**
- *
- * @return
- */
public T getComponent() {
return component;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/49effbf1/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
index aae7ba2..f5a1724 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
@@ -37,18 +37,10 @@ public class ComponentRemoved<T> {
this.component = component;
}
- /**
- *
- * @return
- */
public Class<T> getType() {
return type;
}
- /**
- *
- * @return
- */
public T getComponent() {
return component;
}
[05/20] tomee git commit: use isEmpty and added @Override
Posted by jl...@apache.org.
use isEmpty and added @Override
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/c4790232
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/c4790232
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/c4790232
Branch: refs/heads/master
Commit: c4790232e257aba68e953ba923d8bda228d7db2c
Parents: 7ffcb01
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 22:16:38 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 22:16:38 2018 +0100
----------------------------------------------------------------------
.../main/java/org/apache/openejb/observer/ObserverManager.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/c4790232/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
index 462a46c..8abab63 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
@@ -249,7 +249,7 @@ public class ObserverManager {
}
}
- if (methods.size() == 0 && after.size() == 0 && before.size() == 0) {
+ if (methods.isEmpty() && after.isEmpty() && before.isEmpty()) {
throw new NotAnObserverException("Object has no @Observes methods. For example: public void observe(@Observes RetryConditionAdded event){...}");
}
}
@@ -486,6 +486,7 @@ public class ObserverManager {
return event;
}
+ @Override
public String toString() {
return "AfterEvent{} " + event;
}
@@ -507,6 +508,7 @@ public class ObserverManager {
return event;
}
+ @Override
public String toString() {
return "BeforeEvent{} " + event;
}
[07/20] tomee git commit: ThreadLocalRandom, use diamond op
Posted by jl...@apache.org.
ThreadLocalRandom, use diamond op
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/cdb9e444
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/cdb9e444
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/cdb9e444
Branch: refs/heads/master
Commit: cdb9e4445d91da8bb18df5aa39141984ac0d4aa0
Parents: d815cee
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Fri Dec 7 22:54:29 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Fri Dec 7 22:54:29 2018 +0100
----------------------------------------------------------------------
.../java/org/apache/openejb/loader/BasicURLClassPath.java | 4 ----
.../src/main/java/org/apache/openejb/loader/FileUtils.java | 9 +++------
.../main/java/org/apache/openejb/loader/SystemInstance.java | 2 +-
3 files changed, 4 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/cdb9e444/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
index b9bf5df..4c5ba77 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
@@ -28,10 +28,6 @@ import java.util.Locale;
public abstract class BasicURLClassPath implements ClassPath {
- /**
- *
- * @return ClassLoader
- */
public static ClassLoader getContextClassLoader() {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
http://git-wip-us.apache.org/repos/asf/tomee/blob/cdb9e444/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
index 6a5ea98..b9ef77f 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
@@ -20,11 +20,12 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Hashtable;
+import java.util.concurrent.ThreadLocalRandom;
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
public class FileUtils {
- private static final java.util.Random RANDOM = new java.util.Random();
+ private static final ThreadLocalRandom _random = ThreadLocalRandom.current();
private File home;
@@ -111,10 +112,6 @@ public class FileUtils {
return dir;
}
- /**
- *
- * @return File
- */
public File getDirectory() {
return home;
}
@@ -169,7 +166,7 @@ public class FileUtils {
public static File createTempDirectory(final String pathPrefix) throws IOException {
for (int maxAttempts = 100; maxAttempts > 0; --maxAttempts) {
- final String path = pathPrefix + RANDOM.nextLong();
+ final String path = pathPrefix + _random.nextLong();
final File tmpDir = new File(path);
if (!tmpDir.exists() && tmpDir.mkdirs()) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/cdb9e444/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
index 1b8725a..47baafc 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
@@ -318,7 +318,7 @@ public final class SystemInstance {
return removed;
}
- private static final AtomicReference<SystemInstance> SYSTEM = new AtomicReference<SystemInstance>();
+ private static final AtomicReference<SystemInstance> SYSTEM = new AtomicReference<>();
static {
reset();
[14/20] tomee git commit: update JavaDoc to the ones I could
Posted by jl...@apache.org.
update JavaDoc to the ones I could
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/4c643f7b
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/4c643f7b
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/4c643f7b
Branch: refs/heads/master
Commit: 4c643f7b565c0c077258cc163804973e4f9c6d52
Parents: 6450b2b
Author: Hayri Cicek <ha...@kodnito.com>
Authored: Mon Dec 10 20:06:30 2018 +0100
Committer: Hayri Cicek <ha...@kodnito.com>
Committed: Mon Dec 10 20:06:30 2018 +0100
----------------------------------------------------------------------
.../openejb/loader/BasicURLClassPath.java | 23 +--
.../org/apache/openejb/loader/ClassPath.java | 8 +-
.../apache/openejb/loader/ClassPathFactory.java | 5 -
.../apache/openejb/loader/ContextClassPath.java | 6 +-
.../org/apache/openejb/loader/FileUtils.java | 47 +++---
.../java/org/apache/openejb/loader/Files.java | 90 ++++++------
.../main/java/org/apache/openejb/loader/IO.java | 146 ++++++++++---------
.../org/apache/openejb/loader/JarLocation.java | 20 +--
.../java/org/apache/openejb/loader/Loader.java | 5 -
.../openejb/loader/LoaderRuntimeException.java | 9 --
.../apache/openejb/loader/OpenEJBInstance.java | 7 +-
.../java/org/apache/openejb/loader/Options.java | 142 +-----------------
.../apache/openejb/loader/ProvisioningUtil.java | 10 --
.../apache/openejb/loader/SystemInstance.java | 27 ++--
.../apache/openejb/loader/TomcatClassPath.java | 9 --
.../apache/openejb/loader/WebAppClassPath.java | 4 -
.../java/org/apache/openejb/loader/Zips.java | 9 +-
.../openejb/loader/event/ComponentAdded.java | 5 -
.../openejb/loader/event/ComponentRemoved.java | 5 -
.../loader/provisining/HttpResolver.java | 5 -
.../loader/provisining/MavenResolver.java | 10 --
.../provisining/ProvisiningResolverCreated.java | 9 --
.../provisining/ProvisioningResolver.java | 17 +--
.../provisining/ProvisioningResolverAware.java | 4 -
.../openejb/observer/ObserverManager.java | 40 +----
.../openejb/observer/event/ObserverAdded.java | 4 -
.../openejb/observer/event/ObserverFailed.java | 7 -
.../openejb/observer/event/ObserverRemoved.java | 4 -
28 files changed, 211 insertions(+), 466 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
index 4c5ba77..9e56c27 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
@@ -28,6 +28,11 @@ import java.util.Locale;
public abstract class BasicURLClassPath implements ClassPath {
+ /**
+ * Returns the context ClassLoader for this Thread or null
+ *
+ * @return ClassLoader ClassLoader
+ */
public static ClassLoader getContextClassLoader() {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
@@ -41,7 +46,9 @@ public abstract class BasicURLClassPath implements ClassPath {
private boolean ucpFieldErrorLogged;
/**
- *
+ * Add Jar to the URLClassPath
+ *
+ * Throws Exception if fails any
* @param jar URL
* @param loader URLClassLoader
* @throws Exception
@@ -75,7 +82,8 @@ public abstract class BasicURLClassPath implements ClassPath {
}
/**
- *
+ * Adds Jars to the URLClassPath
+ *
* @param dir File
* @param loader URLClassLoader
* @throws Exception
@@ -125,7 +133,7 @@ public abstract class BasicURLClassPath implements ClassPath {
}
/**
- *
+ *
* @param loader URLClassLoader
* @return Object
* @throws Exception
@@ -166,17 +174,14 @@ public abstract class BasicURLClassPath implements ClassPath {
ClassLoader.registerAsParallelCapable();
}
- /**
- *
- * @param parent ClassLoader
- */
public CustomizableURLClassLoader(final ClassLoader parent) {
super(new URL[0], parent);
}
/**
- *
- * @param url URL
+ * URLs to be added to the URL list for searching classes and resources
+ *
+ * @param url the URL to be added to the URLs list
*/
public void add(final URL url) {
super.addURL(url);
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
index 3baef29..4a12085 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPath.java
@@ -24,14 +24,18 @@ public interface ClassPath {
ClassLoader getClassLoader();
/**
- *
+ * Add Jars to the URL ClassPath
+ * Throws Exception if it fails
+ *
* @param dir File
* @throws Exception
*/
void addJarsToPath(File dir) throws Exception;
/**
- *
+ * Add Jar to the URL ClassPath
+ * Throws Exception if it fails
+ *
* @param dir URL
* @throws Exception
*/
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java
index 4201bab..86b12f8 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ClassPathFactory.java
@@ -22,11 +22,6 @@ import static java.lang.ClassLoader.getSystemClassLoader;
public class ClassPathFactory {
- /**
- *
- * @param name String
- * @return ClassPath
- */
@SuppressWarnings("checkstyle:needbraces")
public static ClassPath createClassPath(final String name) {
if (name.equalsIgnoreCase("tomcat")) return new TomcatClassPath();
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
index fe92b6f..320a02e 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ContextClassPath.java
@@ -36,7 +36,8 @@ public class ContextClassPath extends BasicURLClassPath {
}
/**
- *
+ * Add Jars to URLClassPath
+ *
* @param dir File
* @throws Exception
*/
@@ -50,7 +51,8 @@ public class ContextClassPath extends BasicURLClassPath {
}
/**
- *
+ * Add Jar to URLClassPath
+ *
* @param jar URL
* @throws Exception
*/
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
index f6f15cd..c182b8e 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/FileUtils.java
@@ -31,12 +31,6 @@ public class FileUtils {
this(homeDir, defaultDir, SystemInstance.get().getProperties());
}
- /**
- *
- * @param homeDir String
- * @param defaultDir String
- * @param env Hashtable
- */
@SuppressWarnings("UseOfObsoleteCollectionType")
public FileUtils(final String homeDir, final String defaultDir, final Hashtable env) {
@@ -65,10 +59,12 @@ public class FileUtils {
}
/**
- *
+ * Returns the cannonical pathname
+ *
+ *
* @param path String
* @return File
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public File getDirectory(final String path) throws IOException {
return getDirectory(path, false);
@@ -84,11 +80,12 @@ public class FileUtils {
}
/**
- *
+ * Returns canonical form of the specified path
+ *
* @param path String
- * @param create boolean
+ * @param create boolean
* @return File
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public File getDirectory(final String path, final boolean create) throws IOException {
File dir = new File(home, path);
@@ -114,16 +111,13 @@ public class FileUtils {
return home;
}
- /**
- *
- * @param dir File
- */
public void setDirectory(final File dir) {
this.home = dir;
}
/**
- *
+ * Returns File at specified path String
+ *
* @param path String
* @return File
* @throws IOException
@@ -133,11 +127,12 @@ public class FileUtils {
}
/**
- *
+ * Returns File at specified path String
+ *
* @param path String
* @param validate boolean
* @return File
- * @throws IOException
+ * @throws IOException if and I/O error occurs
*/
public File getFile(final String path, final boolean validate) throws IOException {
File file = new File(path);
@@ -156,9 +151,12 @@ public class FileUtils {
}
/**
- *
- * @param pathPrefix String
- * @return File
+ * Creates Temp Directory
+ *
+ * Throws IOException if directory doesn't exists and if it fails to create directories
+ *
+ * @param pathPrefix path prefix
+ * @return File File
* @throws IOException
*/
public static File createTempDirectory(final String pathPrefix) throws IOException {
@@ -175,8 +173,11 @@ public class FileUtils {
}
/**
- *
- * @return File
+ * Creates Temp Directory
+ *
+ * Throws IOException if directory doesn't exists and if it fails to create directories
+ *
+ * @return File File
* @throws IOException
*/
public static File createTempDirectory() throws IOException {
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
index 1b6d86f..6b247ec 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Files.java
@@ -47,7 +47,8 @@ public class Files {
private static final boolean IS_WINDOWS = System.getProperty("os.name", "unknown").toLowerCase(Locale.ENGLISH).startsWith("win");
/**
- *
+ * Returns the absolute path of the File Object
+ *
* @param parts String...
* @return File
*/
@@ -65,7 +66,8 @@ public class Files {
}
/**
- *
+ * Returns the absolute path of the File Object
+ *
* @param dir File
* @param parts String...
* @return File
@@ -89,7 +91,8 @@ public class Files {
}
/**
- *
+ * Returns a List of pathnames for File Objects
+ *
* @param dir File
* @param regex String
* @return List of Files
@@ -99,7 +102,8 @@ public class Files {
}
/**
- *
+ * Returns a List of pathnames for File Objects
+ *
* @param dir File
* @param pattern Pattern
* @return List of Files
@@ -109,7 +113,8 @@ public class Files {
}
/**
- *
+ * Returns a List of pathnames for File Objects
+ *
* @param dir File
* @param filter FileFilter
* @return List of Files
@@ -131,7 +136,8 @@ public class Files {
}
/**
- *
+ * Method to check if the file or direcotory exists
+ *
* @param file File
* @param s String
* @return File
@@ -145,7 +151,8 @@ public class Files {
}
/**
- *
+ * Method to check if the file or direcotory exists
+ *
* @param file File
* @return File
* @Throws FileRuntimeException on failure at any point
@@ -158,7 +165,8 @@ public class Files {
}
/**
- *
+ * Method to check if it is a directory
+ *
* @param file File
* @return File
* @Throws FileRuntimeException on failure at any point
@@ -172,10 +180,11 @@ public class Files {
}
/**
- *
+ * Method to create a file
+ *
* @param file File
* @return File
- * @throws IOException
+ * @throws IOException if an I/O error occurs
* @Throws FileRuntimeException on failure at any point
*/
public static File touch(final File file) throws IOException {
@@ -186,7 +195,8 @@ public class Files {
}
/**
- *
+ * Method to check if the specified File Object is a File
+ *
* @param file File
* @return File
* @Throws FileRuntimeException on failure at any point
@@ -200,7 +210,8 @@ public class Files {
}
/**
- *
+ * Method to check if File Object is hidden
+ *
* @param file File
* @return File
* @Throws FileRuntimeException on failure at any point
@@ -214,7 +225,8 @@ public class Files {
}
/**
- *
+ * Method to check if File Object is writeable
+ *
* @param file File
* @return File
* @Throws FileRuntimeException on failure at any point
@@ -227,7 +239,8 @@ public class Files {
}
/**
- *
+ * Method to check if File Object is readable
+ *
* @param file File
* @return File
* @Throws FileRuntimeException on failure at any point
@@ -240,7 +253,8 @@ public class Files {
}
/**
- *
+ * File Object is readble
+ *
* @param file File
* @return File
*/
@@ -249,10 +263,11 @@ public class Files {
}
/**
- *
+ * Create directory by the specified path
+ *
* @param file File
* @return File
- * @Throws FileRuntimeException on failure at any point
+ * @Throws FileRuntimeException if it fails to create directory
*/
public static File mkdir(final File file) {
if (file.exists()) {
@@ -275,7 +290,8 @@ public class Files {
}
/**
- *
+ * Create directory by the specified parent pathname and child pathname
+ *
* @param file file
* @param name String
* @return File
@@ -285,9 +301,10 @@ public class Files {
}
/**
- *
+ * Method to create tmp directory
+ *
* @return File
- * @Throws IOException on failure at any point
+ * @Throws IOException if an I/O error occurs
*/
public static File tmpdir() {
try {
@@ -324,9 +341,10 @@ public class Files {
}
/**
- *
+ * Create parent pathname by the specified pathname
+ *
* @param file File
- * @return File
+ * @return File
*/
public static File mkparent(final File file) {
mkdirs(file.getParentFile());
@@ -334,7 +352,8 @@ public class Files {
}
/**
- *
+ * Create directories by the specified pathname
+ *
* @param file File
* @return File
* @Throws FileRuntimeException on failure at any point
@@ -375,7 +394,8 @@ public class Files {
}
/**
- *
+ * Delete File Object when exit
+ *
* @param file File
*/
public static void deleteOnExit(final File file) {
@@ -384,7 +404,8 @@ public class Files {
}
/**
- *
+ * Delete File Objects when exit
+ *
* @param file File
*/
public static void flagForDeleteOnExit(final File file) {
@@ -469,13 +490,6 @@ public class Files {
}
}
- /**
- *
- * @param dir File
- * @param pattern String
- * @return File
- * @Throws IllegalStateException on failure at any point
- */
public static File select(final File dir, final String pattern) {
final List<File> matches = collect(dir, pattern);
if (matches.isEmpty()) {
@@ -554,12 +568,6 @@ public class Files {
return set;
}
- /**
- *
- * @param url URL
- * @return File
- * @Throws IllegalStateException on failure at any point
- */
public static File toFile(final URL url) {
if ("jar".equals(url.getProtocol())) {
try {
@@ -588,12 +596,6 @@ public class Files {
}
}
- /**
- *
- * @param urls Set<URL>
- * @param algo String
- * @return String
- */
public static String hash(final Set<URL> urls, final String algo) {
final Collection<File> files = new ArrayList<>();
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
index e73f2b5..481d03c 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/IO.java
@@ -69,10 +69,11 @@ public class IO {
}
/**
- *
+ * Method for reading files as String
+ *
* @param uri URI
* @return String
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static String readFileAsString(final URI uri) throws IOException {
final StringBuilder builder = new StringBuilder("");
@@ -102,42 +103,46 @@ public class IO {
}
/**
- *
+ * Method for reading Properties
+ *
* @param resource URL
* @return Properties
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static Properties readProperties(final URL resource) throws IOException {
return readProperties(resource, new Properties());
}
/**
- *
+ * Reading Properties
+ *
* @param resource URL
* @param properties Properties
* @return Properties
- * @throws IOException
+ * @throws IOException if and I/O error occurs
*/
public static Properties readProperties(final URL resource, final Properties properties) throws IOException {
return readProperties(read(resource), properties);
}
/**
- *
+ * Read properties of the specified pathname
+ *
* @param resource File
* @return Properties
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static Properties readProperties(final File resource) throws IOException {
return readProperties(resource, new Properties());
}
/**
- *
+ * Read properties of the specified pathname
+ *
* @param resource File
* @param properties Properties
* @return Properties
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static Properties readProperties(final File resource, final Properties properties) throws IOException {
return readProperties(read(resource), properties);
@@ -167,10 +172,11 @@ public class IO {
}
/**
- *
+ * Method for reading the String of the specified pathname
+ *
* @param url URL
* @return String
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static String readString(final URL url) throws IOException {
final InputStream in = url.openStream();
@@ -183,10 +189,11 @@ public class IO {
}
/**
- *
+ * Method for reading the String of the specified pathname
+ *
* @param file File
* @return String
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static String readString(final File file) throws IOException {
final FileReader in = new FileReader(file);
@@ -199,10 +206,11 @@ public class IO {
}
/**
- *
+ * Method to read the entire File into a String
+ *
* @param file File
* @return String
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static String slurp(final File file) throws IOException {
try (final InputStream is = read(file)) {
@@ -211,20 +219,22 @@ public class IO {
}
/**
- *
+ * Method to read the entire specified pathname into a String
+ *
* @param url URL
* @return String
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static String slurp(final URL url) throws IOException {
return slurp(url.openStream());
}
/**
- *
+ * Method to read the entire InputStream into a String
+ *
* @param in InputStream
* @return String
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static String slurp(final InputStream in) throws IOException {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -233,10 +243,11 @@ public class IO {
}
/**
- *
+ * Method to write the specified String to File
+ *
* @param file File
* @param string String
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static void writeString(final File file, final String string) throws IOException {
final FileWriter out = new FileWriter(file);
@@ -254,10 +265,11 @@ public class IO {
}
/**
- *
+ * Method to copy File object
+ *
* @param from File
* @param to File
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static void copy(final File from, final File to) throws IOException {
if (!from.isDirectory()) {
@@ -273,10 +285,11 @@ public class IO {
}
/**
- *
+ * Method to copy directory
+ *
* @param srcDir File
* @param destDir File
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static void copyDirectory(final File srcDir, final File destDir) throws IOException {
if (srcDir == null) {
@@ -340,10 +353,11 @@ public class IO {
}
/**
- *
+ * Method to copy File to OutputStream
+ *
* @param from File
* @param to OutputStream
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static void copy(final File from, final OutputStream to) throws IOException {
final InputStream read = read(from);
@@ -355,10 +369,11 @@ public class IO {
}
/**
- *
+ * Method to copy from specified pathname to OutputStream
+ *
* @param from URL
* @param to OutputStream
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static void copy(final URL from, final OutputStream to) throws IOException {
final InputStream read = read(from);
@@ -370,10 +385,11 @@ public class IO {
}
/**
- *
+ * Method to copy from InputStream to File
+ *
* @param from InputStream
* @param to File
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static void copy(final InputStream from, final File to) throws IOException {
final OutputStream write = write(to);
@@ -385,11 +401,12 @@ public class IO {
}
/**
- *
+ * Method to copy InputStream to File and append
+ *
* @param from InputStream
* @param to File
* @param append boolean
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static void copy(final InputStream from, final File to, final boolean append) throws IOException {
final OutputStream write = write(to, append);
@@ -400,12 +417,6 @@ public class IO {
}
}
- /**
- *
- * @param from InputStream
- * @param to OutputStream
- * @throws IOException
- */
public static void copy(final InputStream from, final OutputStream to) throws IOException {
final byte[] buffer = new byte[1024];
int length;
@@ -415,31 +426,20 @@ public class IO {
to.flush();
}
- /**
- *
- * @param from byte[]
- * @param to File
- * @throws IOException
- */
public static void copy(final byte[] from, final File to) throws IOException {
copy(new ByteArrayInputStream(from), to);
}
- /**
- *
- * @param from byte[]
- * @param to OutputStream
- * @throws IOException
- */
public static void copy(final byte[] from, final OutputStream to) throws IOException {
copy(new ByteArrayInputStream(from), to);
}
/**
- *
+ * Method for writing specified File as ZIP file format
+ *
* @param file File
- * @return ZipOutputStream
- * @throws IOException
+ * @return ZipOutputStream ZipOutputStream
+ * @throws IOException if an I/O error occurs
*/
public static ZipOutputStream zip(final File file) throws IOException {
final OutputStream write = write(file);
@@ -447,10 +447,11 @@ public class IO {
}
/**
- *
+ * Method to unzip ZIP file
+ *
* @param file File
* @return ZipInputStream
- * @throws IOException
+ * @throws IOException if an I/O error occurs
*/
public static ZipInputStream unzip(final File file) throws IOException {
final InputStream read = read(file);
@@ -480,9 +481,10 @@ public class IO {
}
/**
- *
+ * Delete file
+ *
* @param file File
- * @return boolean
+ * @return boolean if file successfully deleted
*/
public static boolean delete(final File file) {
if (file == null) {
@@ -497,10 +499,11 @@ public class IO {
}
/**
- *
+ * Write data to the specified File destination
+ *
* @param destination File
* @return OutputStream
- * @throws FileNotFoundException
+ * @throws FileNotFoundException if the file is not found
*/
public static OutputStream write(final File destination) throws FileNotFoundException {
final OutputStream out = new FileOutputStream(destination);
@@ -508,11 +511,12 @@ public class IO {
}
/**
- *
+ * Write data to the specified File destination and append
+ *
* @param destination File
* @param append boolean
* @return OutputStream
- * @throws FileNotFoundException
+ * @throws FileNotFoundException if the file is not found
*/
public static OutputStream write(final File destination, final boolean append) throws FileNotFoundException {
final OutputStream out = new FileOutputStream(destination, append);
@@ -520,10 +524,11 @@ public class IO {
}
/**
- *
+ * Read data from the specified File source
+ *
* @param source File
* @return InputStream
- * @throws FileNotFoundException
+ * @throws FileNotFoundException if the file is not found
*/
public static InputStream read(final File source) throws FileNotFoundException {
final InputStream in = new FileInputStream(source);
@@ -531,7 +536,8 @@ public class IO {
}
/**
- *
+ * Read the next byte from the specified String to input stream
+ *
* @param content String
* @return InputStream
*/
@@ -540,7 +546,8 @@ public class IO {
}
/**
- *
+ * Read the next byte from the specified String to input stream using encoding
+ *
* @param content String
* @param encoding String
* @return InputStream
@@ -551,7 +558,8 @@ public class IO {
}
/**
- *
+ * Read the data from byte array
+ *
* @param content byte[]
* @return InputStream
*/
@@ -560,7 +568,7 @@ public class IO {
}
/**
- *
+ * Open connection to the specified URL and return InputStream for reading from the connection
* @param url URL
* @return InputStream
* @throws IOException
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
index 2d274cf..dba00e8 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/JarLocation.java
@@ -31,7 +31,8 @@ public class JarLocation {
}
/**
- *
+ * Return jar from the specified resource name
+ *
* @param resourceName String
* @return File
*/
@@ -40,7 +41,8 @@ public class JarLocation {
}
/**
- *
+ * Return jar from the specified resource name
+ *
* @param loader ClassLoader
* @param resourceName String
* @return File
@@ -80,7 +82,8 @@ public class JarLocation {
}
/**
- *
+ * Return jar location
+ *
* @param clazz Class
* @return File
*/
@@ -96,23 +99,12 @@ public class JarLocation {
}
}
- /**
- *
- * @param classFileName String
- * @param url URL
- * @return File
- */
public static File toFile(final String classFileName, final URL url) {
String path = url.getFile();
path = path.substring(0, path.length() - classFileName.length());
return new File(decode(path));
}
- /**
- *
- * @param fileName String
- * @return String
- */
public static String decode(final String fileName) {
if (fileName.indexOf('%') == -1) {
return fileName;
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java
index 635f30b..2ebadbb 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Loader.java
@@ -20,11 +20,6 @@ import java.util.Properties;
public interface Loader {
- /**
- *
- * @param properties Properties
- * @throws Exception
- */
void init(Properties properties) throws Exception;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java
index b9fc239..cfe3ab0 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/LoaderRuntimeException.java
@@ -18,19 +18,10 @@ package org.apache.openejb.loader;
public class LoaderRuntimeException extends RuntimeException {
- /**
- *
- * @param str String
- * @param e Throwable
- */
public LoaderRuntimeException(final String str, final Throwable e) {
super(str, e);
}
- /**
- *
- * @param e Exception
- */
public LoaderRuntimeException(final Exception e) {
super(e);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
index d352a66..69f7166 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/OpenEJBInstance.java
@@ -30,12 +30,7 @@ public class OpenEJBInstance {
this.init = openejb.getMethod("init", Properties.class);
this.isInitialized = openejb.getMethod("isInitialized");
}
-
- /**
- *
- * @param props Properties
- * @throws Exception
- */
+
public void init(final Properties props) throws Exception {
try {
init.invoke(null, props);
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
index 9d0b9cd..96bb761 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Options.java
@@ -73,34 +73,21 @@ public class Options {
private final Options parent;
private final TomEEPropertyAdapter properties;
- /**
- *
- * @param properties Properties
- */
public Options(final Properties properties) {
this(properties, new NullOptions());
}
- /**
- *
- * @param properties Properties
- * @param parent Options
- */
public Options(final Properties properties, final Options parent) {
this.parent = parent;
this.properties = new TomEEPropertyAdapter(properties);
}
- /**
- *
- * @return Properties
- */
public Properties getProperties() {
return properties.delegate;
}
/**
- *
+ *
* @param logger Log
*/
public void setLogger(final Log logger) {
@@ -116,7 +103,8 @@ public class Options {
}
/**
- *
+ * Method to check if properties contains the specified String property
+ *
* @param property String
* @return boolean
*/
@@ -125,7 +113,8 @@ public class Options {
}
/**
- *
+ * Return property by the specified String property
+ *
* @param property String
* @param defaultValue String
* @return String
@@ -136,13 +125,6 @@ public class Options {
return value != null ? log(property, value) : parent.get(property, defaultValue);
}
- /**
- *
- * @param <T>
- * @param property String
- * @param defaultValue T
- * @return
- */
@SuppressWarnings("unchecked")
public <T> T get(final String property, final T defaultValue) {
if (defaultValue == null) {
@@ -167,12 +149,6 @@ public class Options {
}
}
- /**
- *
- * @param property String
- * @param defaultValue int
- * @return int
- */
public int get(final String property, final int defaultValue) {
final String value = properties.getProperty(property);
@@ -188,12 +164,6 @@ public class Options {
}
}
- /**
- *
- * @param property String
- * @param defaultValue long
- * @return long
- */
public long get(final String property, final long defaultValue) {
final String value = properties.getProperty(property);
@@ -209,12 +179,6 @@ public class Options {
}
}
- /**
- *
- * @param property String
- * @param defaultValue boolean
- * @return boolean
- */
public boolean get(final String property, final boolean defaultValue) {
final String value = properties.getProperty(property);
@@ -230,12 +194,6 @@ public class Options {
}
}
- /**
- *
- * @param property String
- * @param defaultValue
- * @return
- */
public Class<?> get(final String property, final Class<?> defaultValue) {
final String className = properties.getProperty(property);
@@ -252,13 +210,6 @@ public class Options {
}
}
- /**
- *
- * @param <T>
- * @param property String
- * @param defaultValue
- * @return
- */
public <T extends Enum<T>> T get(final String property, final T defaultValue) {
final String value = properties.getProperty(property);
@@ -280,25 +231,11 @@ public class Options {
}
}
- /**
- *
- * @param <T>
- * @param property String
- * @param defaultValue T...
- * @return
- */
public <T extends Enum<T>> Set<T> getAll(final String property, final T... defaultValue) {
final EnumSet<T> defaults = EnumSet.copyOf(Arrays.asList(defaultValue));
return getAll(property, defaults);
}
- /**
- *
- * @param <T>
- * @param property String
- * @param defaultValue
- * @return
- */
public <T extends Enum<T>> Set<T> getAll(final String property, final Set<T> defaultValue) {
final Class<T> enumType;
try {
@@ -311,13 +248,6 @@ public class Options {
return getAll(property, defaultValue, enumType);
}
- /**
- *
- * @param <T>
- * @param property String
- * @param enumType
- * @return
- */
public <T extends Enum<T>> Set<T> getAll(final String property, final Class<T> enumType) {
return getAll(property, Collections.EMPTY_SET, enumType);
}
@@ -401,13 +331,6 @@ public class Options {
return value;
}
- /**
- *
- * @param <T>
- * @param property String
- * @param value
- * @return
- */
public <T extends Enum<T>> Set<T> logAll(final String property, final Set<T> value) {
if (!getLogger().isInfoEnabled()) {
return value;
@@ -418,12 +341,6 @@ public class Options {
return value;
}
- /**
- *
- * @param <T>
- * @param items
- * @return
- */
protected static <T extends Enum<T>> String[] lowercase(final T... items) {
final String[] values = new String[items.length];
for (int i = 0; i < items.length; i++) {
@@ -432,12 +349,6 @@ public class Options {
return values;
}
- /**
- *
- * @param <T>
- * @param items
- * @return
- */
protected static <T extends Enum<T>> String[] lowercase(final Collection<T> items) {
final String[] values = new String[items.size()];
int i = 0;
@@ -447,12 +358,6 @@ public class Options {
return values;
}
- /**
- *
- * @param <V>
- * @param v
- * @return
- */
protected static <V extends Enum<V>> String possibleValues(final V v) {
final Class<? extends Enum> enumType = v.getClass();
return possibleValues(enumType);
@@ -594,19 +499,10 @@ public class Options {
public static final int OPENEJB_PREFIX_LENGHT = "openejb.".length();
private final Properties delegate;
- /**
- *
- * @param properties Properties
- */
public TomEEPropertyAdapter(final Properties properties) {
this.delegate = properties;
}
- /**
- *
- * @param key String
- * @return String
- */
public String getProperty(final String key) {
String value = delegate.getProperty(key);
@@ -617,11 +513,6 @@ public class Options {
return value;
}
- /**
- *
- * @param key String
- * @return boolean
- */
public boolean containsKey(final String key) {
return delegate.containsKey(key)
|| delegate.containsKey(getTomeeKey(key));
@@ -669,45 +560,22 @@ public class Options {
return false;
}
- /**
- *
- * @param message String
- * @param t Throwable
- */
@Override
public void warning(final String message, final Throwable t) {
}
- /**
- *
- * @param message String
- */
@Override
public void warning(final String message) {
}
- /**
- *
- * @param message String
- * @param t Throwable
- */
@Override
public void debug(final String message, final Throwable t) {
}
- /**
- *
- * @param message String
- */
@Override
public void debug(final String message) {
}
- /**
- *
- * @param message String
- * @param t Throwable
- */
@Override
public void info(final String message, final Throwable t) {
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
index b1d20aa..f7540ca 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/ProvisioningUtil.java
@@ -43,11 +43,6 @@ public final class ProvisioningUtil {
// no-op
}
- /**
- *
- * @return
- * @throws IOException
- */
public static Collection<File> addAdditionalLibraries() throws IOException {
final File conf = SystemInstance.get().getConf(ADDITIONAL_LIB_CONFIG);
if (conf == null || !conf.exists()) {
@@ -148,11 +143,6 @@ public final class ProvisioningUtil {
return libs;
}
- /**
- *
- * @param location String
- * @return
- */
public static Set<String> realLocation(final String location) {
final boolean initialized = SystemInstance.isInitialized();
if (!initialized) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
index 70a5e01..609119a 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemInstance.java
@@ -130,18 +130,13 @@ public final class SystemInstance {
System.setProperty("derby.system.home", System.getProperty("derby.system.home", baseDirCanonicalPath));
}
- /**
- *
- * @param <E>
- * @param event
- * @return
- */
public <E> E fireEvent(final E event) {
return observerManager.fireEvent(event);
}
/**
- *
+ * Add the specified Object to Observer
+ *
* @param observer Object
* @return boolean
*/
@@ -150,7 +145,8 @@ public final class SystemInstance {
}
/**
- *
+ * Remove the specified Object from Observer
+ *
* @param observer Object
* @return boolean
*/
@@ -172,7 +168,8 @@ public final class SystemInstance {
}
/**
- *
+ * Return the property by the specified String key
+ *
* @param key String
* @return String
*/
@@ -181,7 +178,9 @@ public final class SystemInstance {
}
/**
- *
+ * Return the property by the specified String key
+ * if the key is not found the default value will be returned
+ *
* @param key String
* @param defaultValue String
* @return String
@@ -312,11 +311,6 @@ public final class SystemInstance {
}
}
- /**
- *
- * @param properties Properties
- * @throws Exception
- */
public static synchronized void init(final Properties properties) throws Exception {
if (initialized) {
return;
@@ -347,7 +341,8 @@ public final class SystemInstance {
}
/**
- *
+ * Returns the conf by the specified pathname
+ *
* @param subPath String
* @return File
*/
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
index 5869814..428c248 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
@@ -48,10 +48,6 @@ public class TomcatClassPath extends BasicURLClassPath {
this(getCommonLoader(getContextClassLoader()));
}
- /**
- *
- * @param classLoader ClassLoader
- */
public TomcatClassPath(final ClassLoader classLoader) {
this.commonLoader = classLoader;
@@ -129,11 +125,6 @@ public class TomcatClassPath extends BasicURLClassPath {
rebuild();
}
- /**
- *
- * @param jar URL
- * @throws Exception
- */
public void _addJarToPath(final URL jar) throws Exception {
ClassLoader classLoader = commonLoader;
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java
index 1b45361..94da85e 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/WebAppClassPath.java
@@ -22,10 +22,6 @@ public class WebAppClassPath extends TomcatClassPath {
this(getContextClassLoader());
}
- /**
- *
- * @param classLoader ClassLoader
- */
public WebAppClassPath(final ClassLoader classLoader) {
super(classLoader);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
index 6b52322..3893549 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/Zips.java
@@ -28,7 +28,8 @@ import java.util.zip.ZipInputStream;
public class Zips {
/**
- *
+ * Unzip the specified ZIP file to the specified destination
+ *
* @param zipFile File
* @param destination File
* @throws IOException
@@ -38,7 +39,8 @@ public class Zips {
}
/**
- *
+ * Unzip the specified ZIP file to the specified destination
+ *
* @param zipFile File
* @param destination File
* @param noparent boolean
@@ -61,7 +63,8 @@ public class Zips {
}
/**
- *
+ * Method to unzip ZIP files
+ *
* @param read InputStream
* @param destination File
* @param noparent boolean
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
index acb91fc..5370107 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentAdded.java
@@ -27,11 +27,6 @@ public class ComponentAdded<T> {
private final Class<T> type;
private final T component;
- /**
- *
- * @param type
- * @param component
- */
public ComponentAdded(final Class<T> type, final T component) {
this.type = type;
this.component = component;
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
index f5a1724..095aece 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/event/ComponentRemoved.java
@@ -27,11 +27,6 @@ public class ComponentRemoved<T> {
private final Class<T> type;
private final T component;
- /**
- *
- * @param type
- * @param component
- */
public ComponentRemoved(final Class<T> type, final T component) {
this.type = type;
this.component = component;
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java
index 34d625f..db8139f 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/HttpResolver.java
@@ -57,11 +57,6 @@ public class HttpResolver implements ArchiveResolver {
return lastPart(rawLocation.replace(':', '/'));
}
- /**
- *
- * @param location String
- * @return String
- */
public static String lastPart(final String location) {
int idx = location.lastIndexOf('/');
if (idx <= 0) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
index e753b4f..2f8c60d 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/MavenResolver.java
@@ -93,12 +93,6 @@ public class MavenResolver implements ArchiveResolver, ProvisioningResolverAware
return Objects.requireNonNull(SystemInstance.get().getComponent(ProvisioningResolver.class)).resolveStream(repo1Url);
}
- /**
- *
- * @param raw String
- * @return String
- * @throws MalformedURLException
- */
public String quickMvnUrl(final String raw) throws MalformedURLException {
final String base;
if (raw.contains(SNAPSHOT_SUFFIX) && raw.contains("apache")) {
@@ -295,10 +289,6 @@ public class MavenResolver implements ArchiveResolver, ProvisioningResolverAware
return defaultVersion;
}
- /**
- *
- * @param resolver ProvisioningResolver
- */
@Override
public void setResolver(final ProvisioningResolver resolver) {
this.resolver = resolver;
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java
index 421f887..fbdc767 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisiningResolverCreated.java
@@ -22,19 +22,10 @@ import org.apache.openejb.observer.Event;
public class ProvisiningResolverCreated {
private final ProvisioningResolver resolver;
- /**
- *
- * @param provisioningResolver ProvisioningResolver
- */
public ProvisiningResolverCreated(final ProvisioningResolver provisioningResolver) {
resolver = provisioningResolver;
}
- /**
- *
- * @param resolver ArchiveResolver
- * @return ProvisiningResolverCreated
- */
public ProvisiningResolverCreated register(final ArchiveResolver resolver) {
this.resolver.addResolver(resolver);
return this;
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
index ebe8dff..4bbe082 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolver.java
@@ -75,7 +75,8 @@ public class ProvisioningResolver {
}
/**
- *
+ * Add ArchiveResolver to resolvers
+ *
* @param resolver ArchiveResolver
*/
public void addResolver(final ArchiveResolver resolver) {
@@ -85,7 +86,8 @@ public class ProvisioningResolver {
}
/**
- *
+ * Remove ArchiveResolver
+ *
* @param resolver ArchiveResolver
*/
public void removeResolver(final ArchiveResolver resolver) {
@@ -93,7 +95,8 @@ public class ProvisioningResolver {
}
/**
- *
+ * Real path location of the specified location
+ *
* @param rawLocation String
* @return
*/
@@ -171,12 +174,6 @@ public class ProvisioningResolver {
}
}
- /**
- *
- * @param rawLocation String
- * @return InputStream
- * @throws MalformedURLException
- */
public InputStream resolveStream(final String rawLocation) throws MalformedURLException {
final File file = new File(rawLocation);
if (file.exists()) {
@@ -196,7 +193,7 @@ public class ProvisioningResolver {
}
/**
- *
+ * Cache the specified String pathname
* @param path String
* @return File
*/
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java
index 7fc4dd3..1158718 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/loader/provisining/ProvisioningResolverAware.java
@@ -22,9 +22,5 @@ package org.apache.openejb.loader.provisining;
// ex: mvn delegates to http if the archive is not found locally
public interface ProvisioningResolverAware {
- /**
- *
- * @param resolver ProvisioningResolver
- */
void setResolver(ProvisioningResolver resolver);
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
index 53fb577..29a44be 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/ObserverManager.java
@@ -56,7 +56,8 @@ public class ObserverManager {
private final Map<Class, Invocation> methods = new ConcurrentHashMap<>();
/**
- *
+ * Add Object to Observer
+ *
* @param observer Object
* @return boolean
*/
@@ -80,7 +81,8 @@ public class ObserverManager {
}
/**
- *
+ * Remove Object from Observer
+ *
* @param observer Object
* @return boolean
*/
@@ -321,30 +323,14 @@ public class ObserverManager {
}
}
- /**
- *
- * @param event Phase
- * @param eventType Class
- * @return Invocation
- */
public Invocation get(final Phase event, final Class eventType) {
return get(map(event), eventType);
}
- /**
- *
- * @param eventType Class
- * @return Invocation
- */
public Invocation getAfter(final Class eventType) {
return get(after, eventType);
}
- /**
- *
- * @param eventType Class
- * @return
- */
public Invocation getBefore(final Class eventType) {
return get(before, eventType);
}
@@ -417,20 +403,11 @@ public class ObserverManager {
private final Method method;
private final Object observer;
- /**
- *
- * @param method Method
- * @param observer Object
- */
public MethodInvocation(final Method method, final Object observer) {
this.method = method;
this.observer = observer;
}
- /**
- *
- * @param event Object
- */
@Override
public void invoke(final Object event) {
try {
@@ -540,11 +517,6 @@ public class ObserverManager {
private final List<Invocation> invocations = new LinkedList<>();
- /**
- *
- * @param invocation Invocation
- * @return boolean
- */
public boolean add(final Invocation invocation) {
return invocations.add(invocation);
}
@@ -553,10 +525,6 @@ public class ObserverManager {
return invocations;
}
- /**
- *
- * @param event Object
- */
@Override
public void invoke(final Object event) {
for (final Invocation invocation : invocations) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
index 361ee0a..87dbd74 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverAdded.java
@@ -26,10 +26,6 @@ public class ObserverAdded {
private final Object observer;
- /**
- *
- * @param observer Object
- */
public ObserverAdded(final Object observer) {
this.observer = observer;
}
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
index 9d27b68..83beb49 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverFailed.java
@@ -34,13 +34,6 @@ public class ObserverFailed {
private final Throwable throwable;
- /**
- *
- * @param observer Object
- * @param method Method
- * @param event Object
- * @param throwable Throwable
- */
public ObserverFailed(final Object observer, final Method method, final Object event, final Throwable throwable) {
this.observer = observer;
this.event = event;
http://git-wip-us.apache.org/repos/asf/tomee/blob/4c643f7b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
----------------------------------------------------------------------
diff --git a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
index a685757..f33efa3 100644
--- a/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
+++ b/container/openejb-loader/src/main/java/org/apache/openejb/observer/event/ObserverRemoved.java
@@ -26,10 +26,6 @@ public class ObserverRemoved {
private final Object observer;
- /**
- *
- * @param observer Object
- */
public ObserverRemoved(final Object observer) {
this.observer = observer;
}