Syncleus / aparapi

The New Official Aparapi: a framework for executing native Java and Scala code on the GPU.
http://aparapi.com
Apache License 2.0
466 stars 59 forks source link

Update: Changed KernelManager for easy class extension #106

Closed CoreRasurae closed 6 years ago

CoreRasurae commented 6 years ago

Previous KernelManager implementation defined a default initialization in its constructor which called a very likely method for being overriden, namely createDefaultPreferences(). This was causing difficulties when extending KernelManager with another class that intended to redefine createDefaultPreferences() method based on non-static values passed through the redefined constructor of the derived class. What happens is that upon calling the derived class constructor it would call the super class default constructor which would call the overriden createDefaultPreferences() method even before the non-static class fields having been initialized from the new class constructor parameters. This could potential cause exceptions, but would also make createDefaultPreferences() to be called before time.

freemo commented 6 years ago

@CoreRasurae Technically since this isnt a bug fix it should bump the version to 1.8.0

CoreRasurae commented 6 years ago

@freemo Ok, I'll change that

codecov-io commented 6 years ago

Codecov Report

Merging #106 into master will increase coverage by 5.71%. The diff coverage is 100%.

@@             Coverage Diff              @@
##             master     #106      +/-   ##
============================================
+ Coverage     47.06%   52.78%   +5.71%     
- Complexity      897     1088     +191     
============================================
  Files            58       58              
  Lines          9739     9743       +4     
  Branches       1589     1589              
============================================
+ Hits           4584     5143     +559     
+ Misses         4692     4085     -607     
- Partials        463      515      +52
CoreRasurae commented 6 years ago

@freemo Done!

freemo commented 6 years ago

@CoreRasurae Thanks merged