[jira] [Comment Edited] (ISIS-1846) API Cleanup: code deduplication

2018-01-23 Thread Andi Huber (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16334084#comment-16334084
 ] 

Andi Huber edited comment on ISIS-1846 at 1/23/18 8:21 AM:
---

One possible solution:

We consolidate all internal utility classes in *isis-core-applib* under 
*org.apache.isis.applib.internal.xxx*, put some 'Please do not use, will be 
removed with Java9' warnings into each classes java-doc and ignore the fact, 
that some developers might accidentally use these classes.

We could use a class naming convention for 'internal' classes like prefixing 
with the underscore character ...
* _Strings
* _NullSafe
* _Casts
* _Comparators
* _Constants

to further reduce the risk of misuse.



was (Author: hobrom):
One possible solution:

We consolidate all internal utility classes in *isis-core-applib* under 
*org.apache.isis.applib.internal.xxx*, put some 'Please do not use, will be 
removed with Java9' warnings into each classes java-doc and ignore the fact, 
that some developers might accidentally use these classes.

We could use a class naming convention for 'internal' classes like prefixing 
with the dollar character ...
* _Strings
* _NullSafe
* _Casts
* _Comparators
* _Constants

to further reduce the risk of misuse.


> API Cleanup: code deduplication
> ---
>
> Key: ISIS-1846
> URL: https://issues.apache.org/jira/browse/ISIS-1846
> Project: Isis
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> isis-core-applib would be the perfect place to consolidate any internal 
> utility classes such as
> NullSafe (common null check idioms), StringExtensions, ordering algorithms, 
> etc ...
> but we would want to keep these classes contained, meaning they should not be 
> available for public use, just for internal use within Isis' code-base.
> Java 9 has the perfect solution for this. But what can we do in the meantime 
> (with Java 8)?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (ISIS-1847) Eventbus: AbstractDomainEvent incorrect veto handling?

2018-01-23 Thread Andi Huber (JIRA)
Andi Huber created ISIS-1847:


 Summary: Eventbus: AbstractDomainEvent incorrect veto handling?
 Key: ISIS-1847
 URL: https://issues.apache.org/jira/browse/ISIS-1847
 Project: Isis
  Issue Type: Bug
  Components: Core
Reporter: Andi Huber


When refactoring switch statements I found 2 in
 isis-core-applib's
 *org.apache.isis.applib.services.eventbus.AbstractDomainEvent*
 where the cases have no break statements.

Is this intentional or a bug?

Just for reference, here's the refactored version [1].

[1] 
[https://github.com/apache/isis/blob/8e8b5f1a8e4780b467ab31a7d909f89e499244a9/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AbstractDomainEvent.java]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ISIS-1846) API Cleanup: code deduplication

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16335633#comment-16335633
 ] 

ASF subversion and git services commented on ISIS-1846:
---

Commit 286b2c595b8b993e401aa2b3f5630b7691a264bd in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=286b2c5 ]

ISIS-1846 consolidate uses of constants 'emptyObjects' + 'emptyClasses'

> API Cleanup: code deduplication
> ---
>
> Key: ISIS-1846
> URL: https://issues.apache.org/jira/browse/ISIS-1846
> Project: Isis
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> isis-core-applib would be the perfect place to consolidate any internal 
> utility classes such as
> NullSafe (common null check idioms), StringExtensions, ordering algorithms, 
> etc ...
> but we would want to keep these classes contained, meaning they should not be 
> available for public use, just for internal use within Isis' code-base.
> Java 9 has the perfect solution for this. But what can we do in the meantime 
> (with Java 8)?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ISIS-1841) API cleanup + refactoring for version 2

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16335635#comment-16335635
 ] 

ASF subversion and git services commented on ISIS-1841:
---

Commit 9c2514c7d971bf17576d31acdc95aba434b7515d in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=9c2514c ]

