You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/05/31 10:13:25 UTC

[isis] 03/05: ISIS-1954: fix some compiler warnings

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 6c34f96e89fd1329b4b46933c87654c3bf19a252
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu May 31 10:33:47 2018 +0200

    ISIS-1954: fix some compiler warnings
    
    Task-Url: https://issues.apache.org/jira/browse/ISIS-1954
---
 .../isis/core/runtime/headless/IsisSystem.java       | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/headless/IsisSystem.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/headless/IsisSystem.java
index 7a873fa..8892029 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/headless/IsisSystem.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/headless/IsisSystem.java
@@ -19,6 +19,8 @@
 
 package org.apache.isis.core.runtime.headless;
 
+import static org.apache.isis.commons.internal.base._Casts.uncheckedCast;
+
 import java.util.Set;
 
 import org.apache.isis.applib.AppManifest;
@@ -95,22 +97,22 @@ public class IsisSystem {
 
         public T with(IsisConfiguration configuration) {
             this.configuration = (IsisConfigurationDefault) configuration;
-            return (T)this;
+            return uncheckedCast(this);
         }
 
         public T with(AuthenticationRequest authenticationRequest) {
             this.authenticationRequest = authenticationRequest;
-            return (T)this;
+            return uncheckedCast(this);
         }
 
         public T with(AppManifest appManifest) {
             this.appManifestIfAny = appManifest;
-            return (T)this;
+            return uncheckedCast(this);
         }
 
         public T withLoggingAt(org.apache.log4j.Level level) {
             this.level = level;
-            return (T)this;
+            return uncheckedCast(this);
         }
 
         public S build() {
@@ -119,10 +121,10 @@ public class IsisSystem {
                             appManifestIfAny,
                             configuration,
                             authenticationRequest);
-            return (S)configure(isisSystem);
+            return configure(uncheckedCast(isisSystem));
         }
 
-        protected <T extends IsisSystem> T configure(final T isisSystem) {
+        protected S configure(final S isisSystem) {
             if(level != null) {
                 isisSystem.setLevel(level);
             }
@@ -151,12 +153,10 @@ public class IsisSystem {
 
     }
 
-    public static Builder builder() {
-        return new Builder();
+    public static <T extends Builder<T, S>, S extends IsisSystem> Builder<T, S> builder() {
+        return new Builder<>();
     }
 
-    
-
     // -- constructor, fields
 
     // these fields 'xxxForComponentProvider' are used to initialize the IsisComponentProvider, but shouldn't be used thereafter.

-- 
To stop receiving notification emails like this one, please contact
ahuber@apache.org.