_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q177200 | AbstractProfileMBeanImpl.writeMode | test | private void writeMode() throws SLEEException, ManagementException {
if (!isProfileWriteable()) {
if (logger.isDebugEnabled()) {
logger.debug("Changing state to read-write, for profile mbean with name " + profileName + ", from table with name " + this.profileTable.getProfileTableName... | java | {
"resource": ""
} |
q177201 | AbstractProfileMBeanImpl.beforeSetCmpField | test | protected void beforeSetCmpField() throws ManagementException, InvalidStateException {
if (logger.isDebugEnabled()) {
logger.debug("beforeSetCmpField() on profile with name " + profileName + " of table " + profileTable.getProfileTableName());
}
if (isProfileWriteable()) {
... | java | {
"resource": ""
} |
q177202 | AbstractProfileMBeanImpl.afterSetCmpField | test | protected void afterSetCmpField() throws ManagementException {
if (logger.isDebugEnabled()) {
logger.debug("afterSetCmpField() on profile with name " + profileName + " of table " + profileTable.getProfileTableName());
}
try {
sleeContainer.getTransactionManager().suspen... | java | {
"resource": ""
} |
q177203 | AbstractProfileMBeanImpl.beforeGetCmpField | test | protected boolean beforeGetCmpField() throws ManagementException {
if (logger.isDebugEnabled()) {
logger.debug("beforeGetCmpField() on profile with name " + profileName + " of table " + profileTable.getProfileTableName());
}
return beforeNonSetCmpField();
} | java | {
"resource": ""
} |
q177204 | AbstractProfileMBeanImpl.afterGetCmpField | test | protected void afterGetCmpField(boolean activatedTransaction) throws ManagementException {
if (logger.isDebugEnabled()) {
logger.debug("afterGetCmpField( activatedTransaction = " + activatedTransaction + " ) on profile with name " + profileName + " of table " + profileTable.getProfileTableName());
... | java | {
"resource": ""
} |
q177205 | AbstractProfileMBeanImpl.beforeManagementMethodInvocation | test | protected boolean beforeManagementMethodInvocation() throws ManagementException {
if (logger.isDebugEnabled()) {
logger.debug("beforeManagementMethodInvocation() on profile with name " + profileName + " of table " + profileTable.getProfileTableName());
}
jndiManagement = sleeContai... | java | {
"resource": ""
} |
q177206 | AbstractProfileMBeanImpl.afterManagementMethodInvocation | test | protected void afterManagementMethodInvocation(boolean activatedTransaction) throws ManagementException {
if (logger.isDebugEnabled()) {
logger.debug("afterManagementMethodInvocation( activatedTransaction = " + activatedTransaction + " ) on profile with name " + profileName + " of table " + profileT... | java | {
"resource": ""
} |
q177207 | DeployableUnitImpl.deletePath | test | private void deletePath(File path) {
if (path.isDirectory()) {
File[] files = path.listFiles();
if (files != null) {
for (File file : files) {
deletePath(file);
}
}
}
path.delete();
} | java | {
"resource": ""
} |
q177208 | ConcreteSbbGenerator.createDefaultConstructor | test | protected void createDefaultConstructor() throws DeploymentException {
CtConstructor defaultConstructor = new CtConstructor(null,
sbbConcreteClass);
// We need a "do nothing" constructor because the
// convergence name creation method may need to actually
// create the object instance to run the method tha... | java | {
"resource": ""
} |
q177209 | ConcreteSbbGenerator.createDefaultUsageParameterGetter | test | private void createDefaultUsageParameterGetter(CtClass sbbConcrete)
throws DeploymentException {
String methodName = "getDefaultSbbUsageParameterSet";
CtMethod method = (CtMethod) abstractMethods.get(methodName);
if (method == null) {
method = (CtMethod) superClassesAbstractMethods.get(methodName);
}
if... | java | {
"resource": ""
} |
q177210 | ConcreteSbbGenerator.createSbbEntityGetterAndSetter | test | private void createSbbEntityGetterAndSetter(CtClass sbbConcrete)
throws DeploymentException {
try {
CtMethod getSbbEntity = CtNewMethod
.make("public " + SbbEntity.class.getName()
+ " getSbbEntity() { return this.sbbEntity; }",
sbbConcrete);
getSbbEntity.setModifiers(Modifier.PUBLIC);
s... | java | {
"resource": ""
} |
q177211 | ConcreteSbbGenerator.createFireEventMethods | test | protected void createFireEventMethods(Collection<EventEntryDescriptor> mEventEntries) {
if (mEventEntries == null)
return;
for (EventEntryDescriptor mEventEntry : mEventEntries) {
if (mEventEntry.isFired()) {
String methodName = "fire" + mEventEntry.getEventName();
CtMethod method = (CtMethod) abstrac... | java | {
"resource": ""
} |
q177212 | ConcreteSbbGenerator.createGetSbbActivityContextInterfaceMethod | test | protected void createGetSbbActivityContextInterfaceMethod(
CtClass activityContextInterface,
Class<?> concreteActivityContextInterfaceClass)
throws DeploymentException {
String methodToAdd = "public "
+ activityContextInterface.getName()
+ " asSbbActivityContextInterface(javax.slee.ActivityContextInt... | java | {
"resource": ""
} |
q177213 | CompositeQueryExpression.add | test | protected final void add(QueryExpression expr) throws NullPointerException, IllegalArgumentException {
if (expr == null) throw new NullPointerException("expr is null");
// check for cycles
if (expr instanceof CompositeQueryExpression) {
((CompositeQueryExpression)expr).checkForCycle... | java | {
"resource": ""
} |
q177214 | NonSerializableFactory.bind | test | public static synchronized void bind(String key, Object target) throws NameAlreadyBoundException
{
if( wrapperMap.containsKey(key) == true )
throw new NameAlreadyBoundException(key+" already exists in the NonSerializableFactory map");
wrapperMap.put(key, target);
} | java | {
"resource": ""
} |
q177215 | NonSerializableFactory.rebind | test | public static synchronized void rebind(Name name, Object target) throws NamingException
{
rebind(name, target, false);
} | java | {
"resource": ""
} |
q177216 | SbbAbstractClassDecorator.decorateAbstractSbb | test | public boolean decorateAbstractSbb() throws DeploymentException {
ClassPool pool = component.getClassPool();
String sbbAbstractClassName = component.getDescriptor().getSbbAbstractClass().getSbbAbstractClassName();
try {
sbbAbstractClass = pool.get(sbbAbstractClassName);
... | java | {
"resource": ""
} |
q177217 | SbbLocalObjectInterceptor.invokeAndReturnvoid | test | public void invokeAndReturnvoid(SbbConcrete proxy, String methodName,
Object[] args, Class<?>[] argTypes) throws Exception {
invokeAndReturnObject(proxy, methodName, args, argTypes);
} | java | {
"resource": ""
} |
q177218 | SbbActivityContextInterfaceImpl.getRealFieldName | test | private String getRealFieldName(String fieldName) {
String realFieldName = sbbComponent.getDescriptor()
.getActivityContextAttributeAliases().get(fieldName);
if (realFieldName == null) {
// not there then it has no alias, lets set one based on sbb id
realFieldName = sbbComponent.getSbbID().toString() + ".... | java | {
"resource": ""
} |
q177219 | SbbActivityContextInterfaceImpl.setFieldValue | test | public void setFieldValue(String fieldName, Object value) {
String realFieldName = getRealFieldName(fieldName);
aciImpl.getActivityContext().setDataAttribute(realFieldName, value);
} | java | {
"resource": ""
} |
q177220 | SbbActivityContextInterfaceImpl.getFieldValue | test | public Object getFieldValue(String fieldName, Class<?> returnType) {
String realFieldName = getRealFieldName(fieldName);
Object value = aciImpl.getActivityContext().getDataAttribute(
realFieldName);
if (value == null) {
if (returnType.isPrimitive()) {
if (returnType.equals(Integer.TYPE)) {
retu... | java | {
"resource": ""
} |
q177221 | ProfileObjectImpl.setProfileContext | test | public void setProfileContext(ProfileContextImpl profileContext) {
if(logger.isTraceEnabled()) {
logger.trace("[setProfileContext] "+this);
}
if (profileContext == null) {
throw new NullPointerException("Passed context must not be null.");
}
if (state != ProfileObjectState.DOES_NOT_EXIST) {
th... | java | {
"resource": ""
} |
q177222 | ProfileObjectImpl.profileInitialize | test | private void profileInitialize(String profileName) {
if(logger.isTraceEnabled()) {
logger.trace("[profileInitialize] "+this+" , profileName = "+profileName);
}
if (this.state != ProfileObjectState.POOLED) {
throw new SLEEException(this.toString());
}
if (profileName == null) {
// default p... | java | {
"resource": ""
} |
q177223 | ProfileObjectImpl.unsetProfileContext | test | public void unsetProfileContext() {
if(logger.isTraceEnabled()) {
logger.trace("[unsetProfileContext] "+this);
}
if (state == ProfileObjectState.POOLED && profileConcreteClassInfo.isInvokeUnsetProfileContext()) {
final ClassLoader oldClassLoader = SleeContainerUtils.getCurrentThreadClassLoader();
try... | java | {
"resource": ""
} |
q177224 | ProfileObjectImpl.getProfileLocalObject | test | public ProfileLocalObject getProfileLocalObject() {
final Class<?> profileLocalObjectConcreteClass = profileTable.getProfileSpecificationComponent().getProfileLocalObjectConcreteClass();
ProfileLocalObject profileLocalObject = null;
if (profileLocalObjectConcreteClass == null) {
profileLocalObject = new Profil... | java | {
"resource": ""
} |
q177225 | ProfileObjectImpl.fireAddOrUpdatedEventIfNeeded | test | public void fireAddOrUpdatedEventIfNeeded() {
if (state == ProfileObjectState.READY) {
if (profileEntity.isDirty()) {
// check the table fires events and the object is not assigned to a default profile
if (profileTable.doesFireEvents() && profileEntity.getProfileName() != null && profileTable.getSleeCon... | java | {
"resource": ""
} |
q177226 | ProfileObjectImpl.getProfileCmpSlee10Wrapper | test | public AbstractProfileCmpSlee10Wrapper getProfileCmpSlee10Wrapper() {
if (profileCmpSlee10Wrapper == null) {
try {
profileCmpSlee10Wrapper = (AbstractProfileCmpSlee10Wrapper) profileTable.getProfileSpecificationComponent().getProfileCmpSlee10WrapperClass().getConstructor(ProfileObjectImpl.class).newInstance(th... | java | {
"resource": ""
} |
q177227 | ClassGeneratorUtils.createClass | test | public static CtClass createClass(String className, String[] interfaces) throws Exception
{
if(className == null)
{
throw new NullPointerException("Class name cannot be null");
}
CtClass clazz = classPool.makeClass(className);
if(interfaces != null && interfaces.length > 0)
{
cla... | java | {
"resource": ""
} |
q177228 | ClassGeneratorUtils.createInheritanceLink | test | public static void createInheritanceLink(CtClass concreteClass, String superClassName)
{
if(superClassName != null && superClassName.length() >= 0)
{
try
{
concreteClass.setSuperclass(classPool.get(superClassName));
}
catch ( CannotCompileException e ) {
e.printStackTra... | java | {
"resource": ""
} |
q177229 | ClassGeneratorUtils.addAnnotation | test | public static void addAnnotation(String annotation, LinkedHashMap<String, Object> memberValues, Object toAnnotate)
{
if(toAnnotate instanceof CtClass)
{
CtClass classToAnnotate = (CtClass) toAnnotate;
ClassFile cf = classToAnnotate.getClassFile();
ConstPool cp = cf.getConstPool();
An... | java | {
"resource": ""
} |
q177230 | ClassGeneratorUtils.addMemberValuesToAnnotation | test | private static void addMemberValuesToAnnotation(Annotation annotation, ConstPool cp, LinkedHashMap<String, Object> memberValues)
{
// Get the member value object
for(String mvName : memberValues.keySet())
{
Object mvValue = memberValues.get(mvName);
MemberValue mv = getMemberValue(mvValue, cp)... | java | {
"resource": ""
} |
q177231 | AbstractActivityContextInterfaceFactory.getACI | test | protected ActivityContextInterface getACI(Object activity)
throws NullPointerException, UnrecognizedActivityException,
FactoryException {
if (activity == null) {
throw new NullPointerException("null activity object");
}
ActivityHandle handle = null;
for (ResourceAdaptorEntity raEntity : sleeContainer
... | java | {
"resource": ""
} |
q177232 | AbstractSleeComponent.getClassPool | test | public ClassPool getClassPool() {
if (classPool == null) {
if (classLoader == null) {
throw new IllegalStateException("can't init javassit classpool, there is no class loader set for the component");
}
classPool = new ClassPool();
// add class path for domain and dependencies
classPool.appendClassP... | java | {
"resource": ""
} |
q177233 | AbstractSleeComponent.setDeployableUnit | test | public void setDeployableUnit(DeployableUnit deployableUnit)
throws AlreadyDeployedException {
if (this.deployableUnit != null) {
throw new IllegalStateException(
"deployable unit already set. du = " + this.deployableUnit);
}
this.deployableUnit = deployableUnit;
if (!addToDeployableUnit()) {
thro... | java | {
"resource": ""
} |
q177234 | AbstractSleeComponent.undeployed | test | public void undeployed() {
classLoader = null;
if (classLoaderDomain != null) {
classLoaderDomain.clear();
classLoaderDomain = null;
}
if (classPool != null) {
classPool.clean();
classPool = null;
}
if (permissions != null) {
permissions.clear();
permissions = null;
}... | java | {
"resource": ""
} |
q177235 | SleeEndpointStartActivityNotTransactedExecutor.execute | test | void execute(final ActivityHandle handle, final int activityFlags, boolean suspendActivity)
throws SLEEException {
final SleeTransaction tx = super.suspendTransaction();
ActivityContextHandle ach = null;
try {
ach = sleeEndpoint._startActivity(handle, activityFlags, suspendActivity ? tx : null);
} finall... | java | {
"resource": ""
} |
q177236 | ClassUtils.checkInterfaces | test | public static Class checkInterfaces(Class classOrInterfaceWithInterfaces, String interfaceSearched) {
Class returnValue = null;
if (classOrInterfaceWithInterfaces.getName().compareTo(interfaceSearched) == 0) {
return classOrInterfaceWithInterfaces;
}
// we do check only on get interfaces
for (Class iface... | java | {
"resource": ""
} |
q177237 | ClassUtils.getAllInterfacesMethods | test | public static Map<String, Method> getAllInterfacesMethods(Class xInterfaceClass, Set<String> ignore) {
HashMap<String, Method> abstractMethods = new HashMap<String, Method>();
Method[] methods = null;
Class[] superInterfaces;
superInterfaces = xInterfaceClass.getInterfaces();
for (Class superInterface : sup... | java | {
"resource": ""
} |
q177238 | SleeDeployerEntityResolver.resolveEntity | test | public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
{
URL resourceURL = resources.get(publicId);
if(resourceURL != null) {
InputStream resourceStream = resourceURL.openStream();
InputSource is = new InputSource(resourceSt... | java | {
"resource": ""
} |
q177239 | TraceMBeanImpl.checkTracerName | test | public static void checkTracerName(String tracerName, NotificationSource notificationSource) throws IllegalArgumentException {
if (tracerName.compareTo("") == 0) {
// This is root
return;
}
// String[] splitName = tracerName.split("\\.");
StringTokenizer stringTokenizer = new StringTokenizer(tra... | java | {
"resource": ""
} |
q177240 | ProfileQueryHandler.handle | test | public static Collection<ProfileLocalObject> handle(
ProfileTableImpl profileTable, String queryName, Object[] arguments)
throws NullPointerException, TransactionRequiredLocalException, SLEEException,
UnrecognizedQueryNameException, AttributeTypeMismatchException,
InvalidArgumentException {
return pr... | java | {
"resource": ""
} |
q177241 | DeployableUnitBuilderImpl.checkDependencies | test | private void checkDependencies(SleeComponent sleeComponent,
DeployableUnitImpl deployableUnit) throws DependencyException {
for (ComponentID componentID : sleeComponent.getDependenciesSet()) {
if (componentID instanceof EventTypeID) {
if (deployableUnit.getDeployableUnitRepository()
.getComponent... | java | {
"resource": ""
} |
q177242 | DeployableUnitBuilderImpl.createTempDUDeploymentDir | test | private File createTempDUDeploymentDir(File deploymentRoot,
DeployableUnitID deployableUnitID) {
try {
// first create a dummy file to gurantee uniqueness. I would have
// been nice if the File class had a createTempDir() method
// IVELIN -- do not use jarName here because windows cannot see the
... | java | {
"resource": ""
} |
q177243 | JPAProfileEntityFramework.getEntityManager | test | @SuppressWarnings("unchecked")
private EntityManager getEntityManager() {
if (txDataKey == null) {
txDataKey = new StringBuilder("jpapef.em.").append(component.getProfileSpecificationID()).toString();
}
final TransactionContext txContext = sleeTransactionManager.getTransactionContext();
// look in tx
Ma... | java | {
"resource": ""
} |
q177244 | SleeManagementMBeanImpl.start | test | public void start() throws InvalidStateException, ManagementException {
try {
// request to change to STARTING
final SleeStateChangeRequest startingRequest = new SleeStateChangeRequest() {
@Override
public void stateChanged(SleeState oldState) {
if(logger.isDebugEnabled()) {
logger... | java | {
"resource": ""
} |
q177245 | Utility.switchSafelyClassLoader | test | public static ClassLoader switchSafelyClassLoader(final ClassLoader cl,final ProfileObject po)
{
ClassLoader _cl = null;
if(System.getSecurityManager()!=null)
{
_cl = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction(){
public Object run() {
return _switchSafelyClassLoader(cl,po... | java | {
"resource": ""
} |
q177246 | Utility.makeSafeProxyCall | test | public static Object makeSafeProxyCall(final Object proxy,final String methodToCallname,final Class[] signature,final Object[] values) throws PrivilegedActionException
{
//Here we execute in sbb/profile or any other slee component domain
// so no security calls can be made
try {
//AccessControlContext a... | java | {
"resource": ""
} |
q177247 | ProfileLocalObjectImpl.checkTransaction | test | protected void checkTransaction() throws IllegalStateException {
try {
if (!sleeContainer.getTransactionManager().getTransaction().equals(this.transaction)) {
throw new IllegalStateException();
}
} catch (SystemException e) {
throw new IllegalStateException();
}
} | java | {
"resource": ""
} |
q177248 | ActivityServiceImpl.toTTL | test | private static String toTTL(String lastAccess, long timeout) {
Long ttl = timeout - ((System.currentTimeMillis() - Long.parseLong(lastAccess)) / 1000);
return ttl.toString();
} | java | {
"resource": ""
} |
q177249 | AbstractProfileEvent.isProfileClassVisible | test | boolean isProfileClassVisible() {
try {
Thread.currentThread().getContextClassLoader().loadClass(profileAfterAction.getClass().getName());
return true;
} catch (Throwable e) {
return false;
}
} | java | {
"resource": ""
} |
q177250 | AbstractProfileEvent.getProfileObjectValidInCurrentTransaction | test | ProfileObjectImpl getProfileObjectValidInCurrentTransaction(ProfileEntity profileEntity) throws TransactionRequiredLocalException {
// check tx
final SleeTransactionManager txManager = profileManagement.getSleeContainer().getTransactionManager();
txManager.mandateTransaction();
// look for an assigned o... | java | {
"resource": ""
} |
q177251 | LogManagementMBeanUtils.getLoggerNames | test | public List<String> getLoggerNames(String regex) throws ManagementConsoleException {
try {
return (List<String>) this.mbeanServer.invoke(logMgmtMBeanName, "getLoggerNames", new Object[] { regex }, new String[] { "java.lang.String" });
}
catch (Exception e) {
e.printStackTrace();
thro... | java | {
"resource": ""
} |
q177252 | LogManagementMBeanUtils.resetLoggerLevels | test | public void resetLoggerLevels() throws ManagementConsoleException {
try {
this.mbeanServer.invoke(logMgmtMBeanName, "resetLoggerLevels", null, null);
}
catch (Exception e) {
e.printStackTrace();
throw new ManagementConsoleException(SleeManagementMBeanUtils.doMessage(e));
}
... | java | {
"resource": ""
} |
q177253 | LogManagementMBeanUtils.clearLoggers | test | public void clearLoggers(String name) throws ManagementConsoleException {
try {
this.mbeanServer.invoke(logMgmtMBeanName, "clearLoggers", new Object[] { name }, new String[] { "java.lang.String" });
}
catch (Exception e) {
e.printStackTrace();
throw new ManagementConsoleException(S... | java | {
"resource": ""
} |
q177254 | LogManagementMBeanUtils.addLogger | test | public boolean addLogger(String name, Level level) throws NullPointerException, ManagementConsoleException {
try {
return ((Boolean) this.mbeanServer.invoke(logMgmtMBeanName, "addLogger", new Object[] { name, level }, new String[] { "java.lang.String",
"java.util.logging.Level" })).booleanValue()... | java | {
"resource": ""
} |
q177255 | LogManagementMBeanUtils.addSocketHandler | test | public void addSocketHandler(String loggerName, Level handlerLevel, String handlerName, String formaterClassName, String filterClassName, String host,
int port) throws ManagementConsoleException {
try {
this.mbeanServer.invoke(logMgmtMBeanName, "addSocketHandler", new Object[] { loggerName, handler... | java | {
"resource": ""
} |
q177256 | LogManagementMBeanUtils.removeHandler | test | public boolean removeHandler(String loggerName, String handlerName) throws ManagementConsoleException {
try {
return ((Boolean) this.mbeanServer.invoke(logMgmtMBeanName, "removeHandler", new Object[] { loggerName, handlerName }, new String[] { "java.lang.String",
"java.lang.String" })).booleanVal... | java | {
"resource": ""
} |
q177257 | TracerImpl.tracerNameToLog4JLoggerName | test | private String tracerNameToLog4JLoggerName(String tracerName, NotificationSource notificationSource) {
final StringBuilder sb = new StringBuilder("javax.slee.").append(notificationSource.toString());
if(!tracerName.equals(ROOT_TRACER_NAME)) {
sb.append('.').append(tracerName);
}
return sb.toString();
... | java | {
"resource": ""
} |
q177258 | TracerImpl.syncLevelWithLog4j | test | void syncLevelWithLog4j() {
// get the level from log4j, only the root one uses effective level
Level log4jLevel = parent == null ? logger.getEffectiveLevel() : logger.getLevel();
if (level == null) {
// set the level
assignLog4JLevel(log4jLevel);
}
else {
// set the level only if differs, ot... | java | {
"resource": ""
} |
q177259 | TracerImpl.assignLog4JLevel | test | private void assignLog4JLevel(Level log4jLevel) {
if (log4jLevel == null) {
return;
}
if (log4jLevel == Level.DEBUG) {
level = TraceLevel.FINE;
}
else if (log4jLevel == Level.INFO) {
level = TraceLevel.INFO;
}
else if (log4jLevel == Level.WARN) {
level = TraceLevel.WARNING;
}
... | java | {
"resource": ""
} |
q177260 | TracerImpl.resetCacheFlags | test | void resetCacheFlags(boolean resetChilds) {
if (isTraceable(TraceLevel.FINEST)) {
finestEnabled = true;
finerEnabled = true;
fineEnabled = true;
configEnabled = true;
infoEnabled = true;
warningEnabled = true;
severeEnabled = true;
}
else {
finestEnabled = false;
if (isTrace... | java | {
"resource": ""
} |
q177261 | TracerImpl.sendNotification | test | void sendNotification(javax.slee.facilities.TraceLevel level, String message, Throwable t) {
if (!isTraceable(level)) {
return;
}
traceMBean.sendNotification(new TraceNotification(notificationSource.getNotificationSource().getTraceNotificationType(), traceMBean, notificationSource.getNotificationSource(), ... | java | {
"resource": ""
} |
q177262 | TracerImpl.checkTracerName | test | public static void checkTracerName(String tracerName, NotificationSource notificationSource) throws NullPointerException,InvalidArgumentException {
if (tracerName.equals("")) {
// This is root
return;
}
StringTokenizer stringTokenizer = new StringTokenizer(tracerName, ".", true);
String lastTo... | java | {
"resource": ""
} |
q177263 | VendorExtensionUtils.writeObject | test | public static void writeObject(ObjectOutputStream out, Object vendorData) throws IOException {
// write non-transient fields
out.defaultWriteObject();
// check if should we serialize vendor data?
if (vendorData != null) {
// serialize the vendor data
out.writeBool... | java | {
"resource": ""
} |
q177264 | VendorExtensionUtils.readObject | test | public static Object readObject(ObjectInputStream in, boolean vendorDataDeserializationEnabled) throws IOException, ClassNotFoundException {
// read non-transient fields
in.defaultReadObject();
// read any possible marshalled vendor data from the stream
MarshalledObject vendorData = in.r... | java | {
"resource": ""
} |
q177265 | URLClassLoaderDomainImpl.addDirectDependency | test | public void addDirectDependency(URLClassLoaderDomainImpl domain) {
if (logger.isTraceEnabled())
logger.trace(toString() + " adding domain " + domain
+ " to direct dependencies");
directDependencies.add(domain);
} | java | {
"resource": ""
} |
q177266 | URLClassLoaderDomainImpl.getAllDependencies | test | public List<URLClassLoaderDomainImpl> getAllDependencies() {
List<URLClassLoaderDomainImpl> result = new ArrayList<URLClassLoaderDomainImpl>();
this.getAllDependencies(result);
return result;
} | java | {
"resource": ""
} |
q177267 | URLClassLoaderDomainImpl.findClassLocally | test | protected Class<?> findClassLocally(String name)
throws ClassNotFoundException {
if (logger.isTraceEnabled()) {
logger.trace(toString() + " findClassLocally: " + name);
}
final boolean acquiredLock = acquireGlobalLock();
try {
return findClassLocallyLo... | java | {
"resource": ""
} |
q177268 | URLClassLoaderDomainImpl.findResourceLocally | test | protected URL findResourceLocally(String name) {
if (logger.isTraceEnabled())
logger.trace(toString() + " findResourceLocally: " + name);
return super.findResource(name);
} | java | {
"resource": ""
} |
q177269 | URLClassLoaderDomainImpl.findResourcesLocally | test | protected Enumeration<URL> findResourcesLocally(String name)
throws IOException {
if (logger.isTraceEnabled())
logger.trace(toString() + " findResourcesLocally: " + name);
return super.findResources(name);
} | java | {
"resource": ""
} |
q177270 | ProfileProvisioningMBeanImpl.createAndRegisterProfileMBean | test | private AbstractProfileMBeanImpl createAndRegisterProfileMBean(String profileName, ProfileTableImpl profileTable) throws ManagementException {
if (logger.isDebugEnabled()) {
logger.debug("createAndRegisterProfileMBean( profileTable = "+profileTable+" , profileName = "+profileName+" )");
}
try {
... | java | {
"resource": ""
} |
q177271 | SleeEndpointOperationNotTransactedExecutor.resumeTransaction | test | void resumeTransaction(SleeTransaction transaction) throws SLEEException {
if (transaction != null) {
try {
txManager.resume(transaction);
} catch (Throwable e) {
throw new SLEEException(e.getMessage(),e);
}
}
} | java | {
"resource": ""
} |
q177272 | ServiceComponentImpl.getSbbIDs | test | public Set<SbbID> getSbbIDs(ComponentRepository componentRepository) {
Set<SbbID> result = new HashSet<SbbID>();
buildSbbTree(descriptor.getRootSbbID(), result,
componentRepository);
return result;
} | java | {
"resource": ""
} |
q177273 | ServiceComponentImpl.getResourceAdaptorEntityLinks | test | public Set<String> getResourceAdaptorEntityLinks(ComponentRepository componentRepository) {
Set<String> result = new HashSet<String>();
for (SbbID sbbID : getSbbIDs(componentRepository)) {
SbbComponent sbbComponent = componentRepository.getComponentByID(sbbID);
for (ResourceAdaptorTypeBindingDescriptor ra... | java | {
"resource": ""
} |
q177274 | SleeContainer.initSlee | test | public void initSlee() throws InvalidStateException {
if (sleeState != null) {
throw new InvalidStateException("slee in "+sleeState+" state");
}
// slee init
beforeModulesInitialization();
for (Iterator<SleeContainerModule> i = modules.iterator(); i
.hasNext();) {
i.next().sleeInitialization();
}
... | java | {
"resource": ""
} |
q177275 | SleeContainer.shutdownSlee | test | public void shutdownSlee() throws InvalidStateException {
if (sleeState != SleeState.STOPPED) {
throw new InvalidStateException("slee in "+sleeState+" state");
}
// slee shutdown
beforeModulesShutdown();
for (Iterator<SleeContainerModule> i = modules
.descendingIterator(); i.hasNext();) {
i.next().s... | java | {
"resource": ""
} |
q177276 | SleeContainer.validateStateTransition | test | private void validateStateTransition(SleeState oldState, SleeState newState)
throws InvalidStateException {
if (oldState == SleeState.STOPPED) {
if (newState == SleeState.STARTING) {
return;
}
} else if (oldState == SleeState.STARTING) {
if (newState == SleeState.RUNNING || newState == SleeState.S... | java | {
"resource": ""
} |
q177277 | ConcreteProfileGenerator.generateNamedUsageParameterGetter | test | private void generateNamedUsageParameterGetter(CtClass profileConcreteClass) {
String methodName = "getUsageParameterSet";
for (CtMethod ctMethod : profileConcreteClass.getMethods()) {
if (ctMethod.getName().equals(methodName)) {
try {
// copy method, we can't just add body becase it is in supe... | java | {
"resource": ""
} |
q177278 | UpdateQuery.set | test | public UpdateQuery set(String fieldName, Object value) {
String updatedFieldName = "update_" + fieldName;
values.append(fieldName).append(" = :").append(updatedFieldName).append(", ");
query.setArgument(updatedFieldName, value);
return this;
} | java | {
"resource": ""
} |
q177279 | PolyJDBCBuilder.build | test | public PolyJDBC build() {
TransactionManager manager;
if (dataSource != null) {
manager = new DataSourceTransactionManager(dataSource);
} else {
manager = new ExternalTransactionManager(connectionProvider);
}
return new DefaultPolyJDBC(dialect, schemaName,... | java | {
"resource": ""
} |
q177280 | InsertQuery.value | test | public InsertQuery value(String fieldName, Object value) {
valueNames.append(fieldName).append(", ");
values.append(":").append(fieldName).append(", ");
setArgument(fieldName, value);
return this;
} | java | {
"resource": ""
} |
q177281 | TransactionRunner.run | test | public <T> T run(TransactionWrapper<T> operation) {
QueryRunner runner = null;
try {
runner = queryRunnerFactory.create();
T result = operation.perform(runner);
runner.commit();
return result;
} catch (Throwable throwable) {
TheCloser.... | java | {
"resource": ""
} |
q177282 | RegionRequest.fromString | test | @JsonCreator
public static RegionRequest fromString(String str) throws ResolvingException {
if (str.equals("full")) {
return new RegionRequest();
}
if (str.equals("square")) {
return new RegionRequest(true);
}
Matcher matcher = PARSE_PAT.matcher(str);
if (!matcher.matches()) {
... | java | {
"resource": ""
} |
q177283 | RegionRequest.getRegion | test | public Rectangle2D getRegion() {
if (isRelative()) {
return new Rectangle2D.Double(
relativeBox.x.doubleValue(), relativeBox.y.doubleValue(),
relativeBox.w.doubleValue(), relativeBox.h.doubleValue());
} else {
return absoluteBox;
}
} | java | {
"resource": ""
} |
q177284 | RegionRequest.resolve | test | public Rectangle resolve(Dimension imageDims) throws ResolvingException {
if (square) {
if (imageDims.width > imageDims.height) {
return new Rectangle(
(imageDims.width - imageDims.height) / 2,
0,
imageDims.height, imageDims.height);
} else if (imageDims.heigh... | java | {
"resource": ""
} |
q177285 | ResourceDeserializer.getOnType | test | private String getOnType(DeserializationContext ctxt) {
// Easiest way: The parser has already constructed an annotation object with a motivation.
// This is highly dependendant on the order of keys in the JSON, i.e. if "on" is the first key in the annotation
// object, this won't work.
Object curVal = ... | java | {
"resource": ""
} |
q177286 | Resource.setViewingHints | test | public void setViewingHints(List<ViewingHint> viewingHints) throws IllegalArgumentException {
for (ViewingHint hint : viewingHints) {
boolean supportsHint = (hint.getType() == ViewingHint.Type.OTHER
|| this.getSupportedViewingHintTypes().contains(hint.getType()));
if (!supp... | java | {
"resource": ""
} |
q177287 | Resource.addViewingHint | test | public Resource addViewingHint(ViewingHint first, ViewingHint... rest) throws IllegalArgumentException {
List<ViewingHint> hints = this.viewingHints;
if (hints == null) {
hints = new ArrayList<>();
}
hints.addAll(Lists.asList(first, rest));
this.setViewingHints(hints);
return this;
} | java | {
"resource": ""
} |
q177288 | Resource.setRenderings | test | public void setRenderings(List<OtherContent> renderings) throws IllegalArgumentException {
renderings.forEach(this::verifyRendering);
this.renderings = renderings;
} | java | {
"resource": ""
} |
q177289 | Resource.addRendering | test | public Resource addRendering(OtherContent first, OtherContent... rest) {
if (renderings == null) {
this.renderings = new ArrayList<>();
}
List<OtherContent> renderingsToAdd = Lists.asList(first, rest);
renderingsToAdd.forEach(this::verifyRendering);
this.renderings.addAll(renderingsToAdd);
... | java | {
"resource": ""
} |
q177290 | ImageApiProfile.merge | test | public static ImageApiProfile merge(List<Profile> profiles) {
return profiles.stream()
.filter(ImageApiProfile.class::isInstance)
.map(ImageApiProfile.class::cast)
.reduce(new ImageApiProfile(), ImageApiProfile::merge);
} | java | {
"resource": ""
} |
q177291 | ImageApiProfile.merge | test | public ImageApiProfile merge(ImageApiProfile other) {
ImageApiProfile merged = new ImageApiProfile();
streamNotNull(this.features).forEach(merged::addFeature);
streamNotNull(other.features).forEach(merged::addFeature);
streamNotNull(this.formats).forEach(merged::addFormat);
streamNotNull(other.forma... | java | {
"resource": ""
} |
q177292 | RotationRequest.fromString | test | @JsonCreator
public static RotationRequest fromString(String str) throws ResolvingException {
Matcher matcher = PATTERN.matcher(str);
if (!matcher.matches()) {
throw new ResolvingException("Bad format: " + str);
}
return new RotationRequest(
new BigDecimal(matcher.group(2)),
!(ma... | java | {
"resource": ""
} |
q177293 | SizeRequest.fromString | test | @JsonCreator
public static SizeRequest fromString(String str) throws ResolvingException {
if (str.equals("full")) {
return new SizeRequest();
}
if (str.equals("max")) {
return new SizeRequest(true);
}
Matcher matcher = PARSE_PAT.matcher(str);
if (!matcher.matches()) {
throw n... | java | {
"resource": ""
} |
q177294 | AndroidDeviceStore.initializeAdbConnection | test | protected void initializeAdbConnection() {
// Get a device bridge instance. Initialize, create and restart.
try {
AndroidDebugBridge.init(true);
} catch (IllegalStateException e) {
// When we keep the adb connection alive the AndroidDebugBridge may
// have been already
// initialized... | java | {
"resource": ""
} |
q177295 | AbstractDevice.getDump | test | public String getDump() {
pushAutomator2Device();
runtest();
String path = pullDump2PC();
String xml = "";
try {
FileInputStream fileInputStream = new FileInputStream(path);
@SuppressWarnings("resource")
BufferedReader in = new BufferedReader(
new InputStreamReader(fileIn... | java | {
"resource": ""
} |
q177296 | AbstractDevice.handlePopBox | test | public boolean handlePopBox(String deviceBrand) {
pushHandleGps2Device();
CommandLine exeCommand = null;
if (deviceBrand.contains("HTC")) {
exeCommand = adbCommand("shell", "uiautomator", "runtest",
"/data/local/tmp/handlePopBox.jar", "-c", "com.test.device.gps.HTCGPSTest");
} else if (... | java | {
"resource": ""
} |
q177297 | AbstractDevice.pushHandleGps2Device | test | private boolean pushHandleGps2Device() {
InputStream io = AbstractDevice.class.getResourceAsStream("handlePopBox.jar");
File dest = new File(FileUtils.getTempDirectory(), "handlePopBox.jar");
try {
FileUtils.copyInputStreamToFile(io, dest);
} catch (IOException e) {
e.printStackTrace();
... | java | {
"resource": ""
} |
q177298 | AbstractDevice.cleanTemp | test | public void cleanTemp() {
CommandLine dumpcommand = adbCommand("shell", "rm", "-r",
"/data/local/tmp/local/tmp/dump.xml");
executeCommandQuietly(dumpcommand);
try {
// give it a second to recover from the activity start
Thread.sleep(1000);
} catch (InterruptedException ie) {
th... | java | {
"resource": ""
} |
q177299 | AbstractDevice.pullDump2PC | test | public String pullDump2PC() {
String serial = device.getSerialNumber();
File dest = new File(FileUtils.getTempDirectory(), serial
+ ".xml");
String path = dest.getPath();
log.debug("pull dump file to pc's path {}", path);
CommandLine commandpull = adbCommand("pull", "/data/local/tmp/local/... | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.