Compare commits

...

11 Commits

7 changed files with 134 additions and 27 deletions

View File

@ -1,5 +1,21 @@
# Changelog of versions
### Version 0.9.0
- Added: getFirst/getLast/removeFirst/removeLast to List.class.
- Added: Dedicated Set toArray implementations.
- Added: ToArray/pushTop functions to Stack.class.
- Added: ComputeNonDefault functions which will contain the current behavior of the Compute function, while the Compute will be changed to be more java compliant!
- Added: List.reversed, which returns a SubList that has all elements in reversed order and also inserts reversed.
- Added: Iterators.infinite as an option that will create a Infinite Iterator based on the inputed one.
- Added: List.indexedIterator which allows you to create a iterator with a customized iteration indecies. Useful if you want to transform lists output.
- Added: PriorityQueue.contains is now a function
- Added: Iterators/Async Builders now support MapToPrimitiveType function on the object variant. So more processing can be done. (Will be expanded upon later versions)
- Fixed: SetValue wasn't working on forEach implementations.
- Fixed: Compute functions now perform with primitives more java compliant. Meaning that getDefaultReturnValue function no longer is seen as null.
- Fixed: Supplier was using the wrong dataType in their function name.
- Updated: SimpleCodeGenerator 1.3.0 is now being used which allows for iterative code support.
- Breaking Change: Map.compute/IfAbsent/Present and Map.supplyIfAbsent if the value is a primitive it will no longer accept the defaultReturnValue() as "null" if that functionality is desired then use: computeNonDefault which contains the functionality!
### Version 0.8.1
- Added: getFirst/getLast/removeFirst/removeLast to List.class.
- Added: Dedicated Set toArray implementations.

View File

