method2testcases stringlengths 118 6.63k |
|---|
### Question:
SimpleLogSource implements LogSource { public Logger getLogger() { return logger; } SimpleLogSource(); SimpleLogSource(Logger logger, String realm); void setLogger(Logger logger, String realm); String getRealm(); Logger getLogger(); void setRealm(String realm); void info(String detail); void info(String ... |
### Question:
SimpleLogSource implements LogSource { public String getRealm () { return realm; } SimpleLogSource(); SimpleLogSource(Logger logger, String realm); void setLogger(Logger logger, String realm); String getRealm(); Logger getLogger(); void setRealm(String realm); void info(String detail); void info(String d... |
### Question:
SimpleLogSource implements LogSource { public void info (String detail) { Logger.log (new LogEvent (this, "info", detail)); } SimpleLogSource(); SimpleLogSource(Logger logger, String realm); void setLogger(Logger logger, String realm); String getRealm(); Logger getLogger(); void setRealm(String realm); v... |
### Question:
SimpleLogSource implements LogSource { public void setLogger (Logger logger, String realm) { this.logger = logger; this.realm = realm; } SimpleLogSource(); SimpleLogSource(Logger logger, String realm); void setLogger(Logger logger, String realm); String getRealm(); Logger getLogger(); void setRealm(Strin... |
### Question:
SimpleLogSource implements LogSource { public void setRealm (String realm) { this.realm = realm; } SimpleLogSource(); SimpleLogSource(Logger logger, String realm); void setLogger(Logger logger, String realm); String getRealm(); Logger getLogger(); void setRealm(String realm); void info(String detail); vo... |
### Question:
SimpleLogSource implements LogSource { public void warning (String detail) { Logger.log (new LogEvent (this, "warning", detail)); } SimpleLogSource(); SimpleLogSource(Logger logger, String realm); void setLogger(Logger logger, String realm); String getRealm(); Logger getLogger(); void setRealm(String rea... |
### Question:
RotateLogListener extends SimpleLogListener implements Configurable, Destroyable { protected synchronized void openLogFile() throws IOException { if (f != null) f.close(); f = new FileOutputStream (logName, true); setPrintStream (new PrintStream(f)); p.println ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"... |
### Question:
RotateLogListener extends SimpleLogListener implements Configurable, Destroyable { protected synchronized void closeLogFile() throws IOException { p.println ("</logger>"); if (f != null) f.close(); f = null; } RotateLogListener(); void setConfiguration(Configuration cfg); synchronized LogEvent log(LogEven... |
### Question:
RotateLogListener extends SimpleLogListener implements Configurable, Destroyable { public void destroy () { if (rotate != null) rotate.cancel(); try { closeLogFile (); } catch (IOException e) { logDebug(e.getMessage()); } } RotateLogListener(); void setConfiguration(Configuration cfg); synchronized LogEve... |
### Question:
RotateLogListener extends SimpleLogListener implements Configurable, Destroyable { public synchronized LogEvent log (LogEvent ev) { if (msgCount++ > CHECK_INTERVAL) { checkSize(); msgCount = 0; } return super.log (ev); } RotateLogListener(); void setConfiguration(Configuration cfg); synchronized LogEvent ... |
### Question:
RotateLogListener extends SimpleLogListener implements Configurable, Destroyable { protected synchronized void logDebug (String msg) { if (p != null) { p.println ("<log realm=\"rotate-log-listener\" at=\""+new Date().toString() +"\">"); p.println (" "+msg); p.println ("</log>"); } } RotateLogListener(); v... |
### Question:
RotateLogListener extends SimpleLogListener implements Configurable, Destroyable { public void logRotate () throws IOException { logRotate(false); } RotateLogListener(); void setConfiguration(Configuration cfg); synchronized LogEvent log(LogEvent ev); void logRotate(); synchronized void logRotate(boolean ... |
### Question:
RotateLogListener extends SimpleLogListener implements Configurable, Destroyable { public void setConfiguration (Configuration cfg) throws ConfigurationException { if (maxCopies == 0) { maxCopies = cfg.getInt("copies", 0); } if (sleepTime == 0) { sleepTime = cfg.getInt("window") * 1000; } if (logName == n... |
### Question:
RotateLogListener extends SimpleLogListener implements Configurable, Destroyable { protected String fileNameFromPattern(String inFileName, String patternCodes) { String[] computedValues; String[] codes = patternCodes.split(","); computedValues = new String[codes.length]; for (int i = 0; i < codes.length; ... |
### Question:
BlockingQueue { public synchronized void close() { closed = true; notifyAll(); } synchronized void enqueue(Object o); synchronized void requeue(Object o); synchronized Object dequeue(); synchronized Object dequeue(long timeout); synchronized void close(); synchronized int consumerCount(); synchronized in... |
### Question:
BlockingQueue { public synchronized int consumerCount() { return consumers; } synchronized void enqueue(Object o); synchronized void requeue(Object o); synchronized Object dequeue(); synchronized Object dequeue(long timeout); synchronized void close(); synchronized int consumerCount(); synchronized int c... |
### Question:
BlockingQueue { public synchronized Object dequeue() throws InterruptedException, Closed { consumers++; try { while (queue.size() == 0) { wait(); if (closed) throw new Closed(); } } finally { consumers--; } return queue.removeFirst(); } synchronized void enqueue(Object o); synchronized void requeue(Objec... |
### Question:
BlockingQueue { public synchronized void enqueue (Object o) throws Closed { if (closed) throw new Closed(); queue.addLast (o); notify(); } synchronized void enqueue(Object o); synchronized void requeue(Object o); synchronized Object dequeue(); synchronized Object dequeue(long timeout); synchronized void ... |
### Question:
BlockingQueue { public synchronized int pending() { return queue.size(); } synchronized void enqueue(Object o); synchronized void requeue(Object o); synchronized Object dequeue(); synchronized Object dequeue(long timeout); synchronized void close(); synchronized int consumerCount(); synchronized int cons... |
### Question:
BlockingQueue { public synchronized boolean ready() { return !closed; } synchronized void enqueue(Object o); synchronized void requeue(Object o); synchronized Object dequeue(); synchronized Object dequeue(long timeout); synchronized void close(); synchronized int consumerCount(); synchronized int consume... |
### Question:
BlockingQueue { public synchronized void requeue (Object o) throws Closed { if (closed) throw new Closed(); queue.addFirst (o); notify(); } synchronized void enqueue(Object o); synchronized void requeue(Object o); synchronized Object dequeue(); synchronized Object dequeue(long timeout); synchronized void... |
### Question:
BlockingQueue { public void setQueue (LinkedList queue) { this.queue = queue; } synchronized void enqueue(Object o); synchronized void requeue(Object o); synchronized Object dequeue(); synchronized Object dequeue(long timeout); synchronized void close(); synchronized int consumerCount(); synchronized int... |
### Question:
ExceptionLogFilter implements LogListener { public synchronized LogEvent log (LogEvent evt) { synchronized (evt.getPayLoad()) { for (Object o : evt.getPayLoad()) { if (o instanceof Throwable) return evt; } } return null; } ExceptionLogFilter(); synchronized LogEvent log(LogEvent evt); }### Answer:
@Test ... |
### Question:
SimpleLogListener implements LogListener, XmlConfigurable, Consumer<LogEventWriter> { public synchronized void close() { if (writer != null) { writer.close(); p = null; } if (p != null) { p.close(); p = null; } } SimpleLogListener(); SimpleLogListener(PrintStream p); synchronized void setPrintStream(Prin... |
### Question:
SimpleLogListener implements LogListener, XmlConfigurable, Consumer<LogEventWriter> { public synchronized LogEvent log (LogEvent ev) { if (writer != null) { writer.write(ev); } else { if (p != null) { ev.dump(p, ""); p.flush(); } } return ev; } SimpleLogListener(); SimpleLogListener(PrintStream p); synch... |
### Question:
SimpleLogListener implements LogListener, XmlConfigurable, Consumer<LogEventWriter> { public synchronized void setPrintStream (PrintStream p) { this.p = p; if (writer != null) { writer.setPrintStream(p); } } SimpleLogListener(); SimpleLogListener(PrintStream p); synchronized void setPrintStream(PrintStre... |
### Question:
SimpleLogListener implements LogListener, XmlConfigurable, Consumer<LogEventWriter> { @Override public void setConfiguration(Element e) throws ConfigurationException { Element ew = e.getChild("writer"); LogEventWriter writer; if (ew != null) { String clazz = ew.getAttributeValue("class"); if (clazz != nul... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public boolean accept(File dir, String name) { boolean result; String ext = currentPriority >= 0 ? (String) prio.elementAt(currentPriority) : null; if (ext != null) { if (isRegexPriorityMatching()) { if (!name... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public boolean isPaused() { synchronized (this) { return paused; } } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); void setArchiveDateFormat... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void pause() { synchronized (this) { if (!paused) { paused = true; notify(); } } } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); void... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void setArchiveDir (String dir) { archiveDir = new File (basePath, dir); } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); void setArch... |
### Question:
CharTag { public String getTLV() { int vLen = 0; if (value != null) vLen = value.length(); String length = ISOUtil.zeropad(vLen, lengthSize); String tlv; if (swapTagWithLength) tlv = length + tagId; else tlv = tagId + length; if (vLen == 0) return tlv; return tlv + value; } protected CharTag(String tagId... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void setBadDir (String dir) { badDir = new File (basePath, dir); } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); void setArchiveDateF... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void setConfiguration (Configuration cfg) throws ConfigurationException { if (cfg != null) { if (processor instanceof Configurable) { ((Configurable) processor).setConfiguration (cfg); } setRequestDir (... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public synchronized void setPath(String base) { this.basePath = base; requestDir = new File(base, "request"); responseDir = new File(base, "response"); tmpDir = new File(base, "tmp"); badDir = new File(base, "... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void setPollInterval(long pollInterval) { this.pollInterval = pollInterval; } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); void setA... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void setPriorities (String priorities) { StringTokenizer st = new StringTokenizer (priorities); Vector v = new Vector(); while (st.hasMoreTokens()) { String ext = st.nextToken(); v.addElement (ext.equal... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void setRequestDir (String dir) { requestDir = new File (basePath, dir); } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); void setArch... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void setResponseDir (String dir) { responseDir = new File (basePath, dir); } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); void setAr... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void setRunDir (String dir) { runDir = new File (basePath, dir); } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); void setArchiveDateF... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void setTmpDir (String dir) { tmpDir = new File (basePath, dir); } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); void setArchiveDateF... |
### Question:
DirPoll extends SimpleLogSource implements Runnable, FilenameFilter, Configurable, Destroyable { public void unpause() { synchronized (this) { if (paused) { paused = false; notify(); } } } DirPoll(); synchronized void setPath(String base); void setShouldTimestampArchive(boolean shouldTimestampArchive); vo... |
### Question:
CharTag { @Override public String toString() { int vLen = 0; if (value != null) vLen = value.length(); int sbSize = tagId.length() + lengthSize + vLen + 32; StringBuilder sb = new StringBuilder(sbSize) .append("tag: ") .append(tagId) .append(", len: ") .append(vLen); if (vLen > 0) sb.append(", value: ") .... |
### Question:
Tags implements Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); for (String s : ts) { if (sb.length() > 0) sb.append(','); for (int i = 0; i<s.length(); i++) { char c = s.charAt(i); switch (c) { case '\\': case ',' : sb.append('\\'); break; } sb.append(c); } } r... |
### Question:
Tags implements Serializable { public int size() { return ts.size(); } Tags(); Tags(String tags); Tags(String... tags); void setTags(String tags); boolean add(String t); boolean remove(String t); boolean contains(String t); Iterator<String> iterator(); int size(); boolean containsAll(Tags tags); boolean... |
### Question:
Tags implements Serializable { public boolean containsAll (Tags tags) { return ts.containsAll(tags.ts); } Tags(); Tags(String tags); Tags(String... tags); void setTags(String tags); boolean add(String t); boolean remove(String t); boolean contains(String t); Iterator<String> iterator(); int size(); bool... |
### Question:
Tags implements Serializable { public boolean containsAny (Tags tags) { for (String s : tags.ts) { if (ts.contains(s)) return true; } return tags.size() == 0; } Tags(); Tags(String tags); Tags(String... tags); void setTags(String tags); boolean add(String t); boolean remove(String t); boolean contains(S... |
### Question:
Logger implements LogProducer,Configurable { public void addListener (LogListener l) { listeners.add(l); } Logger(); Configuration getConfiguration(); @Override void setConfiguration(Configuration cfg); void addListener(LogListener l); void removeListener(LogListener l); void removeAllListeners(); static ... |
### Question:
Logger implements LogProducer,Configurable { public void destroy () { NameRegistrar.unregister (NRPREFIX+name); removeAllListeners (); } Logger(); Configuration getConfiguration(); @Override void setConfiguration(Configuration cfg); void addListener(LogListener l); void removeListener(LogListener l); void... |
### Question:
Logger implements LogProducer,Configurable { public synchronized static Logger getLogger (String name) { Logger l; try { l = NameRegistrar.get (NRPREFIX+name); } catch (NameRegistrar.NotFoundException e) { l = new Logger(); l.setName (name); } return l; } Logger(); Configuration getConfiguration(); @Overr... |
### Question:
Logger implements LogProducer,Configurable { public String getName() { return this.name; } Logger(); Configuration getConfiguration(); @Override void setConfiguration(Configuration cfg); void addListener(LogListener l); void removeListener(LogListener l); void removeAllListeners(); static void log(LogEven... |
### Question:
Logger implements LogProducer,Configurable { public boolean hasListeners() { return !listeners.isEmpty(); } Logger(); Configuration getConfiguration(); @Override void setConfiguration(Configuration cfg); void addListener(LogListener l); void removeListener(LogListener l); void removeAllListeners(); static... |
### Question:
Logger implements LogProducer,Configurable { public static void log (LogEvent evt) { Logger l = null; LogSource source = evt.getSource(); if (source != null) l = source.getLogger(); if (l == null && !evt.isHonorSourceLogger()) { l = getLogger(Q2.LOGGER_NAME); } if (l != null && l.hasListeners ()) { Iterat... |
### Question:
Logger implements LogProducer,Configurable { public void removeAllListeners () { for (Object l : listeners) { if (l instanceof Destroyable) { ((Destroyable) l).destroy(); } } listeners.clear (); } Logger(); Configuration getConfiguration(); @Override void setConfiguration(Configuration cfg); void addListe... |
### Question:
Logger implements LogProducer,Configurable { public void removeListener (LogListener l) { listeners.remove(l); } Logger(); Configuration getConfiguration(); @Override void setConfiguration(Configuration cfg); void addListener(LogListener l); void removeListener(LogListener l); void removeAllListeners(); s... |
### Question:
Logger implements LogProducer,Configurable { public void setName (String name) { this.name = name; NameRegistrar.register (NRPREFIX+name, this); } Logger(); Configuration getConfiguration(); @Override void setConfiguration(Configuration cfg); void addListener(LogListener l); void removeListener(LogListene... |
### Question:
Profiler implements Loggeable { @SuppressWarnings("unchecked") public synchronized void checkPoint (String detail) { long now = System.nanoTime(); Entry e = new Entry(); e.setDurationInNanos(now - partial); e.setTotalDurationInNanos(now - start); if (events.containsKey(detail)) { for (int i=1; ;i++) { Str... |
### Question:
Profiler implements Loggeable { public void dump (PrintStream p, String indent) { String inner = indent + " "; if (!events.containsKey("end")) checkPoint ("end"); Collection c = events.values(); Iterator iter = c.iterator(); p.println (indent + "<profiler>"); while (iter.hasNext()) p.println (inner + ISOU... |
### Question:
Profiler implements Loggeable { public long getPartial() { return System.nanoTime() - partial; } Profiler(); void reset(); @SuppressWarnings("unchecked") synchronized void checkPoint(String detail); long getElapsed(); long getElapsedInMillis(); long getPartial(); long getPartialInMillis(); void dump(Print... |
### Question:
Profiler implements Loggeable { public void reset() { start = partial = System.nanoTime(); events = new LinkedHashMap<>(); } Profiler(); void reset(); @SuppressWarnings("unchecked") synchronized void checkPoint(String detail); long getElapsed(); long getElapsedInMillis(); long getPartial(); long getPartia... |
### Question:
Recyclable implements Supplier<T> { public Recyclable(Supplier<T> supplier, long maxCycles) { this.supplier = supplier; this.maxCycles = maxCycles; } Recyclable(Supplier<T> supplier, long maxCycles); @Override T get(); }### Answer:
@Test public void testRecyclable() { long maxCycles = 1000; Recyclable<Ob... |
### Question:
BaseLogEventWriter implements LogEventWriter { @Override public void setPrintStream(PrintStream p) { if (p == null) { close(); return; } if (this.p == p) return; if (this.p != null) close(); this.p = p; } @Override void setPrintStream(PrintStream p); @Override synchronized void close(); @Override void wr... |
### Question:
FilterLogListener implements LogListener,Configurable { public synchronized void close() { if (p != null) { p.close(); p = null; } } FilterLogListener(); FilterLogListener(PrintStream p); @Override void setConfiguration(Configuration cfg); synchronized void setPrintStream(PrintStream p); synchronized voi... |
### Question:
FilterLogListener implements LogListener,Configurable { public String getPriority() { return priority; } FilterLogListener(); FilterLogListener(PrintStream p); @Override void setConfiguration(Configuration cfg); synchronized void setPrintStream(PrintStream p); synchronized void close(); String getPriorit... |
### Question:
FilterLogListener implements LogListener,Configurable { @Override public synchronized LogEvent log(LogEvent ev) { if (p != null && permitLogging(ev.getTag())) { Date d = new Date(); p.println( "<log realm=\"" + ev.getRealm() + "\" at=\"" + d.toString() + "." + d.getTime() % 1000 + "\">" ); ev.dump(p, " ")... |
### Question:
FilterLogListener implements LogListener,Configurable { public boolean permitLogging(String tagLevel) { Integer i = LEVELS.get(tagLevel); if (i == null) i = LEVELS.get(Log.INFO); Integer j = LEVELS.get(priority); return i >= j; } FilterLogListener(); FilterLogListener(PrintStream p); @Override void setCo... |
### Question:
FilterLogListener implements LogListener,Configurable { @Override public void setConfiguration (Configuration cfg) throws ConfigurationException { try { String log_priority = cfg.get("priority"); if ( log_priority != null && !log_priority.trim().equals("") && LEVELS.containsKey(log_priority) ) { priority ... |
### Question:
FilterLogListener implements LogListener,Configurable { public synchronized void setPrintStream(PrintStream p) { this.p = p; } FilterLogListener(); FilterLogListener(PrintStream p); @Override void setConfiguration(Configuration cfg); synchronized void setPrintStream(PrintStream p); synchronized void clos... |
### Question:
FilterLogListener implements LogListener,Configurable { public void setPriority(String priority) { this.priority = priority; } FilterLogListener(); FilterLogListener(PrintStream p); @Override void setConfiguration(Configuration cfg); synchronized void setPrintStream(PrintStream p); synchronized void clos... |
### Question:
FSDMsg implements Loggeable, Cloneable { public void copy (String fieldName, FSDMsg msg) { fields.put (fieldName, msg.get (fieldName)); } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void setSeparator(... |
### Question:
FSDMsg implements Loggeable, Cloneable { @Override public void dump (PrintStream p, String indent) { String inner = indent + " "; p.println (indent + "<fsdmsg schema='" + basePath + baseSchema + "'>"); if (header != null) { append (p, "header", getHexHeader(), inner); } for (String f :fields.keySet()) app... |
### Question:
FSDMsg implements Loggeable, Cloneable { public byte[] getHeader () { return header; } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void setSeparator(String separatorName, char separator); void unsetSe... |
### Question:
FSDMsg implements Loggeable, Cloneable { public byte[] getHexBytes (String name) { String s = get (name); return s == null ? null : ISOUtil.hex2byte (s); } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); ... |
### Question:
FSDMsg implements Loggeable, Cloneable { public String getHexHeader () { return header != null ? ISOUtil.hexString (header).substring (2) : ""; } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void setSe... |
### Question:
FSDMsg implements Loggeable, Cloneable { @SuppressWarnings("PMD.EmptyCatchBlock") public int getInt (String name) { int i = 0; try { i = Integer.parseInt (get (name)); } catch (Exception ignored) { } return i; } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); St... |
### Question:
FSDMsg implements Loggeable, Cloneable { public Map getMap () { return fields; } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void setSeparator(String separatorName, char separator); void unsetSeparato... |
### Question:
FSDMsg implements Loggeable, Cloneable { protected Element getSchema () throws JDOMException, IOException { return getSchema (baseSchema); } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void setSeparat... |
### Question:
FSDMsg implements Loggeable, Cloneable { public boolean hasField(String fieldName) { return fields.containsKey(fieldName); } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void setSeparator(String separa... |
### Question:
FSDMsg implements Loggeable, Cloneable { public String pack () throws JDOMException, IOException, ISOException { StringBuilder sb = new StringBuilder (); pack (getSchema (baseSchema), sb); return sb.toString (); } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); ... |
### Question:
FSDMsg implements Loggeable, Cloneable { public void set (String name, String value) { if (value != null) fields.put (name, value); else fields.remove (name); } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset chars... |
### Question:
FSDMsg implements Loggeable, Cloneable { public void setHeader (byte[] h) { this.header = h; } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void setSeparator(String separatorName, char separator); void... |
### Question:
FSDMsg implements Loggeable, Cloneable { public void setSeparator(String separatorName, char separator) { separators.put(separatorName, separator); } FSDMsg(String basePath); FSDMsg(String basePath, String baseSchema); String getBasePath(); String getBaseSchema(); void setCharset(Charset charset); void s... |
### Question:
FSDMsg implements Loggeable, Cloneable { public Element toXML () { Element e = new Element ("message"); if (header != null) { e.addContent ( new Element ("header") .setText (getHexHeader ()) ); } for (String fieldName :fields.keySet()) { Element inner = new Element (fieldName); inner.addContent (ISOUtil.n... |
### Question:
FSDMsg implements Loggeable, Cloneable { public void unsetSeparator(String separatorName) { if (!separators.containsKey(separatorName)) throw new IllegalArgumentException("unsetSeparator was attempted for "+ separatorName+" which was not previously defined."); separators.remove(separatorName); } FSDMsg(St... |
### Question:
NameRegistrar implements Loggeable { public static NameRegistrar getInstance() { return instance; } private NameRegistrar(); static TSpace<String, Object> getSpace(); static Map<String,Object> getAsMap(); static NameRegistrar getInstance(); static void register(String key, Object value); static void unre... |
### Question:
NameRegistrar implements Loggeable { public static <T> T get(String key) throws NotFoundException { @SuppressWarnings("unchecked") T obj = (T) sp.rdp(key); if (obj == null) { throw new NotFoundException(key); } return obj; } private NameRegistrar(); static TSpace<String, Object> getSpace(); static Map<St... |
### Question:
NameRegistrar implements Loggeable { public static <T> T getIfExists(String key) { @SuppressWarnings("unchecked") T obj = (T) sp.rdp(key); return obj; } private NameRegistrar(); static TSpace<String, Object> getSpace(); static Map<String,Object> getAsMap(); static NameRegistrar getInstance(); static void... |
### Question:
NameRegistrar implements Loggeable { public static void unregister(String key) { SpaceUtil.wipe(sp, key); } private NameRegistrar(); static TSpace<String, Object> getSpace(); static Map<String,Object> getAsMap(); static NameRegistrar getInstance(); static void register(String key, Object value); static v... |
### Question:
RemoveNewLinesMapper implements ByteArrayMapper, Configurable { @Override public void setConfiguration(Configuration cfg) throws ConfigurationException { combineSpaces = cfg.getBoolean("combine-spaces", false); newLineAtEnd = cfg.getBoolean("newline-at-end", true); } @Override byte[] apply(byte[] bytes);... |
### Question:
DefaultTimer { public static Timer getTimer() { if (defaultTimer == null) { synchronized (DefaultTimer.class) { if (defaultTimer == null) defaultTimer = new Timer(true); } } return defaultTimer; } private DefaultTimer(); static Timer getTimer(); }### Answer:
@Test public void testGetTimer() throws Throw... |
### Question:
DailyLogListener extends RotateLogListener { protected void closeCompressedOutputStream(OutputStream os) throws IOException{ if (os instanceof DeflaterOutputStream) ((DeflaterOutputStream)os).finish(); os.close(); } DailyLogListener(); void setConfiguration(Configuration cfg); void deleteOldLogs(); String... |
### Question:
DailyLogListener extends RotateLogListener { protected void compress(File logFile) { if (getCompressionFormat() != NONE){ Thread t = getCompressorThread(logFile); try{ if (t != null) t.start(); } catch (Exception e){ logDebugEx("error compressing file",e); } } } DailyLogListener(); void setConfiguration(C... |
### Question:
DailyLogListener extends RotateLogListener { protected OutputStream getCompressedOutputStream(File f) throws IOException{ OutputStream os = new BufferedOutputStream(new FileOutputStream(f)); if (getCompressionFormat() == ZIP) { ZipOutputStream ret = new ZipOutputStream(os); ret.putNextEntry(new ZipEntry(l... |
### Question:
DailyLogListener extends RotateLogListener { protected Thread getCompressorThread(File f){ return new Thread(new Compressor(f),"DailyLogListener-Compressor"); } DailyLogListener(); void setConfiguration(Configuration cfg); void deleteOldLogs(); String getSuffix(); void setSuffix(String suffix); String get... |
### Question:
DailyLogListener extends RotateLogListener { protected void logDebugEx(String msg, Throwable e){ ByteArrayOutputStream os = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(os); ps.println(msg); e.printStackTrace(ps); ps.close(); logDebug(os.toString()); } DailyLogListener(); void setConfigur... |
### Question:
DailyLogListener extends RotateLogListener { public void setCompressedSuffix(String compressedSuffix) { this.compressedSuffix = compressedSuffix; } DailyLogListener(); void setConfiguration(Configuration cfg); void deleteOldLogs(); String getSuffix(); void setSuffix(String suffix); String getPrefix(); voi... |
### Question:
DailyLogListener extends RotateLogListener { public void setCompressionBufferSize(int compressionBufferSize) { this.compressionBufferSize = compressionBufferSize >= 0 ? compressionBufferSize : DEF_BUFFER_SIZE; } DailyLogListener(); void setConfiguration(Configuration cfg); void deleteOldLogs(); String get... |
### Question:
DailyLogListener extends RotateLogListener { public void setCompressionFormat(int compressionFormat) { this.compressionFormat = compressionFormat; } DailyLogListener(); void setConfiguration(Configuration cfg); void deleteOldLogs(); String getSuffix(); void setSuffix(String suffix); String getPrefix(); vo... |
### Question:
DailyLogListener extends RotateLogListener { public void setDateFmt(DateFormat dateFmt) { this.dateFmt = dateFmt; } DailyLogListener(); void setConfiguration(Configuration cfg); void deleteOldLogs(); String getSuffix(); void setSuffix(String suffix); String getPrefix(); void setPrefix(String prefix); int ... |
### Question:
DailyLogListener extends RotateLogListener { public void setLastDate(String lastDate) { this.lastDate = lastDate; } DailyLogListener(); void setConfiguration(Configuration cfg); void deleteOldLogs(); String getSuffix(); void setSuffix(String suffix); String getPrefix(); void setPrefix(String prefix); int ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.