You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by aj...@apache.org on 2018/01/06 16:04:01 UTC
[2/2] jena git commit: Removing types from jena-base that have been
deprecated for more than two years
Removing types from jena-base that have been deprecated for more than two years
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/0ef309de
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/0ef309de
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/0ef309de
Branch: refs/heads/master
Commit: 0ef309de8b610a4af9cb4807329f7ff8c4953e45
Parents: c0c294d
Author: ajs6f <aj...@apache.org>
Authored: Fri Jan 5 11:30:46 2018 -0500
Committer: ajs6f <aj...@apache.org>
Committed: Sat Jan 6 11:02:43 2018 -0500
----------------------------------------------------------------------
.../org/apache/jena/atlas/iterator/Action.java | 30 ------
.../org/apache/jena/atlas/iterator/Filter.java | 29 -----
.../jena/atlas/iterator/IteratorArray.java | 99 -----------------
.../apache/jena/atlas/iterator/Transform.java | 28 -----
.../apache/jena/atlas/lib/ActionKeyValue.java | 29 -----
.../java/org/apache/jena/atlas/lib/Cache.java | 2 +-
.../apache/jena/atlas/iterator/TS_Iterator.java | 1 -
.../jena/atlas/iterator/TestIteratorArray.java | 107 -------------------
8 files changed, 1 insertion(+), 324 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/0ef309de/jena-base/src/main/java/org/apache/jena/atlas/iterator/Action.java
----------------------------------------------------------------------
diff --git a/jena-base/src/main/java/org/apache/jena/atlas/iterator/Action.java b/jena-base/src/main/java/org/apache/jena/atlas/iterator/Action.java
deleted file mode 100644
index 73756dc..0000000
--- a/jena-base/src/main/java/org/apache/jena/atlas/iterator/Action.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.jena.atlas.iterator;
-
-import java.util.function.Consumer;
-
-/**
- * @deprecated
- * Prefer {@link Consumer}
- */
-@Deprecated
-public interface Action<T> extends Consumer<T>
-{
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/0ef309de/jena-base/src/main/java/org/apache/jena/atlas/iterator/Filter.java
----------------------------------------------------------------------
diff --git a/jena-base/src/main/java/org/apache/jena/atlas/iterator/Filter.java b/jena-base/src/main/java/org/apache/jena/atlas/iterator/Filter.java
deleted file mode 100644
index 8545eab..0000000
--- a/jena-base/src/main/java/org/apache/jena/atlas/iterator/Filter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.jena.atlas.iterator;
-
-import java.util.function.Predicate;
-
-/**
- * @deprecated
- * Prefer {@link Predicate}.
- */
-@FunctionalInterface
-@Deprecated
-public interface Filter <T> extends Predicate<T>{ }
http://git-wip-us.apache.org/repos/asf/jena/blob/0ef309de/jena-base/src/main/java/org/apache/jena/atlas/iterator/IteratorArray.java
----------------------------------------------------------------------
diff --git a/jena-base/src/main/java/org/apache/jena/atlas/iterator/IteratorArray.java b/jena-base/src/main/java/org/apache/jena/atlas/iterator/IteratorArray.java
deleted file mode 100644
index c73a8f7..0000000
--- a/jena-base/src/main/java/org/apache/jena/atlas/iterator/IteratorArray.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.jena.atlas.iterator;
-
-import java.util.Arrays;
-import java.util.Iterator ;
-import java.util.NoSuchElementException ;
-
-/** Iterator over a Java base array */
-/**
- * @deprecated
- * Prefer {@link Arrays#asList(Object...)} with {@link Iterable#iterator()} or
- * {@link Arrays#spliterator(Object[])} or {@link Arrays#stream(Object[])}
- */
-@Deprecated
-public final class IteratorArray<T> implements Iterator<T>
-{
- /** Iterator over all the array elements */
- public static <T> IteratorArray<T> create(T[] array)
- { return new IteratorArray<>(array, 0, array.length) ; }
-
- /** Iterator over array elements from start (inclusive) to finish (exclusive) */
- public static <T> IteratorArray<T> create(T[] array, int start, int finish)
- { return new IteratorArray<>(array, start, finish) ; }
-
- private int idx ;
- private int finishIdx ;
- private T[] array ;
-
- private IteratorArray(T[] array, int start, int finish)
- {
- if ( start < 0 )
- throw new IllegalArgumentException("Start: "+start) ;
-
- if ( start > finish )
- throw new IllegalArgumentException("Start >= finish: "+start+" >= "+finish) ;
-
-// Instead: truncate to array length
-// if ( finish > array.length )
-// throw new IllegalArgumentException("Finish outside array") ;
-//
-// Instead: immediate end iterator
-// if ( start >= array.length )
-// throw new IllegalArgumentException("Start outside array") ;
-
- this.array = array ;
- idx = start ;
- finishIdx = finish ;
- if ( idx < 0 )
- idx = 0 ;
- if ( finishIdx > array.length )
- finishIdx = array.length ;
- }
-
- @Override
- public boolean hasNext()
- {
-// if ( idx < 0 )
-// return false ;
- if ( idx >= finishIdx )
- return false ;
- return true ;
- }
-
- public T current()
- {
- if ( idx >= finishIdx )
- throw new NoSuchElementException() ;
- return array[idx] ;
- }
-
- @Override
- public T next()
- {
- if ( ! hasNext() )
- throw new NoSuchElementException() ;
- return array[idx++] ;
- }
-
- @Override
- public void remove()
- { throw new UnsupportedOperationException("ArrayIterator") ; }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/0ef309de/jena-base/src/main/java/org/apache/jena/atlas/iterator/Transform.java
----------------------------------------------------------------------
diff --git a/jena-base/src/main/java/org/apache/jena/atlas/iterator/Transform.java b/jena-base/src/main/java/org/apache/jena/atlas/iterator/Transform.java
deleted file mode 100644
index 2a070ab..0000000
--- a/jena-base/src/main/java/org/apache/jena/atlas/iterator/Transform.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.jena.atlas.iterator;
-
-import java.util.function.Function;
-
-/**
- * @deprecated
- * Prefer {@link Function}.
- */
-@Deprecated
-public interface Transform <T, R> extends Function<T,R>{ }
http://git-wip-us.apache.org/repos/asf/jena/blob/0ef309de/jena-base/src/main/java/org/apache/jena/atlas/lib/ActionKeyValue.java
----------------------------------------------------------------------
diff --git a/jena-base/src/main/java/org/apache/jena/atlas/lib/ActionKeyValue.java b/jena-base/src/main/java/org/apache/jena/atlas/lib/ActionKeyValue.java
deleted file mode 100644
index 64bc758..0000000
--- a/jena-base/src/main/java/org/apache/jena/atlas/lib/ActionKeyValue.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.jena.atlas.lib;
-
-import java.util.function.BiConsumer;
-
-/**
- * @deprecated Use {@link BiConsumer}.
- */
-@Deprecated
-public interface ActionKeyValue<KeyType, ValueType> extends BiConsumer<KeyType, ValueType>
-{
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/0ef309de/jena-base/src/main/java/org/apache/jena/atlas/lib/Cache.java
----------------------------------------------------------------------
diff --git a/jena-base/src/main/java/org/apache/jena/atlas/lib/Cache.java b/jena-base/src/main/java/org/apache/jena/atlas/lib/Cache.java
index af25173..ff4b4df 100644
--- a/jena-base/src/main/java/org/apache/jena/atlas/lib/Cache.java
+++ b/jena-base/src/main/java/org/apache/jena/atlas/lib/Cache.java
@@ -32,7 +32,7 @@ public interface Cache<Key, Value>
/** Get from cache - or return null. */
public Value getIfPresent(Key key) ;
- /** Get from cache, of not present, call the {@code callable}
+ /** Get from cache, of not present, call the {@link Callable}
* to try to fill the cache. This operation should be atomic.
*/
public Value getOrFill(Key key, Callable<Value> callable) ;
http://git-wip-us.apache.org/repos/asf/jena/blob/0ef309de/jena-base/src/test/java/org/apache/jena/atlas/iterator/TS_Iterator.java
----------------------------------------------------------------------
diff --git a/jena-base/src/test/java/org/apache/jena/atlas/iterator/TS_Iterator.java b/jena-base/src/test/java/org/apache/jena/atlas/iterator/TS_Iterator.java
index 3805875..2768cc9 100644
--- a/jena-base/src/test/java/org/apache/jena/atlas/iterator/TS_Iterator.java
+++ b/jena-base/src/test/java/org/apache/jena/atlas/iterator/TS_Iterator.java
@@ -25,7 +25,6 @@ import org.junit.runners.Suite ;
@Suite.SuiteClasses( {
TestIter.class
, TestIteratorPeek.class
- , TestIteratorArray.class
, TestIteratorPushback.class
, TestIteratorWithHistory.class
, TestIteratorWithBuffer.class
http://git-wip-us.apache.org/repos/asf/jena/blob/0ef309de/jena-base/src/test/java/org/apache/jena/atlas/iterator/TestIteratorArray.java
----------------------------------------------------------------------
diff --git a/jena-base/src/test/java/org/apache/jena/atlas/iterator/TestIteratorArray.java b/jena-base/src/test/java/org/apache/jena/atlas/iterator/TestIteratorArray.java
deleted file mode 100644
index f538558..0000000
--- a/jena-base/src/test/java/org/apache/jena/atlas/iterator/TestIteratorArray.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.jena.atlas.iterator;
-
-import java.util.Iterator ;
-import java.util.NoSuchElementException ;
-
-import org.apache.jena.atlas.iterator.IteratorArray ;
-import org.apache.jena.atlas.junit.BaseTest ;
-import org.junit.Test ;
-
-// Legacy - to be removed sometime.
-@SuppressWarnings("deprecation")
-public class TestIteratorArray extends BaseTest
-{
-
- IteratorArray<String> create(String ... a)
- {
- return IteratorArray.create(a) ;
- }
-
- IteratorArray<String> create(int start, int finish, String ... a)
- {
- return IteratorArray.create(a, start, finish) ;
- }
-
- @Test public void arrayIterator_1()
- {
- Iterator<String> iter = create() ;
- assertFalse(iter.hasNext()) ;
- assertFalse(iter.hasNext()) ;
- }
-
- @Test public void arrayIterator_2()
- {
- Iterator<String> iter = create("a") ;
- assertTrue(iter.hasNext()) ;
- assertEquals("a", iter.next()) ;
- assertFalse(iter.hasNext()) ;
- assertFalse(iter.hasNext()) ;
- }
-
-
- @Test public void arrayIterator_3()
- {
- Iterator<String> iter = create("a", "b", "c") ;
- assertTrue(iter.hasNext()) ;
- assertEquals("a", iter.next()) ;
- assertTrue(iter.hasNext()) ;
- assertEquals("b", iter.next()) ;
- assertTrue(iter.hasNext()) ;
- assertEquals("c", iter.next()) ;
- assertFalse(iter.hasNext()) ;
- assertFalse(iter.hasNext()) ;
- }
-
- @Test public void arrayIterator_4()
- {
- Iterator<String> iter = create("a") ;
- assertEquals("a", iter.next()) ;
- try { iter.next() ; fail("Expected NoSuchElementException") ; }
- catch (NoSuchElementException ex) {}
- }
-
- @Test public void arrayIterator_5()
- {
- Iterator<String> iter = create(0,1, "a", "b", "c") ;
- assertEquals("a", iter.next()) ;
- assertFalse(iter.hasNext()) ;
- }
-
- @Test public void arrayIterator_6()
- {
- Iterator<String> iter = create(1, 3, "a", "b", "c", "d") ;
- assertEquals("b", iter.next()) ;
- assertEquals("c", iter.next()) ;
- assertFalse(iter.hasNext()) ;
- }
-
- @Test public void arrayIterator_7()
- {
- IteratorArray<String> iter = create(1, 3, "a", "b", "c", "d") ;
- assertEquals("b", iter.current()) ;
- assertEquals("b", iter.current()) ;
- assertEquals("b", iter.next()) ;
- assertEquals("c", iter.current()) ;
- assertEquals("c", iter.next()) ;
- assertFalse(iter.hasNext()) ;
- }
-
-}