Skip to content

Commit

Permalink
Convert CRLF to LF
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo committed Jan 6, 2025
1 parent 5c553ff commit 25b6215
Show file tree
Hide file tree
Showing 66 changed files with 9,785 additions and 9,676 deletions.
16 changes: 16 additions & 0 deletions buildSrc/src/main/kotlin/GeneratePlugin.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginExtension
Expand Down
16 changes: 16 additions & 0 deletions buildSrc/src/main/kotlin/GenerateTask.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
Expand Down
16 changes: 16 additions & 0 deletions buildSrc/src/main/kotlin/Primitives.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import freemarker.template.SimpleScalar
import freemarker.template.TemplateMethodModelEx

Expand Down
48 changes: 24 additions & 24 deletions kala-base/src/main/java/kala/Equatable.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala;

public interface Equatable {
default boolean canEqual(Object other) {
return true;
}

boolean equals(Object other);
}
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala;

public interface Equatable {
default boolean canEqual(Object other) {
return true;
}

boolean equals(Object other);
}
48 changes: 24 additions & 24 deletions kala-base/src/main/java/kala/annotations/Contravariant.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;

@Documented
@Target(ElementType.TYPE_PARAMETER)
@Retention(RetentionPolicy.SOURCE)
public @interface Contravariant {
}
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;

@Documented
@Target(ElementType.TYPE_PARAMETER)
@Retention(RetentionPolicy.SOURCE)
public @interface Contravariant {
}
50 changes: 25 additions & 25 deletions kala-base/src/main/java/kala/annotations/ReplaceWith.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;

@Documented
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.SOURCE)
public @interface ReplaceWith {
String value();
}
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;

@Documented
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.SOURCE)
public @interface ReplaceWith {
String value();
}
54 changes: 27 additions & 27 deletions kala-base/src/main/java/kala/annotations/StaticClass.java
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;

/**
* Annotate a class as a static class, which cannot be instantiated.
*/
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface StaticClass {
}
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.annotations;

import java.lang.annotation.*;

/**
* Annotate a class as a static class, which cannot be instantiated.
*/
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface StaticClass {
}
80 changes: 40 additions & 40 deletions kala-base/src/main/java/kala/collection/base/AbstractIterator.java
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.collection.base;

import kala.annotations.Covariant;

import java.util.Iterator;
import java.util.NoSuchElementException;

public abstract class AbstractIterator<@Covariant E> implements Iterator<E> {

/// @throws NoSuchElementException when `hasNext()` returns `false`.
protected void checkStatus() throws NoSuchElementException {
if (!hasNext()) {
throw new NoSuchElementException("The iterator has no more elements");
}
}

@Override
public String toString() {
if (!hasNext()) {
return super.toString() + "[]";
} else {
return super.toString() + "[<not computed>]";
}
}
}
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.collection.base;

import kala.annotations.Covariant;

import java.util.Iterator;
import java.util.NoSuchElementException;

public abstract class AbstractIterator<@Covariant E> implements Iterator<E> {

/// @throws NoSuchElementException when `hasNext()` returns `false`.
protected void checkStatus() throws NoSuchElementException {
if (!hasNext()) {
throw new NoSuchElementException("The iterator has no more elements");
}
}

@Override
public String toString() {
if (!hasNext()) {
return super.toString() + "[]";
} else {
return super.toString() + "[<not computed>]";
}
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.collection.base;

import kala.tuple.Tuple2;

public abstract class AbstractMapIterator<K, V> extends AbstractIterator<Tuple2<K, V>> implements MapIterator<K, V> {

}
/*
* Copyright 2024 Glavo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kala.collection.base;

import kala.tuple.Tuple2;

public abstract class AbstractMapIterator<K, V> extends AbstractIterator<Tuple2<K, V>> implements MapIterator<K, V> {

}
Loading

0 comments on commit 25b6215

Please sign in to comment.