ICU-10740 Fix newline error in ICU4J

X-SVN-Rev: 35504
This commit is contained in:
Michael Ow 2014-03-18 21:57:47 +00:00
parent 36b2e91e43
commit 86c4aaf4ab
3 changed files with 299 additions and 304 deletions

5
.gitattributes vendored
View file

@ -269,9 +269,6 @@ icu4j/main/classes/core/.settings/edu.umd.cs.findbugs.core.prefs -text
icu4j/main/classes/core/.settings/org.eclipse.core.resources.prefs -text
icu4j/main/classes/core/.settings/org.eclipse.jdt.core.prefs -text
icu4j/main/classes/core/manifest.stub -text
icu4j/main/classes/core/src/com/ibm/icu/impl/Deque.java -text
icu4j/main/classes/core/src/com/ibm/icu/impl/SimplePatternFormatter.java -text
icu4j/main/classes/core/src/com/ibm/icu/text/KhmerBreakEngine.java -text
icu4j/main/classes/currdata/.externalToolBuilders/copy-data-currdata.launch -text
icu4j/main/classes/currdata/.settings/org.eclipse.core.resources.prefs -text
icu4j/main/classes/currdata/.settings/org.eclipse.jdt.core.prefs -text
@ -566,7 +563,6 @@ icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_53.1/com.ib
icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_53.1/com.ibm.icu.util.ULocale.dat -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_53.1/com.ibm.icu.util.UResourceTypeMismatchException.dat -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_53.1/com.ibm.icu.util.VTimeZone.dat -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/SimplePatternFormatterTest.java -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.setRanges1.16.tri2 -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.setRanges1.32.tri2 -text
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/Trie2Test.setRanges2.16.tri2 -text
@ -609,7 +605,6 @@ icu4j/perf-tests/.settings/org.eclipse.core.resources.prefs -text
icu4j/perf-tests/.settings/org.eclipse.jdt.core.prefs -text
icu4j/perf-tests/.settings/org.eclipse.jdt.ui.prefs -text
icu4j/perf-tests/data/icuperf2report.xsl -text
icu4j/perf-tests/src/com/ibm/icu/dev/test/perf/ServiceObjectCreationPerf.java -text
icu4j/samples/build.properties -text
icu4j/samples/manifest.stub -text
icu4j/samples/src/com/ibm/icu/samples/iuc/data/popmsg/es.res -text

View file

