code
stringlengths
73
34.1k
label
stringclasses
1 value
private boolean isApplicable(RepositoryResource resource) { if (resource instanceof ApplicableToProduct) { if (((ApplicableToProduct) resource).getAppliesTo() == null) { return true; // No appliesTo -> applicable } } return ((RepositoryResourceImpl) resour...
java
public Collection<ApplicableToProduct> getNonApplicableResourcesForName(String resourceName) { List<ApplicableToProduct> result = nameToNonApplicableResources.get(resourceName); if (result == null) { // We don't expect this to happen, if we're looking for non-applicable resources, it's beca...
java
protected void close(boolean closeWrapperOnly) throws SQLException { TraceComponent tc = getTracer(); final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(this, tc, "close"); // Make sure we only get closed o...
java
final void closeChildWrappers() { TraceComponent tc = getTracer(); final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // Close any child wrappers in the child wrapper list. if (childWrappers != null && !childWrappers.isEmpty()) { if (isTraceOn && tc.isDe...
java
final void init(WSJdbcObject parent) { if (parent != null) { parentWrapper = parent; dsConfig = parent.dsConfig; freeResourcesOnClose = parent.freeResourcesOnClose; } if (freeResourcesOnClose) // then initialize data structures to track them { ...
java
protected void introspectAll(FFDCLogger info) { info.append(this.toString()); // Allow any wrapper specific info to be inserted first. introspectWrapperSpecificInfo(info); // Display generic information. info.append("Wrapper State: ", state.name()); info.append("...
java
private void gatherMetatypeFilesAndStats() throws IOException, JAXBException { for (File bundle : directory.listFiles()) { if (bundle.isFile()) { analyzeBundle(bundle); } } }
java
static long getFreeSpace(final File fileInFs) { try { long result = (long) getInstance().doPrivileged(new PrivilegedAction<Long>() { public Long run() { return fileInFs.getFreeSpace() ; } }); return result ; } catch (SecurityException se) { return -1 ; } }
java
static Timer createTimer() { try { return getInstance().doPrivileged(new PrivilegedAction<Timer>() { @Override public Timer run() { return new Timer(true); // 691649 } }); } catch (SecurityException se) { // TODO: Add logging here but be careful since this code is used in logging logic i...
java
public <T> Object getBeanKey(Contextual<T> bean) { if (passivationCapable) { // if the return ((PassivationCapable) bean).getId(); } return bean; }
java
public Contextual<?> getBean(Object beanKey) { if (passivationCapable) { return beanManager.getPassivationCapableBean((String) beanKey); } else { return (Contextual<?>) beanKey; } }
java
@Override public ManagedService addingService(ServiceReference<ManagedService> reference) { String[] pids = getServicePid(reference); if (pids == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "handleRegistration(): Invalid service...
java
private LogRecord createLogRecord(Level level, String msg, Object[] params, String sourceClassName, String sourceMethodName, String resourceBundleName, Throwable thrown) { ResourceBundle resourceBundle = null; if (level.intValue() >= this.ivMinimumLocalizationLevelIntValue) { if (null == th...
java
private WsLogRecord createWsLogRecord(Level level, String msg, Object[] params, String sourceClassName, String sourceMethodName, String resourceBundleName, ResourceBundle resourceBundle, Throwable thrown) { WsLogRecord logRecord = new WsLogRecord(level, msg); ...
java
private String computeResourceBundleName() { Logger logger = this; while (logger != null) { String name = logger.getResourceBundleName(); if (name != null) { return name; } logger = logger.getParent(); } return null; }
java
private void introspectViaReflection() { { Class<?> memberClass = _member.getClass(); if (memberClass.isArray()) { int length = Array.getLength(_member); Class<?> componentType = memberClass.getComponentType(); if (componentType.isPrimitive...
java
private void addNewChild(String name, Object value) { IntrospectionLevelMember prospectiveMember = new IntrospectionLevelMember(_level + 1, name, makeDescription(value), makeMember(value), _allKnownMembersInThisTree); if (makeMember(value) != null) { // OK, we'd like to introspect the object...
java
private Object getFieldValue(final Field field) { Object field_value = AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { try { Object value = field.get(_member); // Don't dump sensitive ...
java
private Field[] getFields(final Class<?> currentClass) { final Field[] objectFields = AccessController.doPrivileged(new PrivilegedAction<Field[]>() { @Override public Field[] run() { try { Field[] tempObjectFields = currentClass.getDeclaredFields(); ...
java
private String makeDescription(Object value) { String answer; // Not initialized, so the compiler tells if we miss a // case if (value == null) { answer = "null"; } else if (value instanceof String) { answer = "\"" + value + "\""; } else { ...
java
public void print(IncidentStream is, int maxDepth) { StringBuffer fullName = new StringBuffer(); for (int i = 0; i < _level; i++) fullName.append(" "); fullName.append(_name); is.writeLine(fullName.toString(), _description); if (_level < maxDepth) { List<...
java
public static RecoveryDirector recoveryDirector() throws InternalLogException { if (tc.isEntryEnabled()) Tr.entry(tc, "recoveryDirector"); // If the recovery director is null its an error in JET if (_recoveryDirector == null) { final InternalLogException ile ...
java
public static RecoveryDirector createRecoveryDirector() { if (tc.isEntryEnabled()) Tr.entry(tc, "createRecoveryDirector"); _recoveryDirector = LibertyRecoveryDirectorImpl.instance(); if (tc.isEntryEnabled()) Tr.exit(tc, "createRecoveryDirector", _recoveryDirector); ...
java