ISIS-1841 remove unused setter, that does nothing anyway

> API cleanup + refactoring for version 2
> ---
>
> Key: ISIS-1841
> URL: https://issues.apache.org/jira/browse/ISIS-1841
> Project: Isis
>  Issue Type: Task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> add generic type arguments where missing
> reduce number of compiler warnings (enums with missing cases, unchecked 
> casts, vararg type safety, ...)
> reduce duplicate code occurrences (e.g. DeweyOrder Utils, ...)
> reduce occurrences of guava's (Predicate, Function, ...)  interfaces, that 
> have direct Java 8 replacements (at least where easily possible)
> reduce occurrences of deprecated uses



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ISIS-1841) API cleanup + refactoring for version 2

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16335634#comment-16335634
 ] 

ASF subversion and git services commented on ISIS-1841:
---

Commit 3b9aded419530572499770ae854377e23b976d05 in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=3b9aded ]

ISIS-1841 replace uses of deprecated Nullable with Java's Optional

> API cleanup + refactoring for version 2
> ---
>
> Key: ISIS-1841
> URL: https://issues.apache.org/jira/browse/ISIS-1841
> Project: Isis
>  Issue Type: Task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> add generic type arguments where missing
> reduce number of compiler warnings (enums with missing cases, unchecked 
> casts, vararg type safety, ...)
> reduce duplicate code occurrences (e.g. DeweyOrder Utils, ...)
> reduce occurrences of guava's (Predicate, Function, ...)  interfaces, that 
> have direct Java 8 replacements (at least where easily possible)
> reduce occurrences of deprecated uses



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ISIS-1846) API Cleanup: code deduplication

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16335632#comment-16335632
 ] 

ASF subversion and git services commented on ISIS-1846:
---

Commit 70a5f0df5029d7b937f19f38dbe922faf3f7e9a4 in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=70a5f0d ]

ISIS-1846 introduces _Constants (internal API)

> API Cleanup: code deduplication
> ---
>
> Key: ISIS-1846
> URL: https://issues.apache.org/jira/browse/ISIS-1846
> Project: Isis
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> isis-core-applib would be the perfect place to consolidate any internal 
> utility classes such as
> NullSafe (common null check idioms), StringExtensions, ordering algorithms, 
> etc ...
> but we would want to keep these classes contained, meaning they should not be 
> available for public use, just for internal use within Isis' code-base.
> Java 9 has the perfect solution for this. But what can we do in the meantime 
> (with Java 8)?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ISIS-1841) API cleanup + refactoring for version 2

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16335637#comment-16335637
 ] 

ASF subversion and git services commented on ISIS-1841:
---

Commit 7d5b53832b55f0125f4f7998b187e1b415d6258f in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=7d5b538 ]

ISIS-1841 cleanup some compiler warnings

> API cleanup + refactoring for version 2
> ---
>
> Key: ISIS-1841
> URL: https://issues.apache.org/jira/browse/ISIS-1841
> Project: Isis
>  Issue Type: Task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> add generic type arguments where missing
> reduce number of compiler warnings (enums with missing cases, unchecked 
> casts, vararg type safety, ...)
> reduce duplicate code occurrences (e.g. DeweyOrder Utils, ...)
> reduce occurrences of guava's (Predicate, Function, ...)  interfaces, that 
> have direct Java 8 replacements (at least where easily possible)
> reduce occurrences of deprecated uses



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ISIS-1846) API Cleanup: code deduplication

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16335631#comment-16335631
 ] 

ASF subversion and git services commented on ISIS-1846:
---

Commit a5931f6d1e991de0bfd5ff9c97cb54f0aaa3021d in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=a5931f6 ]

ISIS-1846 clarify corner cases for string splitting + tests