@ -1,5 +1,6 @@
![build](https://github.com/Speiger/Primitive-Collections/actions/workflows/build_action.yml/badge.svg)
[![Latest Release](https://jitpack.io/v/Speiger/Primitive-Collections.svg)](https://jitpack.io/#Speiger/Primitive-Collections)
![Maven Central Version](https://img.shields.io/maven-central/v/io.github.speiger/Primitive-Collections)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/Speiger/Primitive-Collections)
![Unit Tests](https://github.com/Speiger/Primitive-Collections/actions/workflows/build_tests_action.yml/badge.svg)
@ -43,7 +44,7 @@ To ensure that problems can be dealt with even if it is breaking the current API
# How to install
Using Jitpack Gradle
```gradle
```groovy
repositories {
maven {
url = "https://jitpack.io"
@ -54,6 +55,13 @@ dependencies {
}
```
Using Maven Central
```groovy
dependencies {
implementation 'io.github.speiger:Primitive-Collections:0.9.0'
}
```
# SourceCode
The generated Sourcecode can be automatically build,
but if you want to just browse around in it.

15
SECURITY.md Normal file
View File

@ -0,0 +1,15 @@
# Security Policy
## Supported Versions
Due to how the releases work, only the latest versions will be supported.
## Reporting a Vulnerability
If you have discovered a security vulnerability in this project, please report it privately.
**Please refrain from posting in public issues.**
This gives me time to process issues that are being found, and reduces the possiblity of abuse while patches are being created.
Please disclose it [here](https://github.com/Speiger/Primitive-Collections/security/advisories/new).
Please consider that this project is developed by a single person.
So please provide a reasonable timeframe when reporting.

View File

@ -1,6 +1,7 @@
plugins {
id 'java-library'
id "jacoco"
// id "com.vanniktech.maven.publish" version "0.28.0"
}
tasks.withType(JavaCompile) {
@ -10,6 +11,7 @@ tasks.withType(JavaCompile) {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'signing'
repositories {
mavenCentral()
@ -19,12 +21,17 @@ repositories {
}
archivesBaseName = 'Primitive Collections'
version = '0.9.0';
version = RELEASE_VERSION;
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaVersion.current();
System.out.println("Java Version: "+compileJava.sourceCompatibility)
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
options.tags = [ "implSpec", "note" ]
}
@ -99,26 +106,12 @@ task generateLimitSource(type: JavaExec) {
args = ['silent', 'load']
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
task srcJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
compileJava.dependsOn generateGithubSource
javadoc.failOnError = false
javadoc.options.memberLevel = JavadocMemberLevel.PUBLIC
javadoc.options.quiet()
artifacts {
archives javadocJar
archives srcJar
}
task testBooleans(type: Test) {
group 'tests'
@ -268,13 +261,10 @@ jacocoTestReport {
}
}
publishing {
Properties props = new Properties()
if(file("$buildDir/credentials.properties").exists()) {
props.load(new FileInputStream("$buildDir/credentials.properties"))
}
publications {
mavenJava(MavenPublication) {
personal(MavenPublication) {
pom {
name = 'Primitive Collections'
description = 'A Primitive Collection library that reduces memory usage and improves performance'
@ -283,8 +273,6 @@ publishing {
artifactId = project.archivesBaseName.replace(" ", "-")
groupId = 'de.speiger'
from components.java
artifact tasks.srcJar
artifact tasks.javadocJar
licenses {
license {
name = 'The Apache License, Version 2.0'
@ -309,11 +297,83 @@ publishing {
}
repositories {
maven {
name = "Speiger_Maven"
def auth = System.getenv("Speiger_Maven_Auth")?.split(';');
url version.endsWith('SNAPSHOT') ? "https://maven.speiger.com/repository/debug" : "https://maven.speiger.com/repository/main"
credentials(PasswordCredentials) {
username props.mavenUser
password props.mavenPassword
username auth?[0]
password auth?[1]
}
}
}
}
}
tasks.withType(PublishToMavenRepository) {
def predicate = provider {
(repository == publishing.repositories.mavenCentral && publication == publishing.publications.maven) ||
(repository != publishing.repositories.mavenCentral && publication != publishing.publications.maven)
}
onlyIf("publishing binary to the external repository, or binary and sources to the internal one") {
predicate.get()
}
}
tasks.withType(PublishToMavenLocal) {
def predicate = provider {
publication == publishing.publications.personal
}
onlyIf("publishing binary and sources") {
predicate.get()
}
}
//Maven central Start
//Disabling due to java8 incompat, only needed to manually publishing anyways
//signing.useGpgCmd()
//
//import com.vanniktech.maven.publish.SonatypeHost
//import com.vanniktech.maven.publish.JavaLibrary
//import com.vanniktech.maven.publish.JavadocJar
//
//mavenPublishing {
// configure(new JavaLibrary(new JavadocJar.None(), true))
//}
//
//mavenPublishing {
// publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
//
// signAllPublications()
// pom {
// name = 'Primitive Collections'
// description = 'A Primitive Collection library that reduces memory usage and improves performance'
// url = 'https://github.com/Speiger/Primitive-Collections'
// version = project.version
// group = 'io.github.speiger'
// licenses {
// license {
// name = 'The Apache License, Version 2.0'
// url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
// }
// }
//
// developers {
// developer {
// id = 'speiger'
// name = 'Speiger'
// }
// }
//
// scm {
// connection = 'scm:git:git://github.com/Speiger/Primitive-Collections.git'
// developerConnection = 'scm:git:ssh://github.com:Speiger/Primitive-Collections.git'
// url = 'https://github.com/Speiger/Primitive-Collections'
// }
//
// issueManagement {
// system = 'github'
// url = 'https://github.com/Speiger/Primitive-Collections/issues'
// }
// }
//}
//

View File

@ -1,4 +1,6 @@
org.gradle.jvmargs=-Xmx3G
maxMemory = 1024m
testThreads = 2
testThreads = 4
RELEASE_VERSION = 0.9.0

View File

@ -342,6 +342,8 @@ public class ITERABLES
#argument MAPPER Predicate ToByteFunction ToShortFunction ToIntFunction ToLongFunction ToFloatFunction ToDoubleFunction
#argument APPLY test applyAsByte applyAsShort applyAsInt applyAsLong applyAsFloat applyAsDouble
#argument DATA_TYPE Boolean Byte Short Int Long Float Double
#argument FILTER_TYPE BOOLEAN_COLLECTION_MODULE BYTE_COLLECTION_MODULE SHORT_COLLECTION_MODULE INT_COLLECTION_MODULE LONG_COLLECTION_MODULE FLOAT_COLLECTION_MODULE DOUBLE_COLLECTION_MODULE
#if FILTER_TYPE
private static class MAPPED_TYPEIterable<E> implements OUTPUT_ITERABLE, ISizeProvider
{
ITERABLE KEY_SPECIAL_GENERIC_TYPE<E> iterable;
@ -369,6 +371,7 @@ public class ITERABLES
}
}
#endif
#enditerate
#endif
private static class MappedIterable KSS_GENERIC_TYPE<E, T> implements ObjectIterable<T>, ISizeProvider

View File

@ -925,6 +925,8 @@ public class ITERATORS
#argument MAPPER Predicate ToByteFunction ToShortFunction ToIntFunction ToLongFunction ToFloatFunction ToDoubleFunction
#argument APPLY test applyAsByte applyAsShort applyAsInt applyAsLong applyAsFloat applyAsDouble
#argument DATA_TYPE boolean byte short int long float double
#argument FILTER_TYPE BOOLEAN_COLLECTION_MODULE BYTE_COLLECTION_MODULE SHORT_COLLECTION_MODULE INT_COLLECTION_MODULE LONG_COLLECTION_MODULE FLOAT_COLLECTION_MODULE DOUBLE_COLLECTION_MODULE
#if FILTER_TYPE
private static class MAPPED_TYPEIterator<E> implements OUTPUT_ITERATOR
{
ITERATOR<E> iterator;
@ -951,6 +953,7 @@ public class ITERATORS
}
}
#endif
#enditerate
#endif
private static class FlatMappedIterator KSS_GENERIC_TYPE<E, T,[SPACE]V extends Iterable<T>> implements ObjectIterator<T>