Awight has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/403476 )
Change subject: Remove unused Buffer class
......................................................................
Remove unused Buffer class
Split from I3517af1cd2a2005596447d154ae338b3bf5692d9
Change-Id: I5c381c20682c6352ddb1ebfca7493da4a6184938
---
D src/org/mediawiki/importer/Buffer.java
1 file changed, 0 insertions(+), 72 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/mwdumper
refs/changes/76/403476/1
diff --git a/src/org/mediawiki/importer/Buffer.java
b/src/org/mediawiki/importer/Buffer.java
deleted file mode 100644
index 217ce84..0000000
--- a/src/org/mediawiki/importer/Buffer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * MediaWiki import/export processing tools
- * Copyright (C) 2005 by Brion Vibber
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE
- * SOFTWARE.
- *
- * $Id$
- */
-
-package org.mediawiki.importer;
-
-import java.util.IdentityHashMap;
-
-public final class Buffer {
-
- private Buffer() {}
-
- private static final IdentityHashMap<Thread, char[]> BUFFERS = new
IdentityHashMap<Thread, char[]>();
-
- private static Thread lastThread;
- private static char[] lastBuffer;
-
- public static synchronized char[] get(int capacity) {
- final Thread thread = Thread.currentThread();
- char[] buffer;
-
- if (lastThread == thread) {
- buffer = lastBuffer;
- } else {
- lastThread = thread;
- buffer = lastBuffer = BUFFERS.get(thread);
- }
-
- if (buffer == null) {
- buffer = lastBuffer = new char[capacity];
- BUFFERS.put(thread, buffer);
- } else if (buffer.length < capacity) {
- int newsize = buffer.length * 2;
- if (newsize < capacity)
- newsize = capacity;
- /*
- // Debug!
- System.err.println("** Growing buffer to " + newsize);
- try {
- throw new RuntimeException("foo");
- } catch (RuntimeException e) {
- e.printStackTrace();
- }
- */
- buffer = lastBuffer = new char[newsize];
- BUFFERS.put(thread, buffer);
- }
-
- return buffer;
- }
-}
--
To view, visit https://gerrit.wikimedia.org/r/403476
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c381c20682c6352ddb1ebfca7493da4a6184938
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/mwdumper
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits