code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public Session createSession() throws OpenViduJavaClientException, OpenViduHttpException { Session s = new Session(); OpenVidu.activeSessions.put(s.getSessionId(), s); return s; }
class class_name[name] begin[{] method[createSession, return_type[type[Session]], modifier[public], parameter[]] begin[{] local_variable[type[Session], s] call[OpenVidu.activeSessions.put, parameter[call[s.getSessionId, parameter[]], member[.s]]] return[member[.s]] end[}] END[}]
Keyword[public] identifier[Session] identifier[createSession] operator[SEP] operator[SEP] Keyword[throws] identifier[OpenViduJavaClientException] , identifier[OpenViduHttpException] { identifier[Session] identifier[s] operator[=] Keyword[new] identifier[Session] operator[SEP] operator[SEP] operator[SEP] identifier[OpenVidu] operator[SEP] identifier[activeSessions] operator[SEP] identifier[put] operator[SEP] identifier[s] operator[SEP] identifier[getSessionId] operator[SEP] operator[SEP] , identifier[s] operator[SEP] operator[SEP] Keyword[return] identifier[s] operator[SEP] }
public static CircuitBreakerStatus copyOf(AbstractCircuitBreakerStatus instance) { if (instance instanceof CircuitBreakerStatus) { return (CircuitBreakerStatus) instance; } return CircuitBreakerStatus.builder() .from(instance) .build(); }
class class_name[name] begin[{] method[copyOf, return_type[type[CircuitBreakerStatus]], modifier[public static], parameter[instance]] begin[{] if[binary_operation[member[.instance], instanceof, type[CircuitBreakerStatus]]] begin[{] return[Cast(expression=MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CircuitBreakerStatus, sub_type=None))] else begin[{] None end[}] return[call[CircuitBreakerStatus.builder, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CircuitBreakerStatus] identifier[copyOf] operator[SEP] identifier[AbstractCircuitBreakerStatus] identifier[instance] operator[SEP] { Keyword[if] operator[SEP] identifier[instance] Keyword[instanceof] identifier[CircuitBreakerStatus] operator[SEP] { Keyword[return] operator[SEP] identifier[CircuitBreakerStatus] operator[SEP] identifier[instance] operator[SEP] } Keyword[return] identifier[CircuitBreakerStatus] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[from] operator[SEP] identifier[instance] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
@Override public void entering(String sourceClass, String sourceMethod, Object param1) { if (isLoggable(Level.FINER)) { Object params[] = { param1 }; logp(Level.FINER, sourceClass, sourceMethod, "ENTRY {0}", params); } }
class class_name[name] begin[{] method[entering, return_type[void], modifier[public], parameter[sourceClass, sourceMethod, param1]] begin[{] if[call[.isLoggable, parameter[member[Level.FINER]]]] begin[{] local_variable[type[Object], params] call[.logp, parameter[member[Level.FINER], member[.sourceClass], member[.sourceMethod], literal["ENTRY {0}"], member[.params]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[entering] operator[SEP] identifier[String] identifier[sourceClass] , identifier[String] identifier[sourceMethod] , identifier[Object] identifier[param1] operator[SEP] { Keyword[if] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] { identifier[Object] identifier[params] operator[SEP] operator[SEP] operator[=] { identifier[param1] } operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] , identifier[sourceClass] , identifier[sourceMethod] , literal[String] , identifier[params] operator[SEP] operator[SEP] } }
@Override public ResourceProvider init(String scheme, Map arguments) { if (!StringUtil.isEmpty(scheme)) this.scheme = scheme; if (arguments != null) { this.arguments = arguments; Object oCaseSensitive = arguments.get("case-sensitive"); if (oCaseSensitive != null) { caseSensitive = Caster.toBooleanValue(oCaseSensitive, true); } // lock-timeout Object oTimeout = arguments.get("lock-timeout"); if (oTimeout != null) { lockTimeout = Caster.toLongValue(oTimeout, lockTimeout); } } lock.setLockTimeout(lockTimeout); lock.setCaseSensitive(caseSensitive); root = new RamResourceCore(null, RamResourceCore.TYPE_DIRECTORY, ""); return this; }
class class_name[name] begin[{] method[init, return_type[type[ResourceProvider]], modifier[public], parameter[scheme, arguments]] begin[{] if[call[StringUtil.isEmpty, parameter[member[.scheme]]]] begin[{] assign[THIS[member[None.scheme]], member[.scheme]] else begin[{] None end[}] if[binary_operation[member[.arguments], !=, literal[null]]] begin[{] assign[THIS[member[None.arguments]], member[.arguments]] local_variable[type[Object], oCaseSensitive] if[binary_operation[member[.oCaseSensitive], !=, literal[null]]] begin[{] assign[member[.caseSensitive], call[Caster.toBooleanValue, parameter[member[.oCaseSensitive], literal[true]]]] else begin[{] None end[}] local_variable[type[Object], oTimeout] if[binary_operation[member[.oTimeout], !=, literal[null]]] begin[{] assign[member[.lockTimeout], call[Caster.toLongValue, parameter[member[.oTimeout], member[.lockTimeout]]]] else begin[{] None end[}] else begin[{] None end[}] call[lock.setLockTimeout, parameter[member[.lockTimeout]]] call[lock.setCaseSensitive, parameter[member[.caseSensitive]]] assign[member[.root], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=TYPE_DIRECTORY, postfix_operators=[], prefix_operators=[], qualifier=RamResourceCore, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RamResourceCore, sub_type=None))] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ResourceProvider] identifier[init] operator[SEP] identifier[String] identifier[scheme] , identifier[Map] identifier[arguments] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[StringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[scheme] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[scheme] operator[=] identifier[scheme] operator[SEP] Keyword[if] operator[SEP] identifier[arguments] operator[!=] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[arguments] operator[=] identifier[arguments] operator[SEP] identifier[Object] identifier[oCaseSensitive] operator[=] identifier[arguments] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oCaseSensitive] operator[!=] Other[null] operator[SEP] { identifier[caseSensitive] operator[=] identifier[Caster] operator[SEP] identifier[toBooleanValue] operator[SEP] identifier[oCaseSensitive] , literal[boolean] operator[SEP] operator[SEP] } identifier[Object] identifier[oTimeout] operator[=] identifier[arguments] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oTimeout] operator[!=] Other[null] operator[SEP] { identifier[lockTimeout] operator[=] identifier[Caster] operator[SEP] identifier[toLongValue] operator[SEP] identifier[oTimeout] , identifier[lockTimeout] operator[SEP] operator[SEP] } } identifier[lock] operator[SEP] identifier[setLockTimeout] operator[SEP] identifier[lockTimeout] operator[SEP] operator[SEP] identifier[lock] operator[SEP] identifier[setCaseSensitive] operator[SEP] identifier[caseSensitive] operator[SEP] operator[SEP] identifier[root] operator[=] Keyword[new] identifier[RamResourceCore] operator[SEP] Other[null] , identifier[RamResourceCore] operator[SEP] identifier[TYPE_DIRECTORY] , literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { long currentTime = System.currentTimeMillis(); String measurementPrefix = getPrefix(handler); Object startTimeAttribute = getAndRemoveAttribute(request, START_TIME); Object postHandleObject = getAndRemoveAttribute(request, POST_HANDLE_TIME); if (startTimeAttribute == null) { LOG.info("Could not find start_time. Something went wrong with handler: " + measurementPrefix); monitor.incrementCounter(measurementPrefix + TIME_ERROR); return; } long startTime = (Long) startTimeAttribute; if (ex != null) { monitor.addTimerMeasurement(measurementPrefix + ERROR, startTime, currentTime); } else { if (postHandleObject != null) { long postHandleTime = (Long) postHandleObject; monitor.addTimerMeasurement(measurementPrefix + RENDERING, postHandleTime, currentTime); monitor.addTimerMeasurement(measurementPrefix + COMPLETE, startTime, currentTime); } } }
class class_name[name] begin[{] method[afterCompletion, return_type[void], modifier[public], parameter[request, response, handler, ex]] begin[{] local_variable[type[long], currentTime] local_variable[type[String], measurementPrefix] local_variable[type[Object], startTimeAttribute] local_variable[type[Object], postHandleObject] if[binary_operation[member[.startTimeAttribute], ==, literal[null]]] begin[{] call[LOG.info, parameter[binary_operation[literal["Could not find start_time. Something went wrong with handler: "], +, member[.measurementPrefix]]]] call[monitor.incrementCounter, parameter[binary_operation[member[.measurementPrefix], +, member[.TIME_ERROR]]]] return[None] else begin[{] None end[}] local_variable[type[long], startTime] if[binary_operation[member[.ex], !=, literal[null]]] begin[{] call[monitor.addTimerMeasurement, parameter[binary_operation[member[.measurementPrefix], +, member[.ERROR]], member[.startTime], member[.currentTime]]] else begin[{] if[binary_operation[member[.postHandleObject], !=, literal[null]]] begin[{] local_variable[type[long], postHandleTime] call[monitor.addTimerMeasurement, parameter[binary_operation[member[.measurementPrefix], +, member[.RENDERING]], member[.postHandleTime], member[.currentTime]]] call[monitor.addTimerMeasurement, parameter[binary_operation[member[.measurementPrefix], +, member[.COMPLETE]], member[.startTime], member[.currentTime]]] else begin[{] None end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[afterCompletion] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] , identifier[Object] identifier[handler] , identifier[Exception] identifier[ex] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[long] identifier[currentTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[measurementPrefix] operator[=] identifier[getPrefix] operator[SEP] identifier[handler] operator[SEP] operator[SEP] identifier[Object] identifier[startTimeAttribute] operator[=] identifier[getAndRemoveAttribute] operator[SEP] identifier[request] , identifier[START_TIME] operator[SEP] operator[SEP] identifier[Object] identifier[postHandleObject] operator[=] identifier[getAndRemoveAttribute] operator[SEP] identifier[request] , identifier[POST_HANDLE_TIME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startTimeAttribute] operator[==] Other[null] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[measurementPrefix] operator[SEP] operator[SEP] identifier[monitor] operator[SEP] identifier[incrementCounter] operator[SEP] identifier[measurementPrefix] operator[+] identifier[TIME_ERROR] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[long] identifier[startTime] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[startTimeAttribute] operator[SEP] Keyword[if] operator[SEP] identifier[ex] operator[!=] Other[null] operator[SEP] { identifier[monitor] operator[SEP] identifier[addTimerMeasurement] operator[SEP] identifier[measurementPrefix] operator[+] identifier[ERROR] , identifier[startTime] , identifier[currentTime] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[postHandleObject] operator[!=] Other[null] operator[SEP] { Keyword[long] identifier[postHandleTime] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[postHandleObject] operator[SEP] identifier[monitor] operator[SEP] identifier[addTimerMeasurement] operator[SEP] identifier[measurementPrefix] operator[+] identifier[RENDERING] , identifier[postHandleTime] , identifier[currentTime] operator[SEP] operator[SEP] identifier[monitor] operator[SEP] identifier[addTimerMeasurement] operator[SEP] identifier[measurementPrefix] operator[+] identifier[COMPLETE] , identifier[startTime] , identifier[currentTime] operator[SEP] operator[SEP] } } }
public Optional<ExternalServiceAlertCondition> show(long policyId, long conditionId) { Optional<ExternalServiceAlertCondition> ret = Optional.absent(); Collection<ExternalServiceAlertCondition> conditions = list(policyId); for(ExternalServiceAlertCondition condition : conditions) { if(condition.getId() == conditionId) ret = Optional.of(condition); } return ret; }
class class_name[name] begin[{] method[show, return_type[type[Optional]], modifier[public], parameter[policyId, conditionId]] begin[{] local_variable[type[Optional], ret] local_variable[type[Collection], conditions] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=condition, selectors=[], type_arguments=None), operandr=MemberReference(member=conditionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=condition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None)), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=conditions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=condition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExternalServiceAlertCondition, sub_type=None))), label=None) return[member[.ret]] end[}] END[}]
Keyword[public] identifier[Optional] operator[<] identifier[ExternalServiceAlertCondition] operator[>] identifier[show] operator[SEP] Keyword[long] identifier[policyId] , Keyword[long] identifier[conditionId] operator[SEP] { identifier[Optional] operator[<] identifier[ExternalServiceAlertCondition] operator[>] identifier[ret] operator[=] identifier[Optional] operator[SEP] identifier[absent] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[ExternalServiceAlertCondition] operator[>] identifier[conditions] operator[=] identifier[list] operator[SEP] identifier[policyId] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ExternalServiceAlertCondition] identifier[condition] operator[:] identifier[conditions] operator[SEP] { Keyword[if] operator[SEP] identifier[condition] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] identifier[conditionId] operator[SEP] identifier[ret] operator[=] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[condition] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
public static void init(@NonNull Application app, @NonNull CoreConfiguration config, boolean checkReportsOnApplicationStart) { final boolean senderServiceProcess = isACRASenderServiceProcess(); if (senderServiceProcess) { if (ACRA.DEV_LOGGING) log.d(LOG_TAG, "Not initialising ACRA to listen for uncaught Exceptions as this is the SendWorker process and we only send reports, we don't capture them to avoid infinite loops"); } final boolean supportedAndroidVersion = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH; if (!supportedAndroidVersion) { // NB We keep initialising so that everything is configured. But ACRA is never enabled below. log.w(LOG_TAG, "ACRA 5.1.0+ requires ICS or greater. ACRA is disabled and will NOT catch crashes or send messages."); } if (isInitialised()) { log.w(LOG_TAG, "ACRA#init called more than once. This might have unexpected side effects. Doing this outside of tests is discouraged."); if(DEV_LOGGING) log.d(LOG_TAG, "Removing old ACRA config..."); ((ErrorReporterImpl) errorReporterSingleton).unregister(); errorReporterSingleton = StubCreator.createErrorReporterStub(); } //noinspection ConstantConditions if (config == null) { log.e(LOG_TAG, "ACRA#init called but no CoreConfiguration provided"); return; } final SharedPreferences prefs = new SharedPreferencesFactory(app, config).create(); new LegacyFileHandler(app, prefs).updateToCurrentVersionIfNecessary(); if (!senderServiceProcess) { // Initialize ErrorReporter with all required data final boolean enableAcra = supportedAndroidVersion && SharedPreferencesFactory.shouldEnableACRA(prefs); // Indicate that ACRA is or is not listening for crashes. log.i(LOG_TAG, "ACRA is " + (enableAcra ? "enabled" : "disabled") + " for " + app.getPackageName() + ", initializing..."); ErrorReporterImpl reporter = new ErrorReporterImpl(app, config, enableAcra, supportedAndroidVersion, checkReportsOnApplicationStart); errorReporterSingleton = reporter; // register after initAcra is called to avoid a // NPE in ErrorReporter.disable() because // the context could be null at this moment. prefs.registerOnSharedPreferenceChangeListener(reporter); } }
class class_name[name] begin[{] method[init, return_type[void], modifier[public static], parameter[app, config, checkReportsOnApplicationStart]] begin[{] local_variable[type[boolean], senderServiceProcess] if[member[.senderServiceProcess]] begin[{] if[member[ACRA.DEV_LOGGING]] begin[{] call[log.d, parameter[member[.LOG_TAG], literal["Not initialising ACRA to listen for uncaught Exceptions as this is the SendWorker process and we only send reports, we don't capture them to avoid infinite loops"]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[boolean], supportedAndroidVersion] if[member[.supportedAndroidVersion]] begin[{] call[log.w, parameter[member[.LOG_TAG], literal["ACRA 5.1.0+ requires ICS or greater. ACRA is disabled and will NOT catch crashes or send messages."]]] else begin[{] None end[}] if[call[.isInitialised, parameter[]]] begin[{] call[log.w, parameter[member[.LOG_TAG], literal["ACRA#init called more than once. This might have unexpected side effects. Doing this outside of tests is discouraged."]]] if[member[.DEV_LOGGING]] begin[{] call[log.d, parameter[member[.LOG_TAG], literal["Removing old ACRA config..."]]] else begin[{] None end[}] Cast(expression=MemberReference(member=errorReporterSingleton, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ErrorReporterImpl, sub_type=None)) assign[member[.errorReporterSingleton], call[StubCreator.createErrorReporterStub, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.config], ==, literal[null]]] begin[{] call[log.e, parameter[member[.LOG_TAG], literal["ACRA#init called but no CoreConfiguration provided"]]] return[None] else begin[{] None end[}] local_variable[type[SharedPreferences], prefs] ClassCreator(arguments=[MemberReference(member=app, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prefs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=updateToCurrentVersionIfNecessary, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=LegacyFileHandler, sub_type=None)) if[member[.senderServiceProcess]] begin[{] local_variable[type[boolean], enableAcra] call[log.i, parameter[member[.LOG_TAG], binary_operation[binary_operation[binary_operation[binary_operation[literal["ACRA is "], +, TernaryExpression(condition=MemberReference(member=enableAcra, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="disabled"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="enabled"))], +, literal[" for "]], +, call[app.getPackageName, parameter[]]], +, literal[", initializing..."]]]] local_variable[type[ErrorReporterImpl], reporter] assign[member[.errorReporterSingleton], member[.reporter]] call[prefs.registerOnSharedPreferenceChangeListener, parameter[member[.reporter]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[init] operator[SEP] annotation[@] identifier[NonNull] identifier[Application] identifier[app] , annotation[@] identifier[NonNull] identifier[CoreConfiguration] identifier[config] , Keyword[boolean] identifier[checkReportsOnApplicationStart] operator[SEP] { Keyword[final] Keyword[boolean] identifier[senderServiceProcess] operator[=] identifier[isACRASenderServiceProcess] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[senderServiceProcess] operator[SEP] { Keyword[if] operator[SEP] identifier[ACRA] operator[SEP] identifier[DEV_LOGGING] operator[SEP] identifier[log] operator[SEP] identifier[d] operator[SEP] identifier[LOG_TAG] , literal[String] operator[SEP] operator[SEP] } Keyword[final] Keyword[boolean] identifier[supportedAndroidVersion] operator[=] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[ICE_CREAM_SANDWICH] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[supportedAndroidVersion] operator[SEP] { identifier[log] operator[SEP] identifier[w] operator[SEP] identifier[LOG_TAG] , literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isInitialised] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[w] operator[SEP] identifier[LOG_TAG] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DEV_LOGGING] operator[SEP] identifier[log] operator[SEP] identifier[d] operator[SEP] identifier[LOG_TAG] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ErrorReporterImpl] operator[SEP] identifier[errorReporterSingleton] operator[SEP] operator[SEP] identifier[unregister] operator[SEP] operator[SEP] operator[SEP] identifier[errorReporterSingleton] operator[=] identifier[StubCreator] operator[SEP] identifier[createErrorReporterStub] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[config] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[e] operator[SEP] identifier[LOG_TAG] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[final] identifier[SharedPreferences] identifier[prefs] operator[=] Keyword[new] identifier[SharedPreferencesFactory] operator[SEP] identifier[app] , identifier[config] operator[SEP] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[LegacyFileHandler] operator[SEP] identifier[app] , identifier[prefs] operator[SEP] operator[SEP] identifier[updateToCurrentVersionIfNecessary] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[senderServiceProcess] operator[SEP] { Keyword[final] Keyword[boolean] identifier[enableAcra] operator[=] identifier[supportedAndroidVersion] operator[&&] identifier[SharedPreferencesFactory] operator[SEP] identifier[shouldEnableACRA] operator[SEP] identifier[prefs] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[i] operator[SEP] identifier[LOG_TAG] , literal[String] operator[+] operator[SEP] identifier[enableAcra] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[app] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[ErrorReporterImpl] identifier[reporter] operator[=] Keyword[new] identifier[ErrorReporterImpl] operator[SEP] identifier[app] , identifier[config] , identifier[enableAcra] , identifier[supportedAndroidVersion] , identifier[checkReportsOnApplicationStart] operator[SEP] operator[SEP] identifier[errorReporterSingleton] operator[=] identifier[reporter] operator[SEP] identifier[prefs] operator[SEP] identifier[registerOnSharedPreferenceChangeListener] operator[SEP] identifier[reporter] operator[SEP] operator[SEP] } }
@Override public BatchDetectKeyPhrasesResult batchDetectKeyPhrases(BatchDetectKeyPhrasesRequest request) { request = beforeClientExecution(request); return executeBatchDetectKeyPhrases(request); }
class class_name[name] begin[{] method[batchDetectKeyPhrases, return_type[type[BatchDetectKeyPhrasesResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeBatchDetectKeyPhrases, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[BatchDetectKeyPhrasesResult] identifier[batchDetectKeyPhrases] operator[SEP] identifier[BatchDetectKeyPhrasesRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeBatchDetectKeyPhrases] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void setFullName(String name) { if (Util.fixEmptyAndTrim(name) == null) name = id; this.fullName = name; }
class class_name[name] begin[{] method[setFullName, return_type[void], modifier[public], parameter[name]] begin[{] if[binary_operation[call[Util.fixEmptyAndTrim, parameter[member[.name]]], ==, literal[null]]] begin[{] assign[member[.name], member[.id]] else begin[{] None end[}] assign[THIS[member[None.fullName]], member[.name]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setFullName] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[Util] operator[SEP] identifier[fixEmptyAndTrim] operator[SEP] identifier[name] operator[SEP] operator[==] Other[null] operator[SEP] identifier[name] operator[=] identifier[id] operator[SEP] Keyword[this] operator[SEP] identifier[fullName] operator[=] identifier[name] operator[SEP] }
public RangeInfo subListBorders(int size) { if (inclusive == null) throw new IllegalStateException("Should not call subListBorders on a non-inclusive aware IntRange"); int tempFrom = from; if (tempFrom < 0) { tempFrom += size; } int tempTo = to; if (tempTo < 0) { tempTo += size; } if (tempFrom > tempTo) { return new RangeInfo(inclusive ? tempTo : tempTo + 1, tempFrom + 1, true); } return new RangeInfo(tempFrom, inclusive ? tempTo + 1 : tempTo, false); }
class class_name[name] begin[{] method[subListBorders, return_type[type[RangeInfo]], modifier[public], parameter[size]] begin[{] if[binary_operation[member[.inclusive], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Should not call subListBorders on a non-inclusive aware IntRange")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], tempFrom] if[binary_operation[member[.tempFrom], <, literal[0]]] begin[{] assign[member[.tempFrom], member[.size]] else begin[{] None end[}] local_variable[type[int], tempTo] if[binary_operation[member[.tempTo], <, literal[0]]] begin[{] assign[member[.tempTo], member[.size]] else begin[{] None end[}] if[binary_operation[member[.tempFrom], >, member[.tempTo]]] begin[{] return[ClassCreator(arguments=[TernaryExpression(condition=MemberReference(member=inclusive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=BinaryOperation(operandl=MemberReference(member=tempTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), if_true=MemberReference(member=tempTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), BinaryOperation(operandl=MemberReference(member=tempFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RangeInfo, sub_type=None))] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=tempFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=MemberReference(member=inclusive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=tempTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=BinaryOperation(operandl=MemberReference(member=tempTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RangeInfo, sub_type=None))] end[}] END[}]
Keyword[public] identifier[RangeInfo] identifier[subListBorders] operator[SEP] Keyword[int] identifier[size] operator[SEP] { Keyword[if] operator[SEP] identifier[inclusive] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[tempFrom] operator[=] identifier[from] operator[SEP] Keyword[if] operator[SEP] identifier[tempFrom] operator[<] Other[0] operator[SEP] { identifier[tempFrom] operator[+=] identifier[size] operator[SEP] } Keyword[int] identifier[tempTo] operator[=] identifier[to] operator[SEP] Keyword[if] operator[SEP] identifier[tempTo] operator[<] Other[0] operator[SEP] { identifier[tempTo] operator[+=] identifier[size] operator[SEP] } Keyword[if] operator[SEP] identifier[tempFrom] operator[>] identifier[tempTo] operator[SEP] { Keyword[return] Keyword[new] identifier[RangeInfo] operator[SEP] identifier[inclusive] operator[?] identifier[tempTo] operator[:] identifier[tempTo] operator[+] Other[1] , identifier[tempFrom] operator[+] Other[1] , literal[boolean] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[RangeInfo] operator[SEP] identifier[tempFrom] , identifier[inclusive] operator[?] identifier[tempTo] operator[+] Other[1] operator[:] identifier[tempTo] , literal[boolean] operator[SEP] operator[SEP] }
public double calculateCategoryAgreement(final Object category) { double result = 0; for (ICodingAnnotationItem item : study.getItems()) { int catCount = 0; int otherCatCount = 0; for (IAnnotationUnit annotation : item.getUnits()) if (category.equals(annotation.getCategory())) catCount++; else otherCatCount++; result += catCount * (catCount - 1) + otherCatCount * (otherCatCount - 1); } return result / (double) (study.getItemCount() * study.getRaterCount() * (study.getRaterCount() - 1)); }
class class_name[name] begin[{] method[calculateCategoryAgreement, return_type[type[double]], modifier[public], parameter[category]] begin[{] local_variable[type[double], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=catCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=otherCatCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCategory, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=category, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=MemberReference(member=otherCatCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), label=None, then_statement=StatementExpression(expression=MemberReference(member=catCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getUnits, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAnnotationUnit, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=catCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=catCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=otherCatCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=otherCatCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=*), operator=+)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getItems, postfix_operators=[], prefix_operators=[], qualifier=study, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ICodingAnnotationItem, sub_type=None))), label=None) return[binary_operation[member[.result], /, Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getItemCount, postfix_operators=[], prefix_operators=[], qualifier=study, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getRaterCount, postfix_operators=[], prefix_operators=[], qualifier=study, selectors=[], type_arguments=None), operator=*), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRaterCount, postfix_operators=[], prefix_operators=[], qualifier=study, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=*), type=BasicType(dimensions=[], name=double))]] end[}] END[}]
Keyword[public] Keyword[double] identifier[calculateCategoryAgreement] operator[SEP] Keyword[final] identifier[Object] identifier[category] operator[SEP] { Keyword[double] identifier[result] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[ICodingAnnotationItem] identifier[item] operator[:] identifier[study] operator[SEP] identifier[getItems] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[catCount] operator[=] Other[0] operator[SEP] Keyword[int] identifier[otherCatCount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[IAnnotationUnit] identifier[annotation] operator[:] identifier[item] operator[SEP] identifier[getUnits] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[category] operator[SEP] identifier[equals] operator[SEP] identifier[annotation] operator[SEP] identifier[getCategory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[catCount] operator[++] operator[SEP] Keyword[else] identifier[otherCatCount] operator[++] operator[SEP] identifier[result] operator[+=] identifier[catCount] operator[*] operator[SEP] identifier[catCount] operator[-] Other[1] operator[SEP] operator[+] identifier[otherCatCount] operator[*] operator[SEP] identifier[otherCatCount] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[/] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[study] operator[SEP] identifier[getItemCount] operator[SEP] operator[SEP] operator[*] identifier[study] operator[SEP] identifier[getRaterCount] operator[SEP] operator[SEP] operator[*] operator[SEP] identifier[study] operator[SEP] identifier[getRaterCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] }
@Override public void processResult(CuratorFramework curatorFramework, CuratorEvent event) throws Exception { CuratorEventType eventType = event.getType(); switch (eventType) { case CHILDREN: break; case CLOSING: break; case CREATE: _invalidateCache(event.getPath()); break; case DELETE: _invalidateCache(event.getPath()); break; case EXISTS: break; case GET_ACL: break; case GET_DATA: break; case SET_ACL: break; case SET_DATA: break; case SYNC: break; case WATCHED: process(event.getWatchedEvent()); break; default: LOGGER.debug(event.toString()); break; } }
class class_name[name] begin[{] method[processResult, return_type[void], modifier[public], parameter[curatorFramework, event]] begin[{] local_variable[type[CuratorEventType], eventType] SwitchStatement(cases=[SwitchStatementCase(case=['CHILDREN'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CLOSING'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CREATE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None)], member=_invalidateCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['DELETE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None)], member=_invalidateCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['EXISTS'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['GET_ACL'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['GET_DATA'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['SET_ACL'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['SET_DATA'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['SYNC'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['WATCHED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWatchedEvent, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None)], member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=eventType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[processResult] operator[SEP] identifier[CuratorFramework] identifier[curatorFramework] , identifier[CuratorEvent] identifier[event] operator[SEP] Keyword[throws] identifier[Exception] { identifier[CuratorEventType] identifier[eventType] operator[=] identifier[event] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[eventType] operator[SEP] { Keyword[case] identifier[CHILDREN] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[CLOSING] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[CREATE] operator[:] identifier[_invalidateCache] operator[SEP] identifier[event] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[DELETE] operator[:] identifier[_invalidateCache] operator[SEP] identifier[event] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[EXISTS] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[GET_ACL] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[GET_DATA] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[SET_ACL] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[SET_DATA] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[SYNC] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[WATCHED] operator[:] identifier[process] operator[SEP] identifier[event] operator[SEP] identifier[getWatchedEvent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] identifier[event] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } }
public boolean set(Map<String, String> datas) { if(datas == null || datas.isEmpty())return false; boolean result = false; try { result = getJedisCommands(groupName).hmset(key, datas).equals(RESP_OK); //设置超时时间 if(result)setExpireIfNot(expireTime); return result; } finally { getJedisProvider(groupName).release(); } }
class class_name[name] begin[{] method[set, return_type[type[boolean]], modifier[public], parameter[datas]] begin[{] if[binary_operation[binary_operation[member[.datas], ==, literal[null]], ||, call[datas.isEmpty, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[boolean], result] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJedisCommands, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=datas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hmset, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=RESP_OK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=expireTime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setExpireIfNot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=groupName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJedisProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=release, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[set] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[datas] operator[SEP] { Keyword[if] operator[SEP] identifier[datas] operator[==] Other[null] operator[||] identifier[datas] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[try] { identifier[result] operator[=] identifier[getJedisCommands] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[hmset] operator[SEP] identifier[key] , identifier[datas] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[RESP_OK] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[setExpireIfNot] operator[SEP] identifier[expireTime] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] } Keyword[finally] { identifier[getJedisProvider] operator[SEP] identifier[groupName] operator[SEP] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP] } }
@Override public EEnum getIfcTransportElementTypeEnum() { if (ifcTransportElementTypeEnumEEnum == null) { ifcTransportElementTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(1091); } return ifcTransportElementTypeEnumEEnum; }
class class_name[name] begin[{] method[getIfcTransportElementTypeEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcTransportElementTypeEnumEEnum], ==, literal[null]]] begin[{] assign[member[.ifcTransportElementTypeEnumEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1091)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.ifcTransportElementTypeEnumEEnum]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EEnum] identifier[getIfcTransportElementTypeEnum] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcTransportElementTypeEnumEEnum] operator[==] Other[null] operator[SEP] { identifier[ifcTransportElementTypeEnumEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[1091] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcTransportElementTypeEnumEEnum] operator[SEP] }
@Override public java.util.concurrent.Future<PublishResult> publishAsync(String topicArn, String message, com.amazonaws.handlers.AsyncHandler<PublishRequest, PublishResult> asyncHandler) { return publishAsync(new PublishRequest().withTopicArn(topicArn).withMessage(message), asyncHandler); }
class class_name[name] begin[{] method[publishAsync, return_type[type[java]], modifier[public], parameter[topicArn, message, asyncHandler]] begin[{] return[call[.publishAsync, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=topicArn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withTopicArn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PublishRequest, sub_type=None)), member[.asyncHandler]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[concurrent] operator[SEP] identifier[Future] operator[<] identifier[PublishResult] operator[>] identifier[publishAsync] operator[SEP] identifier[String] identifier[topicArn] , identifier[String] identifier[message] , identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[handlers] operator[SEP] identifier[AsyncHandler] operator[<] identifier[PublishRequest] , identifier[PublishResult] operator[>] identifier[asyncHandler] operator[SEP] { Keyword[return] identifier[publishAsync] operator[SEP] Keyword[new] identifier[PublishRequest] operator[SEP] operator[SEP] operator[SEP] identifier[withTopicArn] operator[SEP] identifier[topicArn] operator[SEP] operator[SEP] identifier[withMessage] operator[SEP] identifier[message] operator[SEP] , identifier[asyncHandler] operator[SEP] operator[SEP] }
private String buildContentUrl( String methodPath, CPath path ) { return CONTENT_END_POINT + '/' + methodPath + '/' + scope + path.getUrlEncoded(); }
class class_name[name] begin[{] method[buildContentUrl, return_type[type[String]], modifier[private], parameter[methodPath, path]] begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.CONTENT_END_POINT], +, literal['/']], +, member[.methodPath]], +, literal['/']], +, member[.scope]], +, call[path.getUrlEncoded, parameter[]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[buildContentUrl] operator[SEP] identifier[String] identifier[methodPath] , identifier[CPath] identifier[path] operator[SEP] { Keyword[return] identifier[CONTENT_END_POINT] operator[+] literal[String] operator[+] identifier[methodPath] operator[+] literal[String] operator[+] identifier[scope] operator[+] identifier[path] operator[SEP] identifier[getUrlEncoded] operator[SEP] operator[SEP] operator[SEP] }
public Observable<TaskInner> beginUpdateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).map(new Func1<ServiceResponse<TaskInner>, TaskInner>() { @Override public TaskInner call(ServiceResponse<TaskInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[beginUpdateAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, registryName, taskName, taskUpdateParameters]] begin[{] return[call[.beginUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.registryName], member[.taskName], member[.taskUpdateParameters]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[TaskInner] operator[>] identifier[beginUpdateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[registryName] , identifier[String] identifier[taskName] , identifier[TaskUpdateParameters] identifier[taskUpdateParameters] operator[SEP] { Keyword[return] identifier[beginUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[registryName] , identifier[taskName] , identifier[taskUpdateParameters] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[TaskInner] operator[>] , identifier[TaskInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[TaskInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[TaskInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public int optInt(int index, int fallback) { Object object = opt(index); Integer result = JSON.toInteger(object); return result != null ? result : fallback; }
class class_name[name] begin[{] method[optInt, return_type[type[int]], modifier[public], parameter[index, fallback]] begin[{] local_variable[type[Object], object] local_variable[type[Integer], result] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=fallback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[int] identifier[optInt] operator[SEP] Keyword[int] identifier[index] , Keyword[int] identifier[fallback] operator[SEP] { identifier[Object] identifier[object] operator[=] identifier[opt] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[Integer] identifier[result] operator[=] identifier[JSON] operator[SEP] identifier[toInteger] operator[SEP] identifier[object] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[!=] Other[null] operator[?] identifier[result] operator[:] identifier[fallback] operator[SEP] }
public static void compressTar(Resource[] sources, Resource target, int mode) throws IOException { compressTar(sources, IOUtil.toBufferedOutputStream(target.getOutputStream()), mode); }
class class_name[name] begin[{] method[compressTar, return_type[void], modifier[public static], parameter[sources, target, mode]] begin[{] call[.compressTar, parameter[member[.sources], call[IOUtil.toBufferedOutputStream, parameter[call[target.getOutputStream, parameter[]]]], member[.mode]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[compressTar] operator[SEP] identifier[Resource] operator[SEP] operator[SEP] identifier[sources] , identifier[Resource] identifier[target] , Keyword[int] identifier[mode] operator[SEP] Keyword[throws] identifier[IOException] { identifier[compressTar] operator[SEP] identifier[sources] , identifier[IOUtil] operator[SEP] identifier[toBufferedOutputStream] operator[SEP] identifier[target] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] , identifier[mode] operator[SEP] operator[SEP] }
public static void editModule(CmsModule module, boolean isNew, String caption, Runnable callback) { Window window = CmsBasicDialog.prepareWindow(DialogWidth.wide); CmsEditModuleForm form = new CmsEditModuleForm(module, isNew, callback); window.setContent(form); window.setCaption(caption); A_CmsUI.get().addWindow(window); window.center(); }
class class_name[name] begin[{] method[editModule, return_type[void], modifier[public static], parameter[module, isNew, caption, callback]] begin[{] local_variable[type[Window], window] local_variable[type[CmsEditModuleForm], form] call[window.setContent, parameter[member[.form]]] call[window.setCaption, parameter[member[.caption]]] call[A_CmsUI.get, parameter[]] call[window.center, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[editModule] operator[SEP] identifier[CmsModule] identifier[module] , Keyword[boolean] identifier[isNew] , identifier[String] identifier[caption] , identifier[Runnable] identifier[callback] operator[SEP] { identifier[Window] identifier[window] operator[=] identifier[CmsBasicDialog] operator[SEP] identifier[prepareWindow] operator[SEP] identifier[DialogWidth] operator[SEP] identifier[wide] operator[SEP] operator[SEP] identifier[CmsEditModuleForm] identifier[form] operator[=] Keyword[new] identifier[CmsEditModuleForm] operator[SEP] identifier[module] , identifier[isNew] , identifier[callback] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[setContent] operator[SEP] identifier[form] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[setCaption] operator[SEP] identifier[caption] operator[SEP] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[addWindow] operator[SEP] identifier[window] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[center] operator[SEP] operator[SEP] operator[SEP] }
@Nonnull public static <T1, T2> ToDoubleBiFunctionBuilder<T1, T2> toDblBiFunction(Consumer<ToDoubleBiFunction<T1, T2>> consumer) { return new ToDoubleBiFunctionBuilder(consumer); }
class class_name[name] begin[{] method[toDblBiFunction, return_type[type[ToDoubleBiFunctionBuilder]], modifier[public static], parameter[consumer]] begin[{] return[ClassCreator(arguments=[MemberReference(member=consumer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ToDoubleBiFunctionBuilder, sub_type=None))] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] operator[>] identifier[ToDoubleBiFunctionBuilder] operator[<] identifier[T1] , identifier[T2] operator[>] identifier[toDblBiFunction] operator[SEP] identifier[Consumer] operator[<] identifier[ToDoubleBiFunction] operator[<] identifier[T1] , identifier[T2] operator[>] operator[>] identifier[consumer] operator[SEP] { Keyword[return] Keyword[new] identifier[ToDoubleBiFunctionBuilder] operator[SEP] identifier[consumer] operator[SEP] operator[SEP] }
public Expression rewriteExpression(Expression expression, Predicate<Symbol> symbolScope) { checkArgument(isDeterministic(expression), "Only deterministic expressions may be considered for rewrite"); return rewriteExpression(expression, symbolScope, true); }
class class_name[name] begin[{] method[rewriteExpression, return_type[type[Expression]], modifier[public], parameter[expression, symbolScope]] begin[{] call[.checkArgument, parameter[call[.isDeterministic, parameter[member[.expression]]], literal["Only deterministic expressions may be considered for rewrite"]]] return[call[.rewriteExpression, parameter[member[.expression], member[.symbolScope], literal[true]]]] end[}] END[}]
Keyword[public] identifier[Expression] identifier[rewriteExpression] operator[SEP] identifier[Expression] identifier[expression] , identifier[Predicate] operator[<] identifier[Symbol] operator[>] identifier[symbolScope] operator[SEP] { identifier[checkArgument] operator[SEP] identifier[isDeterministic] operator[SEP] identifier[expression] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[rewriteExpression] operator[SEP] identifier[expression] , identifier[symbolScope] , literal[boolean] operator[SEP] operator[SEP] }
private Map<String,Namespace> buildByPrefixMap() { int len = mNamespaces.size(); if (len == 0) { return Collections.emptyMap(); } LinkedHashMap<String,Namespace> m = new LinkedHashMap<String,Namespace>(1 + len + (len>>1)); for (int i = 0; i < len; ++i) { Namespace ns = mNamespaces.get(i); String prefix = ns.getPrefix(); if (prefix == null) { // shouldn't happen but... prefix = ""; } m.put(prefix, ns); } return m; }
class class_name[name] begin[{] method[buildByPrefixMap, return_type[type[Map]], modifier[private], parameter[]] begin[{] local_variable[type[int], len] if[binary_operation[member[.len], ==, literal[0]]] begin[{] return[call[Collections.emptyMap, parameter[]]] else begin[{] None end[}] local_variable[type[LinkedHashMap], m] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mNamespaces, selectors=[], type_arguments=None), name=ns)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Namespace, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPrefix, postfix_operators=[], prefix_operators=[], qualifier=ns, selectors=[], type_arguments=None), name=prefix)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[member[.m]] end[}] END[}]
Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[Namespace] operator[>] identifier[buildByPrefixMap] operator[SEP] operator[SEP] { Keyword[int] identifier[len] operator[=] identifier[mNamespaces] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] } identifier[LinkedHashMap] operator[<] identifier[String] , identifier[Namespace] operator[>] identifier[m] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[Namespace] operator[>] operator[SEP] Other[1] operator[+] identifier[len] operator[+] operator[SEP] identifier[len] operator[>] operator[>] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[Namespace] identifier[ns] operator[=] identifier[mNamespaces] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[prefix] operator[=] identifier[ns] operator[SEP] identifier[getPrefix] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prefix] operator[==] Other[null] operator[SEP] { identifier[prefix] operator[=] literal[String] operator[SEP] } identifier[m] operator[SEP] identifier[put] operator[SEP] identifier[prefix] , identifier[ns] operator[SEP] operator[SEP] } Keyword[return] identifier[m] operator[SEP] }
public static void populateExternalStreamsStatesFromSites(SystemProcedureExecutionContext context) { Database database = context.getDatabase(); for (Table t : database.getTables()) { if (!CatalogUtil.isTableExportOnly(database, t)) continue; Map<Integer, Pair<Long,Long>> sequenceNumbers = s_exportSequenceNumbers.get(t.getTypeName()); if (sequenceNumbers == null) { sequenceNumbers = new HashMap<Integer, Pair<Long, Long>>(); s_exportSequenceNumbers.put(t.getTypeName(), sequenceNumbers); } long[] usoAndSequenceNumber = context.getSiteProcedureConnection().getUSOForExportTable(t.getTypeName()); sequenceNumbers.put( context.getPartitionId(), Pair.of( usoAndSequenceNumber[0], usoAndSequenceNumber[1])); } TupleStreamStateInfo drStateInfo = context.getSiteProcedureConnection().getDRTupleStreamStateInfo(); s_drTupleStreamInfo.put(context.getPartitionId(), drStateInfo); if (drStateInfo.containsReplicatedStreamInfo) { s_drTupleStreamInfo.put(MpInitiator.MP_INIT_PID, drStateInfo); } if (!context.getSiteProcedureConnection().externalStreamsEnabled()) { s_disabledStreams.add(context.getPartitionId()); } }
class class_name[name] begin[{] method[populateExternalStreamsStatesFromSites, return_type[void], modifier[public static], parameter[context]] begin[{] local_variable[type[Database], database] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=database, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isTableExportOnly, postfix_operators=[], prefix_operators=['!'], qualifier=CatalogUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=s_exportSequenceNumbers, selectors=[], type_arguments=None), name=sequenceNumbers)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=[], name=Pair, sub_type=None))], dimensions=[], name=Map, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sequenceNumbers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sequenceNumbers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=[], name=Pair, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), MemberReference(member=sequenceNumbers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=s_exportSequenceNumbers, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSiteProcedureConnection, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=getUSOForExportTable, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=usoAndSequenceNumber)], modifiers=set(), type=BasicType(dimensions=[None], name=long)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPartitionId, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=usoAndSequenceNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=usoAndSequenceNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Pair, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=sequenceNumbers, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTables, postfix_operators=[], prefix_operators=[], qualifier=database, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))), label=None) local_variable[type[TupleStreamStateInfo], drStateInfo] call[s_drTupleStreamInfo.put, parameter[call[context.getPartitionId, parameter[]], member[.drStateInfo]]] if[member[drStateInfo.containsReplicatedStreamInfo]] begin[{] call[s_drTupleStreamInfo.put, parameter[member[MpInitiator.MP_INIT_PID], member[.drStateInfo]]] else begin[{] None end[}] if[call[context.getSiteProcedureConnection, parameter[]]] begin[{] call[s_disabledStreams.add, parameter[call[context.getPartitionId, parameter[]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[populateExternalStreamsStatesFromSites] operator[SEP] identifier[SystemProcedureExecutionContext] identifier[context] operator[SEP] { identifier[Database] identifier[database] operator[=] identifier[context] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Table] identifier[t] operator[:] identifier[database] operator[SEP] identifier[getTables] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[CatalogUtil] operator[SEP] identifier[isTableExportOnly] operator[SEP] identifier[database] , identifier[t] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[Pair] operator[<] identifier[Long] , identifier[Long] operator[>] operator[>] identifier[sequenceNumbers] operator[=] identifier[s_exportSequenceNumbers] operator[SEP] identifier[get] operator[SEP] identifier[t] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sequenceNumbers] operator[==] Other[null] operator[SEP] { identifier[sequenceNumbers] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Integer] , identifier[Pair] operator[<] identifier[Long] , identifier[Long] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[s_exportSequenceNumbers] operator[SEP] identifier[put] operator[SEP] identifier[t] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] , identifier[sequenceNumbers] operator[SEP] operator[SEP] } Keyword[long] operator[SEP] operator[SEP] identifier[usoAndSequenceNumber] operator[=] identifier[context] operator[SEP] identifier[getSiteProcedureConnection] operator[SEP] operator[SEP] operator[SEP] identifier[getUSOForExportTable] operator[SEP] identifier[t] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sequenceNumbers] operator[SEP] identifier[put] operator[SEP] identifier[context] operator[SEP] identifier[getPartitionId] operator[SEP] operator[SEP] , identifier[Pair] operator[SEP] identifier[of] operator[SEP] identifier[usoAndSequenceNumber] operator[SEP] Other[0] operator[SEP] , identifier[usoAndSequenceNumber] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[TupleStreamStateInfo] identifier[drStateInfo] operator[=] identifier[context] operator[SEP] identifier[getSiteProcedureConnection] operator[SEP] operator[SEP] operator[SEP] identifier[getDRTupleStreamStateInfo] operator[SEP] operator[SEP] operator[SEP] identifier[s_drTupleStreamInfo] operator[SEP] identifier[put] operator[SEP] identifier[context] operator[SEP] identifier[getPartitionId] operator[SEP] operator[SEP] , identifier[drStateInfo] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[drStateInfo] operator[SEP] identifier[containsReplicatedStreamInfo] operator[SEP] { identifier[s_drTupleStreamInfo] operator[SEP] identifier[put] operator[SEP] identifier[MpInitiator] operator[SEP] identifier[MP_INIT_PID] , identifier[drStateInfo] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[context] operator[SEP] identifier[getSiteProcedureConnection] operator[SEP] operator[SEP] operator[SEP] identifier[externalStreamsEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[s_disabledStreams] operator[SEP] identifier[add] operator[SEP] identifier[context] operator[SEP] identifier[getPartitionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDefinedClass jclass, Schema currentSchema) { if (!ruleFactory.getGenerationConfig().isIncludeDynamicAccessors() || (!ruleFactory.getGenerationConfig().isIncludeDynamicSetters() && !ruleFactory.getGenerationConfig().isIncludeDynamicGetters() && !ruleFactory.getGenerationConfig().isIncludeDynamicBuilders())) { return jclass; } boolean isIncludeGetters = ruleFactory.getGenerationConfig().isIncludeGetters(); boolean isIncludeSetters = ruleFactory.getGenerationConfig().isIncludeSetters(); boolean isGenerateBuilders = ruleFactory.getGenerationConfig().isGenerateBuilders(); if (isIncludeGetters || isIncludeSetters || isGenerateBuilders) { if (LanguageFeatures.canUseJava7(ruleFactory.getGenerationConfig())) { if (isIncludeSetters) { addInternalSetMethodJava7(jclass, node); } if (isIncludeGetters) { addInternalGetMethodJava7(jclass, node); } } else { if (isIncludeSetters) { addInternalSetMethodJava6(jclass, node); } if (isIncludeGetters) { addInternalGetMethodJava6(jclass, node); } } } if (isIncludeGetters) { addGetMethods(jclass); } if (isIncludeSetters) { addSetMethods(jclass); } if (isGenerateBuilders) { addWithMethods(jclass); } return jclass; }
class class_name[name] begin[{] method[apply, return_type[type[JDefinedClass]], modifier[public], parameter[nodeName, node, parent, jclass, currentSchema]] begin[{] if[binary_operation[call[ruleFactory.getGenerationConfig, parameter[]], ||, binary_operation[binary_operation[call[ruleFactory.getGenerationConfig, parameter[]], &&, call[ruleFactory.getGenerationConfig, parameter[]]], &&, call[ruleFactory.getGenerationConfig, parameter[]]]]] begin[{] return[member[.jclass]] else begin[{] None end[}] local_variable[type[boolean], isIncludeGetters] local_variable[type[boolean], isIncludeSetters] local_variable[type[boolean], isGenerateBuilders] if[binary_operation[binary_operation[member[.isIncludeGetters], ||, member[.isIncludeSetters]], ||, member[.isGenerateBuilders]]] begin[{] if[call[LanguageFeatures.canUseJava7, parameter[call[ruleFactory.getGenerationConfig, parameter[]]]]] begin[{] if[member[.isIncludeSetters]] begin[{] call[.addInternalSetMethodJava7, parameter[member[.jclass], member[.node]]] else begin[{] None end[}] if[member[.isIncludeGetters]] begin[{] call[.addInternalGetMethodJava7, parameter[member[.jclass], member[.node]]] else begin[{] None end[}] else begin[{] if[member[.isIncludeSetters]] begin[{] call[.addInternalSetMethodJava6, parameter[member[.jclass], member[.node]]] else begin[{] None end[}] if[member[.isIncludeGetters]] begin[{] call[.addInternalGetMethodJava6, parameter[member[.jclass], member[.node]]] else begin[{] None end[}] end[}] else begin[{] None end[}] if[member[.isIncludeGetters]] begin[{] call[.addGetMethods, parameter[member[.jclass]]] else begin[{] None end[}] if[member[.isIncludeSetters]] begin[{] call[.addSetMethods, parameter[member[.jclass]]] else begin[{] None end[}] if[member[.isGenerateBuilders]] begin[{] call[.addWithMethods, parameter[member[.jclass]]] else begin[{] None end[}] return[member[.jclass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[JDefinedClass] identifier[apply] operator[SEP] identifier[String] identifier[nodeName] , identifier[JsonNode] identifier[node] , identifier[JsonNode] identifier[parent] , identifier[JDefinedClass] identifier[jclass] , identifier[Schema] identifier[currentSchema] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[ruleFactory] operator[SEP] identifier[getGenerationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[isIncludeDynamicAccessors] operator[SEP] operator[SEP] operator[||] operator[SEP] operator[!] identifier[ruleFactory] operator[SEP] identifier[getGenerationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[isIncludeDynamicSetters] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[ruleFactory] operator[SEP] identifier[getGenerationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[isIncludeDynamicGetters] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[ruleFactory] operator[SEP] identifier[getGenerationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[isIncludeDynamicBuilders] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[jclass] operator[SEP] } Keyword[boolean] identifier[isIncludeGetters] operator[=] identifier[ruleFactory] operator[SEP] identifier[getGenerationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[isIncludeGetters] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isIncludeSetters] operator[=] identifier[ruleFactory] operator[SEP] identifier[getGenerationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[isIncludeSetters] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isGenerateBuilders] operator[=] identifier[ruleFactory] operator[SEP] identifier[getGenerationConfig] operator[SEP] operator[SEP] operator[SEP] identifier[isGenerateBuilders] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isIncludeGetters] operator[||] identifier[isIncludeSetters] operator[||] identifier[isGenerateBuilders] operator[SEP] { Keyword[if] operator[SEP] identifier[LanguageFeatures] operator[SEP] identifier[canUseJava7] operator[SEP] identifier[ruleFactory] operator[SEP] identifier[getGenerationConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isIncludeSetters] operator[SEP] { identifier[addInternalSetMethodJava7] operator[SEP] identifier[jclass] , identifier[node] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isIncludeGetters] operator[SEP] { identifier[addInternalGetMethodJava7] operator[SEP] identifier[jclass] , identifier[node] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[isIncludeSetters] operator[SEP] { identifier[addInternalSetMethodJava6] operator[SEP] identifier[jclass] , identifier[node] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isIncludeGetters] operator[SEP] { identifier[addInternalGetMethodJava6] operator[SEP] identifier[jclass] , identifier[node] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[isIncludeGetters] operator[SEP] { identifier[addGetMethods] operator[SEP] identifier[jclass] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isIncludeSetters] operator[SEP] { identifier[addSetMethods] operator[SEP] identifier[jclass] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isGenerateBuilders] operator[SEP] { identifier[addWithMethods] operator[SEP] identifier[jclass] operator[SEP] operator[SEP] } Keyword[return] identifier[jclass] operator[SEP] }
public Committee detail(String id) throws OpenStatesException { return api.query(new MethodMap("committees", id), null, Committee.class); }
class class_name[name] begin[{] method[detail, return_type[type[Committee]], modifier[public], parameter[id]] begin[{] return[call[api.query, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="committees"), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MethodMap, sub_type=None)), literal[null], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Committee, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Committee] identifier[detail] operator[SEP] identifier[String] identifier[id] operator[SEP] Keyword[throws] identifier[OpenStatesException] { Keyword[return] identifier[api] operator[SEP] identifier[query] operator[SEP] Keyword[new] identifier[MethodMap] operator[SEP] literal[String] , identifier[id] operator[SEP] , Other[null] , identifier[Committee] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
private void cleanup_event_filters() { Enumeration keys = event_callback_map.keys(); while (keys.hasMoreElements()) { String name = (String) keys.nextElement(); EventCallBackStruct callback_struct = event_callback_map.get(name); if (callback_struct.consumer instanceof NotifdEventConsumer) { try { EventChannelStruct ec_struct = channel_map.get(callback_struct.channel_name); Filter filter = ec_struct.structuredProxyPushSupplier.get_filter(callback_struct.filter_id); ec_struct.structuredProxyPushSupplier.remove_filter(callback_struct.filter_id); filter.destroy(); } catch (FilterNotFound e) { // Do nothing } } } }
class class_name[name] begin[{] method[cleanup_event_filters, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[Enumeration], keys] while[call[keys.hasMoreElements, parameter[]]] begin[{] local_variable[type[String], name] local_variable[type[EventCallBackStruct], callback_struct] if[binary_operation[member[callback_struct.consumer], instanceof, type[NotifdEventConsumer]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=channel_name, postfix_operators=[], prefix_operators=[], qualifier=callback_struct, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=channel_map, selectors=[], type_arguments=None), name=ec_struct)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EventChannelStruct, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=filter_id, postfix_operators=[], prefix_operators=[], qualifier=callback_struct, selectors=[])], member=get_filter, postfix_operators=[], prefix_operators=[], qualifier=ec_struct.structuredProxyPushSupplier, selectors=[], type_arguments=None), name=filter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Filter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=filter_id, postfix_operators=[], prefix_operators=[], qualifier=callback_struct, selectors=[])], member=remove_filter, postfix_operators=[], prefix_operators=[], qualifier=ec_struct.structuredProxyPushSupplier, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=destroy, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FilterNotFound']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[cleanup_event_filters] operator[SEP] operator[SEP] { identifier[Enumeration] identifier[keys] operator[=] identifier[event_callback_map] operator[SEP] identifier[keys] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[keys] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[keys] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[EventCallBackStruct] identifier[callback_struct] operator[=] identifier[event_callback_map] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[callback_struct] operator[SEP] identifier[consumer] Keyword[instanceof] identifier[NotifdEventConsumer] operator[SEP] { Keyword[try] { identifier[EventChannelStruct] identifier[ec_struct] operator[=] identifier[channel_map] operator[SEP] identifier[get] operator[SEP] identifier[callback_struct] operator[SEP] identifier[channel_name] operator[SEP] operator[SEP] identifier[Filter] identifier[filter] operator[=] identifier[ec_struct] operator[SEP] identifier[structuredProxyPushSupplier] operator[SEP] identifier[get_filter] operator[SEP] identifier[callback_struct] operator[SEP] identifier[filter_id] operator[SEP] operator[SEP] identifier[ec_struct] operator[SEP] identifier[structuredProxyPushSupplier] operator[SEP] identifier[remove_filter] operator[SEP] identifier[callback_struct] operator[SEP] identifier[filter_id] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[destroy] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FilterNotFound] identifier[e] operator[SEP] { } } } }
protected void addChild(CHILD child) { Objects.requireNonNull(child, "child"); if (child.getParent() != this) { throw new IllegalArgumentException(child.toString()); } this.mutableChildList.add(child); }
class class_name[name] begin[{] method[addChild, return_type[void], modifier[protected], parameter[child]] begin[{] call[Objects.requireNonNull, parameter[member[.child], literal["child"]]] if[binary_operation[call[child.getParent, parameter[]], !=, THIS[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] THIS[member[None.mutableChildList]call[None.add, parameter[member[.child]]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[addChild] operator[SEP] identifier[CHILD] identifier[child] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[child] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[!=] Keyword[this] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[child] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[mutableChildList] operator[SEP] identifier[add] operator[SEP] identifier[child] operator[SEP] operator[SEP] }
@Override @SuppressWarnings("unchecked") public Class<W> getWritableClass() throws IOException { if (writable == null) { return null; } return (Class<W>) writable.getClass(); }
class class_name[name] begin[{] method[getWritableClass, return_type[type[Class]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.writable], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=writable, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=W, sub_type=None))], dimensions=[], name=Class, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Class] operator[<] identifier[W] operator[>] identifier[getWritableClass] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[writable] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] operator[SEP] identifier[Class] operator[<] identifier[W] operator[>] operator[SEP] identifier[writable] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("deprecation") @Bean public UserDetailsService userDetailsService() { InMemoryUserDetailsManager manager = new InMemoryUserDetailsManager(); manager.createUser(User.withDefaultPasswordEncoder().username("demo").password("demo").roles("ACTUATOR", "camunda-admin").build()); manager.createUser(User.withDefaultPasswordEncoder().username("john").password("john").roles("camunda-user").build()); return manager; }
class class_name[name] begin[{] method[userDetailsService, return_type[type[UserDetailsService]], modifier[public], parameter[]] begin[{] local_variable[type[InMemoryUserDetailsManager], manager] call[manager.createUser, parameter[call[User.withDefaultPasswordEncoder, parameter[]]]] call[manager.createUser, parameter[call[User.withDefaultPasswordEncoder, parameter[]]]] return[member[.manager]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Bean] Keyword[public] identifier[UserDetailsService] identifier[userDetailsService] operator[SEP] operator[SEP] { identifier[InMemoryUserDetailsManager] identifier[manager] operator[=] Keyword[new] identifier[InMemoryUserDetailsManager] operator[SEP] operator[SEP] operator[SEP] identifier[manager] operator[SEP] identifier[createUser] operator[SEP] identifier[User] operator[SEP] identifier[withDefaultPasswordEncoder] operator[SEP] operator[SEP] operator[SEP] identifier[username] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[password] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[roles] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[manager] operator[SEP] identifier[createUser] operator[SEP] identifier[User] operator[SEP] identifier[withDefaultPasswordEncoder] operator[SEP] operator[SEP] operator[SEP] identifier[username] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[password] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[roles] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[manager] operator[SEP] }
public Object fromStream(final String iStream) { if (iStream == null || iStream.length() == 0) // NULL VALUE return null; final OSerializableStream instance = new ODocument(); instance.fromStream(OBinaryProtocol.string2bytes(iStream)); return instance; }
class class_name[name] begin[{] method[fromStream, return_type[type[Object]], modifier[public], parameter[iStream]] begin[{] if[binary_operation[binary_operation[member[.iStream], ==, literal[null]], ||, binary_operation[call[iStream.length, parameter[]], ==, literal[0]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[OSerializableStream], instance] call[instance.fromStream, parameter[call[OBinaryProtocol.string2bytes, parameter[member[.iStream]]]]] return[member[.instance]] end[}] END[}]
Keyword[public] identifier[Object] identifier[fromStream] operator[SEP] Keyword[final] identifier[String] identifier[iStream] operator[SEP] { Keyword[if] operator[SEP] identifier[iStream] operator[==] Other[null] operator[||] identifier[iStream] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[final] identifier[OSerializableStream] identifier[instance] operator[=] Keyword[new] identifier[ODocument] operator[SEP] operator[SEP] operator[SEP] identifier[instance] operator[SEP] identifier[fromStream] operator[SEP] identifier[OBinaryProtocol] operator[SEP] identifier[string2bytes] operator[SEP] identifier[iStream] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[instance] operator[SEP] }
@SuppressWarnings("unchecked") public Map<Integer, Integer> getLinkedAdapterColumnsModifications() { return mAdapter instanceof LinkedAdaptiveTableAdapterImpl ? ((LinkedAdaptiveTableAdapterImpl) mAdapter).getColumnsModifications() : Collections.<Integer, Integer>emptyMap(); }
class class_name[name] begin[{] method[getLinkedAdapterColumnsModifications, return_type[type[Map]], modifier[public], parameter[]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=mAdapter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=LinkedAdaptiveTableAdapterImpl, sub_type=None), operator=instanceof), if_false=MethodInvocation(arguments=[], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))]), if_true=Cast(expression=MemberReference(member=mAdapter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LinkedAdaptiveTableAdapterImpl, sub_type=None)))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[getLinkedAdapterColumnsModifications] operator[SEP] operator[SEP] { Keyword[return] identifier[mAdapter] Keyword[instanceof] identifier[LinkedAdaptiveTableAdapterImpl] operator[?] operator[SEP] operator[SEP] identifier[LinkedAdaptiveTableAdapterImpl] operator[SEP] identifier[mAdapter] operator[SEP] operator[SEP] identifier[getColumnsModifications] operator[SEP] operator[SEP] operator[:] identifier[Collections] operator[SEP] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] }
public ObjectEndpoint export(Object server, Class<?> clazz) { // If clazz isn't specified than export all methods on a object if (clazz == null) { clazz = (Class<?>) server.getClass(); } for (Method m : clazz.getMethods()) { // Ignore all java.lang.Object methods if (Object.class.equals(m.getDeclaringClass())) { continue; } MethodEndpoint method = new MethodEndpoint(m, server, null, faultMapper, typeConverter); String name = method.getMethodName(); if (prefix != null) { name = prefix + "." + name; } if (methods.containsKey(name)) { throw new IllegalArgumentException("methods " + m + " and " + methods.get(name) + " are exported as " + name); } methods.put(name, method); } return this; }
class class_name[name] begin[{] method[export, return_type[type[ObjectEndpoint]], modifier[public], parameter[server, clazz]] begin[{] if[binary_operation[member[.clazz], ==, literal[null]]] begin[{] assign[member[.clazz], Cast(expression=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=server, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDeclaringClass, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=faultMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=typeConverter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MethodEndpoint, sub_type=None)), name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodEndpoint, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMethodName, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=methods, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="methods "), operandr=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" and "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=methods, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" are exported as "), operator=+), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=methods, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMethods, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ObjectEndpoint] identifier[export] operator[SEP] identifier[Object] identifier[server] , identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { Keyword[if] operator[SEP] identifier[clazz] operator[==] Other[null] operator[SEP] { identifier[clazz] operator[=] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[server] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Method] identifier[m] operator[:] identifier[clazz] operator[SEP] identifier[getMethods] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[m] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[MethodEndpoint] identifier[method] operator[=] Keyword[new] identifier[MethodEndpoint] operator[SEP] identifier[m] , identifier[server] , Other[null] , identifier[faultMapper] , identifier[typeConverter] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[method] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prefix] operator[!=] Other[null] operator[SEP] { identifier[name] operator[=] identifier[prefix] operator[+] literal[String] operator[+] identifier[name] operator[SEP] } Keyword[if] operator[SEP] identifier[methods] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[m] operator[+] literal[String] operator[+] identifier[methods] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[+] literal[String] operator[+] identifier[name] operator[SEP] operator[SEP] } identifier[methods] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[method] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void await(long delay, TimeUnit timeUnit, int expectedResumes) throws TimeoutException { try { if (failure == null) { synchronized (this) { int remaining = remainingResumes.addAndGet(expectedResumes); if (remaining > 0) circuit.open(); } if (delay == 0) circuit.await(); else if (!circuit.await(delay, timeUnit)) { final int actualResumes = expectedResumes - remainingResumes.get(); throw new TimeoutException(String.format(TIMEOUT_MESSAGE, expectedResumes, actualResumes)); } } } catch (InterruptedException e) { } finally { remainingResumes.set(0); circuit.open(); if (failure != null) { Throwable f = failure; failure = null; sneakyThrow(f); } } }
class class_name[name] begin[{] method[await, return_type[void], modifier[public], parameter[delay, timeUnit, expectedResumes]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=failure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[SynchronizedStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=expectedResumes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAndGet, postfix_operators=[], prefix_operators=[], qualifier=remainingResumes, selectors=[], type_arguments=None), name=remaining)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=remaining, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=open, postfix_operators=[], prefix_operators=[], qualifier=circuit, selectors=[], type_arguments=None), label=None))], label=None, lock=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=delay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=delay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=await, postfix_operators=[], prefix_operators=['!'], qualifier=circuit, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=expectedResumes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=remainingResumes, selectors=[], type_arguments=None), operator=-), name=actualResumes)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=TIMEOUT_MESSAGE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=expectedResumes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=actualResumes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimeoutException, sub_type=None)), label=None)])), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=await, postfix_operators=[], prefix_operators=[], qualifier=circuit, selectors=[], type_arguments=None), label=None))]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=set, postfix_operators=[], prefix_operators=[], qualifier=remainingResumes, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=open, postfix_operators=[], prefix_operators=[], qualifier=circuit, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=failure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=failure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=failure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sneakyThrow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[await] operator[SEP] Keyword[long] identifier[delay] , identifier[TimeUnit] identifier[timeUnit] , Keyword[int] identifier[expectedResumes] operator[SEP] Keyword[throws] identifier[TimeoutException] { Keyword[try] { Keyword[if] operator[SEP] identifier[failure] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[int] identifier[remaining] operator[=] identifier[remainingResumes] operator[SEP] identifier[addAndGet] operator[SEP] identifier[expectedResumes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[remaining] operator[>] Other[0] operator[SEP] identifier[circuit] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[delay] operator[==] Other[0] operator[SEP] identifier[circuit] operator[SEP] identifier[await] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[circuit] operator[SEP] identifier[await] operator[SEP] identifier[delay] , identifier[timeUnit] operator[SEP] operator[SEP] { Keyword[final] Keyword[int] identifier[actualResumes] operator[=] identifier[expectedResumes] operator[-] identifier[remainingResumes] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[TimeoutException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[TIMEOUT_MESSAGE] , identifier[expectedResumes] , identifier[actualResumes] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { } Keyword[finally] { identifier[remainingResumes] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[circuit] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[failure] operator[!=] Other[null] operator[SEP] { identifier[Throwable] identifier[f] operator[=] identifier[failure] operator[SEP] identifier[failure] operator[=] Other[null] operator[SEP] identifier[sneakyThrow] operator[SEP] identifier[f] operator[SEP] operator[SEP] } } }
public static List<String> toSentenceList(String content, boolean shortest) { return toSentenceList(content.toCharArray(), shortest); }
class class_name[name] begin[{] method[toSentenceList, return_type[type[List]], modifier[public static], parameter[content, shortest]] begin[{] return[call[.toSentenceList, parameter[call[content.toCharArray, parameter[]], member[.shortest]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[toSentenceList] operator[SEP] identifier[String] identifier[content] , Keyword[boolean] identifier[shortest] operator[SEP] { Keyword[return] identifier[toSentenceList] operator[SEP] identifier[content] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] , identifier[shortest] operator[SEP] operator[SEP] }
public TrieBuilder<T> addAll(Map<String, T> map) { for (Entry<String, T> entry : map.entrySet()) { add(entry.getKey(), entry.getValue()); } return this; }
class class_name[name] begin[{] method[addAll, return_type[type[TrieBuilder]], modifier[public], parameter[map]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[TrieBuilder] operator[<] identifier[T] operator[>] identifier[addAll] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[T] operator[>] identifier[map] operator[SEP] { Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[T] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[add] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public DescribeAccountAttributesResult withAccountQuotas(AccountQuota... accountQuotas) { if (this.accountQuotas == null) { setAccountQuotas(new java.util.ArrayList<AccountQuota>(accountQuotas.length)); } for (AccountQuota ele : accountQuotas) { this.accountQuotas.add(ele); } return this; }
class class_name[name] begin[{] method[withAccountQuotas, return_type[type[DescribeAccountAttributesResult]], modifier[public], parameter[accountQuotas]] begin[{] if[binary_operation[THIS[member[None.accountQuotas]], ==, literal[null]]] begin[{] call[.setAccountQuotas, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=accountQuotas, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AccountQuota, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=accountQuotas, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=accountQuotas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AccountQuota, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DescribeAccountAttributesResult] identifier[withAccountQuotas] operator[SEP] identifier[AccountQuota] operator[...] identifier[accountQuotas] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[accountQuotas] operator[==] Other[null] operator[SEP] { identifier[setAccountQuotas] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[AccountQuota] operator[>] operator[SEP] identifier[accountQuotas] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[AccountQuota] identifier[ele] operator[:] identifier[accountQuotas] operator[SEP] { Keyword[this] operator[SEP] identifier[accountQuotas] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static String nextDay(int day) { Calendar cal = Calendar.getInstance(); cal.setTime(now()); cal.add(Calendar.DAY_OF_YEAR, day); return format(DF_DATE, cal.getTime()); }
class class_name[name] begin[{] method[nextDay, return_type[type[String]], modifier[public static], parameter[day]] begin[{] local_variable[type[Calendar], cal] call[cal.setTime, parameter[call[.now, parameter[]]]] call[cal.add, parameter[member[Calendar.DAY_OF_YEAR], member[.day]]] return[call[.format, parameter[member[.DF_DATE], call[cal.getTime, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[nextDay] operator[SEP] Keyword[int] identifier[day] operator[SEP] { identifier[Calendar] identifier[cal] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[setTime] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[add] operator[SEP] identifier[Calendar] operator[SEP] identifier[DAY_OF_YEAR] , identifier[day] operator[SEP] operator[SEP] Keyword[return] identifier[format] operator[SEP] identifier[DF_DATE] , identifier[cal] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public KafkaEndpointBuilder consumerProperties(Map<String, Object> consumerProperties) { endpoint.getEndpointConfiguration().setConsumerProperties(consumerProperties); return this; }
class class_name[name] begin[{] method[consumerProperties, return_type[type[KafkaEndpointBuilder]], modifier[public], parameter[consumerProperties]] begin[{] call[endpoint.getEndpointConfiguration, parameter[]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[KafkaEndpointBuilder] identifier[consumerProperties] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[consumerProperties] operator[SEP] { identifier[endpoint] operator[SEP] identifier[getEndpointConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[setConsumerProperties] operator[SEP] identifier[consumerProperties] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private String getProductName(Connector raXml) { if (raXml != null && !XsdString.isNull(raXml.getEisType())) return raXml.getEisType().getValue(); return ""; }
class class_name[name] begin[{] method[getProductName, return_type[type[String]], modifier[private], parameter[raXml]] begin[{] if[binary_operation[binary_operation[member[.raXml], !=, literal[null]], &&, call[XsdString.isNull, parameter[call[raXml.getEisType, parameter[]]]]]] begin[{] return[call[raXml.getEisType, parameter[]]] else begin[{] None end[}] return[literal[""]] end[}] END[}]
Keyword[private] identifier[String] identifier[getProductName] operator[SEP] identifier[Connector] identifier[raXml] operator[SEP] { Keyword[if] operator[SEP] identifier[raXml] operator[!=] Other[null] operator[&&] operator[!] identifier[XsdString] operator[SEP] identifier[isNull] operator[SEP] identifier[raXml] operator[SEP] identifier[getEisType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[raXml] operator[SEP] identifier[getEisType] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] }
@Override public boolean apply(final URI uri) { String host = uri.getHost(); // BURL guarantees lower case. for (String suffix: suffixes) if (host.endsWith(suffix)) return true; return false; }
class class_name[name] begin[{] method[apply, return_type[type[boolean]], modifier[public], parameter[uri]] begin[{] local_variable[type[String], host] ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=suffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=host, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)), control=EnhancedForControl(iterable=MemberReference(member=suffixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=suffix)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[apply] operator[SEP] Keyword[final] identifier[URI] identifier[uri] operator[SEP] { identifier[String] identifier[host] operator[=] identifier[uri] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[suffix] operator[:] identifier[suffixes] operator[SEP] Keyword[if] operator[SEP] identifier[host] operator[SEP] identifier[endsWith] operator[SEP] identifier[suffix] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
protected String getAggregatorName(Map<String, String> configMap) { // trim leading and trailing '/' String alias = (String)configMap.get("alias"); //$NON-NLS-1$ while (alias.charAt(0) == '/') alias = alias.substring(1); while (alias.charAt(alias.length()-1) == '/') alias = alias.substring(0, alias.length()-1); return alias; }
class class_name[name] begin[{] method[getAggregatorName, return_type[type[String]], modifier[protected], parameter[configMap]] begin[{] local_variable[type[String], alias] while[binary_operation[call[alias.charAt, parameter[literal[0]]], ==, literal['/']]] begin[{] assign[member[.alias], call[alias.substring, parameter[literal[1]]]] end[}] while[binary_operation[call[alias.charAt, parameter[binary_operation[call[alias.length, parameter[]], -, literal[1]]]], ==, literal['/']]] begin[{] assign[member[.alias], call[alias.substring, parameter[literal[0], binary_operation[call[alias.length, parameter[]], -, literal[1]]]]] end[}] return[member[.alias]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getAggregatorName] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[configMap] operator[SEP] { identifier[String] identifier[alias] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[configMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[alias] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] identifier[alias] operator[=] identifier[alias] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[alias] operator[SEP] identifier[charAt] operator[SEP] identifier[alias] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] identifier[alias] operator[=] identifier[alias] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[alias] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[alias] operator[SEP] }
public static Annotation getAnnotatedChunk(List<CoreLabel> tokens, int tokenStartIndex, int tokenEndIndex, int totalTokenOffset, Class tokenChunkKey, Class tokenTextKey, Class tokenLabelKey) { Annotation chunk = getAnnotatedChunk(tokens, tokenStartIndex, tokenEndIndex, totalTokenOffset); annotateChunkText(chunk, tokenTextKey); annotateChunkTokens(chunk, tokenChunkKey, tokenLabelKey); return chunk; }
class class_name[name] begin[{] method[getAnnotatedChunk, return_type[type[Annotation]], modifier[public static], parameter[tokens, tokenStartIndex, tokenEndIndex, totalTokenOffset, tokenChunkKey, tokenTextKey, tokenLabelKey]] begin[{] local_variable[type[Annotation], chunk] call[.annotateChunkText, parameter[member[.chunk], member[.tokenTextKey]]] call[.annotateChunkTokens, parameter[member[.chunk], member[.tokenChunkKey], member[.tokenLabelKey]]] return[member[.chunk]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Annotation] identifier[getAnnotatedChunk] operator[SEP] identifier[List] operator[<] identifier[CoreLabel] operator[>] identifier[tokens] , Keyword[int] identifier[tokenStartIndex] , Keyword[int] identifier[tokenEndIndex] , Keyword[int] identifier[totalTokenOffset] , identifier[Class] identifier[tokenChunkKey] , identifier[Class] identifier[tokenTextKey] , identifier[Class] identifier[tokenLabelKey] operator[SEP] { identifier[Annotation] identifier[chunk] operator[=] identifier[getAnnotatedChunk] operator[SEP] identifier[tokens] , identifier[tokenStartIndex] , identifier[tokenEndIndex] , identifier[totalTokenOffset] operator[SEP] operator[SEP] identifier[annotateChunkText] operator[SEP] identifier[chunk] , identifier[tokenTextKey] operator[SEP] operator[SEP] identifier[annotateChunkTokens] operator[SEP] identifier[chunk] , identifier[tokenChunkKey] , identifier[tokenLabelKey] operator[SEP] operator[SEP] Keyword[return] identifier[chunk] operator[SEP] }
@BetaApi public final AggregatedListInstancesPagedResponse aggregatedListInstances(ProjectName project) { AggregatedListInstancesHttpRequest request = AggregatedListInstancesHttpRequest.newBuilder() .setProject(project == null ? null : project.toString()) .build(); return aggregatedListInstances(request); }
class class_name[name] begin[{] method[aggregatedListInstances, return_type[type[AggregatedListInstancesPagedResponse]], modifier[final public], parameter[project]] begin[{] local_variable[type[AggregatedListInstancesHttpRequest], request] return[call[.aggregatedListInstances, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[AggregatedListInstancesPagedResponse] identifier[aggregatedListInstances] operator[SEP] identifier[ProjectName] identifier[project] operator[SEP] { identifier[AggregatedListInstancesHttpRequest] identifier[request] operator[=] identifier[AggregatedListInstancesHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setProject] operator[SEP] identifier[project] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[project] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[aggregatedListInstances] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static void setText(EfficientCacheView cacheView, int viewId, @StringRes int resid) { View view = cacheView.findViewByIdEfficient(viewId); if (view instanceof TextView) { ((TextView) view).setText(resid); } }
class class_name[name] begin[{] method[setText, return_type[void], modifier[public static], parameter[cacheView, viewId, resid]] begin[{] local_variable[type[View], view] if[binary_operation[member[.view], instanceof, type[TextView]]] begin[{] Cast(expression=MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TextView, sub_type=None)) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setText] operator[SEP] identifier[EfficientCacheView] identifier[cacheView] , Keyword[int] identifier[viewId] , annotation[@] identifier[StringRes] Keyword[int] identifier[resid] operator[SEP] { identifier[View] identifier[view] operator[=] identifier[cacheView] operator[SEP] identifier[findViewByIdEfficient] operator[SEP] identifier[viewId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[view] Keyword[instanceof] identifier[TextView] operator[SEP] { operator[SEP] operator[SEP] identifier[TextView] operator[SEP] identifier[view] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[resid] operator[SEP] operator[SEP] } }
@NotNull public static <T> Collector<T, ?, List<T>> toUnmodifiableList() { return Collectors.collectingAndThen(Collectors.<T>toList(), new UnaryOperator<List<T>>() { @NotNull @Override public List<T> apply(@NotNull List<T> list) { Objects.requireNonNullElements(list); return Collections.unmodifiableList(list); } }); }
class class_name[name] begin[{] method[toUnmodifiableList, return_type[type[Collector]], modifier[public static], parameter[]] begin[{] return[call[Collectors.collectingAndThen, parameter[call[.Collectors, parameter[]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=NotNull), Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=requireNonNullElements, postfix_operators=[], prefix_operators=[], qualifier=Objects, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmodifiableList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[Annotation(element=None, name=NotNull)], modifiers=set(), name=list, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=List, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=List, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=UnaryOperator, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[NotNull] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Collector] operator[<] identifier[T] , operator[?] , identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[toUnmodifiableList] operator[SEP] operator[SEP] { Keyword[return] identifier[Collectors] operator[SEP] identifier[collectingAndThen] operator[SEP] identifier[Collectors] operator[SEP] operator[<] identifier[T] operator[>] identifier[toList] operator[SEP] operator[SEP] , Keyword[new] identifier[UnaryOperator] operator[<] identifier[List] operator[<] identifier[T] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[NotNull] annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[T] operator[>] identifier[apply] operator[SEP] annotation[@] identifier[NotNull] identifier[List] operator[<] identifier[T] operator[>] identifier[list] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNullElements] operator[SEP] identifier[list] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[list] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public long getLong(final int index, final ByteOrder byteOrder) { boundsCheck0(index, SIZE_OF_LONG); long bits = UNSAFE.getLong(byteArray, ARRAY_BASE_OFFSET + index); if (NATIVE_BYTE_ORDER != byteOrder) { bits = Long.reverseBytes(bits); } return bits; }
class class_name[name] begin[{] method[getLong, return_type[type[long]], modifier[public], parameter[index, byteOrder]] begin[{] call[.boundsCheck0, parameter[member[.index], member[.SIZE_OF_LONG]]] local_variable[type[long], bits] if[binary_operation[member[.NATIVE_BYTE_ORDER], !=, member[.byteOrder]]] begin[{] assign[member[.bits], call[Long.reverseBytes, parameter[member[.bits]]]] else begin[{] None end[}] return[member[.bits]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getLong] operator[SEP] Keyword[final] Keyword[int] identifier[index] , Keyword[final] identifier[ByteOrder] identifier[byteOrder] operator[SEP] { identifier[boundsCheck0] operator[SEP] identifier[index] , identifier[SIZE_OF_LONG] operator[SEP] operator[SEP] Keyword[long] identifier[bits] operator[=] identifier[UNSAFE] operator[SEP] identifier[getLong] operator[SEP] identifier[byteArray] , identifier[ARRAY_BASE_OFFSET] operator[+] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[NATIVE_BYTE_ORDER] operator[!=] identifier[byteOrder] operator[SEP] { identifier[bits] operator[=] identifier[Long] operator[SEP] identifier[reverseBytes] operator[SEP] identifier[bits] operator[SEP] operator[SEP] } Keyword[return] identifier[bits] operator[SEP] }
public List<VirtualMachineExtensionImageInner> listTypes(String location, String publisherName) { return listTypesWithServiceResponseAsync(location, publisherName).toBlocking().single().body(); }
class class_name[name] begin[{] method[listTypes, return_type[type[List]], modifier[public], parameter[location, publisherName]] begin[{] return[call[.listTypesWithServiceResponseAsync, parameter[member[.location], member[.publisherName]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[VirtualMachineExtensionImageInner] operator[>] identifier[listTypes] operator[SEP] identifier[String] identifier[location] , identifier[String] identifier[publisherName] operator[SEP] { Keyword[return] identifier[listTypesWithServiceResponseAsync] operator[SEP] identifier[location] , identifier[publisherName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public static TypeDescriptor array(TypeDescriptor elementTypeDescriptor) { if(elementTypeDescriptor == null) { return null; } Class<?> type = Array.newInstance(elementTypeDescriptor.getType(), 0).getClass(); return new TypeDescriptor(type, elementTypeDescriptor, null, null, elementTypeDescriptor.getAnnotations()); }
class class_name[name] begin[{] method[array, return_type[type[TypeDescriptor]], modifier[public static], parameter[elementTypeDescriptor]] begin[{] if[binary_operation[member[.elementTypeDescriptor], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Class], type] return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=elementTypeDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=getAnnotations, postfix_operators=[], prefix_operators=[], qualifier=elementTypeDescriptor, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TypeDescriptor, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[TypeDescriptor] identifier[array] operator[SEP] identifier[TypeDescriptor] identifier[elementTypeDescriptor] operator[SEP] { Keyword[if] operator[SEP] identifier[elementTypeDescriptor] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[elementTypeDescriptor] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , Other[0] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[TypeDescriptor] operator[SEP] identifier[type] , identifier[elementTypeDescriptor] , Other[null] , Other[null] , identifier[elementTypeDescriptor] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public List<Action> getTransientActions() { List<Action> actions = new ArrayList<>(); for (TransientUserActionFactory factory : TransientUserActionFactory.all()) { actions.addAll(factory.createFor(this)); } return Collections.unmodifiableList(actions); }
class class_name[name] begin[{] method[getTransientActions, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], actions] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=createFor, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=actions, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=all, postfix_operators=[], prefix_operators=[], qualifier=TransientUserActionFactory, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=factory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransientUserActionFactory, sub_type=None))), label=None) return[call[Collections.unmodifiableList, parameter[member[.actions]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Action] operator[>] identifier[getTransientActions] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Action] operator[>] identifier[actions] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TransientUserActionFactory] identifier[factory] operator[:] identifier[TransientUserActionFactory] operator[SEP] identifier[all] operator[SEP] operator[SEP] operator[SEP] { identifier[actions] operator[SEP] identifier[addAll] operator[SEP] identifier[factory] operator[SEP] identifier[createFor] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[actions] operator[SEP] operator[SEP] }
public Filter<T> equalTo(T value) { return new ComparableFilter<T>(this, value, Operator.EQUAL_TO); }
class class_name[name] begin[{] method[equalTo, return_type[type[Filter]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EQUAL_TO, postfix_operators=[], prefix_operators=[], qualifier=Operator, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=ComparableFilter, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Filter] operator[<] identifier[T] operator[>] identifier[equalTo] operator[SEP] identifier[T] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[ComparableFilter] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[value] , identifier[Operator] operator[SEP] identifier[EQUAL_TO] operator[SEP] operator[SEP] }
public Content getNavLinkNext() { Content li; if (next != null) { Content nextLink = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS, next) .label(nextclassLabel).strong(true)); li = HtmlTree.LI(nextLink); } else li = HtmlTree.LI(nextclassLabel); return li; }
class class_name[name] begin[{] method[getNavLinkNext, return_type[type[Content]], modifier[public], parameter[]] begin[{] local_variable[type[Content], li] if[binary_operation[member[.next], !=, literal[null]]] begin[{] local_variable[type[Content], nextLink] assign[member[.li], call[HtmlTree.LI, parameter[member[.nextLink]]]] else begin[{] assign[member[.li], call[HtmlTree.LI, parameter[member[.nextclassLabel]]]] end[}] return[member[.li]] end[}] END[}]
Keyword[public] identifier[Content] identifier[getNavLinkNext] operator[SEP] operator[SEP] { identifier[Content] identifier[li] operator[SEP] Keyword[if] operator[SEP] identifier[next] operator[!=] Other[null] operator[SEP] { identifier[Content] identifier[nextLink] operator[=] identifier[getLink] operator[SEP] Keyword[new] identifier[LinkInfoImpl] operator[SEP] identifier[configuration] , identifier[LinkInfoImpl] operator[SEP] identifier[Kind] operator[SEP] identifier[CLASS] , identifier[next] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[nextclassLabel] operator[SEP] operator[SEP] identifier[strong] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[li] operator[=] identifier[HtmlTree] operator[SEP] identifier[LI] operator[SEP] identifier[nextLink] operator[SEP] operator[SEP] } Keyword[else] identifier[li] operator[=] identifier[HtmlTree] operator[SEP] identifier[LI] operator[SEP] identifier[nextclassLabel] operator[SEP] operator[SEP] Keyword[return] identifier[li] operator[SEP] }
private EntityDecl expandUnresolvedEntity(String id) throws XMLStreamException { XMLResolver resolver = mConfig.getUndeclaredEntityResolver(); if (resolver != null) { /* Ok, we can check for recursion here; but let's only do that * if there is any chance that it might get resolved by * the special resolver (it must have been resolved this way * earlier, too...) */ if (mInput.isOrIsExpandedFrom(id)) { throwRecursionError(id); } WstxInputSource oldInput = mInput; oldInput.saveContext(this); // null, null -> no public or system ids int xmlVersion = mDocXmlVersion; // 05-Feb-2006, TSa: If xmlVersion not explicitly known, defaults to 1.0 if (xmlVersion == XmlConsts.XML_V_UNKNOWN) { xmlVersion = XmlConsts.XML_V_10; } WstxInputSource newInput; try { newInput = DefaultInputResolver.resolveEntityUsing (oldInput, id, null, null, resolver, mConfig, xmlVersion); if (mCfgTreatCharRefsAsEntities) { return new IntEntity(WstxInputLocation.getEmptyLocation(), newInput.getEntityId(), newInput.getSource(), new char[]{}, WstxInputLocation.getEmptyLocation()); } } catch (IOException ioe) { throw constructFromIOE(ioe); } if (newInput != null) { // true -> is external initInputSource(newInput, true, id); return null; } } handleUndeclaredEntity(id); return null; }
class class_name[name] begin[{] method[expandUnresolvedEntity, return_type[type[EntityDecl]], modifier[private], parameter[id]] begin[{] local_variable[type[XMLResolver], resolver] if[binary_operation[member[.resolver], !=, literal[null]]] begin[{] if[call[mInput.isOrIsExpandedFrom, parameter[member[.id]]]] begin[{] call[.throwRecursionError, parameter[member[.id]]] else begin[{] None end[}] local_variable[type[WstxInputSource], oldInput] call[oldInput.saveContext, parameter[THIS[]]] local_variable[type[int], xmlVersion] if[binary_operation[member[.xmlVersion], ==, member[XmlConsts.XML_V_UNKNOWN]]] begin[{] assign[member[.xmlVersion], member[XmlConsts.XML_V_10]] else begin[{] None end[}] local_variable[type[WstxInputSource], newInput] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=oldInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=resolver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xmlVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveEntityUsing, postfix_operators=[], prefix_operators=[], qualifier=DefaultInputResolver, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=mCfgTreatCharRefsAsEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getEmptyLocation, postfix_operators=[], prefix_operators=[], qualifier=WstxInputLocation, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getEntityId, postfix_operators=[], prefix_operators=[], qualifier=newInput, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSource, postfix_operators=[], prefix_operators=[], qualifier=newInput, selectors=[], type_arguments=None), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=char)), MethodInvocation(arguments=[], member=getEmptyLocation, postfix_operators=[], prefix_operators=[], qualifier=WstxInputLocation, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntEntity, sub_type=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=constructFromIOE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.newInput], !=, literal[null]]] begin[{] call[.initInputSource, parameter[member[.newInput], literal[true], member[.id]]] return[literal[null]] else begin[{] None end[}] else begin[{] None end[}] call[.handleUndeclaredEntity, parameter[member[.id]]] return[literal[null]] end[}] END[}]
Keyword[private] identifier[EntityDecl] identifier[expandUnresolvedEntity] operator[SEP] identifier[String] identifier[id] operator[SEP] Keyword[throws] identifier[XMLStreamException] { identifier[XMLResolver] identifier[resolver] operator[=] identifier[mConfig] operator[SEP] identifier[getUndeclaredEntityResolver] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resolver] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[mInput] operator[SEP] identifier[isOrIsExpandedFrom] operator[SEP] identifier[id] operator[SEP] operator[SEP] { identifier[throwRecursionError] operator[SEP] identifier[id] operator[SEP] operator[SEP] } identifier[WstxInputSource] identifier[oldInput] operator[=] identifier[mInput] operator[SEP] identifier[oldInput] operator[SEP] identifier[saveContext] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[int] identifier[xmlVersion] operator[=] identifier[mDocXmlVersion] operator[SEP] Keyword[if] operator[SEP] identifier[xmlVersion] operator[==] identifier[XmlConsts] operator[SEP] identifier[XML_V_UNKNOWN] operator[SEP] { identifier[xmlVersion] operator[=] identifier[XmlConsts] operator[SEP] identifier[XML_V_10] operator[SEP] } identifier[WstxInputSource] identifier[newInput] operator[SEP] Keyword[try] { identifier[newInput] operator[=] identifier[DefaultInputResolver] operator[SEP] identifier[resolveEntityUsing] operator[SEP] identifier[oldInput] , identifier[id] , Other[null] , Other[null] , identifier[resolver] , identifier[mConfig] , identifier[xmlVersion] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mCfgTreatCharRefsAsEntities] operator[SEP] { Keyword[return] Keyword[new] identifier[IntEntity] operator[SEP] identifier[WstxInputLocation] operator[SEP] identifier[getEmptyLocation] operator[SEP] operator[SEP] , identifier[newInput] operator[SEP] identifier[getEntityId] operator[SEP] operator[SEP] , identifier[newInput] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] , Keyword[new] Keyword[char] operator[SEP] operator[SEP] { } , identifier[WstxInputLocation] operator[SEP] identifier[getEmptyLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { Keyword[throw] identifier[constructFromIOE] operator[SEP] identifier[ioe] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[newInput] operator[!=] Other[null] operator[SEP] { identifier[initInputSource] operator[SEP] identifier[newInput] , literal[boolean] , identifier[id] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } identifier[handleUndeclaredEntity] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
@Override protected boolean changeDirection(int currentIndex, int centerIndex, boolean inBounds) { boolean changed = false; if (getGravityInternal() == Gravity.CENTER && currentIndex <= centerIndex && currentIndex == 0 || !inBounds) { changed = true; } return changed; }
class class_name[name] begin[{] method[changeDirection, return_type[type[boolean]], modifier[protected], parameter[currentIndex, centerIndex, inBounds]] begin[{] local_variable[type[boolean], changed] if[binary_operation[binary_operation[binary_operation[binary_operation[call[.getGravityInternal, parameter[]], ==, member[Gravity.CENTER]], &&, binary_operation[member[.currentIndex], <=, member[.centerIndex]]], &&, binary_operation[member[.currentIndex], ==, literal[0]]], ||, member[.inBounds]]] begin[{] assign[member[.changed], literal[true]] else begin[{] None end[}] return[member[.changed]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[changeDirection] operator[SEP] Keyword[int] identifier[currentIndex] , Keyword[int] identifier[centerIndex] , Keyword[boolean] identifier[inBounds] operator[SEP] { Keyword[boolean] identifier[changed] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[getGravityInternal] operator[SEP] operator[SEP] operator[==] identifier[Gravity] operator[SEP] identifier[CENTER] operator[&&] identifier[currentIndex] operator[<=] identifier[centerIndex] operator[&&] identifier[currentIndex] operator[==] Other[0] operator[||] operator[!] identifier[inBounds] operator[SEP] { identifier[changed] operator[=] literal[boolean] operator[SEP] } Keyword[return] identifier[changed] operator[SEP] }
@Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__OBJ_TYPE: setObjType(OBJ_TYPE_EDEFAULT); return; case AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__ARCH_VRSN: setArchVrsn(ARCH_VRSN_EDEFAULT); return; case AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__DCA_FN_SET: setDCAFnSet(DCA_FN_SET_EDEFAULT); return; case AfplibPackage.OBJECT_FUNCTION_SET_SPECIFICATION__OCA_FN_SET: setOCAFnSet(OCA_FN_SET_EDEFAULT); return; } super.eUnset(featureID); }
class class_name[name] begin[{] method[eUnset, return_type[void], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=OBJECT_FUNCTION_SET_SPECIFICATION__OBJ_TYPE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OBJ_TYPE_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setObjType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=OBJECT_FUNCTION_SET_SPECIFICATION__ARCH_VRSN, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ARCH_VRSN_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setArchVrsn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=OBJECT_FUNCTION_SET_SPECIFICATION__DCA_FN_SET, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DCA_FN_SET_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDCAFnSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=OBJECT_FUNCTION_SET_SPECIFICATION__OCA_FN_SET, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OCA_FN_SET_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOCAFnSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eUnset, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eUnset] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[OBJECT_FUNCTION_SET_SPECIFICATION__OBJ_TYPE] operator[:] identifier[setObjType] operator[SEP] identifier[OBJ_TYPE_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[OBJECT_FUNCTION_SET_SPECIFICATION__ARCH_VRSN] operator[:] identifier[setArchVrsn] operator[SEP] identifier[ARCH_VRSN_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[OBJECT_FUNCTION_SET_SPECIFICATION__DCA_FN_SET] operator[:] identifier[setDCAFnSet] operator[SEP] identifier[DCA_FN_SET_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[OBJECT_FUNCTION_SET_SPECIFICATION__OCA_FN_SET] operator[:] identifier[setOCAFnSet] operator[SEP] identifier[OCA_FN_SET_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eUnset] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
@HtmlSafe public String getStylesheetHtml() { Space space = gpUtil.getSpaceManager().getSpace(getSpaceKey()); return String.format("<style>\n%s\n</style>\n<base href=\"%s\"/>\n", StyleSheetExtractorFactory.getInstance().renderStyleSheet(space), gpUtil.getBaseUrl()); }
class class_name[name] begin[{] method[getStylesheetHtml, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[Space], space] return[call[String.format, parameter[literal["<style>\n%s\n</style>\n<base href=\"%s\"/>\n"], call[StyleSheetExtractorFactory.getInstance, parameter[]], call[gpUtil.getBaseUrl, parameter[]]]]] end[}] END[}]
annotation[@] identifier[HtmlSafe] Keyword[public] identifier[String] identifier[getStylesheetHtml] operator[SEP] operator[SEP] { identifier[Space] identifier[space] operator[=] identifier[gpUtil] operator[SEP] identifier[getSpaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getSpace] operator[SEP] identifier[getSpaceKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[StyleSheetExtractorFactory] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[renderStyleSheet] operator[SEP] identifier[space] operator[SEP] , identifier[gpUtil] operator[SEP] identifier[getBaseUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void addClinicalPrivateFields(Document document) throws JsonProcessingException, FileFormatException { if (collectionName.equals(CLINICAL_VARIANTS_COLLECTION)) { Document annotationDocument = (Document) document.get("annotation"); List<String> featureXrefs = getFeatureXrefsFromClinicalVariants(annotationDocument); if (!featureXrefs.isEmpty()) { document.put(PRIVATE_FEATURE_XREF_FIELD, featureXrefs); } List<String> traitList = getTraitFromClinicalVariants(annotationDocument); if (!featureXrefs.isEmpty()) { document.put(PRIVATE_TRAIT_FIELD, traitList); } } // // // // // if (clinicalVariantSource != null) { // List<String> geneIdList = null; // List<String> phenotypeList = null; // switch (clinicalVariantSource) { // case CLINVARVARIANTSOURCE: // geneIdList = getClinvarGeneIds(document); // phenotypeList = getClinvarPhenotypes(document); // break; // case COSMICVARIANTSOURCE: // geneIdList = document.get("geneName") != null ? Collections.singletonList(document.getString("geneName")) : null; // phenotypeList = getCosmicPhenotypes(document); // break; // case GWASVARIANTSOURCE: // geneIdList = document.get("reportedGenes") != null // ? Collections.singletonList(document.getString("reportedGenes")) // : null; // phenotypeList = getGwasPhenotypes(document); // break; // default: // break; // } // if (geneIdList != null) { // document.put("_geneIds", geneIdList); // } // if (phenotypeList != null) { // document.put("_phenotypes", phenotypeList); // } // } }
class class_name[name] begin[{] method[addClinicalPrivateFields, return_type[void], modifier[private], parameter[document]] begin[{] if[call[collectionName.equals, parameter[member[.CLINICAL_VARIANTS_COLLECTION]]]] begin[{] local_variable[type[Document], annotationDocument] local_variable[type[List], featureXrefs] if[call[featureXrefs.isEmpty, parameter[]]] begin[{] call[document.put, parameter[member[.PRIVATE_FEATURE_XREF_FIELD], member[.featureXrefs]]] else begin[{] None end[}] local_variable[type[List], traitList] if[call[featureXrefs.isEmpty, parameter[]]] begin[{] call[document.put, parameter[member[.PRIVATE_TRAIT_FIELD], member[.traitList]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addClinicalPrivateFields] operator[SEP] identifier[Document] identifier[document] operator[SEP] Keyword[throws] identifier[JsonProcessingException] , identifier[FileFormatException] { Keyword[if] operator[SEP] identifier[collectionName] operator[SEP] identifier[equals] operator[SEP] identifier[CLINICAL_VARIANTS_COLLECTION] operator[SEP] operator[SEP] { identifier[Document] identifier[annotationDocument] operator[=] operator[SEP] identifier[Document] operator[SEP] identifier[document] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[featureXrefs] operator[=] identifier[getFeatureXrefsFromClinicalVariants] operator[SEP] identifier[annotationDocument] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[featureXrefs] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[document] operator[SEP] identifier[put] operator[SEP] identifier[PRIVATE_FEATURE_XREF_FIELD] , identifier[featureXrefs] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[traitList] operator[=] identifier[getTraitFromClinicalVariants] operator[SEP] identifier[annotationDocument] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[featureXrefs] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[document] operator[SEP] identifier[put] operator[SEP] identifier[PRIVATE_TRAIT_FIELD] , identifier[traitList] operator[SEP] operator[SEP] } } }
public synchronized boolean cancel() { if (this.taskFuture != null && this.taskFuture.cancel(true)) { this.taskStateTracker.onTaskRunCompletion(this); this.completeShutdown(); return true; } else { return false; } }
class class_name[name] begin[{] method[cancel, return_type[type[boolean]], modifier[synchronized public], parameter[]] begin[{] if[binary_operation[binary_operation[THIS[member[None.taskFuture]], !=, literal[null]], &&, THIS[member[None.taskFuture]call[None.cancel, parameter[literal[true]]]]]] begin[{] THIS[member[None.taskStateTracker]call[None.onTaskRunCompletion, parameter[THIS[]]]] THIS[call[None.completeShutdown, parameter[]]] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[boolean] identifier[cancel] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[taskFuture] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[taskFuture] operator[SEP] identifier[cancel] operator[SEP] literal[boolean] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[taskStateTracker] operator[SEP] identifier[onTaskRunCompletion] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[completeShutdown] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
private AnimationListener createHeaderAnimationListener( @NonNull final WizardDialog wizardDialog) { return new AnimationListener() { @Override public void onAnimationStart() { } @Override public void onAnimationEnd() { int duration = getResources().getInteger(android.R.integer.config_shortAnimTime); BackgroundAnimation animation = new CrossFadeTransitionAnimation.Builder(getActivity()) .setDuration(duration).create(); wizardDialog.setHeaderBackground(R.drawable.dialog_header_background, animation); } }; }
class class_name[name] begin[{] method[createHeaderAnimationListener, return_type[type[AnimationListener]], modifier[private], parameter[wizardDialog]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[], documentation=None, modifiers={'public'}, name=onAnimationStart, parameters=[], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=config_shortAnimTime, postfix_operators=[], prefix_operators=[], qualifier=android.R.integer, selectors=[])], member=getInteger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=duration)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getActivity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=duration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDuration, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=create, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=CrossFadeTransitionAnimation, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None))), name=animation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BackgroundAnimation, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dialog_header_background, postfix_operators=[], prefix_operators=[], qualifier=R.drawable, selectors=[]), MemberReference(member=animation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHeaderBackground, postfix_operators=[], prefix_operators=[], qualifier=wizardDialog, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onAnimationEnd, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnimationListener, sub_type=None))] end[}] END[}]
Keyword[private] identifier[AnimationListener] identifier[createHeaderAnimationListener] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[WizardDialog] identifier[wizardDialog] operator[SEP] { Keyword[return] Keyword[new] identifier[AnimationListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onAnimationStart] operator[SEP] operator[SEP] { } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onAnimationEnd] operator[SEP] operator[SEP] { Keyword[int] identifier[duration] operator[=] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getInteger] operator[SEP] identifier[android] operator[SEP] identifier[R] operator[SEP] identifier[integer] operator[SEP] identifier[config_shortAnimTime] operator[SEP] operator[SEP] identifier[BackgroundAnimation] identifier[animation] operator[=] Keyword[new] identifier[CrossFadeTransitionAnimation] operator[SEP] identifier[Builder] operator[SEP] identifier[getActivity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setDuration] operator[SEP] identifier[duration] operator[SEP] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[wizardDialog] operator[SEP] identifier[setHeaderBackground] operator[SEP] identifier[R] operator[SEP] identifier[drawable] operator[SEP] identifier[dialog_header_background] , identifier[animation] operator[SEP] operator[SEP] } } operator[SEP] }
public void run(Runnable r) { Context previous = attach(); try { r.run(); } finally { detach(previous); } }
class class_name[name] begin[{] method[run, return_type[void], modifier[public], parameter[r]] begin[{] local_variable[type[Context], previous] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=previous, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=detach, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[run] operator[SEP] identifier[Runnable] identifier[r] operator[SEP] { identifier[Context] identifier[previous] operator[=] identifier[attach] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[r] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[detach] operator[SEP] identifier[previous] operator[SEP] operator[SEP] } }
@Override public void check() throws JMSException { if (destinationType == null) throw new InvalidDescriptorException("Missing destination reference property : 'destinationType'"); if (!destinationType.equals("queue") && !destinationType.equals("topic")) throw new InvalidDescriptorException("Destination reference property 'destinationType' should be one of : queue, topic"); if (destinationName == null) throw new InvalidDescriptorException("Missing destination reference property : 'destinationName'"); }
class class_name[name] begin[{] method[check, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.destinationType], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing destination reference property : 'destinationType'")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidDescriptorException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[call[destinationType.equals, parameter[literal["queue"]]], &&, call[destinationType.equals, parameter[literal["topic"]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination reference property 'destinationType' should be one of : queue, topic")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidDescriptorException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.destinationName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing destination reference property : 'destinationName'")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidDescriptorException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[check] operator[SEP] operator[SEP] Keyword[throws] identifier[JMSException] { Keyword[if] operator[SEP] identifier[destinationType] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[InvalidDescriptorException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[destinationType] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[destinationType] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InvalidDescriptorException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[destinationName] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[InvalidDescriptorException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
@Override public Collection<String> pauseTriggers(GroupMatcher<TriggerKey> matcher, JedisCluster jedis) throws JobPersistenceException { Set<String> pausedTriggerGroups = new HashSet<>(); if (matcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) { final String triggerGroupSetKey = redisSchema.triggerGroupSetKey(new TriggerKey("", matcher.getCompareToValue())); final long addResult = jedis.sadd(redisSchema.pausedTriggerGroupsSet(), triggerGroupSetKey); if (addResult > 0) { for (final String trigger : jedis.smembers(triggerGroupSetKey)) { pauseTrigger(redisSchema.triggerKey(trigger), jedis); } pausedTriggerGroups.add(redisSchema.triggerGroup(triggerGroupSetKey)); } } else { Map<String, Set<String>> triggerGroups = new HashMap<>(); for (final String triggerGroupSetKey : jedis.smembers(redisSchema.triggerGroupsSet())) { if (matcher.getCompareWithOperator().evaluate(redisSchema.triggerGroup(triggerGroupSetKey), matcher.getCompareToValue())) { triggerGroups.put(triggerGroupSetKey, jedis.smembers(triggerGroupSetKey)); } } for (final Map.Entry<String, Set<String>> entry : triggerGroups.entrySet()) { if (jedis.sadd(redisSchema.pausedJobGroupsSet(), entry.getKey()) > 0) { // This trigger group was not paused. Pause it now. pausedTriggerGroups.add(redisSchema.triggerGroup(entry.getKey())); for (final String triggerHashKey : entry.getValue()) { pauseTrigger(redisSchema.triggerKey(triggerHashKey), jedis); } } } } return pausedTriggerGroups; }
class class_name[name] begin[{] method[pauseTriggers, return_type[type[Collection]], modifier[public], parameter[matcher, jedis]] begin[{] local_variable[type[Set], pausedTriggerGroups] if[binary_operation[call[matcher.getCompareWithOperator, parameter[]], ==, member[StringMatcher.StringOperatorName.EQUALS]]] begin[{] local_variable[type[String], triggerGroupSetKey] local_variable[type[long], addResult] if[binary_operation[member[.addResult], >, literal[0]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=trigger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=triggerKey, postfix_operators=[], prefix_operators=[], qualifier=redisSchema, selectors=[], type_arguments=None), MemberReference(member=jedis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pauseTrigger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=triggerGroupSetKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=smembers, postfix_operators=[], prefix_operators=[], qualifier=jedis, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=trigger)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[pausedTriggerGroups.add, parameter[call[redisSchema.triggerGroup, parameter[member[.triggerGroupSetKey]]]]] else begin[{] None end[}] else begin[{] local_variable[type[Map], triggerGroups] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getCompareWithOperator, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=triggerGroupSetKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=triggerGroup, postfix_operators=[], prefix_operators=[], qualifier=redisSchema, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getCompareToValue, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None)], member=evaluate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=triggerGroupSetKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=triggerGroupSetKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=smembers, postfix_operators=[], prefix_operators=[], qualifier=jedis, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=triggerGroups, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=triggerGroupsSet, postfix_operators=[], prefix_operators=[], qualifier=redisSchema, selectors=[], type_arguments=None)], member=smembers, postfix_operators=[], prefix_operators=[], qualifier=jedis, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=triggerGroupSetKey)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=pausedJobGroupsSet, postfix_operators=[], prefix_operators=[], qualifier=redisSchema, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=sadd, postfix_operators=[], prefix_operators=[], qualifier=jedis, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=triggerGroup, postfix_operators=[], prefix_operators=[], qualifier=redisSchema, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=pausedTriggerGroups, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=triggerHashKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=triggerKey, postfix_operators=[], prefix_operators=[], qualifier=redisSchema, selectors=[], type_arguments=None), MemberReference(member=jedis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pauseTrigger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=triggerHashKey)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=triggerGroups, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] return[member[.pausedTriggerGroups]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Collection] operator[<] identifier[String] operator[>] identifier[pauseTriggers] operator[SEP] identifier[GroupMatcher] operator[<] identifier[TriggerKey] operator[>] identifier[matcher] , identifier[JedisCluster] identifier[jedis] operator[SEP] Keyword[throws] identifier[JobPersistenceException] { identifier[Set] operator[<] identifier[String] operator[>] identifier[pausedTriggerGroups] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[getCompareWithOperator] operator[SEP] operator[SEP] operator[==] identifier[StringMatcher] operator[SEP] identifier[StringOperatorName] operator[SEP] identifier[EQUALS] operator[SEP] { Keyword[final] identifier[String] identifier[triggerGroupSetKey] operator[=] identifier[redisSchema] operator[SEP] identifier[triggerGroupSetKey] operator[SEP] Keyword[new] identifier[TriggerKey] operator[SEP] literal[String] , identifier[matcher] operator[SEP] identifier[getCompareToValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[addResult] operator[=] identifier[jedis] operator[SEP] identifier[sadd] operator[SEP] identifier[redisSchema] operator[SEP] identifier[pausedTriggerGroupsSet] operator[SEP] operator[SEP] , identifier[triggerGroupSetKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[addResult] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[trigger] operator[:] identifier[jedis] operator[SEP] identifier[smembers] operator[SEP] identifier[triggerGroupSetKey] operator[SEP] operator[SEP] { identifier[pauseTrigger] operator[SEP] identifier[redisSchema] operator[SEP] identifier[triggerKey] operator[SEP] identifier[trigger] operator[SEP] , identifier[jedis] operator[SEP] operator[SEP] } identifier[pausedTriggerGroups] operator[SEP] identifier[add] operator[SEP] identifier[redisSchema] operator[SEP] identifier[triggerGroup] operator[SEP] identifier[triggerGroupSetKey] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[triggerGroups] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[triggerGroupSetKey] operator[:] identifier[jedis] operator[SEP] identifier[smembers] operator[SEP] identifier[redisSchema] operator[SEP] identifier[triggerGroupsSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[getCompareWithOperator] operator[SEP] operator[SEP] operator[SEP] identifier[evaluate] operator[SEP] identifier[redisSchema] operator[SEP] identifier[triggerGroup] operator[SEP] identifier[triggerGroupSetKey] operator[SEP] , identifier[matcher] operator[SEP] identifier[getCompareToValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[triggerGroups] operator[SEP] identifier[put] operator[SEP] identifier[triggerGroupSetKey] , identifier[jedis] operator[SEP] identifier[smembers] operator[SEP] identifier[triggerGroupSetKey] operator[SEP] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[triggerGroups] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[jedis] operator[SEP] identifier[sadd] operator[SEP] identifier[redisSchema] operator[SEP] identifier[pausedJobGroupsSet] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[pausedTriggerGroups] operator[SEP] identifier[add] operator[SEP] identifier[redisSchema] operator[SEP] identifier[triggerGroup] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[triggerHashKey] operator[:] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] { identifier[pauseTrigger] operator[SEP] identifier[redisSchema] operator[SEP] identifier[triggerKey] operator[SEP] identifier[triggerHashKey] operator[SEP] , identifier[jedis] operator[SEP] operator[SEP] } } } } Keyword[return] identifier[pausedTriggerGroups] operator[SEP] }
public final void parseSingleTableWithoutAlias(final SQLStatement sqlStatement) { int beginPosition = lexerEngine.getCurrentToken().getEndPosition() - lexerEngine.getCurrentToken().getLiterals().length(); String literals = lexerEngine.getCurrentToken().getLiterals(); int skippedSchemaNameLength = 0; lexerEngine.nextToken(); if (lexerEngine.skipIfEqual(Symbol.DOT)) { skippedSchemaNameLength = literals.length() + Symbol.DOT.getLiterals().length(); literals = lexerEngine.getCurrentToken().getLiterals(); lexerEngine.nextToken(); } sqlStatement.addSQLToken(new TableToken(beginPosition, literals, QuoteCharacter.getQuoteCharacter(literals), skippedSchemaNameLength)); sqlStatement.getTables().add(new Table(SQLUtil.getExactlyValue(literals), null)); }
class class_name[name] begin[{] method[parseSingleTableWithoutAlias, return_type[void], modifier[final public], parameter[sqlStatement]] begin[{] local_variable[type[int], beginPosition] local_variable[type[String], literals] local_variable[type[int], skippedSchemaNameLength] call[lexerEngine.nextToken, parameter[]] if[call[lexerEngine.skipIfEqual, parameter[member[Symbol.DOT]]]] begin[{] assign[member[.skippedSchemaNameLength], binary_operation[call[literals.length, parameter[]], +, call[Symbol.DOT.getLiterals, parameter[]]]] assign[member[.literals], call[lexerEngine.getCurrentToken, parameter[]]] call[lexerEngine.nextToken, parameter[]] else begin[{] None end[}] call[sqlStatement.addSQLToken, parameter[ClassCreator(arguments=[MemberReference(member=beginPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=literals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=literals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getQuoteCharacter, postfix_operators=[], prefix_operators=[], qualifier=QuoteCharacter, selectors=[], type_arguments=None), MemberReference(member=skippedSchemaNameLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TableToken, sub_type=None))]] call[sqlStatement.getTables, parameter[]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[parseSingleTableWithoutAlias] operator[SEP] Keyword[final] identifier[SQLStatement] identifier[sqlStatement] operator[SEP] { Keyword[int] identifier[beginPosition] operator[=] identifier[lexerEngine] operator[SEP] identifier[getCurrentToken] operator[SEP] operator[SEP] operator[SEP] identifier[getEndPosition] operator[SEP] operator[SEP] operator[-] identifier[lexerEngine] operator[SEP] identifier[getCurrentToken] operator[SEP] operator[SEP] operator[SEP] identifier[getLiterals] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[literals] operator[=] identifier[lexerEngine] operator[SEP] identifier[getCurrentToken] operator[SEP] operator[SEP] operator[SEP] identifier[getLiterals] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[skippedSchemaNameLength] operator[=] Other[0] operator[SEP] identifier[lexerEngine] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lexerEngine] operator[SEP] identifier[skipIfEqual] operator[SEP] identifier[Symbol] operator[SEP] identifier[DOT] operator[SEP] operator[SEP] { identifier[skippedSchemaNameLength] operator[=] identifier[literals] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] identifier[Symbol] operator[SEP] identifier[DOT] operator[SEP] identifier[getLiterals] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[literals] operator[=] identifier[lexerEngine] operator[SEP] identifier[getCurrentToken] operator[SEP] operator[SEP] operator[SEP] identifier[getLiterals] operator[SEP] operator[SEP] operator[SEP] identifier[lexerEngine] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } identifier[sqlStatement] operator[SEP] identifier[addSQLToken] operator[SEP] Keyword[new] identifier[TableToken] operator[SEP] identifier[beginPosition] , identifier[literals] , identifier[QuoteCharacter] operator[SEP] identifier[getQuoteCharacter] operator[SEP] identifier[literals] operator[SEP] , identifier[skippedSchemaNameLength] operator[SEP] operator[SEP] operator[SEP] identifier[sqlStatement] operator[SEP] identifier[getTables] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Table] operator[SEP] identifier[SQLUtil] operator[SEP] identifier[getExactlyValue] operator[SEP] identifier[literals] operator[SEP] , Other[null] operator[SEP] operator[SEP] operator[SEP] }
public static void prependSoSource(SoSource extraSoSource) throws IOException { sSoSourcesLock.writeLock().lock(); try { Log.d(TAG, "Prepending to SO sources: " + extraSoSource); assertInitialized(); extraSoSource.prepare(makePrepareFlags()); SoSource[] newSoSources = new SoSource[sSoSources.length + 1]; newSoSources[0] = extraSoSource; System.arraycopy(sSoSources, 0, newSoSources, 1, sSoSources.length); sSoSources = newSoSources; sSoSourcesVersion++; Log.d(TAG, "Prepended to SO sources: " + extraSoSource); } finally { sSoSourcesLock.writeLock().unlock(); } }
class class_name[name] begin[{] method[prependSoSource, return_type[void], modifier[public static], parameter[extraSoSource]] begin[{] call[sSoSourcesLock.writeLock, parameter[]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Prepending to SO sources: "), operandr=MemberReference(member=extraSoSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=d, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=assertInitialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=makePrepareFlags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=prepare, postfix_operators=[], prefix_operators=[], qualifier=extraSoSource, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=sSoSources, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SoSource, sub_type=None)), name=newSoSources)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=SoSource, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=newSoSources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MemberReference(member=extraSoSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sSoSources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=newSoSources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=sSoSources, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sSoSources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=newSoSources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MemberReference(member=sSoSourcesVersion, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Prepended to SO sources: "), operandr=MemberReference(member=extraSoSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=d, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=sSoSourcesLock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[prependSoSource] operator[SEP] identifier[SoSource] identifier[extraSoSource] operator[SEP] Keyword[throws] identifier[IOException] { identifier[sSoSourcesLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[extraSoSource] operator[SEP] operator[SEP] identifier[assertInitialized] operator[SEP] operator[SEP] operator[SEP] identifier[extraSoSource] operator[SEP] identifier[prepare] operator[SEP] identifier[makePrepareFlags] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SoSource] operator[SEP] operator[SEP] identifier[newSoSources] operator[=] Keyword[new] identifier[SoSource] operator[SEP] identifier[sSoSources] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] operator[SEP] identifier[newSoSources] operator[SEP] Other[0] operator[SEP] operator[=] identifier[extraSoSource] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[sSoSources] , Other[0] , identifier[newSoSources] , Other[1] , identifier[sSoSources] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[sSoSources] operator[=] identifier[newSoSources] operator[SEP] identifier[sSoSourcesVersion] operator[++] operator[SEP] identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[extraSoSource] operator[SEP] operator[SEP] } Keyword[finally] { identifier[sSoSourcesLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public static WorkQueue getWorkQueue(int numThreads) { if (singleton == null) { synchronized (WorkQueue.class) { if (singleton == null) singleton = new WorkQueue(numThreads); } } while (singleton.availableThreads() < numThreads) { singleton.addThread(); } return singleton; }
class class_name[name] begin[{] method[getWorkQueue, return_type[type[WorkQueue]], modifier[public static], parameter[numThreads]] begin[{] if[binary_operation[member[.singleton], ==, literal[null]]] begin[{] SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WorkQueue, sub_type=None))] BEGIN[{] if[binary_operation[member[.singleton], ==, literal[null]]] begin[{] assign[member[.singleton], ClassCreator(arguments=[MemberReference(member=numThreads, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WorkQueue, sub_type=None))] else begin[{] None end[}] END[}] else begin[{] None end[}] while[binary_operation[call[singleton.availableThreads, parameter[]], <, member[.numThreads]]] begin[{] call[singleton.addThread, parameter[]] end[}] return[member[.singleton]] end[}] END[}]
Keyword[public] Keyword[static] identifier[WorkQueue] identifier[getWorkQueue] operator[SEP] Keyword[int] identifier[numThreads] operator[SEP] { Keyword[if] operator[SEP] identifier[singleton] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[WorkQueue] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] identifier[singleton] operator[==] Other[null] operator[SEP] identifier[singleton] operator[=] Keyword[new] identifier[WorkQueue] operator[SEP] identifier[numThreads] operator[SEP] operator[SEP] } } Keyword[while] operator[SEP] identifier[singleton] operator[SEP] identifier[availableThreads] operator[SEP] operator[SEP] operator[<] identifier[numThreads] operator[SEP] { identifier[singleton] operator[SEP] identifier[addThread] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[singleton] operator[SEP] }
public static synchronized Cache getCache(final String cacheName) { LOGGER.log(Level.INFO, "Constructing cache [name={0}]....", cacheName); Cache ret = CACHES.get(cacheName); try { if (null == ret) { Class<Cache> cacheClass; switch (Latkes.getRuntimeCache()) { case LOCAL_LRU: cacheClass = (Class<Cache>) Class.forName("org.b3log.latke.cache.caffeine.CaffeineCache"); break; case REDIS: cacheClass = (Class<Cache>) Class.forName("org.b3log.latke.cache.redis.RedisCache"); break; case NONE: cacheClass = (Class<Cache>) Class.forName("org.b3log.latke.cache.NoneCache"); break; default: throw new RuntimeException("Latke runs in the hell.... Please set the environment correctly"); } ret = cacheClass.newInstance(); ret.setName(cacheName); CACHES.put(cacheName, ret); } } catch (final Exception e) { throw new RuntimeException("Can not get cache: " + e.getMessage(), e); } LOGGER.log(Level.INFO, "Constructed cache [name={0}, runtime={1}]", cacheName, Latkes.getRuntimeCache()); return ret; }
class class_name[name] begin[{] method[getCache, return_type[type[Cache]], modifier[synchronized public static], parameter[cacheName]] begin[{] call[LOGGER.log, parameter[member[Level.INFO], literal["Constructing cache [name={0}]...."], member[.cacheName]]] local_variable[type[Cache], ret] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=cacheClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Cache, sub_type=None))], dimensions=[], name=Class, sub_type=None)), SwitchStatement(cases=[SwitchStatementCase(case=['LOCAL_LRU'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cacheClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.b3log.latke.cache.caffeine.CaffeineCache")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Cache, sub_type=None))], dimensions=[], name=Class, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['REDIS'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cacheClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.b3log.latke.cache.redis.RedisCache")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Cache, sub_type=None))], dimensions=[], name=Class, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['NONE'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cacheClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.b3log.latke.cache.NoneCache")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Cache, sub_type=None))], dimensions=[], name=Class, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Latke runs in the hell.... Please set the environment correctly")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=getRuntimeCache, postfix_operators=[], prefix_operators=[], qualifier=Latkes, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=cacheClass, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cacheName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setName, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cacheName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=CACHES, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can not get cache: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) call[LOGGER.log, parameter[member[Level.INFO], literal["Constructed cache [name={0}, runtime={1}]"], member[.cacheName], call[Latkes.getRuntimeCache, parameter[]]]] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[synchronized] identifier[Cache] identifier[getCache] operator[SEP] Keyword[final] identifier[String] identifier[cacheName] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[INFO] , literal[String] , identifier[cacheName] operator[SEP] operator[SEP] identifier[Cache] identifier[ret] operator[=] identifier[CACHES] operator[SEP] identifier[get] operator[SEP] identifier[cacheName] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[ret] operator[SEP] { identifier[Class] operator[<] identifier[Cache] operator[>] identifier[cacheClass] operator[SEP] Keyword[switch] operator[SEP] identifier[Latkes] operator[SEP] identifier[getRuntimeCache] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[LOCAL_LRU] operator[:] identifier[cacheClass] operator[=] operator[SEP] identifier[Class] operator[<] identifier[Cache] operator[>] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[REDIS] operator[:] identifier[cacheClass] operator[=] operator[SEP] identifier[Class] operator[<] identifier[Cache] operator[>] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[NONE] operator[:] identifier[cacheClass] operator[=] operator[SEP] identifier[Class] operator[<] identifier[Cache] operator[>] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[ret] operator[=] identifier[cacheClass] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[setName] operator[SEP] identifier[cacheName] operator[SEP] operator[SEP] identifier[CACHES] operator[SEP] identifier[put] operator[SEP] identifier[cacheName] , identifier[ret] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[INFO] , literal[String] , identifier[cacheName] , identifier[Latkes] operator[SEP] identifier[getRuntimeCache] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
public int[] addPortMapping(PortmapProtocol t, int externalPort, int localPort) { port_mapping_t_vector v = s.add_port_mapping(portmap_protocol.swigToEnum(t.swig()), externalPort, localPort); int size = (int) v.size(); int[] arr = new int[size]; for (int i = 0; i < size; i++) { arr[i] = v.get(i); } return arr; }
class class_name[name] begin[{] method[addPortMapping, return_type[type[int]], modifier[public], parameter[t, externalPort, localPort]] begin[{] local_variable[type[port_mapping_t_vector], v] local_variable[type[int], size] local_variable[type[int], arr] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=arr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.arr]] end[}] END[}]
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[addPortMapping] operator[SEP] identifier[PortmapProtocol] identifier[t] , Keyword[int] identifier[externalPort] , Keyword[int] identifier[localPort] operator[SEP] { identifier[port_mapping_t_vector] identifier[v] operator[=] identifier[s] operator[SEP] identifier[add_port_mapping] operator[SEP] identifier[portmap_protocol] operator[SEP] identifier[swigToEnum] operator[SEP] identifier[t] operator[SEP] identifier[swig] operator[SEP] operator[SEP] operator[SEP] , identifier[externalPort] , identifier[localPort] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[v] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[arr] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[arr] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[v] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[arr] operator[SEP] }
public SoapMessage header(String headerName, Object headerValue) { return (SoapMessage) super.setHeader(headerName, headerValue); }
class class_name[name] begin[{] method[header, return_type[type[SoapMessage]], modifier[public], parameter[headerName, headerValue]] begin[{] return[Cast(expression=SuperMethodInvocation(arguments=[MemberReference(member=headerName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHeader, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SoapMessage, sub_type=None))] end[}] END[}]
Keyword[public] identifier[SoapMessage] identifier[header] operator[SEP] identifier[String] identifier[headerName] , identifier[Object] identifier[headerValue] operator[SEP] { Keyword[return] operator[SEP] identifier[SoapMessage] operator[SEP] Keyword[super] operator[SEP] identifier[setHeader] operator[SEP] identifier[headerName] , identifier[headerValue] operator[SEP] operator[SEP] }
@Override public void unregisterAdapterDataObserver(RecyclerView.AdapterDataObserver observer) { super.unregisterAdapterDataObserver(observer); if (mAdapter != null) { mAdapter.unregisterAdapterDataObserver(observer); } }
class class_name[name] begin[{] method[unregisterAdapterDataObserver, return_type[void], modifier[public], parameter[observer]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=observer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unregisterAdapterDataObserver, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) if[binary_operation[member[.mAdapter], !=, literal[null]]] begin[{] call[mAdapter.unregisterAdapterDataObserver, parameter[member[.observer]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[unregisterAdapterDataObserver] operator[SEP] identifier[RecyclerView] operator[SEP] identifier[AdapterDataObserver] identifier[observer] operator[SEP] { Keyword[super] operator[SEP] identifier[unregisterAdapterDataObserver] operator[SEP] identifier[observer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mAdapter] operator[!=] Other[null] operator[SEP] { identifier[mAdapter] operator[SEP] identifier[unregisterAdapterDataObserver] operator[SEP] identifier[observer] operator[SEP] operator[SEP] } }
public static String dirname(String path) { int index = path.lastIndexOf('/'); if (index == -1) return path; return path.substring(0, index + 1); }
class class_name[name] begin[{] method[dirname, return_type[type[String]], modifier[public static], parameter[path]] begin[{] local_variable[type[int], index] if[binary_operation[member[.index], ==, literal[1]]] begin[{] return[member[.path]] else begin[{] None end[}] return[call[path.substring, parameter[literal[0], binary_operation[member[.index], +, literal[1]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[dirname] operator[SEP] identifier[String] identifier[path] operator[SEP] { Keyword[int] identifier[index] operator[=] identifier[path] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] Keyword[return] identifier[path] operator[SEP] Keyword[return] identifier[path] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] }
public void initialize(UnitType unitType, double unitLength, Coordinate position) { if (null == unitType) { throw new IllegalArgumentException("please provide a unitType"); } this.unitType = unitType; this.unitLength = unitLength; backGround = new Rectangle((null == getId() ? "" : getId() + "-bg")); backGround.setBounds(new Bbox(0, 0, 5, MARKER_HEIGHT + 2 * VERTICAL_PADDING)); backGround.setStyle(STYLE_BACKGROUND); leftMarker = new Rectangle((null == getId() ? "" : getId() + "-lm")); leftMarker.setStyle(STYLE_MARKER); leftMarker.setBounds(new Bbox(0, 0, 1, MARKER_HEIGHT)); rightMarker = new Rectangle((null == getId() ? "" : getId() + "-rm")); rightMarker.setStyle(STYLE_MARKER); rightMarker.setBounds(new Bbox(0, 0, 1, MARKER_HEIGHT)); bottomLine = new Rectangle((null == getId() ? "" : getId() + "-bm")); bottomLine.setStyle(STYLE_MARKER); bottomLine.setBounds(new Bbox(0, 0, 0, 1)); distance = new Text((null == getId() ? "" : getId() + "-text")); distance.setStyle(STYLE_FONT); dummy = new Rectangle(getId() + "-dummy"); dummy.setStyle(new ShapeStyle("#FFFFFF", 0, "#FFFFFF", 0, 0)); dummy.setBounds(new Bbox(0, 0, 1, 1)); }
class class_name[name] begin[{] method[initialize, return_type[void], modifier[public], parameter[unitType, unitLength, position]] begin[{] if[binary_operation[literal[null], ==, member[.unitType]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="please provide a unitType")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] assign[THIS[member[None.unitType]], member[.unitType]] assign[THIS[member[None.unitLength]], member[.unitLength]] assign[member[.backGround], ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator===), if_false=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-bg"), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))] call[backGround.setBounds, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), BinaryOperation(operandl=MemberReference(member=MARKER_HEIGHT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operandr=MemberReference(member=VERTICAL_PADDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Bbox, sub_type=None))]] call[backGround.setStyle, parameter[member[.STYLE_BACKGROUND]]] assign[member[.leftMarker], ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator===), if_false=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-lm"), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))] call[leftMarker.setStyle, parameter[member[.STYLE_MARKER]]] call[leftMarker.setBounds, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=MARKER_HEIGHT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Bbox, sub_type=None))]] assign[member[.rightMarker], ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator===), if_false=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-rm"), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))] call[rightMarker.setStyle, parameter[member[.STYLE_MARKER]]] call[rightMarker.setBounds, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=MARKER_HEIGHT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Bbox, sub_type=None))]] assign[member[.bottomLine], ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator===), if_false=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-bm"), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))] call[bottomLine.setStyle, parameter[member[.STYLE_MARKER]]] call[bottomLine.setBounds, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Bbox, sub_type=None))]] assign[member[.distance], ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator===), if_false=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-text"), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Text, sub_type=None))] call[distance.setStyle, parameter[member[.STYLE_FONT]]] assign[member[.dummy], ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-dummy"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))] call[dummy.setStyle, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="#FFFFFF"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="#FFFFFF"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShapeStyle, sub_type=None))]] call[dummy.setBounds, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Bbox, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[initialize] operator[SEP] identifier[UnitType] identifier[unitType] , Keyword[double] identifier[unitLength] , identifier[Coordinate] identifier[position] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[unitType] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[unitType] operator[=] identifier[unitType] operator[SEP] Keyword[this] operator[SEP] identifier[unitLength] operator[=] identifier[unitLength] operator[SEP] identifier[backGround] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] operator[SEP] Other[null] operator[==] identifier[getId] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[backGround] operator[SEP] identifier[setBounds] operator[SEP] Keyword[new] identifier[Bbox] operator[SEP] Other[0] , Other[0] , Other[5] , identifier[MARKER_HEIGHT] operator[+] Other[2] operator[*] identifier[VERTICAL_PADDING] operator[SEP] operator[SEP] operator[SEP] identifier[backGround] operator[SEP] identifier[setStyle] operator[SEP] identifier[STYLE_BACKGROUND] operator[SEP] operator[SEP] identifier[leftMarker] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] operator[SEP] Other[null] operator[==] identifier[getId] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[leftMarker] operator[SEP] identifier[setStyle] operator[SEP] identifier[STYLE_MARKER] operator[SEP] operator[SEP] identifier[leftMarker] operator[SEP] identifier[setBounds] operator[SEP] Keyword[new] identifier[Bbox] operator[SEP] Other[0] , Other[0] , Other[1] , identifier[MARKER_HEIGHT] operator[SEP] operator[SEP] operator[SEP] identifier[rightMarker] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] operator[SEP] Other[null] operator[==] identifier[getId] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[rightMarker] operator[SEP] identifier[setStyle] operator[SEP] identifier[STYLE_MARKER] operator[SEP] operator[SEP] identifier[rightMarker] operator[SEP] identifier[setBounds] operator[SEP] Keyword[new] identifier[Bbox] operator[SEP] Other[0] , Other[0] , Other[1] , identifier[MARKER_HEIGHT] operator[SEP] operator[SEP] operator[SEP] identifier[bottomLine] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] operator[SEP] Other[null] operator[==] identifier[getId] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[bottomLine] operator[SEP] identifier[setStyle] operator[SEP] identifier[STYLE_MARKER] operator[SEP] operator[SEP] identifier[bottomLine] operator[SEP] identifier[setBounds] operator[SEP] Keyword[new] identifier[Bbox] operator[SEP] Other[0] , Other[0] , Other[0] , Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[distance] operator[=] Keyword[new] identifier[Text] operator[SEP] operator[SEP] Other[null] operator[==] identifier[getId] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[distance] operator[SEP] identifier[setStyle] operator[SEP] identifier[STYLE_FONT] operator[SEP] operator[SEP] identifier[dummy] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[dummy] operator[SEP] identifier[setStyle] operator[SEP] Keyword[new] identifier[ShapeStyle] operator[SEP] literal[String] , Other[0] , literal[String] , Other[0] , Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[dummy] operator[SEP] identifier[setBounds] operator[SEP] Keyword[new] identifier[Bbox] operator[SEP] Other[0] , Other[0] , Other[1] , Other[1] operator[SEP] operator[SEP] operator[SEP] }
public static int daysDiff(Date earlierDate, Date laterDate) { if (earlierDate == null || laterDate == null) { return 0; } return (int) ((laterDate.getTime() / DAY_MILLIS) - (earlierDate.getTime() / DAY_MILLIS)); }
class class_name[name] begin[{] method[daysDiff, return_type[type[int]], modifier[public static], parameter[earlierDate, laterDate]] begin[{] if[binary_operation[binary_operation[member[.earlierDate], ==, literal[null]], ||, binary_operation[member[.laterDate], ==, literal[null]]]] begin[{] return[literal[0]] else begin[{] None end[}] return[Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=laterDate, selectors=[], type_arguments=None), operandr=MemberReference(member=DAY_MILLIS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=earlierDate, selectors=[], type_arguments=None), operandr=MemberReference(member=DAY_MILLIS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operator=-), type=BasicType(dimensions=[], name=int))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[daysDiff] operator[SEP] identifier[Date] identifier[earlierDate] , identifier[Date] identifier[laterDate] operator[SEP] { Keyword[if] operator[SEP] identifier[earlierDate] operator[==] Other[null] operator[||] identifier[laterDate] operator[==] Other[null] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[return] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[laterDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[/] identifier[DAY_MILLIS] operator[SEP] operator[-] operator[SEP] identifier[earlierDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[/] identifier[DAY_MILLIS] operator[SEP] operator[SEP] operator[SEP] }
public static void logThreads(final Logger logger, final Level level, final String prefix) { logThreads(logger, level, prefix, "\n\t", "\n\t\t"); }
class class_name[name] begin[{] method[logThreads, return_type[void], modifier[public static], parameter[logger, level, prefix]] begin[{] call[.logThreads, parameter[member[.logger], member[.level], member[.prefix], literal["\n\t"], literal["\n\t\t"]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[logThreads] operator[SEP] Keyword[final] identifier[Logger] identifier[logger] , Keyword[final] identifier[Level] identifier[level] , Keyword[final] identifier[String] identifier[prefix] operator[SEP] { identifier[logThreads] operator[SEP] identifier[logger] , identifier[level] , identifier[prefix] , literal[String] , literal[String] operator[SEP] operator[SEP] }
private static void invertBuffer(char[] buffer, int start, int length) { for(int i = start, j = start + length - 1; i < j; i++, --j) { char temp = buffer[i]; buffer[i] = buffer[j]; buffer[j] = temp; } }
class class_name[name] begin[{] method[invertBuffer, return_type[void], modifier[private static], parameter[buffer, start, length]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=temp)], modifiers=set(), type=BasicType(dimensions=[], name=char)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i), VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[invertBuffer] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[buffer] , Keyword[int] identifier[start] , Keyword[int] identifier[length] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[start] , identifier[j] operator[=] identifier[start] operator[+] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[<] identifier[j] operator[SEP] identifier[i] operator[++] , operator[--] identifier[j] operator[SEP] { Keyword[char] identifier[temp] operator[=] identifier[buffer] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[buffer] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[temp] operator[SEP] } }
public static ALasDataManager getDataManager( File dataFile, GridCoverage2D inDem, double elevThreshold, CoordinateReferenceSystem inCrs ) { String lcName = dataFile.getName().toLowerCase(); if (lcName.endsWith(".las")) { return new LasFileDataManager(dataFile, inDem, elevThreshold, inCrs); } else if (lcName.equals(LasIndexer.INDEX_LASFOLDER)) { return new LasFolderIndexDataManager(dataFile, inDem, elevThreshold, inCrs); } else { try { EDb edb = EDb.fromFileDesktop(dataFile); if (edb != null && edb.isSpatial()) { return new DatabaseLasDataManager(dataFile, inDem, elevThreshold, inCrs); } } catch (Exception e) { // ignore, will be handled } throw new IllegalArgumentException("Can only read .las and " + LasIndexer.INDEX_LASFOLDER + " files."); } }
class class_name[name] begin[{] method[getDataManager, return_type[type[ALasDataManager]], modifier[public static], parameter[dataFile, inDem, elevThreshold, inCrs]] begin[{] local_variable[type[String], lcName] if[call[lcName.endsWith, parameter[literal[".las"]]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=dataFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inDem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=elevThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inCrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LasFileDataManager, sub_type=None))] else begin[{] if[call[lcName.equals, parameter[member[LasIndexer.INDEX_LASFOLDER]]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=dataFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inDem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=elevThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inCrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LasFolderIndexDataManager, sub_type=None))] else begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dataFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromFileDesktop, postfix_operators=[], prefix_operators=[], qualifier=EDb, selectors=[], type_arguments=None), name=edb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EDb, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=edb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isSpatial, postfix_operators=[], prefix_operators=[], qualifier=edb, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=dataFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inDem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=elevThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inCrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseLasDataManager, sub_type=None)), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can only read .las and "), operandr=MemberReference(member=INDEX_LASFOLDER, postfix_operators=[], prefix_operators=[], qualifier=LasIndexer, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" files."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[ALasDataManager] identifier[getDataManager] operator[SEP] identifier[File] identifier[dataFile] , identifier[GridCoverage2D] identifier[inDem] , Keyword[double] identifier[elevThreshold] , identifier[CoordinateReferenceSystem] identifier[inCrs] operator[SEP] { identifier[String] identifier[lcName] operator[=] identifier[dataFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lcName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[LasFileDataManager] operator[SEP] identifier[dataFile] , identifier[inDem] , identifier[elevThreshold] , identifier[inCrs] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[lcName] operator[SEP] identifier[equals] operator[SEP] identifier[LasIndexer] operator[SEP] identifier[INDEX_LASFOLDER] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[LasFolderIndexDataManager] operator[SEP] identifier[dataFile] , identifier[inDem] , identifier[elevThreshold] , identifier[inCrs] operator[SEP] operator[SEP] } Keyword[else] { Keyword[try] { identifier[EDb] identifier[edb] operator[=] identifier[EDb] operator[SEP] identifier[fromFileDesktop] operator[SEP] identifier[dataFile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[edb] operator[!=] Other[null] operator[&&] identifier[edb] operator[SEP] identifier[isSpatial] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[DatabaseLasDataManager] operator[SEP] identifier[dataFile] , identifier[inDem] , identifier[elevThreshold] , identifier[inCrs] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[LasIndexer] operator[SEP] identifier[INDEX_LASFOLDER] operator[+] literal[String] operator[SEP] operator[SEP] } }
public static Type[] typeLambdaReturnConstructor(Type.Callable[] types) { Type[] returnTypes = new Type[types.length]; for (int i = 0; i != types.length; ++i) { // NOTE: this is an implicit assumption that typeLambdaFilter() only ever // returns // lambda types with exactly one return type. returnTypes[i] = types[i].getReturns().get(0); } return returnTypes; }
class class_name[name] begin[{] method[typeLambdaReturnConstructor, return_type[type[Type]], modifier[public static], parameter[types]] begin[{] local_variable[type[Type], returnTypes] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=returnTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=types, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getReturns, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=types, selectors=[]), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[member[.returnTypes]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Type] operator[SEP] operator[SEP] identifier[typeLambdaReturnConstructor] operator[SEP] identifier[Type] operator[SEP] identifier[Callable] operator[SEP] operator[SEP] identifier[types] operator[SEP] { identifier[Type] operator[SEP] operator[SEP] identifier[returnTypes] operator[=] Keyword[new] identifier[Type] operator[SEP] identifier[types] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[!=] identifier[types] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[returnTypes] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[types] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getReturns] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[return] identifier[returnTypes] operator[SEP] }
public boolean notifySipContextListeners(SipContextEvent event) { if(logger.isDebugEnabled()) { logger.debug("notifySipContextListeners " + getName()); } boolean ok = true; if(logger.isDebugEnabled()) { logger.debug(childrenMap.size() + " container to notify of " + event.getEventType()); } if(event.getEventType() == SipContextEventType.SERVLET_INITIALIZED) { //fixes https://github.com/RestComm/sip-servlets/issues/165 //now the SipService is totally ready/started, we prepare //the context again just in case some att was not properly //initiated try { initInternalApplicationComponents(); } catch (Exception e) { logger.warn("Couldnt prepare context", e); } if(!timerService.isStarted()) { timerService.start(); } if(!proxyTimerService.isStarted()) { proxyTimerService.start(); } if(!sasTimerService.isStarted()) { sasTimerService.start(); } } if(this.available) { if(logger.isDebugEnabled()) { logger.debug("notifySipContextListeners - available " + getName()); } enterSipApp(null, null, false, true); boolean batchStarted = enterSipAppHa(true); // https://github.com/Mobicents/sip-servlets/issues/52 List<MobicentsSipServlet> sipServlets = new ArrayList<MobicentsSipServlet>(childrenMap.values()); Collections.sort(sipServlets, new SipServletLoadOnStartupComparator()); try { for (MobicentsSipServlet container : sipServlets) { if(logger.isDebugEnabled()) { logger.debug("container " + container.getName() + ", class : " + container.getClass().getName() + ", load-on-startup : " + container.getLoadOnStartup()); } if(container instanceof Wrapper) { Wrapper wrapper = (Wrapper) container; Servlet sipServlet = null; try { sipServlet = wrapper.allocate(); if(sipServlet instanceof SipServlet) { // Fix for issue 1086 (http://code.google.com/p/mobicents/issues/detail?id=1086) : // Cannot send a request in SipServletListener.initialize() for servlet-selection applications boolean servletHandlerWasNull = false; if(servletHandler == null) { servletHandler = container.getName(); servletHandlerWasNull = true; } final ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); try { final ClassLoader cl = getLoader().getClassLoader(); Thread.currentThread().setContextClassLoader(cl); // http://code.google.com/p/sipservlets/issues/detail?id=135 bindThreadBindingListener(); switch(event.getEventType()) { case SERVLET_INITIALIZED : { SipServletContextEvent sipServletContextEvent = new SipServletContextEvent(getServletContext(), (SipServlet)sipServlet); List<SipServletListener> sipServletListeners = sipListeners.getSipServletsListeners(); if(logger.isDebugEnabled()) { logger.debug(sipServletListeners.size() + " SipServletListener to notify of servlet initialization"); } for (SipServletListener sipServletListener : sipServletListeners) { sipServletListener.servletInitialized(sipServletContextEvent); } break; } case SIP_CONNECTOR_ADDED : { // reload the outbound interfaces if they have changed this.getServletContext().setAttribute(javax.servlet.sip.SipServlet.OUTBOUND_INTERFACES, sipApplicationDispatcher.getOutboundInterfaces()); // https://code.google.com/p/sipservlets/issues/detail?id=246 this.getServletContext().setAttribute("org.mobicents.servlet.sip.SIP_CONNECTORS", sipApplicationDispatcher.getSipService().findSipConnectors()); List<SipConnectorListener> sipConnectorListeners = sipListeners.getSipConnectorListeners(); if(logger.isDebugEnabled()) { logger.debug(sipConnectorListeners.size() + " SipConnectorListener to notify of sip connector addition"); } for (SipConnectorListener sipConnectorListener : sipConnectorListeners) { sipConnectorListener.sipConnectorAdded((SipConnector)event.getEventObject()); } break; } case SIP_CONNECTOR_REMOVED : { // reload the outbound interfaces if they have changed this.getServletContext().setAttribute(javax.servlet.sip.SipServlet.OUTBOUND_INTERFACES, sipApplicationDispatcher.getOutboundInterfaces()); // https://code.google.com/p/sipservlets/issues/detail?id=246 this.getServletContext().setAttribute("org.mobicents.servlet.sip.SIP_CONNECTORS", sipApplicationDispatcher.getSipService().findSipConnectors()); List<SipConnectorListener> sipConnectorListeners = sipListeners.getSipConnectorListeners(); if(logger.isDebugEnabled()) { logger.debug(sipConnectorListeners.size() + " SipConnectorListener to notify of sip connector removal"); } for (SipConnectorListener sipConnectorListener : sipConnectorListeners) { sipConnectorListener.sipConnectorRemoved((SipConnector)event.getEventObject()); } break; } } if(servletHandlerWasNull) { servletHandler = null; } } finally { // http://code.google.com/p/sipservlets/issues/detail?id=135 unbindThreadBindingListener(); Thread.currentThread().setContextClassLoader(oldClassLoader); } } } catch (ServletException e) { logger.error("Cannot allocate the servlet "+ wrapper.getServletClass() +" for notifying the listener " + " of the event " + event.getEventType(), e); ok = false; } catch (Throwable e) { logger.error("An error occured when notifying the servlet " + wrapper.getServletClass() + " of the event " + event.getEventType(), e); ok = false; } try { if(sipServlet != null) { wrapper.deallocate(sipServlet); } } catch (ServletException e) { logger.error("Deallocate exception for servlet" + wrapper.getName(), e); ok = false; } catch (Throwable e) { logger.error("Deallocate exception for servlet" + wrapper.getName(), e); ok = false; } } } } finally { exitSipAppHa(null, null, batchStarted); exitSipApp(null, null); } } return ok; }
class class_name[name] begin[{] method[notifySipContextListeners, return_type[type[boolean]], modifier[public], parameter[event]] begin[{] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[binary_operation[literal["notifySipContextListeners "], +, call[.getName, parameter[]]]]] else begin[{] None end[}] local_variable[type[boolean], ok] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[binary_operation[binary_operation[call[childrenMap.size, parameter[]], +, literal[" container to notify of "]], +, call[event.getEventType, parameter[]]]]] else begin[{] None end[}] if[binary_operation[call[event.getEventType, parameter[]], ==, member[SipContextEventType.SERVLET_INITIALIZED]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=initInternalApplicationComponents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldnt prepare context"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[call[timerService.isStarted, parameter[]]] begin[{] call[timerService.start, parameter[]] else begin[{] None end[}] if[call[proxyTimerService.isStarted, parameter[]]] begin[{] call[proxyTimerService.start, parameter[]] else begin[{] None end[}] if[call[sasTimerService.isStarted, parameter[]]] begin[{] call[sasTimerService.start, parameter[]] else begin[{] None end[}] else begin[{] None end[}] if[THIS[member[None.available]]] begin[{] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[binary_operation[literal["notifySipContextListeners - available "], +, call[.getName, parameter[]]]]] else begin[{] None end[}] call[.enterSipApp, parameter[literal[null], literal[null], literal[false], literal[true]]] local_variable[type[boolean], batchStarted] local_variable[type[List], sipServlets] call[Collections.sort, parameter[member[.sipServlets], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SipServletLoadOnStartupComparator, sub_type=None))]] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="container "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", class : "), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", load-on-startup : "), operator=+), operandr=MethodInvocation(arguments=[], member=getLoadOnStartup, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Wrapper, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Wrapper, sub_type=None)), name=wrapper)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Wrapper, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=sipServlet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Servlet, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sipServlet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=allocate, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sipServlet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SipServlet, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=servletHandlerWasNull)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=servletHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=servletHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=servletHandlerWasNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=getContextClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=oldClassLoader)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=cl)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[MemberReference(member=cl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContextClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=bindThreadBindingListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), SwitchStatement(cases=[SwitchStatementCase(case=['SERVLET_INITIALIZED'], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getServletContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=sipServlet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SipServlet, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SipServletContextEvent, sub_type=None)), name=sipServletContextEvent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SipServletContextEvent, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSipServletsListeners, postfix_operators=[], prefix_operators=[], qualifier=sipListeners, selectors=[], type_arguments=None), name=sipServletListeners)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SipServletListener, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=sipServletListeners, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" SipServletListener to notify of servlet initialization"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sipServletContextEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=servletInitialized, postfix_operators=[], prefix_operators=[], qualifier=sipServletListener, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sipServletListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sipServletListener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SipServletListener, sub_type=None))), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['SIP_CONNECTOR_ADDED'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getServletContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=OUTBOUND_INTERFACES, postfix_operators=[], prefix_operators=[], qualifier=javax.servlet.sip.SipServlet, selectors=[]), MethodInvocation(arguments=[], member=getOutboundInterfaces, postfix_operators=[], prefix_operators=[], qualifier=sipApplicationDispatcher, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getServletContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.mobicents.servlet.sip.SIP_CONNECTORS"), MethodInvocation(arguments=[], member=getSipService, postfix_operators=[], prefix_operators=[], qualifier=sipApplicationDispatcher, selectors=[MethodInvocation(arguments=[], member=findSipConnectors, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setAttribute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSipConnectorListeners, postfix_operators=[], prefix_operators=[], qualifier=sipListeners, selectors=[], type_arguments=None), name=sipConnectorListeners)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SipConnectorListener, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=sipConnectorListeners, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" SipConnectorListener to notify of sip connector addition"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getEventObject, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SipConnector, sub_type=None))], member=sipConnectorAdded, postfix_operators=[], prefix_operators=[], qualifier=sipConnectorListener, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sipConnectorListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sipConnectorListener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SipConnectorListener, sub_type=None))), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=['SIP_CONNECTOR_REMOVED'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getServletContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=OUTBOUND_INTERFACES, postfix_operators=[], prefix_operators=[], qualifier=javax.servlet.sip.SipServlet, selectors=[]), MethodInvocation(arguments=[], member=getOutboundInterfaces, postfix_operators=[], prefix_operators=[], qualifier=sipApplicationDispatcher, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getServletContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.mobicents.servlet.sip.SIP_CONNECTORS"), MethodInvocation(arguments=[], member=getSipService, postfix_operators=[], prefix_operators=[], qualifier=sipApplicationDispatcher, selectors=[MethodInvocation(arguments=[], member=findSipConnectors, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setAttribute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSipConnectorListeners, postfix_operators=[], prefix_operators=[], qualifier=sipListeners, selectors=[], type_arguments=None), name=sipConnectorListeners)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SipConnectorListener, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=sipConnectorListeners, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" SipConnectorListener to notify of sip connector removal"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getEventObject, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SipConnector, sub_type=None))], member=sipConnectorRemoved, postfix_operators=[], prefix_operators=[], qualifier=sipConnectorListener, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sipConnectorListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sipConnectorListener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SipConnectorListener, sub_type=None))), label=None), BreakStatement(goto=None, label=None)])])], expression=MethodInvocation(arguments=[], member=getEventType, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=servletHandlerWasNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=servletHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unbindThreadBindingListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[MemberReference(member=oldClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContextClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot allocate the servlet "), operandr=MethodInvocation(arguments=[], member=getServletClass, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for notifying the listener "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" of the event "), operator=+), operandr=MethodInvocation(arguments=[], member=getEventType, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ServletException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occured when notifying the servlet "), operandr=MethodInvocation(arguments=[], member=getServletClass, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" of the event "), operator=+), operandr=MethodInvocation(arguments=[], member=getEventType, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sipServlet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sipServlet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deallocate, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deallocate exception for servlet"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ServletException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deallocate exception for servlet"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=wrapper, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sipServlets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=container)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MobicentsSipServlet, sub_type=None))), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=batchStarted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exitSipAppHa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=exitSipApp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] return[member[.ok]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[notifySipContextListeners] operator[SEP] identifier[SipContextEvent] identifier[event] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[boolean] identifier[ok] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[childrenMap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[event] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] operator[==] identifier[SipContextEventType] operator[SEP] identifier[SERVLET_INITIALIZED] operator[SEP] { Keyword[try] { identifier[initInternalApplicationComponents] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[timerService] operator[SEP] identifier[isStarted] operator[SEP] operator[SEP] operator[SEP] { identifier[timerService] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[proxyTimerService] operator[SEP] identifier[isStarted] operator[SEP] operator[SEP] operator[SEP] { identifier[proxyTimerService] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[sasTimerService] operator[SEP] identifier[isStarted] operator[SEP] operator[SEP] operator[SEP] { identifier[sasTimerService] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[available] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[enterSipApp] operator[SEP] Other[null] , Other[null] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[boolean] identifier[batchStarted] operator[=] identifier[enterSipAppHa] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[MobicentsSipServlet] operator[>] identifier[sipServlets] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[MobicentsSipServlet] operator[>] operator[SEP] identifier[childrenMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[sipServlets] , Keyword[new] identifier[SipServletLoadOnStartupComparator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[MobicentsSipServlet] identifier[container] operator[:] identifier[sipServlets] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[container] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[container] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[container] operator[SEP] identifier[getLoadOnStartup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[container] Keyword[instanceof] identifier[Wrapper] operator[SEP] { identifier[Wrapper] identifier[wrapper] operator[=] operator[SEP] identifier[Wrapper] operator[SEP] identifier[container] operator[SEP] identifier[Servlet] identifier[sipServlet] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[sipServlet] operator[=] identifier[wrapper] operator[SEP] identifier[allocate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sipServlet] Keyword[instanceof] identifier[SipServlet] operator[SEP] { Keyword[boolean] identifier[servletHandlerWasNull] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[servletHandler] operator[==] Other[null] operator[SEP] { identifier[servletHandler] operator[=] identifier[container] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[servletHandlerWasNull] operator[=] literal[boolean] operator[SEP] } Keyword[final] identifier[ClassLoader] identifier[oldClassLoader] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[ClassLoader] identifier[cl] operator[=] identifier[getLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[setContextClassLoader] operator[SEP] identifier[cl] operator[SEP] operator[SEP] identifier[bindThreadBindingListener] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[event] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[SERVLET_INITIALIZED] operator[:] { identifier[SipServletContextEvent] identifier[sipServletContextEvent] operator[=] Keyword[new] identifier[SipServletContextEvent] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] , operator[SEP] identifier[SipServlet] operator[SEP] identifier[sipServlet] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[SipServletListener] operator[>] identifier[sipServletListeners] operator[=] identifier[sipListeners] operator[SEP] identifier[getSipServletsListeners] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[sipServletListeners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[SipServletListener] identifier[sipServletListener] operator[:] identifier[sipServletListeners] operator[SEP] { identifier[sipServletListener] operator[SEP] identifier[servletInitialized] operator[SEP] identifier[sipServletContextEvent] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } Keyword[case] identifier[SIP_CONNECTOR_ADDED] operator[:] { Keyword[this] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] identifier[javax] operator[SEP] identifier[servlet] operator[SEP] identifier[sip] operator[SEP] identifier[SipServlet] operator[SEP] identifier[OUTBOUND_INTERFACES] , identifier[sipApplicationDispatcher] operator[SEP] identifier[getOutboundInterfaces] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[sipApplicationDispatcher] operator[SEP] identifier[getSipService] operator[SEP] operator[SEP] operator[SEP] identifier[findSipConnectors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[SipConnectorListener] operator[>] identifier[sipConnectorListeners] operator[=] identifier[sipListeners] operator[SEP] identifier[getSipConnectorListeners] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[sipConnectorListeners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[SipConnectorListener] identifier[sipConnectorListener] operator[:] identifier[sipConnectorListeners] operator[SEP] { identifier[sipConnectorListener] operator[SEP] identifier[sipConnectorAdded] operator[SEP] operator[SEP] identifier[SipConnector] operator[SEP] identifier[event] operator[SEP] identifier[getEventObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } Keyword[case] identifier[SIP_CONNECTOR_REMOVED] operator[:] { Keyword[this] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] identifier[javax] operator[SEP] identifier[servlet] operator[SEP] identifier[sip] operator[SEP] identifier[SipServlet] operator[SEP] identifier[OUTBOUND_INTERFACES] , identifier[sipApplicationDispatcher] operator[SEP] identifier[getOutboundInterfaces] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[sipApplicationDispatcher] operator[SEP] identifier[getSipService] operator[SEP] operator[SEP] operator[SEP] identifier[findSipConnectors] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[SipConnectorListener] operator[>] identifier[sipConnectorListeners] operator[=] identifier[sipListeners] operator[SEP] identifier[getSipConnectorListeners] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[sipConnectorListeners] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[SipConnectorListener] identifier[sipConnectorListener] operator[:] identifier[sipConnectorListeners] operator[SEP] { identifier[sipConnectorListener] operator[SEP] identifier[sipConnectorRemoved] operator[SEP] operator[SEP] identifier[SipConnector] operator[SEP] identifier[event] operator[SEP] identifier[getEventObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[servletHandlerWasNull] operator[SEP] { identifier[servletHandler] operator[=] Other[null] operator[SEP] } } Keyword[finally] { identifier[unbindThreadBindingListener] operator[SEP] operator[SEP] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[setContextClassLoader] operator[SEP] identifier[oldClassLoader] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[ServletException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[wrapper] operator[SEP] identifier[getServletClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[event] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[ok] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[wrapper] operator[SEP] identifier[getServletClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[event] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[ok] operator[=] literal[boolean] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[sipServlet] operator[!=] Other[null] operator[SEP] { identifier[wrapper] operator[SEP] identifier[deallocate] operator[SEP] identifier[sipServlet] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[ServletException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[wrapper] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[ok] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[wrapper] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[ok] operator[=] literal[boolean] operator[SEP] } } } } Keyword[finally] { identifier[exitSipAppHa] operator[SEP] Other[null] , Other[null] , identifier[batchStarted] operator[SEP] operator[SEP] identifier[exitSipApp] operator[SEP] Other[null] , Other[null] operator[SEP] operator[SEP] } } Keyword[return] identifier[ok] operator[SEP] }
public void sessionDestroyed(HttpSessionEvent event) { HttpSessionDestroyedEvent e = new HttpSessionDestroyedEvent(event.getSession()); Log log = LogFactory.getLog(LOGGER_NAME); if (log.isDebugEnabled()) { log.debug("Publishing event: " + e); } getContext(event.getSession().getServletContext()).publishEvent(e); }
class class_name[name] begin[{] method[sessionDestroyed, return_type[void], modifier[public], parameter[event]] begin[{] local_variable[type[HttpSessionDestroyedEvent], e] local_variable[type[Log], log] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[literal["Publishing event: "], +, member[.e]]]] else begin[{] None end[}] call[.getContext, parameter[call[event.getSession, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[sessionDestroyed] operator[SEP] identifier[HttpSessionEvent] identifier[event] operator[SEP] { identifier[HttpSessionDestroyedEvent] identifier[e] operator[=] Keyword[new] identifier[HttpSessionDestroyedEvent] operator[SEP] identifier[event] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Log] identifier[log] operator[=] identifier[LogFactory] operator[SEP] identifier[getLog] operator[SEP] identifier[LOGGER_NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] operator[SEP] } identifier[getContext] operator[SEP] identifier[event] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[publishEvent] operator[SEP] identifier[e] operator[SEP] operator[SEP] }
public static String data(byte[] data, int offset, int length) { InputStream in = null; try { in = new ByteArrayInputStream(data, offset, length); return stream(in, length); } catch (IOException e) { e.printStackTrace(); } finally { if (in != null) { try { in.close(); } catch (Exception e) { e.printStackTrace(); } } } // never reach return null; }
class class_name[name] begin[{] method[data, return_type[type[String]], modifier[public static], parameter[data, offset, length]] begin[{] local_variable[type[InputStream], in] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[data] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] operator[SEP] { identifier[InputStream] identifier[in] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[in] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[data] , identifier[offset] , identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[stream] operator[SEP] identifier[in] , identifier[length] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[in] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
public static String replaceTabsWithSpaces(String text, int tabSize) { String tabText = ""; for (int i = 0; i < tabSize; i++) { tabText += " "; } return text.replaceAll("\t", " "); }
class class_name[name] begin[{] method[replaceTabsWithSpaces, return_type[type[String]], modifier[public static], parameter[text, tabSize]] begin[{] local_variable[type[String], tabText] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tabText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=tabSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[text.replaceAll, parameter[literal["\t"], literal[" "]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[replaceTabsWithSpaces] operator[SEP] identifier[String] identifier[text] , Keyword[int] identifier[tabSize] operator[SEP] { identifier[String] identifier[tabText] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[tabSize] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[tabText] operator[+=] literal[String] operator[SEP] } Keyword[return] identifier[text] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] }
private static JobVertexBackPressureInfo.VertexBackPressureLevel getBackPressureLevel(double backPressureRatio) { if (backPressureRatio <= 0.10) { return JobVertexBackPressureInfo.VertexBackPressureLevel.OK; } else if (backPressureRatio <= 0.5) { return JobVertexBackPressureInfo.VertexBackPressureLevel.LOW; } else { return JobVertexBackPressureInfo.VertexBackPressureLevel.HIGH; } }
class class_name[name] begin[{] method[getBackPressureLevel, return_type[type[JobVertexBackPressureInfo]], modifier[private static], parameter[backPressureRatio]] begin[{] if[binary_operation[member[.backPressureRatio], <=, literal[0.10]]] begin[{] return[member[JobVertexBackPressureInfo.VertexBackPressureLevel.OK]] else begin[{] if[binary_operation[member[.backPressureRatio], <=, literal[0.5]]] begin[{] return[member[JobVertexBackPressureInfo.VertexBackPressureLevel.LOW]] else begin[{] return[member[JobVertexBackPressureInfo.VertexBackPressureLevel.HIGH]] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[JobVertexBackPressureInfo] operator[SEP] identifier[VertexBackPressureLevel] identifier[getBackPressureLevel] operator[SEP] Keyword[double] identifier[backPressureRatio] operator[SEP] { Keyword[if] operator[SEP] identifier[backPressureRatio] operator[<=] literal[Float] operator[SEP] { Keyword[return] identifier[JobVertexBackPressureInfo] operator[SEP] identifier[VertexBackPressureLevel] operator[SEP] identifier[OK] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[backPressureRatio] operator[<=] literal[Float] operator[SEP] { Keyword[return] identifier[JobVertexBackPressureInfo] operator[SEP] identifier[VertexBackPressureLevel] operator[SEP] identifier[LOW] operator[SEP] } Keyword[else] { Keyword[return] identifier[JobVertexBackPressureInfo] operator[SEP] identifier[VertexBackPressureLevel] operator[SEP] identifier[HIGH] operator[SEP] } }
private static String getValueForId(int id, String fieldName, String namespace, Table table, Connection connection) throws SQLException { String tableName = String.join(".", namespace, table.name); String selectIdSql = String.format("select %s from %s where id = %d", fieldName, tableName, id); LOG.info(selectIdSql); Statement selectIdStatement = connection.createStatement(); ResultSet selectResults = selectIdStatement.executeQuery(selectIdSql); String value = null; while (selectResults.next()) { value = selectResults.getString(1); } return value; }
class class_name[name] begin[{] method[getValueForId, return_type[type[String]], modifier[private static], parameter[id, fieldName, namespace, table, connection]] begin[{] local_variable[type[String], tableName] local_variable[type[String], selectIdSql] call[LOG.info, parameter[member[.selectIdSql]]] local_variable[type[Statement], selectIdStatement] local_variable[type[ResultSet], selectResults] local_variable[type[String], value] while[call[selectResults.next, parameter[]]] begin[{] assign[member[.value], call[selectResults.getString, parameter[literal[1]]]] end[}] return[member[.value]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[getValueForId] operator[SEP] Keyword[int] identifier[id] , identifier[String] identifier[fieldName] , identifier[String] identifier[namespace] , identifier[Table] identifier[table] , identifier[Connection] identifier[connection] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[String] identifier[tableName] operator[=] identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[namespace] , identifier[table] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[String] identifier[selectIdSql] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[fieldName] , identifier[tableName] , identifier[id] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[selectIdSql] operator[SEP] operator[SEP] identifier[Statement] identifier[selectIdStatement] operator[=] identifier[connection] operator[SEP] identifier[createStatement] operator[SEP] operator[SEP] operator[SEP] identifier[ResultSet] identifier[selectResults] operator[=] identifier[selectIdStatement] operator[SEP] identifier[executeQuery] operator[SEP] identifier[selectIdSql] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[selectResults] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[selectResults] operator[SEP] identifier[getString] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
public String getDatabaseName(String databaseKey) { return getDatabaseProperties().get(databaseKey).getProperty(databaseKey + PROPKEY_NAME); }
class class_name[name] begin[{] method[getDatabaseName, return_type[type[String]], modifier[public], parameter[databaseKey]] begin[{] return[call[.getDatabaseProperties, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getDatabaseName] operator[SEP] identifier[String] identifier[databaseKey] operator[SEP] { Keyword[return] identifier[getDatabaseProperties] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[databaseKey] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[databaseKey] operator[+] identifier[PROPKEY_NAME] operator[SEP] operator[SEP] }
@Override public ICodeBaseLocator createNestedArchiveCodeBaseLocator(ICodeBase parentCodeBase, String path) { return new NestedZipFileCodeBaseLocator(parentCodeBase, path); }
class class_name[name] begin[{] method[createNestedArchiveCodeBaseLocator, return_type[type[ICodeBaseLocator]], modifier[public], parameter[parentCodeBase, path]] begin[{] return[ClassCreator(arguments=[MemberReference(member=parentCodeBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NestedZipFileCodeBaseLocator, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ICodeBaseLocator] identifier[createNestedArchiveCodeBaseLocator] operator[SEP] identifier[ICodeBase] identifier[parentCodeBase] , identifier[String] identifier[path] operator[SEP] { Keyword[return] Keyword[new] identifier[NestedZipFileCodeBaseLocator] operator[SEP] identifier[parentCodeBase] , identifier[path] operator[SEP] operator[SEP] }
void addLastEntry(Object entry) { if (multiple == null) { if (!single.equals(entry)) { multiple = new LinkedList<Object>(); multiple.addLast(single); multiple.addLast(entry); } } else { if (!multiple.contains(entry)) { multiple.addLast(entry); } } single = entry; }
class class_name[name] begin[{] method[addLastEntry, return_type[void], modifier[default], parameter[entry]] begin[{] if[binary_operation[member[.multiple], ==, literal[null]]] begin[{] if[call[single.equals, parameter[member[.entry]]]] begin[{] assign[member[.multiple], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))] call[multiple.addLast, parameter[member[.single]]] call[multiple.addLast, parameter[member[.entry]]] else begin[{] None end[}] else begin[{] if[call[multiple.contains, parameter[member[.entry]]]] begin[{] call[multiple.addLast, parameter[member[.entry]]] else begin[{] None end[}] end[}] assign[member[.single], member[.entry]] end[}] END[}]
Keyword[void] identifier[addLastEntry] operator[SEP] identifier[Object] identifier[entry] operator[SEP] { Keyword[if] operator[SEP] identifier[multiple] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[single] operator[SEP] identifier[equals] operator[SEP] identifier[entry] operator[SEP] operator[SEP] { identifier[multiple] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[multiple] operator[SEP] identifier[addLast] operator[SEP] identifier[single] operator[SEP] operator[SEP] identifier[multiple] operator[SEP] identifier[addLast] operator[SEP] identifier[entry] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[multiple] operator[SEP] identifier[contains] operator[SEP] identifier[entry] operator[SEP] operator[SEP] { identifier[multiple] operator[SEP] identifier[addLast] operator[SEP] identifier[entry] operator[SEP] operator[SEP] } } identifier[single] operator[=] identifier[entry] operator[SEP] }
private void checkOnClickListener(View view, AttributeSet attrs) { final Context context = view.getContext(); if (!(context instanceof ContextWrapper) || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1 && !ViewCompat.hasOnClickListeners(view))) { // Skip our compat functionality if: the Context isn't a ContextWrapper, or // the view doesn't have an OnClickListener (we can only rely on this on API 15+ so // always use our compat code on older devices) return; } final TypedArray a = context.obtainStyledAttributes(attrs, sOnClickAttrs); final String handlerName = a.getString(0); if (handlerName != null) { view.setOnClickListener(new DeclaredOnClickListener(view, handlerName)); } a.recycle(); }
class class_name[name] begin[{] method[checkOnClickListener, return_type[void], modifier[private], parameter[view, attrs]] begin[{] local_variable[type[Context], context] if[binary_operation[binary_operation[member[.context], instanceof, type[ContextWrapper]], ||, binary_operation[binary_operation[member[Build.VERSION.SDK_INT], >=, member[Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1]], &&, call[ViewCompat.hasOnClickListeners, parameter[member[.view]]]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[TypedArray], a] local_variable[type[String], handlerName] if[binary_operation[member[.handlerName], !=, literal[null]]] begin[{] call[view.setOnClickListener, parameter[ClassCreator(arguments=[MemberReference(member=view, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handlerName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DeclaredOnClickListener, sub_type=None))]] else begin[{] None end[}] call[a.recycle, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkOnClickListener] operator[SEP] identifier[View] identifier[view] , identifier[AttributeSet] identifier[attrs] operator[SEP] { Keyword[final] identifier[Context] identifier[context] operator[=] identifier[view] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[context] Keyword[instanceof] identifier[ContextWrapper] operator[SEP] operator[||] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[ICE_CREAM_SANDWICH_MR1] operator[&&] operator[!] identifier[ViewCompat] operator[SEP] identifier[hasOnClickListeners] operator[SEP] identifier[view] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[final] identifier[TypedArray] identifier[a] operator[=] identifier[context] operator[SEP] identifier[obtainStyledAttributes] operator[SEP] identifier[attrs] , identifier[sOnClickAttrs] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[handlerName] operator[=] identifier[a] operator[SEP] identifier[getString] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handlerName] operator[!=] Other[null] operator[SEP] { identifier[view] operator[SEP] identifier[setOnClickListener] operator[SEP] Keyword[new] identifier[DeclaredOnClickListener] operator[SEP] identifier[view] , identifier[handlerName] operator[SEP] operator[SEP] operator[SEP] } identifier[a] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] }
public void cleanup(){ synchronized (mBeanServer) { for (ObjectName beanName : beansNames) try { mBeanServer.unregisterMBean(beanName); } catch (InstanceNotFoundException ignored) { // Bean previously been unregistered } catch (MBeanRegistrationException e) { log.warn("Exception thrown while trying to clean up registered MBeans", e); } } }
class class_name[name] begin[{] method[cleanup, return_type[void], modifier[public], parameter[]] begin[{] SYNCHRONIZED[member[.mBeanServer]] BEGIN[{] ForStatement(body=TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=beanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unregisterMBean, postfix_operators=[], prefix_operators=[], qualifier=mBeanServer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['InstanceNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception thrown while trying to clean up registered MBeans"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MBeanRegistrationException']))], finally_block=None, label=None, resources=None), control=EnhancedForControl(iterable=MemberReference(member=beansNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=beanName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectName, sub_type=None))), label=None) END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[cleanup] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[mBeanServer] operator[SEP] { Keyword[for] operator[SEP] identifier[ObjectName] identifier[beanName] operator[:] identifier[beansNames] operator[SEP] Keyword[try] { identifier[mBeanServer] operator[SEP] identifier[unregisterMBean] operator[SEP] identifier[beanName] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InstanceNotFoundException] identifier[ignored] operator[SEP] { } Keyword[catch] operator[SEP] identifier[MBeanRegistrationException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } }
public static String[] createScriptArgs( final Map<String, Map<String, String>> localDataContext, final INodeEntry node, final String scriptargs, final String[] scriptargsarr, final String scriptinterpreter, final boolean interpreterargsquoted, final String filepath ) { final ArrayList<String> arglist = new ArrayList<String>(); if (null != scriptinterpreter) { List<String> c = Arrays.asList( DataContextUtils.replaceDataReferencesInArray( OptsUtil.burst(scriptinterpreter), localDataContext, null, false, true )); arglist.addAll(c); } if (null != scriptinterpreter && interpreterargsquoted) { final ArrayList<String> sublist = new ArrayList<String>(); if (filepath != null) { sublist.add(filepath); } addQuotedArgs(localDataContext, node, scriptargs, scriptargsarr, sublist, true); arglist.add(DataContextUtils.join(sublist, " ")); } else { if (filepath != null) { arglist.add(filepath); } addQuotedArgs(localDataContext, node, scriptargs, scriptargsarr, arglist, false); } return arglist.toArray(new String[arglist.size()]); }
class class_name[name] begin[{] method[createScriptArgs, return_type[type[String]], modifier[public static], parameter[localDataContext, node, scriptargs, scriptargsarr, scriptinterpreter, interpreterargsquoted, filepath]] begin[{] local_variable[type[ArrayList], arglist] if[binary_operation[literal[null], !=, member[.scriptinterpreter]]] begin[{] local_variable[type[List], c] call[arglist.addAll, parameter[member[.c]]] else begin[{] None end[}] if[binary_operation[binary_operation[literal[null], !=, member[.scriptinterpreter]], &&, member[.interpreterargsquoted]]] begin[{] local_variable[type[ArrayList], sublist] if[binary_operation[member[.filepath], !=, literal[null]]] begin[{] call[sublist.add, parameter[member[.filepath]]] else begin[{] None end[}] call[.addQuotedArgs, parameter[member[.localDataContext], member[.node], member[.scriptargs], member[.scriptargsarr], member[.sublist], literal[true]]] call[arglist.add, parameter[call[DataContextUtils.join, parameter[member[.sublist], literal[" "]]]]] else begin[{] if[binary_operation[member[.filepath], !=, literal[null]]] begin[{] call[arglist.add, parameter[member[.filepath]]] else begin[{] None end[}] call[.addQuotedArgs, parameter[member[.localDataContext], member[.node], member[.scriptargs], member[.scriptargsarr], member[.arglist], literal[false]]] end[}] return[call[arglist.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=arglist, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[createScriptArgs] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[localDataContext] , Keyword[final] identifier[INodeEntry] identifier[node] , Keyword[final] identifier[String] identifier[scriptargs] , Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[scriptargsarr] , Keyword[final] identifier[String] identifier[scriptinterpreter] , Keyword[final] Keyword[boolean] identifier[interpreterargsquoted] , Keyword[final] identifier[String] identifier[filepath] operator[SEP] { Keyword[final] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[arglist] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[scriptinterpreter] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[c] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[DataContextUtils] operator[SEP] identifier[replaceDataReferencesInArray] operator[SEP] identifier[OptsUtil] operator[SEP] identifier[burst] operator[SEP] identifier[scriptinterpreter] operator[SEP] , identifier[localDataContext] , Other[null] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[arglist] operator[SEP] identifier[addAll] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Other[null] operator[!=] identifier[scriptinterpreter] operator[&&] identifier[interpreterargsquoted] operator[SEP] { Keyword[final] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[sublist] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filepath] operator[!=] Other[null] operator[SEP] { identifier[sublist] operator[SEP] identifier[add] operator[SEP] identifier[filepath] operator[SEP] operator[SEP] } identifier[addQuotedArgs] operator[SEP] identifier[localDataContext] , identifier[node] , identifier[scriptargs] , identifier[scriptargsarr] , identifier[sublist] , literal[boolean] operator[SEP] operator[SEP] identifier[arglist] operator[SEP] identifier[add] operator[SEP] identifier[DataContextUtils] operator[SEP] identifier[join] operator[SEP] identifier[sublist] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[filepath] operator[!=] Other[null] operator[SEP] { identifier[arglist] operator[SEP] identifier[add] operator[SEP] identifier[filepath] operator[SEP] operator[SEP] } identifier[addQuotedArgs] operator[SEP] identifier[localDataContext] , identifier[node] , identifier[scriptargs] , identifier[scriptargsarr] , identifier[arglist] , literal[boolean] operator[SEP] operator[SEP] } Keyword[return] identifier[arglist] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[arglist] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void loadState(final Graph graph, final Configuration configuration) { // load selected types configuration.subset(PREFIX_SELECTED_TYPE_KEY).getKeys().forEachRemaining(key -> selectedTypes.add((LabelId) configuration.getProperty(PREFIX_SELECTED_TYPE_KEY + "." + key))); // load user specified properties configuration.subset(PREFIX_PERSISTENT_PROPERTIES).getKeys().forEachRemaining(key -> persistentProperties.put(key, configuration.getProperty(PREFIX_PERSISTENT_PROPERTIES + "." + key))); }
class class_name[name] begin[{] method[loadState, return_type[void], modifier[public], parameter[graph, configuration]] begin[{] call[configuration.subset, parameter[member[.PREFIX_SELECTED_TYPE_KEY]]] call[configuration.subset, parameter[member[.PREFIX_PERSISTENT_PROPERTIES]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[loadState] operator[SEP] Keyword[final] identifier[Graph] identifier[graph] , Keyword[final] identifier[Configuration] identifier[configuration] operator[SEP] { identifier[configuration] operator[SEP] identifier[subset] operator[SEP] identifier[PREFIX_SELECTED_TYPE_KEY] operator[SEP] operator[SEP] identifier[getKeys] operator[SEP] operator[SEP] operator[SEP] identifier[forEachRemaining] operator[SEP] identifier[key] operator[->] identifier[selectedTypes] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[LabelId] operator[SEP] identifier[configuration] operator[SEP] identifier[getProperty] operator[SEP] identifier[PREFIX_SELECTED_TYPE_KEY] operator[+] literal[String] operator[+] identifier[key] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[configuration] operator[SEP] identifier[subset] operator[SEP] identifier[PREFIX_PERSISTENT_PROPERTIES] operator[SEP] operator[SEP] identifier[getKeys] operator[SEP] operator[SEP] operator[SEP] identifier[forEachRemaining] operator[SEP] identifier[key] operator[->] identifier[persistentProperties] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[configuration] operator[SEP] identifier[getProperty] operator[SEP] identifier[PREFIX_PERSISTENT_PROPERTIES] operator[+] literal[String] operator[+] identifier[key] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public long writeData(final InputStream data) throws IOException, ResourceModelSourceException { if (!isDataWritable()) { throw new IllegalArgumentException("Cannot write to file, it is not configured to be writeable"); } ResourceFormatParser resourceFormat = getResourceFormatParser(); //validate data File temp = Files.createTempFile("temp", "." + resourceFormat.getPreferredFileExtension()).toFile(); temp.deleteOnExit(); try { try (FileOutputStream fos = new FileOutputStream(temp)) { Streams.copyStream(data, fos); } final ResourceFormatParser parser = getResourceFormatParser(); try { final INodeSet set = parser.parseDocument(temp); } catch (ResourceFormatParserException e) { throw new ResourceModelSourceException(e); } try (FileInputStream tempStream = new FileInputStream(temp)) { return writeFileData(tempStream); } } finally { temp.delete(); } }
class class_name[name] begin[{] method[writeData, return_type[type[long]], modifier[public], parameter[data]] begin[{] if[call[.isDataWritable, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot write to file, it is not configured to be writeable")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[ResourceFormatParser], resourceFormat] local_variable[type[File], temp] call[temp.deleteOnExit, parameter[]] TryStatement(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyStream, postfix_operators=[], prefix_operators=[], qualifier=Streams, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=fos, type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None)))]), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResourceFormatParser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=parser)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ResourceFormatParser, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseDocument, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), name=set)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=INodeSet, sub_type=None))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ResourceModelSourceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ResourceFormatParserException']))], finally_block=None, label=None, resources=None), TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=tempStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeFileData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=tempStream, type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)))])], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[long] identifier[writeData] operator[SEP] Keyword[final] identifier[InputStream] identifier[data] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ResourceModelSourceException] { Keyword[if] operator[SEP] operator[!] identifier[isDataWritable] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[ResourceFormatParser] identifier[resourceFormat] operator[=] identifier[getResourceFormatParser] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[temp] operator[=] identifier[Files] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] , literal[String] operator[+] identifier[resourceFormat] operator[SEP] identifier[getPreferredFileExtension] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] identifier[temp] operator[SEP] identifier[deleteOnExit] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[try] operator[SEP] identifier[FileOutputStream] identifier[fos] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[temp] operator[SEP] operator[SEP] { identifier[Streams] operator[SEP] identifier[copyStream] operator[SEP] identifier[data] , identifier[fos] operator[SEP] operator[SEP] } Keyword[final] identifier[ResourceFormatParser] identifier[parser] operator[=] identifier[getResourceFormatParser] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[INodeSet] identifier[set] operator[=] identifier[parser] operator[SEP] identifier[parseDocument] operator[SEP] identifier[temp] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ResourceFormatParserException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ResourceModelSourceException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[try] operator[SEP] identifier[FileInputStream] identifier[tempStream] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[temp] operator[SEP] operator[SEP] { Keyword[return] identifier[writeFileData] operator[SEP] identifier[tempStream] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[temp] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] } }
@Indexable(type = IndexableType.DELETE) @Override public CPInstance deleteCPInstance(long CPInstanceId) throws PortalException { return cpInstancePersistence.remove(CPInstanceId); }
class class_name[name] begin[{] method[deleteCPInstance, return_type[type[CPInstance]], modifier[public], parameter[CPInstanceId]] begin[{] return[call[cpInstancePersistence.remove, parameter[member[.CPInstanceId]]]] end[}] END[}]
annotation[@] identifier[Indexable] operator[SEP] identifier[type] operator[=] identifier[IndexableType] operator[SEP] identifier[DELETE] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[CPInstance] identifier[deleteCPInstance] operator[SEP] Keyword[long] identifier[CPInstanceId] operator[SEP] Keyword[throws] identifier[PortalException] { Keyword[return] identifier[cpInstancePersistence] operator[SEP] identifier[remove] operator[SEP] identifier[CPInstanceId] operator[SEP] operator[SEP] }
public void recordCheckoutQueueLength(SocketDestination dest, int queueLength) { if(dest != null) { getOrCreateNodeStats(dest).recordCheckoutQueueLength(null, queueLength); recordCheckoutQueueLength(null, queueLength); } else { this.checkoutQueueLengthHistogram.insert(queueLength); checkMonitoringInterval(); } }
class class_name[name] begin[{] method[recordCheckoutQueueLength, return_type[void], modifier[public], parameter[dest, queueLength]] begin[{] if[binary_operation[member[.dest], !=, literal[null]]] begin[{] call[.getOrCreateNodeStats, parameter[member[.dest]]] call[.recordCheckoutQueueLength, parameter[literal[null], member[.queueLength]]] else begin[{] THIS[member[None.checkoutQueueLengthHistogram]call[None.insert, parameter[member[.queueLength]]]] call[.checkMonitoringInterval, parameter[]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[recordCheckoutQueueLength] operator[SEP] identifier[SocketDestination] identifier[dest] , Keyword[int] identifier[queueLength] operator[SEP] { Keyword[if] operator[SEP] identifier[dest] operator[!=] Other[null] operator[SEP] { identifier[getOrCreateNodeStats] operator[SEP] identifier[dest] operator[SEP] operator[SEP] identifier[recordCheckoutQueueLength] operator[SEP] Other[null] , identifier[queueLength] operator[SEP] operator[SEP] identifier[recordCheckoutQueueLength] operator[SEP] Other[null] , identifier[queueLength] operator[SEP] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[checkoutQueueLengthHistogram] operator[SEP] identifier[insert] operator[SEP] identifier[queueLength] operator[SEP] operator[SEP] identifier[checkMonitoringInterval] operator[SEP] operator[SEP] operator[SEP] } }
private static String buildKey(String key, Map<String, Object> parameters) { // 匹配符合 :name 格式的参数 Matcher matcher = PATTERN.matcher(key); if (matcher.find()) { StringBuilder builder = new StringBuilder(); int index = 0; do { // 提取参数名称 final String name = matcher.group(1).trim(); Object value = null; // 解析 a.b.c 类型的名称 int find = name.indexOf('.'); if (find >= 0) { // 用 BeanWrapper 获取属性值 Object bean = parameters.get(name.substring(0, find)); if (bean != null) { value = new BeanWrapperImpl(bean) .getPropertyValue(name.substring(find + 1)); } } else { // 获取参数值 value = parameters.get(name); } // 拼装参数值 builder.append(key.substring(index, matcher.start())); builder.append(value); index = matcher.end(); } while (matcher.find()); // 拼装最后一段 builder.append(key.substring(index)); return builder.toString(); } return key; }
class class_name[name] begin[{] method[buildKey, return_type[type[String]], modifier[private static], parameter[key, parameters]] begin[{] local_variable[type[Matcher], matcher] if[call[matcher.find, parameter[]]] begin[{] local_variable[type[StringBuilder], builder] local_variable[type[int], index] do[call[matcher.find, parameter[]]] begin[{] local_variable[type[String], name] local_variable[type[Object], value] local_variable[type[int], find] if[binary_operation[member[.find], >=, literal[0]]] begin[{] local_variable[type[Object], bean] if[binary_operation[member[.bean], !=, literal[null]]] begin[{] assign[member[.value], ClassCreator(arguments=[MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=find, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None)], member=getPropertyValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BeanWrapperImpl, sub_type=None))] else begin[{] None end[}] else begin[{] assign[member[.value], call[parameters.get, parameter[member[.name]]]] end[}] call[builder.append, parameter[call[key.substring, parameter[member[.index], call[matcher.start, parameter[]]]]]] call[builder.append, parameter[member[.value]]] assign[member[.index], call[matcher.end, parameter[]]] end[}] call[builder.append, parameter[call[key.substring, parameter[member[.index]]]]] return[call[builder.toString, parameter[]]] else begin[{] None end[}] return[member[.key]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[buildKey] operator[SEP] identifier[String] identifier[key] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameters] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[do] { Keyword[final] identifier[String] identifier[name] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[=] Other[null] operator[SEP] Keyword[int] identifier[find] operator[=] identifier[name] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[find] operator[>=] Other[0] operator[SEP] { identifier[Object] identifier[bean] operator[=] identifier[parameters] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[find] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bean] operator[!=] Other[null] operator[SEP] { identifier[value] operator[=] Keyword[new] identifier[BeanWrapperImpl] operator[SEP] identifier[bean] operator[SEP] operator[SEP] identifier[getPropertyValue] operator[SEP] identifier[name] operator[SEP] identifier[substring] operator[SEP] identifier[find] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[value] operator[=] identifier[parameters] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[key] operator[SEP] identifier[substring] operator[SEP] identifier[index] , identifier[matcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[index] operator[=] identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[key] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[key] operator[SEP] }
public int checkSecurity() { App application = null; if (this.getTask() != null) application = this.getTask().getApplication(); int iErrorCode = Constant.NORMAL_RETURN; if (application != null) iErrorCode = application.checkSecurity(this.getClass().getName()); return iErrorCode; }
class class_name[name] begin[{] method[checkSecurity, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[App], application] if[binary_operation[THIS[call[None.getTask, parameter[]]], !=, literal[null]]] begin[{] assign[member[.application], THIS[call[None.getTask, parameter[]]call[None.getApplication, parameter[]]]] else begin[{] None end[}] local_variable[type[int], iErrorCode] if[binary_operation[member[.application], !=, literal[null]]] begin[{] assign[member[.iErrorCode], call[application.checkSecurity, parameter[THIS[call[None.getClass, parameter[]]call[None.getName, parameter[]]]]]] else begin[{] None end[}] return[member[.iErrorCode]] end[}] END[}]
Keyword[public] Keyword[int] identifier[checkSecurity] operator[SEP] operator[SEP] { identifier[App] identifier[application] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[application] operator[=] Keyword[this] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[iErrorCode] operator[=] identifier[Constant] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] Keyword[if] operator[SEP] identifier[application] operator[!=] Other[null] operator[SEP] identifier[iErrorCode] operator[=] identifier[application] operator[SEP] identifier[checkSecurity] operator[SEP] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[iErrorCode] operator[SEP] }
protected void setOffsetAndLength(long offset, int length) throws IOException { this.offset = offset; this.length = length; this.position = 0; if (subStream.position() != offset) { subStream.seek(offset); } }
class class_name[name] begin[{] method[setOffsetAndLength, return_type[void], modifier[protected], parameter[offset, length]] begin[{] assign[THIS[member[None.offset]], member[.offset]] assign[THIS[member[None.length]], member[.length]] assign[THIS[member[None.position]], literal[0]] if[binary_operation[call[subStream.position, parameter[]], !=, member[.offset]]] begin[{] call[subStream.seek, parameter[member[.offset]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[setOffsetAndLength] operator[SEP] Keyword[long] identifier[offset] , Keyword[int] identifier[length] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[this] operator[SEP] identifier[offset] operator[=] identifier[offset] operator[SEP] Keyword[this] operator[SEP] identifier[length] operator[=] identifier[length] operator[SEP] Keyword[this] operator[SEP] identifier[position] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[subStream] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[!=] identifier[offset] operator[SEP] { identifier[subStream] operator[SEP] identifier[seek] operator[SEP] identifier[offset] operator[SEP] operator[SEP] } }
public void watchPath(DisconfCoreProcessor disconfCoreMgr, DisConfCommonModel disConfCommonModel, String keyName, DisConfigTypeEnum disConfigTypeEnum, String value) throws Exception { // 新建 String monitorPath = makeMonitorPath(disConfigTypeEnum, disConfCommonModel, keyName, value); // 进行监控 NodeWatcher nodeWatcher = new NodeWatcher(disconfCoreMgr, monitorPath, keyName, disConfigTypeEnum, new DisconfSysUpdateCallback(), debug); nodeWatcher.monitorMaster(); }
class class_name[name] begin[{] method[watchPath, return_type[void], modifier[public], parameter[disconfCoreMgr, disConfCommonModel, keyName, disConfigTypeEnum, value]] begin[{] local_variable[type[String], monitorPath] local_variable[type[NodeWatcher], nodeWatcher] call[nodeWatcher.monitorMaster, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[watchPath] operator[SEP] identifier[DisconfCoreProcessor] identifier[disconfCoreMgr] , identifier[DisConfCommonModel] identifier[disConfCommonModel] , identifier[String] identifier[keyName] , identifier[DisConfigTypeEnum] identifier[disConfigTypeEnum] , identifier[String] identifier[value] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[monitorPath] operator[=] identifier[makeMonitorPath] operator[SEP] identifier[disConfigTypeEnum] , identifier[disConfCommonModel] , identifier[keyName] , identifier[value] operator[SEP] operator[SEP] identifier[NodeWatcher] identifier[nodeWatcher] operator[=] Keyword[new] identifier[NodeWatcher] operator[SEP] identifier[disconfCoreMgr] , identifier[monitorPath] , identifier[keyName] , identifier[disConfigTypeEnum] , Keyword[new] identifier[DisconfSysUpdateCallback] operator[SEP] operator[SEP] , identifier[debug] operator[SEP] operator[SEP] identifier[nodeWatcher] operator[SEP] identifier[monitorMaster] operator[SEP] operator[SEP] operator[SEP] }
public Object[] marshalParams(RpcRequest req) throws RpcException { Object[] converted = new Object[params.size()]; Object[] reqParams = req.getParams(); if (reqParams.length != converted.length) { String msg = "Function '" + req.getMethod() + "' expects " + params.size() + " param(s). " + reqParams.length + " given."; throw invParams(msg); } for (int i = 0; i < converted.length; i++) { converted[i] = params.get(i).getTypeConverter().marshal(reqParams[i]); } return converted; }
class class_name[name] begin[{] method[marshalParams, return_type[type[Object]], modifier[public], parameter[req]] begin[{] local_variable[type[Object], converted] local_variable[type[Object], reqParams] if[binary_operation[member[reqParams.length], !=, member[converted.length]]] begin[{] local_variable[type[String], msg] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=converted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[MethodInvocation(arguments=[], member=getTypeConverter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=reqParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=marshal, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=converted, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.converted]] end[}] END[}]
Keyword[public] identifier[Object] operator[SEP] operator[SEP] identifier[marshalParams] operator[SEP] identifier[RpcRequest] identifier[req] operator[SEP] Keyword[throws] identifier[RpcException] { identifier[Object] operator[SEP] operator[SEP] identifier[converted] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[params] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[reqParams] operator[=] identifier[req] operator[SEP] identifier[getParams] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reqParams] operator[SEP] identifier[length] operator[!=] identifier[converted] operator[SEP] identifier[length] operator[SEP] { identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[req] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[params] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[reqParams] operator[SEP] identifier[length] operator[+] literal[String] operator[SEP] Keyword[throw] identifier[invParams] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[converted] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[converted] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[params] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getTypeConverter] operator[SEP] operator[SEP] operator[SEP] identifier[marshal] operator[SEP] identifier[reqParams] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[converted] operator[SEP] }
public PendingCall present() { logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()), AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED); if (onPresentCallback != null) { try { onPresentCallback.onPresent(activity); } catch (Exception e) { throw new FacebookException(e); } } if (fragment != null) { fragment.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode()); } else { activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode()); } return appCall; }
class class_name[name] begin[{] method[present, return_type[type[PendingCall]], modifier[public], parameter[]] begin[{] call[.logDialogActivity, parameter[member[.activity], member[.fragment], call[.getEventName, parameter[call[appCall.getRequestIntent, parameter[]]]], member[AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED]]] if[binary_operation[member[.onPresentCallback], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=activity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onPresent, postfix_operators=[], prefix_operators=[], qualifier=onPresentCallback, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FacebookException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] if[binary_operation[member[.fragment], !=, literal[null]]] begin[{] call[fragment.startActivityForResult, parameter[call[appCall.getRequestIntent, parameter[]], call[appCall.getRequestCode, parameter[]]]] else begin[{] call[activity.startActivityForResult, parameter[call[appCall.getRequestIntent, parameter[]], call[appCall.getRequestCode, parameter[]]]] end[}] return[member[.appCall]] end[}] END[}]
Keyword[public] identifier[PendingCall] identifier[present] operator[SEP] operator[SEP] { identifier[logDialogActivity] operator[SEP] identifier[activity] , identifier[fragment] , identifier[getEventName] operator[SEP] identifier[appCall] operator[SEP] identifier[getRequestIntent] operator[SEP] operator[SEP] operator[SEP] , identifier[AnalyticsEvents] operator[SEP] identifier[PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[onPresentCallback] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[onPresentCallback] operator[SEP] identifier[onPresent] operator[SEP] identifier[activity] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[FacebookException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[fragment] operator[!=] Other[null] operator[SEP] { identifier[fragment] operator[SEP] identifier[startActivityForResult] operator[SEP] identifier[appCall] operator[SEP] identifier[getRequestIntent] operator[SEP] operator[SEP] , identifier[appCall] operator[SEP] identifier[getRequestCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[activity] operator[SEP] identifier[startActivityForResult] operator[SEP] identifier[appCall] operator[SEP] identifier[getRequestIntent] operator[SEP] operator[SEP] , identifier[appCall] operator[SEP] identifier[getRequestCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[appCall] operator[SEP] }
private DefaultSubscriptionBase getDefaultSubscriptionBase(final Entity subscriptionBase, final Catalog catalog, final InternalTenantContext context) throws CatalogApiException { if (subscriptionBase instanceof DefaultSubscriptionBase) { return (DefaultSubscriptionBase) subscriptionBase; } else { // Safe cast, see above return (DefaultSubscriptionBase) dao.getSubscriptionFromId(subscriptionBase.getId(), catalog, context); } }
class class_name[name] begin[{] method[getDefaultSubscriptionBase, return_type[type[DefaultSubscriptionBase]], modifier[private], parameter[subscriptionBase, catalog, context]] begin[{] if[binary_operation[member[.subscriptionBase], instanceof, type[DefaultSubscriptionBase]]] begin[{] return[Cast(expression=MemberReference(member=subscriptionBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DefaultSubscriptionBase, sub_type=None))] else begin[{] return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=subscriptionBase, selectors=[], type_arguments=None), MemberReference(member=catalog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSubscriptionFromId, postfix_operators=[], prefix_operators=[], qualifier=dao, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DefaultSubscriptionBase, sub_type=None))] end[}] end[}] END[}]
Keyword[private] identifier[DefaultSubscriptionBase] identifier[getDefaultSubscriptionBase] operator[SEP] Keyword[final] identifier[Entity] identifier[subscriptionBase] , Keyword[final] identifier[Catalog] identifier[catalog] , Keyword[final] identifier[InternalTenantContext] identifier[context] operator[SEP] Keyword[throws] identifier[CatalogApiException] { Keyword[if] operator[SEP] identifier[subscriptionBase] Keyword[instanceof] identifier[DefaultSubscriptionBase] operator[SEP] { Keyword[return] operator[SEP] identifier[DefaultSubscriptionBase] operator[SEP] identifier[subscriptionBase] operator[SEP] } Keyword[else] { Keyword[return] operator[SEP] identifier[DefaultSubscriptionBase] operator[SEP] identifier[dao] operator[SEP] identifier[getSubscriptionFromId] operator[SEP] identifier[subscriptionBase] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[catalog] , identifier[context] operator[SEP] operator[SEP] } }
public static boolean hasMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) { return (getMethodIfAvailable(clazz, methodName, paramTypes) != null); }
class class_name[name] begin[{] method[hasMethod, return_type[type[boolean]], modifier[public static], parameter[clazz, methodName, paramTypes]] begin[{] return[binary_operation[call[.getMethodIfAvailable, parameter[member[.clazz], member[.methodName], member[.paramTypes]]], !=, literal[null]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[hasMethod] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[String] identifier[methodName] , identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[paramTypes] operator[SEP] { Keyword[return] operator[SEP] identifier[getMethodIfAvailable] operator[SEP] identifier[clazz] , identifier[methodName] , identifier[paramTypes] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] }