method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
/** * Handles the HTTP <code>GET</code> method. * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>GET</code> method
doGet
{ "repo_name": "BijayaDas/FriendSociety", "path": "src/java/com/friend/UpdateContactInfo.java", "license": "mit", "size": 3974 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
752,672
@JsonCreator public static Version fromString(String versionString) throws IllegalArgumentException { Matcher versionMatcher = VERSION_PATTERN.matcher(versionString); if (!versionMatcher.find()) { throw new IllegalArgumentException(String.format(EXCEPTION_STRING_NOT_VERSION, versionString)); } return new Version(Integer.parseInt(versionMatcher.group(1)), Integer.parseInt(versionMatcher.group(2)), Integer.parseInt(versionMatcher.group(3)), versionMatcher.group(4) == null ? false : true); }
static Version function(String versionString) throws IllegalArgumentException { Matcher versionMatcher = VERSION_PATTERN.matcher(versionString); if (!versionMatcher.find()) { throw new IllegalArgumentException(String.format(EXCEPTION_STRING_NOT_VERSION, versionString)); } return new Version(Integer.parseInt(versionMatcher.group(1)), Integer.parseInt(versionMatcher.group(2)), Integer.parseInt(versionMatcher.group(3)), versionMatcher.group(4) == null ? false : true); }
/** * Parses a version number string in the format V1.2.3. * @param versionString version number string * @return a Version object */
Parses a version number string in the format V1.2.3
fromString
{ "repo_name": "CS2103JAN2017-T15-B2/main", "path": "src/main/java/watodo/commons/core/Version.java", "license": "mit", "size": 2986 }
[ "java.util.regex.Matcher" ]
import java.util.regex.Matcher;
import java.util.regex.*;
[ "java.util" ]
java.util;
2,112,352
@Test public void indexUpdateCompletedWrapsFromMaxIntegerToNegativeValue() { statistics.incInt(indexUpdateCompletedId, Integer.MAX_VALUE); cachePerfStats.endIndexUpdate(1); assertThat(cachePerfStats.getIndexUpdateCompleted()).isNegative(); }
void function() { statistics.incInt(indexUpdateCompletedId, Integer.MAX_VALUE); cachePerfStats.endIndexUpdate(1); assertThat(cachePerfStats.getIndexUpdateCompleted()).isNegative(); }
/** * Characterization test: {@code indexUpdateCompleted} currently wraps to negative from max * integer value. */
Characterization test: indexUpdateCompleted currently wraps to negative from max integer value
indexUpdateCompletedWrapsFromMaxIntegerToNegativeValue
{ "repo_name": "davebarnes97/geode", "path": "geode-core/src/test/java/org/apache/geode/internal/cache/CachePerfStatsTest.java", "license": "apache-2.0", "size": 34945 }
[ "org.assertj.core.api.Assertions" ]
import org.assertj.core.api.Assertions;
import org.assertj.core.api.*;
[ "org.assertj.core" ]
org.assertj.core;
996,714
int size(WALRecord record) throws IgniteCheckedException;
int size(WALRecord record) throws IgniteCheckedException;
/** * Calculates size of record data. * * @param record WAL record. * @return Size of record in bytes. * @throws IgniteCheckedException If it's unable to calculate record data size. */
Calculates size of record data
size
{ "repo_name": "dream-x/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/RecordDataSerializer.java", "license": "apache-2.0", "size": 2225 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.pagemem.wal.record.WALRecord" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.pagemem.wal.record.WALRecord;
import org.apache.ignite.*; import org.apache.ignite.internal.pagemem.wal.record.*;
[ "org.apache.ignite" ]
org.apache.ignite;
650,506
private void startSession(boolean relaunch, String sessionId, ResultBundleHandler resultBundleHandler) { Intent intent = new Intent(MediaControlIntent.ACTION_START_SESSION); intent.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); intent.putExtra(CastMediaControlIntent.EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS, true); intent.putExtra(MediaControlIntent.EXTRA_SESSION_STATUS_UPDATE_RECEIVER, mSessionStatusUpdateIntent); intent.putExtra(CastMediaControlIntent.EXTRA_CAST_APPLICATION_ID, getCastReceiverId()); intent.putExtra(CastMediaControlIntent.EXTRA_CAST_RELAUNCH_APPLICATION, relaunch); if (sessionId != null) intent.putExtra(MediaControlIntent.EXTRA_SESSION_ID, sessionId); addIntentExtraForDebugLogging(intent); sendIntentToRoute(intent, resultBundleHandler); }
void function(boolean relaunch, String sessionId, ResultBundleHandler resultBundleHandler) { Intent intent = new Intent(MediaControlIntent.ACTION_START_SESSION); intent.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); intent.putExtra(CastMediaControlIntent.EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS, true); intent.putExtra(MediaControlIntent.EXTRA_SESSION_STATUS_UPDATE_RECEIVER, mSessionStatusUpdateIntent); intent.putExtra(CastMediaControlIntent.EXTRA_CAST_APPLICATION_ID, getCastReceiverId()); intent.putExtra(CastMediaControlIntent.EXTRA_CAST_RELAUNCH_APPLICATION, relaunch); if (sessionId != null) intent.putExtra(MediaControlIntent.EXTRA_SESSION_ID, sessionId); addIntentExtraForDebugLogging(intent); sendIntentToRoute(intent, resultBundleHandler); }
/** * Send a start session intent. * * @param relaunch Whether we should relaunch the cast application. * @param resultBundleHandler BundleHandler to handle reply. */
Send a start session intent
startSession
{ "repo_name": "danakj/chromium", "path": "chrome/android/java/src/org/chromium/chrome/browser/media/remote/DefaultMediaRouteController.java", "license": "bsd-3-clause", "size": 34528 }
[ "android.content.Intent", "android.support.v7.media.MediaControlIntent", "com.google.android.gms.cast.CastMediaControlIntent" ]
import android.content.Intent; import android.support.v7.media.MediaControlIntent; import com.google.android.gms.cast.CastMediaControlIntent;
import android.content.*; import android.support.v7.media.*; import com.google.android.gms.cast.*;
[ "android.content", "android.support", "com.google.android" ]
android.content; android.support; com.google.android;
634,821
public void removeChangeListener(TitleChangeListener listener) { this.listenerList.remove(listener); }
void function(TitleChangeListener listener) { this.listenerList.remove(listener); }
/** * Unregisters an object for notification of changes to the chart title. * * @param listener the object that is being unregistered. */
Unregisters an object for notification of changes to the chart title
removeChangeListener
{ "repo_name": "djun100/afreechart", "path": "src/org/afree/chart/title/Title.java", "license": "lgpl-3.0", "size": 15564 }
[ "org.afree.chart.event.TitleChangeListener" ]
import org.afree.chart.event.TitleChangeListener;
import org.afree.chart.event.*;
[ "org.afree.chart" ]
org.afree.chart;
963,631
public boolean shouldExecute() { return this.rabbit.getRabbitType() != 99 && super.shouldExecute(); } } static class AIEvilAttack extends EntityAIAttackMelee { public AIEvilAttack(EntityRabbit rabbit) { super(rabbit, 1.4D, true); }
boolean function() { return this.rabbit.getRabbitType() != 99 && super.shouldExecute(); } } static class AIEvilAttack extends EntityAIAttackMelee { public AIEvilAttack(EntityRabbit rabbit) { super(rabbit, 1.4D, true); }
/** * Returns whether the EntityAIBase should begin execution. */
Returns whether the EntityAIBase should begin execution
shouldExecute
{ "repo_name": "TheGreatAndPowerfulWeegee/wipunknown", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/passive/EntityRabbit.java", "license": "gpl-3.0", "size": 24853 }
[ "net.minecraft.entity.ai.EntityAIAttackMelee" ]
import net.minecraft.entity.ai.EntityAIAttackMelee;
import net.minecraft.entity.ai.*;
[ "net.minecraft.entity" ]
net.minecraft.entity;
1,792,072
int countByExample(DpInfoExample example);
int countByExample(DpInfoExample example);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table dp_info * * @mbggenerated */
This method was generated by MyBatis Generator. This method corresponds to the database table dp_info
countByExample
{ "repo_name": "gubaijin/gplucky", "path": "common/src/main/java/com/gplucky/mybatis/dao/DpInfoMapper.java", "license": "apache-2.0", "size": 2600 }
[ "com.gplucky.mybatis.model.DpInfoExample" ]
import com.gplucky.mybatis.model.DpInfoExample;
import com.gplucky.mybatis.model.*;
[ "com.gplucky.mybatis" ]
com.gplucky.mybatis;
949,331
public ServiceFuture<PrivateLinkHubInner> updateAsync(String resourceGroupName, String privateLinkHubName, Map<String, String> tags, final ServiceCallback<PrivateLinkHubInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateLinkHubName, tags), serviceCallback); }
ServiceFuture<PrivateLinkHubInner> function(String resourceGroupName, String privateLinkHubName, Map<String, String> tags, final ServiceCallback<PrivateLinkHubInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, privateLinkHubName, tags), serviceCallback); }
/** * Updates a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateLinkHubName The name of the privateLinkHub * @param tags Resource tags * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Updates a privateLinkHub
updateAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubsInner.java", "license": "mit", "size": 57290 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture", "java.util.Map" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import java.util.Map;
import com.microsoft.rest.*; import java.util.*;
[ "com.microsoft.rest", "java.util" ]
com.microsoft.rest; java.util;
1,859,676
public EnumCreatureAttribute getCreatureAttribute() { return EnumCreatureAttribute.ARTHROPOD; }
EnumCreatureAttribute function() { return EnumCreatureAttribute.ARTHROPOD; }
/** * Get this Entity's EnumCreatureAttribute */
Get this Entity's EnumCreatureAttribute
getCreatureAttribute
{ "repo_name": "DirectCodeGraveyard/Minetweak", "path": "src/main/java/net/minecraft/entity/EntitySilverfish.java", "license": "lgpl-3.0", "size": 8355 }
[ "net.minecraft.utils.enums.EnumCreatureAttribute" ]
import net.minecraft.utils.enums.EnumCreatureAttribute;
import net.minecraft.utils.enums.*;
[ "net.minecraft.utils" ]
net.minecraft.utils;
2,881,274
@SuppressWarnings("finally") @RequestMapping(value = "/getAllEventPublish", method = RequestMethod.GET) public EventResponse getAll() { EventResponse response = new EventResponse(); ; try { response.setCode(200); response.setCodeMessage("eventsPublish fetch success"); response.setEventList(eventServiceInterface.getAllEventPublish()); } catch (Exception e) { response.setCode(500); response.setCodeMessage(e.toString()); e.printStackTrace(); } finally { return response; } }
@SuppressWarnings(STR) @RequestMapping(value = STR, method = RequestMethod.GET) EventResponse function() { EventResponse response = new EventResponse(); ; try { response.setCode(200); response.setCodeMessage(STR); response.setEventList(eventServiceInterface.getAllEventPublish()); } catch (Exception e) { response.setCode(500); response.setCodeMessage(e.toString()); e.printStackTrace(); } finally { return response; } }
/*** * Obtiene todos los eventos que han sido publicados. * * @author Enmanuel García González * @return * @version 1.0 */
Obtiene todos los eventos que han sido publicados
getAll
{ "repo_name": "pigleth96/Softlutions", "path": "dondeEs/src/main/java/com/cenfotec/dondeEs/controller/EventController.java", "license": "cc0-1.0", "size": 12177 }
[ "com.cenfotec.dondeEs.contracts.EventResponse", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod" ]
import com.cenfotec.dondeEs.contracts.EventResponse; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
import com.cenfotec.*; import org.springframework.web.bind.annotation.*;
[ "com.cenfotec", "org.springframework.web" ]
com.cenfotec; org.springframework.web;
2,397,351
public static boolean hasAccessMode(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource) { return Base.has(model, instanceResource, ACCESSMODE); }
static boolean function(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource) { return Base.has(model, instanceResource, ACCESSMODE); }
/** * Check if org.ontoware.rdfreactor.generator.java.JProperty@33037ca5 has at * least one value set * * @param model an RDF2Go model * @param resource an RDF2Go resource * @return true if this property has at least one value [Generated from * RDFReactor template rule #get0has-static] */
Check if org.ontoware.rdfreactor.generator.java.JProperty@33037ca5 has at least one value set
hasAccessMode
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-w3-wacl/src/main/java/org/w3/ns/auth/acl/Authorization.java", "license": "mit", "size": 78044 }
[ "org.ontoware.rdf2go.model.Model", "org.ontoware.rdf2go.model.node.Resource", "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.rdf2go.model.Model; import org.ontoware.rdf2go.model.node.Resource; import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.rdf2go.model.*; import org.ontoware.rdf2go.model.node.*; import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.rdf2go", "org.ontoware.rdfreactor" ]
org.ontoware.rdf2go; org.ontoware.rdfreactor;
675,076
public static long calculateHeapSizeMB(long totalJavaMemorySizeMB, Configuration config) { Preconditions.checkArgument(totalJavaMemorySizeMB > 0); // subtract the Java memory used for network buffers (always off-heap) final long networkBufMB = NettyShuffleEnvironmentConfiguration.calculateNetworkBufferMemory( totalJavaMemorySizeMB << 20, // megabytes to bytes config) >> 20; // bytes to megabytes final long remainingJavaMemorySizeMB = totalJavaMemorySizeMB - networkBufMB; // split the available Java memory between heap and off-heap final boolean useOffHeap = config.getBoolean(TaskManagerOptions.MEMORY_OFF_HEAP); final long heapSizeMB; if (useOffHeap) { long offHeapSize; String managedMemorySizeDefaultVal = TaskManagerOptions.MANAGED_MEMORY_SIZE.defaultValue(); if (!config.getString(TaskManagerOptions.MANAGED_MEMORY_SIZE).equals(managedMemorySizeDefaultVal)) { try { offHeapSize = MemorySize.parse(config.getString(TaskManagerOptions.MANAGED_MEMORY_SIZE), MEGA_BYTES).getMebiBytes(); } catch (IllegalArgumentException e) { throw new IllegalConfigurationException( "Could not read " + TaskManagerOptions.MANAGED_MEMORY_SIZE.key(), e); } } else { offHeapSize = Long.valueOf(managedMemorySizeDefaultVal); } if (offHeapSize <= 0) { // calculate off-heap section via fraction double fraction = config.getFloat(TaskManagerOptions.MANAGED_MEMORY_FRACTION); offHeapSize = (long) (fraction * remainingJavaMemorySizeMB); } ConfigurationParserUtils.checkConfigParameter(offHeapSize < remainingJavaMemorySizeMB, offHeapSize, TaskManagerOptions.MANAGED_MEMORY_SIZE.key(), "Managed memory size too large for " + networkBufMB + " MB network buffer memory and a total of " + totalJavaMemorySizeMB + " MB JVM memory"); heapSizeMB = remainingJavaMemorySizeMB - offHeapSize; } else { heapSizeMB = remainingJavaMemorySizeMB; } return heapSizeMB; }
static long function(long totalJavaMemorySizeMB, Configuration config) { Preconditions.checkArgument(totalJavaMemorySizeMB > 0); final long networkBufMB = NettyShuffleEnvironmentConfiguration.calculateNetworkBufferMemory( totalJavaMemorySizeMB << 20, config) >> 20; final long remainingJavaMemorySizeMB = totalJavaMemorySizeMB - networkBufMB; final boolean useOffHeap = config.getBoolean(TaskManagerOptions.MEMORY_OFF_HEAP); final long heapSizeMB; if (useOffHeap) { long offHeapSize; String managedMemorySizeDefaultVal = TaskManagerOptions.MANAGED_MEMORY_SIZE.defaultValue(); if (!config.getString(TaskManagerOptions.MANAGED_MEMORY_SIZE).equals(managedMemorySizeDefaultVal)) { try { offHeapSize = MemorySize.parse(config.getString(TaskManagerOptions.MANAGED_MEMORY_SIZE), MEGA_BYTES).getMebiBytes(); } catch (IllegalArgumentException e) { throw new IllegalConfigurationException( STR + TaskManagerOptions.MANAGED_MEMORY_SIZE.key(), e); } } else { offHeapSize = Long.valueOf(managedMemorySizeDefaultVal); } if (offHeapSize <= 0) { double fraction = config.getFloat(TaskManagerOptions.MANAGED_MEMORY_FRACTION); offHeapSize = (long) (fraction * remainingJavaMemorySizeMB); } ConfigurationParserUtils.checkConfigParameter(offHeapSize < remainingJavaMemorySizeMB, offHeapSize, TaskManagerOptions.MANAGED_MEMORY_SIZE.key(), STR + networkBufMB + STR + totalJavaMemorySizeMB + STR); heapSizeMB = remainingJavaMemorySizeMB - offHeapSize; } else { heapSizeMB = remainingJavaMemorySizeMB; } return heapSizeMB; }
/** * Calculates the amount of heap memory to use (to set via <tt>-Xmx</tt> and <tt>-Xms</tt>) * based on the total memory to use and the given configuration parameters. * * @param totalJavaMemorySizeMB * overall available memory to use (heap and off-heap) * @param config * configuration object * * @return heap memory to use (in megabytes) */
Calculates the amount of heap memory to use (to set via -Xmx and -Xms) based on the total memory to use and the given configuration parameters
calculateHeapSizeMB
{ "repo_name": "shaoxuan-wang/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskManagerServices.java", "license": "apache-2.0", "size": 19944 }
[ "org.apache.flink.configuration.Configuration", "org.apache.flink.configuration.IllegalConfigurationException", "org.apache.flink.configuration.MemorySize", "org.apache.flink.configuration.TaskManagerOptions", "org.apache.flink.runtime.taskmanager.NettyShuffleEnvironmentConfiguration", "org.apache.flink.runtime.util.ConfigurationParserUtils", "org.apache.flink.util.Preconditions" ]
import org.apache.flink.configuration.Configuration; import org.apache.flink.configuration.IllegalConfigurationException; import org.apache.flink.configuration.MemorySize; import org.apache.flink.configuration.TaskManagerOptions; import org.apache.flink.runtime.taskmanager.NettyShuffleEnvironmentConfiguration; import org.apache.flink.runtime.util.ConfigurationParserUtils; import org.apache.flink.util.Preconditions;
import org.apache.flink.configuration.*; import org.apache.flink.runtime.taskmanager.*; import org.apache.flink.runtime.util.*; import org.apache.flink.util.*;
[ "org.apache.flink" ]
org.apache.flink;
886,346
void storeOnDisk(KeysetHandle keysetHandle, String context, EncryptionType encryptionType) throws IOException { // try to delete first deleteFromDisk(context, encryptionType); // yes, Google Tink fails to close their streams if using any of the other utility methods, so we have to pass our own stream to avoid a file handler leak... // https://github.com/google/tink/issues/316 OutputStream outputStream = Files.newOutputStream(createFilePath(context, encryptionType)); KeysetWriter writer = JsonKeysetWriter.withOutputStream(outputStream); CleartextKeysetHandle.write(keysetHandle, writer); try { outputStream.close(); } catch (Exception e) { LogService.getRoot().log(Level.WARNING, "Failed to close encryption keyhandle writer!", e); } }
void storeOnDisk(KeysetHandle keysetHandle, String context, EncryptionType encryptionType) throws IOException { deleteFromDisk(context, encryptionType); OutputStream outputStream = Files.newOutputStream(createFilePath(context, encryptionType)); KeysetWriter writer = JsonKeysetWriter.withOutputStream(outputStream); CleartextKeysetHandle.write(keysetHandle, writer); try { outputStream.close(); } catch (Exception e) { LogService.getRoot().log(Level.WARNING, STR, e); } }
/** * Stores the given keyset handle for the given context and encryption type on disk. Will overwrite an existing file. * * @param keysetHandle the keyset handle to persist to disk * @param context the context key of the keyset handle to persist * @param encryptionType the {@link EncryptionType} of the keyset handle to persist * @throws IOException if storing on disk fails */
Stores the given keyset handle for the given context and encryption type on disk. Will overwrite an existing file
storeOnDisk
{ "repo_name": "rapidminer/rapidminer-studio", "path": "src/main/java/com/rapidminer/tools/encryption/EncryptionFileUtils.java", "license": "agpl-3.0", "size": 8198 }
[ "com.google.crypto.tink.CleartextKeysetHandle", "com.google.crypto.tink.JsonKeysetWriter", "com.google.crypto.tink.KeysetHandle", "com.google.crypto.tink.KeysetWriter", "com.rapidminer.tools.LogService", "java.io.IOException", "java.io.OutputStream", "java.nio.file.Files", "java.util.logging.Level" ]
import com.google.crypto.tink.CleartextKeysetHandle; import com.google.crypto.tink.JsonKeysetWriter; import com.google.crypto.tink.KeysetHandle; import com.google.crypto.tink.KeysetWriter; import com.rapidminer.tools.LogService; import java.io.IOException; import java.io.OutputStream; import java.nio.file.Files; import java.util.logging.Level;
import com.google.crypto.tink.*; import com.rapidminer.tools.*; import java.io.*; import java.nio.file.*; import java.util.logging.*;
[ "com.google.crypto", "com.rapidminer.tools", "java.io", "java.nio", "java.util" ]
com.google.crypto; com.rapidminer.tools; java.io; java.nio; java.util;
85,481
private boolean isOfInterest(Field field) { return !field.isAnnotationPresent(Ignore.class) && ((field.getModifiers() & NOT_SAVEABLE_MODIFIERS) == 0) && !field.isSynthetic() && !field.getName().startsWith("bitmap$init"); // Scala adds a field bitmap$init$0 and bitmap$init$1 etc }
boolean function(Field field) { return !field.isAnnotationPresent(Ignore.class) && ((field.getModifiers() & NOT_SAVEABLE_MODIFIERS) == 0) && !field.isSynthetic() && !field.getName().startsWith(STR); }
/** * Determine if we should create a Property for the field. Things we ignore: static, final, @Ignore, synthetic */
Determine if we should create a Property for the field. Things we ignore: static, final, @Ignore, synthetic
isOfInterest
{ "repo_name": "asolfre/objectify-appengine", "path": "src/main/java/com/googlecode/objectify/impl/translate/ClassPopulator.java", "license": "mit", "size": 7193 }
[ "com.googlecode.objectify.annotation.Ignore", "java.lang.reflect.Field" ]
import com.googlecode.objectify.annotation.Ignore; import java.lang.reflect.Field;
import com.googlecode.objectify.annotation.*; import java.lang.reflect.*;
[ "com.googlecode.objectify", "java.lang" ]
com.googlecode.objectify; java.lang;
122,943
LOGGER.debug("########### SuitabilityAnalysisReportDaoTest "); WifProject project = new WifProject(); project.setName("test"); project.setRoleOwner("aurin"); WifProject createProject = wifProjectDao.persistProject(project); newProjectId = createProject.getId(); LOGGER.debug("project uuid: " + createProject.getId()); Assert.assertNotNull(newProjectId); }
LOGGER.debug(STR); WifProject project = new WifProject(); project.setName("test"); project.setRoleOwner("aurin"); WifProject createProject = wifProjectDao.persistProject(project); newProjectId = createProject.getId(); LOGGER.debug(STR + createProject.getId()); Assert.assertNotNull(newProjectId); }
/** * Load test project. * * @throws Exception * the exception */
Load test project
loadTestProject
{ "repo_name": "tosseto/online-whatif", "path": "src/test/java/au/org/aurin/wif/repo/impl/reports/CouchSuitabilityAnalysisReportDaoIT.java", "license": "mit", "size": 6405 }
[ "au.org.aurin.wif.model.WifProject", "org.testng.Assert" ]
import au.org.aurin.wif.model.WifProject; import org.testng.Assert;
import au.org.aurin.wif.model.*; import org.testng.*;
[ "au.org.aurin", "org.testng" ]
au.org.aurin; org.testng;
2,632,109
public Settings settings() { return this.settings; }
Settings function() { return this.settings; }
/** * The settings that were used to create the node. */
The settings that were used to create the node
settings
{ "repo_name": "shashi95/kafkaES", "path": "core/src/main/java/org/elasticsearch/node/Node.java", "license": "apache-2.0", "size": 18714 }
[ "org.elasticsearch.common.settings.Settings" ]
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
1,835,220
public Object clone () { if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) { MODELMBEAN_LOGGER.log(Level.TRACE, "Entry"); } return(new ModelMBeanNotificationInfo(this)); }
Object function () { if (MODELMBEAN_LOGGER.isLoggable(Level.TRACE)) { MODELMBEAN_LOGGER.log(Level.TRACE, "Entry"); } return(new ModelMBeanNotificationInfo(this)); }
/** * Creates and returns a new ModelMBeanNotificationInfo which is a * duplicate of this ModelMBeanNotificationInfo. **/
Creates and returns a new ModelMBeanNotificationInfo which is a duplicate of this ModelMBeanNotificationInfo
clone
{ "repo_name": "YouDiSN/OpenJDK-Research", "path": "jdk9/jdk/src/java.management/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java", "license": "gpl-2.0", "size": 16155 }
[ "java.lang.System" ]
import java.lang.System;
import java.lang.*;
[ "java.lang" ]
java.lang;
2,756,162
// This test is not valid. When listenForDataSerializeChanges is called // it ALWAYS does vrecman writes and a commit. Look at saveInstantiators // and saveDataSerializers to see these commit calls. // These calls can cause the size of the files to change. public void testSizeStatsAfterRecreation() throws Exception { final int MAX_OPLOG_SIZE = 500; diskProps.setMaxOplogSize(MAX_OPLOG_SIZE); diskProps.setPersistBackup(true); diskProps.setRolling(false); diskProps.setSynchronous(true); diskProps.setOverflow(false); diskProps.setDiskDirsAndSizes(new File[] { dirs[0],dirs[1] }, new int[] { 4000,4000 }); final byte[] val = new byte[200]; region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL); DiskRegion dr = ((LocalRegion)region).getDiskRegion(); try { LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true; for(int i = 0; i < 8;++i) { region.put("key"+i, val); } long size1 =0; for(DirectoryHolder dh:dr.getDirectories()) { size1 += dh.getDirStatsDiskSpaceUsage(); } System.out.println("Size before close = "+ size1); region.close(); region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL); dr = ((LocalRegion)region).getDiskRegion(); long size2 =0; for(DirectoryHolder dh:dr.getDirectories()) { size2 += dh.getDirStatsDiskSpaceUsage(); } System.out.println("Size after recreation= "+ size2); assertEquals(size1, size2); region.close(); } finally { LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false; } }
void function() throws Exception { final int MAX_OPLOG_SIZE = 500; diskProps.setMaxOplogSize(MAX_OPLOG_SIZE); diskProps.setPersistBackup(true); diskProps.setRolling(false); diskProps.setSynchronous(true); diskProps.setOverflow(false); diskProps.setDiskDirsAndSizes(new File[] { dirs[0],dirs[1] }, new int[] { 4000,4000 }); final byte[] val = new byte[200]; region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL); DiskRegion dr = ((LocalRegion)region).getDiskRegion(); try { LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true; for(int i = 0; i < 8;++i) { region.put("key"+i, val); } long size1 =0; for(DirectoryHolder dh:dr.getDirectories()) { size1 += dh.getDirStatsDiskSpaceUsage(); } System.out.println(STR+ size1); region.close(); region = DiskRegionHelperFactory.getSyncPersistOnlyRegion(cache, diskProps, Scope.LOCAL); dr = ((LocalRegion)region).getDiskRegion(); long size2 =0; for(DirectoryHolder dh:dr.getDirectories()) { size2 += dh.getDirStatsDiskSpaceUsage(); } System.out.println(STR+ size2); assertEquals(size1, size2); region.close(); } finally { LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false; } }
/** * Tests if without rolling the region size before close is same as after * recreation */
Tests if without rolling the region size before close is same as after recreation
testSizeStatsAfterRecreation
{ "repo_name": "papicella/snappy-store", "path": "gemfire-junit/src/main/java/com/gemstone/gemfire/internal/cache/OplogJUnitTest.java", "license": "apache-2.0", "size": 142039 }
[ "com.gemstone.gemfire.cache.Scope", "java.io.File" ]
import com.gemstone.gemfire.cache.Scope; import java.io.File;
import com.gemstone.gemfire.cache.*; import java.io.*;
[ "com.gemstone.gemfire", "java.io" ]
com.gemstone.gemfire; java.io;
332,509
@Test public void testTableFoundPreviousColumnInSameRow() { JXTable table = new JXTable(new TestTableModel()); int lastColumn = table.getColumnCount() -1; int row = 90; String firstSearchText = table.getValueAt(row, lastColumn).toString(); // need a pattern for backwards search PatternModel model = new PatternModel(); model.setRawText(firstSearchText); int foundIndex = table.getSearchable().search(model.getPattern(), -1, true); assertEquals("last line found", row, foundIndex); String secondSearchText = table.getValueAt(row, lastColumn - 1).toString(); model.setRawText(secondSearchText); int secondFoundIndex = table.getSearchable().search(model.getPattern(), foundIndex, true); assertEquals("must find match in same row", foundIndex, secondFoundIndex); }
void function() { JXTable table = new JXTable(new TestTableModel()); int lastColumn = table.getColumnCount() -1; int row = 90; String firstSearchText = table.getValueAt(row, lastColumn).toString(); PatternModel model = new PatternModel(); model.setRawText(firstSearchText); int foundIndex = table.getSearchable().search(model.getPattern(), -1, true); assertEquals(STR, row, foundIndex); String secondSearchText = table.getValueAt(row, lastColumn - 1).toString(); model.setRawText(secondSearchText); int secondFoundIndex = table.getSearchable().search(model.getPattern(), foundIndex, true); assertEquals(STR, foundIndex, secondFoundIndex); }
/** * test if match in same row but different column is found in backwards * search. * */
test if match in same row but different column is found in backwards search
testTableFoundPreviousColumnInSameRow
{ "repo_name": "syncer/swingx", "path": "swingx-core/src/test/java/org/jdesktop/swingx/search/FindTest.java", "license": "lgpl-2.1", "size": 31517 }
[ "org.jdesktop.swingx.JXTable" ]
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.*;
[ "org.jdesktop.swingx" ]
org.jdesktop.swingx;
1,729,693
public Object getEnumConstant(String enumName, String constantName) throws ClassNotFoundException, JAXBException { Object valueToReturn = null; Class<?> enumClass = getDynamicClassLoader().loadClass(enumName); Object[] enumConstants = enumClass.getEnumConstants(); for (Object enumConstant : enumConstants) { if (enumConstant.toString().equals(constantName)) { valueToReturn = enumConstant; } } if (valueToReturn != null) { return valueToReturn; } else { throw new JAXBException(org.eclipse.persistence.exceptions.JAXBException.enumConstantNotFound(enumName + "." + constantName)); } } // ======================================================================== static class DynamicJAXBContextState extends JAXBContextState { private ArrayList<DynamicHelper> helpers; private DynamicClassLoader dClassLoader; public DynamicJAXBContextState(DynamicClassLoader loader) { super(); helpers = new ArrayList<DynamicHelper>(); } public DynamicJAXBContextState(XMLContext ctx) { super(ctx); }
Object function(String enumName, String constantName) throws ClassNotFoundException, JAXBException { Object valueToReturn = null; Class<?> enumClass = getDynamicClassLoader().loadClass(enumName); Object[] enumConstants = enumClass.getEnumConstants(); for (Object enumConstant : enumConstants) { if (enumConstant.toString().equals(constantName)) { valueToReturn = enumConstant; } } if (valueToReturn != null) { return valueToReturn; } else { throw new JAXBException(org.eclipse.persistence.exceptions.JAXBException.enumConstantNotFound(enumName + "." + constantName)); } } static class DynamicJAXBContextState extends JAXBContextState { private ArrayList<DynamicHelper> helpers; private DynamicClassLoader dClassLoader; public DynamicJAXBContextState(DynamicClassLoader loader) { super(); helpers = new ArrayList<DynamicHelper>(); } public DynamicJAXBContextState(XMLContext ctx) { super(ctx); }
/** * Returns the constant named <tt>constantName</tt> from the enum class specified by <tt>enumName</tt>. * * @param enumName * Java class name of an enum. * @param constantName * Name of the constant to get from the specified enum. * * @return * An <tt>Object</tt>, the constant from the specified enum. */
Returns the constant named constantName from the enum class specified by enumName
getEnumConstant
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/dynamic/DynamicJAXBContext.java", "license": "epl-1.0", "size": 17317 }
[ "java.util.ArrayList", "javax.xml.bind.JAXBException", "org.eclipse.persistence.dynamic.DynamicClassLoader", "org.eclipse.persistence.dynamic.DynamicHelper", "org.eclipse.persistence.oxm.XMLContext" ]
import java.util.ArrayList; import javax.xml.bind.JAXBException; import org.eclipse.persistence.dynamic.DynamicClassLoader; import org.eclipse.persistence.dynamic.DynamicHelper; import org.eclipse.persistence.oxm.XMLContext;
import java.util.*; import javax.xml.bind.*; import org.eclipse.persistence.dynamic.*; import org.eclipse.persistence.oxm.*;
[ "java.util", "javax.xml", "org.eclipse.persistence" ]
java.util; javax.xml; org.eclipse.persistence;
429,824
@SuppressWarnings("IfMayBeConditional") public IgniteInternalFuture<Boolean> dynamicStartSqlCache( CacheConfiguration ccfg ) { A.notNull(ccfg, "ccfg"); return dynamicStartCache(ccfg, ccfg.getName(), ccfg.getNearConfiguration(), CacheType.USER, true, false, true, true); }
@SuppressWarnings(STR) IgniteInternalFuture<Boolean> function( CacheConfiguration ccfg ) { A.notNull(ccfg, "ccfg"); return dynamicStartCache(ccfg, ccfg.getName(), ccfg.getNearConfiguration(), CacheType.USER, true, false, true, true); }
/** * Dynamically starts cache as a result of SQL {@code CREATE TABLE} command. * * @param ccfg Cache configuration. */
Dynamically starts cache as a result of SQL CREATE TABLE command
dynamicStartSqlCache
{ "repo_name": "irudyak/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java", "license": "apache-2.0", "size": 174729 }
[ "org.apache.ignite.configuration.CacheConfiguration", "org.apache.ignite.internal.IgniteInternalFuture", "org.apache.ignite.internal.util.typedef.internal.A" ]
import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.configuration.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.util.typedef.internal.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,865,523
public void setSize(int size) { if (size != MaterialProgressDrawable.LARGE && size != MaterialProgressDrawable.DEFAULT) { return; } final DisplayMetrics metrics = getResources().getDisplayMetrics(); if (size == MaterialProgressDrawable.LARGE) { mCircleHeight = mCircleWidth = (int) (CIRCLE_DIAMETER_LARGE * metrics.density); } else { mCircleHeight = mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density); } // force the bounds of the progress circle inside the circle view to // update by setting it to null before updating its size and then // re-setting it mCircleView.setImageDrawable(null); mProgress.updateSizes(size); mCircleView.setImageDrawable(mProgress); } public SwipeRefreshLayout(Context context) { this(context, null); } public SwipeRefreshLayout(Context context, AttributeSet attrs) { super(context, attrs); mMediumAnimationDuration = getResources().getInteger( android.R.integer.config_mediumAnimTime); setWillNotDraw(false); mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR); final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS); setEnabled(a.getBoolean(0, true)); a.recycle(); final DisplayMetrics metrics = getResources().getDisplayMetrics(); mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density); mCircleHeight = (int) (CIRCLE_DIAMETER * metrics.density); createProgressView(); setChildrenDrawingOrderEnabled(true); // the absolute offset has to take into account that the circle starts at an offset mSpinnerFinalOffset = DEFAULT_CIRCLE_TARGET * metrics.density; mTotalDragDistance = mSpinnerFinalOffset; }
void function(int size) { if (size != MaterialProgressDrawable.LARGE && size != MaterialProgressDrawable.DEFAULT) { return; } final DisplayMetrics metrics = getResources().getDisplayMetrics(); if (size == MaterialProgressDrawable.LARGE) { mCircleHeight = mCircleWidth = (int) (CIRCLE_DIAMETER_LARGE * metrics.density); } else { mCircleHeight = mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density); } mCircleView.setImageDrawable(null); mProgress.updateSizes(size); mCircleView.setImageDrawable(mProgress); } public SwipeRefreshLayout(Context context) { this(context, null); } public SwipeRefreshLayout(Context context, AttributeSet attrs) { super(context, attrs); mMediumAnimationDuration = getResources().getInteger( android.R.integer.config_mediumAnimTime); setWillNotDraw(false); mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR); final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS); setEnabled(a.getBoolean(0, true)); a.recycle(); final DisplayMetrics metrics = getResources().getDisplayMetrics(); mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density); mCircleHeight = (int) (CIRCLE_DIAMETER * metrics.density); createProgressView(); setChildrenDrawingOrderEnabled(true); mSpinnerFinalOffset = DEFAULT_CIRCLE_TARGET * metrics.density; mTotalDragDistance = mSpinnerFinalOffset; }
/** * One of DEFAULT, or LARGE. */
One of DEFAULT, or LARGE
setSize
{ "repo_name": "ltilve/chromium", "path": "third_party/android_swipe_refresh/java/src/org/chromium/third_party/android/swiperefresh/SwipeRefreshLayout.java", "license": "bsd-3-clause", "size": 29822 }
[ "android.content.Context", "android.content.res.TypedArray", "android.util.AttributeSet", "android.util.DisplayMetrics", "android.view.animation.DecelerateInterpolator" ]
import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.animation.DecelerateInterpolator;
import android.content.*; import android.content.res.*; import android.util.*; import android.view.animation.*;
[ "android.content", "android.util", "android.view" ]
android.content; android.util; android.view;
1,179,903
private DocumentRouteHeaderValue materializeDocument(SimulationResults results) { DocumentRouteHeaderValue document = results.getDocument(); //document.getActionRequests().addAll(results.getSimulatedActionRequests()); document.getSimulatedActionRequests().addAll(results.getSimulatedActionRequests()); return document; }
DocumentRouteHeaderValue function(SimulationResults results) { DocumentRouteHeaderValue document = results.getDocument(); document.getSimulatedActionRequests().addAll(results.getSimulatedActionRequests()); return document; }
/** * The document returned does not have any of the simulated action requests set on it, we'll want to set them. */
The document returned does not have any of the simulated action requests set on it, we'll want to set them
materializeDocument
{ "repo_name": "bhutchinson/rice", "path": "rice-middleware/impl/src/main/java/org/kuali/rice/kew/routemodule/service/impl/RoutingReportServiceImpl.java", "license": "apache-2.0", "size": 2147 }
[ "org.kuali.rice.kew.engine.simulation.SimulationResults", "org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue" ]
import org.kuali.rice.kew.engine.simulation.SimulationResults; import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
import org.kuali.rice.kew.engine.simulation.*; import org.kuali.rice.kew.routeheader.*;
[ "org.kuali.rice" ]
org.kuali.rice;
201,119
public void setOnDismissListener(PopupWindow.OnDismissListener listener) { mWindow.setOnDismissListener(listener); }
void function(PopupWindow.OnDismissListener listener) { mWindow.setOnDismissListener(listener); }
/** * Set listener on window dismissed. * * @param listener */
Set listener on window dismissed
setOnDismissListener
{ "repo_name": "SmileMx/Screen_Launcher", "path": "Launcher/src/com/tcl/simpletv/launcher2/popupswitch/PopupWindows.java", "license": "apache-2.0", "size": 2778 }
[ "android.widget.PopupWindow" ]
import android.widget.PopupWindow;
import android.widget.*;
[ "android.widget" ]
android.widget;
440,073
public TokenizerProperty removeKeyword(String image) { return removeSpecialSequence(image); }
TokenizerProperty function(String image) { return removeSpecialSequence(image); }
/** * Removing a special sequence from the store. If the special sequence denoted * by the given string does not exist the method returns <code>null</code>. * * @param image sequence to remove * @return the removed property or <code>null</code> if the sequence was not found */
Removing a special sequence from the store. If the special sequence denoted by the given string does not exist the method returns <code>null</code>
removeKeyword
{ "repo_name": "dohkoos/todolet", "path": "src/de/susebox/jtopas/impl/SequenceStore.java", "license": "mit", "size": 22640 }
[ "de.susebox.jtopas.TokenizerProperty" ]
import de.susebox.jtopas.TokenizerProperty;
import de.susebox.jtopas.*;
[ "de.susebox.jtopas" ]
de.susebox.jtopas;
964,212
@Override public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); JournalTrace info = (JournalTrace) o; info.setMessage(tightUnmarshalString(dataIn, bs)); }
void function(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); JournalTrace info = (JournalTrace) o; info.setMessage(tightUnmarshalString(dataIn, bs)); }
/** * Un-marshal an object instance from the data input stream * * @param o * the object to un-marshal * @param dataIn * the data input stream to build the object from * @throws IOException */
Un-marshal an object instance from the data input stream
tightUnmarshal
{ "repo_name": "tabish121/OpenWire", "path": "openwire-legacy/src/main/java/io/openwire/codec/v3/JournalTraceMarshaller.java", "license": "apache-2.0", "size": 4027 }
[ "io.openwire.codec.BooleanStream", "io.openwire.codec.OpenWireFormat", "io.openwire.commands.JournalTrace", "java.io.DataInput", "java.io.IOException" ]
import io.openwire.codec.BooleanStream; import io.openwire.codec.OpenWireFormat; import io.openwire.commands.JournalTrace; import java.io.DataInput; import java.io.IOException;
import io.openwire.codec.*; import io.openwire.commands.*; import java.io.*;
[ "io.openwire.codec", "io.openwire.commands", "java.io" ]
io.openwire.codec; io.openwire.commands; java.io;
733,853
public List<IpsecPolicy> ipsecPolicies() { return this.ipsecPolicies; }
List<IpsecPolicy> function() { return this.ipsecPolicies; }
/** * Get the ipsecPolicies property: The IPSec Policies to be considered by this connection. * * @return the ipsecPolicies value. */
Get the ipsecPolicies property: The IPSec Policies to be considered by this connection
ipsecPolicies
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.java", "license": "mit", "size": 17592 }
[ "com.azure.resourcemanager.network.models.IpsecPolicy", "java.util.List" ]
import com.azure.resourcemanager.network.models.IpsecPolicy; import java.util.List;
import com.azure.resourcemanager.network.models.*; import java.util.*;
[ "com.azure.resourcemanager", "java.util" ]
com.azure.resourcemanager; java.util;
2,518,424
public Resource getResource() { return fResource; }
Resource function() { return fResource; }
/** * Return the resource that was used to read in this BPEL process. * * @return the resource that was used to read in this BPEL process. */
Return the resource that was used to read in this BPEL process
getResource
{ "repo_name": "splinter/developer-studio", "path": "bps/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ReconciliationBPELReader.java", "license": "apache-2.0", "size": 140766 }
[ "org.eclipse.emf.ecore.resource.Resource" ]
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,312,681
public JsonBuilder writeClassObj( @NotNull final CharSequence elementId, @NotNull final ObjectProvider objectProvider) throws IOException { return writeObj(SelectorType.CLASS.prefix, elementId, objectProvider); }
JsonBuilder function( @NotNull final CharSequence elementId, @NotNull final ObjectProvider objectProvider) throws IOException { return writeObj(SelectorType.CLASS.prefix, elementId, objectProvider); }
/** An experimental feature: write the value for a CSS CLASS selector * * @param elementId ID selector * @param objectProvider A value provider * @throws IOException */
An experimental feature: write the value for a CSS CLASS selector
writeClassObj
{ "repo_name": "pponec/ujorm", "path": "project-m2/ujo-web/src/main/java/org/ujorm/tools/web/json/JsonBuilder.java", "license": "apache-2.0", "size": 11069 }
[ "java.io.IOException", "org.jetbrains.annotations.NotNull", "org.ujorm.tools.web.ao.ObjectProvider" ]
import java.io.IOException; import org.jetbrains.annotations.NotNull; import org.ujorm.tools.web.ao.ObjectProvider;
import java.io.*; import org.jetbrains.annotations.*; import org.ujorm.tools.web.ao.*;
[ "java.io", "org.jetbrains.annotations", "org.ujorm.tools" ]
java.io; org.jetbrains.annotations; org.ujorm.tools;
1,519,035
public void registerTransformers() { ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_ar", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_bg", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_ca", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_cjk", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_cz", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_da", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_de", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_el", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_en", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_es", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_eu", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_fa", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_fi", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_fr", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_ga", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_gl", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_hi", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_hu", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_hy", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_id", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_it", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_ja", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_lv", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_nl", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_no", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_pt", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_ro", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_ru", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_sv", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_th", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_tr", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text_ws", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "position", new LatLonTransformer()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "position_s", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "location", new LatLonTransformer()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "location_s", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "geohash", new LatLonTransformer()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "geohash_s", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "color", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "reverse_path_ngrams", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "lower_string", new StringTransformer<Value>()); // transformer for dynamic index values (strings) ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "dynamic", new DynamicValueTransformer()); // ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "dynamic_i", new DynamicValueTransformer()); // ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "dynamic_d", new DynamicValueTransformer()); // ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "dynamic_dt", new DynamicValueTransformer()); }
void function() { ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "text", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new LatLonTransformer()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new LatLonTransformer()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new LatLonTransformer()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + "color", new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new StringTransformer<Value>()); ldpathConfig.addTransformer(Namespaces.NS_LMF_TYPES + STR, new DynamicValueTransformer()); }
/** * Register the default transformers */
Register the default transformers
registerTransformers
{ "repo_name": "bienstock/catalog-service-backend", "path": "libs/marmotta-search/src/main/java/at/newmedialab/lmf/search/services/program/SolrProgramServiceImpl.java", "license": "apache-2.0", "size": 14024 }
[ "at.newmedialab.lmf.search.ldpath.model.transformers.DynamicValueTransformer", "at.newmedialab.lmf.search.ldpath.model.transformers.LatLonTransformer", "org.apache.marmotta.commons.sesame.model.Namespaces", "org.apache.marmotta.ldpath.model.transformers.StringTransformer", "org.openrdf.model.Value" ]
import at.newmedialab.lmf.search.ldpath.model.transformers.DynamicValueTransformer; import at.newmedialab.lmf.search.ldpath.model.transformers.LatLonTransformer; import org.apache.marmotta.commons.sesame.model.Namespaces; import org.apache.marmotta.ldpath.model.transformers.StringTransformer; import org.openrdf.model.Value;
import at.newmedialab.lmf.search.ldpath.model.transformers.*; import org.apache.marmotta.commons.sesame.model.*; import org.apache.marmotta.ldpath.model.transformers.*; import org.openrdf.model.*;
[ "at.newmedialab.lmf", "org.apache.marmotta", "org.openrdf.model" ]
at.newmedialab.lmf; org.apache.marmotta; org.openrdf.model;
1,983,798
public static DataSourceIdentifier<?> resolveId(String geneIDStr) { try { if (geneIDStr.startsWith("MGI:")) { if (geneIDStr.startsWith("MGI:MGI:")) { return new MgiGeneID(StringUtil.removePrefix(geneIDStr, "MGI:")); } return new MgiGeneID(geneIDStr); } else if (geneIDStr.startsWith("ncbi-geneid:")) return new NcbiGeneId(StringUtil.removePrefix(geneIDStr, "ncbi-geneid:")); else if (geneIDStr.startsWith(IREFWEB_ENTREZGENE_ID_PREFIX)) return new NcbiGeneId(StringUtil.removePrefix(geneIDStr, IREFWEB_ENTREZGENE_ID_PREFIX)); else if (geneIDStr.startsWith("Ensembl:")) return new EnsemblGeneID(StringUtil.removePrefix(geneIDStr, "Ensembl:")); else if (geneIDStr.startsWith("refseq:")) return new RefSeqID(StringUtil.removePrefix(geneIDStr, "refseq:")); else if (StringUtil.startsWithRegex(geneIDStr.toLowerCase(), "uniprot.*?:")) { geneIDStr = StringUtil.removePrefixRegex(geneIDStr.toLowerCase(), "uniprot.*?:"); if (geneIDStr.contains(StringConstants.HYPHEN_MINUS)) return new UniProtIsoformID(geneIDStr.toUpperCase()); return new UniProtID(geneIDStr.toUpperCase()); } else if (geneIDStr.startsWith("Swiss-Prot:")) return new UniProtID(StringUtil.removePrefix(geneIDStr, "Swiss-Prot:")); else if (geneIDStr.startsWith("TREMBL:")) return new UniProtID(StringUtil.removePrefix(geneIDStr, "TREMBL:")); else if (geneIDStr.startsWith("TAIR:")) return new TairID(StringUtil.removePrefix(geneIDStr, "TAIR:")); else if (geneIDStr.startsWith("MaizeGDB:")) return new MaizeGdbID(StringUtil.removePrefix(geneIDStr, "MaizeGDB:")); else if (geneIDStr.startsWith("WormBase:")) return new WormBaseID(StringUtil.removePrefix(geneIDStr, "WormBase:")); else if (geneIDStr.startsWith("BEEBASE:")) return new BeeBaseID(StringUtil.removePrefix(geneIDStr, "BEEBASE:")); else if (geneIDStr.startsWith("NASONIABASE:")) return new NasoniaBaseID(StringUtil.removePrefix(geneIDStr, "NASONIABASE:")); else if (geneIDStr.startsWith("VectorBase:")) return new VectorBaseID(StringUtil.removePrefix(geneIDStr, "VectorBase:")); else if (geneIDStr.startsWith("APHIDBASE:")) return new AphidBaseID(StringUtil.removePrefix(geneIDStr, "APHIDBASE:")); else if (geneIDStr.startsWith("BEETLEBASE:")) return new BeetleBaseID(StringUtil.removePrefix(geneIDStr, "BEETLEBASE:")); else if (geneIDStr.toUpperCase().startsWith("FLYBASE:")) return new FlyBaseID(StringUtil.removePrefix(geneIDStr.toUpperCase(), "FLYBASE:")); else if (geneIDStr.startsWith("ZFIN:")) return new ZfinID(StringUtil.removePrefix(geneIDStr, "ZFIN:")); else if (geneIDStr.startsWith("AnimalQTLdb:")) return new AnimalQtlDbID(StringUtil.removePrefix(geneIDStr, "AnimalQTLdb:")); else if (geneIDStr.startsWith("RGD:")) return new RgdID(StringUtil.removePrefix(geneIDStr, "RGD:")); else if (geneIDStr.startsWith("PBR:")) return new PbrID(StringUtil.removePrefix(geneIDStr, "PBR:")); else if (geneIDStr.startsWith("VBRC:")) return new VbrcID(StringUtil.removePrefix(geneIDStr, "VBRC:")); else if (geneIDStr.startsWith("Pathema:")) return new PathemaID(StringUtil.removePrefix(geneIDStr, "Pathema:")); else if (geneIDStr.startsWith("PseudoCap:")) return new PseudoCapID(StringUtil.removePrefix(geneIDStr, "PseudoCap:")); else if (geneIDStr.startsWith("ApiDB_CryptoDB:")) return new ApiDbCryptoDbID(StringUtil.removePrefix(geneIDStr, "ApiDB_CryptoDB:")); else if (geneIDStr.startsWith("dictyBase:")) return new DictyBaseID(StringUtil.removePrefix(geneIDStr, "dictyBase:")); else if (geneIDStr.startsWith("UniProtKB/Swiss-Prot:")) return new UniProtID(StringUtil.removePrefix(geneIDStr, "UniProtKB/Swiss-Prot:")); else if (geneIDStr.startsWith("InterPro:")) return new InterProID(StringUtil.removePrefix(geneIDStr, "InterPro:")); else if (geneIDStr.startsWith("EcoGene:")) return new EcoGeneID(StringUtil.removePrefix(geneIDStr, "EcoGene:")); else if (geneIDStr.toUpperCase().startsWith("ECOCYC:")) return new EcoCycID(StringUtil.removePrefix(geneIDStr.toUpperCase(), "ECOCYC:")); else if (geneIDStr.startsWith("SGD:")) return new SgdID(StringUtil.removePrefix(geneIDStr, "SGD:")); else if (geneIDStr.startsWith("RATMAP:")) return new RatMapID(StringUtil.removePrefix(geneIDStr, "RATMAP:")); else if (geneIDStr.startsWith("Xenbase:")) return new XenBaseID(StringUtil.removePrefix(geneIDStr, "Xenbase:")); else if (geneIDStr.startsWith("CGNC:")) return new CgncID(StringUtil.removePrefix(geneIDStr, "CGNC:")); else if (geneIDStr.startsWith("HGNC:")) { if (geneIDStr.startsWith("HGNC:HGNC:")) { return new HgncID(StringUtil.removePrefix(geneIDStr, "HGNC:")); } return new HgncID(geneIDStr); } else if (geneIDStr.startsWith("MIM:")) return new OmimID(StringUtil.removePrefix(geneIDStr, "MIM:")); else if (geneIDStr.startsWith("HPRD:")) return new HprdID(StringUtil.removePrefix(geneIDStr, "HPRD:")); else if (geneIDStr.startsWith("IMGT/GENE-DB:")) return new ImgtID(StringUtil.removePrefix(geneIDStr, "IMGT/GENE-DB:")); else if (geneIDStr.startsWith("PDB:")) return new PdbID(StringUtil.removePrefix(geneIDStr, "PDB:")); else if (geneIDStr.toLowerCase().startsWith("gb:")) return new GenBankID(StringUtil.removePrefix(geneIDStr.toLowerCase(), "gb:").toUpperCase()); else if (geneIDStr.startsWith("emb:")) return new EmbID(StringUtil.removePrefix(geneIDStr, "emb:")); else if (geneIDStr.startsWith("dbj:")) return new DbjID(StringUtil.removePrefix(geneIDStr, "dbj:")); else if (geneIDStr.startsWith("intact:")) return new IntActID(StringUtil.removePrefix(geneIDStr, "intact:")); else if (geneIDStr.startsWith("RefSeq:")) return new RefSeqID(StringUtil.removePrefix(geneIDStr, "RefSeq:")); else if (geneIDStr.startsWith("uniparc:")) return new UniParcID(StringUtil.removePrefix(geneIDStr, "uniparc:")); else if (geneIDStr.startsWith("genbank_protein_gi:")) return new GiNumberID(StringUtil.removePrefix(geneIDStr, "genbank_protein_gi:")); else if (geneIDStr.toLowerCase().startsWith("pir:")) return new PirID(StringUtil.removePrefix(geneIDStr.toLowerCase(), "pir:").toUpperCase()); else if (geneIDStr.startsWith("pubmed:")) return new PubMedID(StringUtil.removePrefix(geneIDStr, "pubmed:")); else if (geneIDStr.startsWith("dip:") && geneIDStr.endsWith("N")) return new DipInteractorID(StringUtil.removePrefix(geneIDStr, "dip:")); else if (geneIDStr.startsWith("dip:") && geneIDStr.endsWith("E")) return new DipInteractionID(StringUtil.removePrefix(geneIDStr, "dip:")); else if (geneIDStr.startsWith("TIGR:")) return new TigrFamsID(StringUtil.removePrefix(geneIDStr, "TIGR:")); else if (geneIDStr.startsWith("ipi:")) return new IpiID(StringUtil.removePrefix(geneIDStr, "ipi:")); else if (geneIDStr.startsWith("mint:")) return new MintID(StringUtil.removePrefix(geneIDStr, "mint:")); else if (geneIDStr.startsWith("Reactome:")) return new ReactomeReactionID(StringUtil.removePrefix(geneIDStr, "Reactome:")); else if (geneIDStr.startsWith("miRBase:")) return new MiRBaseID(StringUtil.removePrefix(geneIDStr, "miRBase:")); else if (geneIDStr.startsWith("PR:")) return new ProteinOntologyId(geneIDStr); else if (geneIDStr.startsWith("SO:")) return new SequenceOntologyId(geneIDStr); else if (geneIDStr.startsWith("GO:")) return new GeneOntologyID(geneIDStr); else if (geneIDStr.startsWith("CHEBI:")) return new ChebiOntologyID(geneIDStr); else if (geneIDStr.startsWith("MP:")) return new MammalianPhenotypeID(geneIDStr); else if (geneIDStr.startsWith("MOD:")) return new PsiModId(geneIDStr); else if (geneIDStr.startsWith("KEGG_")) return new KeggGeneID(geneIDStr); else if (geneIDStr.startsWith("KEGG_PATHWAY")) return new KeggPathwayID(geneIDStr); else if (geneIDStr.startsWith("EG_")) return new NcbiGeneId(StringUtil.removePrefix(geneIDStr, "EG_")); else if (geneIDStr.startsWith("HOMOLOGENE_GROUP_")) return new HomologeneGroupID(StringUtil.removePrefix(geneIDStr, "HOMOLOGENE_GROUP_")); else if (geneIDStr.matches("IPR\\d+")) return new InterProID(geneIDStr); else if (geneIDStr.matches("rs\\d+")) return new SnpRsId(geneIDStr); else if (geneIDStr.startsWith("CL:")) return new CellTypeOntologyID(geneIDStr); else if (geneIDStr.startsWith("Vega:")) return new VegaID(StringUtil.removePrefix(geneIDStr, "Vega:")); else if (geneIDStr.startsWith("NCBITaxon:")) return new NcbiTaxonomyID(StringUtil.removePrefix(geneIDStr, "NCBITaxon:")); logger.warn(String.format("Unhandled gene ID format: %s. Creating UnknownDataSourceIdentifier.", geneIDStr)); return new UnknownDataSourceIdentifier(geneIDStr); } catch (IllegalArgumentException e) { logger.warn("Invalid ID detected... " + e.getMessage()); return new ProbableErrorDataSourceIdentifier(geneIDStr, null, e.getMessage()); } }
static DataSourceIdentifier<?> function(String geneIDStr) { try { if (geneIDStr.startsWith("MGI:")) { if (geneIDStr.startsWith(STR)) { return new MgiGeneID(StringUtil.removePrefix(geneIDStr, "MGI:")); } return new MgiGeneID(geneIDStr); } else if (geneIDStr.startsWith(STR)) return new NcbiGeneId(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(IREFWEB_ENTREZGENE_ID_PREFIX)) return new NcbiGeneId(StringUtil.removePrefix(geneIDStr, IREFWEB_ENTREZGENE_ID_PREFIX)); else if (geneIDStr.startsWith(STR)) return new EnsemblGeneID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new RefSeqID(StringUtil.removePrefix(geneIDStr, STR)); else if (StringUtil.startsWithRegex(geneIDStr.toLowerCase(), STR)) { geneIDStr = StringUtil.removePrefixRegex(geneIDStr.toLowerCase(), STR); if (geneIDStr.contains(StringConstants.HYPHEN_MINUS)) return new UniProtIsoformID(geneIDStr.toUpperCase()); return new UniProtID(geneIDStr.toUpperCase()); } else if (geneIDStr.startsWith(STR)) return new UniProtID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new UniProtID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith("TAIR:")) return new TairID(StringUtil.removePrefix(geneIDStr, "TAIR:")); else if (geneIDStr.startsWith(STR)) return new MaizeGdbID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new WormBaseID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new BeeBaseID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new NasoniaBaseID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new VectorBaseID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new AphidBaseID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new BeetleBaseID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.toUpperCase().startsWith(STR)) return new FlyBaseID(StringUtil.removePrefix(geneIDStr.toUpperCase(), STR)); else if (geneIDStr.startsWith("ZFIN:")) return new ZfinID(StringUtil.removePrefix(geneIDStr, "ZFIN:")); else if (geneIDStr.startsWith(STR)) return new AnimalQtlDbID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith("RGD:")) return new RgdID(StringUtil.removePrefix(geneIDStr, "RGD:")); else if (geneIDStr.startsWith("PBR:")) return new PbrID(StringUtil.removePrefix(geneIDStr, "PBR:")); else if (geneIDStr.startsWith("VBRC:")) return new VbrcID(StringUtil.removePrefix(geneIDStr, "VBRC:")); else if (geneIDStr.startsWith(STR)) return new PathemaID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new PseudoCapID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new ApiDbCryptoDbID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new DictyBaseID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new UniProtID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new InterProID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new EcoGeneID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.toUpperCase().startsWith(STR)) return new EcoCycID(StringUtil.removePrefix(geneIDStr.toUpperCase(), STR)); else if (geneIDStr.startsWith("SGD:")) return new SgdID(StringUtil.removePrefix(geneIDStr, "SGD:")); else if (geneIDStr.startsWith(STR)) return new RatMapID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new XenBaseID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith("CGNC:")) return new CgncID(StringUtil.removePrefix(geneIDStr, "CGNC:")); else if (geneIDStr.startsWith("HGNC:")) { if (geneIDStr.startsWith(STR)) { return new HgncID(StringUtil.removePrefix(geneIDStr, "HGNC:")); } return new HgncID(geneIDStr); } else if (geneIDStr.startsWith("MIM:")) return new OmimID(StringUtil.removePrefix(geneIDStr, "MIM:")); else if (geneIDStr.startsWith("HPRD:")) return new HprdID(StringUtil.removePrefix(geneIDStr, "HPRD:")); else if (geneIDStr.startsWith(STR)) return new ImgtID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith("PDB:")) return new PdbID(StringUtil.removePrefix(geneIDStr, "PDB:")); else if (geneIDStr.toLowerCase().startsWith("gb:")) return new GenBankID(StringUtil.removePrefix(geneIDStr.toLowerCase(), "gb:").toUpperCase()); else if (geneIDStr.startsWith("emb:")) return new EmbID(StringUtil.removePrefix(geneIDStr, "emb:")); else if (geneIDStr.startsWith("dbj:")) return new DbjID(StringUtil.removePrefix(geneIDStr, "dbj:")); else if (geneIDStr.startsWith(STR)) return new IntActID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new RefSeqID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new UniParcID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new GiNumberID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.toLowerCase().startsWith("pir:")) return new PirID(StringUtil.removePrefix(geneIDStr.toLowerCase(), "pir:").toUpperCase()); else if (geneIDStr.startsWith(STR)) return new PubMedID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith("dip:") && geneIDStr.endsWith("N")) return new DipInteractorID(StringUtil.removePrefix(geneIDStr, "dip:")); else if (geneIDStr.startsWith("dip:") && geneIDStr.endsWith("E")) return new DipInteractionID(StringUtil.removePrefix(geneIDStr, "dip:")); else if (geneIDStr.startsWith("TIGR:")) return new TigrFamsID(StringUtil.removePrefix(geneIDStr, "TIGR:")); else if (geneIDStr.startsWith("ipi:")) return new IpiID(StringUtil.removePrefix(geneIDStr, "ipi:")); else if (geneIDStr.startsWith("mint:")) return new MintID(StringUtil.removePrefix(geneIDStr, "mint:")); else if (geneIDStr.startsWith(STR)) return new ReactomeReactionID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith(STR)) return new MiRBaseID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.startsWith("PR:")) return new ProteinOntologyId(geneIDStr); else if (geneIDStr.startsWith("SO:")) return new SequenceOntologyId(geneIDStr); else if (geneIDStr.startsWith("GO:")) return new GeneOntologyID(geneIDStr); else if (geneIDStr.startsWith(STR)) return new ChebiOntologyID(geneIDStr); else if (geneIDStr.startsWith("MP:")) return new MammalianPhenotypeID(geneIDStr); else if (geneIDStr.startsWith("MOD:")) return new PsiModId(geneIDStr); else if (geneIDStr.startsWith("KEGG_")) return new KeggGeneID(geneIDStr); else if (geneIDStr.startsWith(STR)) return new KeggPathwayID(geneIDStr); else if (geneIDStr.startsWith("EG_")) return new NcbiGeneId(StringUtil.removePrefix(geneIDStr, "EG_")); else if (geneIDStr.startsWith(STR)) return new HomologeneGroupID(StringUtil.removePrefix(geneIDStr, STR)); else if (geneIDStr.matches(STR)) return new InterProID(geneIDStr); else if (geneIDStr.matches(STR)) return new SnpRsId(geneIDStr); else if (geneIDStr.startsWith("CL:")) return new CellTypeOntologyID(geneIDStr); else if (geneIDStr.startsWith("Vega:")) return new VegaID(StringUtil.removePrefix(geneIDStr, "Vega:")); else if (geneIDStr.startsWith(STR)) return new NcbiTaxonomyID(StringUtil.removePrefix(geneIDStr, STR)); logger.warn(String.format(STR, geneIDStr)); return new UnknownDataSourceIdentifier(geneIDStr); } catch (IllegalArgumentException e) { logger.warn(STR + e.getMessage()); return new ProbableErrorDataSourceIdentifier(geneIDStr, null, e.getMessage()); } }
/** * Resolve provided id to an instance of {@link DataSourceIdentifier}. * * @param geneIDStr * @return if can be resolved, id instance; otherwise, null */
Resolve provided id to an instance of <code>DataSourceIdentifier</code>
resolveId
{ "repo_name": "UCDenver-ccp/datasource", "path": "datasource-fileparsers/src/main/java/edu/ucdenver/ccp/datasource/identifiers/DataSourceIdResolver.java", "license": "bsd-3-clause", "size": 28784 }
[ "edu.ucdenver.ccp.common.string.StringConstants", "edu.ucdenver.ccp.common.string.StringUtil", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.AnimalQtlDbID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.AphidBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.ApiDbCryptoDbID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.BeeBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.BeetleBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.CellTypeOntologyID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.CgncID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.ChebiOntologyID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.DbjID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.DictyBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.DipInteractionID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.DipInteractorID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.EcoCycID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.EcoGeneID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.EmbID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.EnsemblGeneID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.FlyBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.GenBankID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.GeneOntologyID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.GiNumberID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.HgncID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.HomologeneGroupID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.HprdID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.ImgtID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.IntActID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.InterProID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.IpiID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.KeggGeneID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.KeggPathwayID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.MaizeGdbID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.MammalianPhenotypeID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.MgiGeneID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.MiRBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.MintID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.NasoniaBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.NcbiGeneId", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.NcbiTaxonomyID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.OmimID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.PathemaID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.PbrID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.PdbID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.PirID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.ProteinOntologyId", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.PseudoCapID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.PsiModId", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.RatMapID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.ReactomeReactionID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.RefSeqID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.RgdID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.SequenceOntologyId", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.SgdID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.SnpRsId", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.TairID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.TigrFamsID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.UniParcID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.UniProtID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.UniProtIsoformID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.VbrcID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.VectorBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.VegaID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.WormBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.XenBaseID", "edu.ucdenver.ccp.datasource.identifiers.impl.bio.ZfinID", "edu.ucdenver.ccp.datasource.identifiers.impl.ice.PubMedID" ]
import edu.ucdenver.ccp.common.string.StringConstants; import edu.ucdenver.ccp.common.string.StringUtil; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.AnimalQtlDbID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.AphidBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.ApiDbCryptoDbID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.BeeBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.BeetleBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.CellTypeOntologyID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.CgncID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.ChebiOntologyID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.DbjID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.DictyBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.DipInteractionID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.DipInteractorID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.EcoCycID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.EcoGeneID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.EmbID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.EnsemblGeneID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.FlyBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.GenBankID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.GeneOntologyID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.GiNumberID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.HgncID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.HomologeneGroupID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.HprdID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.ImgtID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.IntActID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.InterProID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.IpiID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.KeggGeneID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.KeggPathwayID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.MaizeGdbID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.MammalianPhenotypeID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.MgiGeneID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.MiRBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.MintID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.NasoniaBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.NcbiGeneId; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.NcbiTaxonomyID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.OmimID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.PathemaID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.PbrID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.PdbID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.PirID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.ProteinOntologyId; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.PseudoCapID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.PsiModId; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.RatMapID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.ReactomeReactionID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.RefSeqID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.RgdID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.SequenceOntologyId; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.SgdID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.SnpRsId; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.TairID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.TigrFamsID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.UniParcID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.UniProtID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.UniProtIsoformID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.VbrcID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.VectorBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.VegaID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.WormBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.XenBaseID; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.ZfinID; import edu.ucdenver.ccp.datasource.identifiers.impl.ice.PubMedID;
import edu.ucdenver.ccp.common.string.*; import edu.ucdenver.ccp.datasource.identifiers.impl.bio.*; import edu.ucdenver.ccp.datasource.identifiers.impl.ice.*;
[ "edu.ucdenver.ccp" ]
edu.ucdenver.ccp;
1,393,431
Log.d(Log.TAG_SYNC, "startReplicating()"); initPendingSequences(); initDownloadsToInsert(); startChangeTracker(); // start replicator .. }
Log.d(Log.TAG_SYNC, STR); initPendingSequences(); initDownloadsToInsert(); startChangeTracker(); }
/** * Actual work of starting the replication process. */
Actual work of starting the replication process
beginReplicating
{ "repo_name": "netsense-sas/couchbase-lite-java-core", "path": "src/main/java/com/couchbase/lite/replicator/PullerInternal.java", "license": "apache-2.0", "size": 41640 }
[ "com.couchbase.lite.util.Log" ]
import com.couchbase.lite.util.Log;
import com.couchbase.lite.util.*;
[ "com.couchbase.lite" ]
com.couchbase.lite;
2,103,842
NodesUsageRequestBuilder prepareNodesUsage(String... nodesIds);
NodesUsageRequestBuilder prepareNodesUsage(String... nodesIds);
/** * Nodes usage of the cluster. */
Nodes usage of the cluster
prepareNodesUsage
{ "repo_name": "jprante/elasticsearch-server", "path": "server/src/main/java/org/elasticsearch/client/ClusterAdminClient.java", "license": "apache-2.0", "size": 26854 }
[ "org.elasticsearch.action.admin.cluster.node.usage.NodesUsageRequestBuilder" ]
import org.elasticsearch.action.admin.cluster.node.usage.NodesUsageRequestBuilder;
import org.elasticsearch.action.admin.cluster.node.usage.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
2,118,453
public Object next() { if (!beforeFirst || removed) { throw new NoSuchElementException(); } beforeFirst = false; return object; }
Object function() { if (!beforeFirst removed) { throw new NoSuchElementException(); } beforeFirst = false; return object; }
/** * Get the next object from the iterator. * <p> * This returns the single object if it hasn't been returned yet. * * @return the single object * @throws NoSuchElementException if the single object has already * been returned */
Get the next object from the iterator. This returns the single object if it hasn't been returned yet
next
{ "repo_name": "ProfilingLabs/Usemon2", "path": "usemon-agent-commons-java/src/main/java/com/usemon/lib/org/apache/commons/collections/iterators/SingletonIterator.java", "license": "mpl-2.0", "size": 4102 }
[ "java.util.NoSuchElementException" ]
import java.util.NoSuchElementException;
import java.util.*;
[ "java.util" ]
java.util;
1,299,620
EAttribute getCollaborationActivityType_Name();
EAttribute getCollaborationActivityType_Name();
/** * Returns the meta object for the attribute '{@link org.ebxml.business.process.CollaborationActivityType#getName <em>Name</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Name</em>'. * @see org.ebxml.business.process.CollaborationActivityType#getName() * @see #getCollaborationActivityType() * @generated */
Returns the meta object for the attribute '<code>org.ebxml.business.process.CollaborationActivityType#getName Name</code>'.
getCollaborationActivityType_Name
{ "repo_name": "GRA-UML/tool", "path": "plugins/org.ijis.gra.ebxml.ebBPSS/src/main/java/org/ebxml/business/process/ProcessPackage.java", "license": "epl-1.0", "size": 274455 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,355,739
private void add2ndToolbarFields(RunData data, Context context) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); context.put("totalPageNumber", Integer.valueOf(totalPageNumber(state))); context.put("form_search", FORM_SEARCH); context.put("formPageNumber", FORM_PAGE_NUMBER); context.put("prev_page_exists", state.getAttribute(STATE_PREV_PAGE_EXISTS)); context.put("next_page_exists", state.getAttribute(STATE_NEXT_PAGE_EXISTS)); context.put("current_page", state.getAttribute(STATE_CURRENT_PAGE)); context.put("selectedView", state.getAttribute(STATE_MODE)); } // add2ndToolbarFields
void function(RunData data, Context context) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); context.put(STR, Integer.valueOf(totalPageNumber(state))); context.put(STR, FORM_SEARCH); context.put(STR, FORM_PAGE_NUMBER); context.put(STR, state.getAttribute(STATE_PREV_PAGE_EXISTS)); context.put(STR, state.getAttribute(STATE_NEXT_PAGE_EXISTS)); context.put(STR, state.getAttribute(STATE_CURRENT_PAGE)); context.put(STR, state.getAttribute(STATE_MODE)); }
/** * put those variables related to 2ndToolbar into context */
put those variables related to 2ndToolbar into context
add2ndToolbarFields
{ "repo_name": "udayg/sakai", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 672322 }
[ "org.sakaiproject.cheftool.Context", "org.sakaiproject.cheftool.JetspeedRunData", "org.sakaiproject.cheftool.RunData", "org.sakaiproject.event.api.SessionState" ]
import org.sakaiproject.cheftool.Context; import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState;
import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*;
[ "org.sakaiproject.cheftool", "org.sakaiproject.event" ]
org.sakaiproject.cheftool; org.sakaiproject.event;
1,838,737
public static List<Method> getMethods(Class clazz) { return DECLARED_METHODS.computeIfAbsent( clazz, c -> { return Arrays.stream(c.getDeclaredMethods()) .filter(m -> !Modifier.isPrivate(m.getModifiers())) .filter(m -> !Modifier.isProtected(m.getModifiers())) .filter(m -> !Modifier.isStatic(m.getModifiers())) .collect(Collectors.toList()); }); }
static List<Method> function(Class clazz) { return DECLARED_METHODS.computeIfAbsent( clazz, c -> { return Arrays.stream(c.getDeclaredMethods()) .filter(m -> !Modifier.isPrivate(m.getModifiers())) .filter(m -> !Modifier.isProtected(m.getModifiers())) .filter(m -> !Modifier.isStatic(m.getModifiers())) .collect(Collectors.toList()); }); }
/** * Returns the list of non private/protected, non-static methods in the class, caching the * results. */
Returns the list of non private/protected, non-static methods in the class, caching the results
getMethods
{ "repo_name": "markflyhigh/incubator-beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/ReflectUtils.java", "license": "apache-2.0", "size": 6825 }
[ "java.lang.reflect.Method", "java.lang.reflect.Modifier", "java.util.Arrays", "java.util.List", "java.util.stream.Collectors" ]
import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors;
import java.lang.reflect.*; import java.util.*; import java.util.stream.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
949,405
for(String streamName: streamNames) { Stream s = ydb.getStream(streamName); if(s!=null) { for(StreamSubscriber ss:s.getSubscribers()) { if(ss instanceof TableWriter) { s.removeSubscriber(ss); ((TableWriter)ss).close(); } } } } }
for(String streamName: streamNames) { Stream s = ydb.getStream(streamName); if(s!=null) { for(StreamSubscriber ss:s.getSubscribers()) { if(ss instanceof TableWriter) { s.removeSubscriber(ss); ((TableWriter)ss).close(); } } } } }
/** * close all table writers subscribed to any of the stream in the list * * @param ydb * @param streamNames */
close all table writers subscribed to any of the stream in the list
closeTableWriters
{ "repo_name": "fqqb/yamcs", "path": "yamcs-core/src/main/java/org/yamcs/archive/Utils.java", "license": "agpl-3.0", "size": 886 }
[ "org.yamcs.yarch.Stream", "org.yamcs.yarch.StreamSubscriber", "org.yamcs.yarch.TableWriter" ]
import org.yamcs.yarch.Stream; import org.yamcs.yarch.StreamSubscriber; import org.yamcs.yarch.TableWriter;
import org.yamcs.yarch.*;
[ "org.yamcs.yarch" ]
org.yamcs.yarch;
1,222,454
private static JSONObject makeHttpRequest(String url, String method, HashMap<String, String> urlParameters, HashMap<String, String> bodyParameters) { return jParser.makeHttpRequest(url, method, urlParameters, bodyParameters); }
static JSONObject function(String url, String method, HashMap<String, String> urlParameters, HashMap<String, String> bodyParameters) { return jParser.makeHttpRequest(url, method, urlParameters, bodyParameters); }
/** * Send HTTP Request with params (x-url-encoded) * * @param url - URL of the request * @param method - HTTP method (GET, POST, PUT, DELETE, ...) * @param urlParameters - parameters send in URL * @param bodyParameters - parameters send in body (encoded) * @return JSONObject returned by the server */
Send HTTP Request with params (x-url-encoded)
makeHttpRequest
{ "repo_name": "AamuLumi/LesCoursAndroid", "path": "TP1/SharedShopping-Corrected/app/src/main/java/info/aamulumi/sharedshopping/network/APIConnection.java", "license": "mit", "size": 14540 }
[ "java.util.HashMap", "org.json.JSONObject" ]
import java.util.HashMap; import org.json.JSONObject;
import java.util.*; import org.json.*;
[ "java.util", "org.json" ]
java.util; org.json;
2,606,871
void createFloatingIP(OpenstackFloatingIP openstackFloatingIp);
void createFloatingIP(OpenstackFloatingIP openstackFloatingIp);
/** * Stores the floating IP information created by openstack. * * @param openstackFloatingIp Floating IP information */
Stores the floating IP information created by openstack
createFloatingIP
{ "repo_name": "VinodKumarS-Huawei/ietf96yang", "path": "apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackRoutingService.java", "license": "apache-2.0", "size": 3162 }
[ "org.onosproject.openstackinterface.OpenstackFloatingIP" ]
import org.onosproject.openstackinterface.OpenstackFloatingIP;
import org.onosproject.openstackinterface.*;
[ "org.onosproject.openstackinterface" ]
org.onosproject.openstackinterface;
394,150
@Test public void testReporterArgumentForwarding() { Configuration config = new Configuration(); config.setString(MetricOptions.REPORTERS_LIST, "test"); config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, TestReporter2.class.getName()); config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test.arg1", "hello"); config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test.arg2", "world"); new MetricRegistry(MetricRegistryConfiguration.fromConfiguration(config)).shutdown(); }
void function() { Configuration config = new Configuration(); config.setString(MetricOptions.REPORTERS_LIST, "test"); config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, TestReporter2.class.getName()); config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + STR, "hello"); config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + STR, "world"); new MetricRegistry(MetricRegistryConfiguration.fromConfiguration(config)).shutdown(); }
/** * Verifies that configured arguments are properly forwarded to the reporter. */
Verifies that configured arguments are properly forwarded to the reporter
testReporterArgumentForwarding
{ "repo_name": "WangTaoTheTonic/flink", "path": "flink-runtime/src/test/java/org/apache/flink/runtime/metrics/MetricRegistryTest.java", "license": "apache-2.0", "size": 16582 }
[ "org.apache.flink.configuration.ConfigConstants", "org.apache.flink.configuration.Configuration", "org.apache.flink.configuration.MetricOptions" ]
import org.apache.flink.configuration.ConfigConstants; import org.apache.flink.configuration.Configuration; import org.apache.flink.configuration.MetricOptions;
import org.apache.flink.configuration.*;
[ "org.apache.flink" ]
org.apache.flink;
2,735,275
public Observable<ServiceResponse<VpnServerConfigurationInner>> updateTagsWithServiceResponseAsync(String resourceGroupName, String vpnServerConfigurationName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (vpnServerConfigurationName == null) { throw new IllegalArgumentException("Parameter vpnServerConfigurationName is required and cannot be null."); }
Observable<ServiceResponse<VpnServerConfigurationInner>> function(String resourceGroupName, String vpnServerConfigurationName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (vpnServerConfigurationName == null) { throw new IllegalArgumentException(STR); }
/** * Updates VpnServerConfiguration tags. * * @param resourceGroupName The resource group name of the VpnServerConfiguration. * @param vpnServerConfigurationName The name of the VpnServerConfiguration being updated. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the VpnServerConfigurationInner object */
Updates VpnServerConfiguration tags
updateTagsWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/VpnServerConfigurationsInner.java", "license": "mit", "size": 70526 }
[ "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
432,408
public final List<Library> getLibraries( ) { return getLibraries( IAccessControl.DIRECTLY_INCLUDED_LEVEL ); }
final List<Library> function( ) { return getLibraries( IAccessControl.DIRECTLY_INCLUDED_LEVEL ); }
/** * Returns only libraries this module includes directly. * * @return list of libraries. */
Returns only libraries this module includes directly
getLibraries
{ "repo_name": "sguan-actuate/birt", "path": "model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/core/ModuleImpl.java", "license": "epl-1.0", "size": 72136 }
[ "java.util.List", "org.eclipse.birt.report.model.api.core.IAccessControl", "org.eclipse.birt.report.model.elements.Library" ]
import java.util.List; import org.eclipse.birt.report.model.api.core.IAccessControl; import org.eclipse.birt.report.model.elements.Library;
import java.util.*; import org.eclipse.birt.report.model.api.core.*; import org.eclipse.birt.report.model.elements.*;
[ "java.util", "org.eclipse.birt" ]
java.util; org.eclipse.birt;
650,742
@Override public void removeColor(ItemStack par1ItemStack){ NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound(); if (nbttagcompound != null) { NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); if (nbttagcompound1.hasKey("color")) { nbttagcompound1.removeTag("color"); } } }
void function(ItemStack par1ItemStack){ NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound(); if (nbttagcompound != null) { NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag(STR); if (nbttagcompound1.hasKey("color")) { nbttagcompound1.removeTag("color"); } } }
/** * Remove the color from the specified ItemStack. */
Remove the color from the specified ItemStack
removeColor
{ "repo_name": "nalimleinad/Battlegear2", "path": "battlegear mod src/minecraft/mods/battlegear2/items/ItemShield.java", "license": "gpl-3.0", "size": 7876 }
[ "net.minecraft.item.ItemStack", "net.minecraft.nbt.NBTTagCompound" ]
import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.item.*; import net.minecraft.nbt.*;
[ "net.minecraft.item", "net.minecraft.nbt" ]
net.minecraft.item; net.minecraft.nbt;
1,277,788
public synchronized Relationship getRelationship(Vertex type, Vertex target) { Map<Relationship, Relationship> relationships = getRelationships().get(type); if (relationships == null) { return null; } return relationships.get(new BasicRelationship(this, type, target)); }
synchronized Relationship function(Vertex type, Vertex target) { Map<Relationship, Relationship> relationships = getRelationships().get(type); if (relationships == null) { return null; } return relationships.get(new BasicRelationship(this, type, target)); }
/** * Return the relationship of the type primitive to the target. */
Return the relationship of the type primitive to the target
getRelationship
{ "repo_name": "BOTlibre/BOTlibre", "path": "micro-ai-engine/android/source/org/botlibre/knowledge/BasicVertex.java", "license": "epl-1.0", "size": 152940 }
[ "java.util.Map", "org.botlibre.api.knowledge.Relationship", "org.botlibre.api.knowledge.Vertex" ]
import java.util.Map; import org.botlibre.api.knowledge.Relationship; import org.botlibre.api.knowledge.Vertex;
import java.util.*; import org.botlibre.api.knowledge.*;
[ "java.util", "org.botlibre.api" ]
java.util; org.botlibre.api;
910,095
public int getPort() { final int port = getPortIfSpecified(); if (port == UNSPECIFIED_PORT) { String prot = getProtocol(); if (HTTPConstants.PROTOCOL_HTTPS.equalsIgnoreCase(prot)) { return HTTPConstants.DEFAULT_HTTPS_PORT; } if (!HTTPConstants.PROTOCOL_HTTP.equalsIgnoreCase(prot)) { log.warn("Unexpected protocol: {}", prot); // TODO - should this return something else? } return HTTPConstants.DEFAULT_HTTP_PORT; } return port; }
int function() { final int port = getPortIfSpecified(); if (port == UNSPECIFIED_PORT) { String prot = getProtocol(); if (HTTPConstants.PROTOCOL_HTTPS.equalsIgnoreCase(prot)) { return HTTPConstants.DEFAULT_HTTPS_PORT; } if (!HTTPConstants.PROTOCOL_HTTP.equalsIgnoreCase(prot)) { log.warn(STR, prot); } return HTTPConstants.DEFAULT_HTTP_PORT; } return port; }
/** * Get the port; apply the default for the protocol if necessary. * * @return the port number, with default applied if required. */
Get the port; apply the default for the protocol if necessary
getPort
{ "repo_name": "vherilier/jmeter", "path": "src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java", "license": "apache-2.0", "size": 84530 }
[ "org.apache.jmeter.protocol.http.util.HTTPConstants" ]
import org.apache.jmeter.protocol.http.util.HTTPConstants;
import org.apache.jmeter.protocol.http.util.*;
[ "org.apache.jmeter" ]
org.apache.jmeter;
2,215,289
private void _move_studies( ContentManager cm ) throws Exception { long iDest = Long.parseLong( (String) folderForm.getStickyPatients().iterator().next().toString() ); long[] iaSrc = getLongArrayFromSet( folderForm.getStickyStudies() ); delegate.moveStudies( iaSrc, iDest ); PatientModel destPat = folderForm.getPatientByPk( iDest ); List path = findModelPath( folderForm.getPatients(), iaSrc[0], 1 ); PatientModel srcPat = (PatientModel) path.get(0); _updatePatientWithStudies( destPat, cm ); _updatePatientWithStudies( srcPat, cm ); StudyModel study; for ( int i = 0, len=iaSrc.length ; i < len ; i++ ) { study = new StudyModel( cm.getStudy( iaSrc[i] ) ); ctrl.logProcedureRecord(destPat,study,"study moved from " + srcPat.getPatientName()+ " ("+srcPat.getPatientID()+")" ); } }
void function( ContentManager cm ) throws Exception { long iDest = Long.parseLong( (String) folderForm.getStickyPatients().iterator().next().toString() ); long[] iaSrc = getLongArrayFromSet( folderForm.getStickyStudies() ); delegate.moveStudies( iaSrc, iDest ); PatientModel destPat = folderForm.getPatientByPk( iDest ); List path = findModelPath( folderForm.getPatients(), iaSrc[0], 1 ); PatientModel srcPat = (PatientModel) path.get(0); _updatePatientWithStudies( destPat, cm ); _updatePatientWithStudies( srcPat, cm ); StudyModel study; for ( int i = 0, len=iaSrc.length ; i < len ; i++ ) { study = new StudyModel( cm.getStudy( iaSrc[i] ) ); ctrl.logProcedureRecord(destPat,study,STR + srcPat.getPatientName()+ STR+srcPat.getPatientID()+")" ); } }
/** * Move selected studies to a patient. * * @param cm ContentManagerBean to update the model. */
Move selected studies to a patient
_move_studies
{ "repo_name": "medicayun/medicayundicom", "path": "dcm4jboss-all/tags/DCM4CHEE_2_14_2_TAGA/dcm4jboss-web/src/java/org/dcm4chex/archive/web/maverick/FolderMoveDelegate.java", "license": "apache-2.0", "size": 19590 }
[ "java.util.List", "org.dcm4chex.archive.ejb.interfaces.ContentManager", "org.dcm4chex.archive.web.maverick.model.PatientModel", "org.dcm4chex.archive.web.maverick.model.StudyModel" ]
import java.util.List; import org.dcm4chex.archive.ejb.interfaces.ContentManager; import org.dcm4chex.archive.web.maverick.model.PatientModel; import org.dcm4chex.archive.web.maverick.model.StudyModel;
import java.util.*; import org.dcm4chex.archive.ejb.interfaces.*; import org.dcm4chex.archive.web.maverick.model.*;
[ "java.util", "org.dcm4chex.archive" ]
java.util; org.dcm4chex.archive;
2,527,014
public static int getScreenWidth() { return Toolkit.getDefaultToolkit().getScreenSize().width; }
static int function() { return Toolkit.getDefaultToolkit().getScreenSize().width; }
/** * gets the Width of the Screen * * @return The Width of the Screen */
gets the Width of the Screen
getScreenWidth
{ "repo_name": "AIKO-Aaron/AikoCore", "path": "src/ch/aiko/engine/sprite/ImageUtil.java", "license": "gpl-2.0", "size": 9442 }
[ "java.awt.Toolkit" ]
import java.awt.Toolkit;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,240,367
@Deprecated public RequestGet<CodeBox> getCodeBox(int id) { String url = String.format(Constants.SCRIPTS_DETAIL_URL, getNotEmptyInstanceName(), id); return new RequestGet<>(CodeBox.class, url, this); }
RequestGet<CodeBox> function(int id) { String url = String.format(Constants.SCRIPTS_DETAIL_URL, getNotEmptyInstanceName(), id); return new RequestGet<>(CodeBox.class, url, this); }
/** * Get details of previously created CodeBox. * * @param id CodeBox id. * @return Existing CodeBox. */
Get details of previously created CodeBox
getCodeBox
{ "repo_name": "Syncano/syncano-android", "path": "library/src/main/java/com/syncano/library/SyncanoDashboard.java", "license": "mit", "size": 24946 }
[ "com.syncano.library.api.RequestGet", "com.syncano.library.data.CodeBox" ]
import com.syncano.library.api.RequestGet; import com.syncano.library.data.CodeBox;
import com.syncano.library.api.*; import com.syncano.library.data.*;
[ "com.syncano.library" ]
com.syncano.library;
1,590,243
protected Channel getChannelFromUrl(String sUrl) throws RssAgregatorException { SilverTrace.debug("rssAgregator", "RSSServiceImpl.getChannelFromUrl", "root.MSG_GEN_ENTER_METHOD", "sUrl = " + sUrl); Channel channel = null; try { if (StringUtil.isDefined(sUrl)) { URL url = new URL(sUrl); channel = (Channel) FeedParser.parse(channelBuilder, url); } } catch (MalformedURLException e) { throw new RssAgregatorException("RSSServiceImpl.getChannelFromUrl", SilverpeasException.WARNING, "RssAgregator.EX_URL_IS_NOT_VALID", e); } catch (IOException e) { throw new RssAgregatorException("RSSServiceImpl.getChannelFromUrl", SilverpeasException.WARNING, "RssAgregator.EX_URL_IS_NOT_REATCHABLE", e); } catch (ParseException e) { throw new RssAgregatorException("RSSServiceImpl.getChannelFromUrl", SilverpeasException.WARNING, "RssAgregator.EX_RSS_BAD_FORMAT", e); } SilverTrace.debug("rssAgregator", "RSSServiceImpl.getChannelFromUrl", "root.MSG_GEN_EXIT_METHOD"); return channel; }
Channel function(String sUrl) throws RssAgregatorException { SilverTrace.debug(STR, STR, STR, STR + sUrl); Channel channel = null; try { if (StringUtil.isDefined(sUrl)) { URL url = new URL(sUrl); channel = (Channel) FeedParser.parse(channelBuilder, url); } } catch (MalformedURLException e) { throw new RssAgregatorException(STR, SilverpeasException.WARNING, STR, e); } catch (IOException e) { throw new RssAgregatorException(STR, SilverpeasException.WARNING, STR, e); } catch (ParseException e) { throw new RssAgregatorException(STR, SilverpeasException.WARNING, STR, e); } SilverTrace.debug(STR, STR, STR); return channel; }
/** * Retrieve channel from URL string parameter * @param sUrl the url string parameter * @return RSS channel from URL * @throws RssAgregatorException if MalformedURL or Parse or IO problem occur */
Retrieve channel from URL string parameter
getChannelFromUrl
{ "repo_name": "NicolasEYSSERIC/Silverpeas-Components", "path": "rssaggregator/rssaggregator-jar/src/main/java/com/silverpeas/rssAgregator/control/RSSServiceImpl.java", "license": "agpl-3.0", "size": 6460 }
[ "com.silverpeas.rssAgregator.model.RssAgregatorException", "com.silverpeas.util.StringUtil", "com.stratelia.silverpeas.silvertrace.SilverTrace", "com.stratelia.webactiv.util.exception.SilverpeasException", "de.nava.informa.core.ParseException", "de.nava.informa.impl.basic.Channel", "de.nava.informa.parsers.FeedParser", "java.io.IOException", "java.net.MalformedURLException" ]
import com.silverpeas.rssAgregator.model.RssAgregatorException; import com.silverpeas.util.StringUtil; import com.stratelia.silverpeas.silvertrace.SilverTrace; import com.stratelia.webactiv.util.exception.SilverpeasException; import de.nava.informa.core.ParseException; import de.nava.informa.impl.basic.Channel; import de.nava.informa.parsers.FeedParser; import java.io.IOException; import java.net.MalformedURLException;
import com.silverpeas.*; import com.silverpeas.util.*; import com.stratelia.silverpeas.silvertrace.*; import com.stratelia.webactiv.util.exception.*; import de.nava.informa.core.*; import de.nava.informa.impl.basic.*; import de.nava.informa.parsers.*; import java.io.*; import java.net.*;
[ "com.silverpeas", "com.silverpeas.util", "com.stratelia.silverpeas", "com.stratelia.webactiv", "de.nava.informa", "java.io", "java.net" ]
com.silverpeas; com.silverpeas.util; com.stratelia.silverpeas; com.stratelia.webactiv; de.nava.informa; java.io; java.net;
2,489,601
public static void rectangle (final double x, final double y, final double halfWidth, final double halfHeight) { if (!(halfWidth >= 0)) { throw new IllegalArgumentException("half width must be nonnegative"); } if (!(halfHeight >= 0)) { throw new IllegalArgumentException("half height must be nonnegative"); } final double xs = scaleX(x); final double ys = scaleY(y); final double ws = factorX(2 * halfWidth); final double hs = factorY(2 * halfHeight); if (ws <= 1 && hs <= 1) { pixel(x, y); } else { offscreen.draw(new Rectangle2D.Double(xs - ws / 2, ys - hs / 2, ws, hs)); } draw(); }
static void function (final double x, final double y, final double halfWidth, final double halfHeight) { if (!(halfWidth >= 0)) { throw new IllegalArgumentException(STR); } if (!(halfHeight >= 0)) { throw new IllegalArgumentException(STR); } final double xs = scaleX(x); final double ys = scaleY(y); final double ws = factorX(2 * halfWidth); final double hs = factorY(2 * halfHeight); if (ws <= 1 && hs <= 1) { pixel(x, y); } else { offscreen.draw(new Rectangle2D.Double(xs - ws / 2, ys - hs / 2, ws, hs)); } draw(); }
/** Draws a rectangle of the specified size, centered at (<em>x</em>, <em>y</em>). * * @param x the <em>x</em>-coordinate of the center of the rectangle * @param y the <em>y</em>-coordinate of the center of the rectangle * @param halfWidth one half the width of the rectangle * @param halfHeight one half the height of the rectangle * @throws IllegalArgumentException if either {@code halfWidth} or {@code halfHeight} is negative */
Draws a rectangle of the specified size, centered at (x, y)
rectangle
{ "repo_name": "JFixby/com.hackarrank.java", "path": "bullshit-problems/glass/com/google/java/StdDraw.java", "license": "unlicense", "size": 67145 }
[ "java.awt.geom.Rectangle2D" ]
import java.awt.geom.Rectangle2D;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,704,593
public final CapptainAgent getCapptainAgent() { return mCapptainAgent; }
final CapptainAgent function() { return mCapptainAgent; }
/** * Get the Capptain agent attached to this activity. * @return the Capptain agent */
Get the Capptain agent attached to this activity
getCapptainAgent
{ "repo_name": "ogoguel/azure-mobile-engagement-capptain-cordova", "path": "src/android/capptain-sdk-android/src/com/ubikod/capptain/android/sdk/activity/CapptainPreferenceActivity.java", "license": "mit", "size": 2543 }
[ "com.ubikod.capptain.android.sdk.CapptainAgent" ]
import com.ubikod.capptain.android.sdk.CapptainAgent;
import com.ubikod.capptain.android.sdk.*;
[ "com.ubikod.capptain" ]
com.ubikod.capptain;
171,353
@Test public void bootstrap() { MemoryNodeStore mount = new MemoryNodeStore(); MemoryNodeStore global = new MemoryNodeStore(); MountInfoProvider mip = Mounts.newBuilder().readOnlyMount("libs", "/libs", "/apps").build(); ctx.registerService(MountInfoProvider.class, mip); ctx.registerService(StatisticsProvider.class, StatisticsProvider.NOOP); ctx.registerService(NodeStoreProvider.class, new SimpleNodeStoreProvider(global), ImmutableMap.of("role", "composite-global", "registerDescriptors", Boolean.TRUE)); ctx.registerService(NodeStoreProvider.class, new SimpleNodeStoreProvider(mount), ImmutableMap.of("role", "composite-mount-libs")); ctx.registerInjectActivateService(new NodeStoreChecksService()); ctx.registerInjectActivateService(new CompositeNodeStoreService()); assertThat("No NodeStore registered", ctx.getService(NodeStore.class), notNullValue()); }
void function() { MemoryNodeStore mount = new MemoryNodeStore(); MemoryNodeStore global = new MemoryNodeStore(); MountInfoProvider mip = Mounts.newBuilder().readOnlyMount("libs", "/libs", "/apps").build(); ctx.registerService(MountInfoProvider.class, mip); ctx.registerService(StatisticsProvider.class, StatisticsProvider.NOOP); ctx.registerService(NodeStoreProvider.class, new SimpleNodeStoreProvider(global), ImmutableMap.of("role", STR, STR, Boolean.TRUE)); ctx.registerService(NodeStoreProvider.class, new SimpleNodeStoreProvider(mount), ImmutableMap.of("role", STR)); ctx.registerInjectActivateService(new NodeStoreChecksService()); ctx.registerInjectActivateService(new CompositeNodeStoreService()); assertThat(STR, ctx.getService(NodeStore.class), notNullValue()); }
/** * Verifies that a minimally-configured <tt>CompositeNodeStore</tt> can be registered successfully */
Verifies that a minimally-configured CompositeNodeStore can be registered successfully
bootstrap
{ "repo_name": "apache/jackrabbit-oak", "path": "oak-store-composite/src/test/java/org/apache/jackrabbit/oak/composite/CompositeNodeStoreServiceTest.java", "license": "apache-2.0", "size": 8305 }
[ "com.google.common.collect.ImmutableMap", "org.apache.jackrabbit.oak.composite.checks.NodeStoreChecksService", "org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore", "org.apache.jackrabbit.oak.spi.mount.MountInfoProvider", "org.apache.jackrabbit.oak.spi.mount.Mounts", "org.apache.jackrabbit.oak.spi.state.NodeStore", "org.apache.jackrabbit.oak.spi.state.NodeStoreProvider", "org.apache.jackrabbit.oak.stats.StatisticsProvider", "org.hamcrest.MatcherAssert", "org.hamcrest.Matchers" ]
import com.google.common.collect.ImmutableMap; import org.apache.jackrabbit.oak.composite.checks.NodeStoreChecksService; import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore; import org.apache.jackrabbit.oak.spi.mount.MountInfoProvider; import org.apache.jackrabbit.oak.spi.mount.Mounts; import org.apache.jackrabbit.oak.spi.state.NodeStore; import org.apache.jackrabbit.oak.spi.state.NodeStoreProvider; import org.apache.jackrabbit.oak.stats.StatisticsProvider; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers;
import com.google.common.collect.*; import org.apache.jackrabbit.oak.composite.checks.*; import org.apache.jackrabbit.oak.plugins.memory.*; import org.apache.jackrabbit.oak.spi.mount.*; import org.apache.jackrabbit.oak.spi.state.*; import org.apache.jackrabbit.oak.stats.*; import org.hamcrest.*;
[ "com.google.common", "org.apache.jackrabbit", "org.hamcrest" ]
com.google.common; org.apache.jackrabbit; org.hamcrest;
1,888,752
public Set<VisualStyle> createVisualStyles(final Properties props) { // Convert properties to Vizmap: Vizmap vizmap = new Vizmap(); var vizmapStyles = vizmap.getVisualStyle(); // Group properties keys/values by visual style name: Map<String, Map<String, String>> styleNamesMap = new HashMap<>(); Set<String> propNames = props.stringPropertyNames(); for (String key : propNames) { String value = props.getProperty(key); String styleName = CalculatorConverter.parseStyleName(key); if (styleName != null) { // Add each style name and its properties to a map Map<String, String> keyValueMap = styleNamesMap.get(styleName); if (keyValueMap == null) { keyValueMap = new HashMap<String, String>(); styleNamesMap.put(styleName, keyValueMap); } keyValueMap.put(key, value); } } // Create a Visual Style for each style name: for (Entry<String, Map<String, String>> entry : styleNamesMap.entrySet()) { String styleName = entry.getKey(); var vs = new org.cytoscape.io.internal.util.vizmap.model.VisualStyle(); vs.setName(styleName); vs.setNetwork(new Network()); vs.setNode(new Node()); vs.setEdge(new Edge()); // Create and set the visual properties and mappings: Map<String, String> vsProps = entry.getValue(); for (Entry<String, String> p : vsProps.entrySet()) { String key = p.getKey(); String value = p.getValue(); Set<CalculatorConverter> convs = calculatorConverterFactory.getConverters(key); for (CalculatorConverter c : convs) { c.convert(vs, value, props); } } vizmapStyles.add(vs); } return createNetworkVisualStyles(vizmap); }
Set<VisualStyle> function(final Properties props) { Vizmap vizmap = new Vizmap(); var vizmapStyles = vizmap.getVisualStyle(); Map<String, Map<String, String>> styleNamesMap = new HashMap<>(); Set<String> propNames = props.stringPropertyNames(); for (String key : propNames) { String value = props.getProperty(key); String styleName = CalculatorConverter.parseStyleName(key); if (styleName != null) { Map<String, String> keyValueMap = styleNamesMap.get(styleName); if (keyValueMap == null) { keyValueMap = new HashMap<String, String>(); styleNamesMap.put(styleName, keyValueMap); } keyValueMap.put(key, value); } } for (Entry<String, Map<String, String>> entry : styleNamesMap.entrySet()) { String styleName = entry.getKey(); var vs = new org.cytoscape.io.internal.util.vizmap.model.VisualStyle(); vs.setName(styleName); vs.setNetwork(new Network()); vs.setNode(new Node()); vs.setEdge(new Edge()); Map<String, String> vsProps = entry.getValue(); for (Entry<String, String> p : vsProps.entrySet()) { String key = p.getKey(); String value = p.getValue(); Set<CalculatorConverter> convs = calculatorConverterFactory.getConverters(key); for (CalculatorConverter c : convs) { c.convert(vs, value, props); } } vizmapStyles.add(vs); } return createNetworkVisualStyles(vizmap); }
/** * This method creates a collection of VisualStyle objects based on the provided Properties object. * Used to convert old (2.x) vizmap.props format to visual styles. * @param vizmap A Properties object containing a representation of VisualStyles. * @return A collection of VisualStyle objects. */
This method creates a collection of VisualStyle objects based on the provided Properties object. Used to convert old (2.x) vizmap.props format to visual styles
createVisualStyles
{ "repo_name": "cytoscape/cytoscape-impl", "path": "io-impl/impl/src/main/java/org/cytoscape/io/internal/util/vizmap/VisualStyleSerializer.java", "license": "lgpl-2.1", "size": 25153 }
[ "java.util.HashMap", "java.util.Map", "java.util.Properties", "java.util.Set", "org.cytoscape.io.internal.util.vizmap.model.Edge", "org.cytoscape.io.internal.util.vizmap.model.Network", "org.cytoscape.io.internal.util.vizmap.model.Node", "org.cytoscape.io.internal.util.vizmap.model.Vizmap", "org.cytoscape.view.vizmap.VisualStyle" ]
import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.Set; import org.cytoscape.io.internal.util.vizmap.model.Edge; import org.cytoscape.io.internal.util.vizmap.model.Network; import org.cytoscape.io.internal.util.vizmap.model.Node; import org.cytoscape.io.internal.util.vizmap.model.Vizmap; import org.cytoscape.view.vizmap.VisualStyle;
import java.util.*; import org.cytoscape.io.internal.util.vizmap.model.*; import org.cytoscape.view.vizmap.*;
[ "java.util", "org.cytoscape.io", "org.cytoscape.view" ]
java.util; org.cytoscape.io; org.cytoscape.view;
948,932
@Test public void parseBlockNestedBlock() { final String code = " BLOCK0\n BLOCK1\n NOP\n ENDBLOCK1\n ENDBLOCK0"; final CompositeSourceNode body = parseCompleteBlock(code); final List<SourceNode> bodyNodes = body.getChildNodes(); assertThat(bodyNodes.size(), is(1)); final SourceNode bodyNode0 = bodyNodes.get(0); assertThat(bodyNode0.getLength(), is(24)); assertThat(bodyNode0.getParseError(), is(nullValue())); assertThat(bodyNode0, hasType(Block1Block.class)); }
void function() { final String code = STR; final CompositeSourceNode body = parseCompleteBlock(code); final List<SourceNode> bodyNodes = body.getChildNodes(); assertThat(bodyNodes.size(), is(1)); final SourceNode bodyNode0 = bodyNodes.get(0); assertThat(bodyNode0.getLength(), is(24)); assertThat(bodyNode0.getParseError(), is(nullValue())); assertThat(bodyNode0, hasType(Block1Block.class)); }
/** * Asserts that {@link BasicBlockParser#parseBlock(SourceNodeProducer, BlockDirectiveLine)} correctly parses a block with a * nested block in its body. */
Asserts that <code>BasicBlockParser#parseBlock(SourceNodeProducer, BlockDirectiveLine)</code> correctly parses a block with a nested block in its body
parseBlockNestedBlock
{ "repo_name": "reasm/reasm-commons", "path": "src/test/java/org/reasm/commons/source/BasicBlockParserTest.java", "license": "mit", "size": 8494 }
[ "ca.fragag.testhelpers.HasType", "java.util.List", "org.hamcrest.Matchers", "org.junit.Assert", "org.reasm.source.CompositeSourceNode", "org.reasm.source.SourceNode" ]
import ca.fragag.testhelpers.HasType; import java.util.List; import org.hamcrest.Matchers; import org.junit.Assert; import org.reasm.source.CompositeSourceNode; import org.reasm.source.SourceNode;
import ca.fragag.testhelpers.*; import java.util.*; import org.hamcrest.*; import org.junit.*; import org.reasm.source.*;
[ "ca.fragag.testhelpers", "java.util", "org.hamcrest", "org.junit", "org.reasm.source" ]
ca.fragag.testhelpers; java.util; org.hamcrest; org.junit; org.reasm.source;
175,252
public static API updateApi(API originalAPI, APIDTO apiDtoToUpdate, APIProvider apiProvider, String[] tokenScopes) throws ParseException, CryptoException, APIManagementException, FaultGatewaysException { APIIdentifier apiIdentifier = originalAPI.getId(); // Validate if the USER_REST_API_SCOPES is not set in WebAppAuthenticator when scopes are validated if (tokenScopes == null) { throw new APIManagementException("Error occurred while updating the API " + originalAPI.getUUID() + " as the token information hasn't been correctly set internally", ExceptionCodes.TOKEN_SCOPES_NOT_SET); } boolean isGraphql = originalAPI.getType() != null && APIConstants.APITransportType.GRAPHQL.toString() .equals(originalAPI.getType()); boolean isAsyncAPI = originalAPI.getType() != null && (APIConstants.APITransportType.WS.toString().equals(originalAPI.getType()) || APIConstants.APITransportType.WEBSUB.toString().equals(originalAPI.getType()) || APIConstants.APITransportType.SSE.toString().equals(originalAPI.getType())); Scope[] apiDtoClassAnnotatedScopes = APIDTO.class.getAnnotationsByType(Scope.class); boolean hasClassLevelScope = checkClassScopeAnnotation(apiDtoClassAnnotatedScopes, tokenScopes); JSONParser parser = new JSONParser(); String oldEndpointConfigString = originalAPI.getEndpointConfig(); JSONObject oldEndpointConfig = null; if (StringUtils.isNotBlank(oldEndpointConfigString)) { oldEndpointConfig = (JSONObject) parser.parse(oldEndpointConfigString); } String oldProductionApiSecret = null; String oldSandboxApiSecret = null; if (oldEndpointConfig != null) { if ((oldEndpointConfig.containsKey(APIConstants.ENDPOINT_SECURITY))) { JSONObject oldEndpointSecurity = (JSONObject) oldEndpointConfig.get(APIConstants.ENDPOINT_SECURITY); if (oldEndpointSecurity.containsKey(APIConstants.OAuthConstants.ENDPOINT_SECURITY_PRODUCTION)) { JSONObject oldEndpointSecurityProduction = (JSONObject) oldEndpointSecurity .get(APIConstants.OAuthConstants.ENDPOINT_SECURITY_PRODUCTION); if (oldEndpointSecurityProduction.get(APIConstants.OAuthConstants.OAUTH_CLIENT_ID) != null && oldEndpointSecurityProduction.get(APIConstants.OAuthConstants.OAUTH_CLIENT_SECRET) != null) { oldProductionApiSecret = oldEndpointSecurityProduction .get(APIConstants.OAuthConstants.OAUTH_CLIENT_SECRET).toString(); } } if (oldEndpointSecurity.containsKey(APIConstants.OAuthConstants.ENDPOINT_SECURITY_SANDBOX)) { JSONObject oldEndpointSecuritySandbox = (JSONObject) oldEndpointSecurity .get(APIConstants.OAuthConstants.ENDPOINT_SECURITY_SANDBOX); if (oldEndpointSecuritySandbox.get(APIConstants.OAuthConstants.OAUTH_CLIENT_ID) != null && oldEndpointSecuritySandbox.get(APIConstants.OAuthConstants.OAUTH_CLIENT_SECRET) != null) { oldSandboxApiSecret = oldEndpointSecuritySandbox .get(APIConstants.OAuthConstants.OAUTH_CLIENT_SECRET).toString(); } } } } Map endpointConfig = (Map) apiDtoToUpdate.getEndpointConfig(); CryptoUtil cryptoUtil = CryptoUtil.getDefaultCryptoUtil(); // OAuth 2.0 backend protection: API Key and API Secret encryption encryptEndpointSecurityOAuthCredentials(endpointConfig, cryptoUtil, oldProductionApiSecret, oldSandboxApiSecret, apiDtoToUpdate); // AWS Lambda: secret key encryption while updating the API if (apiDtoToUpdate.getEndpointConfig() != null) { if (endpointConfig.containsKey(APIConstants.AMZN_SECRET_KEY)) { String secretKey = (String) endpointConfig.get(APIConstants.AMZN_SECRET_KEY); if (!StringUtils.isEmpty(secretKey)) { if (!APIConstants.AWS_SECRET_KEY.equals(secretKey)) { String encryptedSecretKey = cryptoUtil.encryptAndBase64Encode(secretKey.getBytes()); endpointConfig.put(APIConstants.AMZN_SECRET_KEY, encryptedSecretKey); apiDtoToUpdate.setEndpointConfig(endpointConfig); } else { JSONParser jsonParser = new JSONParser(); JSONObject originalEndpointConfig = (JSONObject) jsonParser .parse(originalAPI.getEndpointConfig()); String encryptedSecretKey = (String) originalEndpointConfig.get(APIConstants.AMZN_SECRET_KEY); endpointConfig.put(APIConstants.AMZN_SECRET_KEY, encryptedSecretKey); apiDtoToUpdate.setEndpointConfig(endpointConfig); } } } } if (!hasClassLevelScope) { // Validate per-field scopes apiDtoToUpdate = getFieldOverriddenAPIDTO(apiDtoToUpdate, originalAPI, tokenScopes); } //Overriding some properties: //API Name change not allowed if OnPrem if (APIUtil.isOnPremResolver()) { apiDtoToUpdate.setName(apiIdentifier.getApiName()); } apiDtoToUpdate.setVersion(apiIdentifier.getVersion()); apiDtoToUpdate.setProvider(apiIdentifier.getProviderName()); apiDtoToUpdate.setContext(originalAPI.getContextTemplate()); apiDtoToUpdate.setLifeCycleStatus(originalAPI.getStatus()); apiDtoToUpdate.setType(APIDTO.TypeEnum.fromValue(originalAPI.getType())); List<APIResource> removedProductResources = getRemovedProductResources(apiDtoToUpdate, originalAPI); if (!removedProductResources.isEmpty()) { throw new APIManagementException( "Cannot remove following resource paths " + removedProductResources.toString() + " because they are used by one or more API Products", ExceptionCodes .from(ExceptionCodes.API_PRODUCT_USED_RESOURCES, originalAPI.getId().getApiName(), originalAPI.getId().getVersion())); } // Validate API Security List<String> apiSecurity = apiDtoToUpdate.getSecurityScheme(); //validation for tiers List<String> tiersFromDTO = apiDtoToUpdate.getPolicies(); String originalStatus = originalAPI.getStatus(); if (apiSecurity.contains(APIConstants.DEFAULT_API_SECURITY_OAUTH2) || apiSecurity .contains(APIConstants.API_SECURITY_API_KEY)) { if (tiersFromDTO == null || tiersFromDTO.isEmpty() && !(APIConstants.CREATED.equals(originalStatus) || APIConstants.PROTOTYPED.equals(originalStatus))) { throw new APIManagementException( "A tier should be defined if the API is not in CREATED or PROTOTYPED state", ExceptionCodes.TIER_CANNOT_BE_NULL); } } if (tiersFromDTO != null && !tiersFromDTO.isEmpty()) { //check whether the added API's tiers are all valid Set<Tier> definedTiers = apiProvider.getTiers(); List<String> invalidTiers = getInvalidTierNames(definedTiers, tiersFromDTO); if (invalidTiers.size() > 0) { throw new APIManagementException( "Specified tier(s) " + Arrays.toString(invalidTiers.toArray()) + " are invalid", ExceptionCodes.TIER_NAME_INVALID); } } if (apiDtoToUpdate.getAccessControlRoles() != null) { String errorMessage = validateUserRoles(apiDtoToUpdate.getAccessControlRoles()); if (!errorMessage.isEmpty()) { throw new APIManagementException(errorMessage, ExceptionCodes.INVALID_USER_ROLES); } } if (apiDtoToUpdate.getVisibleRoles() != null) { String errorMessage = validateRoles(apiDtoToUpdate.getVisibleRoles()); if (!errorMessage.isEmpty()) { throw new APIManagementException(errorMessage, ExceptionCodes.INVALID_USER_ROLES); } } if (apiDtoToUpdate.getAdditionalProperties() != null) { String errorMessage = validateAdditionalProperties(apiDtoToUpdate.getAdditionalProperties()); if (!errorMessage.isEmpty()) { throw new APIManagementException(errorMessage, ExceptionCodes .from(ExceptionCodes.INVALID_ADDITIONAL_PROPERTIES, apiDtoToUpdate.getName(), apiDtoToUpdate.getVersion())); } } // Validate if resources are empty if (apiDtoToUpdate.getOperations() == null || apiDtoToUpdate.getOperations().isEmpty()) { throw new APIManagementException(ExceptionCodes.NO_RESOURCES_FOUND); } API apiToUpdate = APIMappingUtil.fromDTOtoAPI(apiDtoToUpdate, apiIdentifier.getProviderName()); if (APIConstants.PUBLIC_STORE_VISIBILITY.equals(apiToUpdate.getVisibility())) { apiToUpdate.setVisibleRoles(StringUtils.EMPTY); } apiToUpdate.setUUID(originalAPI.getUUID()); apiToUpdate.setOrganization(originalAPI.getOrganization()); validateScopes(apiToUpdate); apiToUpdate.setThumbnailUrl(originalAPI.getThumbnailUrl()); if (apiDtoToUpdate.getKeyManagers() instanceof List) { apiToUpdate.setKeyManagers((List<String>) apiDtoToUpdate.getKeyManagers()); } else { apiToUpdate.setKeyManagers(Collections.singletonList(APIConstants.KeyManager.API_LEVEL_ALL_KEY_MANAGERS)); } //preserve monetization status in the update flow //apiProvider.configureMonetizationInAPIArtifact(originalAPI); ////////////TODO /////////REG call if (!isAsyncAPI) { String oldDefinition = apiProvider .getOpenAPIDefinition(apiToUpdate.getUuid(), originalAPI.getOrganization()); APIDefinition apiDefinition = OASParserUtil.getOASParser(oldDefinition); SwaggerData swaggerData = new SwaggerData(apiToUpdate); String newDefinition = apiDefinition.generateAPIDefinition(swaggerData, oldDefinition); apiProvider.saveSwaggerDefinition(apiToUpdate, newDefinition, originalAPI.getOrganization()); if (!isGraphql) { apiToUpdate.setUriTemplates(apiDefinition.getURITemplates(newDefinition)); } } else { String oldDefinition = apiProvider .getAsyncAPIDefinition(apiToUpdate.getUuid(), originalAPI.getOrganization()); AsyncApiParser asyncApiParser = new AsyncApiParser(); String updateAsyncAPIDefinition = asyncApiParser.updateAsyncAPIDefinition(oldDefinition, apiToUpdate); apiProvider.saveAsyncApiDefinition(originalAPI, updateAsyncAPIDefinition); } apiToUpdate.setWsdlUrl(apiDtoToUpdate.getWsdlUrl()); //validate API categories List<APICategory> apiCategories = apiToUpdate.getApiCategories(); List<APICategory> apiCategoriesList = new ArrayList<>(); for (APICategory category : apiCategories) { category.setOrganization(originalAPI.getOrganization()); apiCategoriesList.add(category); } apiToUpdate.setApiCategories(apiCategoriesList); if (apiCategoriesList.size() > 0) { if (!APIUtil.validateAPICategories(apiCategoriesList, originalAPI.getOrganization())) { throw new APIManagementException("Invalid API Category name(s) defined", ExceptionCodes.from(ExceptionCodes.API_CATEGORY_INVALID)); } } apiToUpdate.setOrganization(originalAPI.getOrganization()); apiProvider.updateAPI(apiToUpdate, originalAPI); return apiProvider.getAPIbyUUID(originalAPI.getUuid(), originalAPI.getOrganization()); // TODO use returend api }
static API function(API originalAPI, APIDTO apiDtoToUpdate, APIProvider apiProvider, String[] tokenScopes) throws ParseException, CryptoException, APIManagementException, FaultGatewaysException { APIIdentifier apiIdentifier = originalAPI.getId(); if (tokenScopes == null) { throw new APIManagementException(STR + originalAPI.getUUID() + STR, ExceptionCodes.TOKEN_SCOPES_NOT_SET); } boolean isGraphql = originalAPI.getType() != null && APIConstants.APITransportType.GRAPHQL.toString() .equals(originalAPI.getType()); boolean isAsyncAPI = originalAPI.getType() != null && (APIConstants.APITransportType.WS.toString().equals(originalAPI.getType()) APIConstants.APITransportType.WEBSUB.toString().equals(originalAPI.getType()) APIConstants.APITransportType.SSE.toString().equals(originalAPI.getType())); Scope[] apiDtoClassAnnotatedScopes = APIDTO.class.getAnnotationsByType(Scope.class); boolean hasClassLevelScope = checkClassScopeAnnotation(apiDtoClassAnnotatedScopes, tokenScopes); JSONParser parser = new JSONParser(); String oldEndpointConfigString = originalAPI.getEndpointConfig(); JSONObject oldEndpointConfig = null; if (StringUtils.isNotBlank(oldEndpointConfigString)) { oldEndpointConfig = (JSONObject) parser.parse(oldEndpointConfigString); } String oldProductionApiSecret = null; String oldSandboxApiSecret = null; if (oldEndpointConfig != null) { if ((oldEndpointConfig.containsKey(APIConstants.ENDPOINT_SECURITY))) { JSONObject oldEndpointSecurity = (JSONObject) oldEndpointConfig.get(APIConstants.ENDPOINT_SECURITY); if (oldEndpointSecurity.containsKey(APIConstants.OAuthConstants.ENDPOINT_SECURITY_PRODUCTION)) { JSONObject oldEndpointSecurityProduction = (JSONObject) oldEndpointSecurity .get(APIConstants.OAuthConstants.ENDPOINT_SECURITY_PRODUCTION); if (oldEndpointSecurityProduction.get(APIConstants.OAuthConstants.OAUTH_CLIENT_ID) != null && oldEndpointSecurityProduction.get(APIConstants.OAuthConstants.OAUTH_CLIENT_SECRET) != null) { oldProductionApiSecret = oldEndpointSecurityProduction .get(APIConstants.OAuthConstants.OAUTH_CLIENT_SECRET).toString(); } } if (oldEndpointSecurity.containsKey(APIConstants.OAuthConstants.ENDPOINT_SECURITY_SANDBOX)) { JSONObject oldEndpointSecuritySandbox = (JSONObject) oldEndpointSecurity .get(APIConstants.OAuthConstants.ENDPOINT_SECURITY_SANDBOX); if (oldEndpointSecuritySandbox.get(APIConstants.OAuthConstants.OAUTH_CLIENT_ID) != null && oldEndpointSecuritySandbox.get(APIConstants.OAuthConstants.OAUTH_CLIENT_SECRET) != null) { oldSandboxApiSecret = oldEndpointSecuritySandbox .get(APIConstants.OAuthConstants.OAUTH_CLIENT_SECRET).toString(); } } } } Map endpointConfig = (Map) apiDtoToUpdate.getEndpointConfig(); CryptoUtil cryptoUtil = CryptoUtil.getDefaultCryptoUtil(); encryptEndpointSecurityOAuthCredentials(endpointConfig, cryptoUtil, oldProductionApiSecret, oldSandboxApiSecret, apiDtoToUpdate); if (apiDtoToUpdate.getEndpointConfig() != null) { if (endpointConfig.containsKey(APIConstants.AMZN_SECRET_KEY)) { String secretKey = (String) endpointConfig.get(APIConstants.AMZN_SECRET_KEY); if (!StringUtils.isEmpty(secretKey)) { if (!APIConstants.AWS_SECRET_KEY.equals(secretKey)) { String encryptedSecretKey = cryptoUtil.encryptAndBase64Encode(secretKey.getBytes()); endpointConfig.put(APIConstants.AMZN_SECRET_KEY, encryptedSecretKey); apiDtoToUpdate.setEndpointConfig(endpointConfig); } else { JSONParser jsonParser = new JSONParser(); JSONObject originalEndpointConfig = (JSONObject) jsonParser .parse(originalAPI.getEndpointConfig()); String encryptedSecretKey = (String) originalEndpointConfig.get(APIConstants.AMZN_SECRET_KEY); endpointConfig.put(APIConstants.AMZN_SECRET_KEY, encryptedSecretKey); apiDtoToUpdate.setEndpointConfig(endpointConfig); } } } } if (!hasClassLevelScope) { apiDtoToUpdate = getFieldOverriddenAPIDTO(apiDtoToUpdate, originalAPI, tokenScopes); } if (APIUtil.isOnPremResolver()) { apiDtoToUpdate.setName(apiIdentifier.getApiName()); } apiDtoToUpdate.setVersion(apiIdentifier.getVersion()); apiDtoToUpdate.setProvider(apiIdentifier.getProviderName()); apiDtoToUpdate.setContext(originalAPI.getContextTemplate()); apiDtoToUpdate.setLifeCycleStatus(originalAPI.getStatus()); apiDtoToUpdate.setType(APIDTO.TypeEnum.fromValue(originalAPI.getType())); List<APIResource> removedProductResources = getRemovedProductResources(apiDtoToUpdate, originalAPI); if (!removedProductResources.isEmpty()) { throw new APIManagementException( STR + removedProductResources.toString() + STR, ExceptionCodes .from(ExceptionCodes.API_PRODUCT_USED_RESOURCES, originalAPI.getId().getApiName(), originalAPI.getId().getVersion())); } List<String> apiSecurity = apiDtoToUpdate.getSecurityScheme(); List<String> tiersFromDTO = apiDtoToUpdate.getPolicies(); String originalStatus = originalAPI.getStatus(); if (apiSecurity.contains(APIConstants.DEFAULT_API_SECURITY_OAUTH2) apiSecurity .contains(APIConstants.API_SECURITY_API_KEY)) { if (tiersFromDTO == null tiersFromDTO.isEmpty() && !(APIConstants.CREATED.equals(originalStatus) APIConstants.PROTOTYPED.equals(originalStatus))) { throw new APIManagementException( STR, ExceptionCodes.TIER_CANNOT_BE_NULL); } } if (tiersFromDTO != null && !tiersFromDTO.isEmpty()) { Set<Tier> definedTiers = apiProvider.getTiers(); List<String> invalidTiers = getInvalidTierNames(definedTiers, tiersFromDTO); if (invalidTiers.size() > 0) { throw new APIManagementException( STR + Arrays.toString(invalidTiers.toArray()) + STR, ExceptionCodes.TIER_NAME_INVALID); } } if (apiDtoToUpdate.getAccessControlRoles() != null) { String errorMessage = validateUserRoles(apiDtoToUpdate.getAccessControlRoles()); if (!errorMessage.isEmpty()) { throw new APIManagementException(errorMessage, ExceptionCodes.INVALID_USER_ROLES); } } if (apiDtoToUpdate.getVisibleRoles() != null) { String errorMessage = validateRoles(apiDtoToUpdate.getVisibleRoles()); if (!errorMessage.isEmpty()) { throw new APIManagementException(errorMessage, ExceptionCodes.INVALID_USER_ROLES); } } if (apiDtoToUpdate.getAdditionalProperties() != null) { String errorMessage = validateAdditionalProperties(apiDtoToUpdate.getAdditionalProperties()); if (!errorMessage.isEmpty()) { throw new APIManagementException(errorMessage, ExceptionCodes .from(ExceptionCodes.INVALID_ADDITIONAL_PROPERTIES, apiDtoToUpdate.getName(), apiDtoToUpdate.getVersion())); } } if (apiDtoToUpdate.getOperations() == null apiDtoToUpdate.getOperations().isEmpty()) { throw new APIManagementException(ExceptionCodes.NO_RESOURCES_FOUND); } API apiToUpdate = APIMappingUtil.fromDTOtoAPI(apiDtoToUpdate, apiIdentifier.getProviderName()); if (APIConstants.PUBLIC_STORE_VISIBILITY.equals(apiToUpdate.getVisibility())) { apiToUpdate.setVisibleRoles(StringUtils.EMPTY); } apiToUpdate.setUUID(originalAPI.getUUID()); apiToUpdate.setOrganization(originalAPI.getOrganization()); validateScopes(apiToUpdate); apiToUpdate.setThumbnailUrl(originalAPI.getThumbnailUrl()); if (apiDtoToUpdate.getKeyManagers() instanceof List) { apiToUpdate.setKeyManagers((List<String>) apiDtoToUpdate.getKeyManagers()); } else { apiToUpdate.setKeyManagers(Collections.singletonList(APIConstants.KeyManager.API_LEVEL_ALL_KEY_MANAGERS)); } if (!isAsyncAPI) { String oldDefinition = apiProvider .getOpenAPIDefinition(apiToUpdate.getUuid(), originalAPI.getOrganization()); APIDefinition apiDefinition = OASParserUtil.getOASParser(oldDefinition); SwaggerData swaggerData = new SwaggerData(apiToUpdate); String newDefinition = apiDefinition.generateAPIDefinition(swaggerData, oldDefinition); apiProvider.saveSwaggerDefinition(apiToUpdate, newDefinition, originalAPI.getOrganization()); if (!isGraphql) { apiToUpdate.setUriTemplates(apiDefinition.getURITemplates(newDefinition)); } } else { String oldDefinition = apiProvider .getAsyncAPIDefinition(apiToUpdate.getUuid(), originalAPI.getOrganization()); AsyncApiParser asyncApiParser = new AsyncApiParser(); String updateAsyncAPIDefinition = asyncApiParser.updateAsyncAPIDefinition(oldDefinition, apiToUpdate); apiProvider.saveAsyncApiDefinition(originalAPI, updateAsyncAPIDefinition); } apiToUpdate.setWsdlUrl(apiDtoToUpdate.getWsdlUrl()); List<APICategory> apiCategories = apiToUpdate.getApiCategories(); List<APICategory> apiCategoriesList = new ArrayList<>(); for (APICategory category : apiCategories) { category.setOrganization(originalAPI.getOrganization()); apiCategoriesList.add(category); } apiToUpdate.setApiCategories(apiCategoriesList); if (apiCategoriesList.size() > 0) { if (!APIUtil.validateAPICategories(apiCategoriesList, originalAPI.getOrganization())) { throw new APIManagementException(STR, ExceptionCodes.from(ExceptionCodes.API_CATEGORY_INVALID)); } } apiToUpdate.setOrganization(originalAPI.getOrganization()); apiProvider.updateAPI(apiToUpdate, originalAPI); return apiProvider.getAPIbyUUID(originalAPI.getUuid(), originalAPI.getOrganization()); }
/** * Update an API. * * @param originalAPI Existing API * @param apiDtoToUpdate New API DTO to update * @param apiProvider API Provider * @param tokenScopes Scopes of the token * @throws ParseException If an error occurs while parsing the endpoint configuration * @throws CryptoException If an error occurs while encrypting the secret key of API * @throws APIManagementException If an error occurs while updating the API * @throws FaultGatewaysException If an error occurs while updating manage of an existing API */
Update an API
updateApi
{ "repo_name": "fazlan-nazeem/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/PublisherCommonUtils.java", "license": "apache-2.0", "size": 89948 }
[ "java.util.ArrayList", "java.util.Arrays", "java.util.Collections", "java.util.List", "java.util.Map", "java.util.Set", "org.apache.commons.lang3.StringUtils", "org.json.simple.JSONObject", "org.json.simple.parser.JSONParser", "org.json.simple.parser.ParseException", "org.wso2.carbon.apimgt.api.APIDefinition", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.APIProvider", "org.wso2.carbon.apimgt.api.ExceptionCodes", "org.wso2.carbon.apimgt.api.FaultGatewaysException", "org.wso2.carbon.apimgt.api.doc.model.APIResource", "org.wso2.carbon.apimgt.api.model.APICategory", "org.wso2.carbon.apimgt.api.model.APIIdentifier", "org.wso2.carbon.apimgt.api.model.SwaggerData", "org.wso2.carbon.apimgt.api.model.Tier", "org.wso2.carbon.apimgt.impl.APIConstants", "org.wso2.carbon.apimgt.impl.definitions.AsyncApiParser", "org.wso2.carbon.apimgt.impl.definitions.OASParserUtil", "org.wso2.carbon.apimgt.impl.utils.APIUtil", "org.wso2.carbon.apimgt.rest.api.common.annotations.Scope", "org.wso2.carbon.core.util.CryptoException", "org.wso2.carbon.core.util.CryptoUtil" ]
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.commons.lang3.StringUtils; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import org.wso2.carbon.apimgt.api.APIDefinition; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.api.ExceptionCodes; import org.wso2.carbon.apimgt.api.FaultGatewaysException; import org.wso2.carbon.apimgt.api.doc.model.APIResource; import org.wso2.carbon.apimgt.api.model.APICategory; import org.wso2.carbon.apimgt.api.model.APIIdentifier; import org.wso2.carbon.apimgt.api.model.SwaggerData; import org.wso2.carbon.apimgt.api.model.Tier; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.definitions.AsyncApiParser; import org.wso2.carbon.apimgt.impl.definitions.OASParserUtil; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.apimgt.rest.api.common.annotations.Scope; import org.wso2.carbon.core.util.CryptoException; import org.wso2.carbon.core.util.CryptoUtil;
import java.util.*; import org.apache.commons.lang3.*; import org.json.simple.*; import org.json.simple.parser.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.doc.model.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.*; import org.wso2.carbon.apimgt.impl.definitions.*; import org.wso2.carbon.apimgt.impl.utils.*; import org.wso2.carbon.apimgt.rest.api.common.annotations.*; import org.wso2.carbon.core.util.*;
[ "java.util", "org.apache.commons", "org.json.simple", "org.wso2.carbon" ]
java.util; org.apache.commons; org.json.simple; org.wso2.carbon;
1,961,308
final List<EdmProperty.Builder> properties = new ArrayList<EdmProperty.Builder>(); properties.add(EdmProperty.newBuilder("dataSource").setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder("dimensions").setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder("measures").setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder("genericCols").setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder("dataSourceClassMapping").setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder("limitExceeded").setType(EdmSimpleType.BOOLEAN)); return EdmComplexType.newBuilder().setNamespace(namespace).setName("DataSource").addProperties(properties); }
final List<EdmProperty.Builder> properties = new ArrayList<EdmProperty.Builder>(); properties.add(EdmProperty.newBuilder(STR).setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder(STR).setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder(STR).setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder(STR).setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder(STR).setType(EdmSimpleType.STRING)); properties.add(EdmProperty.newBuilder(STR).setType(EdmSimpleType.BOOLEAN)); return EdmComplexType.newBuilder().setNamespace(namespace).setName(STR).addProperties(properties); }
/** * Fornisce la struttura degli oggetti LayerInfo * @param namespace * @return */
Fornisce la struttura degli oggetti LayerInfo
getTypeDefinition
{ "repo_name": "sistemi-territoriali/StatPortalOpenData", "path": "OpenDataProxy/src/it/sister/statportal/odata/proxy/complextype/ReportDataSource.java", "license": "gpl-3.0", "size": 3174 }
[ "java.util.ArrayList", "java.util.List", "org.odata4j.edm.EdmComplexType", "org.odata4j.edm.EdmProperty", "org.odata4j.edm.EdmSimpleType" ]
import java.util.ArrayList; import java.util.List; import org.odata4j.edm.EdmComplexType; import org.odata4j.edm.EdmProperty; import org.odata4j.edm.EdmSimpleType;
import java.util.*; import org.odata4j.edm.*;
[ "java.util", "org.odata4j.edm" ]
java.util; org.odata4j.edm;
1,887,538
public void schedule(Runnable command, long delay, long tolerance, TimeUnit unit) { if (delay < 0 || tolerance < 0) { throw new IllegalArgumentException(); } long triggerPoint = clock.now() + unit.toMillis(delay); scheduledTasks.add(new ScheduledRunnable(command, triggerPoint, unit.toMillis(tolerance))); // Ensure we don't hit the race where a new scheduled task is added right before the // RunLoop enters a blocking select. if (signal.compareAndSet(false, true)) { selector.wakeup(); } }
void function(Runnable command, long delay, long tolerance, TimeUnit unit) { if (delay < 0 tolerance < 0) { throw new IllegalArgumentException(); } long triggerPoint = clock.now() + unit.toMillis(delay); scheduledTasks.add(new ScheduledRunnable(command, triggerPoint, unit.toMillis(tolerance))); if (signal.compareAndSet(false, true)) { selector.wakeup(); } }
/** * Schedules the runnable for future execution on the internal RunLoopThread. * * @param command the runnable to execute * @param delay the delay to wait before execution * @param tolerance window of time past the specified delay that execution is still allowed. If * this is set to 0, then the command will still be executed regardless of how * much additional time may have passed. * @param unit time unit of both the specified delay and tolerance */
Schedules the runnable for future execution on the internal RunLoopThread
schedule
{ "repo_name": "ning-github/whiskey", "path": "src/main/java/com/twitter/whiskey/nio/RunLoop.java", "license": "apache-2.0", "size": 9173 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,227,442
private void setNextTrack() { mNextPlayPos = getNextPosition(false); if (D) Log.d(TAG, "setNextTrack: next play position = " + mNextPlayPos); if (mNextPlayPos >= 0 && mPlayList != null) { final long id = mPlayList[mNextPlayPos]; mPlayer.setNextDataSource(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI + "/" + id); } else { mPlayer.setNextDataSource(null); } }
void function() { mNextPlayPos = getNextPosition(false); if (D) Log.d(TAG, STR + mNextPlayPos); if (mNextPlayPos >= 0 && mPlayList != null) { final long id = mPlayList[mNextPlayPos]; mPlayer.setNextDataSource(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI + "/" + id); } else { mPlayer.setNextDataSource(null); } }
/** * Sets the track track to be played */
Sets the track track to be played
setNextTrack
{ "repo_name": "13922841464/frostwire-android", "path": "apollo/src/com/andrew/apollo/MusicPlaybackService.java", "license": "gpl-3.0", "size": 98643 }
[ "android.provider.MediaStore", "android.util.Log" ]
import android.provider.MediaStore; import android.util.Log;
import android.provider.*; import android.util.*;
[ "android.provider", "android.util" ]
android.provider; android.util;
2,717,437
void loadContextMenu(CmsUUID structureId, AdeContext context);
void loadContextMenu(CmsUUID structureId, AdeContext context);
/** * Loads the context menu.<p> * @param structureId the structure id of the resource for which to load the context menu * @param context the context menu item visibility context */
Loads the context menu
loadContextMenu
{ "repo_name": "it-tavis/opencms-core", "path": "src-gwt/org/opencms/gwt/client/ui/I_CmsToolbarHandler.java", "license": "lgpl-2.1", "size": 2279 }
[ "org.opencms.gwt.shared.CmsCoreData", "org.opencms.util.CmsUUID" ]
import org.opencms.gwt.shared.CmsCoreData; import org.opencms.util.CmsUUID;
import org.opencms.gwt.shared.*; import org.opencms.util.*;
[ "org.opencms.gwt", "org.opencms.util" ]
org.opencms.gwt; org.opencms.util;
1,795,631
public static void removeIterator(final AccumuloStore store, final String iteratorName) throws StoreException { try { store.getConnection().tableOperations().removeIterator(store.getProperties().getTable(), iteratorName, EnumSet.of(IteratorScope.majc, IteratorScope.minc, IteratorScope.scan)); } catch (AccumuloSecurityException | AccumuloException | TableNotFoundException | StoreException e) { throw new StoreException("Unable remove iterator with Name: " + iteratorName); } }
static void function(final AccumuloStore store, final String iteratorName) throws StoreException { try { store.getConnection().tableOperations().removeIterator(store.getProperties().getTable(), iteratorName, EnumSet.of(IteratorScope.majc, IteratorScope.minc, IteratorScope.scan)); } catch (AccumuloSecurityException AccumuloException TableNotFoundException StoreException e) { throw new StoreException(STR + iteratorName); } }
/** * This method takes a store and the name of an iterator to be * removed. * * @param store the accumulo store * @param iteratorName the name of the iterator update * @throws StoreException if any issues occur when updating the iterator */
This method takes a store and the name of an iterator to be removed
removeIterator
{ "repo_name": "flitte/Gaffer", "path": "accumulo-store/src/main/java/gaffer/accumulostore/utils/AddUpdateTableIterator.java", "license": "apache-2.0", "size": 9250 }
[ "java.util.EnumSet", "org.apache.accumulo.core.client.AccumuloException", "org.apache.accumulo.core.client.AccumuloSecurityException", "org.apache.accumulo.core.client.TableNotFoundException", "org.apache.accumulo.core.iterators.IteratorUtil" ]
import java.util.EnumSet; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.accumulo.core.iterators.IteratorUtil;
import java.util.*; import org.apache.accumulo.core.client.*; import org.apache.accumulo.core.iterators.*;
[ "java.util", "org.apache.accumulo" ]
java.util; org.apache.accumulo;
2,421,618
public COSStream getDifferences() { return (COSStream) fdf.getDictionaryObject(COSName.DIFFERENCES); }
COSStream function() { return (COSStream) fdf.getDictionaryObject(COSName.DIFFERENCES); }
/** * This will get the incremental updates since the PDF was last opened. * * @return The differences entry of the FDF dictionary. */
This will get the incremental updates since the PDF was last opened
getDifferences
{ "repo_name": "TomRoush/PdfBox-Android", "path": "library/src/main/java/com/tom_roush/pdfbox/pdmodel/fdf/FDFDictionary.java", "license": "apache-2.0", "size": 19809 }
[ "com.tom_roush.pdfbox.cos.COSName", "com.tom_roush.pdfbox.cos.COSStream" ]
import com.tom_roush.pdfbox.cos.COSName; import com.tom_roush.pdfbox.cos.COSStream;
import com.tom_roush.pdfbox.cos.*;
[ "com.tom_roush.pdfbox" ]
com.tom_roush.pdfbox;
490,100
int[][] testMass = { {1, 2}, {3, 4} }; RotateArray rotate = new RotateArray(); int[][] resultArray = rotate.rotate(testMass); int[][] expectArray = { {3, 1}, {4, 2} }; assertThat(resultArray, is(expectArray)); }
int[][] testMass = { {1, 2}, {3, 4} }; RotateArray rotate = new RotateArray(); int[][] resultArray = rotate.rotate(testMass); int[][] expectArray = { {3, 1}, {4, 2} }; assertThat(resultArray, is(expectArray)); }
/** *Test 1. */
Test 1
whenRotateTwoRowTwoColArrayThenRotatedArray
{ "repo_name": "simvip/isliusar", "path": "chapter_001/src/test/java/ru/job4j/array/RotateTest.java", "license": "apache-2.0", "size": 1202 }
[ "org.hamcrest.core.Is", "org.junit.Assert" ]
import org.hamcrest.core.Is; import org.junit.Assert;
import org.hamcrest.core.*; import org.junit.*;
[ "org.hamcrest.core", "org.junit" ]
org.hamcrest.core; org.junit;
877,335
public RowMetaAndData getLogRecord( LogStatus status, Object subject, Object parent ) { if ( subject == null || subject instanceof StepPerformanceSnapShot ) { StepPerformanceSnapShot snapShot = (StepPerformanceSnapShot) subject; RowMetaAndData row = new RowMetaAndData(); for ( LogTableField field : fields ) { if ( field.isEnabled() ) { Object value = null; if ( subject != null ) { switch ( ID.valueOf( field.getId() ) ) { case ID_BATCH: value = new Long( snapShot.getBatchId() ); break; case SEQ_NR: value = new Long( snapShot.getSeqNr() ); break; case LOGDATE: value = snapShot.getDate(); break; case TRANSNAME: value = snapShot.getTransName(); break; case STEPNAME: value = snapShot.getStepName(); break; case STEP_COPY: value = new Long( snapShot.getStepCopy() ); break; case LINES_READ: value = new Long( snapShot.getLinesRead() ); break; case LINES_WRITTEN: value = new Long( snapShot.getLinesWritten() ); break; case LINES_INPUT: value = new Long( snapShot.getLinesInput() ); break; case LINES_OUTPUT: value = new Long( snapShot.getLinesOutput() ); break; case LINES_UPDATED: value = new Long( snapShot.getLinesUpdated() ); break; case LINES_REJECTED: value = new Long( snapShot.getLinesRejected() ); break; case ERRORS: value = new Long( snapShot.getErrors() ); break; case INPUT_BUFFER_ROWS: value = new Long( snapShot.getInputBufferSize() ); break; case OUTPUT_BUFFER_ROWS: value = new Long( snapShot.getOutputBufferSize() ); break; default: break; } } row.addValue( field.getFieldName(), field.getDataType(), value ); row.getRowMeta().getValueMeta( row.size() - 1 ).setLength( field.getLength() ); } } return row; } else { return null; } }
RowMetaAndData function( LogStatus status, Object subject, Object parent ) { if ( subject == null subject instanceof StepPerformanceSnapShot ) { StepPerformanceSnapShot snapShot = (StepPerformanceSnapShot) subject; RowMetaAndData row = new RowMetaAndData(); for ( LogTableField field : fields ) { if ( field.isEnabled() ) { Object value = null; if ( subject != null ) { switch ( ID.valueOf( field.getId() ) ) { case ID_BATCH: value = new Long( snapShot.getBatchId() ); break; case SEQ_NR: value = new Long( snapShot.getSeqNr() ); break; case LOGDATE: value = snapShot.getDate(); break; case TRANSNAME: value = snapShot.getTransName(); break; case STEPNAME: value = snapShot.getStepName(); break; case STEP_COPY: value = new Long( snapShot.getStepCopy() ); break; case LINES_READ: value = new Long( snapShot.getLinesRead() ); break; case LINES_WRITTEN: value = new Long( snapShot.getLinesWritten() ); break; case LINES_INPUT: value = new Long( snapShot.getLinesInput() ); break; case LINES_OUTPUT: value = new Long( snapShot.getLinesOutput() ); break; case LINES_UPDATED: value = new Long( snapShot.getLinesUpdated() ); break; case LINES_REJECTED: value = new Long( snapShot.getLinesRejected() ); break; case ERRORS: value = new Long( snapShot.getErrors() ); break; case INPUT_BUFFER_ROWS: value = new Long( snapShot.getInputBufferSize() ); break; case OUTPUT_BUFFER_ROWS: value = new Long( snapShot.getOutputBufferSize() ); break; default: break; } } row.addValue( field.getFieldName(), field.getDataType(), value ); row.getRowMeta().getValueMeta( row.size() - 1 ).setLength( field.getLength() ); } } return row; } else { return null; } }
/** * This method calculates all the values that are required * * @param id * the id to use or -1 if no id is needed * @param status * the log status to use */
This method calculates all the values that are required
getLogRecord
{ "repo_name": "codek/pentaho-kettle", "path": "engine/src/org/pentaho/di/core/logging/PerformanceLogTable.java", "license": "apache-2.0", "size": 13923 }
[ "org.pentaho.di.core.RowMetaAndData", "org.pentaho.di.trans.performance.StepPerformanceSnapShot" ]
import org.pentaho.di.core.RowMetaAndData; import org.pentaho.di.trans.performance.StepPerformanceSnapShot;
import org.pentaho.di.core.*; import org.pentaho.di.trans.performance.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,919,075
public Query setFilter(Filter filter) { this.filter = filter; return this; }
Query function(Filter filter) { this.filter = filter; return this; }
/** * Apply the specified server-side filter when performing the Query. * Only {@link Filter#filterKeyValue(Cell)} is called AFTER all tests * for ttl, column match, deletes and max versions have been run. * @param filter filter to run on the server * @return this for invocation chaining */
Apply the specified server-side filter when performing the Query. Only <code>Filter#filterKeyValue(Cell)</code> is called AFTER all tests for ttl, column match, deletes and max versions have been run
setFilter
{ "repo_name": "tobegit3hub/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/Query.java", "license": "apache-2.0", "size": 4594 }
[ "org.apache.hadoop.hbase.filter.Filter" ]
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,188,213
int findAvailablePort(int minPort, int maxPort) { Assert.isTrue(minPort > 0, "'minPort' must be greater than 0"); Assert.isTrue(maxPort >= minPort, "'maxPort' must be greater than or equal to 'minPort'"); Assert.isTrue(maxPort <= PORT_RANGE_MAX, "'maxPort' must be less than or equal to " + PORT_RANGE_MAX); int portRange = maxPort - minPort; int candidatePort; int searchCounter = 0; do { if (searchCounter > portRange) { throw new IllegalStateException( String.format("Could not find an available %s port in the range [%d, %d] after %d attempts", name(), minPort, maxPort, searchCounter)); } candidatePort = findRandomPort(minPort, maxPort); searchCounter++; } while (!isPortAvailable(candidatePort)); return candidatePort; }
int findAvailablePort(int minPort, int maxPort) { Assert.isTrue(minPort > 0, STR); Assert.isTrue(maxPort >= minPort, STR); Assert.isTrue(maxPort <= PORT_RANGE_MAX, STR + PORT_RANGE_MAX); int portRange = maxPort - minPort; int candidatePort; int searchCounter = 0; do { if (searchCounter > portRange) { throw new IllegalStateException( String.format(STR, name(), minPort, maxPort, searchCounter)); } candidatePort = findRandomPort(minPort, maxPort); searchCounter++; } while (!isPortAvailable(candidatePort)); return candidatePort; }
/** * Find an available port for this {@code SocketType}, randomly selected from the * range [{@code minPort}, {@code maxPort}]. * @param minPort the minimum port number * @param maxPort the maximum port number * @return an available port number for this socket type * @throws IllegalStateException if no available port could be found */
Find an available port for this SocketType, randomly selected from the range [minPort, maxPort]
findAvailablePort
{ "repo_name": "spring-cloud/spring-cloud-commons", "path": "spring-cloud-test-support/src/main/java/org/springframework/cloud/test/TestSocketUtils.java", "license": "apache-2.0", "size": 11011 }
[ "org.springframework.util.Assert" ]
import org.springframework.util.Assert;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
2,690,558
public void setTProjectKey(ObjectKey key) throws TorqueException { setProject(new Integer(((NumberKey) key).intValue())); } private TListType aTListType;
void function(ObjectKey key) throws TorqueException { setProject(new Integer(((NumberKey) key).intValue())); } private TListType aTListType;
/** * Provides convenient way to set a relationship based on a * ObjectKey, for example * <code>bar.setFooKey(foo.getPrimaryKey())</code> * */
Provides convenient way to set a relationship based on a ObjectKey, for example <code>bar.setFooKey(foo.getPrimaryKey())</code>
setTProjectKey
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/persist/BaseTInitState.java", "license": "gpl-3.0", "size": 31398 }
[ "com.aurel.track.persist.TListType", "org.apache.torque.TorqueException", "org.apache.torque.om.NumberKey", "org.apache.torque.om.ObjectKey" ]
import com.aurel.track.persist.TListType; import org.apache.torque.TorqueException; import org.apache.torque.om.NumberKey; import org.apache.torque.om.ObjectKey;
import com.aurel.track.persist.*; import org.apache.torque.*; import org.apache.torque.om.*;
[ "com.aurel.track", "org.apache.torque" ]
com.aurel.track; org.apache.torque;
2,518,815
interface WithLocation { WithCreate withLocation(String location); } interface WithCreate extends Creatable<Database>, DefinitionStages.WithLocation { } } interface Update extends Appliable<Database>, UpdateStages.WithLocation { }
interface WithLocation { WithCreate withLocation(String location); } interface WithCreate extends Creatable<Database>, DefinitionStages.WithLocation { } } interface Update extends Appliable<Database>, UpdateStages.WithLocation { }
/** * Specifies location. * @param location Resource location * @return the next definition stage */
Specifies location
withLocation
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/kusto/mgmt-v2019_09_07/src/main/java/com/microsoft/azure/management/kusto/v2019_09_07/Database.java", "license": "mit", "size": 3606 }
[ "com.microsoft.azure.arm.model.Appliable", "com.microsoft.azure.arm.model.Creatable" ]
import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable;
import com.microsoft.azure.arm.model.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,602,617
public void deleteApplication(int applicationID, Connection connection) throws IdentityApplicationManagementException { int tenantID = CarbonContext.getThreadLocalCarbonContext().getTenantId(); if (log.isDebugEnabled()) { log.debug("Deleting Application " + applicationID); } // Now, delete the application PreparedStatement deleteClientPrepStmt = null; try { // delete clients InboundAuthenticationConfig clients = getInboundAuthenticationConfig(applicationID, connection, tenantID); for (InboundAuthenticationRequestConfig client : clients .getInboundAuthenticationRequestConfigs()) { deleteClient(client.getInboundAuthKey(), client.getInboundAuthType()); } String applicationName = getApplicationName(applicationID, connection); // delete roles ApplicationMgtUtil.deleteAppRole(applicationName); deleteClientPrepStmt = connection .prepareStatement(ApplicationMgtDBQueries.REMOVE_APP_FROM_APPMGT_APP_WITH_ID); deleteClientPrepStmt.setInt(1, applicationID); deleteClientPrepStmt.setInt(2, tenantID); deleteClientPrepStmt.execute(); if (!connection.getAutoCommit()) { connection.commit(); } } catch (SQLException e) { log.error(e.getMessage(), e); throw new IdentityApplicationManagementException("Error deleting application"); } finally { IdentityApplicationManagementUtil.closeStatement(deleteClientPrepStmt); } }
void function(int applicationID, Connection connection) throws IdentityApplicationManagementException { int tenantID = CarbonContext.getThreadLocalCarbonContext().getTenantId(); if (log.isDebugEnabled()) { log.debug(STR + applicationID); } PreparedStatement deleteClientPrepStmt = null; try { InboundAuthenticationConfig clients = getInboundAuthenticationConfig(applicationID, connection, tenantID); for (InboundAuthenticationRequestConfig client : clients .getInboundAuthenticationRequestConfigs()) { deleteClient(client.getInboundAuthKey(), client.getInboundAuthType()); } String applicationName = getApplicationName(applicationID, connection); ApplicationMgtUtil.deleteAppRole(applicationName); deleteClientPrepStmt = connection .prepareStatement(ApplicationMgtDBQueries.REMOVE_APP_FROM_APPMGT_APP_WITH_ID); deleteClientPrepStmt.setInt(1, applicationID); deleteClientPrepStmt.setInt(2, tenantID); deleteClientPrepStmt.execute(); if (!connection.getAutoCommit()) { connection.commit(); } } catch (SQLException e) { log.error(e.getMessage(), e); throw new IdentityApplicationManagementException(STR); } finally { IdentityApplicationManagementUtil.closeStatement(deleteClientPrepStmt); } }
/** * Deletes the Application with application ID * * @param applicationID * @param connection * @throws IdentityApplicationManagementException */
Deletes the Application with application ID
deleteApplication
{ "repo_name": "nuwandi-is/identity-framework", "path": "components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationDAOImpl.java", "license": "apache-2.0", "size": 141804 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.SQLException", "org.wso2.carbon.context.CarbonContext", "org.wso2.carbon.identity.application.common.IdentityApplicationManagementException", "org.wso2.carbon.identity.application.common.model.InboundAuthenticationConfig", "org.wso2.carbon.identity.application.common.model.InboundAuthenticationRequestConfig", "org.wso2.carbon.identity.application.common.util.IdentityApplicationManagementUtil", "org.wso2.carbon.identity.application.mgt.ApplicationMgtDBQueries", "org.wso2.carbon.identity.application.mgt.ApplicationMgtUtil" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.identity.application.common.IdentityApplicationManagementException; import org.wso2.carbon.identity.application.common.model.InboundAuthenticationConfig; import org.wso2.carbon.identity.application.common.model.InboundAuthenticationRequestConfig; import org.wso2.carbon.identity.application.common.util.IdentityApplicationManagementUtil; import org.wso2.carbon.identity.application.mgt.ApplicationMgtDBQueries; import org.wso2.carbon.identity.application.mgt.ApplicationMgtUtil;
import java.sql.*; import org.wso2.carbon.context.*; import org.wso2.carbon.identity.application.common.*; import org.wso2.carbon.identity.application.common.model.*; import org.wso2.carbon.identity.application.common.util.*; import org.wso2.carbon.identity.application.mgt.*;
[ "java.sql", "org.wso2.carbon" ]
java.sql; org.wso2.carbon;
2,617,918
String uploadDialogButton(); } I_CmsLayoutBundle INSTANCE = GWT.create(I_CmsLayoutBundle.class);
String uploadDialogButton(); } I_CmsLayoutBundle INSTANCE = GWT.create(I_CmsLayoutBundle.class);
/** * Access method.<p> * * @return the CSS class name */
Access method
uploadDialogButton
{ "repo_name": "victos/opencms-core", "path": "src-gwt/org/opencms/ade/upload/client/ui/css/I_CmsLayoutBundle.java", "license": "lgpl-2.1", "size": 3018 }
[ "com.google.gwt.core.client.GWT" ]
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.*;
[ "com.google.gwt" ]
com.google.gwt;
1,728,346
public static String convertToAbsolute(String path) { return currentDirectoryPath + File.separator + path; }
static String function(String path) { return currentDirectoryPath + File.separator + path; }
/** * Converts the specified internal <code>file</code> partial path to * an absolute path adding the current directory path. * * @param path The specified internal <code>file</code> partial path * @return The <code>file</code> absolute path */
Converts the specified internal <code>file</code> partial path to an absolute path adding the current directory path
convertToAbsolute
{ "repo_name": "ProgettoRadis/ArasuiteIta", "path": "AraWord/src/araword/utils/TFileHandler.java", "license": "apache-2.0", "size": 9264 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,295,020
public User delete(int id);
User function(int id);
/** * Deletes the user from the database * * @param id * The id of the user * @return User the deleted user object */
Deletes the user from the database
delete
{ "repo_name": "kumar-pratyaksh/AceMyRideFrontendBackEnd", "path": "AceMyRideBackend/src/main/java/com/avizva/dao/UserDao.java", "license": "gpl-3.0", "size": 1661 }
[ "com.avizva.model.User" ]
import com.avizva.model.User;
import com.avizva.model.*;
[ "com.avizva.model" ]
com.avizva.model;
2,555,142
Operation deleteDisk(String zone, String disk, Map<Option, ?> options);
Operation deleteDisk(String zone, String disk, Map<Option, ?> options);
/** * Deletes the requested disk. * * @return a zone operation if the request was issued correctly, {@code null} if the disk was not * found * @throws ComputeException upon failure */
Deletes the requested disk
deleteDisk
{ "repo_name": "mbrukman/gcloud-java", "path": "google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/spi/v1/ComputeRpc.java", "license": "apache-2.0", "size": 20843 }
[ "com.google.api.services.compute.model.Operation", "java.util.Map" ]
import com.google.api.services.compute.model.Operation; import java.util.Map;
import com.google.api.services.compute.model.*; import java.util.*;
[ "com.google.api", "java.util" ]
com.google.api; java.util;
1,031,684
private void displayParametersField() { mTextDoc.setVisibility(View.VISIBLE); mTextParameters.setVisibility(View.VISIBLE); mTextParameters.setText(mPreferences.getString(CUSTOM_PARAMETERS_TEXT, "")); mShowCustomParameters = true; saveCustomParameters(); }
void function() { mTextDoc.setVisibility(View.VISIBLE); mTextParameters.setVisibility(View.VISIBLE); mTextParameters.setText(mPreferences.getString(CUSTOM_PARAMETERS_TEXT, "")); mShowCustomParameters = true; saveCustomParameters(); }
/** * Sets visible the custom parameters text field, and loads the saved parameters */
Sets visible the custom parameters text field, and loads the saved parameters
displayParametersField
{ "repo_name": "cSploit/android", "path": "cSploit/src/main/java/org/csploit/android/plugins/PortScanner.java", "license": "gpl-3.0", "size": 13742 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
2,531,699
public String createNarfTsv(String aPdbId, NucleicAcid aNucleicAcid, List<Cycle<Nucleotide, InteractionEdge>> aCycleList, String aptamerType, int structureId, boolean basepaironly) { String rm = ""; // put the header in if (basepaironly) { rm += "id\tcycle_len\tstart_vertex\tend_vertex\tedge_summary\tvertex_summary\tmin_norm_no_gly_no_edges\taptamertype\tstructure_id\n"; } else { rm += "pdbid\tcycle_len\tstart_vertex\tend_vertex\tedge_summary\tvertex_summary\tmin_norm\tmin_norm_no_gly_no_edges\n"; } List<String> level_2 = new ArrayList<String>(); // no edge-edge interaction information and no glycosidic bond // orientation info List<String> level_1 = new ArrayList<String>(); for (Cycle<Nucleotide, InteractionEdge> cycle : aCycleList) { BigDecimal min_norm = null; // if basepaironly was set to false then compute the basepair only // version aswell BigDecimal min_norm_no_edges_no_glybond = null; if (basepaironly) { min_norm_no_edges_no_glybond = CycleHelper .findMinmalNormalization(aNucleicAcid, cycle, basepaironly); level_1.add("#" + min_norm_no_edges_no_glybond); } else { min_norm_no_edges_no_glybond = CycleHelper .findMinmalNormalization(aNucleicAcid, cycle, true); level_1.add("#" + min_norm_no_edges_no_glybond); min_norm = CycleHelper.findMinmalNormalization(aNucleicAcid, cycle, false); level_2.add("#" + min_norm); } int cLen = cycle.size(); String sV = cycle.getStartVertex().getResidueIdentifier() + cycle.getStartVertex().getResiduePosition(); if (cycle.getStartVertex().getChainId() != null) { sV += "_" + cycle.getStartVertex().getChainId(); } String eV = cycle.getEndVertex().getResidueIdentifier() + cycle.getEndVertex().getResiduePosition(); if (cycle.getEndVertex().getChainId() != null) { eV += "_" + cycle.getEndVertex().getChainId(); } // edgeclass String edgeSummary = ""; String bpSummary = ""; List<InteractionEdge> edges = cycle.getEdgeList(); for (InteractionEdge anEdge : edges) { String bpC = anEdge.extractBasePairClasses(); if (bpC.length() > 0) { bpSummary += bpC + ", "; } edgeSummary += anEdge.extractEdgeClasses() + "-"; } if (bpSummary.length() > 0) { bpSummary = bpSummary.substring(0, bpSummary.length() - 2); } edgeSummary = edgeSummary.substring(0, edgeSummary.length() - 1); String vertexSummary = ""; List<Nucleotide> vertices = cycle.getVertexList(); for (Nucleotide n : vertices) { vertexSummary += n.getResidueIdentifier() + n.getResiduePosition() + "_" + n.getChainId() + ", "; } vertexSummary = vertexSummary.substring(0, vertexSummary.length() - 2); String data = null; if (basepaironly) { data = aPdbId + "\t" + cLen + "\t" + sV + "\t" + eV + "\t" + edgeSummary + "\t" + bpSummary + "\t" + vertexSummary + "\t#" + min_norm_no_edges_no_glybond; if (aptamerType != null) { data += "\t" + aptamerType; } if (structureId > 0) { data += "\t" + structureId; } rm += data + "\n"; } else { data = aPdbId + "\t" + cLen + "\t" + sV + "\t" + eV + "\t" + edgeSummary + "\t" + bpSummary + "\t" + vertexSummary + "\t#" + min_norm + "\t#" + min_norm_no_edges_no_glybond; rm += data + "\n"; }// else }// for this.keepTrack(aPdbId, level_2, level_1); return rm; }
String function(String aPdbId, NucleicAcid aNucleicAcid, List<Cycle<Nucleotide, InteractionEdge>> aCycleList, String aptamerType, int structureId, boolean basepaironly) { String rm = STRid\tcycle_len\tstart_vertex\tend_vertex\tedge_summary\tvertex_summary\tmin_norm_no_gly_no_edges\taptamertype\tstructure_id\nSTRpdbid\tcycle_len\tstart_vertex\tend_vertex\tedge_summary\tvertex_summary\tmin_norm\tmin_norm_no_gly_no_edges\nSTR#STR#STR#STR_STR_STRSTRSTR, STR-STRSTR_STR, STR\tSTR\tSTR\tSTR\tSTR\tSTR\tSTR\t#STR\tSTR\tSTR\nSTR\tSTR\tSTR\tSTR\tSTR\tSTR\tSTR\t#STR\t#STR\n"; } } this.keepTrack(aPdbId, level_2, level_1); return rm; }
/** * Create a TSV representation from a list of cycles * * @param aPdbId * the pdbId of the structure from where this cycle basis was * derived * @param acycleList * the list of cycles computed from a pdb id * @param basepaironly * a boolean flag that specifies the level of desired annotation * for the base pair class if set to true base pairs classes will * not make use neither glycosidic bond orientation nor of * edge-edge interactions * @return a TSV string representation of the list of cycles */
Create a TSV representation from a list of cycles
createNarfTsv
{ "repo_name": "jctoledo/narf", "path": "graphs/src/main/java/org/semanticscience/narf/graphs/lib/CycleSerializer.java", "license": "mit", "size": 41397 }
[ "java.util.List", "org.semanticscience.narf.graphs.lib.cycles.Cycle", "org.semanticscience.narf.graphs.nucleicacid.InteractionEdge", "org.semanticscience.narf.graphs.nucleicacid.NucleicAcid", "org.semanticscience.narf.structures.parts.Nucleotide" ]
import java.util.List; import org.semanticscience.narf.graphs.lib.cycles.Cycle; import org.semanticscience.narf.graphs.nucleicacid.InteractionEdge; import org.semanticscience.narf.graphs.nucleicacid.NucleicAcid; import org.semanticscience.narf.structures.parts.Nucleotide;
import java.util.*; import org.semanticscience.narf.graphs.lib.cycles.*; import org.semanticscience.narf.graphs.nucleicacid.*; import org.semanticscience.narf.structures.parts.*;
[ "java.util", "org.semanticscience.narf" ]
java.util; org.semanticscience.narf;
1,435,905
@Override public void paintComponent(Graphics g) { super.paintComponent(g); draw(g); }
void function(Graphics g) { super.paintComponent(g); draw(g); }
/** * Let it Paint you a picture * @param g A graphics */
Let it Paint you a picture
paintComponent
{ "repo_name": "syonfox/FrenchPress_cpsc101_Project", "path": "src/TimeTablePanel.java", "license": "gpl-3.0", "size": 5364 }
[ "java.awt.Graphics" ]
import java.awt.Graphics;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,722,091
@Override public String getText(Object object) { String label = ((Operation)object).getName(); return label == null || label.length() == 0 ? getString("_UI_Operation_type") : getString("_UI_Operation_type") + " " + label; }
String function(Object object) { String label = ((Operation)object).getName(); return label == null label.length() == 0 ? getString(STR) : getString(STR) + " " + label; }
/** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This returns the label text for the adapted class.
getText
{ "repo_name": "road-framework/ROADDesigner", "path": "au.edu.swin.ict.road.designer.edit/src/au/edu/swin/ict/road/designer/smc/provider/OperationItemProvider.java", "license": "apache-2.0", "size": 7001 }
[ "au.edu.swin.ict.road.designer.smc.Operation" ]
import au.edu.swin.ict.road.designer.smc.Operation;
import au.edu.swin.ict.road.designer.smc.*;
[ "au.edu.swin" ]
au.edu.swin;
1,418,018
private Type parseQualifiedType() { Type baseType; if (lexer.lookingAt(TypeLexer.LT)){ baseType = parseGroupedType(); } else { BaseType bt = parseBaseType(); String fullName = bt.fullName; Type qualifyingType = bt.qualifyingType; while(lexer.lookingAt(TypeLexer.DOT)){ lexer.eat(); Part part = parseTypeNameWithArguments(); fullName = fullName + '.' + part.name; qualifyingType = loadType(bt.pkg, fullName, part, qualifyingType); } if(qualifyingType == null){ throw new ModelResolutionException("Could not find type '"+fullName+"'"); } if(qualifyingType instanceof Type == false){ throw new ModelResolutionException("Type is a declaration (should be a Type): '"+fullName+"'"); } baseType = (Type) qualifyingType; } Part part; String fullName = ""; Type qualifyingType = baseType; while(lexer.lookingAt(TypeLexer.DOT)){ lexer.eat(); part = parseTypeNameWithArguments(); fullName = fullName + '.' + part.name; qualifyingType = loadType("", fullName, part, qualifyingType); } if(qualifyingType == null){ throw new ModelResolutionException("Could not find type '"+fullName+"'"); } if(qualifyingType instanceof Type == false){ throw new ModelResolutionException("Type is a declaration (should be a Type): '"+fullName+"'"); } return (Type) qualifyingType; } static class BaseType { String pkg; String fullName; Type qualifyingType; public BaseType(String pkg, Type qualifyingType, String fullName) { super(); this.pkg = pkg; this.qualifyingType = qualifyingType; this.fullName = fullName; } }
Type function() { Type baseType; if (lexer.lookingAt(TypeLexer.LT)){ baseType = parseGroupedType(); } else { BaseType bt = parseBaseType(); String fullName = bt.fullName; Type qualifyingType = bt.qualifyingType; while(lexer.lookingAt(TypeLexer.DOT)){ lexer.eat(); Part part = parseTypeNameWithArguments(); fullName = fullName + '.' + part.name; qualifyingType = loadType(bt.pkg, fullName, part, qualifyingType); } if(qualifyingType == null){ throw new ModelResolutionException(STR+fullName+"'"); } if(qualifyingType instanceof Type == false){ throw new ModelResolutionException(STR+fullName+"'"); } baseType = (Type) qualifyingType; } Part part; String fullName = STR", fullName, part, qualifyingType); } if(qualifyingType == null){ throw new ModelResolutionException(STR+fullName+"'"); } if(qualifyingType instanceof Type == false){ throw new ModelResolutionException(STR+fullName+"'"); } return (Type) qualifyingType; } static class BaseType { String pkg; String fullName; Type qualifyingType; public BaseType(String pkg, Type qualifyingType, String fullName) { super(); this.pkg = pkg; this.qualifyingType = qualifyingType; this.fullName = fullName; } }
/** * Spec says: * <blockquote><pre> * QualifiedType: BaseType ("." TypeNameWithArguments)* * BaseType: PackageQualifier? TypeNameWithArguments | GroupedType * TypeNameWithArguments: TypeName TypeArguments? * PackageQualifier: "package" "." * GroupedType: "<" Type ">" * </blockquote></pre> * We implement this quite differently, because we handle * {@code package.qualification::}, which the spec doesn't * have to cover at all. */
Spec says: <code> QualifiedType: BaseType ("." TypeNameWithArguments) BaseType: PackageQualifier? TypeNameWithArguments | GroupedType TypeNameWithArguments: TypeName TypeArguments? PackageQualifier: "package" "." GroupedType: "" </code> We implement this quite differently, because we handle package.qualification::, which the spec doesn't have to cover at all
parseQualifiedType
{ "repo_name": "ceylon/ceylon", "path": "model/src/org/eclipse/ceylon/model/loader/TypeParser.java", "license": "apache-2.0", "size": 28883 }
[ "org.eclipse.ceylon.model.typechecker.model.Type" ]
import org.eclipse.ceylon.model.typechecker.model.Type;
import org.eclipse.ceylon.model.typechecker.model.*;
[ "org.eclipse.ceylon" ]
org.eclipse.ceylon;
592,985
public static List lookupKickstartInstallTypes() { Session session = null; List retval = null; String query = "KickstartInstallType.loadAll"; session = HibernateFactory.getSession(); //Retrieve from cache if there retval = session.getNamedQuery(query).setCacheable(true).list(); return retval; }
static List function() { Session session = null; List retval = null; String query = STR; session = HibernateFactory.getSession(); retval = session.getNamedQuery(query).setCacheable(true).list(); return retval; }
/** * Return a List of KickstartInstallType classes. * @return List of KickstartInstallType instances */
Return a List of KickstartInstallType classes
lookupKickstartInstallTypes
{ "repo_name": "ogajduse/spacewalk", "path": "java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java", "license": "gpl-2.0", "size": 43885 }
[ "com.redhat.rhn.common.hibernate.HibernateFactory", "java.util.List", "org.hibernate.Session" ]
import com.redhat.rhn.common.hibernate.HibernateFactory; import java.util.List; import org.hibernate.Session;
import com.redhat.rhn.common.hibernate.*; import java.util.*; import org.hibernate.*;
[ "com.redhat.rhn", "java.util", "org.hibernate" ]
com.redhat.rhn; java.util; org.hibernate;
2,142,783
public static void saveCaches(final Collection<Geocache> caches, final Set<LoadFlags.SaveFlag> saveFlags) { if (CollectionUtils.isEmpty(caches)) { return; } final List<String> cachesFromDatabase = new ArrayList<>(); final Map<String, Geocache> existingCaches = new HashMap<>(); // first check which caches are in the memory cache for (final Geocache cache : caches) { final String geocode = cache.getGeocode(); final Geocache cacheFromCache = cacheCache.getCacheFromCache(geocode); if (cacheFromCache == null) { cachesFromDatabase.add(geocode); } else { existingCaches.put(geocode, cacheFromCache); } } // then load all remaining caches from the database in one step for (final Geocache cacheFromDatabase : loadCaches(cachesFromDatabase, LoadFlags.LOAD_ALL_DB_ONLY)) { existingCaches.put(cacheFromDatabase.getGeocode(), cacheFromDatabase); } final List<Geocache> toBeStored = new ArrayList<>(); // Merge with the data already stored in the CacheCache or in the database if // the cache had not been loaded before, and update the CacheCache. // Also, a DB update is required if the merge data comes from the CacheCache // (as it may be more recent than the version in the database), or if the // version coming from the database is different than the version we are entering // into the cache (that includes absence from the database). for (final Geocache cache : caches) { final String geocode = cache.getGeocode(); final Geocache existingCache = existingCaches.get(geocode); boolean dbUpdateRequired = !cache.gatherMissingFrom(existingCache) || cacheCache.getCacheFromCache(geocode) != null; // parse the note AFTER merging the local information in dbUpdateRequired |= cache.parseWaypointsFromNote(); cache.addStorageLocation(StorageLocation.CACHE); cacheCache.putCacheInCache(cache); // Only save the cache in the database if it is requested by the caller and // the cache contains detailed information. if (saveFlags.contains(SaveFlag.DB) && dbUpdateRequired) { toBeStored.add(cache); } } for (final Geocache geocache : toBeStored) { storeIntoDatabase(geocache); } }
static void function(final Collection<Geocache> caches, final Set<LoadFlags.SaveFlag> saveFlags) { if (CollectionUtils.isEmpty(caches)) { return; } final List<String> cachesFromDatabase = new ArrayList<>(); final Map<String, Geocache> existingCaches = new HashMap<>(); for (final Geocache cache : caches) { final String geocode = cache.getGeocode(); final Geocache cacheFromCache = cacheCache.getCacheFromCache(geocode); if (cacheFromCache == null) { cachesFromDatabase.add(geocode); } else { existingCaches.put(geocode, cacheFromCache); } } for (final Geocache cacheFromDatabase : loadCaches(cachesFromDatabase, LoadFlags.LOAD_ALL_DB_ONLY)) { existingCaches.put(cacheFromDatabase.getGeocode(), cacheFromDatabase); } final List<Geocache> toBeStored = new ArrayList<>(); for (final Geocache cache : caches) { final String geocode = cache.getGeocode(); final Geocache existingCache = existingCaches.get(geocode); boolean dbUpdateRequired = !cache.gatherMissingFrom(existingCache) cacheCache.getCacheFromCache(geocode) != null; dbUpdateRequired = cache.parseWaypointsFromNote(); cache.addStorageLocation(StorageLocation.CACHE); cacheCache.putCacheInCache(cache); if (saveFlags.contains(SaveFlag.DB) && dbUpdateRequired) { toBeStored.add(cache); } } for (final Geocache geocache : toBeStored) { storeIntoDatabase(geocache); } }
/** * Save/store a cache to the CacheCache * * @param caches * the caches to save in the CacheCache/DB * */
Save/store a cache to the CacheCache
saveCaches
{ "repo_name": "mucek4/cgeo", "path": "main/src/cgeo/geocaching/storage/DataStore.java", "license": "apache-2.0", "size": 141240 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.HashMap", "java.util.List", "java.util.Map", "java.util.Set", "org.apache.commons.collections4.CollectionUtils" ]
import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.commons.collections4.CollectionUtils;
import java.util.*; import org.apache.commons.collections4.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
893,488
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<WorkloadNetworkPublicIpInner>> listPublicIPsSinglePageAsync( String resourceGroupName, String privateCloudName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (privateCloudName == null) { return Mono .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .listPublicIPs( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), privateCloudName, accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<WorkloadNetworkPublicIpInner>> function( String resourceGroupName, String privateCloudName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (privateCloudName == null) { return Mono .error(new IllegalArgumentException(STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .listPublicIPs( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), privateCloudName, accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); }
/** * List of Public IP Blocks in a private cloud workload network. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param privateCloudName Name of the private cloud. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of NSX Public IP Blocks. */
List of Public IP Blocks in a private cloud workload network
listPublicIPsSinglePageAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java", "license": "mit", "size": 538828 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedResponse", "com.azure.core.http.rest.PagedResponseBase", "com.azure.core.util.Context", "com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPublicIpInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.avs.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,416,585
public void testRestoreProp() throws RepositoryException { Node propParent = p.getParent(); propParent.checkout(); Version v = propParent.checkin(); propParent.checkout(); p.setValue(newPropValue); p.save(); propParent.restore(v, false); assertEquals("On restore of a OnParentVersion-COMPUTE property P, the current P in the workspace will be left unchanged.", p.getString(), newPropValue); }
void function() throws RepositoryException { Node propParent = p.getParent(); propParent.checkout(); Version v = propParent.checkin(); propParent.checkout(); p.setValue(newPropValue); p.save(); propParent.restore(v, false); assertEquals(STR, p.getString(), newPropValue); }
/** * Test the restore of a OnParentVersion-COMPUTE property * * @throws javax.jcr.RepositoryException */
Test the restore of a OnParentVersion-COMPUTE property
testRestoreProp
{ "repo_name": "Kast0rTr0y/jackrabbit", "path": "jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/OnParentVersionComputeTest.java", "license": "apache-2.0", "size": 2932 }
[ "javax.jcr.Node", "javax.jcr.RepositoryException", "javax.jcr.version.Version" ]
import javax.jcr.Node; import javax.jcr.RepositoryException; import javax.jcr.version.Version;
import javax.jcr.*; import javax.jcr.version.*;
[ "javax.jcr" ]
javax.jcr;
980,316
public boolean offer(MessageContext messageContext);
boolean function(MessageContext messageContext);
/** * Inserts the Message into this store if it is possible to do so immediately * without violating capacity restrictions. * @param messageContext MessageContext to be saved */
Inserts the Message into this store if it is possible to do so immediately without violating capacity restrictions
offer
{ "repo_name": "asanka88/apache-synapse", "path": "modules/core/src/main/java/org/apache/synapse/message/store/MessageStore.java", "license": "apache-2.0", "size": 4841 }
[ "org.apache.synapse.MessageContext" ]
import org.apache.synapse.MessageContext;
import org.apache.synapse.*;
[ "org.apache.synapse" ]
org.apache.synapse;
1,586,874
@JsonProperty("parties") public void setParties(Set<Organization> parties) { this.parties = parties; }
@JsonProperty(STR) void function(Set<Organization> parties) { this.parties = parties; }
/** * Parties * <p> * Information on the parties (organizations, economic operators and other participants) who are involved in the * contracting process and their roles, e.g. buyer, procuring entity, supplier etc. Organization references * elsewhere in the schema are used to refer back to this entries in this list. */
Parties Information on the parties (organizations, economic operators and other participants) who are involved in the contracting process and their roles, e.g. buyer, procuring entity, supplier etc. Organization references elsewhere in the schema are used to refer back to this entries in this list
setParties
{ "repo_name": "devgateway/ocua", "path": "persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/Release.java", "license": "mit", "size": 24880 }
[ "com.fasterxml.jackson.annotation.JsonProperty", "java.util.Set" ]
import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Set;
import com.fasterxml.jackson.annotation.*; import java.util.*;
[ "com.fasterxml.jackson", "java.util" ]
com.fasterxml.jackson; java.util;
956,749
public void print(boolean b) throws IOException { write(b ? "true" : "false"); }
void function(boolean b) throws IOException { write(b ? "true" : "false"); }
/** * Print a boolean value. The string produced by <code>{@link * java.lang.String#valueOf(boolean)}</code> is translated into bytes * according to the platform's default character encoding, and these bytes * are written in exactly the manner of the <code>{@link * #write(int)}</code> method. * * @param b The <code>boolean</code> to be printed */
Print a boolean value. The string produced by <code><code>java.lang.String#valueOf(boolean)</code></code> is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the <code><code>#write(int)</code></code> method
print
{ "repo_name": "ctomc/jastow", "path": "src/main/java/org/apache/jasper/runtime/JspWriterImpl.java", "license": "apache-2.0", "size": 18172 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
944,927
@Test public void testPDFBox3949() throws IOException { PDDocument.load(new File(TARGETPDFDIR, "PDFBOX-3949-MKFYUGZWS3OPXLLVU2Z4LWCTVA5WNOGF.pdf")).close(); }
void function() throws IOException { PDDocument.load(new File(TARGETPDFDIR, STR)).close(); }
/** * PDFBOX-3949: test parsing of file with incomplete object stream. * * @throws IOException */
PDFBOX-3949: test parsing of file with incomplete object stream
testPDFBox3949
{ "repo_name": "torakiki/sambox", "path": "src/test/java/org/sejda/sambox/input/PDFParserTest.java", "license": "apache-2.0", "size": 15289 }
[ "java.io.File", "java.io.IOException", "org.sejda.sambox.pdmodel.PDDocument" ]
import java.io.File; import java.io.IOException; import org.sejda.sambox.pdmodel.PDDocument;
import java.io.*; import org.sejda.sambox.pdmodel.*;
[ "java.io", "org.sejda.sambox" ]
java.io; org.sejda.sambox;
2,321,321
public static long calculateIndex(List<AggregationChainLink> links) { notNull(links, "Aggregation chain links"); long chainIndex = 0; for (int i = 0; i < links.size(); i++) { if (links.get(i).isLeft()) { chainIndex |= 1L << i; } } chainIndex |= 1L << links.size(); return chainIndex; } private AggregationHashChainUtil() { }
static long function(List<AggregationChainLink> links) { notNull(links, STR); long chainIndex = 0; for (int i = 0; i < links.size(); i++) { if (links.get(i).isLeft()) { chainIndex = 1L << i; } } chainIndex = 1L << links.size(); return chainIndex; } private AggregationHashChainUtil() { }
/** * Calculates chain index * * @param links Chain links for which to calculate the index * @return Index of the chain */
Calculates chain index
calculateIndex
{ "repo_name": "GuardTime/ksi-java-sdk", "path": "ksi-api/src/main/java/com/guardtime/ksi/unisignature/AggregationHashChainUtil.java", "license": "apache-2.0", "size": 1614 }
[ "com.guardtime.ksi.util.Util", "java.util.List" ]
import com.guardtime.ksi.util.Util; import java.util.List;
import com.guardtime.ksi.util.*; import java.util.*;
[ "com.guardtime.ksi", "java.util" ]
com.guardtime.ksi; java.util;
442,128
protected void processWindowEvent(final WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { switch (defaultCloseOperation) { case HIDE_ON_CLOSE: setVisible(false); break; case DISPOSE_ON_CLOSE: dispose(); break; case EXIT_ON_CLOSE: // This needs to match the checkExit call in // setDefaultCloseOperation System.exit(0); break; case DO_NOTHING_ON_CLOSE: default: } } }
void function(final WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { switch (defaultCloseOperation) { case HIDE_ON_CLOSE: setVisible(false); break; case DISPOSE_ON_CLOSE: dispose(); break; case EXIT_ON_CLOSE: System.exit(0); break; case DO_NOTHING_ON_CLOSE: default: } } }
/** * Processes window events occurring on this component. * Hides the window or disposes of it, as specified by the setting * of the <code>defaultCloseOperation</code> property. * * @param e the window event * @see #setDefaultCloseOperation * @see java.awt.Window#processWindowEvent */
Processes window events occurring on this component. Hides the window or disposes of it, as specified by the setting of the <code>defaultCloseOperation</code> property
processWindowEvent
{ "repo_name": "wangsongpeng/jdk-src", "path": "src/main/java/javax/swing/JFrame.java", "license": "apache-2.0", "size": 33318 }
[ "java.awt.event.WindowEvent" ]
import java.awt.event.WindowEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
1,166,416
public static <T> T get(String key, Class<T> clazz) throws CacheException{ if(logger.isDebugEnabled()) logger.debug("get data from cache with key [" + key + "].") ; String cacheData = getCache().get(key) ; if(!StringService.hasLength(cacheData)) return null ; // convert to data. byte[] serialData = DigestService.base64Decode(cacheData) ; if(serialData == null || serialData.length == 0) return null ; // return object. return IOService.getObject(serialData, clazz) ; }
static <T> T function(String key, Class<T> clazz) throws CacheException{ if(logger.isDebugEnabled()) logger.debug(STR + key + "].") ; String cacheData = getCache().get(key) ; if(!StringService.hasLength(cacheData)) return null ; byte[] serialData = DigestService.base64Decode(cacheData) ; if(serialData == null serialData.length == 0) return null ; return IOService.getObject(serialData, clazz) ; }
/** * Get the data in cache from the given cache key. * * @param key String - the given cache key. * @return the cache data. * @throws CacheException when error occurs during getting data from cache. */
Get the data in cache from the given cache key
get
{ "repo_name": "inetcloud/iMail", "path": "source/mail-admin-service/src/com/inet/web/service/mail/utils/LongLiveRegionService.java", "license": "gpl-2.0", "size": 4675 }
[ "com.inet.base.service.DigestService", "com.inet.base.service.IOService", "com.inet.base.service.StringService", "com.inet.web.cache.exception.CacheException" ]
import com.inet.base.service.DigestService; import com.inet.base.service.IOService; import com.inet.base.service.StringService; import com.inet.web.cache.exception.CacheException;
import com.inet.base.service.*; import com.inet.web.cache.exception.*;
[ "com.inet.base", "com.inet.web" ]
com.inet.base; com.inet.web;
1,431,575
@GET @Path("/approvedreceivers/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod public Response listApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId) { List<IntygReceiver> intygReceivers = certificateReceiverService.listPossibleReceiversWithApprovedInfo(intygsTyp, intygsId); return Response.ok(intygReceivers).build(); }
@Path(STR) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response function(@PathParam(STR) String intygsTyp, @PathParam(STR) String intygsId) { List<IntygReceiver> intygReceivers = certificateReceiverService.listPossibleReceiversWithApprovedInfo(intygsTyp, intygsId); return Response.ok(intygReceivers).build(); }
/** * Used after the signing of the intyg if the doctor wants to see (and possibly edit) approved receivers. */
Used after the signing of the intyg if the doctor wants to see (and possibly edit) approved receivers
listApprovedReceivers
{ "repo_name": "sklintyg/webcert", "path": "web/src/main/java/se/inera/intyg/webcert/web/web/controller/api/ReceiverApiController.java", "license": "gpl-3.0", "size": 3587 }
[ "java.util.List", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.Produces", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "se.inera.intyg.webcert.web.web.controller.api.dto.IntygReceiver" ]
import java.util.List; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import se.inera.intyg.webcert.web.web.controller.api.dto.IntygReceiver;
import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import se.inera.intyg.webcert.web.web.controller.api.dto.*;
[ "java.util", "javax.ws", "se.inera.intyg" ]
java.util; javax.ws; se.inera.intyg;
944,547
public static void log(Object caller, Level level, String message, Object... params) { message = caller.getClass().getName() + ": " + message; logger.log(level, message, params); }
static void function(Object caller, Level level, String message, Object... params) { message = caller.getClass().getName() + STR + message; logger.log(level, message, params); }
/** * Log message. * * @param caller Caller of the method. * @param level Java log level. * @param message Log message. * @param params Message parameters. */
Log message
log
{ "repo_name": "agents4its/agentpolis", "path": "src/main/java/cz/agents/agentpolis/siminfrastructure/Log.java", "license": "gpl-3.0", "size": 2806 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
121,349
creationIdentifier = creationIdentifier == null ? "" : "_" + creationIdentifier; String location = (baseTexture.toString() + creationIdentifier + "_" + textureIdentifier).toLowerCase(); TextureAtlasSprite sprite; if (ResourceHelper.exists(location)) { sprite = map.registerSprite(new ResourceLocation(location)); } else { // material does not need a special generated texture if (renderInfoProvider.getRenderInfo() == null) { return null; } TextureAtlasSprite matBase = base;
creationIdentifier = creationIdentifier == null ? STR_STR_" + textureIdentifier).toLowerCase(); TextureAtlasSprite sprite; if (ResourceHelper.exists(location)) { sprite = map.registerSprite(new ResourceLocation(location)); } else { if (renderInfoProvider.getRenderInfo() == null) { return null; } TextureAtlasSprite matBase = base;
/** * Method to create a modified texture given the RenderInfoProvider. * * @param renderInfoProvider The provider that provides the renderinfo that manipulates the basetexture * @param textureIdentifier The identifier for the new texture. Appended to the baseTexture and the creationIdentifier. * @param baseTexture The address of the base texture to modify * @param base The sprite data of the base texture. * @param map The TextureMap to register the texture to. * @param creationIdentifier A Identifier of whom created the texture. Null results in no Identifier and seperator being added. * * @return A modified version of the base Texture. */
Method to create a modified texture given the RenderInfoProvider
createTexture
{ "repo_name": "SmithsGaming/Armory", "path": "src/api/com/smithsmodding/armory/api/util/client/TextureCreationHelper.java", "license": "lgpl-3.0", "size": 3441 }
[ "com.smithsmodding.smithscore.util.client.ResourceHelper", "net.minecraft.client.renderer.texture.TextureAtlasSprite", "net.minecraft.util.ResourceLocation" ]
import com.smithsmodding.smithscore.util.client.ResourceHelper; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.ResourceLocation;
import com.smithsmodding.smithscore.util.client.*; import net.minecraft.client.renderer.texture.*; import net.minecraft.util.*;
[ "com.smithsmodding.smithscore", "net.minecraft.client", "net.minecraft.util" ]
com.smithsmodding.smithscore; net.minecraft.client; net.minecraft.util;
326,963
public Map<String, String> getReportsLevel2Lung(final Map<String, String> replacements) { return getReports(filterLevel2Lung, replacements); }
Map<String, String> function(final Map<String, String> replacements) { return getReports(filterLevel2Lung, replacements); }
/** * DOCUMENT ME! * * @param replacements DOCUMENT ME! * * @return DOCUMENT ME! */
DOCUMENT ME
getReportsLevel2Lung
{ "repo_name": "cismet/report-generator", "path": "src/main/java/de/cismet/custom/wrrl/reportgenerator/WRRLReportProvider.java", "license": "lgpl-3.0", "size": 10393 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,365,633
Object get(Type serviceType) throws UnknownServiceException, ServiceLookupException;
Object get(Type serviceType) throws UnknownServiceException, ServiceLookupException;
/** * Locates the service of the given type. * * @param serviceType The service type. * @return The service instance. Never returns null. * @throws UnknownServiceException When there is no service of the given type available. * @throws ServiceLookupException On failure to lookup the specified service. */
Locates the service of the given type
get
{ "repo_name": "Pushjet/Pushjet-Android", "path": "gradle/wrapper/dists/gradle-1.12-all/4ff8jj5a73a7zgj5nnzv1ubq0/gradle-1.12/src/base-services/org/gradle/internal/service/ServiceRegistry.java", "license": "bsd-2-clause", "size": 3360 }
[ "java.lang.reflect.Type" ]
import java.lang.reflect.Type;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,791,582
Set<Resource> getSourceNodes() { return sourceNodes; }
Set<Resource> getSourceNodes() { return sourceNodes; }
/** * Return the set of nodes whose reasoners together produced this. */
Return the set of nodes whose reasoners together produced this
getSourceNodes
{ "repo_name": "isper3at/incubator-rya", "path": "extras/rya.reasoning/src/main/java/mvm/rya/reasoning/Derivation.java", "license": "apache-2.0", "size": 10292 }
[ "java.util.Set", "org.openrdf.model.Resource" ]
import java.util.Set; import org.openrdf.model.Resource;
import java.util.*; import org.openrdf.model.*;
[ "java.util", "org.openrdf.model" ]
java.util; org.openrdf.model;
1,917,746
public void updateMenuView(boolean cleared) { final ViewGroup parent = (ViewGroup) mMenuView; if (parent == null) { return; } int childIndex = 0; if (mMenu != null) { mMenu.flagActionItems(); ArrayList<MenuItemImpl> visibleItems = mMenu.getVisibleItems(); final int itemCount = visibleItems.size(); for (int i = 0; i < itemCount; i++) { MenuItemImpl item = visibleItems.get(i); if (shouldIncludeItem(childIndex, item)) { final View convertView = parent.getChildAt(childIndex); final MenuItemImpl oldItem = convertView instanceof MenuView.ItemView ? ((MenuView.ItemView) convertView).getItemData() : null; final View itemView = getItemView(item, convertView, parent); if (item != oldItem) { // Don't let old states linger with new data. itemView.setPressed(false); // itemView.jumpDrawablesToCurrentState(); // Animation API: Not available on API < 11 } if (itemView != convertView) { addItemView(itemView, childIndex); } childIndex++; } } } // Remove leftover views. while (childIndex < parent.getChildCount()) { if (!filterLeftoverView(parent, childIndex)) { childIndex++; } } }
void function(boolean cleared) { final ViewGroup parent = (ViewGroup) mMenuView; if (parent == null) { return; } int childIndex = 0; if (mMenu != null) { mMenu.flagActionItems(); ArrayList<MenuItemImpl> visibleItems = mMenu.getVisibleItems(); final int itemCount = visibleItems.size(); for (int i = 0; i < itemCount; i++) { MenuItemImpl item = visibleItems.get(i); if (shouldIncludeItem(childIndex, item)) { final View convertView = parent.getChildAt(childIndex); final MenuItemImpl oldItem = convertView instanceof MenuView.ItemView ? ((MenuView.ItemView) convertView).getItemData() : null; final View itemView = getItemView(item, convertView, parent); if (item != oldItem) { itemView.setPressed(false); } if (itemView != convertView) { addItemView(itemView, childIndex); } childIndex++; } } } while (childIndex < parent.getChildCount()) { if (!filterLeftoverView(parent, childIndex)) { childIndex++; } } }
/** * Reuses item views when it can */
Reuses item views when it can
updateMenuView
{ "repo_name": "CyberEagle/SupportLibraryV7AppCompatPatched", "path": "src/main/java/android/support/v7/internal/view/menu/BaseMenuPresenter.java", "license": "apache-2.0", "size": 7712 }
[ "android.view.View", "android.view.ViewGroup", "java.util.ArrayList" ]
import android.view.View; import android.view.ViewGroup; import java.util.ArrayList;
import android.view.*; import java.util.*;
[ "android.view", "java.util" ]
android.view; java.util;
2,380,263
public CppLinkActionBuilder setInterfaceOutput(Artifact interfaceOutput) { this.interfaceOutput = interfaceOutput; return this; }
CppLinkActionBuilder function(Artifact interfaceOutput) { this.interfaceOutput = interfaceOutput; return this; }
/** * Sets the interface output of the link. A non-null argument can only be provided if the link * type is {@code DYNAMIC_LIBRARY} and fake is false. */
Sets the interface output of the link. A non-null argument can only be provided if the link type is DYNAMIC_LIBRARY and fake is false
setInterfaceOutput
{ "repo_name": "Asana/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java", "license": "apache-2.0", "size": 70730 }
[ "com.google.devtools.build.lib.actions.Artifact" ]
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.*;
[ "com.google.devtools" ]
com.google.devtools;
255,093
public boolean isSupported() throws NoResponseException, XMPPErrorException, NotConnectedException{ return ServiceDiscoveryManager.getInstanceFor(connection()).serverSupportsFeature(NAMESPACE); }
boolean function() throws NoResponseException, XMPPErrorException, NotConnectedException{ return ServiceDiscoveryManager.getInstanceFor(connection()).serverSupportsFeature(NAMESPACE); }
/** * Check if the user's server supports privacy lists. * * @return true, if the server supports privacy lists, false otherwise. * @throws XMPPErrorException * @throws NoResponseException * @throws NotConnectedException */
Check if the user's server supports privacy lists
isSupported
{ "repo_name": "unisontech/Smack", "path": "smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/PrivacyListManager.java", "license": "apache-2.0", "size": 22570 }
[ "org.jivesoftware.smack.SmackException", "org.jivesoftware.smack.XMPPException", "org.jivesoftware.smackx.disco.ServiceDiscoveryManager" ]
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smack.*; import org.jivesoftware.smackx.disco.*;
[ "org.jivesoftware.smack", "org.jivesoftware.smackx" ]
org.jivesoftware.smack; org.jivesoftware.smackx;
2,724,629
public SimpleFragmentIntent<F> putExtra(String name, double value) { if (extras == null) { extras = new Bundle(); } extras.putDouble(name, value); return this; }
SimpleFragmentIntent<F> function(String name, double value) { if (extras == null) { extras = new Bundle(); } extras.putDouble(name, value); return this; }
/** * Add extended data to the intent. * * @param name The name of the extra data, with package prefix. * @param value The double data value. * @return Returns the same SimpleFragmentIntent<F> object, for chaining multiple calls into a * single statement. * @see #putExtras * @see #removeExtra * @see #getDoubleExtra(String, double) */
Add extended data to the intent
putExtra
{ "repo_name": "evant/simplefragment", "path": "simplefragment/src/main/java/me/tatarka/simplefragment/SimpleFragmentIntent.java", "license": "apache-2.0", "size": 36200 }
[ "android.os.Bundle" ]
import android.os.Bundle;
import android.os.*;
[ "android.os" ]
android.os;
2,357,472