> API Cleanup: code deduplication
> ---
>
> Key: ISIS-1846
> URL: https://issues.apache.org/jira/browse/ISIS-1846
> Project: Isis
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> isis-core-applib would be the perfect place to consolidate any internal 
> utility classes such as
> NullSafe (common null check idioms), StringExtensions, ordering algorithms, 
> etc ...
> but we would want to keep these classes contained, meaning they should not be 
> available for public use, just for internal use within Isis' code-base.
> Java 9 has the perfect solution for this. But what can we do in the meantime 
> (with Java 8)?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ISIS-1846) API Cleanup: code deduplication

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16335636#comment-16335636
 ] 

ASF subversion and git services commented on ISIS-1846:
---

Commit fe219d009f9aea07cb054c3e0ae101a8df2ec738 in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=fe219d0 ]

ISIS-1846 add _Exceptions to internal API

> API Cleanup: code deduplication
> ---
>
> Key: ISIS-1846
> URL: https://issues.apache.org/jira/browse/ISIS-1846
> Project: Isis
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> isis-core-applib would be the perfect place to consolidate any internal 
> utility classes such as
> NullSafe (common null check idioms), StringExtensions, ordering algorithms, 
> etc ...
> but we would want to keep these classes contained, meaning they should not be 
> available for public use, just for internal use within Isis' code-base.
> Java 9 has the perfect solution for this. But what can we do in the meantime 
> (with Java 8)?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (ISIS-1847) Eventbus: AbstractDomainEvent incorrect veto handling?

2018-01-23 Thread Andi Huber (JIRA)

 [ 
https://issues.apache.org/jira/browse/ISIS-1847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andi Huber updated ISIS-1847:
-
Fix Version/s: 2.0.0-M1
   1.16.1

> Eventbus: AbstractDomainEvent incorrect veto handling?
> --
>
> Key: ISIS-1847
> URL: https://issues.apache.org/jira/browse/ISIS-1847
> Project: Isis
>  Issue Type: Bug
>  Components: Core
>Reporter: Andi Huber
>Priority: Major
> Fix For: 1.16.1, 2.0.0-M1
>
>
> When refactoring switch statements I found 2 in
>  isis-core-applib's
>  *org.apache.isis.applib.services.eventbus.AbstractDomainEvent*
>  where the cases have no break statements.
> Is this intentional or a bug?
> Just for reference, here's the refactored version [1].
> [1] 
> [https://github.com/apache/isis/blob/8e8b5f1a8e4780b467ab31a7d909f89e499244a9/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AbstractDomainEvent.java]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ISIS-1846) API Cleanup: code deduplication

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16336251#comment-16336251
 ] 

ASF subversion and git services commented on ISIS-1846:
---

Commit 5dd9f737062fd2466e39039deaf91db6aa1014f5 in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=5dd9f73 ]

ISIS-1846 improve java-doc

> API Cleanup: code deduplication
> ---
>
> Key: ISIS-1846
> URL: https://issues.apache.org/jira/browse/ISIS-1846
> Project: Isis
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> isis-core-applib would be the perfect place to consolidate any internal 
> utility classes such as
> NullSafe (common null check idioms), StringExtensions, ordering algorithms, 
> etc ...
> but we would want to keep these classes contained, meaning they should not be 
> available for public use, just for internal use within Isis' code-base.
> Java 9 has the perfect solution for this. But what can we do in the meantime 
> (with Java 8)?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Internal API: Introduction

2018-01-23 Thread Andreas Huber
Hi Folks!

I'd like to give a summary of changes introduced with branch
ISIS-1846_internal_utils that's meant for version 2.0.0. (Ready for
review and comments.)

In order to consolidate recurring code fragments and idioms, we gather
these within an Internal API which ...
* is shared among the entire code base (except unittestsupport)
* has explicit java-doc warnings 'internal use only ... likely to change
without notice'
* is gathered within org.apache.isis.applib.internal.xxx
* has naming convention: class-names should be prefixed with underscore (_)
* has naming suggestion: package private support classes should follow
'mixin naming style'
* is not part of the public API and will be access restricted once Java
9 will be in place

