diff --git a/platform/util/src/com/intellij/openapi/util/DefaultJDOMExternalizer.java b/platform/util/src/com/intellij/openapi/util/DefaultJDOMExternalizer.java index fbc5dc112a09..f56423b3ce72 100644 --- a/platform/util/src/com/intellij/openapi/util/DefaultJDOMExternalizer.java +++ b/platform/util/src/com/intellij/openapi/util/DefaultJDOMExternalizer.java @@ -1,17 +1,5 @@ /* - * Copyright 2000-2017 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. + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. */ package com.intellij.openapi.util; @@ -138,27 +126,29 @@ public class DefaultJDOMExternalizer { } @Nullable - static String filterXMLCharacters(String value) { - if (value != null) { - StringBuilder builder = null; - for (int i=0; i implements J public JDOMExternalizableStringList() { } - public JDOMExternalizableStringList(@NotNull Collection c) { + public JDOMExternalizableStringList(@NotNull Collection c) { super(c); } @@ -78,7 +78,7 @@ public class JDOMExternalizableStringList extends ArrayList implements J writeList(this, element); } - public static void writeList(@NotNull List strings, @NotNull Element element) { + private static void writeList(@NotNull List strings, @NotNull Element element) { int listSize = strings.size(); Element listElement = new Element(ATTR_LIST); listElement.setAttribute(ATTR_LISTSIZE, Integer.toString(listSize)); diff --git a/platform/util/testSrc/com/intellij/util/containers/ByteArrayQueueTest.java b/platform/util/testSrc/com/intellij/util/containers/ByteArrayQueueTest.java index 4debfa178ef9..1295fd05980d 100644 --- a/platform/util/testSrc/com/intellij/util/containers/ByteArrayQueueTest.java +++ b/platform/util/testSrc/com/intellij/util/containers/ByteArrayQueueTest.java @@ -1,20 +1,22 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. + */ package com.intellij.util.containers; -import junit.framework.Assert; +import static junit.framework.TestCase.assertEquals; /** * @author Sergey Simonchik */ public class ByteArrayQueueTest { - @org.junit.Test public void testSingleAdd() { ByteArrayQueue queue = new ByteArrayQueue(0); byte value = 1; queue.add(value); - Assert.assertEquals(1, queue.size()); - Assert.assertEquals(value, queue.poll()); - Assert.assertEquals(-1, queue.poll()); + assertEquals(1, queue.size()); + assertEquals(value, queue.poll()); + assertEquals(-1, queue.poll()); } @org.junit.Test @@ -22,11 +24,11 @@ public class ByteArrayQueueTest { ByteArrayQueue queue = new ByteArrayQueue(4); byte[] buf = new byte[] {1, 2, 3, 4, 5}; queue.addAll(buf); - Assert.assertEquals(queue.size(), buf.length); + assertEquals(queue.size(), buf.length); for (byte b : buf) { - Assert.assertEquals(b, queue.poll()); + assertEquals(b, queue.poll()); } - Assert.assertEquals(-1, queue.poll()); + assertEquals(-1, queue.poll()); } @org.junit.Test @@ -34,24 +36,23 @@ public class ByteArrayQueueTest { ByteArrayQueue queue = new ByteArrayQueue(4); byte[] buf = new byte[] {1, 2, 3, 4, 5, 6, 7, 8}; queue.addAll(buf); - Assert.assertEquals(queue.size(), buf.length); - Assert.assertEquals(buf[0], queue.poll()); - Assert.assertEquals(buf[1], queue.poll()); + assertEquals(queue.size(), buf.length); + assertEquals(buf[0], queue.poll()); + assertEquals(buf[1], queue.poll()); byte v = 9; queue.add(v); queue.add(v); queue.addAll(buf); // array resize with myHead > myTail - Assert.assertEquals(queue.size(), buf.length * 2); + assertEquals(queue.size(), buf.length * 2); for (int i = 2; i < buf.length; i++) { - Assert.assertEquals(buf[i], queue.poll()); + assertEquals(buf[i], queue.poll()); } - Assert.assertEquals(v, queue.poll()); - Assert.assertEquals(v, queue.poll()); + assertEquals(v, queue.poll()); + assertEquals(v, queue.poll()); for (byte b : buf) { - Assert.assertEquals(b, queue.poll()); + assertEquals(b, queue.poll()); } - Assert.assertEquals(-1, queue.poll()); + assertEquals(-1, queue.poll()); } - }