Skip to content

Commit

Permalink
Merge branch '2.17'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Dec 16, 2023
2 parents cf6f052 + b1a8eef commit 20dad4e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
# 01-Jul-2021, tatu: Requires JDK 11 for build, due to Jetty dep (for testing)
matrix:
java_version: ['11', '17']
java_version: ['11', '17', '21']
os: ['ubuntu-20.04']
env:
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
Expand Down
34 changes: 23 additions & 11 deletions base/src/main/java/tools/jackson/jakarta/rs/base/ProviderBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

import tools.jackson.databind.*;
import tools.jackson.databind.type.TypeFactory;
import tools.jackson.databind.util.LookupCache;
import tools.jackson.databind.util.SimpleLookupCache;
import tools.jackson.jakarta.rs.base.util.ClassKey;
import tools.jackson.jakarta.rs.base.util.LRUMap;
import tools.jackson.jakarta.rs.cfg.*;

public abstract class ProviderBase<
Expand Down Expand Up @@ -80,7 +81,7 @@ public abstract class ProviderBase<
};

protected final static int JAKARTA_RS_FEATURE_DEFAULTS = JakartaRSFeature.collectDefaults();

/*
/**********************************************************************
/* General configuration
Expand All @@ -92,7 +93,7 @@ public abstract class ProviderBase<
* of {@link ObjectMapper}
*/
protected final MAPPER_CONFIG _mapperConfig;

/**
* Map that contains overrides to default list of untouchable
* types: <code>true</code> meaning that entry is untouchable,
Expand All @@ -114,7 +115,7 @@ public abstract class ProviderBase<
* View to use for writing if none defined for the end point.
*/
protected Class<?> _defaultWriteView;

/*
/**********************************************************************
/* Excluded types
Expand All @@ -136,14 +137,12 @@ public abstract class ProviderBase<
/**
* Cache for resolved endpoint configurations when reading JSON data
*/
protected final LRUMap<AnnotationBundleKey, EP_CONFIG> _readers
= new LRUMap<AnnotationBundleKey, EP_CONFIG>(16, 120);
protected final LookupCache<AnnotationBundleKey, EP_CONFIG> _readers;

/**
* Cache for resolved endpoint configurations when writing JSON data
*/
protected final LRUMap<AnnotationBundleKey, EP_CONFIG> _writers
= new LRUMap<AnnotationBundleKey, EP_CONFIG>(16, 120);
protected final LookupCache<AnnotationBundleKey, EP_CONFIG> _writers;

/*
/**********************************************************************
Expand All @@ -152,8 +151,9 @@ public abstract class ProviderBase<
*/

protected ProviderBase(MAPPER_CONFIG mconfig) {
_mapperConfig = mconfig;
_jakartaRSFeatures = JAKARTA_RS_FEATURE_DEFAULTS;
this(mconfig,
new SimpleLookupCache<>(16, 120),
new SimpleLookupCache<>(16, 120));
}

/**
Expand All @@ -164,8 +164,20 @@ protected ProviderBase(MAPPER_CONFIG mconfig) {
*/
@Deprecated // just to denote it should NOT be directly called; will NOT be removed
protected ProviderBase() {
_mapperConfig = null;
this(null);
}

/**
* @since 2.17
*/
protected ProviderBase(MAPPER_CONFIG mconfig,
LookupCache<AnnotationBundleKey, EP_CONFIG> readerCache,
LookupCache<AnnotationBundleKey, EP_CONFIG> writerCache
) {
_mapperConfig = mconfig;
_jakartaRSFeatures = JAKARTA_RS_FEATURE_DEFAULTS;
_readers = readerCache;
_writers = writerCache;
}

/*
Expand Down
25 changes: 0 additions & 25 deletions base/src/main/java/tools/jackson/jakarta/rs/base/util/LRUMap.java

This file was deleted.

4 changes: 4 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Sub-modules:

-

2.16.1 (not yet released)

#23: Deprecate local `LRUMap`, use `jackson-databind` provided one instead

2.16.0 (15-Nov-2023)

No changes since 2.15
Expand Down

0 comments on commit 20dad4e

Please sign in to comment.