id stringlengths 7 14 | text stringlengths 1 106k |
|---|---|
1307227_9 | public static LoggerStore createLoggerStore(final String configuratorType, final String resource) {
final InitialLoggerStoreFactory factory = new InitialLoggerStoreFactory();
final Map<String, Object> data = new HashMap<String, Object>();
data.put(INITIAL_FACTORY, getFactoryClassName(configuratorType));
... |
1312627_0 | public void ping() throws IOException {
pingCount++;
StringBuffer uri = new StringBuffer("http://" + address + "/" + "?");
for (String key : usageDataMap.keySet()) {
uri.append(key);
uri.append("=");
uri.append(usageDataMap.get(key));
uri.append("+");
}
// append coun... |
1312627_1 | public void ping() throws IOException {
pingCount++;
StringBuffer uri = new StringBuffer("http://" + address + "/" + "?");
for (String key : usageDataMap.keySet()) {
uri.append(key);
uri.append("=");
uri.append(usageDataMap.get(key));
uri.append("+");
}
// append coun... |
1312627_2 | public void ping() throws IOException {
pingCount++;
StringBuffer uri = new StringBuffer("http://" + address + "/" + "?");
for (String key : usageDataMap.keySet()) {
uri.append(key);
uri.append("=");
uri.append(usageDataMap.get(key));
uri.append("+");
}
// append coun... |
1312627_3 | public String getName()
{
return this.identifier.indexName;
} |
1312627_4 | public IndexHits<T> get( String key, Object value )
{
return query( type.get( key, value ), key, value, null );
} |
1312627_5 | public static String getKernelRevision()
{
return KERNEL_VERSION.getRevision();
} |
1312627_6 | public boolean contains( int id )
{
for ( int i = 0; i < arrayCount; i++ )
{
if ( rels[i] == id )
{
return true;
}
}
if ( arrayCount == -1 )
{
return relationshipSet.contains( id );
}
return false;
} |
1312627_7 | public ArrayMap()
{
useThreadSafeMap = false;
arrayEntries = new ArrayEntry[toMapThreshold];
} |
1312627_8 | public TxLog( String fileName ) throws IOException
{
if ( fileName == null )
{
throw new IllegalArgumentException( "Null filename" );
}
fileChannel = new RandomAccessFile( fileName, "rw" ).getChannel();
fileChannel.position( fileChannel.size() );
buffer = ByteBuffer.allocateDirect(
... |
1312627_9 | public synchronized void resize( int newMaxSize )
{
if ( newMaxSize < 1 )
{
throw new IllegalArgumentException( "newMaxSize=" + newMaxSize );
}
resizeInternal( newMaxSize );
} |
1313372_0 | @Override
public void parse(Reader in) throws IOException {
texte = new StringBuilder(1024);
ParserDelegator delegator = new ParserDelegator();
delegator.parse(in, this, true);
} |
1313372_1 | public boolean isSpam() throws MessagingException {
String[] spamFlags = this.mimeMessage.getHeader(SPAM_FLAG_HEADER);
if (spamFlags != null) {
for (String flag : spamFlags) {
if ("YES".equalsIgnoreCase(flag)) {
return true;
}
}
}
return false;
} |
1313372_2 | public float getSpamLevel() throws MessagingException {
String[] spamScores = this.mimeMessage.getHeader(SPAM_LEVEL_HEADER);
if (spamScores != null && spamScores.length > 0) {
return Float.parseFloat(spamScores[0]);
}
return 0f;
} |
1313372_3 | public boolean isBounced() throws IOException, MessagingException {
if (isAutomaticMessage()) {
return true;
}
if (mimeMessage.getContent() instanceof Multipart) {
Multipart parts = (Multipart) this.mimeMessage.getContent();
for (int i = 0; i < parts.getCount(); i++) {
String contentType = parts... |
1313372_4 | protected boolean isAutomaticMessage() throws MessagingException {
String[] autoSubmittedHeaders = this.mimeMessage.getHeader(AUTO_SUBMITTED_HEADER);
if (autoSubmittedHeaders != null) {
for (String autoSubmittedHeader : autoSubmittedHeaders) {
if ("auto-generated".equalsIgnoreCase(autoSubmittedHeader) ||
... |
1313372_5 | protected boolean isNotification(String contentType) {
return isDeliveryStatus(contentType) || isMessageReport(contentType);
} |
1313372_6 | protected boolean isDeliveryStatus(String contentType) {
return "message/delivery-status".equalsIgnoreCase(contentType);
} |
1313372_7 | protected boolean isMessageReport(String contentType) {
return contentType.startsWith("multipart/report");
} |
1313372_8 | public boolean isVisible() {
Date today = DateUtil.getDate();
return isVisible(today);
} |
1313372_9 | public void addToAlbums(String... albumIds) {
MediaServiceProvider.getMediaService().addMediaToAlbums(this, albumIds);
} |
1318639_0 | @Override
public OrbTrackerMemberData[] getOrbTrackerMemberData() throws ZooKeeperConnectionException,
WatcherException,
NodeDoesNotExistException {
if (zk == null) {
try {
initializeZooKeeper();
... |
1318639_1 | @Override
public String[] getJobsInQueue() throws NodeDoesNotExistException,
ZooKeeperConnectionException,
WatcherException {
if (zk == null) {
try {
initializeZooKeeper();
} catch (Exception e) {
throw new ZooKeeperConnectionExceptio... |
1318639_2 | @Override
public String[] getJobsInProgress() throws NodeDoesNotExistException,
ZooKeeperConnectionException,
WatcherException {
if (zk == null) {
try {
initializeZooKeeper();
} catch (Exception e) {
throw new ZooKeeperConnectio... |
1319605_0 | InputStream getInputStream(final String path) throws IOException {
final List<URL> urls = Collections.list(loader.getResources(path));
Exceptions.raiseIf(urls.stream().distinct().count() > 1, ValidationException::new,
"More than one %s is found in the classpath", path);
return urls.isEmpty() ? null ... |
1319605_1 | InputStream getInputStream(final String path) throws IOException {
final List<URL> urls = Collections.list(loader.getResources(path));
Exceptions.raiseIf(urls.stream().distinct().count() > 1, ValidationException::new,
"More than one %s is found in the classpath", path);
return urls.isEmpty() ? null ... |
1319605_2 | public BootstrapConfiguration processValidationConfig(final String file,
final ConfigurationImpl targetConfig) {
final ValidationConfigType xmlConfig = parseXmlConfig(file);
if (xmlConfig == null) {
return null;
}
final boolean executableValidationEnabled;
final Set<ExecutableType> defau... |
1319605_3 | public BootstrapConfiguration processValidationConfig(final String file,
final ConfigurationImpl targetConfig) {
final ValidationConfigType xmlConfig = parseXmlConfig(file);
if (xmlConfig == null) {
return null;
}
final boolean executableValidationEnabled;
final Set<ExecutableType> defau... |
1319605_4 | public BootstrapConfiguration processValidationConfig(final String file,
final ConfigurationImpl targetConfig) {
final ValidationConfigType xmlConfig = parseXmlConfig(file);
if (xmlConfig == null) {
return null;
}
final boolean executableValidationEnabled;
final Set<ExecutableType> defau... |
1319605_5 | public static PathImpl createPathFromString(String propertyPath) {
if (propertyPath == null || propertyPath.isEmpty()) {
return create();
}
return PathNavigation.navigateAndReturn(propertyPath, new Builder());
} |
1319605_6 | public static PathImpl createPathFromString(String propertyPath) {
if (propertyPath == null || propertyPath.isEmpty()) {
return create();
}
return PathNavigation.navigateAndReturn(propertyPath, new Builder());
} |
1319605_7 | public static PathImpl createPathFromString(String propertyPath) {
if (propertyPath == null || propertyPath.isEmpty()) {
return create();
}
return PathNavigation.navigateAndReturn(propertyPath, new Builder());
} |
1319605_8 | public static PathImpl createPathFromString(String propertyPath) {
if (propertyPath == null || propertyPath.isEmpty()) {
return create();
}
return PathNavigation.navigateAndReturn(propertyPath, new Builder());
} |
1319605_9 | @Override
public String toString() {
final StringBuilder builder = new StringBuilder();
for (Path.Node node : this) {
NodeImpl.appendNode(node, builder);
}
return builder.toString();
} |
1320181_0 | public static <T> T transportFromPersistence(final Class<T> clazz, final Object persistent)
throws Exception
{
return transform(clazz, clazz, persistent);
} |
1320181_1 | public Category findDefault()
{
return getSingleResult(createCriteria(isDefault()));
} |
1320181_2 | public Category findDefault()
{
return getSingleResult(createCriteria(isDefault()));
} |
1320181_3 | public Category findByNameAndEnterprise(final String categoryName, final Enterprise enterprise)
{
Query query;
if (enterprise == null)
{
query = getSession().createQuery(BY_NAME_AND_NO_ENTERPRISE);
}
else
{
query = getSession().createQuery(BY_NAME_AND_ENTERPRISE);
query.s... |
1320181_4 | public Category findByNameAndEnterprise(final String categoryName, final Enterprise enterprise)
{
Query query;
if (enterprise == null)
{
query = getSession().createQuery(BY_NAME_AND_NO_ENTERPRISE);
}
else
{
query = getSession().createQuery(BY_NAME_AND_ENTERPRISE);
query.s... |
1320181_5 | public boolean existsAnyWithName(final String name)
{
return existsAnyByCriterions(equalsName(name));
} |
1320181_6 | public List<VirtualMachineTemplate> findByEnterprise(final Enterprise enterprise)
{
Criteria criteria = createCriteria(sameEnterpriseOrShared(enterprise));
criteria.addOrder(Order.asc(VirtualMachine.NAME_PROPERTY));
return getResultList(criteria);
} |
1320181_7 | public List<VirtualMachineTemplate> findByEnterpriseAndRepository(final Enterprise enterprise,
final com.abiquo.server.core.infrastructure.Repository repository)
{
Criteria criteria = createCriteria(sameEnterpriseOrSharedInRepo(enterprise, repository));
criteria.addOrder(Order.asc(VirtualMachine.NAME_PROPER... |
1320181_8 | public VirtualMachineTemplate findByName(final String name)
{
return findUniqueByProperty(VirtualMachineTemplate.NAME_PROPERTY, name);
} |
1320181_9 | public VirtualMachineTemplate findByPath(final Enterprise enterprise,
final com.abiquo.server.core.infrastructure.Repository repository, final String path)
{
Criteria criteria =
createCriteria(sameEnterpriseOrSharedInRepo(enterprise, repository, path));
criteria.addOrder(Order.asc(VirtualMachine.NAM... |
1322545_0 | public static boolean validateUrl(String url) {
if (TextUtils.isEmpty(url)) {
return false;
}
pattern = Pattern.compile(URL_PATTERN);
matcher = pattern.matcher(url);
if (matcher.matches()) {
return true;
}
return false;
} |
1322545_1 | public static boolean validateUrl(String url) {
if (TextUtils.isEmpty(url)) {
return false;
}
pattern = Pattern.compile(URL_PATTERN);
matcher = pattern.matcher(url);
if (matcher.matches()) {
return true;
}
return false;
} |
1322545_2 | public static String capitalizeFirstLetter(String text) {
if (text == null) {
return null;
} else if (text.length() == 0) {
return "";
} else if (text.length() == 1) {
return text.toUpperCase();
}
return text.substring(0, 1).toUpperCase() + text.substring(1);
} |
1322545_3 | public static String capitalizeFirstLetter(String text) {
if (text == null) {
return null;
} else if (text.length() == 0) {
return "";
} else if (text.length() == 1) {
return text.toUpperCase();
}
return text.substring(0, 1).toUpperCase() + text.substring(1);
} |
1322545_4 | public static String capitalizeFirstLetter(String text) {
if (text == null) {
return null;
} else if (text.length() == 0) {
return "";
} else if (text.length() == 1) {
return text.toUpperCase();
}
return text.substring(0, 1).toUpperCase() + text.substring(1);
} |
1322545_5 | public static String capitalizeFirstLetter(String text) {
if (text == null) {
return null;
} else if (text.length() == 0) {
return "";
} else if (text.length() == 1) {
return text.toUpperCase();
}
return text.substring(0, 1).toUpperCase() + text.substring(1);
} |
1322545_6 | public static String capitalizeFirstLetter(String text) {
if (text == null) {
return null;
} else if (text.length() == 0) {
return "";
} else if (text.length() == 1) {
return text.toUpperCase();
}
return text.substring(0, 1).toUpperCase() + text.substring(1);
} |
1322545_7 | public boolean routeSms(Message message) {
Logger.log(TAG, "routeSms uuid: " + message.toString());
// Double check if SMSsync service is running
if (!mPrefsFactory.serviceEnabled().get()) {
return false;
}
// Send auto response from phone not server
if (mPrefsFactory.enableReply().get()... |
1322545_8 | public String getPhoneNumber() {
return Utility.getPhoneNumber(mContext, mPrefsFactory);
} |
1322545_9 | @Override
protected Observable buildUseCaseObservable() {
return mFilterRepository.getEntities();
} |
1328283_0 | @Override
public void hash(ByteBuffer value, int hashSize, byte[] hashBytes) {
int seed = INITIAL_SEED;
long hashValue;
for (int i = 0; i <= hashSize - 8; i += 8) {
hashValue = murmurHash64(value, seed);
seed = (int) hashValue;
hashBytes[i] = (byte) ((hashValue >> 56) & 0xff);
hashBytes[i + 1] = (... |
1328283_1 | @Override
public void hash(ByteBuffer value, int hashSize, byte[] hashBytes) {
int seed = INITIAL_SEED;
long hashValue;
for (int i = 0; i <= hashSize - 8; i += 8) {
hashValue = murmurHash64(value, seed);
seed = (int) hashValue;
hashBytes[i] = (byte) ((hashValue >> 56) & 0xff);
hashBytes[i + 1] = (... |
1328283_2 | @Override
public void hash(ByteBuffer value, int hashSize, byte[] hashBytes) {
int seed = INITIAL_SEED;
long hashValue;
for (int i = 0; i <= hashSize - 8; i += 8) {
hashValue = murmurHash64(value, seed);
seed = (int) hashValue;
hashBytes[i] = (byte) ((hashValue >> 56) & 0xff);
hashBytes[i + 1] = (... |
1328283_3 | @Override
public void hash(ByteBuffer value, int hashSize, byte[] hashBytes) {
int seed = INITIAL_SEED;
long hashValue;
for (int i = 0; i <= hashSize - 8; i += 8) {
hashValue = murmurHash64(value, seed);
seed = (int) hashValue;
hashBytes[i] = (byte) ((hashValue >> 56) & 0xff);
hashBytes[i + 1] = (... |
1328283_4 | @Override
public void hash(ByteBuffer value, int hashSize, byte[] hashBytes) {
if (value.remaining() > hashSize) {
throw new IllegalArgumentException("Cannot pad incoming item "+value+" to length "+hashSize+"!");
}
int bytesToPad = hashSize - value.remaining();
System.arraycopy(value.array(), value.arrayOff... |
1328283_5 | public static void encodeLittleEndianFixedWidthLong(long l, byte[] array) {
encodeLittleEndianFixedWidthLong(l, array, 0, array.length);
} |
1328283_6 | public static long decodeLittleEndianFixedWidthLong(ByteBuffer buffer) {
return decodeLittleEndianFixedWidthLong(buffer.array(),
buffer.arrayOffset() + buffer.position(),
buffer.remaining());
} |
1328283_7 | public static int encodeLittleEndianVarInt(int n, byte[] buffer) {
if (n == 0) {
buffer[0] = 0;
return 1;
}
int i = 0;
while (n > 0) {
byte b = (byte) (n & 0x7f);
n >>= 7;
if (n > 0) {
b |= 0x80;
}
buffer[i++] = b;
}
return i;
} |
1328283_8 | public static int decodeLittleEndianVarInt(ByteBuffer buffer) {
byte b = buffer.get();
int result = b & 0x7f;
if ((b & 0x80) > 0) {
b = buffer.get();
result |= ((b & 0x7f) << 7);
if ((b & 0x80) > 0) {
b = buffer.get();
result |= ((b & 0x7f) << 14);
if ((b & 0x80) > 0) {
b = b... |
1328283_9 | @Override
public boolean claimRingGroupConductor(RingGroupConductorMode mode) throws IOException {
try {
if (zk.exists(ringGroupConductorOnlinePath, false) == null) {
zk.create(ringGroupConductorOnlinePath, BytesUtils.stringToBytes(mode.toString()), CreateMode.EPHEMERAL);
return true;
}
return... |
1337781_0 | <T> T imposterise(MethodInterceptor interceptor, Class<T> mockedType, Class<?>... ancillaryTypes) {
return INSTANCE.imposteriseProtected(interceptor, mockedType, ancillaryTypes);
} |
1337781_1 | <T> T imposterise(MethodInterceptor interceptor, Class<T> mockedType, Class<?>... ancillaryTypes) {
return INSTANCE.imposteriseProtected(interceptor, mockedType, ancillaryTypes);
} |
1337781_2 | <T> T imposterise(MethodInterceptor interceptor, Class<T> mockedType, Class<?>... ancillaryTypes) {
return INSTANCE.imposteriseProtected(interceptor, mockedType, ancillaryTypes);
} |
1337781_3 | <T> T imposterise(MethodInterceptor interceptor, Class<T> mockedType, Class<?>... ancillaryTypes) {
return INSTANCE.imposteriseProtected(interceptor, mockedType, ancillaryTypes);
} |
1337781_4 | <T> T imposterise(MethodInterceptor interceptor, Class<T> mockedType, Class<?>... ancillaryTypes) {
return INSTANCE.imposteriseProtected(interceptor, mockedType, ancillaryTypes);
} |
1337781_5 | @Override
public boolean canProvide(Class<?> type) {
return type.getName().equals(getReturnType());
} |
1337781_6 | @Override
public boolean canProvide(Class<?> type) {
return type.getName().equals(getReturnType());
} |
1337781_7 | @Override
public void enrich(final SearchContext searchContext, Object target) {
List<Field> fields = FindByUtilities.getListOfFieldsAnnotatedWithFindBys(target);
for (Field field : fields) {
GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext)
... |
1337781_8 | @Override
public void enrich(final SearchContext searchContext, Object target) {
List<Field> fields = FindByUtilities.getListOfFieldsAnnotatedWithFindBys(target);
for (Field field : fields) {
GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext)
... |
1337781_9 | @Override
public void enrich(final SearchContext searchContext, Object target) {
List<Field> fields = FindByUtilities.getListOfFieldsAnnotatedWithFindBys(target);
for (Field field : fields) {
GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext)
... |
1338456_0 | public static <T> byte[] fromObject(T value)
{
ON_MAPPER.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
ON_MAPPER.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
ON_MAPPER.getSerializationConfig().withSerializationInclusion(Include.NON_NULL);
JSON_MAPPER.getSerializationConfig().setDate... |
1338456_1 | public void add(final LabelCounters diff)
{
if (diff.totalBytes != null) {
this.totalBytes += diff.totalBytes;
}
if (diff.totalMessages != null) {
this.totalMessages += diff.totalMessages;
}
if (diff.unreadMessages != null) {
this.unreadMessages += diff.unreadMessages;
}
} |
1338456_2 | static String getLabelKey(final String mailbox, final int label)
{
return getLabelKey(mailbox, Integer.toString(label));
} |
1338456_3 | static String getLabelKey(final String mailbox, final int label)
{
return getLabelKey(mailbox, Integer.toString(label));
} |
1341207_0 | @Override
@Nonnull
public List<L> getListeners() {
final List<L> result;
synchronized (listeners) {
result = new ArrayList<L>(listeners.size());
// copy listeners and remove garbage collected references
for (Iterator<R> it = listeners.iterator(); it.hasNext(); ) {
final R r = it.next();
final L l = r.get(... |
1341207_1 | @Nonnull
@Override
public <LE extends L> List<LE> getListenersOfType(@Nonnull Class<LE> type) {
final List<L> listeners = getListeners();
final List<LE> result = new ArrayList<LE>(listeners.size());
for (L listener : listeners) {
if (type.isAssignableFrom(listener.getClass())) {
result.add((LE) listener);
}
... |
1341207_2 | @Override
public void fireEvent(@Nonnull final E event) {
fireEvents(Arrays.asList(event));
} |
1341207_3 | @Override
public boolean addListener(@Nonnull L listener) {
if (!baseEventType.isAssignableFrom(listener.getEventType())) {
throw new IllegalArgumentException("Current listener cannot be added, because will never be fired!");
}
return listeners.addListener(listener);
} |
1341207_4 | @Override
public boolean removeListener(@Nonnull L listener) {
return listeners.removeListener(listener);
} |
1341207_5 | @Nonnull
public static <T extends Number & Comparable<T>> NumberIntervalMapper<T> of(@Nonnull Class<T> clazz) {
return new NumberIntervalMapper<T>(clazz);
} |
1341207_6 | @Nonnull
@Override
public SecretKey getSecretKey(@Nonnull String secret, @Nonnull byte[] salt) throws CiphererException {
final String secretKey = secret + Bytes.toHex(salt);
try {
final MessageDigest sha = MessageDigest.getInstance("SHA-1");
byte[] secretKeyHash = sha.digest(secretKey.getBytes(Charsets.UTF_8));
... |
1341207_7 | @Override
public void removeNodeIf(@Nonnull JPredicate<? super TreeNode<T>> filter) {
Collections.removeIf(this.iterator(), filter);
} |
1341207_8 | @Nonnull
public PrefixTreeNode getRoot() {
return root;
} |
1341207_9 | public boolean containsString(@Nonnull String s) {
return root.containsString(s, 0);
} |
1342891_0 | public <T extends Mapping> T findMapping(MappingType type)
{
return this.findMapping(type, null);
} |
1342891_1 | @Override
public boolean equals(final Object o)
{
if (this == o) { return true; }
if (!(o instanceof InteractionUnit)) { return false; }
InteractionUnit that = (InteractionUnit) o;
if (!id.equals(that.id)) { return false; }
return true;
} |
1342891_2 | public void addMapping(Mapping mapping)
{
if (mapping != null)
{
mappings.put(mapping.getType(), mapping);
}
} |
1342891_3 | @Override
public void execute(final Dialog dialog, final Context context) throws ReificationException
{
IdVisitor idVisitor = new IdVisitor();
dialog.getInterfaceModel().accept(idVisitor);
boolean comma = false;
StringBuilder message = new StringBuilder();
Map<QName, Integer> idCount = idVisitor.get... |
1342891_4 | @Override
public void execute(final Dialog dialog, final Context context) throws ReificationException
{
IdVisitor idVisitor = new IdVisitor();
dialog.getInterfaceModel().accept(idVisitor);
boolean comma = false;
StringBuilder message = new StringBuilder();
Map<QName, Integer> idCount = idVisitor.get... |
1342891_5 | public CellTree parse(List<Property> model) {
stack.push(root);
parseSiblings(model, "");
return cellTree;
} |
1342891_6 | SingleSelectionModel<JndiEntry> getSelectionModel() {
return selectionModel;
} |
1342891_7 | @Override
public void loadEntities(String nameEditedOrAdded) {
loadEntities(nameEditedOrAdded, Baseadress.get());
} |
1342891_8 | @Override
public void loadEntities(String nameEditedOrAdded) {
loadEntities(nameEditedOrAdded, Baseadress.get());
} |
1346655_0 | public Image tomato() {
int size = tray.iconSize().height;
Image image = tomato(size);
if (image == null) {
image = tomato(DEFAULT_ICON_SIZE);
}
return image;
} |
1346655_1 | public Image tomato() {
int size = tray.iconSize().height;
Image image = tomato(size);
if (image == null) {
image = tomato(DEFAULT_ICON_SIZE);
}
return image;
} |
1346655_2 | public Image image(final String resourceName) {
final URL imageUrl = getClass().getResource(resourceName);
if (imageUrl != null) {
try {
return ImageIO.read(imageUrl);
} catch (IOException e) {
logger.error("Could not load image: " + resourceName, e);
}
}
return null;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.