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 2019/12/12 15:28:59 UTC

[isis] branch master updated (96d445b -> c87085c)

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

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


    from 96d445b  ISIS-2224: fixes smoketests complaining about missing properties
     new 398aec7  ISIS-2223: remove Defaults from applib (not referenced)
     new c87085c  ISIS-2223: fixing code quality issues

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/isis/applib/Defaults.java | 47 ----------------------
 .../isis/applib/util/TitleBufferException.java     |  2 +-
 .../isis/applib/value/LocalResourcePath.java       | 23 +++++++----
 3 files changed, 16 insertions(+), 56 deletions(-)
 delete mode 100755 core/applib/src/main/java/org/apache/isis/applib/Defaults.java


[isis] 02/02: ISIS-2223: fixing code quality issues

Posted by ah...@apache.org.
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 c87085cc50eab1cb3228d1e0bada93a8b1829b30
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Dec 12 16:28:47 2019 +0100

    ISIS-2223: fixing code quality issues
---
 .../isis/applib/util/TitleBufferException.java     |  2 +-
 .../isis/applib/value/LocalResourcePath.java       | 23 ++++++++++++++--------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/util/TitleBufferException.java b/core/applib/src/main/java/org/apache/isis/applib/util/TitleBufferException.java
index 0928182..64ec136 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/util/TitleBufferException.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/util/TitleBufferException.java
@@ -42,7 +42,7 @@ public class TitleBufferException extends RuntimeException {
     }
 
     @Override
-    public Throwable getCause() {
+    public synchronized Throwable getCause() {
         return cause;
     }
 }
diff --git a/core/applib/src/main/java/org/apache/isis/applib/value/LocalResourcePath.java b/core/applib/src/main/java/org/apache/isis/applib/value/LocalResourcePath.java
index f657475..34b45af 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/value/LocalResourcePath.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/value/LocalResourcePath.java
@@ -26,13 +26,15 @@ import javax.annotation.Nonnull;
 
 import org.apache.isis.applib.annotation.Value;
 
+import lombok.NonNull;
+
 /**
  * Represents a local resource path, typically a relative path originating at this web-app's root or context-root.
  */
 @Value(semanticsProviderName = "org.apache.isis.metamodel.facets.value.localrespath.LocalResourcePathValueSemanticsProvider")
 public final class LocalResourcePath implements Serializable {
     private static final long serialVersionUID = 1L;
-    private final String path;
+    @NonNull private final String path;
 
     public LocalResourcePath(final String path) throws IllegalArgumentException {
 
@@ -41,7 +43,7 @@ public final class LocalResourcePath implements Serializable {
         this.path = (path != null) ? path : "";
     }
 
-    @Nonnull
+    @NonNull
     public Object getValue() {
         return path;
     }
@@ -58,25 +60,30 @@ public final class LocalResourcePath implements Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if(obj==null)
+        if(obj==null) {
             return false;
-
+        }
         return (obj instanceof LocalResourcePath) ?	isEqualTo((LocalResourcePath)obj) : false;
     }
+    
+    @Override
+    public int hashCode() {
+        return path.hashCode();
+    }
 
     public boolean isEqualTo(LocalResourcePath other) {
-        if(other==null)
+        if(other==null) {
             return false;
-
+        }
         return this.getPath().equals(other.getPath());
     }
 
     // -- HELPER
 
     private void validate(String path) throws IllegalArgumentException {
-        if(path==null)
+        if(path==null) {
             return;
-
+        }
         try {
             // used for syntax testing
             new java.net.URI("http://localhost/"+path);


[isis] 01/02: ISIS-2223: remove Defaults from applib (not referenced)

Posted by ah...@apache.org.
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 398aec7eb653a16325f0bbc8be6e80bea11feb34
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Dec 12 16:02:48 2019 +0100

    ISIS-2223: remove Defaults from applib (not referenced)
    
    code quality complaint: not threadsafe
---
 .../main/java/org/apache/isis/applib/Defaults.java | 47 ----------------------
 1 file changed, 47 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/Defaults.java b/core/applib/src/main/java/org/apache/isis/applib/Defaults.java
deleted file mode 100755
index eebad2a..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/Defaults.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.applib;
-
-import java.util.Calendar;
-
-import org.joda.time.DateTimeZone;
-
-public class Defaults {
-    static {
-        setTimeZone(DateTimeZone.UTC);
-    }
-
-    static DateTimeZone timeZone = DateTimeZone.UTC;
-
-    public static DateTimeZone getTimeZone() {
-        return timeZone;
-    }
-
-    public static void setTimeZone(final DateTimeZone timezone) {
-        timeZone = timezone;
-        calendar = Calendar.getInstance(timezone.toTimeZone());
-    }
-
-    private static Calendar calendar;
-
-    public static Calendar getCalendar() {
-        return calendar;
-    }
-
-}