code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
static ThrottledGenerator serialYearGenerator(final int interval, final DateValue dtStart) {
return new ThrottledGenerator() {
//the last year seen
int year = dtStart.year() - interval;
int throttle = MAX_YEARS_BETWEEN_INSTANCES;
@Override
boolean generate(DTBuilder builder) throws IteratorShortCircu... | class class_name[name] begin[{]
method[serialYearGenerator, return_type[type[ThrottledGenerator]], modifier[static], parameter[interval, dtStart]] begin[{]
return[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation... | Keyword[static] identifier[ThrottledGenerator] identifier[serialYearGenerator] operator[SEP] Keyword[final] Keyword[int] identifier[interval] , Keyword[final] identifier[DateValue] identifier[dtStart] operator[SEP] {
Keyword[return] Keyword[new] identifier[ThrottledGenerator] operator[SEP] operator[SEP] {
... |
static Map<String, CmsClientProperty> createClientProperties(Iterable<CmsProperty> props, boolean preserveOrigin) {
Map<String, CmsClientProperty> result = new HashMap<String, CmsClientProperty>();
for (CmsProperty prop : props) {
CmsClientProperty clientProp = createClientProperty(prop, pr... | class class_name[name] begin[{]
method[createClientProperties, return_type[type[Map]], modifier[static], parameter[props, preserveOrigin]] begin[{]
local_variable[type[Map], result]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[Va... | Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[CmsClientProperty] operator[>] identifier[createClientProperties] operator[SEP] identifier[Iterable] operator[<] identifier[CmsProperty] operator[>] identifier[props] , Keyword[boolean] identifier[preserveOrigin] operator[SEP] {
identi... |
public static byte[] readLine(InputStream in) throws IOException {
int BUFF_LENGTH = 256;
byte[] buf = new byte[BUFF_LENGTH];
int i = 0;
int loops = 0;
int ch = 0;
while (true) {
ch = in.read();
if (ch < 0) {
break;
}
loops++;
// skip a leading LF's
if (loops == 1 && ch == LF) {
... | class class_name[name] begin[{]
method[readLine, return_type[type[byte]], modifier[public static], parameter[in]] begin[{]
local_variable[type[int], BUFF_LENGTH]
local_variable[type[byte], buf]
local_variable[type[int], i]
local_variable[type[int], loops]
local_variable[... | Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[readLine] operator[SEP] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[BUFF_LENGTH] operator[=] Other[256] operator[SEP] Keyword[byte] operator[SEP] operato... |
public static AndQuery CreateAndQuery(Query first, Query second) {
AndQuery and = new AndQuery();
and.subqueries.add(first);
and.subqueries.add(second);
return and;
} | class class_name[name] begin[{]
method[CreateAndQuery, return_type[type[AndQuery]], modifier[public static], parameter[first, second]] begin[{]
local_variable[type[AndQuery], and]
call[and.subqueries.add, parameter[member[.first]]]
call[and.subqueries.add, parameter[memb... | Keyword[public] Keyword[static] identifier[AndQuery] identifier[CreateAndQuery] operator[SEP] identifier[Query] identifier[first] , identifier[Query] identifier[second] operator[SEP] {
identifier[AndQuery] identifier[and] operator[=] Keyword[new] identifier[AndQuery] operator[SEP] operator[SEP] operator[SEP] id... |
@Override
public boolean containsValue(Object value) {
if (value != null) {
for (Property property : getProperties(_scope)) {
if (value.equals(property.getValue())) {
return true;
}
}
}
return false;
} | class class_name[name] begin[{]
method[containsValue, return_type[type[boolean]], modifier[public], parameter[value]] begin[{]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvoca... | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[containsValue] operator[SEP] identifier[Object] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Property] identifi... |
protected LayoutNodeType getLayoutNodeType(HttpServletRequest request, String folderNodeId) {
final IUserInstance userInstance = this.userInstanceManager.getUserInstance(request);
final IUserPreferencesManager preferencesManager = userInstance.getPreferencesManager();
final IUserLayoutManager us... | class class_name[name] begin[{]
method[getLayoutNodeType, return_type[type[LayoutNodeType]], modifier[protected], parameter[request, folderNodeId]] begin[{]
local_variable[type[IUserInstance], userInstance]
local_variable[type[IUserPreferencesManager], preferencesManager]
local_variable... | Keyword[protected] identifier[LayoutNodeType] identifier[getLayoutNodeType] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[String] identifier[folderNodeId] operator[SEP] {
Keyword[final] identifier[IUserInstance] identifier[userInstance] operator[=] Keyword[this] operator[SEP] ide... |
private String getInitialTarget(CmsObject cms, CmsResource resource) {
String sitePath = cms.getSitePath(resource);
String parent = CmsResource.getParentFolder(sitePath);
if (parent != null) {
return parent;
} else {
String rootParent = CmsResource.getParentFolde... | class class_name[name] begin[{]
method[getInitialTarget, return_type[type[String]], modifier[private], parameter[cms, resource]] begin[{]
local_variable[type[String], sitePath]
local_variable[type[String], parent]
if[binary_operation[member[.parent], !=, literal[null]]] begin[{]... | Keyword[private] identifier[String] identifier[getInitialTarget] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[CmsResource] identifier[resource] operator[SEP] {
identifier[String] identifier[sitePath] operator[=] identifier[cms] operator[SEP] identifier[getSitePath] operator[SEP] identifier[r... |
private void handleMessageFromServer(String textResponse) {
if (verbose) {
puts("RESPONSE", url, ProtocolConstants.prettyPrintMessage(textResponse));
puts("RESPONSE", url);
puts(ProtocolConstants.prettyPrintMessageWithLinesTabs(textResponse));
}
if (textRes... | class class_name[name] begin[{]
method[handleMessageFromServer, return_type[void], modifier[private], parameter[textResponse]] begin[{]
if[member[.verbose]] begin[{]
call[.puts, parameter[literal["RESPONSE"], member[.url], call[ProtocolConstants.prettyPrintMessage, param... | Keyword[private] Keyword[void] identifier[handleMessageFromServer] operator[SEP] identifier[String] identifier[textResponse] operator[SEP] {
Keyword[if] operator[SEP] identifier[verbose] operator[SEP] {
identifier[puts] operator[SEP] literal[String] , identifier[url] , identifier[ProtocolConstants] ... |
public static CmsSelectWidgetOption getWidgetOptionForFormatter(CmsObject cms, I_CmsFormatterBean formatter)
throws Exception {
String name = formatter.getNiceName(OpenCms.getWorkplaceManager().getWorkplaceLocale(cms))
+ " "
+ formatter.getResourceTypeNames().toString()
... | class class_name[name] begin[{]
method[getWidgetOptionForFormatter, return_type[type[CmsSelectWidgetOption]], modifier[public static], parameter[cms, formatter]] begin[{]
local_variable[type[String], name]
local_variable[type[String], path]
local_variable[type[CmsSelectWidgetOption], op... | Keyword[public] Keyword[static] identifier[CmsSelectWidgetOption] identifier[getWidgetOptionForFormatter] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[I_CmsFormatterBean] identifier[formatter] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[String] identifier[name] operator[... |
public M keep(String attr) {
if (attrs.containsKey(attr)) { // prevent put null value to the newColumns
Object keepIt = attrs.get(attr);
boolean keepFlag = _getModifyFlag().contains(attr);
attrs.clear();
_getModifyFlag().clear();
attrs.put(attr, keepIt);
if (keepFlag)
_getModifyFlag().ad... | class class_name[name] begin[{]
method[keep, return_type[type[M]], modifier[public], parameter[attr]] begin[{]
if[call[attrs.containsKey, parameter[member[.attr]]]] begin[{]
local_variable[type[Object], keepIt]
local_variable[type[boolean], keepFlag]
... | Keyword[public] identifier[M] identifier[keep] operator[SEP] identifier[String] identifier[attr] operator[SEP] {
Keyword[if] operator[SEP] identifier[attrs] operator[SEP] identifier[containsKey] operator[SEP] identifier[attr] operator[SEP] operator[SEP] {
identifier[Object] identifier[keepIt] operator... |
@Override
public ServletInputStream getInputStream() {
byte[] data = content == null ? new byte[0] : content;
return new MockServletInputStream(new ByteArrayInputStream(data));
} | class class_name[name] begin[{]
method[getInputStream, return_type[type[ServletInputStream]], modifier[public], parameter[]] begin[{]
local_variable[type[byte], data]
return[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], q... | annotation[@] identifier[Override] Keyword[public] identifier[ServletInputStream] identifier[getInputStream] operator[SEP] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[content] operator[==] Other[null] operator[?] Keyword[new] Keyword[byte] operator[SEP] Other... |
protected Pattern convertToRegex(String url) {
Pattern regex;
String pattern = null;
try {
// Escape any characters that have special meaning in regular expressions,
// such as '.' and '+'.
pattern = url.replace(".", "\\.");
pattern = pattern.repla... | class class_name[name] begin[{]
method[convertToRegex, return_type[type[Pattern]], modifier[protected], parameter[url]] begin[{]
local_variable[type[Pattern], regex]
local_variable[type[String], pattern]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberRef... | Keyword[protected] identifier[Pattern] identifier[convertToRegex] operator[SEP] identifier[String] identifier[url] operator[SEP] {
identifier[Pattern] identifier[regex] operator[SEP] identifier[String] identifier[pattern] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[pattern] operato... |
public String openGallery() {
StringBuffer jsOpener = new StringBuffer(32);
String galleryType = null;
try {
CmsResource res = getCms().readResource(getParamResource());
if (res != null) {
// get gallery path
String galleryPath = getParamR... | class class_name[name] begin[{]
method[openGallery, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[StringBuffer], jsOpener]
local_variable[type[String], galleryType]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[Variabl... | Keyword[public] identifier[String] identifier[openGallery] operator[SEP] operator[SEP] {
identifier[StringBuffer] identifier[jsOpener] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[32] operator[SEP] operator[SEP] identifier[String] identifier[galleryType] operator[=] Other[null] operator[... |
private static boolean implementsMap(ClassDescriptor d) {
while (d != null) {
try {
// Do not report this warning for EnumMap: EnumMap.keySet()/get() iteration is as fast as entrySet() iteration
if ("java.util.EnumMap".equals(d.getDottedClassName())) {
... | class class_name[name] begin[{]
method[implementsMap, return_type[type[boolean]], modifier[private static], parameter[d]] begin[{]
while[binary_operation[member[.d], !=, literal[null]]] begin[{]
TryStatement(block=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators... | Keyword[private] Keyword[static] Keyword[boolean] identifier[implementsMap] operator[SEP] identifier[ClassDescriptor] identifier[d] operator[SEP] {
Keyword[while] operator[SEP] identifier[d] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] literal[String... |
@Nonnull
public BugInstance addClassAndMethod(MethodAnnotation methodAnnotation) {
addClass(methodAnnotation.getClassName());
addMethod(methodAnnotation);
return this;
} | class class_name[name] begin[{]
method[addClassAndMethod, return_type[type[BugInstance]], modifier[public], parameter[methodAnnotation]] begin[{]
call[.addClass, parameter[call[methodAnnotation.getClassName, parameter[]]]]
call[.addMethod, parameter[member[.methodAnnotation]]]
... | annotation[@] identifier[Nonnull] Keyword[public] identifier[BugInstance] identifier[addClassAndMethod] operator[SEP] identifier[MethodAnnotation] identifier[methodAnnotation] operator[SEP] {
identifier[addClass] operator[SEP] identifier[methodAnnotation] operator[SEP] identifier[getClassName] operator[SEP] oper... |
protected String getTag(ILoggingEvent event) {
// format tag based on encoder layout; truncate if max length
// exceeded (only necessary for isLoggable(), which throws
// IllegalArgumentException)
String tag = (this.tagEncoder != null) ? this.tagEncoder.getLayout().doLayout(event) : event.getLoggerName(... | class class_name[name] begin[{]
method[getTag, return_type[type[String]], modifier[protected], parameter[event]] begin[{]
local_variable[type[String], tag]
if[binary_operation[member[.checkLoggable], &&, binary_operation[call[tag.length, parameter[]], >, member[.MAX_TAG_LENGTH]]]] begin... | Keyword[protected] identifier[String] identifier[getTag] operator[SEP] identifier[ILoggingEvent] identifier[event] operator[SEP] {
identifier[String] identifier[tag] operator[=] operator[SEP] Keyword[this] operator[SEP] identifier[tagEncoder] operator[!=] Other[null] operator[SEP] operator[?] Keyword[this] opera... |
@Skip
@Override
public void bind(ChannelHandlerContext ctx, SocketAddress localAddress,
ChannelPromise promise) throws Exception {
ctx.bind(localAddress, promise);
} | class class_name[name] begin[{]
method[bind, return_type[void], modifier[public], parameter[ctx, localAddress, promise]] begin[{]
call[ctx.bind, parameter[member[.localAddress], member[.promise]]]
end[}]
END[}] | annotation[@] identifier[Skip] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[bind] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] , identifier[SocketAddress] identifier[localAddress] , identifier[ChannelPromise] identifier[promise] operator[SEP] Keyword[throws] identifie... |
@Override
public void clearProperty(String key) {
if (config instanceof ConcurrentCompositeConfiguration) {
((ConcurrentCompositeConfiguration) config).clearOverrideProperty(key);
} else {
config.clearProperty(key);
}
} | class class_name[name] begin[{]
method[clearProperty, return_type[void], modifier[public], parameter[key]] begin[{]
if[binary_operation[member[.config], instanceof, type[ConcurrentCompositeConfiguration]]] begin[{]
Cast(expression=MemberReference(member=config, postfix_o... | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[clearProperty] operator[SEP] identifier[String] identifier[key] operator[SEP] {
Keyword[if] operator[SEP] identifier[config] Keyword[instanceof] identifier[ConcurrentCompositeConfiguration] operator[SEP] {
operator[SEP] operat... |
Map<String, LocalResource> getResources(
final ResourceLaunchEvent resourceLaunchEvent)
throws IOException {
final Map<String, LocalResource> result = new HashMap<>();
result.putAll(getGlobalResources());
final File localStagingFolder = this.tempFileCreator.createTempDirectory(this.fileNames.g... | class class_name[name] begin[{]
method[getResources, return_type[type[Map]], modifier[default], parameter[resourceLaunchEvent]] begin[{]
local_variable[type[Map], result]
call[result.putAll, parameter[call[.getGlobalResources, parameter[]]]]
local_variable[type[File], localStagi... | identifier[Map] operator[<] identifier[String] , identifier[LocalResource] operator[>] identifier[getResources] operator[SEP] Keyword[final] identifier[ResourceLaunchEvent] identifier[resourceLaunchEvent] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[Map] operator[<] identifi... |
protected void removeExistingEntity(String localId) {
if (StringUtils.isEmpty(localId))
return;
List<Scope> scopes = projectRepo.getScopeIdById(localId);
if (CollectionUtils.isEmpty(scopes))
return;
ObjectId tempEntId = scopes.get(0).getId();
if (localId.equalsIgnoreCase(scopes.get(0).getpId())) {
... | class class_name[name] begin[{]
method[removeExistingEntity, return_type[void], modifier[protected], parameter[localId]] begin[{]
if[call[StringUtils.isEmpty, parameter[member[.localId]]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[List], scopes]... | Keyword[protected] Keyword[void] identifier[removeExistingEntity] operator[SEP] identifier[String] identifier[localId] operator[SEP] {
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[localId] operator[SEP] operator[SEP] Keyword[return] operator[SEP] id... |
@Override
public DeleteUserPoolResult deleteUserPool(DeleteUserPoolRequest request) {
request = beforeClientExecution(request);
return executeDeleteUserPool(request);
} | class class_name[name] begin[{]
method[deleteUserPool, return_type[type[DeleteUserPoolResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeDeleteUserPool, parameter[member[.reques... | annotation[@] identifier[Override] Keyword[public] identifier[DeleteUserPoolResult] identifier[deleteUserPool] operator[SEP] identifier[DeleteUserPoolRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] oper... |
public static <T> T checkNotNull(@Nullable T value, Object varName) {
if (value == null) {
throw new NullPointerException(format("{} cannot be null", varName));
}
return value;
} | class class_name[name] begin[{]
method[checkNotNull, return_type[type[T]], modifier[public static], parameter[value, varName]] begin[{]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Lite... | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[checkNotNull] operator[SEP] annotation[@] identifier[Nullable] identifier[T] identifier[value] , identifier[Object] identifier[varName] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[==] Other[nu... |
@Override
public Integer getInteger( final String key )
throws
UtilException
{
return formatInteger( key, getRequiredPropValue( key ) );
} | class class_name[name] begin[{]
method[getInteger, return_type[type[Integer]], modifier[public], parameter[key]] begin[{]
return[call[.formatInteger, parameter[member[.key], call[.getRequiredPropValue, parameter[member[.key]]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Integer] identifier[getInteger] operator[SEP] Keyword[final] identifier[String] identifier[key] operator[SEP] Keyword[throws] identifier[UtilException] {
Keyword[return] identifier[formatInteger] operator[SEP] identifier[key] , identifier[getRequired... |
public BinaryString toLowerCase() {
if (javaObject != null) {
return toLowerCaseSlow();
}
if (sizeInBytes == 0) {
return EMPTY_UTF8;
}
int size = segments[0].size();
SegmentAndOffset segmentAndOffset = startSegmentAndOffset(size);
byte[] bytes = new byte[sizeInBytes];
bytes[0] = (byte) Character.t... | class class_name[name] begin[{]
method[toLowerCase, return_type[type[BinaryString]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.javaObject], !=, literal[null]]] begin[{]
return[call[.toLowerCaseSlow, parameter[]]]
else begin[{]
None
end[}]
... | Keyword[public] identifier[BinaryString] identifier[toLowerCase] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[javaObject] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[toLowerCaseSlow] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] ope... |
static void validateArgs(List<Object> args, Object instance, Method m, Command cmd) {
if (!onClasspath(JSR303_1_1_CLASSNAME)) {
return;
}
try {
Object validator = getValidator();
Method validate = validator.getClass().getMethod("validateArgs", List.class,
... | class class_name[name] begin[{]
method[validateArgs, return_type[void], modifier[static], parameter[args, instance, m, cmd]] begin[{]
if[call[.onClasspath, parameter[member[.JSR303_1_1_CLASSNAME]]]] begin[{]
return[None]
else begin[{]
None
end[}]
TryStatement... | Keyword[static] Keyword[void] identifier[validateArgs] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] identifier[args] , identifier[Object] identifier[instance] , identifier[Method] identifier[m] , identifier[Command] identifier[cmd] operator[SEP] {
Keyword[if] operator[SEP] operato... |
public static void runExample(
AdWordsServicesInterface adWordsServices, AdWordsSession session, Long adGroupId)
throws RemoteException, BatchJobException, InterruptedException, TimeoutException {
// Get the BatchJobService.
BatchJobServiceInterface batchJobService =
adWordsServices.get(sess... | class class_name[name] begin[{]
method[runExample, return_type[void], modifier[public static], parameter[adWordsServices, session, adGroupId]] begin[{]
local_variable[type[BatchJobServiceInterface], batchJobService]
local_variable[type[BatchJobOperation], addOp]
call[addOp.setOp... | Keyword[public] Keyword[static] Keyword[void] identifier[runExample] operator[SEP] identifier[AdWordsServicesInterface] identifier[adWordsServices] , identifier[AdWordsSession] identifier[session] , identifier[Long] identifier[adGroupId] operator[SEP] Keyword[throws] identifier[RemoteException] , identifier[BatchJob... |
public void executeOneAsync(FutureCallback<Row> callback, Statement stm)
throws ExceedMaxAsyncJobsException {
executeOneAsync(callback, stm, null);
} | class class_name[name] begin[{]
method[executeOneAsync, return_type[void], modifier[public], parameter[callback, stm]] begin[{]
call[.executeOneAsync, parameter[member[.callback], member[.stm], literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[executeOneAsync] operator[SEP] identifier[FutureCallback] operator[<] identifier[Row] operator[>] identifier[callback] , identifier[Statement] identifier[stm] operator[SEP] Keyword[throws] identifier[ExceedMaxAsyncJobsException] {
identifier[executeOneAsync] operator[SEP... |
public Observable<ZoneInner> updateAsync(String resourceGroupName, String zoneName, String ifMatch, Map<String, String> tags) {
return updateWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch, tags).map(new Func1<ServiceResponse<ZoneInner>, ZoneInner>() {
@Override
public Zone... | class class_name[name] begin[{]
method[updateAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, zoneName, ifMatch, tags]] begin[{]
return[call[.updateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.zoneName], member[.ifMatch], member[.tags]]]]
... | Keyword[public] identifier[Observable] operator[<] identifier[ZoneInner] operator[>] identifier[updateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[zoneName] , identifier[String] identifier[ifMatch] , identifier[Map] operator[<] identifier[String] , identifier... |
public final ItemStream removeFirstMatchingItemStream(Filter filter, Transaction transaction) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "removeFirstMatchingItemStream");
ItemStream item = (ItemStream) _itemStreams.... | class class_name[name] begin[{]
method[removeFirstMatchingItemStream, return_type[type[ItemStream]], modifier[final public], parameter[filter, transaction]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
... | Keyword[public] Keyword[final] identifier[ItemStream] identifier[removeFirstMatchingItemStream] operator[SEP] identifier[Filter] identifier[filter] , identifier[Transaction] identifier[transaction] operator[SEP] Keyword[throws] identifier[MessageStoreException] {
Keyword[if] operator[SEP] identifier[TraceCompon... |
@Override
public void readFragmentFrom(MwsReader r) {
amazonOrderId = r.read("AmazonOrderId", String.class);
sellerOrderId = r.read("SellerOrderId", String.class);
purchaseDate = r.read("PurchaseDate", XMLGregorianCalendar.class);
lastUpdateDate = r.read("LastUpdateDate", XMLGregoria... | class class_name[name] begin[{]
method[readFragmentFrom, return_type[void], modifier[public], parameter[r]] begin[{]
assign[member[.amazonOrderId], call[r.read, parameter[literal["AmazonOrderId"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=Reference... | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[readFragmentFrom] operator[SEP] identifier[MwsReader] identifier[r] operator[SEP] {
identifier[amazonOrderId] operator[=] identifier[r] operator[SEP] identifier[read] operator[SEP] literal[String] , identifier[String] operator[SEP] Keyw... |
public static void write(HttpServletResponse response, String text, String contentType) {
response.setContentType(contentType);
Writer writer = null;
try {
writer = response.getWriter();
writer.write(text);
writer.flush();
} catch (IOException e) {
throw new UtilException(e);
} finally {
... | class class_name[name] begin[{]
method[write, return_type[void], modifier[public static], parameter[response, text, contentType]] begin[{]
call[response.setContentType, parameter[member[.contentType]]]
local_variable[type[Writer], writer]
TryStatement(block=[StatementExpression(... | Keyword[public] Keyword[static] Keyword[void] identifier[write] operator[SEP] identifier[HttpServletResponse] identifier[response] , identifier[String] identifier[text] , identifier[String] identifier[contentType] operator[SEP] {
identifier[response] operator[SEP] identifier[setContentType] operator[SEP] ident... |
public static List<CommerceSubscriptionEntry> findByGroupId(long groupId,
int start, int end) {
return getPersistence().findByGroupId(groupId, start, end);
} | class class_name[name] begin[{]
method[findByGroupId, return_type[type[List]], modifier[public static], parameter[groupId, start, end]] begin[{]
return[call[.getPersistence, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[CommerceSubscriptionEntry] operator[>] identifier[findByGroupId] operator[SEP] Keyword[long] identifier[groupId] , Keyword[int] identifier[start] , Keyword[int] identifier[end] operator[SEP] {
Keyword[return] identifier[getPersistence] ope... |
public T merge(T entity) {
try {
tx.begin();
T mergedEntity = repository.merge(entity);
loadGraph(mergedEntity);
// we do not want to propagate any pending modification
repository.detach(mergedEntity);
tx.rollback();
return merg... | class class_name[name] begin[{]
method[merge, return_type[type[T]], modifier[public], parameter[entity]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=begin, postfix_operators=[], prefix_operators=[], qualifier=tx, selectors=[], type_arguments=None), ... | Keyword[public] identifier[T] identifier[merge] operator[SEP] identifier[T] identifier[entity] operator[SEP] {
Keyword[try] {
identifier[tx] operator[SEP] identifier[begin] operator[SEP] operator[SEP] operator[SEP] identifier[T] identifier[mergedEntity] operator[=] identifier[repository] operator[SEP]... |
public static Schema of(Type type) {
Preconditions.checkArgument(type.isSimpleType(), "Type %s is not a simple type.", type);
return new Schema(type, null, null, null, null, null, null, null);
} | class class_name[name] begin[{]
method[of, return_type[type[Schema]], modifier[public static], parameter[type]] begin[{]
call[Preconditions.checkArgument, parameter[call[type.isSimpleType, parameter[]], literal["Type %s is not a simple type."], member[.type]]]
return[ClassCreator(argume... | Keyword[public] Keyword[static] identifier[Schema] identifier[of] operator[SEP] identifier[Type] identifier[type] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[type] operator[SEP] identifier[isSimpleType] operator[SEP] operator[SEP] , literal[String] ... |
@Override
public boolean tryCompleteWith(Future<T> result) {
return tryComplete(future -> result.onComplete(response -> future.complete(response)));
} | class class_name[name] begin[{]
method[tryCompleteWith, return_type[type[boolean]], modifier[public], parameter[result]] begin[{]
return[call[.tryComplete, parameter[LambdaExpression(body=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=response, post... | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[tryCompleteWith] operator[SEP] identifier[Future] operator[<] identifier[T] operator[>] identifier[result] operator[SEP] {
Keyword[return] identifier[tryComplete] operator[SEP] identifier[future] operator[->] identifier[result] operat... |
public ObjectMetadata getObject(String bucketName, String key, File destinationFile) {
return this.getObject(new GetObjectRequest(bucketName, key), destinationFile);
} | class class_name[name] begin[{]
method[getObject, return_type[type[ObjectMetadata]], modifier[public], parameter[bucketName, key, destinationFile]] begin[{]
return[THIS[call[None.getObject, parameter[ClassCreator(arguments=[MemberReference(member=bucketName, postfix_operators=[], prefix_operators=[], q... | Keyword[public] identifier[ObjectMetadata] identifier[getObject] operator[SEP] identifier[String] identifier[bucketName] , identifier[String] identifier[key] , identifier[File] identifier[destinationFile] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[getObject] operator[SEP] Keyword[ne... |
public void cleanup() {
if (file != null && file.exists() && !file.delete()) {
LOGGER.debug("Failed to delete first temporary file {}", file.toString());
file.deleteOnExit();
}
} | class class_name[name] begin[{]
method[cleanup, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.file], !=, literal[null]], &&, call[file.exists, parameter[]]], &&, call[file.delete, parameter[]]]] begin[{]
... | Keyword[public] Keyword[void] identifier[cleanup] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[file] operator[!=] Other[null] operator[&&] identifier[file] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[file] operator[SEP] identifier[delete]... |
static Method getMethodUnchecked(
Class<?> type, String methodName, Class<?>... parameterTypes)
{
try
{
return type.getMethod(methodName, parameterTypes);
}
catch (SecurityException e)
{
throw new IllegalArgumentException(e);
... | class class_name[name] begin[{]
method[getMethodUnchecked, return_type[type[Method]], modifier[static], parameter[type, methodName, parameterTypes]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operat... | Keyword[static] identifier[Method] identifier[getMethodUnchecked] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] , identifier[String] identifier[methodName] , identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[parameterTypes] operator[SEP] {
Key... |
@Override
public void restart() throws IOException, InterruptedException {
Jenkins jenkins = Jenkins.getInstanceOrNull(); // guard against repeated concurrent calls to restart
try {
if (jenkins != null) {
jenkins.cleanUp();
}
} catch (Exception e) {
... | class class_name[name] begin[{]
method[restart, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Jenkins], jenkins]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=jenkins, postfix_operators=[], prefix_operators=[], qualifi... | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[restart] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] {
identifier[Jenkins] identifier[jenkins] operator[=] identifier[Jenkins] operator[SEP] identifier[getInstanceOrNull] operat... |
public EClass getIfcGeometricCurveSet() {
if (ifcGeometricCurveSetEClass == null) {
ifcGeometricCurveSetEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(266);
}
return ifcGeometricCurveSetEClass;
} | class class_name[name] begin[{]
method[getIfcGeometricCurveSet, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcGeometricCurveSetEClass], ==, literal[null]]] begin[{]
assign[member[.ifcGeometricCurveSetEClass], Cast(expre... | Keyword[public] identifier[EClass] identifier[getIfcGeometricCurveSet] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcGeometricCurveSetEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcGeometricCurveSetEClass] operator[=] operator[SEP] identifier[EClass] operator[SE... |
private Object processElement(byte[] source, int offset, int currentColumnIndex) {
byte[] temp;
int length = columnsDataLength.get(currentColumnIndex);
if (columns.get(currentColumnIndex).getType() == Number.class) {
temp = Arrays.copyOfRange(source, offset + (int) (long) columnsData... | class class_name[name] begin[{]
method[processElement, return_type[type[Object]], modifier[private], parameter[source, offset, currentColumnIndex]] begin[{]
local_variable[type[byte], temp]
local_variable[type[int], length]
if[binary_operation[call[columns.get, parameter[member[... | Keyword[private] identifier[Object] identifier[processElement] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[source] , Keyword[int] identifier[offset] , Keyword[int] identifier[currentColumnIndex] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[temp] operator[SEP] Keyw... |
public Object doMoveOne(int iRelPosition) throws DBException, RemoteException
{
try {
synchronized (this.getTask())
{
FieldList record = this.getMainRecord().move(iRelPosition);
int iRecordStatus = DBConstants.RECORD_NORMAL;
if (recor... | class class_name[name] begin[{]
method[doMoveOne, return_type[type[Object]], modifier[public], parameter[iRelPosition]] begin[{]
TryStatement(block=[SynchronizedStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[]... | Keyword[public] identifier[Object] identifier[doMoveOne] operator[SEP] Keyword[int] identifier[iRelPosition] operator[SEP] Keyword[throws] identifier[DBException] , identifier[RemoteException] {
Keyword[try] {
Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[getTask] operato... |
public static KbObjectNotFoundException fromThrowable(Throwable cause) {
return (cause instanceof KbObjectNotFoundException)
? (KbObjectNotFoundException) cause
: new KbObjectNotFoundException(cause);
} | class class_name[name] begin[{]
method[fromThrowable, return_type[type[KbObjectNotFoundException]], modifier[public static], parameter[cause]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, select... | Keyword[public] Keyword[static] identifier[KbObjectNotFoundException] identifier[fromThrowable] operator[SEP] identifier[Throwable] identifier[cause] operator[SEP] {
Keyword[return] operator[SEP] identifier[cause] Keyword[instanceof] identifier[KbObjectNotFoundException] operator[SEP] operator[?] operator[SEP] i... |
private static void addLiveReference(Object value) {
synchronized (sLiveObjects) {
Integer count = sLiveObjects.get(value);
if (count == null) {
sLiveObjects.put(value, 1);
} else {
sLiveObjects.put(value, count + 1);
}
}
} | class class_name[name] begin[{]
method[addLiveReference, return_type[void], modifier[private static], parameter[value]] begin[{]
SYNCHRONIZED[member[.sLiveObjects]] BEGIN[{]
local_variable[type[Integer], count]
if[binary_operation[member[.count], ==, literal[... | Keyword[private] Keyword[static] Keyword[void] identifier[addLiveReference] operator[SEP] identifier[Object] identifier[value] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[sLiveObjects] operator[SEP] {
identifier[Integer] identifier[count] operator[=] identifier[sLiveObjects] operato... |
private CompletableFuture<Collection<Permission>> findPermissions0(String projectName, String repoName,
User user) {
requireNonNull(projectName, "projectName");
requireNonNull(repoName, "repoName");
requireNonNull(user, "user... | class class_name[name] begin[{]
method[findPermissions0, return_type[type[CompletableFuture]], modifier[private], parameter[projectName, repoName, user]] begin[{]
call[.requireNonNull, parameter[member[.projectName], literal["projectName"]]]
call[.requireNonNull, parameter[membe... | Keyword[private] identifier[CompletableFuture] operator[<] identifier[Collection] operator[<] identifier[Permission] operator[>] operator[>] identifier[findPermissions0] operator[SEP] identifier[String] identifier[projectName] , identifier[String] identifier[repoName] , identifier[User] identifier[user] operator[SEP]... |
public static MtasSpanQuery constructQuery(String queryValue,
String queryType, String queryPrefix,
HashMap<String, String[]> queryVariables, String field,
String queryIgnore, Integer maximumIgnoreLength) throws IOException {
if (queryType == null || queryType.isEmpty()) {
throw new IOExcept... | class class_name[name] begin[{]
method[constructQuery, return_type[type[MtasSpanQuery]], modifier[public static], parameter[queryValue, queryType, queryPrefix, queryVariables, field, queryIgnore, maximumIgnoreLength]] begin[{]
if[binary_operation[binary_operation[member[.queryType], ==, literal... | Keyword[public] Keyword[static] identifier[MtasSpanQuery] identifier[constructQuery] operator[SEP] identifier[String] identifier[queryValue] , identifier[String] identifier[queryType] , identifier[String] identifier[queryPrefix] , identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[SEP]... |
public boolean waitForNewTimeslot() throws InterruptedException {
boolean hasWaited = false;
while(true) {
final long numberOfEventsInTimeSlot = getNumberOfEventsInTimeslot();
if(numberOfEventsInTimeSlot > numberOfEvents) {
hasWaited = true;
Thread.sleep(timeslotInMilliseconds / 10);
} el... | class class_name[name] begin[{]
method[waitForNewTimeslot, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
local_variable[type[boolean], hasWaited]
while[literal[true]] begin[{]
local_variable[type[long], numberOfEventsInTimeSlot]
... | Keyword[public] Keyword[boolean] identifier[waitForNewTimeslot] operator[SEP] operator[SEP] Keyword[throws] identifier[InterruptedException] {
Keyword[boolean] identifier[hasWaited] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[final] ... |
public static TimeZone parseBackendTimeZone(String timeZone) {
if (timeZone.startsWith("GMT")) {
TimeZone tz = GMT_ZONES.get(timeZone);
if (tz != null) {
return tz;
}
}
return TimeZone.getTimeZone(timeZone);
} | class class_name[name] begin[{]
method[parseBackendTimeZone, return_type[type[TimeZone]], modifier[public static], parameter[timeZone]] begin[{]
if[call[timeZone.startsWith, parameter[literal["GMT"]]]] begin[{]
local_variable[type[TimeZone], tz]
if[binary_ope... | Keyword[public] Keyword[static] identifier[TimeZone] identifier[parseBackendTimeZone] operator[SEP] identifier[String] identifier[timeZone] operator[SEP] {
Keyword[if] operator[SEP] identifier[timeZone] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
id... |
@Subscribe
public synchronized void renew(final DisabledStateChangedEvent disabledStateChangedEvent) {
OrchestrationShardingSchema shardingSchema = disabledStateChangedEvent.getShardingSchema();
if (ShardingConstant.LOGIC_SCHEMA_NAME.equals(shardingSchema.getSchemaName())) {
for (MasterS... | class class_name[name] begin[{]
method[renew, return_type[void], modifier[synchronized public], parameter[disabledStateChangedEvent]] begin[{]
local_variable[type[OrchestrationShardingSchema], shardingSchema]
if[call[ShardingConstant.LOGIC_SCHEMA_NAME.equals, parameter[call[shardingSche... | annotation[@] identifier[Subscribe] Keyword[public] Keyword[synchronized] Keyword[void] identifier[renew] operator[SEP] Keyword[final] identifier[DisabledStateChangedEvent] identifier[disabledStateChangedEvent] operator[SEP] {
identifier[OrchestrationShardingSchema] identifier[shardingSchema] operator[=] identif... |
public <T> SlimAnnotatedTypeContext<T> loadAnnotatedType(String className, String bdaId) {
return loadAnnotatedType(this.<T> loadClass(className), bdaId);
} | class class_name[name] begin[{]
method[loadAnnotatedType, return_type[type[SlimAnnotatedTypeContext]], modifier[public], parameter[className, bdaId]] begin[{]
return[call[.loadAnnotatedType, parameter[THIS[call[None.loadClass, parameter[member[.className]]]], member[.bdaId]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[SlimAnnotatedTypeContext] operator[<] identifier[T] operator[>] identifier[loadAnnotatedType] operator[SEP] identifier[String] identifier[className] , identifier[String] identifier[bdaId] operator[SEP] {
Keyword[return] identifier[loadAnnotatedTyp... |
public static QueryFilter getIdentityFilter(DecoratedKey key, String cfName, long timestamp)
{
return new QueryFilter(key, cfName, new IdentityQueryFilter(), timestamp);
} | class class_name[name] begin[{]
method[getIdentityFilter, return_type[type[QueryFilter]], modifier[public static], parameter[key, cfName, timestamp]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference... | Keyword[public] Keyword[static] identifier[QueryFilter] identifier[getIdentityFilter] operator[SEP] identifier[DecoratedKey] identifier[key] , identifier[String] identifier[cfName] , Keyword[long] identifier[timestamp] operator[SEP] {
Keyword[return] Keyword[new] identifier[QueryFilter] operator[SEP] identifie... |
public void printTo(Writer writer)
throws IOException
{
if (exception != null)
{
writer.write(ExceptionUtils.stackTrace(exception, "\n"));
writer.flush();
return;
}
if (execution != null)
{
writer.write(toHtml(execution, true));
writer.flush();
}
} | class class_name[name] begin[{]
method[printTo, return_type[void], modifier[public], parameter[writer]] begin[{]
if[binary_operation[member[.exception], !=, literal[null]]] begin[{]
call[writer.write, parameter[call[ExceptionUtils.stackTrace, parameter[member[.exception]... | Keyword[public] Keyword[void] identifier[printTo] operator[SEP] identifier[Writer] identifier[writer] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[exception] operator[!=] Other[null] operator[SEP] {
identifier[writer] operator[SEP] identifier[write] oper... |
public void setJmsAcknowledgeMode(int mode){
switch (mode) {
case Session.AUTO_ACKNOWLEDGE:
case Session.CLIENT_ACKNOWLEDGE:
case Session.DUPS_OK_ACKNOWLEDGE:
break;
default:
throw new IllegalArgumentException("Unknown Acknowledge mode: " + mode + " (See javax.jms.Session for valid values)");
}
thi... | class class_name[name] begin[{]
method[setJmsAcknowledgeMode, return_type[void], modifier[public], parameter[mode]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=AUTO_ACKNOWLEDGE, postfix_operators=[], prefix_operators=[], qualifier=Session, selectors=[]), MemberRefer... | Keyword[public] Keyword[void] identifier[setJmsAcknowledgeMode] operator[SEP] Keyword[int] identifier[mode] operator[SEP] {
Keyword[switch] operator[SEP] identifier[mode] operator[SEP] {
Keyword[case] identifier[Session] operator[SEP] identifier[AUTO_ACKNOWLEDGE] operator[:] Keyword[case] identifier[... |
public static base_response unset(nitro_service client, clusterinstance resource, String[] args) throws Exception{
clusterinstance unsetresource = new clusterinstance();
unsetresource.clid = resource.clid;
return unsetresource.unset_resource(client,args);
} | class class_name[name] begin[{]
method[unset, return_type[type[base_response]], modifier[public static], parameter[client, resource, args]] begin[{]
local_variable[type[clusterinstance], unsetresource]
assign[member[unsetresource.clid], member[resource.clid]]
return[call[unsetre... | Keyword[public] Keyword[static] identifier[base_response] identifier[unset] operator[SEP] identifier[nitro_service] identifier[client] , identifier[clusterinstance] identifier[resource] , identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] {
ident... |
public List<GroupMember> backups(int numBackups) {
if (primary == null || candidates.isEmpty()) {
return Collections.emptyList();
}
return candidates.subList(1, Math.min(candidates.size(), numBackups + 1));
} | class class_name[name] begin[{]
method[backups, return_type[type[List]], modifier[public], parameter[numBackups]] begin[{]
if[binary_operation[binary_operation[member[.primary], ==, literal[null]], ||, call[candidates.isEmpty, parameter[]]]] begin[{]
return[call[Collections.emptyLis... | Keyword[public] identifier[List] operator[<] identifier[GroupMember] operator[>] identifier[backups] operator[SEP] Keyword[int] identifier[numBackups] operator[SEP] {
Keyword[if] operator[SEP] identifier[primary] operator[==] Other[null] operator[||] identifier[candidates] operator[SEP] identifier[isEmpty] opera... |
@Override
public void unset(String propName) {
if (propName.equals(PROP_ST)) {
unsetSt();
}
if (propName.equals(PROP_STATE_OR_PROVINCE_NAME)) {
unsetStateOrProvinceName();
}
if (propName.equals(PROP_STREET)) {
unsetStreet();
}
... | class class_name[name] begin[{]
method[unset, return_type[void], modifier[public], parameter[propName]] begin[{]
if[call[propName.equals, parameter[member[.PROP_ST]]]] begin[{]
call[.unsetSt, parameter[]]
else begin[{]
None
end[}]
if[call[... | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[unset] operator[SEP] identifier[String] identifier[propName] operator[SEP] {
Keyword[if] operator[SEP] identifier[propName] operator[SEP] identifier[equals] operator[SEP] identifier[PROP_ST] operator[SEP] operator[SEP] {
ident... |
@Override
protected HtmlToken produce() {
HtmlToken token = readToken();
if (token == null) { return null; }
switch (token.type) {
// Keep track of whether we're inside a tag or not.
case TAGBEGIN:
state = State.IN_TAG;
break;
case TAGEND:
if (state == State.SAW... | class class_name[name] begin[{]
method[produce, return_type[type[HtmlToken]], modifier[protected], parameter[]] begin[{]
local_variable[type[HtmlToken], token]
if[binary_operation[member[.token], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
... | annotation[@] identifier[Override] Keyword[protected] identifier[HtmlToken] identifier[produce] operator[SEP] operator[SEP] {
identifier[HtmlToken] identifier[token] operator[=] identifier[readToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[==] Other[null] op... |
public Request<EmailVerificationTicket> requestEmailVerification(EmailVerificationTicket emailVerificationTicket) {
Asserts.assertNotNull(emailVerificationTicket, "email verification ticket");
String url = baseUrl
.newBuilder()
.addPathSegments("api/v2/tickets/email-veri... | class class_name[name] begin[{]
method[requestEmailVerification, return_type[type[Request]], modifier[public], parameter[emailVerificationTicket]] begin[{]
call[Asserts.assertNotNull, parameter[member[.emailVerificationTicket], literal["email verification ticket"]]]
local_variable[type[... | Keyword[public] identifier[Request] operator[<] identifier[EmailVerificationTicket] operator[>] identifier[requestEmailVerification] operator[SEP] identifier[EmailVerificationTicket] identifier[emailVerificationTicket] operator[SEP] {
identifier[Asserts] operator[SEP] identifier[assertNotNull] operator[SEP] iden... |
private void assertNoError(String errorValue, String errorDescription) throws AuthenticationException {
if (errorValue == null) {
return;
}
Log.e(TAG, "Error, access denied. Check that the required Permissions are granted and that the Application has this Connection configured in Aut... | class class_name[name] begin[{]
method[assertNoError, return_type[void], modifier[private], parameter[errorValue, errorDescription]] begin[{]
if[binary_operation[member[.errorValue], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
... | Keyword[private] Keyword[void] identifier[assertNoError] operator[SEP] identifier[String] identifier[errorValue] , identifier[String] identifier[errorDescription] operator[SEP] Keyword[throws] identifier[AuthenticationException] {
Keyword[if] operator[SEP] identifier[errorValue] operator[==] Other[null] operato... |
public boolean hasRuleBlock(String name) {
for (RuleBlock ruleBlock : this.ruleBlocks) {
if (ruleBlock.getName().equals(name)) {
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[hasRuleBlock, return_type[type[boolean]], modifier[public], parameter[name]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier... | Keyword[public] Keyword[boolean] identifier[hasRuleBlock] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[for] operator[SEP] identifier[RuleBlock] identifier[ruleBlock] operator[:] Keyword[this] operator[SEP] identifier[ruleBlocks] operator[SEP] {
Keyword[if] operator[SEP] i... |
private void writeFrame() {
int clocalsSize = frame[1];
int cstackSize = frame[2];
if ((cw.version & 0xFFFF) < Opcodes.V1_6) {
stackMap.putShort(frame[0]).putShort(clocalsSize);
writeFrameTypes(3, 3 + clocalsSize);
stackMap.putShort(cstackSize);
wr... | class class_name[name] begin[{]
method[writeFrame, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[int], clocalsSize]
local_variable[type[int], cstackSize]
if[binary_operation[binary_operation[member[cw.version], &, literal[0xFFFF]], <, member[Opc... | Keyword[private] Keyword[void] identifier[writeFrame] operator[SEP] operator[SEP] {
Keyword[int] identifier[clocalsSize] operator[=] identifier[frame] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[cstackSize] operator[=] identifier[frame] operator[SEP] Other[2] operator[SEP] operator... |
public boolean exists(String indexName) {
try {
final JestResult result = jestClient.execute(new GetSettings.Builder().addIndex(indexName).build());
return result.isSucceeded() && Iterators.contains(result.getJsonObject().fieldNames(), indexName);
} catch (IOException e) {
... | class class_name[name] begin[{]
method[exists, return_type[type[boolean]], modifier[public], parameter[indexName]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassCreator(arguments=[], body... | Keyword[public] Keyword[boolean] identifier[exists] operator[SEP] identifier[String] identifier[indexName] operator[SEP] {
Keyword[try] {
Keyword[final] identifier[JestResult] identifier[result] operator[=] identifier[jestClient] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[... |
public void add(BatchEntry batchEntry) throws DatabaseEngineException {
bufferLock.lock();
try {
buffer.add(batchEntry);
batch--;
} finally {
bufferLock.unlock();
}
if (batch <= 0) {
flush();
}
} | class class_name[name] begin[{]
method[add, return_type[void], modifier[public], parameter[batchEntry]] begin[{]
call[bufferLock.lock, parameter[]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=batchEntry, postfix_operators=[], pre... | Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[BatchEntry] identifier[batchEntry] operator[SEP] Keyword[throws] identifier[DatabaseEngineException] {
identifier[bufferLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[buffer... |
@Override
public CreateApiKeyResult createApiKey(CreateApiKeyRequest request) {
request = beforeClientExecution(request);
return executeCreateApiKey(request);
} | class class_name[name] begin[{]
method[createApiKey, return_type[type[CreateApiKeyResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeCreateApiKey, parameter[member[.request]]]]
... | annotation[@] identifier[Override] Keyword[public] identifier[CreateApiKeyResult] identifier[createApiKey] operator[SEP] identifier[CreateApiKeyRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[S... |
@Override
public boolean validatePassword(String cleartext, String encrypted) {
// If local account has no password, do not allow login.
if (encrypted == null) {
return false;
} else if (encrypted.startsWith(MD5_PREFIX)) {
encrypted = encrypted.substring(5);
... | class class_name[name] begin[{]
method[validatePassword, return_type[type[boolean]], modifier[public], parameter[cleartext, encrypted]] begin[{]
if[binary_operation[member[.encrypted], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
if[call[encr... | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[validatePassword] operator[SEP] identifier[String] identifier[cleartext] , identifier[String] identifier[encrypted] operator[SEP] {
Keyword[if] operator[SEP] identifier[encrypted] operator[==] Other[null] operator[SEP] {
K... |
public static final boolean endsWithDelimiter(byte[] bytes, int endPos, byte[] delim) {
if (endPos < delim.length - 1) {
return false;
}
for (int pos = 0; pos < delim.length; ++pos) {
if (delim[pos] != bytes[endPos - delim.length + 1 + pos]) {
return false;
}
}
return true;
} | class class_name[name] begin[{]
method[endsWithDelimiter, return_type[type[boolean]], modifier[final public static], parameter[bytes, endPos, delim]] begin[{]
if[binary_operation[member[.endPos], <, binary_operation[member[delim.length], -, literal[1]]]] begin[{]
return[literal[fals... | Keyword[public] Keyword[static] Keyword[final] Keyword[boolean] identifier[endsWithDelimiter] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , Keyword[int] identifier[endPos] , Keyword[byte] operator[SEP] operator[SEP] identifier[delim] operator[SEP] {
Keyword[if] operator[SEP] ident... |
public synchronized void putJob(Executable job)
{
// Preconditions
if (m_queueThread == null || !m_queueThread.isAlive()) {
throw new IllegalStateException("Can't put job, thread is not alive or not present");
}
if (isInterrupted()) {
throw new IllegalStateException("... | class class_name[name] begin[{]
method[putJob, return_type[void], modifier[synchronized public], parameter[job]] begin[{]
if[binary_operation[binary_operation[member[.m_queueThread], ==, literal[null]], ||, call[m_queueThread.isAlive, parameter[]]]] begin[{]
ThrowStatement(expressio... | Keyword[public] Keyword[synchronized] Keyword[void] identifier[putJob] operator[SEP] identifier[Executable] identifier[job] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_queueThread] operator[==] Other[null] operator[||] operator[!] identifier[m_queueThread] operator[SEP] identifier[isAlive] operator[SE... |
public void visit(final WebAppErrorPage webAppErrorPage) {
NullArgumentException.validateNotNull(webAppErrorPage,
"Web app error page");
try {
webContainer.registerErrorPage(webAppErrorPage.getError(),
webAppErrorPage.getLocation(), httpContext);
//CHECKSTYLE:OFF
} catch (Exception ignore) {... | class class_name[name] begin[{]
method[visit, return_type[void], modifier[public], parameter[webAppErrorPage]] begin[{]
call[NullArgumentException.validateNotNull, parameter[member[.webAppErrorPage], literal["Web app error page"]]]
TryStatement(block=[StatementExpression(expression=Meth... | Keyword[public] Keyword[void] identifier[visit] operator[SEP] Keyword[final] identifier[WebAppErrorPage] identifier[webAppErrorPage] operator[SEP] {
identifier[NullArgumentException] operator[SEP] identifier[validateNotNull] operator[SEP] identifier[webAppErrorPage] , literal[String] operator[SEP] operator[SEP]... |
public <U> Maybe<U> transaction(io.reactivex.functions.Function<ReactiveRXGenericQueryExecutor, Maybe<U>> transaction){
return beginTransaction()
.toMaybe()
.flatMap(queryExecutor -> transaction.apply(queryExecutor) //perform user tasks
.flatMap(res -> que... | class class_name[name] begin[{]
method[transaction, return_type[type[Maybe]], modifier[public], parameter[transaction]] begin[{]
return[call[.beginTransaction, parameter[]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[U] operator[>] identifier[Maybe] operator[<] identifier[U] operator[>] identifier[transaction] operator[SEP] identifier[io] operator[SEP] identifier[reactivex] operator[SEP] identifier[functions] operator[SEP] identifier[Function] operator[<] identifier[ReactiveRXGenericQueryExecu... |
@Override
public final void put(Object o) {
boolean discarded = false;
if (inactive) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setting active: " + this);
// If the pool was marked inactive by the pool manager alarm, the... | class class_name[name] begin[{]
method[put, return_type[void], modifier[final public], parameter[o]] begin[{]
local_variable[type[boolean], discarded]
if[member[.inactive]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, ca... | annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[put] operator[SEP] identifier[Object] identifier[o] operator[SEP] {
Keyword[boolean] identifier[discarded] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[inactive] operator[SEP] {
... |
public static Optional<String> getFileType(final String aUrl) {
if (aUrl != null) {
int index = aUrl.lastIndexOf('.');
if (index > 0) {
return Optional.of(aUrl.substring(index + 1));
}
}
return Optional.empty();
} | class class_name[name] begin[{]
method[getFileType, return_type[type[Optional]], modifier[public static], parameter[aUrl]] begin[{]
if[binary_operation[member[.aUrl], !=, literal[null]]] begin[{]
local_variable[type[int], index]
if[binary_operation[member[.in... | Keyword[public] Keyword[static] identifier[Optional] operator[<] identifier[String] operator[>] identifier[getFileType] operator[SEP] Keyword[final] identifier[String] identifier[aUrl] operator[SEP] {
Keyword[if] operator[SEP] identifier[aUrl] operator[!=] Other[null] operator[SEP] {
Keyword[int] iden... |
public static List<String> splitToCells(String line, int minCnt) {
LOG.trace("split line : {}", line);
List<String> newCells = new ArrayList<String>();
for (Iterator<String> cellItr = Arrays.asList(line.split(",")).iterator(); cellItr
.hasNext();) {
String cell = ... | class class_name[name] begin[{]
method[splitToCells, return_type[type[List]], modifier[public static], parameter[line, minCnt]] begin[{]
call[LOG.trace, parameter[literal["split line : {}"], member[.line]]]
local_variable[type[List], newCells]
ForStatement(body=BlockStatement(la... | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[splitToCells] operator[SEP] identifier[String] identifier[line] , Keyword[int] identifier[minCnt] operator[SEP] {
identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[lin... |
private Ref modOp() throws PageException {
Ref ref = divMultiOp();
while (cfml.isValidIndex() && (cfml.forwardIfCurrent('%') || cfml.forwardIfCurrent("mod"))) {
ref = _mod(ref);
}
return ref;
} | class class_name[name] begin[{]
method[modOp, return_type[type[Ref]], modifier[private], parameter[]] begin[{]
local_variable[type[Ref], ref]
while[binary_operation[call[cfml.isValidIndex, parameter[]], &&, binary_operation[call[cfml.forwardIfCurrent, parameter[literal['%']]], ||, call[... | Keyword[private] identifier[Ref] identifier[modOp] operator[SEP] operator[SEP] Keyword[throws] identifier[PageException] {
identifier[Ref] identifier[ref] operator[=] identifier[divMultiOp] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[cfml] operator[SEP] identifier[isValidInd... |
private OperationPair createSetBidOperation(ProductPartitionNode node) {
Preconditions.checkNotNull(node.getProductPartitionId(),
"Node for SET operation has no partition ID: %s", node);
Preconditions.checkArgument(node.getProductPartitionId().longValue() >= 0L,
"Node for SET operation has a neg... | class class_name[name] begin[{]
method[createSetBidOperation, return_type[type[OperationPair]], modifier[private], parameter[node]] begin[{]
call[Preconditions.checkNotNull, parameter[call[node.getProductPartitionId, parameter[]], literal["Node for SET operation has no partition ID: %s"], membe... | Keyword[private] identifier[OperationPair] identifier[createSetBidOperation] operator[SEP] identifier[ProductPartitionNode] identifier[node] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[node] operator[SEP] identifier[getProductPartitionId] operator[SEP... |
public void marshall(AuthorizationData authorizationData, ProtocolMarshaller protocolMarshaller) {
if (authorizationData == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(authorizationData.getAuthori... | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[authorizationData, protocolMarshaller]] begin[{]
if[binary_operation[member[.authorizationData], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(pos... | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[AuthorizationData] identifier[authorizationData] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[authorizationData] operator[==] Other[null] operator[SEP] {
... |
public int getNextRangeIndex() {
int length = rangeIndexList.size();
if (length > 0) {
Integer rindex = rangeIndexList.get(length - 1);
return rindex.intValue();
}
return 0;
} | class class_name[name] begin[{]
method[getNextRangeIndex, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[int], length]
if[binary_operation[member[.length], >, literal[0]]] begin[{]
local_variable[type[Integer], rindex]
return[... | Keyword[public] Keyword[int] identifier[getNextRangeIndex] operator[SEP] operator[SEP] {
Keyword[int] identifier[length] operator[=] identifier[rangeIndexList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] ... |
void decreaseKBy1() {
if (k_ <= 1) {
throw new SketchesStateException("Cannot decrease k below 1 in union");
}
if ((h_ == 0) && (r_ == 0)) {
// exact mode, but no data yet; this reduction is somewhat gratuitous
--k_;
} else if ((h_ > 0) && (r_ == 0)) {
// exact mode, but we have... | class class_name[name] begin[{]
method[decreaseKBy1, return_type[void], modifier[default], parameter[]] begin[{]
if[binary_operation[member[.k_], <=, literal[1]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=... | Keyword[void] identifier[decreaseKBy1] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[k_] operator[<=] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SketchesStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] opera... |
@Override
protected LogicalFilterWrapper appendAttributeToQuery(LogicalFilterWrapper queryBuilder, final String dataAttribute, final List<Object> queryValues) {
if (queryBuilder == null) {
queryBuilder = new LogicalFilterWrapper(this.queryType);
}
for (final Object queryValue : ... | class class_name[name] begin[{]
method[appendAttributeToQuery, return_type[type[LogicalFilterWrapper]], modifier[protected], parameter[queryBuilder, dataAttribute, queryValues]] begin[{]
if[binary_operation[member[.queryBuilder], ==, literal[null]]] begin[{]
assign[membe... | annotation[@] identifier[Override] Keyword[protected] identifier[LogicalFilterWrapper] identifier[appendAttributeToQuery] operator[SEP] identifier[LogicalFilterWrapper] identifier[queryBuilder] , Keyword[final] identifier[String] identifier[dataAttribute] , Keyword[final] identifier[List] operator[<] identifier[Objec... |
public JCTree translateTopLevelClass(JCTree cdef, TreeMaker make) {
// note that this method does NOT support recursion.
this.make = make;
pt = null;
return translate(cdef, null);
} | class class_name[name] begin[{]
method[translateTopLevelClass, return_type[type[JCTree]], modifier[public], parameter[cdef, make]] begin[{]
assign[THIS[member[None.make]], member[.make]]
assign[member[.pt], literal[null]]
return[call[.translate, parameter[member[.cdef], ... | Keyword[public] identifier[JCTree] identifier[translateTopLevelClass] operator[SEP] identifier[JCTree] identifier[cdef] , identifier[TreeMaker] identifier[make] operator[SEP] {
Keyword[this] operator[SEP] identifier[make] operator[=] identifier[make] operator[SEP] identifier[pt] operator[=] Other[null] operator... |
public String getPrincipal() {
Authentication authentication = SecurityContextHolder.getContext()
.getAuthentication();
if (authentication == null) {
log.warn("No Authentication object set in SecurityContext - returning empty String as Principal");
return "";
}
Object principal = authentication.getP... | class class_name[name] begin[{]
method[getPrincipal, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[Authentication], authentication]
if[binary_operation[member[.authentication], ==, literal[null]]] begin[{]
call[log.warn, p... | Keyword[public] identifier[String] identifier[getPrincipal] operator[SEP] operator[SEP] {
identifier[Authentication] identifier[authentication] operator[=] identifier[SecurityContextHolder] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getAuthentication] operator[SEP] ... |
public static BeanManager getBeanManager() {
BeanManager mgr = getBeanManagerFromJndi();
if (mgr == null) {
ServiceLoader<BeanManagerProvider> loader = ServiceLoader
.load(BeanManagerProvider.class);
Iterator<BeanManagerProvider> it = loader.iterator();
... | class class_name[name] begin[{]
method[getBeanManager, return_type[type[BeanManager]], modifier[public static], parameter[]] begin[{]
local_variable[type[BeanManager], mgr]
if[binary_operation[member[.mgr], ==, literal[null]]] begin[{]
local_variable[type[ServiceLoader], loa... | Keyword[public] Keyword[static] identifier[BeanManager] identifier[getBeanManager] operator[SEP] operator[SEP] {
identifier[BeanManager] identifier[mgr] operator[=] identifier[getBeanManagerFromJndi] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mgr] operator[==] Other[null] oper... |
@Deprecated
public void debug(Object message, Object[] params, Throwable t) {
doLog(Level.DEBUG, FQCN, message, params, t);
} | class class_name[name] begin[{]
method[debug, return_type[void], modifier[public], parameter[message, params, t]] begin[{]
call[.doLog, parameter[member[Level.DEBUG], member[.FQCN], member[.message], member[.params], member[.t]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[void] identifier[debug] operator[SEP] identifier[Object] identifier[message] , identifier[Object] operator[SEP] operator[SEP] identifier[params] , identifier[Throwable] identifier[t] operator[SEP] {
identifier[doLog] operator[SEP] identifier[Level] o... |
public int minComponent() {
float absX = Math.abs(x);
float absY = Math.abs(y);
if (absX < absY)
return 0;
return 1;
} | class class_name[name] begin[{]
method[minComponent, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[float], absX]
local_variable[type[float], absY]
if[binary_operation[member[.absX], <, member[.absY]]] begin[{]
return[literal[0]]
else... | Keyword[public] Keyword[int] identifier[minComponent] operator[SEP] operator[SEP] {
Keyword[float] identifier[absX] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[float] identifier[absY] operator[=] identifier[Math] operator[SEP] identif... |
public static authorizationpolicy_lbvserver_binding[] get(nitro_service service, String name) throws Exception{
authorizationpolicy_lbvserver_binding obj = new authorizationpolicy_lbvserver_binding();
obj.set_name(name);
authorizationpolicy_lbvserver_binding response[] = (authorizationpolicy_lbvserver_binding[]) ... | class class_name[name] begin[{]
method[get, return_type[type[authorizationpolicy_lbvserver_binding]], modifier[public static], parameter[service, name]] begin[{]
local_variable[type[authorizationpolicy_lbvserver_binding], obj]
call[obj.set_name, parameter[member[.name]]]
local_v... | Keyword[public] Keyword[static] identifier[authorizationpolicy_lbvserver_binding] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[authorizationpolicy_lbv... |
public static String packValues(List<String> unpackedValues) {
if (hasItems(unpackedValues)) {
final Iterator<String> it = unpackedValues.iterator();
final StringBuilder b = new StringBuilder();
while (it.hasNext()) {
b.append(it.next());
if (i... | class class_name[name] begin[{]
method[packValues, return_type[type[String]], modifier[public static], parameter[unpackedValues]] begin[{]
if[call[.hasItems, parameter[member[.unpackedValues]]]] begin[{]
local_variable[type[Iterator], it]
local_variable[type[StringBuilde... | Keyword[public] Keyword[static] identifier[String] identifier[packValues] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[unpackedValues] operator[SEP] {
Keyword[if] operator[SEP] identifier[hasItems] operator[SEP] identifier[unpackedValues] operator[SEP] operator[SEP] {
... |
@SuppressWarnings("unchecked")
public <T extends AbstractCache<KEY, VALUE>> T named(String name) {
this.name = name;
return (T) this;
} | class class_name[name] begin[{]
method[named, return_type[type[T]], modifier[public], parameter[name]] begin[{]
assign[THIS[member[None.name]], member[.name]]
return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(argumen... | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[AbstractCache] operator[<] identifier[KEY] , identifier[VALUE] operator[>] operator[>] identifier[T] identifier[named] operator[SEP] identifier[String] identifier... |
@Override
public void parse(final String... parameters) {
// Manage red composite
if (parameters.length >= 1) {
redProperty().set(Double.parseDouble(parameters[0]));
}
// Manage green composite
if (parameters.length >= 2) {
greenProperty().set(... | class class_name[name] begin[{]
method[parse, return_type[void], modifier[public], parameter[parameters]] begin[{]
if[binary_operation[member[parameters.length], >=, literal[1]]] begin[{]
call[.redProperty, parameter[]]
else begin[{]
None
end[}]
... | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[parse] operator[SEP] Keyword[final] identifier[String] operator[...] identifier[parameters] operator[SEP] {
Keyword[if] operator[SEP] identifier[parameters] operator[SEP] identifier[length] operator[>=] Other[1] operator[SEP] {
... |
public void doFinally() {
if (conn != null && !isPartOfTransaction) {
try {
conn.close();
} catch (SQLException e) {
// Not much we can do
}
}
parameters = null;
conn = null;
} | class class_name[name] begin[{]
method[doFinally, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[member[.conn], !=, literal[null]], &&, member[.isPartOfTransaction]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodI... | Keyword[public] Keyword[void] identifier[doFinally] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[conn] operator[!=] Other[null] operator[&&] operator[!] identifier[isPartOfTransaction] operator[SEP] {
Keyword[try] {
identifier[conn] operator[SEP] identifier[close] ... |
public synchronized void close() throws Exception {
//Stop the periodic flush as we will flush laster
if (m_flush != null) {
m_flush.cancel(false);
}
m_ses.shutdown();
// Remove this VoltBulkLoader from the active set.
synchronized (m_vblGlobals) {
... | class class_name[name] begin[{]
method[close, return_type[void], modifier[synchronized public], parameter[]] begin[{]
if[binary_operation[member[.m_flush], !=, literal[null]]] begin[{]
call[m_flush.cancel, parameter[literal[false]]]
else begin[{]
None
end... | Keyword[public] Keyword[synchronized] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[m_flush] operator[!=] Other[null] operator[SEP] {
identifier[m_flush] operator[SEP] identifier[cancel] operator[SEP] literal[bo... |
public int edit() throws DBException
{
if ((this.getRecord().getEditMode() != Constants.EDIT_CURRENT)
&& (this.getRecord().getEditMode() != Constants.EDIT_IN_PROGRESS))
throw new DBException(Constants.INVALID_RECORD);
int iErrorCode = this.doEdit(); // Only call if edit is su... | class class_name[name] begin[{]
method[edit, return_type[type[int]], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[THIS[call[None.getRecord, parameter[]]call[None.getEditMode, parameter[]]], !=, member[Constants.EDIT_CURRENT]], &&, binary_operation[THIS[call[None.... | Keyword[public] Keyword[int] identifier[edit] operator[SEP] operator[SEP] Keyword[throws] identifier[DBException] {
Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getEditMode] operator[SEP] operator[SEP] operator[!=] ... |
private void onSetComment(CfDef cfDef, Properties cfProperties, StringBuilder builder)
{
String comment = cfProperties.getProperty(CassandraConstants.COMMENT);
if (comment != null)
{
if (builder != null)
{
String comment_Str = CQLTranslator.getKeyword(... | class class_name[name] begin[{]
method[onSetComment, return_type[void], modifier[private], parameter[cfDef, cfProperties, builder]] begin[{]
local_variable[type[String], comment]
if[binary_operation[member[.comment], !=, literal[null]]] begin[{]
if[binary_operati... | Keyword[private] Keyword[void] identifier[onSetComment] operator[SEP] identifier[CfDef] identifier[cfDef] , identifier[Properties] identifier[cfProperties] , identifier[StringBuilder] identifier[builder] operator[SEP] {
identifier[String] identifier[comment] operator[=] identifier[cfProperties] operator[SEP] i... |
static void addCommon(final ArgP argp) {
argp.addOption("--table", "TABLE",
"Name of the HBase table where to store the time series"
+ " (default: tsdb).");
argp.addOption("--uidtable", "TABLE",
"Name of the HBase table to use for Unique IDs"
... | class class_name[name] begin[{]
method[addCommon, return_type[void], modifier[static], parameter[argp]] begin[{]
call[argp.addOption, parameter[literal["--table"], literal["TABLE"], binary_operation[literal["Name of the HBase table where to store the time series"], +, literal[" (default: tsdb).... | Keyword[static] Keyword[void] identifier[addCommon] operator[SEP] Keyword[final] identifier[ArgP] identifier[argp] operator[SEP] {
identifier[argp] operator[SEP] identifier[addOption] operator[SEP] literal[String] , literal[String] , literal[String] operator[+] literal[String] operator[SEP] operator[SEP] ident... |
public static void reloadAndWatch(final String configFile, final long delay) {
long watchDelay = delay == 0 ? Log4jUtils.DEFAULT_WATCH_DELAY : delay;
if (configFile != null) {
if (configFile.endsWith(XML_FILE_EXENSION)) {
DOMConfigurator.configureAndWatch(configFile, watchDe... | class class_name[name] begin[{]
method[reloadAndWatch, return_type[void], modifier[public static], parameter[configFile, delay]] begin[{]
local_variable[type[long], watchDelay]
if[binary_operation[member[.configFile], !=, literal[null]]] begin[{]
if[call[configFi... | Keyword[public] Keyword[static] Keyword[void] identifier[reloadAndWatch] operator[SEP] Keyword[final] identifier[String] identifier[configFile] , Keyword[final] Keyword[long] identifier[delay] operator[SEP] {
Keyword[long] identifier[watchDelay] operator[=] identifier[delay] operator[==] Other[0] operator[?] id... |
public void marshall(Preset preset, ProtocolMarshaller protocolMarshaller) {
if (preset == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(preset.getArn(), ARN_BINDING);
protocolMarshaller... | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[preset, protocolMarshaller]] begin[{]
if[binary_operation[member[.preset], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], pre... | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[Preset] identifier[preset] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[preset] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] iden... |
public Cell createCell(Date date) {
Cell cell = this.getNextCell(CellType.STRING);
if (date != null) {
cell.setCellValue(date);
}
cell.setCellStyle(this.style.getDateCs());
return cell;
} | class class_name[name] begin[{]
method[createCell, return_type[type[Cell]], modifier[public], parameter[date]] begin[{]
local_variable[type[Cell], cell]
if[binary_operation[member[.date], !=, literal[null]]] begin[{]
call[cell.setCellValue, parameter[member[.date... | Keyword[public] identifier[Cell] identifier[createCell] operator[SEP] identifier[Date] identifier[date] operator[SEP] {
identifier[Cell] identifier[cell] operator[=] Keyword[this] operator[SEP] identifier[getNextCell] operator[SEP] identifier[CellType] operator[SEP] identifier[STRING] operator[SEP] operator[SEP]... |
public HCatInputFormatBase<T> asFlinkTuples() throws HCatException {
// build type information
int numFields = outputSchema.getFields().size();
if (numFields > this.getMaxFlinkTupleSize()) {
throw new IllegalArgumentException("Only up to " + this.getMaxFlinkTupleSize() +
" fields can be returned as Flink... | class class_name[name] begin[{]
method[asFlinkTuples, return_type[type[HCatInputFormatBase]], modifier[public], parameter[]] begin[{]
local_variable[type[int], numFields]
if[binary_operation[member[.numFields], >, THIS[call[None.getMaxFlinkTupleSize, parameter[]]]]] begin[{]
... | Keyword[public] identifier[HCatInputFormatBase] operator[<] identifier[T] operator[>] identifier[asFlinkTuples] operator[SEP] operator[SEP] Keyword[throws] identifier[HCatException] {
Keyword[int] identifier[numFields] operator[=] identifier[outputSchema] operator[SEP] identifier[getFields] operator[SEP] operato... |
@Override
public <T> Query<T> createSqlQueryMappingColumns(Class<T> entityType,
String sql,
Map<String, String> columnMapping) {
Assert.notNull(entityType, "entityType must not null");
Asse... | class class_name[name] begin[{]
method[createSqlQueryMappingColumns, return_type[type[Query]], modifier[public], parameter[entityType, sql, columnMapping]] begin[{]
call[Assert.notNull, parameter[member[.entityType], literal["entityType must not null"]]]
call[Assert.hasText, par... | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[Query] operator[<] identifier[T] operator[>] identifier[createSqlQueryMappingColumns] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[entityType] , identifier[String] identifier[sql] , ... |
public static <T extends Tree> Matcher<T> isStatic() {
return new Matcher<T>() {
@Override
public boolean matches(Tree tree, VisitorState state) {
Symbol sym = ASTHelpers.getSymbol(tree);
return sym != null && sym.isStatic();
}
};
} | class class_name[name] begin[{]
method[isStatic, return_type[type[Matcher]], modifier[public static], parameter[]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[Variab... | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Tree] operator[>] identifier[Matcher] operator[<] identifier[T] operator[>] identifier[isStatic] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[Matcher] operator[<] identifier[T] operator[>] operator[SEP]... |
public void write(File file) throws Exception {
try (FileOutputStream fout = new FileOutputStream(file)) {
fout.write(get());
}
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[public], parameter[file]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], typ... | Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[File] identifier[file] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[try] operator[SEP] identifier[FileOutputStream] identifier[fout] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] opera... |
public Index<SecondaryTable<T>> getOrCreateIndex()
{
List<Node> nodeList = childNode.get("index");
if (nodeList != null && nodeList.size() > 0)
{
return new IndexImpl<SecondaryTable<T>>(this, "index", childNode, nodeList.get(0));
}
return createIndex();
} | class class_name[name] begin[{]
method[getOrCreateIndex, return_type[type[Index]], modifier[public], parameter[]] begin[{]
local_variable[type[List], nodeList]
if[binary_operation[binary_operation[member[.nodeList], !=, literal[null]], &&, binary_operation[call[nodeList.size, parameter[... | Keyword[public] identifier[Index] operator[<] identifier[SecondaryTable] operator[<] identifier[T] operator[>] operator[>] identifier[getOrCreateIndex] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[Node] operator[>] identifier[nodeList] operator[=] identifier[childNode] operator[SEP] iden... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.