Giter VIP home page Giter VIP logo

udtopia's People

Contributors

willhains avatar

Watchers

 avatar

udtopia's Issues

Shields.io API change

As discussed in Shields issue: badges/shields#8736

Remove branch parameter from beta branch status badge URL.
The badge should show the latest result of build-beta.yml.
No need to specify the branch explicitly.

Current:
Beta Build Status

New:
Beta Build Status

- https://shields.io/github/actions/workflow/status/willhains/udtopia/build-beta.yml?label=beta+build&branch=beta/1.0.0
+ https://shields.io/github/actions/workflow/status/willhains/udtopia/build-beta.yml?label=beta+build

Fix broken links

Links

Summary

Status Count
๐Ÿ” Total 90
โœ… Successful 84
โณ Timeouts 3
๐Ÿ”€ Redirected 0
๐Ÿ‘ป Excluded 0
โ“ Unknown 0
๐Ÿšซ Errors 3

Errors per input

Errors in CONTRIBUTING.md

Errors in README.md

Errors in DOCUMENTATION.md

Does UDTopia work on Java >8?

Test that UDTopia works on later Java versions, and fix it if it doesn't.

Use-cases to test:

  • Use the existing .jar (built on JDK 8) on higher-version JREs.
  • With the versions in pom.xml as-is, build on higher-version JDKs.
  • Build with higher source and target versions in pom.xml.

Normalizer to format words

The @LowerCase and @UpperCase normalizer rules do only simple letter case coercion.

Should there be a normalizer rule for more sophisticated case conversion patterns for words?

Proposed APIs

@WordsAs(CAMEL_CASE) // camelCase
@WordsAs(CONCATENATED_TITLE_CASE) // ConcatenatedTitleCase
@WordsAs(TITLE_CASE) // Title Case
@WordsAs(SNAKE_CASE) // snake_case
@WordsAs(HYPHENATED) // hyphenated-words-like-this
@WordsAs(ENUM_CASE) // ENUM_CASE

Discard Safety Test false negative

The Discard Safety Tests workflow failed with a diff that isn't a diff.

Run java -cp "./target/classes;./target/test-classes" org.udtopia.recycle.SingleFieldDiscardSafetyTest
  java -cp "./target/classes;./target/test-classes" org.udtopia.recycle.SingleFieldDiscardSafetyTest
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    JAVA_HOME: C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.312-7\x64
producer: (3451777) 1726071.26877399371005594730377197265625 -- RecycleBin[4]: Enable assertions (-ea) to see recycle stats <-- final value
consumer: (3451777) 1726071.26877399371005594730377197265625 <-- DIFF!
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
consumer: (3451777) 1726071.26877399371005594730377197265625
Error: Process completed with exit code 1.

A re-run of the same job passed.

Normalizer to truncate string values

The @Max(length) validator rule throws when the value is longer than length.
The @Trim normalizer rule trims whitespace characters only.

Should there be a normalizer rule to truncate string values to a specified length?

Use-Case Example

You want to capture the output of an operation to show in a progress summary.
When the command output is very long, you don't need to keep all of it, but the first X characters are useful, and you don't want a long value to cause an error.

Proposed API

@Truncate(60)
public final @Value class CommandOutput extends PureString<CommandOutput> {...}

Validator for email addresses, host names, IP addresses

Email address validation can be tricky.
Should there be an explicit validator rule for email address strings?
There may also be some performance benefit to validate by code rather than by regex.

Proposed API

@EmailAddress
public final @Value class EmailAddress extends PureString<EmailAddress> {...}

@HostName
public final @Value class HostName extends PureString<HostName> {...}

@IPAddress
public final @Value class ServerIP extends PureString<ServerIP> {...}

Alternatives

Rather than creating separate annotations for each, provide constants for special cases:

@Matching(EMAIL_ADDRESS)
public final @Value class EmailAddress extends PureString<EmailAddress> {...}

@Matching(HOST_NAME)
public final @Value class HostName extends PureString<HostName> {...}

@Matching(IP_V4_ADDRESS)
public final @Value class ServerIP extends PureString<ServerIP> {...}

These could be well-tested regex patterns, or special constant string values that the @Matching rule checks for, and invokes non-regex logic for faster validation.

UDT* value subclasses for Flyweight object pools

Currently, the UDT* value classes are subclassed by Pure* and Recyclable* classes.

The Recyclable* classes reuse existing instances, resetting their raw value on every "allocation".

Use-Case

There are use-cases where the same, small number of values are repeated many times.
In these cases, it might be better to keep a cache of previously created instances, similar to String.intern(). (And the UDTString subclass could actually intern the raw value as well.)

Proposed API

public final @Value class CityName extends FlyweightString<CityName> {...}

Validator for String character set

@Chars and @NotChars are fine when the set of allowed/disallowed characters is small, but there is a need to validate that string values conform to a given character set.

Use-Case Example

You want to save a text value into a file or database with ISO-8859-1 (US-ASCII) encoding.
The app needs to validate that the text can conform to that encoding.

Proposed API

Rather than hard-code any specific encoding, provide a parameter to specify the name of the character set:

@Max(50) @EncodableAs("US-ASCII")
public final @Value class SomeAsciiValue {...}

Role annotations should be compile retention only (for now)

Currently, the role annotations @Value, @Mutable, @IO, and @ThreadSafe have RUNTIME retention. This retention level is unnecessary.

  • UDTopia itself doesn't use them at runtime.
  • There are no tools (yet) that use them for static code analysis.

Runtime retention means projects cannot use them without a runtime dependency.

Reduce the retention level to source-only.

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.