= Internal API Summary [1]

== _Constants
* as the name suggests, a collection of immutable recurring immutables
* helps to reduce heap pollution (at least a little bit)

== _Casts
* collection of common type casting use-cases
* by now we have only one: unchecked casts

== _NullSafe
* shortcuts for common null-check idioms
* shortcuts for common empty-check idioms
* convenient ways for null-safe stream creation

== _Strings
* all use-cases are implemented null-safe (we handle null inputs properly)
* has some basic building blocks like 'trim', 'upper', 'lower', 'capitalize'
* can combine building blocks via unary-operator composition
* more complex string processing operators are provided via mixins
* convenient string splitting via Stream splitThenStream(input,
separator)

== _Comparators
* complex recurring comparators (e.g. dewey-order) are provided via mixins

== _Context
* provides a mechanism for storing and retrieving singletons
* needed to replaces static fields in our code-base that have a
application-scoped life-cycle
* could be backed with CDI once we have it, by now uses a static hash-map

== _Exceptions
provides recurring exception creation idioms like
* 'unexpected code reach' or
* 'case not handled' in switch statements

== _Reflect
Since we use an external reflection API (reflections.org), we refactored
all use-cases throughout our code-base (except unittestsupport) to
access 'reflections.org' only via the interfaces now provided by
_Reflect. This allows for easy replacement under the hood, if needed.
Maven dependencies have been updated, such that 'reflections.org' is
only a compile-dependency for isis-core-applib (and unittestsupport) but
this dependency is not transitive (meaning, its not propagated to the
other core-projects).

Cheers Andi!

[1]
https://github.com/apache/isis/tree/ISIS-1846_internal_utils/core/applib/src/main/java/org/apache/isis/applib/internal














[jira] [Commented] (ISIS-1846) API Cleanup: code deduplication

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16336262#comment-16336262
 ] 

ASF subversion and git services commented on ISIS-1846:
---

Commit 71101fca273d874c581bce05d3feb7d93ba44ce6 in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=71101fc ]

ISIS-1846 put empty string array also in _Constants for convenience

> API Cleanup: code deduplication
> ---
>
> Key: ISIS-1846
> URL: https://issues.apache.org/jira/browse/ISIS-1846
> Project: Isis
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> isis-core-applib would be the perfect place to consolidate any internal 
> utility classes such as
> NullSafe (common null check idioms), StringExtensions, ordering algorithms, 
> etc ...
> but we would want to keep these classes contained, meaning they should not be 
> available for public use, just for internal use within Isis' code-base.
> Java 9 has the perfect solution for this. But what can we do in the meantime 
> (with Java 8)?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ISIS-1846) API Cleanup: code deduplication

2018-01-23 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ISIS-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16335932#comment-16335932
 ] 

ASF subversion and git services commented on ISIS-1846:
---

Commit 7743f0b9587fe5c797d909e1988b3d4382ef8575 in isis's branch 
refs/heads/ISIS-1846_internal_utils from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=7743f0b ]

ISIS-1846 java-doc: simplify warnings for internal API use

> API Cleanup: code deduplication
> ---
>
> Key: ISIS-1846
> URL: https://issues.apache.org/jira/browse/ISIS-1846
> Project: Isis
>  Issue Type: Sub-task
>  Components: Core
>Reporter: Andi Huber
>Assignee: Andi Huber
>Priority: Major
> Fix For: 2.0.0-M1
>
>
> isis-core-applib would be the perfect place to consolidate any internal 
> utility classes such as
> NullSafe (common null check idioms), StringExtensions, ordering algorithms, 
> etc ...
> but we would want to keep these classes contained, meaning they should not be 
> available for public use, just for internal use within Isis' code-base.
> Java 9 has the perfect solution for this. But what can we do in the meantime 
> (with Java 8)?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)