_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q177000 | SpringActionInputParameter.isHidden | test | @Override
public boolean isHidden(String property) {
Annotation[] paramAnnotations = methodParameter.getParameterAnnotations();
Input inputAnnotation = methodParameter.getParameterAnnotation(Input.class);
return inputAnnotation != null && arrayContains(inputAnnotation.hidden(), property);
... | java | {
"resource": ""
} |
q177001 | SpringActionInputParameter.containsPropertyIncludeValue | test | private boolean containsPropertyIncludeValue(String property) {
return arrayContains(inputAnnotation.readOnly(), property)
|| arrayContains(inputAnnotation.hidden(), property)
|| arrayContains(inputAnnotation.include(), property);
} | java | {
"resource": ""
} |
q177002 | SpringActionInputParameter.hasExplicitOrImplicitPropertyIncludeValue | test | private boolean hasExplicitOrImplicitPropertyIncludeValue() {
// TODO maybe not a useful optimization
return inputAnnotation != null && inputAnnotation.readOnly().length > 0
|| inputAnnotation.hidden().length > 0
|| inputAnnotation.include().length > 0;
} | java | {
"resource": ""
} |
q177003 | SpringActionInputParameter.isRequired | test | public boolean isRequired() {
boolean ret;
if (isRequestBody()) {
ret = requestBody.required();
} else if (isRequestParam()) {
ret = !(isDefined(requestParam.defaultValue()) || !requestParam.required());
} else if (isRequestHeader()) {
ret = !(isDefine... | java | {
"resource": ""
} |
q177004 | SpringActionInputParameter.getDefaultValue | test | public String getDefaultValue() {
String ret;
if (isRequestParam()) {
ret = isDefined(requestParam.defaultValue()) ?
requestParam.defaultValue() : null;
} else if (isRequestHeader()) {
ret = !(ValueConstants.DEFAULT_NONE.equals(requestHeader.defaultVal... | java | {
"resource": ""
} |
q177005 | SpringActionInputParameter.getParameterName | test | @Override
public String getParameterName() {
String ret = null;
if (requestParam != null) {
String requestParamName = requestParam.value();
if (!requestParamName.isEmpty())
ret = requestParamName;
}
if (pathVariable != null) {
Strin... | java | {
"resource": ""
} |
q177006 | LinkListSerializer.getExposedPropertyOrParamName | test | private String getExposedPropertyOrParamName(ActionInputParameter inputParameter) {
final Expose expose = inputParameter.getAnnotation(Expose.class);
String property;
if (expose != null) {
property = expose.value();
} else {
property = inputParameter.getParameterN... | java | {
"resource": ""
} |
q177007 | LdContextFactory.getVocab | test | public String getVocab(MixinSource mixinSource, Object bean, Class<?> mixInClass) {
if (proxyUnwrapper != null) {
bean = proxyUnwrapper.unwrapProxy(bean);
}
// determine vocab in context
String classVocab = bean == null ? null : vocabFromClassOrPackage(bean.getClass());
... | java | {
"resource": ""
} |
q177008 | PartialUriTemplateComponents.getQuery | test | public String getQuery() {
StringBuilder query = new StringBuilder();
if (queryTail.length() > 0) {
if (queryHead.length() == 0) {
query.append("{?")
.append(queryTail)
.append("}");
} else if (queryHead.length() > 0... | java | {
"resource": ""
} |
q177009 | XhtmlWriter.appendForm | test | private void appendForm(Affordance affordance, ActionDescriptor actionDescriptor) throws IOException {
String formName = actionDescriptor.getActionName();
RequestMethod httpMethod = RequestMethod.valueOf(actionDescriptor.getHttpMethod());
// Link's expand method removes non-required variables f... | java | {
"resource": ""
} |
q177010 | XhtmlWriter.inputButton | test | private void inputButton(Type type, String value) throws IOException {
write("<input type=\"");
write(type.toString());
write("\" ");
write("value");
write("=");
quote();
write(value);
quote();
write("/>");
} | java | {
"resource": ""
} |
q177011 | XhtmlWriter.appendInputOrSelect | test | private void appendInputOrSelect(ActionInputParameter parentInputParameter, String paramName, ActionInputParameter
childInputParameter, Object[] possibleValues) throws IOException {
if (possibleValues.length > 0) {
if (childInputParameter.isArrayOrCollection()) {
// TODO ... | java | {
"resource": ""
} |
q177012 | AffordanceBuilder.and | test | public AffordanceBuilder and(AffordanceBuilder affordanceBuilder) {
for (ActionDescriptor actionDescriptor : affordanceBuilder.actionDescriptors) {
this.actionDescriptors.add(actionDescriptor);
}
return this;
} | java | {
"resource": ""
} |
q177013 | PartialUriTemplate.asComponents | test | public PartialUriTemplateComponents asComponents() {
return getUriTemplateComponents(Collections.<String, Object>emptyMap(), Collections.<String>emptyList());
} | java | {
"resource": ""
} |
q177014 | PartialUriTemplate.stripOptionalVariables | test | public PartialUriTemplateComponents stripOptionalVariables(List<ActionDescriptor> actionDescriptors) {
return getUriTemplateComponents(Collections.<String, Object>emptyMap(), getRequiredArgNames(actionDescriptors));
} | java | {
"resource": ""
} |
q177015 | AbstractUberNode.getFirstByName | test | public UberNode getFirstByName(String name) {
// TODO consider less naive impl
UberNode ret = null;
for (UberNode node : data) {
if (name.equals(node.getName())) {
ret = node;
break;
}
}
return ret;
} | java | {
"resource": ""
} |
q177016 | AbstractUberNode.getFirstByRel | test | public UberNode getFirstByRel(String rel) {
// TODO consider less naive impl
for (UberNode node : data) {
List<String> myRels = node.getRel();
if (myRels != null) {
for (String myRel : myRels) {
if (rel.equals(myRel)) {
... | java | {
"resource": ""
} |
q177017 | AbstractUberNode.iterator | test | @Override
public Iterator<UberNode> iterator() {
return new Iterator<UberNode>() {
int index = 0;
@Override
public void remove() {
throw new UnsupportedOperationException("removing from uber node is not supported");
}
@Override
... | java | {
"resource": ""
} |
q177018 | PersistentHashMap.ofEq | test | @SuppressWarnings("WeakerAccess")
public static <K,V> PersistentHashMap<K,V> ofEq(Equator<K> eq, Iterable<Map.Entry<K,V>> es) {
if (es == null) { return empty(eq); }
MutableHashMap<K,V> map = emptyMutable(eq);
for (Map.Entry<K,V> entry : es) {
if (entry != null) {
... | java | {
"resource": ""
} |
q177019 | PersistentTreeMap.of | test | public static <K extends Comparable<K>,V> PersistentTreeMap<K,V>
of(Iterable<Map.Entry<K,V>> es) {
if (es == null) { return empty(); }
PersistentTreeMap<K,V> map = new PersistentTreeMap<>(Equator.defaultComparator(), null, 0);
for (Map.Entry<K,V> entry : es) {
if (entry != null) ... | java | {
"resource": ""
} |
q177020 | PersistentTreeMap.empty | test | public static <K,V> PersistentTreeMap<K,V> empty(Comparator<? super K> c) {
return new PersistentTreeMap<>(c, null, 0);
} | java | {
"resource": ""
} |
q177021 | PersistentTreeMap.entrySet | test | @Override public ImSortedSet<Entry<K,V>> entrySet() {
// This is the pretty way to do it.
return this.fold(PersistentTreeSet.ofComp(new KeyComparator<>(comp)),
PersistentTreeSet::put);
} | java | {
"resource": ""
} |
q177022 | PersistentTreeMap.lastKey | test | @Override public K lastKey() {
UnEntry<K,V> max = last();
if (max == null) {
throw new NoSuchElementException("this map is empty");
}
return max.getKey();
} | java | {
"resource": ""
} |
q177023 | Xform.of | test | public static <T> Xform<T> of(Iterable<? extends T> list) {
if (list == null) { return empty(); }
return new SourceProviderIterableDesc<>(list);
} | java | {
"resource": ""
} |
q177024 | Xform._fold | test | @SuppressWarnings("unchecked")
private static <H> H _fold(Iterable source, Operation[] ops, int opIdx, H ident, Fn2 reducer) {
Object ret = ident;
// This is a label - the first one I have used in Java in years, or maybe ever.
// I'm assuming this is fast, but will have to test to confirm i... | java | {
"resource": ""
} |
q177025 | Xform.dropWhile | test | @Override public Xform<A> dropWhile(Fn1<? super A,Boolean> predicate) {
if (predicate == null) { throw new IllegalArgumentException("Can't dropWhile without a function."); }
return new DropWhileDesc<>(this, predicate);
} | java | {
"resource": ""
} |
q177026 | Xform.fold | test | @Override public <B> B fold(B ident, Fn2<? super B,? super A,B> reducer) {
if (reducer == null) {
throw new IllegalArgumentException("Can't fold with a null reduction function.");
}
// Construct an optimized array of OpRuns (mutable operations for this run)
RunList runList =... | java | {
"resource": ""
} |
q177027 | Tuple2.of | test | public static <K,V> Tuple2<K,V> of(Map.Entry<K,V> entry) {
// Protect against multiple-instantiation
if (entry instanceof Tuple2) {
return (Tuple2<K,V>) entry;
}
return new Tuple2<>(entry.getKey(), entry.getValue());
} | java | {
"resource": ""
} |
q177028 | OneOf3.match | test | @SuppressWarnings("unchecked")
public <R> R match(Fn1<A, R> fa,
Fn1<B, R> fb,
Fn1<C, R> fc) {
if (sel == 0) {
return fa.apply((A) item);
} else if (sel == 1) {
return fb.apply((B) item);
} else {
return fc.appl... | java | {
"resource": ""
} |
q177029 | RuntimeTypes.registerClasses | test | public static ImList<Class> registerClasses(Class... cs) {
if (cs == null) {
throw new IllegalArgumentException("Can't register a null type array");
}
if (cs.length == 0) {
throw new IllegalArgumentException("Can't register a zero-length type array");
}
fo... | java | {
"resource": ""
} |
q177030 | PersistentVector.get | test | @Override public E get(int i) {
E[] node = leafNodeArrayFor(i);
return node[i & LOW_BITS];
} | java | {
"resource": ""
} |
q177031 | PersistentVector.append | test | @SuppressWarnings("unchecked")
@Override public PersistentVector<E> append(E val) {
//room in tail?
// if(tail.length < MAX_NODE_LENGTH)
if (size - tailoff() < MAX_NODE_LENGTH) {
E[] newTail = (E[]) new Object[tail.length + 1];
System.arraycopy(tail, 0, newTail, 0, ta... | java | {
"resource": ""
} |
q177032 | PersistentVector.concat | test | @Override public PersistentVector<E> concat(Iterable<? extends E> items) {
return (PersistentVector<E>) ImList.super.concat(items);
} | java | {
"resource": ""
} |
q177033 | StaticImports.mutableSet | test | @SafeVarargs
public static <T> MutableSet<T> mutableSet(T... items) {
MutableSet<T> ret = PersistentHashSet.emptyMutable();
if (items == null) { return ret; }
for (T t : items) {
ret.put(t);
}
return ret;
} | java | {
"resource": ""
} |
q177034 | StaticImports.mutableVec | test | @SafeVarargs
public static <T> MutableList<T> mutableVec(T... items) {
MutableList<T> ret = PersistentVector.emptyMutable();
if (items == null) { return ret; }
for (T t : items) {
ret.append(t);
}
return ret;
} | java | {
"resource": ""
} |
q177035 | StaticImports.set | test | @SafeVarargs
public static <T> ImSet<T> set(T... items) {
if ( (items == null) || (items.length < 1) ) { return PersistentHashSet.empty(); }
return PersistentHashSet.of(Arrays.asList(items));
} | java | {
"resource": ""
} |
q177036 | StaticImports.vec | test | @SafeVarargs
static public <T> ImList<T> vec(T... items) {
if ( (items == null) || (items.length < 1) ) { return PersistentVector.empty(); }
return mutableVec(items).immutable();
} | java | {
"resource": ""
} |
q177037 | StaticImports.xformArray | test | @SafeVarargs
public static <T> UnmodIterable<T> xformArray(T... items) {
return Xform.of(Arrays.asList(items));
} | java | {
"resource": ""
} |
q177038 | IndentUtils.indentSpace | test | public static StringBuilder indentSpace(int len) {
StringBuilder sB = new StringBuilder();
if (len < 1) { return sB; }
while (len > SPACES_LENGTH_MINUS_ONE) {
sB.append(SPACES[SPACES_LENGTH_MINUS_ONE]);
len = len - SPACES_LENGTH_MINUS_ONE;
}
return sB.appe... | java | {
"resource": ""
} |
q177039 | IndentUtils.arrayString | test | public static <T> String arrayString(T[] items) {
StringBuilder sB = new StringBuilder("A[");
boolean isFirst = true;
for (T item : items) {
if (isFirst) {
isFirst = false;
} else {
sB.append(" ");
}
if (item instanc... | java | {
"resource": ""
} |
q177040 | LazyRef.of | test | public static <T> LazyRef<T> of(Fn0<T> producer) {
if (producer == null) {
throw new IllegalArgumentException("The producer function cannot be null (the value it returns can)");
}
return new LazyRef<>(producer);
} | java | {
"resource": ""
} |
q177041 | LazyRef.applyEx | test | public synchronized T applyEx() {
// Have we produced our value yet?
if (producer != null) {
// produce our value.
value = producer.apply();
// Delete the producer to 1. mark the work done and 2. free resources.
producer = null;
}
// We're ... | java | {
"resource": ""
} |
q177042 | Cowry.insertIntoArrayAt | test | public static <T> T[] insertIntoArrayAt(T item, T[] items, int idx, Class<T> tClass) {
// Make an array that's one bigger. It's too bad that the JVM bothers to
// initialize this with nulls.
@SuppressWarnings("unchecked")
T[] newItems = (T[]) ((tClass == null) ? new Object[items.length ... | java | {
"resource": ""
} |
q177043 | Cowry.arrayCopy | test | public static <T> T[] arrayCopy(T[] items, int length, Class<T> tClass) {
// Make an array of the appropriate size. It's too bad that the JVM bothers to
// initialize this with nulls.
@SuppressWarnings("unchecked")
T[] newItems = (T[]) ((tClass == null) ? new Object[length]
... | java | {
"resource": ""
} |
q177044 | SleeTransactionImpl.suspendIfAssoaciatedWithThread | test | private void suspendIfAssoaciatedWithThread() throws SystemException {
// if there is a tx associated with this thread and it is this one
// then suspend it to dissociate the thread (dumb feature?!?! of jboss ts)
final SleeTransaction currentThreadTransaction = transactionManager
.getSleeTransaction();
if (... | java | {
"resource": ""
} |
q177045 | SleeTransactionImpl.beforeAsyncOperation | test | private void beforeAsyncOperation() throws IllegalStateException,
SecurityException {
try {
int status = transaction.getStatus();
if (asyncOperationInitiated.getAndSet(true) || (status != Status.STATUS_ACTIVE
&& status != Status.STATUS_MARKED_ROLLBACK)) {
throw new IllegalStateException(
"Ther... | java | {
"resource": ""
} |
q177046 | DeployableUnitServiceComponentBuilder.buildComponents | test | public List<ServiceComponentImpl> buildComponents(String serviceDescriptorFileName, JarFile deployableUnitJar) throws DeploymentException {
// make component jar entry
JarEntry componentDescriptor = deployableUnitJar.getJarEntry(serviceDescriptorFileName);
InputStream componentDescriptorInputStream = null;
... | java | {
"resource": ""
} |
q177047 | ConcreteClassGeneratorUtils.validateDirectory | test | static private void validateDirectory(File aDirectory)
throws FileNotFoundException {
if (aDirectory == null) {
throw new IllegalArgumentException("Directory should not be null.");
}
if (!aDirectory.exists()) {
throw new FileNotFoundException("Directory does not exist: "
+ aDirectory);
}
... | java | {
"resource": ""
} |
q177048 | ConcreteClassGeneratorUtils.createInheritanceLink | test | public static void createInheritanceLink(CtClass concreteClass,
CtClass superClass) {
if (superClass == null)
return;
try {
concreteClass.setSuperclass(superClass);
logger.trace(concreteClass.getName() + " Inheritance link with "
+ superClass.getName() + " class created");
} catch (Cannot... | java | {
"resource": ""
} |
q177049 | ConcreteClassGeneratorUtils.copyMethods | test | public static void copyMethods(CtClass source, CtClass destination,
CtClass[] exceptions) {
copyMethods(source.getDeclaredMethods(), destination, exceptions);
} | java | {
"resource": ""
} |
q177050 | ConcreteClassGeneratorUtils.copyMethods | test | public static void copyMethods(CtMethod[] methods, CtClass destination,
CtClass[] exceptions) {
CtMethod methodCopy = null;
for (CtMethod method : methods) {
try {
methodCopy = new CtMethod(method, destination, null);
if (exceptions != null) {
try {
methodCopy.setExceptionTypes(exce... | java | {
"resource": ""
} |
q177051 | LogStructureTreePanel.doTree | test | private TreeItem doTree(FQDNNode localRoot) {
TreeItem localLeaf = new TreeItem();
LogTreeNode logTreeNode = new LogTreeNode(browseContainer, localRoot.getShortName(), localRoot.getFqdName(), localRoot.isWasLeaf(), this);
localLeaf.setWidget(logTreeNode);
if (localRoot.getChildren().size() >... | java | {
"resource": ""
} |
q177052 | SbbEntityFactoryImpl.removeSbbEntityWithCurrentClassLoader | test | private void removeSbbEntityWithCurrentClassLoader(
final SbbEntity sbbEntity) {
// remove entity
sbbEntity.remove();
// remove from tx data
final TransactionContext txContext = sleeContainer.getTransactionManager().getTransactionContext();
final SbbEntityID sbbEntityID = sbbEntity.getSbbEntityId()... | java | {
"resource": ""
} |
q177053 | UsageNotificationManagerMBeanImpl.getNotificationsEnabled | test | public boolean getNotificationsEnabled(String paramName) {
Boolean areNotificationsEnabled = paramNames.get(paramName);
if(!isSlee11)
{
if (areNotificationsEnabled == null
|| areNotificationsEnabled.booleanValue()) {
// considering that notifications are enabled, by default, for each
// param
... | java | {
"resource": ""
} |
q177054 | ServiceManagementImpl.getReferencedRAEntityLinksWhichNotExists | test | public Set<String> getReferencedRAEntityLinksWhichNotExists(
ServiceComponent serviceComponent) {
Set<String> result = new HashSet<String>();
Set<String> raLinkNames = sleeContainer.getResourceManagement()
.getLinkNamesSet();
for (String raLink : serviceComponent
.getResourceAdaptorEntityLinks(componen... | java | {
"resource": ""
} |
q177055 | ServiceManagementImpl.installService | test | public void installService(final ServiceComponent serviceComponent)
throws Exception {
if (logger.isDebugEnabled()) {
logger.debug("Installing Service " + serviceComponent);
}
// creates and registers the service usage mbean
final ServiceUsageMBean serviceUsageMBean = sleeContainer
.getUsageParamete... | java | {
"resource": ""
} |
q177056 | ServiceManagementImpl.uninstallService | test | public void uninstallService(final ServiceComponent serviceComponent)
throws SystemException, UnrecognizedServiceException,
InstanceNotFoundException, MBeanRegistrationException,
NullPointerException, UnrecognizedResourceAdaptorEntityException,
ManagementException, InvalidStateException {
if (logger.isDe... | java | {
"resource": ""
} |
q177057 | ServiceManagementImpl.isRAEntityLinkNameReferenced | test | public boolean isRAEntityLinkNameReferenced(String raLinkName) {
if (raLinkName == null) {
throw new NullPointerException("null ra link name");
}
boolean b = false;
try {
b = transactionManager.requireTransaction();
for (ServiceID serviceID : componentRepositoryImpl.getServiceIDs()) {
ServiceCompo... | java | {
"resource": ""
} |
q177058 | ServiceUsageMBeanImpl.getUsageParameterSets | test | public synchronized String[] getUsageParameterSets(SbbID sbbId)
throws NullPointerException, UnrecognizedSbbException,
InvalidArgumentException, ManagementException {
if (sbbId == null)
throw new NullPointerException("Sbb ID is null!");
// get the sbb component
SbbComponent sbbComponent = sle... | java | {
"resource": ""
} |
q177059 | ServiceUsageMBeanImpl.resetAllUsageParameters | test | public synchronized void resetAllUsageParameters()
throws ManagementException {
try {
//FIXME: hmm, how to check here for clustered... ghmp
for (UsageMBeanImpl usageMBeanImpl : usageMBeans.values()) {
usageMBeanImpl.resetAllUsageParameters();
}
} catch (Throwable e) {
throw new Management... | java | {
"resource": ""
} |
q177060 | ProfileFacilityImpl.getProfiles | test | public Collection<ProfileID> getProfiles(String profileTableName)
throws NullPointerException, UnrecognizedProfileTableNameException,
TransactionRolledbackLocalException, FacilityException {
if (logger.isTraceEnabled()) {
logger.trace("getProfiles( profileTableName = "
+ profileTableName + " )");... | java | {
"resource": ""
} |
q177061 | ProfileFacilityImpl.getProfileTableActivity | test | public ProfileTableActivity getProfileTableActivity(String profileTableName)
throws NullPointerException, UnrecognizedProfileTableNameException,
TransactionRolledbackLocalException, FacilityException {
if (logger.isTraceEnabled()) {
logger.trace("getProfileTableActivity( profileTableName = "
+ pr... | java | {
"resource": ""
} |
q177062 | ProfileFacilityImpl.getProfileByIndexedAttribute | test | public ProfileID getProfileByIndexedAttribute(
java.lang.String profileTableName, java.lang.String attributeName,
java.lang.Object attributeValue) throws NullPointerException,
UnrecognizedProfileTableNameException,
UnrecognizedAttributeException, AttributeNotIndexedException,
AttributeTypeMismatchEx... | java | {
"resource": ""
} |
q177063 | AbstractOperation.displayResult | test | public void displayResult() {
//default impl of display;
if (!context.isQuiet()) {
// Translate the result to text
String resultText = prepareResultText();
// render results to out
PrintWriter out = context.getWriter();
out.println(resultText);
out.flush();
}
} | java | {
"resource": ""
} |
q177064 | AbstractOperation.unfoldArray | test | protected String unfoldArray(String prefix, Object[] array, PropertyEditor editor)
{
//StringBuffer sb = new StringBuffer("\n");
StringBuffer sb = new StringBuffer("[");
for (int index = 0; index<array.length; index++) {
if (editor != null) {
editor.setValue(array[index]);
sb.append(edito... | java | {
"resource": ""
} |
q177065 | SleeEndpointFireEventNotTransactedExecutor.execute | test | void execute(final ActivityHandle realHandle, final ActivityHandle refHandle,
final FireableEventType eventType, final Object event,
final Address address, final ReceivableService receivableService,
final int eventFlags) throws ActivityIsEndingException,
FireEventException, SLEEException,
UnrecognizedAct... | java | {
"resource": ""
} |
q177066 | ActivityContextNamingFacilityCacheData.bindName | test | public void bindName(Object ach, String name)
throws NameAlreadyBoundException {
final Node node = getNode();
if (node.hasChild(name)) {
throw new NameAlreadyBoundException("name already bound");
} else {
node.addChild(Fqn.fromElements(name)).put(CACHE_NODE_MAP_KEY, ach);
}
} | java | {
"resource": ""
} |
q177067 | ActivityContextNamingFacilityCacheData.unbindName | test | public Object unbindName(String name) throws NameNotBoundException {
final Node node = getNode();
final Node childNode = node.getChild(name);
if (childNode == null) {
throw new NameNotBoundException("name not bound");
} else {
final Object ach = childNode.get(CACHE_NODE_MAP_KEY);
node.removeChild(name)... | java | {
"resource": ""
} |
q177068 | ActivityContextNamingFacilityCacheData.lookupName | test | public Object lookupName(String name) {
final Node childNode = getNode().getChild(name);
if (childNode == null) {
return null;
} else {
return childNode.get(CACHE_NODE_MAP_KEY);
}
} | java | {
"resource": ""
} |
q177069 | ActivityContextNamingFacilityCacheData.getNameBindings | test | public Map getNameBindings() {
Map result = new HashMap();
Node childNode = null;
Object name = null;
for (Object obj : getNode().getChildren()) {
childNode = (Node) obj;
name = childNode.getFqn().getLastElement();
result.put(name, childNode.get(CACHE_NODE_MAP_KEY));
}
return result;
} | java | {
"resource": ""
} |
q177070 | NextSbbEntityFinder.next | test | public Result next(ActivityContext ac,
EventContext sleeEvent, Set<SbbEntityID> sbbEntitiesThatHandledCurrentEvent, SleeContainer sleeContainer) {
SbbEntityID sbbEntityId = null;
SbbEntity sbbEntity = null;
EventEntryDescriptor mEventEntry = null;
// get the highest priority sbb from sbb entities att... | java | {
"resource": ""
} |
q177071 | TraceLevel.isHigherLevel | test | public boolean isHigherLevel(TraceLevel other) throws NullPointerException {
if (other == null) throw new NullPointerException("other is null");
return this.level < other.level;
} | java | {
"resource": ""
} |
q177072 | DeployableUnitJarComponentBuilder.extractJar | test | private void extractJar(JarFile jarFile, File dstDir)
throws DeploymentException {
// Extract jar contents to a classpath location
JarInputStream jarIs = null;
try {
jarIs = new JarInputStream(new BufferedInputStream(
new FileInputStream(jarFile.getName())));
for (JarEntry entry = jarIs.getNextJar... | java | {
"resource": ""
} |
q177073 | DeployableUnitJarComponentBuilder.pipeStream | test | private void pipeStream(InputStream is, OutputStream os) throws IOException {
synchronized (buffer) {
try {
for (int bytesRead = is.read(buffer); bytesRead != -1; bytesRead = is
.read(buffer))
os.write(buffer, 0, bytesRead);
is.close();
os.close();
} catch (IOException ioe) {
try {
... | java | {
"resource": ""
} |
q177074 | ActivityContextCacheData.putObject | test | @SuppressWarnings("unchecked")
public Object putObject(Object key, Object value) {
return getNode().put(key, value);
} | java | {
"resource": ""
} |
q177075 | ActivityContextCacheData.attachSbbEntity | test | public boolean attachSbbEntity(SbbEntityID sbbEntityId) {
final Node node = getAttachedSbbsNode(true);
if (!node.hasChild(sbbEntityId)) {
node.addChild(Fqn.fromElements(sbbEntityId));
return true;
} else {
return false;
}
} | java | {
"resource": ""
} |
q177076 | ActivityContextCacheData.detachSbbEntity | test | public boolean detachSbbEntity(SbbEntityID sbbEntityId) {
final Node node = getAttachedSbbsNode(false);
return node != null ? node.removeChild(sbbEntityId) : false;
} | java | {
"resource": ""
} |
q177077 | ActivityContextCacheData.noSbbEntitiesAttached | test | public boolean noSbbEntitiesAttached() {
final Node node = getAttachedSbbsNode(false);
return node != null ? node.getChildrenNames().isEmpty() : true;
} | java | {
"resource": ""
} |
q177078 | ActivityContextCacheData.getSbbEntitiesAttached | test | @SuppressWarnings("unchecked")
public Set<SbbEntityID> getSbbEntitiesAttached() {
final Node node = getAttachedSbbsNode(false);
return node != null ? node.getChildrenNames() : Collections.emptySet();
} | java | {
"resource": ""
} |
q177079 | ActivityContextCacheData.attachTimer | test | public boolean attachTimer(TimerID timerID) {
final Node node = getAttachedTimersNode(true);
if (!node.hasChild(timerID)) {
node.addChild(Fqn.fromElements(timerID));
return true;
}
else {
return false;
}
} | java | {
"resource": ""
} |
q177080 | ActivityContextCacheData.detachTimer | test | public boolean detachTimer(TimerID timerID) {
final Node node = getAttachedTimersNode(false);
return node != null ? node.removeChild(timerID) : false;
} | java | {
"resource": ""
} |
q177081 | ActivityContextCacheData.noTimersAttached | test | public boolean noTimersAttached() {
final Node node = getAttachedTimersNode(false);
return node != null ? node.getChildrenNames().isEmpty() : true;
} | java | {
"resource": ""
} |
q177082 | ActivityContextCacheData.getAttachedTimers | test | public Set getAttachedTimers() {
final Node node = getAttachedTimersNode(false);
return node != null ? node.getChildrenNames() : Collections.emptySet();
} | java | {
"resource": ""
} |
q177083 | ActivityContextCacheData.nameBound | test | public void nameBound(String name) {
final Node node = getNamesBoundNode(true);
if (!node.hasChild(name)) {
node.addChild(Fqn.fromElements(name));
}
} | java | {
"resource": ""
} |
q177084 | ActivityContextCacheData.nameUnbound | test | public boolean nameUnbound(String name) {
final Node node = getNamesBoundNode(false);
return node != null ? node.removeChild(name) : false;
} | java | {
"resource": ""
} |
q177085 | ActivityContextCacheData.noNamesBound | test | public boolean noNamesBound() {
final Node node = getNamesBoundNode(false);
return node != null ? node.getChildrenNames().isEmpty() : true;
} | java | {
"resource": ""
} |
q177086 | ActivityContextCacheData.getNamesBoundCopy | test | public Set getNamesBoundCopy() {
final Node node = getNamesBoundNode(false);
return node != null ? node.getChildrenNames() : Collections.emptySet();
} | java | {
"resource": ""
} |
q177087 | ActivityContextCacheData.setCmpAttribute | test | @SuppressWarnings("unchecked")
public void setCmpAttribute(String attrName, Object attrValue) {
final Node node = getCmpAttributesNode(true);
Node cmpNode = node.getChild(attrName);
if (cmpNode == null) {
cmpNode = node.addChild(Fqn.fromElements(attrName));
}
cmpNode.put(CMP_ATTRIBUTES_NODE_MAP_KEY, attrV... | java | {
"resource": ""
} |
q177088 | ActivityContextCacheData.getCmpAttribute | test | @SuppressWarnings("unchecked")
public Object getCmpAttribute(String attrName) {
final Node node = getCmpAttributesNode(false);
if(node == null) {
return null;
}
else {
final Node cmpNode = node.getChild(attrName);
if (cmpNode != null) {
return cmpNode.get(CMP_ATTRIBUTES_NODE_MAP_KEY);
}
else... | java | {
"resource": ""
} |
q177089 | ActivityContextCacheData.getCmpAttributesCopy | test | @SuppressWarnings("unchecked")
public Map getCmpAttributesCopy() {
final Node node = getCmpAttributesNode(false);
if(node == null) {
return Collections.emptyMap();
}
else {
Map result = new HashMap();
Node cmpNode = null;
for (Object obj : node.getChildren()) {
cmpNode = (Node) obj;
result.... | java | {
"resource": ""
} |
q177090 | UsageMBeanImpl.initNotificationInfo | test | private static MBeanNotificationInfo[] initNotificationInfo() {
String[] notificationTypes = new String[] {
ProfileTableNotification.USAGE_NOTIFICATION_TYPE,
ResourceAdaptorEntityNotification.USAGE_NOTIFICATION_TYPE,
SbbNotification.USAGE_NOTIFICATION_TYPE,
SubsystemNotification.USAGE_NOTIFICATION_TY... | java | {
"resource": ""
} |
q177091 | UsageMBeanImpl.sendUsageNotification | test | public void sendUsageNotification(long value, long seqno,
String usageParameterSetName, String usageParameterName,
boolean isCounter) {
UsageNotificationManagerMBeanImpl notificationManager = parent
.getUsageNotificationManagerMBean(notificationSource);
if (notificationManager == null
|| notificationM... | java | {
"resource": ""
} |
q177092 | DeploymentManagerMBeanImpl.downloadRemoteDU | test | private File downloadRemoteDU(URL duURL, File deploymentRoot) throws Exception {
InputStream in = null;
OutputStream out = null;
try {
// Get the filename out of the URL
String filename = new File(duURL.getPath()).getName();
// Prepare for creating the file at deploy folder
... | java | {
"resource": ""
} |
q177093 | DeploymentManager.updateDeployedComponents | test | public void updateDeployedComponents() {
try {
// Get the SLEE Component Repo
ComponentRepository componentRepository = sleeContainerDeployer.getSleeContainer().getComponentRepository();
// First we'll put the components in a temp Collection
ConcurrentLinkedQueue<String> newDeployedComponen... | java | {
"resource": ""
} |
q177094 | DeploymentManager.installDeployableUnit | test | public void installDeployableUnit(DeployableUnit du) throws Exception {
// Update the deployed components from SLEE
updateDeployedComponents();
// Check if the DU is ready to be installed
if (du.isReadyToInstall(true)) {
// Get and Run the actions needed for installing this DU
sciAction(du... | java | {
"resource": ""
} |
q177095 | DeploymentManager.uninstallDeployableUnit | test | public void uninstallDeployableUnit(DeployableUnit du) throws Exception {
// Update the deployed components from SLEE
updateDeployedComponents();
// It isn't installed?
if (!du.isInstalled()) {
// Then it should be in the waiting list... remove and we're done.
if (waitingForInstallDUs.remo... | java | {
"resource": ""
} |
q177096 | DeploymentManager.processInternalUndeploy | test | private void processInternalUndeploy(DeployableUnit du) throws Exception {
// Set the DU as not installed
du.setInstalled(false);
// Remove if it was present in waiting list
waitingForUninstallDUs.remove(du);
// Update the deployed components from SLEE
updateDeployedComponents();
// Go th... | java | {
"resource": ""
} |
q177097 | DeploymentManager.showStatus | test | public String showStatus() {
// Update the currently deployed components.
updateDeployedComponents();
String output = "";
output += "<p>Deployable Units Waiting For Install:</p>";
for (DeployableUnit waitingDU : waitingForInstallDUs) {
output += "+-- " + waitingDU.getDeploymentInfoShortName(... | java | {
"resource": ""
} |
q177098 | MobicentsLogFilter.isLoggable | test | public boolean isLoggable(LogRecord record)
{
Logger logger = getLogger(record);
if (record.getThrown() != null)
{
logWithThrowable(logger, record);
}
else
{
logWithoutThrowable(logger, record);
}
return false;
} | java | {
"resource": ""
} |
q177099 | MobicentsLogFilter.getLogger | test | private Logger getLogger(LogRecord record)
{
String loggerName = record.getLoggerName();
Logger logger = loggerCache.get(loggerName);
if (logger == null)
{
logger = Logger.getLogger(loggerName);
loggerCache.put(loggerName, logger);
}
return logger;
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.