Coder Social home page Coder Social logo

ddimtirov / nuggets Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 1.28 MB

nuggets is (yet another) utility library for Java

Home Page: https://ddimtirov.github.io/nuggets/javadoc/io/github/ddimitrov/nuggets/package-summary.html

License: Apache License 2.0

Java 62.40% Groovy 32.64% Shell 0.18% Kotlin 2.86% CSS 1.92%
java usability utility

nuggets's People

Contributors

ddimtirov avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

remkop

nuggets's Issues

Port Allocator

  • Support block port reservation as well as allocating ports by binding to port zero and releasing
  • Support pluggable registry to support multi-classloader and multi-process use-cases
    • hash-map
    • System.properties
    • Consul or Etcd
  • Support Bonjour/zeroconf/mdns
  • Support TCP and UDP

Groovy-native API

Groovy should not be a dependency, but if it exists on the classpath, we should fit right in (after all we are using Spock)

  • Take advantage of Closure->Lambda conversion.
  • Make sure classes are usable as categories i.t. the first method is sensible as self (do not do that at the expense of consistency on the Java side)
  • Add extension methods for peek and poke field to classes
  • Add to the Java classes docs.
  • Add to README

Linearize type hierarchy

Sometimes we need to disambiguate from a set of types [A, B, C] which one is the best match for type X (think overloading resolution). In this case it helps if we can iterate through all types X implements in some reasonable fashion.

Text Table

  • separate layout, data and rendering
  • formatting
    • padding
    • alignment
    • optional columns
    • default value suppliers
    • custom rendering
    • pluggable box rendering
  • annotate nullness
  • testing
    • functionality
    • error-handling
  • javadoc
    • members
    • class comment
    • thread-safety
  • Update README

'Named' decorators for JDK functional objects

Provide decorators for the generic functional interfaces that print a caller-specified toString() message.

Useful for libraries that return lambdas to be used as filters, transformers or predicates.

Add Dokka to the Gradle build

While the documentation is in the code, we are not building it as Dokka Gradle plugin is currently PITA will create a separate issue.

Following up on #18

Parse exception from stacktrace

Make a best effort to reconstruct exception object from a stacktrace string.

  • Parse an exception without causes and suppressed
  • Parse an exception with missing class as ThrowableClassNotFoundException and capture the original exception name in a field. The formatting should be identical to the original + a special mark.
  • Parse an exception with causes
    • Resolve ### more... into the appropriate number of bottom stack frames from the cause
    • Resolve "Circular reference" to the first seen exception with the same toString()
  • Parse an exception with suppressed
  • Parse an exception with causes and suppressed that have caused/suppressed of their own

TextTable Bar Chart renderer

  • support stacked values denoted by different chars (i.e. ||||####====----....
  • try to support stacked positive and negative (i.e. christmas-tree chart)
  • support a token mode and dot-chart mode
  • allow multiple point markers per column
  • customizable headers
  • customizable annotations in the first cell of a row/column

Javadoc spruce-up

  • Fix style to look more normal
  • Fix not to double the Jetbrains annotations
  • Add entry-point markers
  • Syntax-colorize sample code
  • Add the current API version
  • tweak sizes - only html in pixels, everything else in rems
  • tweak media
    • hidpi
    • lodpi
    • phone
    • print

Upgrade to JUnit 5 and switch Kotlin tests to Spek

We currently use Spock which is built on Junit 4, while Spec requires JUnit 5 - that's why all our kotlin tests are JUnit style.

We should:

  • migrate to JUnit 5 once it is released and use the legacy support to run Spock tests.
  • once we do that we should migrate the Kotlin tests to Spek

Following up on #18

Agent to enrich stack-trace across threads

An agent that enriches the stacktraces for frameworks like fork/join, parallel streams, akka, quasar, various ESB, etc. Automatically capture some context from the stack-switch point (i.e. task details, etc) and add it to the exception mesage. Maintain the history context in a threadlocal, handing off at the specified points.

May use a generic AOP tool, or our own DSL with custom bytecode instrumentation. Look at the Dart Zones for explicit API.

Multi-dispatch for functional objects

Multiple dispatch or multimethods is a feature of some programming languages in which a function or method can be dynamically dispatched based on the run-time (dynamic) type or, in the more general case some other attribute, of more than one of its arguments.

Layout manager for monospaced text

Provide a DSL that can position multiline-strings in a layout, padding with whitespace considering alignment and optionally drawing frames.

Kotlin-native API

A lot of things will turn into free functions and extension methods.

  • Read the manual again
  • Implement the API
  • Add tests
  • Add documentation (using Dokka)
  • Update readme

Compare exceptions

Do a semantic diff of exceptions, including masking of irrelevant detail (e.g. the stack above an entry point)

Iterate through accessible members

As constructors, methods and fields share the AccessibleObject interface, we can write a generic function that would allow us to iterate through all members in all classes, taking care of reflection, setting accessibility flag and rethrowing any exceptions from the processing strategy.

Public Release

  • Publich snapshots to OSS Artifactory
  • Add release notes file
  • Sign tagged releases
  • Publish tagged releases to Github Releases
  • Publish tagged releases to Bintray
  • Publish tagged releases to Central

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.