mirror of https://github.com/qos-ch/slf4j
class.getModule is new in Java9
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
This commit is contained in:
parent
3ff00870b3
commit
8ae0efca23
|
|
@ -24,9 +24,6 @@
|
|||
|
||||
package org.slf4j.helpers;
|
||||
|
||||
import java.lang.module.ModuleDescriptor;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Various utility methods
|
||||
*
|
||||
|
|
@ -42,9 +39,9 @@ public class Slf4jEnvUtil {
|
|||
* @since 2.0.14
|
||||
*/
|
||||
static public String slf4jVersion() {
|
||||
String moduleVersion = slf4jVersionByModule();
|
||||
if(moduleVersion != null)
|
||||
return moduleVersion;
|
||||
// String moduleVersion = slf4jVersionByModule();
|
||||
// if(moduleVersion != null)
|
||||
// return moduleVersion;
|
||||
|
||||
Package pkg = Slf4jEnvUtil.class.getPackage();
|
||||
if(pkg == null) {
|
||||
|
|
@ -61,16 +58,16 @@ public class Slf4jEnvUtil {
|
|||
* @return current version or null if missing version data
|
||||
* @since 2.0.14
|
||||
*/
|
||||
static private String slf4jVersionByModule() {
|
||||
Module module = Slf4jEnvUtil.class.getModule();
|
||||
if (module == null)
|
||||
return null;
|
||||
|
||||
ModuleDescriptor md = module.getDescriptor();
|
||||
if (md == null)
|
||||
return null;
|
||||
Optional<String> opt = md.rawVersion();
|
||||
return opt.orElse(null);
|
||||
}
|
||||
// static private String slf4jVersionByModule() {
|
||||
// Module module = Slf4jEnvUtil.class.getModule();
|
||||
// if (module == null)
|
||||
// return null;
|
||||
//
|
||||
// ModuleDescriptor md = module.getDescriptor();
|
||||
// if (md == null)
|
||||
// return null;
|
||||
// Optional<String> opt = md.rawVersion();
|
||||
// return opt.orElse(null);
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue