Enhancement #6397

Deprecate Callback and Callable interfaces from org.simantics.utils.datastructures

Added by Tuukka Lehtonen almost 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:2016-03-31
Priority:4Due date:2016-03-31
Assignee:Tuukka Lehtonen% Done:

100%

Category:-Spent time:5.00 hours
Target version:1.23.0
Release notes:Deprecated org.simantics.utils.datastructures.Callback/Callable interfaces in favor of Java 8 the functional Consumer and Supplier interfaces.
Tags: refactor, java8
Story points-
Velocity based estimate-
ReleaseSimantics 1.23.0Release relationshipAuto

Description

Both interfaces are directly replaceable by Java 8 interfaces Consumer and Supplier.
We should minimize the dependencies in our code on our own custom interfaces and use standard functional interfaces where possible.

Also change all platform locations using either interface to use the standard Java interfaces.

Migration instructions:
  • Replace uses of org.simantics.utils.datastructures.Callback<T> with java.util.function.Consumer<T>
    • Change invocations of the callback from run(t) to accept(t)
  • Replace uses of org.simantics.utils.datastructures.Callable<T> with java.util.function.Supplier<T>
    • Change invocations of the callable from call() to get()

Related issues

Related to Sysdyn - Enhancement #6400: Update all references to deprecated Simantics interfaces ... Closed 2016-03-31 2016-03-31
Related to Platform - Enhancement #6649: Make deprecated org.simantics.utils.datastructures.Callba... Closed 2016-08-16 2016-08-16
Related to Platform - Support #6520: Interop plug-isn using old interfaces Closed 2016-06-02 2016-06-02

Associated revisions

Revision 32620
Added by Tuukka Lehtonen almost 2 years ago

Deprecated interfaces org.simantics.utils.datastructures.{Callable,Callback} since they can be directly replaced by Java 8 Supplier and Consumer interfaces.

refs #6397

Revision 32623
Added by Tuukka Lehtonen almost 2 years ago

Getting rid of the use of deprecated Simantics-specific Callable and Callback interfaces in the platform as much as possible.

refs #6397

Revision 32624
Added by Tuukka Lehtonen almost 2 years ago

Reverted accidentally committed changes.

refs #6397

Revision 32625
Added by Tuukka Lehtonen almost 2 years ago

Added missing SymbolEditorCopyPasteStrategy stub implementation.

refs #6397

Revision 32626
Added by Tuukka Lehtonen almost 2 years ago

Getting rid of the use of deprecated Simantics-specific Callable and Callback interfaces in the platform as much as possible.

refs #6397

Revision 32712
Added by Tuukka Lehtonen almost 2 years ago

Removed use of deprecated Callback interface.

refs #6397

Revision 32716
Added by Tuukka Lehtonen almost 2 years ago

(refs #6397) Removed use of deprecated Callback interface.

Revision 32750
Added by Tuukka Lehtonen almost 2 years ago

(refs #6397) Merged trunk r32712,r32716 to branches/simantics-1.23 on 2016-05-02 for 1.23.0 release.

Revision 32756
Added by Tuukka Lehtonen almost 2 years ago

(refs #6397, refs #6407) Merging scripts.

History

#1 Updated by Tuukka Lehtonen almost 2 years ago

  • Tracker changed from Bug to Enhancement

#2 Updated by Tuukka Lehtonen almost 2 years ago

  • Description updated (diff)
  • Status changed from New to In Progress

#3 Updated by Tuukka Lehtonen almost 2 years ago

  • Description updated (diff)

#4 Updated by Tuukka Lehtonen almost 2 years ago

Pretty much everything else besides the use of Callback on the DB interfaces and the DB internal implementation have been replaced with standard java functional interfaces.

#5 Updated by Tuukka Lehtonen almost 2 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 50

#6 Updated by Tuukka Lehtonen almost 2 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 50 to 100

#7 Updated by Tuukka Lehtonen almost 2 years ago

  • Release notes set to Deprecated org.simantics.utils.datastructures.Callback/Callable interfaces in favor of Java 8 the functional Consumer and Supplier interfaces.

Also available in: Atom PDF