_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q179400 | ThrowableHandler.add | test | public static void add(int type, Throwable t) {
// don't add null throwables
if (t == null) return;
try {
fireOnThrowable(type, t);
}
catch (Throwable bad) {
// don't let these propagate, that could introduce unwanted side-effects
System.err.println("Unable to h... | java | {
"resource": ""
} |
q179401 | LazyList.createImplementation | test | private List<T> createImplementation()
{
if (delegate instanceof ArrayList == false)
return new ArrayList<T>(delegate);
return delegate;
} | java | {
"resource": ""
} |
q179402 | TimerTask.compareTo | test | public int compareTo(Object other)
{
if (other == this) return 0;
TimerTask t = (TimerTask) other;
long diff = getNextExecutionTime() - t.getNextExecutionTime();
return (int) diff;
} | java | {
"resource": ""
} |
q179403 | InetAddressEditor.getValue | test | public Object getValue()
{
try
{
String text = getAsText();
if (text == null)
{
return null;
}
if (text.startsWith("/"))
{
// seems like localhost sometimes will look like:
// /127.0.0.1 and the getByNames barfs on ... | java | {
"resource": ""
} |
q179404 | CachedList.getObject | test | private Object getObject(final int index) {
Object obj = list.get(index);
return Objects.deref(obj);
} | java | {
"resource": ""
} |
q179405 | CachedList.set | test | public Object set(final int index, final Object obj) {
maintain();
SoftObject soft = SoftObject.create(obj, queue);
soft = (SoftObject)list.set(index, soft);
return Objects.deref(soft);
} | java | {
"resource": ""
} |
q179406 | CachedList.maintain | test | private void maintain() {
SoftObject obj;
int count = 0;
while ((obj = (SoftObject)queue.poll()) != null) {
count++;
list.remove(obj);
}
if (count != 0) {
// some temporary debugging fluff
System.err.println("vm reclaimed " + count + " objects");
... | java | {
"resource": ""
} |
q179407 | CatalogEntry.addEntryType | test | public static int addEntryType(String name, int numArgs) {
entryTypes.put(name, new Integer(nextEntry));
entryArgs.add(nextEntry, new Integer(numArgs));
nextEntry++;
return nextEntry-1;
} | java | {
"resource": ""
} |
q179408 | CatalogEntry.getEntryType | test | public static int getEntryType(String name)
throws CatalogException {
if (!entryTypes.containsKey(name)) {
throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE);
}
Integer iType = (Integer) entryTypes.get(name);
if (iType == null) {
throw new CatalogException(CatalogException... | java | {
"resource": ""
} |
q179409 | CatalogEntry.getEntryArgCount | test | public static int getEntryArgCount(int type)
throws CatalogException {
try {
Integer iArgs = (Integer) entryArgs.get(type);
return iArgs.intValue();
} catch (ArrayIndexOutOfBoundsException e) {
throw new CatalogException(CatalogException.INVALID_ENTRY_TYPE);
}
} | java | {
"resource": ""
} |
q179410 | CatalogEntry.getEntryArg | test | public String getEntryArg(int argNum) {
try {
String arg = (String) args.get(argNum);
return arg;
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
} | java | {
"resource": ""
} |
q179411 | ContextClassLoaderSwitcher.setContextClassLoader | test | public void setContextClassLoader(final Thread thread, final ClassLoader cl)
{
AccessController.doPrivileged(new PrivilegedAction()
{
public Object run()
{
thread.setContextClassLoader(cl);
return null;
}
});
} | java | {
"resource": ""
} |
q179412 | TimeoutPriorityQueueImpl.swap | test | private void swap(int a, int b)
{
// INV: assertExpr(a > 0);
// INV: assertExpr(a <= size);
// INV: assertExpr(b > 0);
// INV: assertExpr(b <= size);
// INV: assertExpr(queue[a] != null);
// INV: assertExpr(queue[b] != null);
// INV: assertExpr(queue[a].index == a);
//... | java | {
"resource": ""
} |
q179413 | TimeoutPriorityQueueImpl.removeNode | test | private TimeoutExtImpl removeNode(int index)
{
// INV: assertExpr(index > 0);
// INV: assertExpr(index <= size);
TimeoutExtImpl res = queue[index];
// INV: assertExpr(res != null);
// INV: assertExpr(res.index == index);
if (index == size)
{
--size;
queue[i... | java | {
"resource": ""
} |
q179414 | TimeoutPriorityQueueImpl.cleanupTimeoutExtImpl | test | private TimeoutExtImpl cleanupTimeoutExtImpl(TimeoutExtImpl timeout)
{
if (timeout != null)
timeout.target = null;
return null;
} | java | {
"resource": ""
} |
q179415 | DelegatingClassLoader.loadClass | test | protected Class<?> loadClass(String className, boolean resolve)
throws ClassNotFoundException
{
// Revert to standard rules
if (standard)
return super.loadClass(className, resolve);
// Ask the parent
Class<?> clazz = null;
try
{
clazz = parent.loadClass(cl... | java | {
"resource": ""
} |
q179416 | URLStreamHandlerFactory.preload | test | @SuppressWarnings("unused")
public static void preload()
{
for (int i = 0; i < PROTOCOLS.length; i ++)
{
try
{
URL url = new URL(PROTOCOLS[i], "", -1, "");
log.trace("Loaded protocol: " + PROTOCOLS[i]);
}
catch (Exception e)
{
... | java | {
"resource": ""
} |
q179417 | URLStreamHandlerFactory.createURLStreamHandler | test | public URLStreamHandler createURLStreamHandler(final String protocol)
{
// Check the handler map
URLStreamHandler handler = (URLStreamHandler) handlerMap.get(protocol);
if( handler != null )
return handler;
// Validate that createURLStreamHandler is not recursing
String prevPr... | java | {
"resource": ""
} |
q179418 | URLStreamHandlerFactory.checkHandlerPkgs | test | private synchronized void checkHandlerPkgs()
{
String handlerPkgsProp = System.getProperty("java.protocol.handler.pkgs");
if( handlerPkgsProp != null && handlerPkgsProp.equals(lastHandlerPkgs) == false )
{
// Update the handlerPkgs[] from the handlerPkgsProp
StringTokenizer tokeni... | java | {
"resource": ""
} |
q179419 | ClassEditor.getValue | test | public Object getValue()
{
try
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
String classname = getAsText();
Class<?> type = loader.loadClass(classname);
return type;
}
catch (Exception e)
{
throw new NestedRuntimeEx... | java | {
"resource": ""
} |
q179420 | LazySet.createImplementation | test | private Set<T> createImplementation()
{
if (delegate instanceof HashSet == false)
return new HashSet<T>(delegate);
return delegate;
} | java | {
"resource": ""
} |
q179421 | LongCounter.makeSynchronized | test | public static LongCounter makeSynchronized(final LongCounter counter)
{
return new Wrapper(counter) {
/** The serialVersionUID */
private static final long serialVersionUID = 8903330696503363758L;
public synchronized long increment() {
return this.counter.increment(... | java | {
"resource": ""
} |
q179422 | LongCounter.makeDirectional | test | public static LongCounter makeDirectional(final LongCounter counter,
final boolean increasing)
{
LongCounter temp;
if (increasing) {
temp = new Wrapper(counter) {
/** The serialVersionUID */
private static final long serialVers... | java | {
"resource": ""
} |
q179423 | OASISXMLCatalogReader.inExtensionNamespace | test | protected boolean inExtensionNamespace() {
boolean inExtension = false;
Enumeration elements = namespaceStack.elements();
while (!inExtension && elements.hasMoreElements()) {
String ns = (String) elements.nextElement();
if (ns == null) {
inExtension = true;
} else {
inExtension = (!ns.e... | java | {
"resource": ""
} |
q179424 | NotifyingBufferedOutputStream.checkNotification | test | public void checkNotification(int result)
{
// Is a notification required?
chunk += result;
if (chunk >= chunkSize)
{
if (listener != null)
listener.onStreamNotification(this, chunk);
// Start a new chunk
chunk = 0;
}
} | java | {
"resource": ""
} |
q179425 | NonSerializableFactory.rebind | test | public static synchronized void rebind(Name name, Object target, boolean createSubcontexts) throws NamingException
{
String key = name.toString();
InitialContext ctx = new InitialContext();
if (createSubcontexts == true && name.size() > 1)
{
int size = name.size() - 1;
Util.... | java | {
"resource": ""
} |
q179426 | NonSerializableFactory.getObjectInstance | test | public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable env)
throws Exception
{ // Get the nns value from the Reference obj and use it as the map key
Reference ref = (Reference) obj;
RefAddr addr = ref.get("nns");
String key = (String) addr.getContent();
... | java | {
"resource": ""
} |
q179427 | Strings.subst | test | public static String subst(final StringBuffer buff, final String string,
final Map map, final String beginToken,
final String endToken)
{
int begin = 0, rangeEnd = 0;
Range range;
while ((range = rangeOf(beginToken, endToken, string, rangeEnd)) != null)
{
// append the f... | java | {
"resource": ""
} |
q179428 | Strings.split | test | public static String[] split(final String string, final String delim,
final int limit)
{
// get the count of delim in string, if count is > limit
// then use limit for count. The number of delimiters is less by one
// than the number of elements, so add one to count.
int count = count... | java | {
"resource": ""
} |
q179429 | Strings.join | test | public static String join(final byte array[])
{
Byte bytes[] = new Byte[array.length];
for (int i = 0; i < bytes.length; i++)
{
bytes[i] = new Byte(array[i]);
}
return join(bytes, null);
} | java | {
"resource": ""
} |
q179430 | Strings.defaultToString | test | public static final void defaultToString(JBossStringBuilder buffer, Object object)
{
if (object == null)
buffer.append("null");
else
{
buffer.append(object.getClass().getName());
buffer.append('@');
buffer.append(Integer.toHexString(System.identityHashCode(object... | java | {
"resource": ""
} |
q179431 | BlockingModeEditor.getValue | test | public Object getValue()
{
String text = getAsText();
BlockingMode mode = BlockingMode.toBlockingMode(text);
return mode;
} | java | {
"resource": ""
} |
q179432 | TimedCachePolicy.create | test | public void create()
{
if( threadSafe )
entryMap = Collections.synchronizedMap(new HashMap());
else
entryMap = new HashMap();
now = System.currentTimeMillis();
} | java | {
"resource": ""
} |
q179433 | TimedCachePolicy.get | test | public Object get(Object key)
{
TimedEntry entry = (TimedEntry) entryMap.get(key);
if( entry == null )
return null;
if( entry.isCurrent(now) == false )
{ // Try to refresh the entry
if( entry.refresh() == false )
{ // Failed, remove the entry and return null
... | java | {
"resource": ""
} |
q179434 | TimedCachePolicy.peek | test | public Object peek(Object key)
{
TimedEntry entry = (TimedEntry) entryMap.get(key);
Object value = null;
if( entry != null )
value = entry.getValue();
return value;
} | java | {
"resource": ""
} |
q179435 | TimedCachePolicy.remove | test | public void remove(Object key)
{
TimedEntry entry = (TimedEntry) entryMap.remove(key);
if( entry != null )
entry.destroy();
} | java | {
"resource": ""
} |
q179436 | TimedCachePolicy.flush | test | public void flush()
{
Map tmpMap = null;
synchronized( this )
{
tmpMap = entryMap;
if( threadSafe )
entryMap = Collections.synchronizedMap(new HashMap());
else
entryMap = new HashMap();
}
// Notify the entries of their removal
I... | java | {
"resource": ""
} |
q179437 | TimedCachePolicy.getValidKeys | test | public List getValidKeys()
{
ArrayList validKeys = new ArrayList();
synchronized( entryMap )
{
Iterator iter = entryMap.entrySet().iterator();
while( iter.hasNext() )
{
Map.Entry entry = (Map.Entry) iter.next();
TimedEntry value = (TimedEntry) entr... | java | {
"resource": ""
} |
q179438 | TimedCachePolicy.setResolution | test | public synchronized void setResolution(int resolution)
{
if( resolution <= 0 )
resolution = 60;
if( resolution != this.resolution )
{
this.resolution = resolution;
theTimer.cancel();
theTimer = new ResolutionTimer();
resolutionTimer.scheduleAtFixedRate(t... | java | {
"resource": ""
} |
q179439 | TimedCachePolicy.peekEntry | test | public TimedEntry peekEntry(Object key)
{
TimedEntry entry = (TimedEntry) entryMap.get(key);
return entry;
} | java | {
"resource": ""
} |
q179440 | XmlHelper.getChildrenByTagName | test | public static Iterator getChildrenByTagName(Element element,
String tagName)
{
if (element == null) return null;
// getElementsByTagName gives the corresponding elements in the whole
// descendance. We want only children
NodeList children = ele... | java | {
"resource": ""
} |
q179441 | XmlHelper.getUniqueChild | test | public static Element getUniqueChild(Element element, String tagName)
throws Exception
{
Iterator goodChildren = getChildrenByTagName(element, tagName);
if (goodChildren != null && goodChildren.hasNext()) {
Element child = (Element)goodChildren.next();
if (goodChildren.hasNext())... | java | {
"resource": ""
} |
q179442 | XmlHelper.getOptionalChild | test | public static Element getOptionalChild(Element element, String tagName)
throws Exception
{
return getOptionalChild(element, tagName, null);
} | java | {
"resource": ""
} |
q179443 | XmlHelper.getElementContent | test | public static String getElementContent(Element element, String defaultStr)
throws Exception
{
if (element == null)
return defaultStr;
NodeList children = element.getChildNodes();
String result = "";
for (int i = 0; i < children.getLength(); i++)
{
if (children.i... | java | {
"resource": ""
} |
q179444 | XmlHelper.getUniqueChildContent | test | public static String getUniqueChildContent(Element element,
String tagName)
throws Exception
{
return getElementContent(getUniqueChild(element, tagName));
} | java | {
"resource": ""
} |
q179445 | XmlHelper.getOptionalChildContent | test | public static String getOptionalChildContent(Element element,
String tagName)
throws Exception
{
return getElementContent(getOptionalChild(element, tagName));
} | java | {
"resource": ""
} |
q179446 | BasicThreadPool.setMaximumQueueSize | test | public void setMaximumQueueSize(int size)
{
// Reset the executor work queue
ArrayList tmp = new ArrayList();
queue.drainTo(tmp);
queue = new LinkedBlockingQueue(size);
queue.addAll(tmp);
ThreadFactory tf = executor.getThreadFactory();
RejectedExecutionHandler handler = exe... | java | {
"resource": ""
} |
q179447 | BasicThreadPool.setBlockingMode | test | public void setBlockingMode(String name)
{
blockingMode = BlockingMode.toBlockingMode(name);
if( blockingMode == null )
blockingMode = BlockingMode.ABORT;
} | java | {
"resource": ""
} |
q179448 | BasicThreadPool.setBlockingModeString | test | public void setBlockingModeString(String name)
{
blockingMode = BlockingMode.toBlockingMode(name);
if( blockingMode == null )
blockingMode = BlockingMode.ABORT;
} | java | {
"resource": ""
} |
q179449 | BasicThreadPool.execute | test | protected void execute(TaskWrapper wrapper)
{
if( trace )
log.trace("execute, wrapper="+wrapper);
try
{
executor.execute(wrapper);
}
catch (Throwable t)
{
wrapper.rejectTask(new ThreadPoolFullException("Error scheduling work: " + wrapper, t));
}
... | java | {
"resource": ""
} |
q179450 | Resolver.resolveSystem | test | public String resolveSystem(String systemId)
throws MalformedURLException, IOException {
String resolved = super.resolveSystem(systemId);
if (resolved != null) {
return resolved;
}
Enumeration enumt = catalogEntries.elements();
while (enumt.hasMoreElements()) {
CatalogEntry e = (Ca... | java | {
"resource": ""
} |
q179451 | Resolver.resolvePublic | test | public String resolvePublic(String publicId, String systemId)
throws MalformedURLException, IOException {
String resolved = super.resolvePublic(publicId, systemId);
if (resolved != null) {
return resolved;
}
Enumeration enumt = catalogEntries.elements();
while (enumt.hasMoreElements()) ... | java | {
"resource": ""
} |
q179452 | Resolver.resolveExternalSystem | test | protected String resolveExternalSystem(String systemId, String resolver)
throws MalformedURLException, IOException {
Resolver r = queryResolver(resolver, "i2l", systemId, null);
if (r != null) {
return r.resolveSystem(systemId);
} else {
return null;
}
} | java | {
"resource": ""
} |
q179453 | Resolver.resolveExternalPublic | test | protected String resolveExternalPublic(String publicId, String resolver)
throws MalformedURLException, IOException {
Resolver r = queryResolver(resolver, "fpi2l", publicId, null);
if (r != null) {
return r.resolvePublic(publicId, null);
} else {
return null;
}
} | java | {
"resource": ""
} |
q179454 | Resolver.queryResolver | test | protected Resolver queryResolver(String resolver,
String command,
String arg1,
String arg2) {
String RFC2483 = resolver + "?command=" + command
+ "&format=tr9401&uri=" + arg1
+ "&uri2=" + arg2;
try {
URL url = new URL(RFC2483);
URLConnection urlCon = url.openConnecti... | java | {
"resource": ""
} |
q179455 | Resolver.appendVector | test | private Vector appendVector(Vector vec, Vector appvec) {
if (appvec != null) {
for (int count = 0; count < appvec.size(); count++) {
vec.addElement(appvec.elementAt(count));
}
}
return vec;
} | java | {
"resource": ""
} |
q179456 | Resolver.resolveAllSystemReverse | test | public Vector resolveAllSystemReverse(String systemId)
throws MalformedURLException, IOException {
Vector resolved = new Vector();
// If there's a SYSTEM entry in this catalog, use it
if (systemId != null) {
Vector localResolved = resolveLocalSystemReverse(systemId);
resolved = appendVector(resolved, loc... | java | {
"resource": ""
} |
q179457 | Resolver.resolveSystemReverse | test | public String resolveSystemReverse(String systemId)
throws MalformedURLException, IOException {
Vector resolved = resolveAllSystemReverse(systemId);
if (resolved != null && resolved.size() > 0) {
return (String) resolved.elementAt(0);
} else {
return null;
}
} | java | {
"resource": ""
} |
q179458 | Resolver.resolveAllSystem | test | public Vector resolveAllSystem(String systemId)
throws MalformedURLException, IOException {
Vector resolutions = new Vector();
// If there are SYSTEM entries in this catalog, start with them
if (systemId != null) {
Vector localResolutions = resolveAllLocalSystem(systemId);
resolutions = appendVector(reso... | java | {
"resource": ""
} |
q179459 | Resolver.resolveAllLocalSystem | test | private Vector resolveAllLocalSystem(String systemId) {
Vector map = new Vector();
String osname = System.getProperty("os.name");
boolean windows = (osname.indexOf("Windows") >= 0);
Enumeration enumt = catalogEntries.elements();
while (enumt.hasMoreElements()) {
CatalogEntry e = (CatalogEntry) enumt.nextEleme... | java | {
"resource": ""
} |
q179460 | Resolver.resolveAllSubordinateCatalogs | test | private synchronized Vector resolveAllSubordinateCatalogs(int entityType,
String entityName,
String publicId,
String systemId)
throws MalformedURLException, IOException {
Vector resolutions = new Vector();
for (int catPos = 0; catPos < catalogs.size(); catPos++) {
Resolver c =... | java | {
"resource": ""
} |
q179461 | SAXCatalogReader.readCatalog | test | public void readCatalog(Catalog catalog, String fileUrl)
throws MalformedURLException, IOException,
CatalogException {
URL url = null;
try {
url = new URL(fileUrl);
} catch (MalformedURLException e) {
url = new URL("file:///" + fileUrl);
}
debug = catalog.getCatalogManager().d... | java | {
"resource": ""
} |
q179462 | SAXCatalogReader.readCatalog | test | public void readCatalog(Catalog catalog, InputStream is)
throws IOException, CatalogException {
// Create an instance of the parser
if (parserFactory == null && parserClass == null) {
debug.message(1, "Cannot read SAX catalog without a parser");
throw new CatalogException(CatalogException.UNPA... | java | {
"resource": ""
} |
q179463 | FileURLConnection.connect | test | public void connect() throws IOException
{
if (connected)
return;
if (!file.exists())
{
throw new FileNotFoundException(file.getPath());
}
connected = true;
} | java | {
"resource": ""
} |
q179464 | FileURLConnection.getOutputStream | test | public OutputStream getOutputStream() throws IOException
{
connect();
SecurityManager sm = System.getSecurityManager();
if (sm != null)
{
// Check for write access
FilePermission p = new FilePermission(file.getPath(), "write");
sm.checkPermission(p);
}
... | java | {
"resource": ""
} |
q179465 | Node.casNext | test | boolean casNext(Node<K,V> cmp, Node<K,V> val) {
return nextUpdater.compareAndSet(this, cmp, val);
} | java | {
"resource": ""
} |
q179466 | Node.helpDelete | test | void helpDelete(Node<K,V> b, Node<K,V> f) {
/*
* Rechecking links and then doing only one of the
* help-out stages per call tends to minimize CAS
* interference among helping threads.
*/
if (f == next && this == b.next) {
if (f ... | java | {
"resource": ""
} |
q179467 | Node.getValidValue | test | V getValidValue() {
Object v = value;
if (v == this || v == BASE_HEADER)
return null;
return (V)v;
} | java | {
"resource": ""
} |
q179468 | Node.createSnapshot | test | SnapshotEntry<K,V> createSnapshot() {
V v = getValidValue();
if (v == null)
return null;
return new SnapshotEntry(key, v);
} | java | {
"resource": ""
} |
q179469 | Index.casRight | test | final boolean casRight(Index<K,V> cmp, Index<K,V> val) {
return rightUpdater.compareAndSet(this, cmp, val);
} | java | {
"resource": ""
} |
q179470 | JBossObject.createLog | test | private Logger createLog()
{
Class<?> clazz = getClass();
Logger logger = loggers.get(clazz);
if (logger == null)
{
logger = Logger.getLogger(clazz);
loggers.put(clazz, logger);
}
return logger;
} | java | {
"resource": ""
} |
q179471 | JBossObject.list | test | public static void list(JBossStringBuilder buffer, Collection objects)
{
if (objects == null)
return;
buffer.append('[');
if (objects.isEmpty() == false)
{
for (Iterator i = objects.iterator(); i.hasNext();)
{
Object object = i.next();
if (o... | java | {
"resource": ""
} |
q179472 | JBossObject.getClassShortName | test | public String getClassShortName()
{
String longName = getClass().getName();
int dot = longName.lastIndexOf('.');
if (dot != -1)
return longName.substring(dot + 1);
return longName;
} | java | {
"resource": ""
} |
q179473 | JBossObject.toStringImplementation | test | protected String toStringImplementation()
{
JBossStringBuilder buffer = new JBossStringBuilder();
buffer.append(getClassShortName()).append('@');
buffer.append(Integer.toHexString(System.identityHashCode(this)));
buffer.append('{');
toString(buffer);
buffer.append('}');
retu... | java | {
"resource": ""
} |
q179474 | PropertyManager.names | test | public static Iterator names()
{
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkPropertiesAccess();
return props.names();
} | java | {
"resource": ""
} |
q179475 | PropertyManager.getPropertyGroup | test | public static PropertyGroup getPropertyGroup(final String basename)
{
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkPropertiesAccess();
return props.getPropertyGroup(basename);
} | java | {
"resource": ""
} |
q179476 | Objects.getCompatibleConstructor | test | public static Constructor getCompatibleConstructor(final Class type,
final Class valueType)
{
// first try and find a constructor with the exact argument type
try {
return type.getConstructor(new Class[] { valueType });
}
catch (E... | java | {
"resource": ""
} |
q179477 | Objects.copy | test | public static Object copy(final Serializable obj)
throws IOException, ClassNotFoundException
{
ObjectOutputStream out = null;
ObjectInputStream in = null;
Object copy = null;
try {
// write the object
ByteArrayOutputStream baos = new ByteArrayOutputStream();
... | java | {
"resource": ""
} |
q179478 | Objects.deref | test | public static <T> T deref(final Object obj, Class<T> expected)
{
Object result = deref(obj);
if (result == null)
return null;
return expected.cast(result);
} | java | {
"resource": ""
} |
q179479 | PropertyMap.init | test | private void init()
{
unboundListeners = Collections.synchronizedList(new ArrayList());
boundListeners = Collections.synchronizedMap(new HashMap());
jndiMap = new HashMap();
PrivilegedAction action = new PrivilegedAction()
{
public Object run()
{
Object va... | java | {
"resource": ""
} |
q179480 | PropertyMap.updateJndiCache | test | private void updateJndiCache(String name, String value)
{
if( name == null )
return;
boolean isJndiProperty = name.equals(Context.PROVIDER_URL)
|| name.equals(Context.INITIAL_CONTEXT_FACTORY)
|| name.equals(Context.OBJECT_FACTORIES)
|| name.equals(Context.URL_PKG_PREF... | java | {
"resource": ""
} |
q179481 | PropertyMap.keySet | test | public Set keySet(final boolean includeDefaults)
{
if (includeDefaults)
{
Set set = new HashSet();
set.addAll(defaults.keySet());
set.addAll(super.keySet());
return Collections.synchronizedSet(set);
}
return super.keySet();
} | java | {
"resource": ""
} |
q179482 | PropertyMap.entrySet | test | public Set entrySet(final boolean includeDefaults)
{
if (includeDefaults)
{
Set set = new HashSet();
set.addAll(defaults.entrySet());
set.addAll(super.entrySet());
return Collections.synchronizedSet(set);
}
return super.entrySet();
} | java | {
"resource": ""
} |
q179483 | PropertyMap.removePropertyListener | test | public boolean removePropertyListener(PropertyListener listener)
{
if (listener == null)
throw new NullArgumentException("listener");
boolean removed = false;
if (listener instanceof BoundPropertyListener)
{
removed = removePropertyListener((BoundPropertyListener) listener)... | java | {
"resource": ""
} |
q179484 | PropertyMap.firePropertyAdded | test | private void firePropertyAdded(List list, PropertyEvent event)
{
if (list == null) return;
int size = list.size();
for (int i = 0; i < size; i++)
{
PropertyListener listener = (PropertyListener) list.get(i);
listener.propertyAdded(event);
}
} | java | {
"resource": ""
} |
q179485 | PropertyMap.firePropertyRemoved | test | private void firePropertyRemoved(List list, PropertyEvent event)
{
if (list == null) return;
int size = list.size();
for (int i = 0; i < size; i++)
{
PropertyListener listener = (PropertyListener) list.get(i);
listener.propertyRemoved(event);
}
} | java | {
"resource": ""
} |
q179486 | PropertyMap.firePropertyChanged | test | private void firePropertyChanged(List list, PropertyEvent event)
{
if (list == null) return;
int size = list.size();
for (int i = 0; i < size; i++)
{
PropertyListener listener = (PropertyListener) list.get(i);
listener.propertyChanged(event);
}
} | java | {
"resource": ""
} |
q179487 | PropertyMap.firePropertyChanged | test | protected void firePropertyChanged(PropertyEvent event)
{
// fire all bound listeners (if any) first
if (boundListeners != null)
{
List list = (List) boundListeners.get(event.getPropertyName());
if (list != null)
{
firePropertyChanged(list, event);
}
... | java | {
"resource": ""
} |
q179488 | PropertyMap.makePrefixedPropertyName | test | protected String makePrefixedPropertyName(String base, String prefix)
{
String name = base;
if (prefix != null)
{
StringBuffer buff = new StringBuffer(base);
if (prefix != null)
{
buff.insert(0, PROPERTY_NAME_SEPARATOR);
buff.insert(0, prefix);
... | java | {
"resource": ""
} |
q179489 | PropertyMap.load | test | public void load(PropertyReader reader) throws PropertyException, IOException
{
if (reader == null)
throw new NullArgumentException("reader");
load(reader.readProperties());
} | java | {
"resource": ""
} |
q179490 | PropertyMap.load | test | public void load(String className) throws PropertyException, IOException
{
if (className == null)
throw new NullArgumentException("className");
PropertyReader reader = null;
try
{
Class type = Class.forName(className);
reader = (PropertyReader) type.newInstance();... | java | {
"resource": ""
} |
q179491 | PropertyMap.getPropertyGroup | test | public PropertyGroup getPropertyGroup(String basename, int index)
{
String name = makeIndexPropertyName(basename, index);
return getPropertyGroup(name);
} | java | {
"resource": ""
} |
q179492 | JBossEntityResolver.isEntityResolved | test | public boolean isEntityResolved()
{
Boolean value = entityResolved.get();
return value != null ? value.booleanValue() : false;
} | java | {
"resource": ""
} |
q179493 | JBossEntityResolver.resolveSystemID | test | protected InputSource resolveSystemID(String systemId, boolean trace)
{
if( systemId == null )
return null;
if( trace )
log.trace("resolveSystemID, systemId="+systemId);
InputSource inputSource = null;
// Try to resolve the systemId as an entity key
String filename ... | java | {
"resource": ""
} |
q179494 | JBossEntityResolver.resolveSystemIDasURL | test | protected InputSource resolveSystemIDasURL(String systemId, boolean trace)
{
if( systemId == null )
return null;
if( trace )
log.trace("resolveSystemIDasURL, systemId="+systemId);
InputSource inputSource = null;
// Try to use the systemId as a URL to the schema
try
{... | java | {
"resource": ""
} |
q179495 | JBossEntityResolver.resolveClasspathName | test | protected InputSource resolveClasspathName(String systemId, boolean trace)
{
if( systemId == null )
return null;
if( trace )
log.trace("resolveClasspathName, systemId="+systemId);
String filename = systemId;
// Parse the systemId as a uri to get the final path component
... | java | {
"resource": ""
} |
q179496 | ElementEditor.setAsText | test | public void setAsText(String text)
{
Document d = getAsDocument(text);
setValue(d.getDocumentElement());
} | java | {
"resource": ""
} |
q179497 | PublicId.normalize | test | public static String normalize(String publicId) {
String normal = publicId.replace('\t', ' ');
normal = normal.replace('\r', ' ');
normal = normal.replace('\n', ' ');
normal = normal.trim();
int pos;
while ((pos = normal.indexOf(" ")) >= 0) {
normal = normal.substring(0, pos) + normal.s... | java | {
"resource": ""
} |
q179498 | PublicId.encodeURN | test | public static String encodeURN(String publicId) {
String urn = PublicId.normalize(publicId);
urn = PublicId.stringReplace(urn, "%", "%25");
urn = PublicId.stringReplace(urn, ";", "%3B");
urn = PublicId.stringReplace(urn, "'", "%27");
urn = PublicId.stringReplace(urn, "?", "%3F");
urn = PublicId... | java | {
"resource": ""
} |
q179499 | PublicId.decodeURN | test | public static String decodeURN(String urn) {
String publicId = "";
if (urn.startsWith("urn:publicid:")) {
publicId = urn.substring(13);
} else {
return urn;
}
publicId = PublicId.stringReplace(publicId, "%2F", "/");
publicId = PublicId.stringReplace(publicId, ":", "//");
public... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.