Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.0-rc.8 #306

Merged
merged 84 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
266d370
build: set version to `1.0.0-SNAPSHOT` for `development`
JarvisCraft Nov 4, 2021
7356d68
Merge pull request #285 from JarvisCraft/sync-development-with-master
JarvisCraft Nov 4, 2021
bf0794f
build: delete `tools` module
JarvisCraft Nov 4, 2021
acc712e
Merge pull request #286 from JarvisCraft/remove-tools-module
JarvisCraft Nov 4, 2021
52e5c4d
build(deps): bump xstream from 1.4.17 to 1.4.18
dependabot[bot] Nov 5, 2021
c939f2a
Merge pull request #287 from JarvisCraft/dependabot/maven/development…
mergify[bot] Nov 5, 2021
28d0d8b
revert: keep `xstream` version `1.4.17`
JarvisCraft Nov 5, 2021
5e13cbb
fix(java-commons): catch `Throwable` in `Result#tryGet(..)`
JarvisCraft Nov 6, 2021
b95e6b5
style(java-commons): add missing space after `implements` section of …
JarvisCraft Nov 6, 2021
3bcade1
feat(java-commons): add methods for type specific error handling
JarvisCraft Nov 6, 2021
746ee7d
refactor(java-commons): use `isInstance(..)` instead of `isAssignable…
JarvisCraft Nov 6, 2021
bf71caf
feat(java-commons): give higher priority to type-inferred `try`-metho…
JarvisCraft Nov 6, 2021
1e601af
feat(java-commons): add conditional mappers to `Result.Extensions`
JarvisCraft Nov 7, 2021
655a713
Merge pull request #288 from JarvisCraft/result-throwable-friendship
JarvisCraft Nov 7, 2021
0ba4156
build(deps): bump annotations from 22.0.0 to 23.0.0
dependabot[bot] Nov 11, 2021
72f9f11
Merge pull request #289 from JarvisCraft/dependabot/maven/development…
mergify[bot] Nov 11, 2021
246ddf7
build: enable all `javac` lints
JarvisCraft Nov 17, 2021
cc3a17d
refactor: resolve `unchecked` warnings
JarvisCraft Nov 17, 2021
7cf57d6
refactor(java-commons): perform minor cleanup of `LazyIteratorToColle…
JarvisCraft Nov 17, 2021
1b3a841
refactor(java-commons): rename `StatefulMutableImRunnable` to `Statef…
JarvisCraft Nov 17, 2021
75a22da
fix(java-commons): remove `UncheckedCasts#uncheckedObjectCast(..)` wh…
JarvisCraft Nov 17, 2021
6740d16
fix(java-commons): add `serialVersionUID`s to `Throwable`s
JarvisCraft Nov 17, 2021
f69a65f
refactor(java-commons): deprecate `@DontOverrideEqualsAndHashCode`
JarvisCraft Nov 17, 2021
520ace7
refactor: cleanup components related to Invoke API
JarvisCraft Nov 17, 2021
b5a505a
refactor(java-commons)!: get rid of ambiguous overloads in `Runnables`
JarvisCraft Nov 17, 2021
bc61d35
refactor(java-commons)!: remove redundant `Runnables#<T>statefule(T, …
JarvisCraft Nov 17, 2021
956e5b2
build: disable `processing` lint
JarvisCraft Nov 17, 2021
b0254a9
refactor(java-commons)!: rename `BooleanUnaryOperator#andThen(..)` ->…
JarvisCraft Nov 17, 2021
e651b69
refactor(java-commons)!: remove `LazyIteratorToCollectionWrapper`
JarvisCraft Nov 17, 2021
601a0a0
chore(ultimate-messenger): remove redundant import of `DebuggingTextM…
JarvisCraft Nov 17, 2021
f5f9b40
chore(java-commons): suppress `varargs` warning on tricky `@SafeVarar…
JarvisCraft Nov 17, 2021
e57dfed
chore: use uppercase `L` in `long` literals
JarvisCraft Nov 17, 2021
f2835f1
Merge pull request #290 from JarvisCraft/resolve-javac-lints
JarvisCraft Nov 17, 2021
ed67e6e
docs: add `SECURITY.md`
JarvisCraft Nov 17, 2021
eeef78e
Merge branch 'development' into create-security-policy
JarvisCraft Nov 17, 2021
84e1110
Merge pull request #291 from JarvisCraft/create-security-policy
JarvisCraft Nov 17, 2021
0e79528
ci: configure CodeQL
JarvisCraft Nov 17, 2021
383ffd8
Merge branch 'development' into codeql
JarvisCraft Nov 17, 2021
6efa8d4
ci: setup Java explicitly and cache local Maven repository
JarvisCraft Nov 17, 2021
39f2f6b
Merge pull request #292 from JarvisCraft/codeql
JarvisCraft Nov 17, 2021
b704234
build: correctly generate javadocs *after* delombok
JarvisCraft Nov 17, 2021
1fdfad9
fix(java-commons): don't use BlackHole for initialization of `Caffein…
JarvisCraft Nov 17, 2021
6f4e9ff
fix(java-commons): disable generation of getters in `Result`
JarvisCraft Nov 17, 2021
373bcff
docs: add docs for well-supported APIs
JarvisCraft Nov 17, 2021
2e4c245
build(deps-dev): bump version.mockito from 4.0.0 to 4.1.0
dependabot[bot] Nov 22, 2021
7528374
Merge pull request #293 from JarvisCraft/dependabot/maven/development…
mergify[bot] Nov 22, 2021
bba1a9c
build(deps): bump github/codeql-action from 1.0.23 to 1.0.24
dependabot[bot] Nov 24, 2021
fef13f0
Merge pull request #294 from JarvisCraft/dependabot/github_actions/de…
mergify[bot] Nov 24, 2021
b7dd631
build(deps): bump junit-bom from 5.8.1 to 5.8.2
dependabot[bot] Nov 29, 2021
ddb8815
Merge pull request #295 from JarvisCraft/dependabot/maven/development…
mergify[bot] Nov 29, 2021
7fd64e2
build(deps): bump actions/setup-java from 2.3.1 to 2.4.0
dependabot[bot] Nov 30, 2021
687eda0
Merge pull request #296 from JarvisCraft/dependabot/github_actions/de…
mergify[bot] Nov 30, 2021
7c4f7bf
build(deps): bump caffeine from 2.9.2 to 2.9.3
dependabot[bot] Dec 3, 2021
fbe2572
Merge pull request #297 from JarvisCraft/dependabot/maven/development…
mergify[bot] Dec 3, 2021
7cc3d7c
build(deps): bump github/codeql-action from 1.0.24 to 1.0.25
dependabot[bot] Dec 7, 2021
c405ce6
Merge pull request #299 from JarvisCraft/dependabot/github_actions/de…
mergify[bot] Dec 7, 2021
40ac993
Merge branch 'development' into correct-javadocs
JarvisCraft Dec 11, 2021
dcab541
chore(java-commons): simplify radix checks in `NumberUtil`
JarvisCraft Dec 11, 2021
5a174dc
build(deps): bump github/codeql-action from 1.0.25 to 1.0.26
dependabot[bot] Dec 13, 2021
4c05116
Merge pull request #302 from JarvisCraft/dependabot/github_actions/de…
mergify[bot] Dec 13, 2021
0241007
build(deps-dev): bump version.mockito from 4.1.0 to 4.2.0
dependabot[bot] Dec 17, 2021
c3fda26
Merge pull request #303 from JarvisCraft/dependabot/maven/development…
mergify[bot] Dec 17, 2021
fc4f60e
Merge branch 'development' into correct-javadocs
JarvisCraft Dec 18, 2021
9dd4472
fix(java-commons): make `CaffeineCacheFactory` a `static` `class`
JarvisCraft Dec 18, 2021
8155840
refactor(java-commons): don't make `TypeHints#resolve()` consume var-…
JarvisCraft Dec 18, 2021
e4661df
chore(java-commons): remove redundant `Predicate` import from `Concur…
JarvisCraft Dec 18, 2021
fcbb067
fix: update `SimplePlaceholdersTest` to the new default
JarvisCraft Dec 18, 2021
a80092e
fix(ultimate-messenger): update `SimplePlaceholdersTest` to the new d…
JarvisCraft Dec 18, 2021
168430d
docs(java-commons): add missing javadocs to `AbstractManagedPendingSe…
JarvisCraft Dec 18, 2021
23bd976
Merge pull request #301 from JarvisCraft/correct-javadocs
JarvisCraft Dec 18, 2021
55add20
Merge branch 'development' into correct-javadocs
JarvisCraft Dec 18, 2021
6e6a3f4
chore(ultimate-messenger): place nullability annotations correctly in…
JarvisCraft Dec 20, 2021
8ec6e59
feat: deprecate `StaticTextModel` in favor of `TextModel#of(String)`
JarvisCraft Dec 20, 2021
84c7294
feat(java-commons): add `NumberUtil#saturatingSum(..)`
JarvisCraft Dec 20, 2021
0722041
feat(ultimate-messenger)!: use primitive values for `TextModel` bounds
JarvisCraft Dec 20, 2021
a7f92cc
feat: add `TextModel#write(..)` for future optimized implementations
JarvisCraft Dec 20, 2021
f85b2a8
refactor: implement `CompoundTextModel#write(..)`
JarvisCraft Dec 20, 2021
ec15433
feat: deprecate `DelegatingCompoundTextModel` in favor of factories i…
JarvisCraft Dec 20, 2021
276d1c9
fix(ultimate-messenger): use `NumberUtil#saturingAdd(..)` when worjin…
JarvisCraft Dec 20, 2021
5385d09
docs(ultimate-messenger): remove redundant `@throws` from `TextModel#…
JarvisCraft Dec 20, 2021
5aeb7dd
Merge pull request #304 from JarvisCraft/correct-javadocs
JarvisCraft Dec 20, 2021
a2b70c1
Merge branch 'development' into better-text-models
JarvisCraft Dec 20, 2021
a318c0c
Merge pull request #305 from JarvisCraft/better-text-models
JarvisCraft Dec 21, 2021
dafaa12
build: bump version to `1.0.0-rc.8`
JarvisCraft Dec 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CodeQL

on:
push:
branches: [ master, development ]
pull_request:
branches: [ master, development ]
schedule:
- cron: '00 12 * * *'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

permissions:
actions: read
contents: read
security-events: write

steps:
- uses: actions/checkout@v2.4.0

- name: Set up Java 17
uses: actions/setup-java@v2.4.0
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'

- name: Initialize CodeQL
uses: github/codeql-action/init@v1.0.26
with:
languages: java

- name: Autobuild
uses: github/codeql-action/autobuild@v1.0.26

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1.0.26
2 changes: 1 addition & 1 deletion .github/workflows/deploy-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2.4.0

- name: Set up Java 17 & Deployment credentials
uses: actions/setup-java@v2.3.1
uses: actions/setup-java@v2.4.0
with:
distribution: 'zulu'
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2.4.0

- name: Set up Java 17 & Deployment credentials
uses: actions/setup-java@v2.3.1
uses: actions/setup-java@v2.4.0
with:
distribution: 'zulu'
java-version: '17'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2.4.0

- name: Set up Java 17
uses: actions/setup-java@v2.3.1
uses: actions/setup-java@v2.4.0
with:
distribution: 'zulu'
java-version: '17'
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v2.4.0

- name: Set up Java 17
uses: actions/setup-java@v2.3.1
uses: actions/setup-java@v2.4.0
with:
distribution: 'zulu'
java-version: '17'
Expand Down
18 changes: 18 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------------ | ------------------ |
| [1.0.0-rc.7] | :heavy_check_mark: |
| < 1.0.0-rc.7 | :x: |

## Reporting a Vulnerability

In order to report a vulnerability simply create an [issues](https://github.com/JarvisCraft/padla/issues) for it.

These are checked regularly and are the primary support channel.

<!-- Version links -->

[1.0.0-rc.7]: https://mvnrepository.com/artifact/ru.progrm-jarvis/padla/1.0.0-rc.7
2 changes: 1 addition & 1 deletion java-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>ru.progrm-jarvis</groupId>
<artifactId>padla</artifactId>
<version>1.0.0-rc.7</version>
<version>1.0.0-rc.8</version>
</parent>
<artifactId>java-commons</artifactId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
/**
* Marker indicating that {@link Object#equals(Object)} and {@link Object#hashCode()} methods
* are not overridden for this class for some reason.
*
* @deprecated this annotation is applicable by default thus it is redundant
*/
@Deprecated
@Inherited
@Documented
@Target(ElementType.TYPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import lombok.experimental.UtilityClass;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import ru.progrm_jarvis.javacommons.util.BlackHole;

/**
* Utilities for creation of <a href="https://github.com/ben-manes/caffeine">Caffeine</a>-based
Expand All @@ -19,16 +18,16 @@ public class CaffeineCache {
/**
* Flag indicating whether {@link Caffeine} is available
*/
private static final boolean AVAILABLE;
private final @Nullable CacheFactory CACHE_FACTORY;

static {
boolean available = true;
try { // check if Caffeine class is available
BlackHole.consume(Caffeine.class);
CacheFactory cacheFactory;
try { // check if Caffeine is available
cacheFactory = new CaffeineCacheFactory(Caffeine::newBuilder);
} catch (final Throwable ignored) {
available = false;
cacheFactory = null;
}
AVAILABLE = available;
CACHE_FACTORY = cacheFactory;
}

/**
Expand All @@ -38,19 +37,19 @@ public class CaffeineCache {
*
* @throws IllegalStateException if Caffeine is not available
*/
public static @NotNull CacheFactory createFactory() {
if (AVAILABLE) return CaffeineCacheFactory.INSTANCE;
public @NotNull CacheFactory createFactory() {
if (CACHE_FACTORY == null) throw new IllegalStateException("Caffeine Cache is not available");

throw new IllegalStateException("Caffeine Cache is not available");
return CACHE_FACTORY;
}

/**
* Attempts to create a Caffeine Cache factory.
*
* @return created Caffeine Cache factory or {@code null} if it is unavailable
*/
public static @Nullable CacheFactory tryCreateFactory() {
return AVAILABLE ? CaffeineCacheFactory.INSTANCE : null;
public @Nullable CacheFactory tryCreateFactory() {
return CACHE_FACTORY;
}

/**
Expand All @@ -61,9 +60,9 @@ public class CaffeineCache {
private static final class CaffeineCacheFactory implements CacheFactory {

/**
* Singleton instance of this {@link CacheFactory} implementation
* Factory used for creation of {@link Caffeine} builder
*/
private static final @NotNull CacheFactory INSTANCE = new CaffeineCacheFactory();
private @NotNull CaffeineBuilderFactory factory;

/**
* Wraps the provided {@link com.github.benmanes.caffeine.cache.Cache Caffeine Cache} into {@link Cache}.
Expand All @@ -81,17 +80,30 @@ private static final class CaffeineCacheFactory implements CacheFactory {

@Override
public <K, V> @NotNull Cache<K, V> weakKeysCache() {
return wrap(Caffeine.newBuilder().weakKeys().build());
return wrap(factory.newBuilder().weakKeys().build());
}

@Override
public <K, V> @NotNull Cache<K, V> weakValuesCache() {
return wrap(Caffeine.newBuilder().weakValues().build());
return wrap(factory.newBuilder().weakValues().build());
}

@Override
public <K, V> @NotNull Cache<K, V> softValuesCache() {
return wrap(Caffeine.newBuilder().softValues().build());
return wrap(factory.newBuilder().softValues().build());
}

/**
* Factory responsible for creation of {@link Caffeine} builder.
*/
public interface CaffeineBuilderFactory {

/**
* Creates a {@link Caffeine} builder.
*
* @return Caffeine builder
*/
Caffeine<Object, Object> newBuilder();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import java.util.List;
import java.util.Map;

/**
* Object used for runtime class definition.
*/
public interface ClassDefiner {

/**Uns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public class CollectionFactory {
/**
* {@link Lookup lookup} of this class.
*/
private static final Lookup LOOKUP = MethodHandles.lookup();
private final Lookup LOOKUP = MethodHandles.lookup();

/**
* Class naming strategy used to allocate names for generated immutable enum set classes
*/
private static final @NonNull ClassNamingStrategy IMMUTABLE_ENUM_SET_CLASS_NAMING_STRATEGY = ClassNamingStrategy
private final @NonNull ClassNamingStrategy IMMUTABLE_ENUM_SET_CLASS_NAMING_STRATEGY = ClassNamingStrategy
.createPaginated(CollectionFactory.class.getName() + "$$Generated$$ImmutableEnumSet$$");

/**
Expand All @@ -57,18 +57,18 @@ public class CollectionFactory {
/**
* {@link CtClass} representation of {@link AbstractImmutableSet} wrapped in {@link Lazy}
*/
private static final @NonNull Lazy<CtClass> ABSTRACT_IMMUTABLE_SET_CT_CLASS = Lazy
private final @NonNull Lazy<CtClass> ABSTRACT_IMMUTABLE_SET_CT_CLASS = Lazy
.createThreadSafe(() -> toCtClass(AbstractImmutableSet.class));
/**
* Array storing single reference to {@link CtClass} representation of {@link Iterator} wrapped in {@link Lazy}
*/
private static final @NonNull Lazy<CtClass[]> ITERATOR_CT_CLASS_ARRAY = Lazy
private final @NonNull Lazy<CtClass[]> ITERATOR_CT_CLASS_ARRAY = Lazy
.createThreadSafe(() -> new CtClass[]{toCtClass(Iterator.class)});

/**
* Empty array of {@link CtClass}es.
*/
public static final @NotNull CtClass @NotNull @Unmodifiable [] EMPTY_CT_CLASS_ARRAY = new CtClass[0];
public final @NotNull CtClass @NotNull @Unmodifiable [] EMPTY_CT_CLASS_ARRAY = new CtClass[0];

/**
* Creates an immutable enum {@link Set set} from the given array of stored enum constants.
Expand All @@ -83,7 +83,7 @@ public class CollectionFactory {
* instanceof} and {@code switch} by {@link Enum#ordinal()} are used for containment-related checks and {@link}
*/
@SafeVarargs
@SuppressWarnings("unchecked")
@SuppressWarnings({"unchecked", "varargs"})
@Deprecated // should be remade via ASM or totally removed due to specific behaviour of anonymous class referencing
@UsesBytecodeModification(value = CommonBytecodeLibrary.JAVASSIST, optional = true)
public <E extends Enum<E>> Set<E> createImmutableEnumSet(final @NonNull E... values) {
Expand All @@ -97,7 +97,6 @@ public <E extends Enum<E>> Set<E> createImmutableEnumSet(final @NonNull E... val
.sorted()
.toArray(Enum[]::new);

//noinspection unchecked
return (Set<E>) IMMUTABLE_ENUM_SETS.get(enumValues, valuesArray -> {
//<editor-fold desc="Class generation" defaultstate="collapsed">
val enumType = valuesArray.getClass().getComponentType();
Expand Down
Loading