From b00022ef1c821c615c34b13f0460220b3e6b0e0b Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 25 Jun 2014 20:08:23 +0400 Subject: [PATCH] Add JetBrains license to HashPMap, remove obsolete author tags and javadocs --- .../jvm/internal/pcollections/ConsPStack.java | 18 +++++++++-- .../jvm/internal/pcollections/HashPMap.java | 24 +++++++++----- .../jvm/internal/pcollections/IntTree.java | 16 ++++++++++ .../internal/pcollections/IntTreePMap.java | 32 +++++++++---------- .../jvm/internal/pcollections/MapEntry.java | 23 +++++++++---- 5 files changed, 80 insertions(+), 33 deletions(-) diff --git a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/ConsPStack.java b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/ConsPStack.java index 91fef90dc82..a541e1e9206 100644 --- a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/ConsPStack.java +++ b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/ConsPStack.java @@ -1,3 +1,19 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * 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 kotlin.reflect.jvm.internal.pcollections; import java.util.Iterator; @@ -7,8 +23,6 @@ import java.util.NoSuchElementException; * A simple persistent stack of non-null values. *

* This implementation is thread-safe, although its iterators may not be. - * - * @author harold */ final class ConsPStack implements Iterable { private static final ConsPStack EMPTY = new ConsPStack(); diff --git a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/HashPMap.java b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/HashPMap.java index 2989de823e6..eae81f149ea 100644 --- a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/HashPMap.java +++ b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/HashPMap.java @@ -1,15 +1,23 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * 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 kotlin.reflect.jvm.internal.pcollections; /** * A persistent map from non-null keys to non-null values. - *

- * This map uses a given integer map to map hashcodes to lists of elements - * with the same hashcode. Thus if all elements have the same hashcode, performance - * is reduced to that of an association list. - *

- * This implementation is thread-safe, although its iterators may not be. - * - * @author harold */ public final class HashPMap { private static final HashPMap EMPTY = new HashPMap(IntTreePMap.>>empty(), 0); diff --git a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/IntTree.java b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/IntTree.java index 5d3fcd44160..d39167fedc1 100644 --- a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/IntTree.java +++ b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/IntTree.java @@ -1,3 +1,19 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * 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 kotlin.reflect.jvm.internal.pcollections; /** diff --git a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/IntTreePMap.java b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/IntTreePMap.java index 9a77bb2f5b8..040f5464b43 100644 --- a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/IntTreePMap.java +++ b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/IntTreePMap.java @@ -1,23 +1,23 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * 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 kotlin.reflect.jvm.internal.pcollections; /** * An efficient persistent map from integer keys to non-null values. - *

- * Iteration occurs in the integer order of the keys. - *

- * This implementation is thread-safe, although its iterators may not be. - *

- * The balanced tree is based on the Glasgow Haskell Compiler's Data.Map implementation, - * which in turn is based on "size balanced binary trees" as described by: - *

- * Stephen Adams, "Efficient sets: a balancing act", - * Journal of Functional Programming 3(4):553-562, October 1993, - * http://www.swiss.ai.mit.edu/~adams/BB/. - *

- * J. Nievergelt and E.M. Reingold, "Binary search trees of bounded balance", - * SIAM journal of computing 2(1), March 1973. - * - * @author harold */ final class IntTreePMap { private static final IntTreePMap EMPTY = new IntTreePMap(IntTree.EMPTYNODE); diff --git a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/MapEntry.java b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/MapEntry.java index 9251bdb4e6b..ccfa49a0878 100644 --- a/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/MapEntry.java +++ b/core/runtime.jvm/src/kotlin/reflect/jvm/internal/pcollections/MapEntry.java @@ -1,12 +1,21 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * 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 kotlin.reflect.jvm.internal.pcollections; -/** - *

- * An Entry maintaining an immutable key and value. This class - * does not support method setValue. This class may be - * convenient in methods that return thread-safe snapshots of - * key-value mappings. - */ final class MapEntry implements java.io.Serializable { private static final long serialVersionUID = 7138329143949025153L;