@ -1,219 +1,219 @@
/*
*******************************************************************************
* Copyright (C) 2014, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.impl;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.NoSuchElementException;
/**
* Thin wrapper of java.util.LinkedList implementing Java 6 Deque on
* Java 5 runtime environment. This class might be removed when the minimum
* Java runtime version is updated to 6 or later.
*/
public class Deque<E> {
private LinkedList<E> ll = new LinkedList<E>();
public Deque() {
}
public boolean isEmpty() {
return ll.isEmpty();
}
public Object[] toArray() {
return ll.toArray();
}
public <T> T[] toArray(T[] a) {
return ll.toArray(a);
}
public boolean containsAll(Collection<?> c) {
return ll.containsAll(c);
}
public boolean addAll(Collection<? extends E> c) {
return ll.addAll(c);
}
public boolean removeAll(Collection<?> c) {
return ll.removeAll(c);
}
public boolean retainAll(Collection<?> c) {
return ll.retainAll(c);
}
public void clear() {
ll.clear();
}
public void addFirst(E e) {
ll.addFirst(e);
}
public void addLast(E e) {
ll.addLast(e);
}
public boolean offerFirst(E e) {
ll.addFirst(e);
return true;
}
public boolean offerLast(E e) {
ll.addLast(e);
return true;
}
public E removeFirst() {
return ll.removeFirst();
}
public E removeLast() {
return ll.removeLast();
}
public E pollFirst() {
return ll.poll();
}
public E pollLast() {
E e;
try {
e = ll.removeLast();
} catch (NoSuchElementException ex) {
// ignore the exception and return null
e = null;
}
return e;
}
public E getFirst() {
return ll.getFirst();
}
public E getLast() {
return ll.getLast();
}
public E peekFirst() {
return ll.peek();
}
public E peekLast() {
E e;
try {
e = ll.getLast();
} catch (NoSuchElementException ex) {
// ignore the exception and return null
e = null;
}
return e;
}
public boolean removeFirstOccurrence(Object o) {
return ll.remove(o);
}
public boolean removeLastOccurrence(Object o) {
ListIterator<E> litr = ll.listIterator(ll.size());
while (litr.hasPrevious()) {
E e = litr.previous();
if ((o == null && e == null) || (o != null && o.equals(e))) {
litr.remove();
return true;
}
}
return false;
}
public boolean add(E e) {
return ll.add(e);
}
public boolean offer(E e) {
return ll.offer(e);
}
public E remove() {
return ll.remove();
}
public E poll() {
return ll.poll();
}
public E element() {
return ll.element();
}
public E peek() {
return ll.peek();
}
public void push(E e) {
ll.addFirst(e);
}
public E pop() {
return ll.removeFirst();
}
public boolean remove(Object o) {
return ll.remove(o);
}
public boolean contains(Object o) {
return ll.contains(o);
}
public int size() {
return ll.size();
}
public Iterator<E> iterator() {
return ll.iterator();
}
public Iterator<E> descendingIterator() {
return new DescendingIterator();
}
private class DescendingIterator implements Iterator<E> {
private ListIterator<E> litr;
DescendingIterator() {
litr = ll.listIterator(ll.size());
}
/* (non-Javadoc)
* @see java.util.Iterator#hasNext()
*/
public boolean hasNext() {
return litr.hasPrevious();
}
/* (non-Javadoc)
* @see java.util.Iterator#next()
*/
public E next() {
return litr.previous();
}
/* (non-Javadoc)
* @see java.util.Iterator#remove()
*/
public void remove() {
litr.remove();
}
}
}
/*
*******************************************************************************
* Copyright (C) 2014, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.impl;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.NoSuchElementException;
/**
* Thin wrapper of java.util.LinkedList implementing Java 6 Deque on
* Java 5 runtime environment. This class might be removed when the minimum
* Java runtime version is updated to 6 or later.
*/
public class Deque<E> {
private LinkedList<E> ll = new LinkedList<E>();
public Deque() {
}
public boolean isEmpty() {
return ll.isEmpty();
}
public Object[] toArray() {
return ll.toArray();
}
public <T> T[] toArray(T[] a) {
return ll.toArray(a);
}
public boolean containsAll(Collection<?> c) {
return ll.containsAll(c);
}
public boolean addAll(Collection<? extends E> c) {
return ll.addAll(c);
}
public boolean removeAll(Collection<?> c) {
return ll.removeAll(c);
}
public boolean retainAll(Collection<?> c) {
return ll.retainAll(c);
}
public void clear() {
ll.clear();
}
public void addFirst(E e) {
ll.addFirst(e);
}
public void addLast(E e) {
ll.addLast(e);
}
public boolean offerFirst(E e) {
ll.addFirst(e);
return true;
}
public boolean offerLast(E e) {
ll.addLast(e);
return true;
}
public E removeFirst() {
return ll.removeFirst();
}
public E removeLast() {
return ll.removeLast();
}
public E pollFirst() {
return ll.poll();
}
public E pollLast() {
E e;
try {
e = ll.removeLast();
} catch (NoSuchElementException ex) {
// ignore the exception and return null
e = null;
}
return e;
}
public E getFirst() {
return ll.getFirst();
}
public E getLast() {
return ll.getLast();
}
public E peekFirst() {
return ll.peek();
}
public E peekLast() {
E e;
try {
e = ll.getLast();
} catch (NoSuchElementException ex) {
// ignore the exception and return null
e = null;
}
return e;
}
public boolean removeFirstOccurrence(Object o) {
return ll.remove(o);
}
public boolean removeLastOccurrence(Object o) {
ListIterator<E> litr = ll.listIterator(ll.size());
while (litr.hasPrevious()) {
E e = litr.previous();
if ((o == null && e == null) || (o != null && o.equals(e))) {
litr.remove();
return true;
}
}
return false;
}
public boolean add(E e) {
return ll.add(e);
}
public boolean offer(E e) {
return ll.offer(e);
}
public E remove() {
return ll.remove();
}
public E poll() {
return ll.poll();
}
public E element() {
return ll.element();
}
public E peek() {
return ll.peek();
}
public void push(E e) {
ll.addFirst(e);
}
public E pop() {
return ll.removeFirst();
}
public boolean remove(Object o) {
return ll.remove(o);
}
public boolean contains(Object o) {
return ll.contains(o);
}
public int size() {
return ll.size();
}
public Iterator<E> iterator() {
return ll.iterator();
}
public Iterator<E> descendingIterator() {
return new DescendingIterator();
}
private class DescendingIterator implements Iterator<E> {
private ListIterator<E> litr;
DescendingIterator() {
litr = ll.listIterator(ll.size());
}
/* (non-Javadoc)
* @see java.util.Iterator#hasNext()
*/
public boolean hasNext() {
return litr.hasPrevious();
}
/* (non-Javadoc)
* @see java.util.Iterator#next()
*/
public E next() {
return litr.previous();
}
/* (non-Javadoc)
* @see java.util.Iterator#remove()
*/
public void remove() {
litr.remove();
}
}
}

View file

@ -1,80 +1,80 @@
/*
*******************************************************************************
* Copyright (C) 2014, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.dev.test.perf;
/**
* ICU service object creation performance test cases
*/
public class ServiceObjectCreationPerf extends PerfTest {
private static final long DEF_COUNT = 1000L;
public static void main(String... args) throws Exception {
new ServiceObjectCreationPerf().run(args);
}
PerfTest.Function TestCalendarJava() {
return new PerfTest.Function() {
private long n = DEF_COUNT;
public void call() {
for (long i = 0; i < n; i++) {
@SuppressWarnings("unused")
java.util.Calendar cal = java.util.Calendar.getInstance();
}
}
public long getOperationsPerIteration() {
return n;
}
};
}
PerfTest.Function TestCalendarICU() {
return new PerfTest.Function() {
private long n = DEF_COUNT;
public void call() {
for (long i = 0; i < n; i++) {
@SuppressWarnings("unused")
com.ibm.icu.util.Calendar cal = com.ibm.icu.util.Calendar.getInstance();
}
}
public long getOperationsPerIteration() {
return n;
}
};
}
PerfTest.Function TestTimeZoneJava() {
return new PerfTest.Function() {
private long n = DEF_COUNT;
public void call() {
for (long i = 0; i < n; i++) {
@SuppressWarnings("unused")
java.util.TimeZone tz = java.util.TimeZone.getDefault();
}
}
public long getOperationsPerIteration() {
return n;
}
};
}
PerfTest.Function TestTimeZoneICU() {
return new PerfTest.Function() {
private long n = DEF_COUNT;
public void call() {
for (long i = 0; i < n; i++) {
@SuppressWarnings("unused")
com.ibm.icu.util.TimeZone tz = com.ibm.icu.util.TimeZone.getDefault();
}
}
public long getOperationsPerIteration() {
return n;
}
};
}
}
/*
*******************************************************************************
* Copyright (C) 2014, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.dev.test.perf;
/**
* ICU service object creation performance test cases
*/
public class ServiceObjectCreationPerf extends PerfTest {
private static final long DEF_COUNT = 1000L;
public static void main(String... args) throws Exception {
new ServiceObjectCreationPerf().run(args);
}
PerfTest.Function TestCalendarJava() {
return new PerfTest.Function() {
private long n = DEF_COUNT;
public void call() {
for (long i = 0; i < n; i++) {
@SuppressWarnings("unused")
java.util.Calendar cal = java.util.Calendar.getInstance();
}
}
public long getOperationsPerIteration() {
return n;
}
};
}
PerfTest.Function TestCalendarICU() {
return new PerfTest.Function() {
private long n = DEF_COUNT;
public void call() {
for (long i = 0; i < n; i++) {
@SuppressWarnings("unused")
com.ibm.icu.util.Calendar cal = com.ibm.icu.util.Calendar.getInstance();
}
}
public long getOperationsPerIteration() {
return n;
}
};
}
PerfTest.Function TestTimeZoneJava() {
return new PerfTest.Function() {
private long n = DEF_COUNT;
public void call() {
for (long i = 0; i < n; i++) {
@SuppressWarnings("unused")
java.util.TimeZone tz = java.util.TimeZone.getDefault();
}
}
public long getOperationsPerIteration() {
return n;
}
};
}
PerfTest.Function TestTimeZoneICU() {
return new PerfTest.Function() {
private long n = DEF_COUNT;
public void call() {
for (long i = 0; i < n; i++) {
@SuppressWarnings("unused")
com.ibm.icu.util.TimeZone tz = com.ibm.icu.util.TimeZone.getDefault();
}
}
public long getOperationsPerIteration() {
return n;
}
};
}
}