code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
protected final PrcPageWithSubaccTypes<RS> createPutPrcPageWithSubaccTypes( final Map<String, Object> pAddParam) throws Exception { PrcPageWithSubaccTypes<RS> proc = new PrcPageWithSubaccTypes<RS>(); PrcEntitiesPage procDlg = (PrcEntitiesPage) this.fctBnProcessors .lazyGet(pAddParam, PrcEntitiesPage.class.getSimpleName()); proc.setPrcAccEntitiesPage(procDlg); proc.setSrvTypeCode(getSrvTypeCode()); //assigning fully initialized object: this.processorsMap .put(PrcPageWithSubaccTypes.class.getSimpleName(), proc); return proc; }
class class_name[name] begin[{] method[createPutPrcPageWithSubaccTypes, return_type[type[PrcPageWithSubaccTypes]], modifier[final protected], parameter[pAddParam]] begin[{] local_variable[type[PrcPageWithSubaccTypes], proc] local_variable[type[PrcEntitiesPage], procDlg] call[proc.setPrcAccEntitiesPage, parameter[member[.procDlg]]] call[proc.setSrvTypeCode, parameter[call[.getSrvTypeCode, parameter[]]]] THIS[member[None.processorsMap]call[None.put, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PrcPageWithSubaccTypes, sub_type=None)), member[.proc]]]] return[member[.proc]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[PrcPageWithSubaccTypes] operator[<] identifier[RS] operator[>] identifier[createPutPrcPageWithSubaccTypes] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[pAddParam] operator[SEP] Keyword[throws] identifier[Exception] { identifier[PrcPageWithSubaccTypes] operator[<] identifier[RS] operator[>] identifier[proc] operator[=] Keyword[new] identifier[PrcPageWithSubaccTypes] operator[<] identifier[RS] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[PrcEntitiesPage] identifier[procDlg] operator[=] operator[SEP] identifier[PrcEntitiesPage] operator[SEP] Keyword[this] operator[SEP] identifier[fctBnProcessors] operator[SEP] identifier[lazyGet] operator[SEP] identifier[pAddParam] , identifier[PrcEntitiesPage] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setPrcAccEntitiesPage] operator[SEP] identifier[procDlg] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvTypeCode] operator[SEP] identifier[getSrvTypeCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[put] operator[SEP] identifier[PrcPageWithSubaccTypes] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[proc] operator[SEP] operator[SEP] Keyword[return] identifier[proc] operator[SEP] }
public void setOperator(String v) { if (VariableAssignment_Type.featOkTst && ((VariableAssignment_Type)jcasType).casFeat_operator == null) jcasType.jcas.throwFeatMissing("operator", "ch.epfl.bbp.uima.types.VariableAssignment"); jcasType.ll_cas.ll_setStringValue(addr, ((VariableAssignment_Type)jcasType).casFeatCode_operator, v);}
class class_name[name] begin[{] method[setOperator, return_type[void], modifier[public], parameter[v]] begin[{] if[binary_operation[member[VariableAssignment_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=VariableAssignment_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["operator"], literal["ch.epfl.bbp.uima.types.VariableAssignment"]]] else begin[{] None end[}] call[jcasType.ll_cas.ll_setStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=VariableAssignment_Type, sub_type=None)), member[.v]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setOperator] operator[SEP] identifier[String] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[VariableAssignment_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[VariableAssignment_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_operator] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[VariableAssignment_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_operator] , identifier[v] operator[SEP] operator[SEP] }
@Override public void register( YogaEntityConfiguration<?>... entityConfigurations ) { for ( YogaEntityConfiguration<?> entityConfiguration : entityConfigurations ) { Class<?> type = entityConfiguration.getEntityClass(); if ( type == null ) { throw new IllegalArgumentException("Entity configuration must define an entity class to configure: " + entityConfiguration.getClass().getName()); } _registry.put( type, entityConfiguration ); } }
class class_name[name] begin[{] method[register, return_type[void], modifier[public], parameter[entityConfigurations]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEntityClass, postfix_operators=[], prefix_operators=[], qualifier=entityConfiguration, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, 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=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entity configuration must define an entity class to configure: "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=entityConfiguration, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), 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=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=entityConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=_registry, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=entityConfigurations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entityConfiguration)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=YogaEntityConfiguration, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[register] operator[SEP] identifier[YogaEntityConfiguration] operator[<] operator[?] operator[>] operator[...] identifier[entityConfigurations] operator[SEP] { Keyword[for] operator[SEP] identifier[YogaEntityConfiguration] operator[<] operator[?] operator[>] identifier[entityConfiguration] operator[:] identifier[entityConfigurations] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[entityConfiguration] operator[SEP] identifier[getEntityClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[entityConfiguration] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[_registry] operator[SEP] identifier[put] operator[SEP] identifier[type] , identifier[entityConfiguration] operator[SEP] operator[SEP] } }
@Override public Element execute(Context context) { Element result = Undef.VALUE; for (Operation op : ops) { try { result = op.execute(context); } catch (EvaluationException ee) { throw ee.addExceptionInfo(sourceRange, context); } } return result; }
class class_name[name] begin[{] method[execute, return_type[type[Element]], modifier[public], parameter[context]] begin[{] local_variable[type[Element], result] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=op, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=sourceRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addExceptionInfo, postfix_operators=[], prefix_operators=[], qualifier=ee, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ee, types=['EvaluationException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=ops, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=op)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Operation, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Element] identifier[execute] operator[SEP] identifier[Context] identifier[context] operator[SEP] { identifier[Element] identifier[result] operator[=] identifier[Undef] operator[SEP] identifier[VALUE] operator[SEP] Keyword[for] operator[SEP] identifier[Operation] identifier[op] operator[:] identifier[ops] operator[SEP] { Keyword[try] { identifier[result] operator[=] identifier[op] operator[SEP] identifier[execute] operator[SEP] identifier[context] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[EvaluationException] identifier[ee] operator[SEP] { Keyword[throw] identifier[ee] operator[SEP] identifier[addExceptionInfo] operator[SEP] identifier[sourceRange] , identifier[context] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public void sessionPropertiesChangedAllPlugin(Session session) { logger.debug("sessionPropertiesChangedAllPlugin"); for (ExtensionHook hook : extensionHooks.values()) { for (SessionChangedListener listener : hook.getSessionListenerList()) { try { if (listener != null) { listener.sessionPropertiesChanged(session); } } catch (Exception e) { logger.error(e.getMessage(), e); } } } }
class class_name[name] begin[{] method[sessionPropertiesChangedAllPlugin, return_type[void], modifier[public], parameter[session]] begin[{] call[logger.debug, parameter[literal["sessionPropertiesChangedAllPlugin"]]] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=listener, 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=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sessionPropertiesChanged, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, 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)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSessionListenerList, postfix_operators=[], prefix_operators=[], qualifier=hook, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SessionChangedListener, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=extensionHooks, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=hook)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExtensionHook, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[sessionPropertiesChangedAllPlugin] operator[SEP] identifier[Session] identifier[session] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ExtensionHook] identifier[hook] operator[:] identifier[extensionHooks] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[SessionChangedListener] identifier[listener] operator[:] identifier[hook] operator[SEP] identifier[getSessionListenerList] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[listener] operator[!=] Other[null] operator[SEP] { identifier[listener] operator[SEP] identifier[sessionPropertiesChanged] operator[SEP] identifier[session] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } }
public static FloatsColumn create(ColumnarFloats column, ImmutableBitmap nullValueBitmap) { if (nullValueBitmap.isEmpty()) { return new FloatsColumn(column); } else { return new FloatsColumnWithNulls(column, nullValueBitmap); } }
class class_name[name] begin[{] method[create, return_type[type[FloatsColumn]], modifier[public static], parameter[column, nullValueBitmap]] begin[{] if[call[nullValueBitmap.isEmpty, parameter[]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=column, 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=FloatsColumn, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nullValueBitmap, 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=FloatsColumnWithNulls, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[FloatsColumn] identifier[create] operator[SEP] identifier[ColumnarFloats] identifier[column] , identifier[ImmutableBitmap] identifier[nullValueBitmap] operator[SEP] { Keyword[if] operator[SEP] identifier[nullValueBitmap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[FloatsColumn] operator[SEP] identifier[column] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[FloatsColumnWithNulls] operator[SEP] identifier[column] , identifier[nullValueBitmap] operator[SEP] operator[SEP] } }
public static RefundNotifyReqInfo decryptRefundNotifyReqInfo(String req_info, String key) { try { Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding"); Key sKeySpec = new SecretKeySpec(DigestUtils.md5Hex(key).getBytes(), "AES"); cipher.init(Cipher.DECRYPT_MODE, sKeySpec); byte[] resultByte = cipher.doFinal(Base64.decodeBase64(req_info)); String data = new String(PKCS7Encoder.decode(resultByte)); return XMLConverUtil.convertToObject(RefundNotifyReqInfo.class, data); } catch (Exception e) { logger.error("", e); } return null; }
class class_name[name] begin[{] method[decryptRefundNotifyReqInfo, return_type[type[RefundNotifyReqInfo]], modifier[public static], parameter[req_info, key]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AES/ECB/NoPadding")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[], type_arguments=None), name=cipher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cipher, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=md5Hex, postfix_operators=[], prefix_operators=[], qualifier=DigestUtils, selectors=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AES")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecretKeySpec, sub_type=None)), name=sKeySpec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Key, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DECRYPT_MODE, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[]), MemberReference(member=sKeySpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=cipher, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=req_info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decodeBase64, postfix_operators=[], prefix_operators=[], qualifier=Base64, selectors=[], type_arguments=None)], member=doFinal, postfix_operators=[], prefix_operators=[], qualifier=cipher, selectors=[], type_arguments=None), name=resultByte)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=resultByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decode, postfix_operators=[], prefix_operators=[], qualifier=PKCS7Encoder, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=data)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RefundNotifyReqInfo, sub_type=None)), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertToObject, postfix_operators=[], prefix_operators=[], qualifier=XMLConverUtil, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, 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) return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[RefundNotifyReqInfo] identifier[decryptRefundNotifyReqInfo] operator[SEP] identifier[String] identifier[req_info] , identifier[String] identifier[key] operator[SEP] { Keyword[try] { identifier[Cipher] identifier[cipher] operator[=] identifier[Cipher] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Key] identifier[sKeySpec] operator[=] Keyword[new] identifier[SecretKeySpec] operator[SEP] identifier[DigestUtils] operator[SEP] identifier[md5Hex] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[Cipher] operator[SEP] identifier[DECRYPT_MODE] , identifier[sKeySpec] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[resultByte] operator[=] identifier[cipher] operator[SEP] identifier[doFinal] operator[SEP] identifier[Base64] operator[SEP] identifier[decodeBase64] operator[SEP] identifier[req_info] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[data] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[PKCS7Encoder] operator[SEP] identifier[decode] operator[SEP] identifier[resultByte] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[XMLConverUtil] operator[SEP] identifier[convertToObject] operator[SEP] identifier[RefundNotifyReqInfo] operator[SEP] Keyword[class] , identifier[data] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public byte[] getMessage() { byte result[] = new byte[3 + m_length]; int offset = 0; result[offset++] = (byte)(m_length + 2); result[offset++] = (byte)m_slaveId; result[offset++] = (byte)m_status; if (m_length > 0) { System.arraycopy(m_data, 0, result, offset, m_length - 2); } return result; }
class class_name[name] begin[{] method[getMessage, return_type[type[byte]], modifier[public], parameter[]] begin[{] local_variable[type[byte], result] local_variable[type[int], offset] assign[member[.result], Cast(expression=BinaryOperation(operandl=MemberReference(member=m_length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), type=BasicType(dimensions=[], name=byte))] assign[member[.result], Cast(expression=MemberReference(member=m_slaveId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))] assign[member[.result], Cast(expression=MemberReference(member=m_status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))] if[binary_operation[member[.m_length], >, literal[0]]] begin[{] call[System.arraycopy, parameter[member[.m_data], literal[0], member[.result], member[.offset], binary_operation[member[.m_length], -, literal[2]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] { Keyword[byte] identifier[result] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[3] operator[+] identifier[m_length] operator[SEP] operator[SEP] Keyword[int] identifier[offset] operator[=] Other[0] operator[SEP] identifier[result] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[m_length] operator[+] Other[2] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[m_slaveId] operator[SEP] identifier[result] operator[SEP] identifier[offset] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] identifier[m_status] operator[SEP] Keyword[if] operator[SEP] identifier[m_length] operator[>] Other[0] operator[SEP] { identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[m_data] , Other[0] , identifier[result] , identifier[offset] , identifier[m_length] operator[-] Other[2] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public List<Object> receiveSelectedAndConvertBatch(Destination destination, String messageSelector) throws JmsException { return receiveSelectedAndConvertBatch(destination, messageSelector, getBatchSize()); }
class class_name[name] begin[{] method[receiveSelectedAndConvertBatch, return_type[type[List]], modifier[public], parameter[destination, messageSelector]] begin[{] return[call[.receiveSelectedAndConvertBatch, parameter[member[.destination], member[.messageSelector], call[.getBatchSize, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Object] operator[>] identifier[receiveSelectedAndConvertBatch] operator[SEP] identifier[Destination] identifier[destination] , identifier[String] identifier[messageSelector] operator[SEP] Keyword[throws] identifier[JmsException] { Keyword[return] identifier[receiveSelectedAndConvertBatch] operator[SEP] identifier[destination] , identifier[messageSelector] , identifier[getBatchSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public String getTextAttribute(String name) { String attr = getAttributeValue(name); if (attr != null) { return attr; } NamedAttribute namedAttribute = getNamedAttributeNode(name); if (namedAttribute == null) { return null; } return namedAttribute.getText(); }
class class_name[name] begin[{] method[getTextAttribute, return_type[type[String]], modifier[public], parameter[name]] begin[{] local_variable[type[String], attr] if[binary_operation[member[.attr], !=, literal[null]]] begin[{] return[member[.attr]] else begin[{] None end[}] local_variable[type[NamedAttribute], namedAttribute] if[binary_operation[member[.namedAttribute], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[namedAttribute.getText, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getTextAttribute] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[String] identifier[attr] operator[=] identifier[getAttributeValue] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attr] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[attr] operator[SEP] } identifier[NamedAttribute] identifier[namedAttribute] operator[=] identifier[getNamedAttributeNode] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[namedAttribute] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[namedAttribute] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] }
public static cacheselector[] get(nitro_service service, options option) throws Exception{ cacheselector obj = new cacheselector(); cacheselector[] response = (cacheselector[])obj.get_resources(service,option); return response; }
class class_name[name] begin[{] method[get, return_type[type[cacheselector]], modifier[public static], parameter[service, option]] begin[{] local_variable[type[cacheselector], obj] local_variable[type[cacheselector], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[cacheselector] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[options] identifier[option] operator[SEP] Keyword[throws] identifier[Exception] { identifier[cacheselector] identifier[obj] operator[=] Keyword[new] identifier[cacheselector] operator[SEP] operator[SEP] operator[SEP] identifier[cacheselector] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[cacheselector] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
@Override public int compareTo(HandlerHolder holderToCompare) { if (holderToCompare == this || this.serviceId == holderToCompare.serviceId) return 0; // service ranking is higher to lower int compare = holderToCompare.serviceRanking - this.serviceRanking; if (compare == 0) { // service id is lower to higher return holderToCompare.serviceId > this.serviceId ? -1 : 1; } // service ranking is higher to lower // Can't get here with equal ranking, falls into compare block w/ // non-equal service ids. return holderToCompare.serviceRanking > this.serviceRanking ? 1 : -1; }
class class_name[name] begin[{] method[compareTo, return_type[type[int]], modifier[public], parameter[holderToCompare]] begin[{] if[binary_operation[binary_operation[member[.holderToCompare], ==, THIS[]], ||, binary_operation[THIS[member[None.serviceId]], ==, member[holderToCompare.serviceId]]]] begin[{] return[literal[0]] else begin[{] None end[}] local_variable[type[int], compare] if[binary_operation[member[.compare], ==, literal[0]]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=serviceId, postfix_operators=[], prefix_operators=[], qualifier=holderToCompare, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serviceId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1))] else begin[{] None end[}] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=serviceRanking, postfix_operators=[], prefix_operators=[], qualifier=holderToCompare, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serviceRanking, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compareTo] operator[SEP] identifier[HandlerHolder] identifier[holderToCompare] operator[SEP] { Keyword[if] operator[SEP] identifier[holderToCompare] operator[==] Keyword[this] operator[||] Keyword[this] operator[SEP] identifier[serviceId] operator[==] identifier[holderToCompare] operator[SEP] identifier[serviceId] operator[SEP] Keyword[return] Other[0] operator[SEP] Keyword[int] identifier[compare] operator[=] identifier[holderToCompare] operator[SEP] identifier[serviceRanking] operator[-] Keyword[this] operator[SEP] identifier[serviceRanking] operator[SEP] Keyword[if] operator[SEP] identifier[compare] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[holderToCompare] operator[SEP] identifier[serviceId] operator[>] Keyword[this] operator[SEP] identifier[serviceId] operator[?] operator[-] Other[1] operator[:] Other[1] operator[SEP] } Keyword[return] identifier[holderToCompare] operator[SEP] identifier[serviceRanking] operator[>] Keyword[this] operator[SEP] identifier[serviceRanking] operator[?] Other[1] operator[:] operator[-] Other[1] operator[SEP] }
private CompletableFuture<Void> commitInitialEntries() { // The Raft protocol dictates that leaders cannot commit entries from previous terms until // at least one entry from their current term has been stored on a majority of servers. Thus, // we force entries to be appended up to the leader's no-op entry. The LeaderAppender will ensure // that the commitIndex is not increased until the no-op entry (appender.index()) is committed. CompletableFuture<Void> future = new CompletableFuture<>(); appender.appendEntries(appender.index()).whenComplete((resultIndex, error) -> { context.checkThread(); if (isOpen()) { if (error == null) { context.getStateMachine().apply(resultIndex); future.complete(null); } else { context.setLeader(0); context.transition(CopycatServer.State.FOLLOWER); } } }); return future; }
class class_name[name] begin[{] method[commitInitialEntries, return_type[type[CompletableFuture]], modifier[private], parameter[]] begin[{] local_variable[type[CompletableFuture], future] call[appender.appendEntries, parameter[call[appender.index, parameter[]]]] return[member[.future]] end[}] END[}]
Keyword[private] identifier[CompletableFuture] operator[<] identifier[Void] operator[>] identifier[commitInitialEntries] operator[SEP] operator[SEP] { identifier[CompletableFuture] operator[<] identifier[Void] operator[>] identifier[future] operator[=] Keyword[new] identifier[CompletableFuture] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[appender] operator[SEP] identifier[appendEntries] operator[SEP] identifier[appender] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[whenComplete] operator[SEP] operator[SEP] identifier[resultIndex] , identifier[error] operator[SEP] operator[->] { identifier[context] operator[SEP] identifier[checkThread] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[error] operator[==] Other[null] operator[SEP] { identifier[context] operator[SEP] identifier[getStateMachine] operator[SEP] operator[SEP] operator[SEP] identifier[apply] operator[SEP] identifier[resultIndex] operator[SEP] operator[SEP] identifier[future] operator[SEP] identifier[complete] operator[SEP] Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[context] operator[SEP] identifier[setLeader] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[transition] operator[SEP] identifier[CopycatServer] operator[SEP] identifier[State] operator[SEP] identifier[FOLLOWER] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] Keyword[return] identifier[future] operator[SEP] }
public Observable<BackupStatusResponseInner> getAsync(String azureRegion, BackupStatusRequest parameters) { return getWithServiceResponseAsync(azureRegion, parameters).map(new Func1<ServiceResponse<BackupStatusResponseInner>, BackupStatusResponseInner>() { @Override public BackupStatusResponseInner call(ServiceResponse<BackupStatusResponseInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[getAsync, return_type[type[Observable]], modifier[public], parameter[azureRegion, parameters]] begin[{] return[call[.getWithServiceResponseAsync, parameter[member[.azureRegion], member[.parameters]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[BackupStatusResponseInner] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[azureRegion] , identifier[BackupStatusRequest] identifier[parameters] operator[SEP] { Keyword[return] identifier[getWithServiceResponseAsync] operator[SEP] identifier[azureRegion] , identifier[parameters] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[BackupStatusResponseInner] operator[>] , identifier[BackupStatusResponseInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[BackupStatusResponseInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[BackupStatusResponseInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public void setTargetGroups(java.util.Collection<TargetGroupInfo> targetGroups) { if (targetGroups == null) { this.targetGroups = null; return; } this.targetGroups = new com.amazonaws.internal.SdkInternalList<TargetGroupInfo>(targetGroups); }
class class_name[name] begin[{] method[setTargetGroups, return_type[void], modifier[public], parameter[targetGroups]] begin[{] if[binary_operation[member[.targetGroups], ==, literal[null]]] begin[{] assign[THIS[member[None.targetGroups]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.targetGroups]], ClassCreator(arguments=[MemberReference(member=targetGroups, 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=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TargetGroupInfo, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTargetGroups] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[TargetGroupInfo] operator[>] identifier[targetGroups] operator[SEP] { Keyword[if] operator[SEP] identifier[targetGroups] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[targetGroups] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[targetGroups] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[TargetGroupInfo] operator[>] operator[SEP] identifier[targetGroups] operator[SEP] operator[SEP] }
private File getStatefulBeanFile(String fileNamePrefix, boolean checkAll) { File statefulBeanFile = null; if (clusterName != null) { statefulBeanFile = new File(passivationDir, fileNamePrefix + clusterName); if (checkAll && statefulBeanFile.exists()) { return statefulBeanFile; } } statefulBeanFile = new File(passivationDir, fileNamePrefix + serverName); if (checkAll && statefulBeanFile.exists()) { return statefulBeanFile; } return new File(passivationDir, fileNamePrefix); }
class class_name[name] begin[{] method[getStatefulBeanFile, return_type[type[File]], modifier[private], parameter[fileNamePrefix, checkAll]] begin[{] local_variable[type[File], statefulBeanFile] if[binary_operation[member[.clusterName], !=, literal[null]]] begin[{] assign[member[.statefulBeanFile], ClassCreator(arguments=[MemberReference(member=passivationDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=fileNamePrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=clusterName, 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=File, sub_type=None))] if[binary_operation[member[.checkAll], &&, call[statefulBeanFile.exists, parameter[]]]] begin[{] return[member[.statefulBeanFile]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.statefulBeanFile], ClassCreator(arguments=[MemberReference(member=passivationDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=fileNamePrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=serverName, 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=File, sub_type=None))] if[binary_operation[member[.checkAll], &&, call[statefulBeanFile.exists, parameter[]]]] begin[{] return[member[.statefulBeanFile]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=passivationDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fileNamePrefix, 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=File, sub_type=None))] end[}] END[}]
Keyword[private] identifier[File] identifier[getStatefulBeanFile] operator[SEP] identifier[String] identifier[fileNamePrefix] , Keyword[boolean] identifier[checkAll] operator[SEP] { identifier[File] identifier[statefulBeanFile] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[clusterName] operator[!=] Other[null] operator[SEP] { identifier[statefulBeanFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[passivationDir] , identifier[fileNamePrefix] operator[+] identifier[clusterName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[checkAll] operator[&&] identifier[statefulBeanFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[statefulBeanFile] operator[SEP] } } identifier[statefulBeanFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[passivationDir] , identifier[fileNamePrefix] operator[+] identifier[serverName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[checkAll] operator[&&] identifier[statefulBeanFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[statefulBeanFile] operator[SEP] } Keyword[return] Keyword[new] identifier[File] operator[SEP] identifier[passivationDir] , identifier[fileNamePrefix] operator[SEP] operator[SEP] }
@Override public void start(final Stage stage) throws Exception { // Store the preloader stage to reuse it later this.preloaderStage = stage; // Configure the stage stage.centerOnScreen(); stage.initStyle(StageStyle.TRANSPARENT); stage.setScene(createPreloaderScene()); // Let's start the show stage.show(); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[stage]] begin[{] assign[THIS[member[None.preloaderStage]], member[.stage]] call[stage.centerOnScreen, parameter[]] call[stage.initStyle, parameter[member[StageStyle.TRANSPARENT]]] call[stage.setScene, parameter[call[.createPreloaderScene, parameter[]]]] call[stage.show, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[start] operator[SEP] Keyword[final] identifier[Stage] identifier[stage] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[this] operator[SEP] identifier[preloaderStage] operator[=] identifier[stage] operator[SEP] identifier[stage] operator[SEP] identifier[centerOnScreen] operator[SEP] operator[SEP] operator[SEP] identifier[stage] operator[SEP] identifier[initStyle] operator[SEP] identifier[StageStyle] operator[SEP] identifier[TRANSPARENT] operator[SEP] operator[SEP] identifier[stage] operator[SEP] identifier[setScene] operator[SEP] identifier[createPreloaderScene] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stage] operator[SEP] identifier[show] operator[SEP] operator[SEP] operator[SEP] }
public HadoopJarStepConfig newInstallHiveStep(HiveVersion... hiveVersions) { if (hiveVersions.length > 0) { String[] versionStrings = new String[hiveVersions.length]; for (int i = 0; i < hiveVersions.length; i++) { versionStrings[i] = hiveVersions[i].toString(); } return newInstallHiveStep(versionStrings); } return newHivePigStep("hive", "--install-hive", "--hive-versions", "latest"); }
class class_name[name] begin[{] method[newInstallHiveStep, return_type[type[HadoopJarStepConfig]], modifier[public], parameter[hiveVersions]] begin[{] if[binary_operation[member[hiveVersions.length], >, literal[0]]] begin[{] local_variable[type[String], versionStrings] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=versionStrings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=hiveVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=toString, 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=hiveVersions, 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[.newInstallHiveStep, parameter[member[.versionStrings]]]] else begin[{] None end[}] return[call[.newHivePigStep, parameter[literal["hive"], literal["--install-hive"], literal["--hive-versions"], literal["latest"]]]] end[}] END[}]
Keyword[public] identifier[HadoopJarStepConfig] identifier[newInstallHiveStep] operator[SEP] identifier[HiveVersion] operator[...] identifier[hiveVersions] operator[SEP] { Keyword[if] operator[SEP] identifier[hiveVersions] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[versionStrings] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[hiveVersions] 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[hiveVersions] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[versionStrings] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[hiveVersions] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[newInstallHiveStep] operator[SEP] identifier[versionStrings] operator[SEP] operator[SEP] } Keyword[return] identifier[newHivePigStep] operator[SEP] literal[String] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] }
public static String getMD5Checksum(String text) { final byte[] data = stringToBytes(text); return getChecksum(MD5, data); }
class class_name[name] begin[{] method[getMD5Checksum, return_type[type[String]], modifier[public static], parameter[text]] begin[{] local_variable[type[byte], data] return[call[.getChecksum, parameter[member[.MD5], member[.data]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getMD5Checksum] operator[SEP] identifier[String] identifier[text] operator[SEP] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[stringToBytes] operator[SEP] identifier[text] operator[SEP] operator[SEP] Keyword[return] identifier[getChecksum] operator[SEP] identifier[MD5] , identifier[data] operator[SEP] operator[SEP] }
private static Rule<?> createCustomRule(String javaClass, SoyErrorKind error) { Class<? extends Rule<?>> customRuleClass; try { @SuppressWarnings("unchecked") Class<? extends Rule<?>> asSubclass = (Class<? extends Rule<?>>) Class.forName(javaClass).asSubclass(Rule.class); customRuleClass = asSubclass; } catch (ClassNotFoundException e) { throw new IllegalArgumentException("custom rule class " + javaClass + " not found", e); } try { // It is ok for the constructor to be non-public as long as it is defined in this package // if it is non public and defined in another package, this will throw an // IllegalAccessException which seems about right. Constructor<? extends Rule<?>> ctor = customRuleClass.getDeclaredConstructor(SoyErrorKind.class); return ctor.newInstance(error); } catch (ReflectiveOperationException e) { throw new IllegalArgumentException( "unable to construct custom rule class: " + javaClass + ": " + e.getMessage(), e); } }
class class_name[name] begin[{] method[createCustomRule, return_type[type[Rule]], modifier[private static], parameter[javaClass, error]] begin[{] local_variable[type[Class], customRuleClass] TryStatement(block=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=javaClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rule, sub_type=None))], member=asSubclass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Rule, sub_type=None))], dimensions=[], name=Class, sub_type=None)), name=asSubclass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Rule, sub_type=None))], dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=customRuleClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=asSubclass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="custom rule class "), operandr=MemberReference(member=javaClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not found"), 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=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SoyErrorKind, sub_type=None))], member=getDeclaredConstructor, postfix_operators=[], prefix_operators=[], qualifier=customRuleClass, selectors=[], type_arguments=None), name=ctor)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Rule, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=ctor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unable to construct custom rule class: "), operandr=MemberReference(member=javaClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), 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=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ReflectiveOperationException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[Rule] operator[<] operator[?] operator[>] identifier[createCustomRule] operator[SEP] identifier[String] identifier[javaClass] , identifier[SoyErrorKind] identifier[error] operator[SEP] { identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Rule] operator[<] operator[?] operator[>] operator[>] identifier[customRuleClass] operator[SEP] Keyword[try] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Rule] operator[<] operator[?] operator[>] operator[>] identifier[asSubclass] operator[=] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Rule] operator[<] operator[?] operator[>] operator[>] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[javaClass] operator[SEP] operator[SEP] identifier[asSubclass] operator[SEP] identifier[Rule] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[customRuleClass] operator[=] identifier[asSubclass] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[javaClass] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[try] { identifier[Constructor] operator[<] operator[?] Keyword[extends] identifier[Rule] operator[<] operator[?] operator[>] operator[>] identifier[ctor] operator[=] identifier[customRuleClass] operator[SEP] identifier[getDeclaredConstructor] operator[SEP] identifier[SoyErrorKind] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[ctor] operator[SEP] identifier[newInstance] operator[SEP] identifier[error] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ReflectiveOperationException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[javaClass] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public LoadBalancerDescription withSubnets(String... subnets) { if (this.subnets == null) { setSubnets(new com.amazonaws.internal.SdkInternalList<String>(subnets.length)); } for (String ele : subnets) { this.subnets.add(ele); } return this; }
class class_name[name] begin[{] method[withSubnets, return_type[type[LoadBalancerDescription]], modifier[public], parameter[subnets]] begin[{] if[binary_operation[THIS[member[None.subnets]], ==, literal[null]]] begin[{] call[.setSubnets, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=subnets, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, 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=subnets, 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=subnets, 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=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[LoadBalancerDescription] identifier[withSubnets] operator[SEP] identifier[String] operator[...] identifier[subnets] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[subnets] operator[==] Other[null] operator[SEP] { identifier[setSubnets] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[subnets] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[subnets] operator[SEP] { Keyword[this] operator[SEP] identifier[subnets] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static long copy(Reader reader, Writer writer, int bufferSize) throws IORuntimeException { return copy(reader, writer, bufferSize, null); }
class class_name[name] begin[{] method[copy, return_type[type[long]], modifier[public static], parameter[reader, writer, bufferSize]] begin[{] return[call[.copy, parameter[member[.reader], member[.writer], member[.bufferSize], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] identifier[copy] operator[SEP] identifier[Reader] identifier[reader] , identifier[Writer] identifier[writer] , Keyword[int] identifier[bufferSize] operator[SEP] Keyword[throws] identifier[IORuntimeException] { Keyword[return] identifier[copy] operator[SEP] identifier[reader] , identifier[writer] , identifier[bufferSize] , Other[null] operator[SEP] operator[SEP] }
public Collection<String> saveSearchResultsWithPageKeys(TextPageCriteria criteria, Region<String,Collection<?>> pageKeysRegion) { if(criteria == null) return null; if(criteria.getQuery() == null || criteria.getQuery().length() == 0) return null; if(criteria.getIndexName() == null || criteria.getIndexName().length() == 0) throw new IllegalArgumentException("Default criteria's indexName is required"); if(criteria.getId() == null || criteria.getId().length() == 0) throw new IllegalArgumentException("Default criteria's id is required"); if(criteria.getDefaultField() == null || criteria.getDefaultField().length() == 0) throw new IllegalArgumentException("Default criteria's defaultField is required"); try { LuceneQuery<Object, Object> luceneQuery = luceneService.createLuceneQueryFactory() .create(criteria.getIndexName(), criteria.getRegionName(), criteria.getQuery(), criteria.getDefaultField()); List<LuceneResultStruct<Object, Object>> list = luceneQuery.findResults(); luceneQuery.findPages(); if(list == null || list.isEmpty()) return null; String sortField = criteria.getSortField(); BeanComparator beanComparator = null; Collection<Map.Entry<Object,Object>> results = null; if(sortField != null && sortField.trim().length() > 0 ) { beanComparator = new BeanComparator(sortField,criteria.isSortDescending()); Collection<Map.Entry<Object,Object>> set = new TreeSet<Map.Entry<Object,Object>>(beanComparator); list.parallelStream().forEach(e -> set.add(new MapEntry<Object,Object>(e.getKey(), e.getValue()))); results = set; } else { results = list.stream().map( e -> new MapEntry<>(e.getKey(), e.getValue())).collect(Collectors.toList()); } //add to pages List<Collection<Object>> pagesCollection = Organizer.toKeyPages(results, criteria.getEndIndex() - criteria.getBeginIndex()); int pageIndex = 0; String key = null; ArrayList<String> keys = new ArrayList<String>(10); for (Collection<Object> page : pagesCollection) { //store in region key = new StringBuilder().append(criteria.getId()).append("-").append(pageIndex++).toString(); pageKeysRegion.put(key, page); keys.add(key); } keys.trimToSize(); return keys; } catch (LuceneQueryException e) { throw new SystemException(e); } }
class class_name[name] begin[{] method[saveSearchResultsWithPageKeys, return_type[type[Collection]], modifier[public], parameter[criteria, pageKeysRegion]] begin[{] if[binary_operation[member[.criteria], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[binary_operation[call[criteria.getQuery, parameter[]], ==, literal[null]], ||, binary_operation[call[criteria.getQuery, parameter[]], ==, literal[0]]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[binary_operation[call[criteria.getIndexName, parameter[]], ==, literal[null]], ||, binary_operation[call[criteria.getIndexName, parameter[]], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Default criteria's indexName is required")], 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[}] if[binary_operation[binary_operation[call[criteria.getId, parameter[]], ==, literal[null]], ||, binary_operation[call[criteria.getId, parameter[]], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Default criteria's id is required")], 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[}] if[binary_operation[binary_operation[call[criteria.getDefaultField, parameter[]], ==, literal[null]], ||, binary_operation[call[criteria.getDefaultField, parameter[]], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Default criteria's defaultField is required")], 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[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=createLuceneQueryFactory, postfix_operators=[], prefix_operators=[], qualifier=luceneService, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIndexName, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getRegionName, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getQuery, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getDefaultField, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=create, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=luceneQuery)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=LuceneQuery, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=findResults, postfix_operators=[], prefix_operators=[], qualifier=luceneQuery, selectors=[], type_arguments=None), name=list)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=LuceneResultStruct, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=findPages, postfix_operators=[], prefix_operators=[], qualifier=luceneQuery, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSortField, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), name=sortField)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=beanComparator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BeanComparator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=results)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))], dimensions=[], name=Collection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=sortField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=sortField, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[MethodInvocation(arguments=[LambdaExpression(body=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=MapEntry, sub_type=None)), parameters=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toList, postfix_operators=[], prefix_operators=[], qualifier=Collectors, selectors=[], type_arguments=None)], member=collect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=beanComparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=sortField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=isSortDescending, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BeanComparator, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=beanComparator, postfix_operators=[], prefix_operators=[], qualifier=, 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=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))], dimensions=None, name=TreeSet, sub_type=None)), name=set)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))], dimensions=[], name=Collection, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=parallelStream, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], 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)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=MapEntry, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[], type_arguments=None), parameters=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=forEach, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEndIndex, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getBeginIndex, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), operator=-)], member=toKeyPages, postfix_operators=[], prefix_operators=[], qualifier=Organizer, selectors=[], type_arguments=None), name=pagesCollection)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Collection, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=pageIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], 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=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=keys)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=pageIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=page, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=pageKeysRegion, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pagesCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=page)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Collection, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=trimToSize, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=SystemException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['LuceneQueryException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Collection] operator[<] identifier[String] operator[>] identifier[saveSearchResultsWithPageKeys] operator[SEP] identifier[TextPageCriteria] identifier[criteria] , identifier[Region] operator[<] identifier[String] , identifier[Collection] operator[<] operator[?] operator[>] operator[>] identifier[pageKeysRegion] operator[SEP] { Keyword[if] operator[SEP] identifier[criteria] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[criteria] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[getIndexName] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[criteria] operator[SEP] identifier[getIndexName] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[criteria] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[getDefaultField] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[criteria] operator[SEP] identifier[getDefaultField] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[LuceneQuery] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[luceneQuery] operator[=] identifier[luceneService] operator[SEP] identifier[createLuceneQueryFactory] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[criteria] operator[SEP] identifier[getIndexName] operator[SEP] operator[SEP] , identifier[criteria] operator[SEP] identifier[getRegionName] operator[SEP] operator[SEP] , identifier[criteria] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] , identifier[criteria] operator[SEP] identifier[getDefaultField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[LuceneResultStruct] operator[<] identifier[Object] , identifier[Object] operator[>] operator[>] identifier[list] operator[=] identifier[luceneQuery] operator[SEP] identifier[findResults] operator[SEP] operator[SEP] operator[SEP] identifier[luceneQuery] operator[SEP] identifier[findPages] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[==] Other[null] operator[||] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[String] identifier[sortField] operator[=] identifier[criteria] operator[SEP] identifier[getSortField] operator[SEP] operator[SEP] operator[SEP] identifier[BeanComparator] identifier[beanComparator] operator[=] Other[null] operator[SEP] identifier[Collection] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Object] operator[>] operator[>] identifier[results] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[sortField] operator[!=] Other[null] operator[&&] identifier[sortField] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[beanComparator] operator[=] Keyword[new] identifier[BeanComparator] operator[SEP] identifier[sortField] , identifier[criteria] operator[SEP] identifier[isSortDescending] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Object] operator[>] operator[>] identifier[set] operator[=] Keyword[new] identifier[TreeSet] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Object] operator[>] operator[>] operator[SEP] identifier[beanComparator] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[parallelStream] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[e] operator[->] identifier[set] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[MapEntry] operator[<] identifier[Object] , identifier[Object] operator[>] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[=] identifier[set] operator[SEP] } Keyword[else] { identifier[results] operator[=] identifier[list] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[e] operator[->] Keyword[new] identifier[MapEntry] operator[<] operator[>] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[Collection] operator[<] identifier[Object] operator[>] operator[>] identifier[pagesCollection] operator[=] identifier[Organizer] operator[SEP] identifier[toKeyPages] operator[SEP] identifier[results] , identifier[criteria] operator[SEP] identifier[getEndIndex] operator[SEP] operator[SEP] operator[-] identifier[criteria] operator[SEP] identifier[getBeginIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[pageIndex] operator[=] Other[0] operator[SEP] identifier[String] identifier[key] operator[=] Other[null] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[keys] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] Other[10] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Collection] operator[<] identifier[Object] operator[>] identifier[page] operator[:] identifier[pagesCollection] operator[SEP] { identifier[key] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[criteria] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[pageIndex] operator[++] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[pageKeysRegion] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[page] operator[SEP] operator[SEP] identifier[keys] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP] } identifier[keys] operator[SEP] identifier[trimToSize] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[keys] operator[SEP] } Keyword[catch] operator[SEP] identifier[LuceneQueryException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SystemException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
private static BaseTypeConverter lookupTypeConverter(Class type) { BaseTypeConverter converter = (BaseTypeConverter)TYPE_CONVERTERS.get(type); if(converter == null) { String msg = "Could not find a TypeConverter for converting a String to an object of type \"" + (type != null ? type.getName() : null) + "\""; TypeConverterNotFoundException tcn = new TypeConverterNotFoundException(msg); if(type == null) msg = Bundle.getErrorString("TypeUtils_nullType"); else msg = Bundle.getErrorString("TypeUtils_noConverterForType", new Object[]{type.getName()}); tcn.setLocalizedMessage(msg); LOGGER.error(msg); throw tcn; } return converter; }
class class_name[name] begin[{] method[lookupTypeConverter, return_type[type[BaseTypeConverter]], modifier[private static], parameter[type]] begin[{] local_variable[type[BaseTypeConverter], converter] if[binary_operation[member[.converter], ==, literal[null]]] begin[{] local_variable[type[String], msg] local_variable[type[TypeConverterNotFoundException], tcn] if[binary_operation[member[.type], ==, literal[null]]] begin[{] assign[member[.msg], call[Bundle.getErrorString, parameter[literal["TypeUtils_nullType"]]]] else begin[{] assign[member[.msg], call[Bundle.getErrorString, parameter[literal["TypeUtils_noConverterForType"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]] end[}] call[tcn.setLocalizedMessage, parameter[member[.msg]]] call[LOGGER.error, parameter[member[.msg]]] ThrowStatement(expression=MemberReference(member=tcn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] return[member[.converter]] end[}] END[}]
Keyword[private] Keyword[static] identifier[BaseTypeConverter] identifier[lookupTypeConverter] operator[SEP] identifier[Class] identifier[type] operator[SEP] { identifier[BaseTypeConverter] identifier[converter] operator[=] operator[SEP] identifier[BaseTypeConverter] operator[SEP] identifier[TYPE_CONVERTERS] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[converter] operator[==] Other[null] operator[SEP] { identifier[String] identifier[msg] operator[=] literal[String] operator[+] operator[SEP] identifier[type] operator[!=] Other[null] operator[?] identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] operator[+] literal[String] operator[SEP] identifier[TypeConverterNotFoundException] identifier[tcn] operator[=] Keyword[new] identifier[TypeConverterNotFoundException] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] identifier[msg] operator[=] identifier[Bundle] operator[SEP] identifier[getErrorString] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[else] identifier[msg] operator[=] identifier[Bundle] operator[SEP] identifier[getErrorString] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[tcn] operator[SEP] identifier[setLocalizedMessage] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[throw] identifier[tcn] operator[SEP] } Keyword[return] identifier[converter] operator[SEP] }
private String applyFilters(String methodName) { if (filters.isEmpty()) { return methodName; } Reader in = new StringReader(methodName); for (TokenFilter tf : filters) { in = tf.chain(in); } try { return CharStreams.toString(in); } catch (IOException e) { junit4.log("Could not apply filters to " + methodName + ": " + Throwables.getStackTraceAsString(e), Project.MSG_WARN); return methodName; } }
class class_name[name] begin[{] method[applyFilters, return_type[type[String]], modifier[private], parameter[methodName]] begin[{] if[call[filters.isEmpty, parameter[]]] begin[{] return[member[.methodName]] else begin[{] None end[}] local_variable[type[Reader], in] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=chain, postfix_operators=[], prefix_operators=[], qualifier=tf, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=filters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tf)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TokenFilter, sub_type=None))), label=None) TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=CharStreams, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not apply filters to "), operandr=MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTraceAsString, postfix_operators=[], prefix_operators=[], qualifier=Throwables, selectors=[], type_arguments=None), operator=+), MemberReference(member=MSG_WARN, postfix_operators=[], prefix_operators=[], qualifier=Project, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=junit4, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] identifier[String] identifier[applyFilters] operator[SEP] identifier[String] identifier[methodName] operator[SEP] { Keyword[if] operator[SEP] identifier[filters] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[methodName] operator[SEP] } identifier[Reader] identifier[in] operator[=] Keyword[new] identifier[StringReader] operator[SEP] identifier[methodName] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TokenFilter] identifier[tf] operator[:] identifier[filters] operator[SEP] { identifier[in] operator[=] identifier[tf] operator[SEP] identifier[chain] operator[SEP] identifier[in] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] identifier[CharStreams] operator[SEP] identifier[toString] operator[SEP] identifier[in] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[junit4] operator[SEP] identifier[log] operator[SEP] literal[String] operator[+] identifier[methodName] operator[+] literal[String] operator[+] identifier[Throwables] operator[SEP] identifier[getStackTraceAsString] operator[SEP] identifier[e] operator[SEP] , identifier[Project] operator[SEP] identifier[MSG_WARN] operator[SEP] operator[SEP] Keyword[return] identifier[methodName] operator[SEP] } }
private boolean checkDestinationAccess( DestinationHandler destination, String discriminator, String userId) throws SIDiscriminatorSyntaxException { if (tc.isEntryEnabled()) SibTr.entry( tc, "checkDestinationAccess", new Object[] { destination, discriminator, userId }); boolean allowed = true; // Map a null userid to an empty string if (userId == null) { userId = ""; // Empty string means those users that have not // been authenticated, but who are still, of course, // members of EVERYONE. } // We use the userid flavour of security context as we need // to drive the userid flavour of the sib.security checkDestinationAccess // which is attuned for access checks for messages from foreign buses. SecurityContext secContext = new SecurityContext(userId, discriminator); // Check authority to access the destination if (!destination .checkDestinationAccess(secContext, OperationType.RECEIVE)) { if (tc.isDebugEnabled()) SibTr.debug( tc, "checkDestinationAccess", "not authorized to produce to this destination"); // Build the message for the Exception and the Notification String nlsMessage = nls_cwsik.getFormattedMessage("DELIVERY_ERROR_SIRC_18", // USER_NOT_AUTH_SEND_ERROR_CWSIP0306 new Object[] { destination.getName(), userId }, null); // Fire a Notification if Eventing is enabled iProxyHandler. getMessageProcessor(). getAccessChecker(). fireDestinationAccessNotAuthorizedEvent(destination.getName(), userId, OperationType.RECEIVE, nlsMessage); // sib.security will audit this allowed = false; } // Check authority to produce to discriminator if (allowed) { // If the discriminator is non-wildcarded, we can check authority to consume on // the discriminator. if (discriminator != null && !iProxyHandler .getMessageProcessor() .getMessageProcessorMatching() .isWildCarded(discriminator)) { if (!destination .checkDiscriminatorAccess(secContext, OperationType.RECEIVE)) { if (tc.isDebugEnabled()) SibTr.debug( tc, "checkDestinationAccess", "not authorized to produce to this discriminator"); // Write an audit record if access is denied SibTr .audit( tc, nls_cwsik .getFormattedMessage("DELIVERY_ERROR_SIRC_20", // USER_NOT_AUTH_SEND_ERROR_CWSIP0308 new Object[] { destination.getName(), discriminator, userId }, null)); allowed = false; } } } if (tc.isEntryEnabled()) SibTr.exit(tc, "checkDestinationAccess", new Boolean(allowed)); return allowed; }
class class_name[name] begin[{] method[checkDestinationAccess, return_type[type[boolean]], modifier[private], parameter[destination, discriminator, userId]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["checkDestinationAccess"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=destination, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=discriminator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] local_variable[type[boolean], allowed] if[binary_operation[member[.userId], ==, literal[null]]] begin[{] assign[member[.userId], literal[""]] else begin[{] None end[}] local_variable[type[SecurityContext], secContext] if[call[destination.checkDestinationAccess, parameter[member[.secContext], member[OperationType.RECEIVE]]]] begin[{] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[SibTr.debug, parameter[member[.tc], literal["checkDestinationAccess"], literal["not authorized to produce to this destination"]]] else begin[{] None end[}] local_variable[type[String], nlsMessage] call[iProxyHandler.getMessageProcessor, parameter[]] assign[member[.allowed], literal[false]] else begin[{] None end[}] if[member[.allowed]] begin[{] if[binary_operation[binary_operation[member[.discriminator], !=, literal[null]], &&, call[iProxyHandler.getMessageProcessor, parameter[]]]] begin[{] if[call[destination.checkDiscriminatorAccess, parameter[member[.secContext], member[OperationType.RECEIVE]]]] begin[{] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[SibTr.debug, parameter[member[.tc], literal["checkDestinationAccess"], literal["not authorized to produce to this discriminator"]]] else begin[{] None end[}] call[SibTr.audit, parameter[member[.tc], call[nls_cwsik.getFormattedMessage, parameter[literal["DELIVERY_ERROR_SIRC_20"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=destination, selectors=[], type_arguments=None), MemberReference(member=discriminator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), literal[null]]]]] assign[member[.allowed], literal[false]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["checkDestinationAccess"], ClassCreator(arguments=[MemberReference(member=allowed, 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=Boolean, sub_type=None))]] else begin[{] None end[}] return[member[.allowed]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[checkDestinationAccess] operator[SEP] identifier[DestinationHandler] identifier[destination] , identifier[String] identifier[discriminator] , identifier[String] identifier[userId] operator[SEP] Keyword[throws] identifier[SIDiscriminatorSyntaxException] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[destination] , identifier[discriminator] , identifier[userId] } operator[SEP] operator[SEP] Keyword[boolean] identifier[allowed] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[userId] operator[==] Other[null] operator[SEP] { identifier[userId] operator[=] literal[String] operator[SEP] } identifier[SecurityContext] identifier[secContext] operator[=] Keyword[new] identifier[SecurityContext] operator[SEP] identifier[userId] , identifier[discriminator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[destination] operator[SEP] identifier[checkDestinationAccess] operator[SEP] identifier[secContext] , identifier[OperationType] operator[SEP] identifier[RECEIVE] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[nlsMessage] operator[=] identifier[nls_cwsik] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[destination] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[userId] } , Other[null] operator[SEP] operator[SEP] identifier[iProxyHandler] operator[SEP] identifier[getMessageProcessor] operator[SEP] operator[SEP] operator[SEP] identifier[getAccessChecker] operator[SEP] operator[SEP] operator[SEP] identifier[fireDestinationAccessNotAuthorizedEvent] operator[SEP] identifier[destination] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[userId] , identifier[OperationType] operator[SEP] identifier[RECEIVE] , identifier[nlsMessage] operator[SEP] operator[SEP] identifier[allowed] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[allowed] operator[SEP] { Keyword[if] operator[SEP] identifier[discriminator] operator[!=] Other[null] operator[&&] operator[!] identifier[iProxyHandler] operator[SEP] identifier[getMessageProcessor] operator[SEP] operator[SEP] operator[SEP] identifier[getMessageProcessorMatching] operator[SEP] operator[SEP] operator[SEP] identifier[isWildCarded] operator[SEP] identifier[discriminator] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[destination] operator[SEP] identifier[checkDiscriminatorAccess] operator[SEP] identifier[secContext] , identifier[OperationType] operator[SEP] identifier[RECEIVE] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[audit] operator[SEP] identifier[tc] , identifier[nls_cwsik] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[destination] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[discriminator] , identifier[userId] } , Other[null] operator[SEP] operator[SEP] operator[SEP] identifier[allowed] operator[=] literal[boolean] operator[SEP] } } } Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Boolean] operator[SEP] identifier[allowed] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[allowed] operator[SEP] }
protected JsJmsMessage instantiateMessage() throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "instantiateMessage"); // Create a new message object. JsJmsMessage newMsg = jmfact.createJmsMessage(); messageClass = CLASS_NONE; // d317373 default the MSG_TYPE to be DATAGRAM until setReplyTo is called newMsg.setNonNullProperty(ApiJmsConstants.MSG_TYPE_PROPERTY, Integer.valueOf(ApiJmsConstants.MQMT_DATAGRAM)); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "instantiateMessage", newMsg); return newMsg; }
class class_name[name] begin[{] method[instantiateMessage, return_type[type[JsJmsMessage]], modifier[protected], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["instantiateMessage"]]] else begin[{] None end[}] local_variable[type[JsJmsMessage], newMsg] assign[member[.messageClass], member[.CLASS_NONE]] call[newMsg.setNonNullProperty, parameter[member[ApiJmsConstants.MSG_TYPE_PROPERTY], call[Integer.valueOf, parameter[member[ApiJmsConstants.MQMT_DATAGRAM]]]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["instantiateMessage"], member[.newMsg]]] else begin[{] None end[}] return[member[.newMsg]] end[}] END[}]
Keyword[protected] identifier[JsJmsMessage] identifier[instantiateMessage] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[JsJmsMessage] identifier[newMsg] operator[=] identifier[jmfact] operator[SEP] identifier[createJmsMessage] operator[SEP] operator[SEP] operator[SEP] identifier[messageClass] operator[=] identifier[CLASS_NONE] operator[SEP] identifier[newMsg] operator[SEP] identifier[setNonNullProperty] operator[SEP] identifier[ApiJmsConstants] operator[SEP] identifier[MSG_TYPE_PROPERTY] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[ApiJmsConstants] operator[SEP] identifier[MQMT_DATAGRAM] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[newMsg] operator[SEP] operator[SEP] Keyword[return] identifier[newMsg] operator[SEP] }
public void encodeData(AsnOutputStream asnOs) throws MAPException { if (this.areaDefinition == null) { throw new MAPException("Error while encoding " + _PrimitiveName + " the mandatory parameter[areaDefinition [0] AreaDefinition] is not defined"); } ((AreaDefinitionImpl) this.areaDefinition).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _TAG_areaDefinition); try { if (this.occurrenceInfo != null) { asnOs.writeInteger(Tag.CLASS_CONTEXT_SPECIFIC, _TAG_OCCURRENCE_INFO, this.occurrenceInfo.getInfo()); } if (this.intervalTime != null) { asnOs.writeInteger(Tag.CLASS_CONTEXT_SPECIFIC, _TAG_INTERVAL_TIME, this.intervalTime); } } catch (IOException e) { throw new MAPException("IOException when encoding " + _PrimitiveName + ": " + e.getMessage(), e); } catch (AsnException e) { throw new MAPException("AsnException when encoding " + _PrimitiveName + ": " + e.getMessage(), e); } }
class class_name[name] begin[{] method[encodeData, return_type[void], modifier[public], parameter[asnOs]] begin[{] if[binary_operation[THIS[member[None.areaDefinition]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while encoding "), operandr=MemberReference(member=_PrimitiveName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" the mandatory parameter[areaDefinition [0] AreaDefinition] is not defined"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MAPException, sub_type=None)), label=None) else begin[{] None end[}] Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=areaDefinition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type=ReferenceType(arguments=None, dimensions=[], name=AreaDefinitionImpl, sub_type=None)) TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=occurrenceInfo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), 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=CLASS_CONTEXT_SPECIFIC, postfix_operators=[], prefix_operators=[], qualifier=Tag, selectors=[]), MemberReference(member=_TAG_OCCURRENCE_INFO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=occurrenceInfo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getInfo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=writeInteger, postfix_operators=[], prefix_operators=[], qualifier=asnOs, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=intervalTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), 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=CLASS_CONTEXT_SPECIFIC, postfix_operators=[], prefix_operators=[], qualifier=Tag, selectors=[]), MemberReference(member=_TAG_INTERVAL_TIME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=intervalTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=writeInteger, postfix_operators=[], prefix_operators=[], qualifier=asnOs, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOException when encoding "), operandr=MemberReference(member=_PrimitiveName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), 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=MAPException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AsnException when encoding "), operandr=MemberReference(member=_PrimitiveName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), 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=MAPException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['AsnException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[encodeData] operator[SEP] identifier[AsnOutputStream] identifier[asnOs] operator[SEP] Keyword[throws] identifier[MAPException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[areaDefinition] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[MAPException] operator[SEP] literal[String] operator[+] identifier[_PrimitiveName] operator[+] literal[String] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[AreaDefinitionImpl] operator[SEP] Keyword[this] operator[SEP] identifier[areaDefinition] operator[SEP] operator[SEP] identifier[encodeAll] operator[SEP] identifier[asnOs] , identifier[Tag] operator[SEP] identifier[CLASS_CONTEXT_SPECIFIC] , identifier[_TAG_areaDefinition] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[occurrenceInfo] operator[!=] Other[null] operator[SEP] { identifier[asnOs] operator[SEP] identifier[writeInteger] operator[SEP] identifier[Tag] operator[SEP] identifier[CLASS_CONTEXT_SPECIFIC] , identifier[_TAG_OCCURRENCE_INFO] , Keyword[this] operator[SEP] identifier[occurrenceInfo] operator[SEP] identifier[getInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[intervalTime] operator[!=] Other[null] operator[SEP] { identifier[asnOs] operator[SEP] identifier[writeInteger] operator[SEP] identifier[Tag] operator[SEP] identifier[CLASS_CONTEXT_SPECIFIC] , identifier[_TAG_INTERVAL_TIME] , Keyword[this] operator[SEP] identifier[intervalTime] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[MAPException] operator[SEP] literal[String] operator[+] identifier[_PrimitiveName] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[AsnException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[MAPException] operator[SEP] literal[String] operator[+] identifier[_PrimitiveName] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
static IntersectionImplR wrapInstance(final Memory srcMem, final long seed) { final IntersectionImplR impl = new IntersectionImplR((WritableMemory) srcMem, seed, false); return internalWrapInstance(srcMem, impl); }
class class_name[name] begin[{] method[wrapInstance, return_type[type[IntersectionImplR]], modifier[static], parameter[srcMem, seed]] begin[{] local_variable[type[IntersectionImplR], impl] return[call[.internalWrapInstance, parameter[member[.srcMem], member[.impl]]]] end[}] END[}]
Keyword[static] identifier[IntersectionImplR] identifier[wrapInstance] operator[SEP] Keyword[final] identifier[Memory] identifier[srcMem] , Keyword[final] Keyword[long] identifier[seed] operator[SEP] { Keyword[final] identifier[IntersectionImplR] identifier[impl] operator[=] Keyword[new] identifier[IntersectionImplR] operator[SEP] operator[SEP] identifier[WritableMemory] operator[SEP] identifier[srcMem] , identifier[seed] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[internalWrapInstance] operator[SEP] identifier[srcMem] , identifier[impl] operator[SEP] operator[SEP] }
public ProjectFile read() throws MPXJException { try { m_reader = new AstaReader(); ProjectFile project = m_reader.getProject(); project.getEventManager().addProjectListeners(m_projectListeners); processProjectProperties(); processCalendars(); processResources(); processTasks(); processPredecessors(); processAssignments(); m_reader = null; return (project); } catch (SQLException ex) { throw new MPXJException(MPXJException.READ_ERROR, ex); } finally { if (m_allocatedConnection && m_connection != null) { try { m_connection.close(); } catch (SQLException ex) { // silently ignore errors on close } m_connection = null; } } }
class class_name[name] begin[{] method[read, return_type[type[ProjectFile]], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_reader, 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=None, dimensions=None, name=AstaReader, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getProject, postfix_operators=[], prefix_operators=[], qualifier=m_reader, selectors=[], type_arguments=None), name=project)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProjectFile, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getEventManager, postfix_operators=[], prefix_operators=[], qualifier=project, selectors=[MethodInvocation(arguments=[MemberReference(member=m_projectListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addProjectListeners, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=processProjectProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=processCalendars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=processResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=processTasks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=processPredecessors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=processAssignments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ReturnStatement(expression=MemberReference(member=project, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=READ_ERROR, postfix_operators=[], prefix_operators=[], qualifier=MPXJException, selectors=[]), MemberReference(member=ex, 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=MPXJException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SQLException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m_allocatedConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=m_connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), 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=m_connection, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SQLException']))], finally_block=None, label=None, resources=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[ProjectFile] identifier[read] operator[SEP] operator[SEP] Keyword[throws] identifier[MPXJException] { Keyword[try] { identifier[m_reader] operator[=] Keyword[new] identifier[AstaReader] operator[SEP] operator[SEP] operator[SEP] identifier[ProjectFile] identifier[project] operator[=] identifier[m_reader] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] identifier[project] operator[SEP] identifier[getEventManager] operator[SEP] operator[SEP] operator[SEP] identifier[addProjectListeners] operator[SEP] identifier[m_projectListeners] operator[SEP] operator[SEP] identifier[processProjectProperties] operator[SEP] operator[SEP] operator[SEP] identifier[processCalendars] operator[SEP] operator[SEP] operator[SEP] identifier[processResources] operator[SEP] operator[SEP] operator[SEP] identifier[processTasks] operator[SEP] operator[SEP] operator[SEP] identifier[processPredecessors] operator[SEP] operator[SEP] operator[SEP] identifier[processAssignments] operator[SEP] operator[SEP] operator[SEP] identifier[m_reader] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[project] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[MPXJException] operator[SEP] identifier[MPXJException] operator[SEP] identifier[READ_ERROR] , identifier[ex] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[m_allocatedConnection] operator[&&] identifier[m_connection] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[m_connection] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[ex] operator[SEP] { } identifier[m_connection] operator[=] Other[null] operator[SEP] } } }
public Pager<TreeItem> getTree(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException { return (getTree(projectIdOrPath, "/", "master", false, itemsPerPage)); }
class class_name[name] begin[{] method[getTree, return_type[type[Pager]], modifier[public], parameter[projectIdOrPath, itemsPerPage]] begin[{] return[call[.getTree, parameter[member[.projectIdOrPath], literal["/"], literal["master"], literal[false], member[.itemsPerPage]]]] end[}] END[}]
Keyword[public] identifier[Pager] operator[<] identifier[TreeItem] operator[>] identifier[getTree] operator[SEP] identifier[Object] identifier[projectIdOrPath] , Keyword[int] identifier[itemsPerPage] operator[SEP] Keyword[throws] identifier[GitLabApiException] { Keyword[return] operator[SEP] identifier[getTree] operator[SEP] identifier[projectIdOrPath] , literal[String] , literal[String] , literal[boolean] , identifier[itemsPerPage] operator[SEP] operator[SEP] operator[SEP] }
private Set<String> validateAndExtractFieldsToHash( Record record, Set<String> fieldsDontExist, Set<String> fieldsWithListOrMapType, Set<String> fieldsWithNull, Collection<String> matchingFieldsPath ) { Set<String> validFieldsToHashForThisConfig = new HashSet<String>(); for (String matchingFieldPath : matchingFieldsPath) { if (record.has(matchingFieldPath)) { Field field = record.get(matchingFieldPath); if (UNSUPPORTED_FIELD_TYPES.contains(field.getType())) { fieldsWithListOrMapType.add(matchingFieldPath); } else if (field.getValue() == null) { fieldsWithNull.add(matchingFieldPath); } else { validFieldsToHashForThisConfig.add(matchingFieldPath); } } else { fieldsDontExist.add(matchingFieldPath); } } return validFieldsToHashForThisConfig; }
class class_name[name] begin[{] method[validateAndExtractFieldsToHash, return_type[type[Set]], modifier[private], parameter[record, fieldsDontExist, fieldsWithListOrMapType, fieldsWithNull, matchingFieldsPath]] begin[{] local_variable[type[Set], validFieldsToHashForThisConfig] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=matchingFieldPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=has, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=matchingFieldPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fieldsDontExist, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=matchingFieldPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=UNSUPPORTED_FIELD_TYPES, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=matchingFieldPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=validFieldsToHashForThisConfig, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=matchingFieldPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fieldsWithNull, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=matchingFieldPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fieldsWithListOrMapType, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=matchingFieldsPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=matchingFieldPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.validFieldsToHashForThisConfig]] end[}] END[}]
Keyword[private] identifier[Set] operator[<] identifier[String] operator[>] identifier[validateAndExtractFieldsToHash] operator[SEP] identifier[Record] identifier[record] , identifier[Set] operator[<] identifier[String] operator[>] identifier[fieldsDontExist] , identifier[Set] operator[<] identifier[String] operator[>] identifier[fieldsWithListOrMapType] , identifier[Set] operator[<] identifier[String] operator[>] identifier[fieldsWithNull] , identifier[Collection] operator[<] identifier[String] operator[>] identifier[matchingFieldsPath] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[validFieldsToHashForThisConfig] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[matchingFieldPath] operator[:] identifier[matchingFieldsPath] operator[SEP] { Keyword[if] operator[SEP] identifier[record] operator[SEP] identifier[has] operator[SEP] identifier[matchingFieldPath] operator[SEP] operator[SEP] { identifier[Field] identifier[field] operator[=] identifier[record] operator[SEP] identifier[get] operator[SEP] identifier[matchingFieldPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[UNSUPPORTED_FIELD_TYPES] operator[SEP] identifier[contains] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[fieldsWithListOrMapType] operator[SEP] identifier[add] operator[SEP] identifier[matchingFieldPath] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[fieldsWithNull] operator[SEP] identifier[add] operator[SEP] identifier[matchingFieldPath] operator[SEP] operator[SEP] } Keyword[else] { identifier[validFieldsToHashForThisConfig] operator[SEP] identifier[add] operator[SEP] identifier[matchingFieldPath] operator[SEP] operator[SEP] } } Keyword[else] { identifier[fieldsDontExist] operator[SEP] identifier[add] operator[SEP] identifier[matchingFieldPath] operator[SEP] operator[SEP] } } Keyword[return] identifier[validFieldsToHashForThisConfig] operator[SEP] }
public void processTimeout(TimeoutEvent arg0) { synchronized (listeners) { Iterator<SipListener> iter = listeners.iterator(); while (iter.hasNext() == true) { SipListener listener = (SipListener) iter.next(); listener.processTimeout(arg0); } } }
class class_name[name] begin[{] method[processTimeout, return_type[void], modifier[public], parameter[arg0]] begin[{] SYNCHRONIZED[member[.listeners]] BEGIN[{] local_variable[type[Iterator], iter] while[binary_operation[call[iter.hasNext, parameter[]], ==, literal[true]]] begin[{] local_variable[type[SipListener], listener] call[listener.processTimeout, parameter[member[.arg0]]] end[}] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[processTimeout] operator[SEP] identifier[TimeoutEvent] identifier[arg0] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[listeners] operator[SEP] { identifier[Iterator] operator[<] identifier[SipListener] operator[>] identifier[iter] operator[=] identifier[listeners] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] { identifier[SipListener] identifier[listener] operator[=] operator[SEP] identifier[SipListener] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[listener] operator[SEP] identifier[processTimeout] operator[SEP] identifier[arg0] operator[SEP] operator[SEP] } } }
public static IGenericDomainAccess createGenericDomainAccess(IDBAccess dbAccess, String domainName, DomainLabelUse domainLabelUse) { return IDomainAccessFactory.INSTANCE.createGenericDomainAccess(dbAccess, domainName, domainLabelUse); }
class class_name[name] begin[{] method[createGenericDomainAccess, return_type[type[IGenericDomainAccess]], modifier[public static], parameter[dbAccess, domainName, domainLabelUse]] begin[{] return[call[IDomainAccessFactory.INSTANCE.createGenericDomainAccess, parameter[member[.dbAccess], member[.domainName], member[.domainLabelUse]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[IGenericDomainAccess] identifier[createGenericDomainAccess] operator[SEP] identifier[IDBAccess] identifier[dbAccess] , identifier[String] identifier[domainName] , identifier[DomainLabelUse] identifier[domainLabelUse] operator[SEP] { Keyword[return] identifier[IDomainAccessFactory] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[createGenericDomainAccess] operator[SEP] identifier[dbAccess] , identifier[domainName] , identifier[domainLabelUse] operator[SEP] operator[SEP] }
public static Resource getResourceByType(int resourceType) { for (Resource resource : Resources.values()) { if (resource.resourceType() == resourceType) { return resource; } } return null; }
class class_name[name] begin[{] method[getResourceByType, return_type[type[Resource]], modifier[public static], parameter[resourceType]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=resourceType, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None), operandr=MemberReference(member=resourceType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=Resources, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Resource, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Resource] identifier[getResourceByType] operator[SEP] Keyword[int] identifier[resourceType] operator[SEP] { Keyword[for] operator[SEP] identifier[Resource] identifier[resource] operator[:] identifier[Resources] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[resource] operator[SEP] identifier[resourceType] operator[SEP] operator[SEP] operator[==] identifier[resourceType] operator[SEP] { Keyword[return] identifier[resource] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public String getStr(String attr) { // return (String)attrs.get(attr); Object s = attrs.get(attr); return s != null ? s.toString() : null; }
class class_name[name] begin[{] method[getStr, return_type[type[String]], modifier[public], parameter[attr]] begin[{] local_variable[type[Object], s] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] identifier[String] identifier[getStr] operator[SEP] identifier[String] identifier[attr] operator[SEP] { identifier[Object] identifier[s] operator[=] identifier[attrs] operator[SEP] identifier[get] operator[SEP] identifier[attr] operator[SEP] operator[SEP] Keyword[return] identifier[s] operator[!=] Other[null] operator[?] identifier[s] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] }
static List<String> parsePattern(String pattern) { List<String> parameters = new ArrayList<>(4); Matcher matcher = PARAM_REGEX.matcher(pattern); while (matcher.find()) { parameters.add(matcher.group(1)); } return parameters; }
class class_name[name] begin[{] method[parsePattern, return_type[type[List]], modifier[static], parameter[pattern]] begin[{] local_variable[type[List], parameters] local_variable[type[Matcher], matcher] while[call[matcher.find, parameter[]]] begin[{] call[parameters.add, parameter[call[matcher.group, parameter[literal[1]]]]] end[}] return[member[.parameters]] end[}] END[}]
Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[parsePattern] operator[SEP] identifier[String] identifier[pattern] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[parameters] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[Matcher] identifier[matcher] operator[=] identifier[PARAM_REGEX] operator[SEP] identifier[matcher] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[parameters] operator[SEP] identifier[add] operator[SEP] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[parameters] operator[SEP] }
public static @Nonnull Predicate acquiredLock(final @Nonnull String className) { return new Predicate() { @Override public boolean isValid(@Nonnull ProcessThread<?, ?, ?> thread) { for (ThreadLock lock: thread.getAcquiredLocks()) { if (lock.getClassName().equals(className)) return true; } return false; } }; }
class class_name[name] begin[{] method[acquiredLock, return_type[type[Predicate]], modifier[public static], parameter[className]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=MethodInvocation(arguments=[], member=getAcquiredLocks, postfix_operators=[], prefix_operators=[], qualifier=thread, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=lock)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ThreadLock, sub_type=None))), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], documentation=None, modifiers={'public'}, name=isValid, parameters=[FormalParameter(annotations=[Annotation(element=None, name=Nonnull)], modifiers=set(), name=thread, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ProcessThread, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Predicate, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] annotation[@] identifier[Nonnull] identifier[Predicate] identifier[acquiredLock] operator[SEP] Keyword[final] annotation[@] identifier[Nonnull] identifier[String] identifier[className] operator[SEP] { Keyword[return] Keyword[new] identifier[Predicate] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isValid] operator[SEP] annotation[@] identifier[Nonnull] identifier[ProcessThread] operator[<] operator[?] , operator[?] , operator[?] operator[>] identifier[thread] operator[SEP] { Keyword[for] operator[SEP] identifier[ThreadLock] identifier[lock] operator[:] identifier[thread] operator[SEP] identifier[getAcquiredLocks] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[lock] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[className] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } } operator[SEP] }
public static <A> Lens.Simple<Iterable<A>, Iterable<A>> tail() { return simpleLens(Tail::tail, fn2(Head.<A>head().andThen(o -> o.fmap(cons()).orElse(id()))).toBiFunction()); }
class class_name[name] begin[{] method[tail, return_type[type[Lens]], modifier[public static], parameter[]] begin[{] return[call[.simpleLens, parameter[MethodReference(expression=MemberReference(member=Tail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=tail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), call[.fn2, parameter[call[.Head, parameter[]]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[A] operator[>] identifier[Lens] operator[SEP] identifier[Simple] operator[<] identifier[Iterable] operator[<] identifier[A] operator[>] , identifier[Iterable] operator[<] identifier[A] operator[>] operator[>] identifier[tail] operator[SEP] operator[SEP] { Keyword[return] identifier[simpleLens] operator[SEP] identifier[Tail] operator[::] identifier[tail] , identifier[fn2] operator[SEP] identifier[Head] operator[SEP] operator[<] identifier[A] operator[>] identifier[head] operator[SEP] operator[SEP] operator[SEP] identifier[andThen] operator[SEP] identifier[o] operator[->] identifier[o] operator[SEP] identifier[fmap] operator[SEP] identifier[cons] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toBiFunction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void accum(FgModel model, int i, Accumulator ac) { try { accumWithException(model, i, ac); } catch(Throwable t) { log.error("Skipping example " + i + " due to throwable: " + t.getMessage()); t.printStackTrace(); } }
class class_name[name] begin[{] method[accum, return_type[void], modifier[public], parameter[model, i, ac]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accumWithException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Skipping example "), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" due to throwable: "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[accum] operator[SEP] identifier[FgModel] identifier[model] , Keyword[int] identifier[i] , identifier[Accumulator] identifier[ac] operator[SEP] { Keyword[try] { identifier[accumWithException] operator[SEP] identifier[model] , identifier[i] , identifier[ac] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[i] operator[+] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[t] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } }
public static void sendDevTimeError( String messageKey, Throwable cause, int productionTimeErrorCode, ServletRequest request, ServletResponse response, ServletContext servletContext, Object[] messageArgs ) throws IOException { sendDevTimeError( messageKey, messageArgs, cause, productionTimeErrorCode, request, response, servletContext ); }
class class_name[name] begin[{] method[sendDevTimeError, return_type[void], modifier[public static], parameter[messageKey, cause, productionTimeErrorCode, request, response, servletContext, messageArgs]] begin[{] call[.sendDevTimeError, parameter[member[.messageKey], member[.messageArgs], member[.cause], member[.productionTimeErrorCode], member[.request], member[.response], member[.servletContext]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[sendDevTimeError] operator[SEP] identifier[String] identifier[messageKey] , identifier[Throwable] identifier[cause] , Keyword[int] identifier[productionTimeErrorCode] , identifier[ServletRequest] identifier[request] , identifier[ServletResponse] identifier[response] , identifier[ServletContext] identifier[servletContext] , identifier[Object] operator[SEP] operator[SEP] identifier[messageArgs] operator[SEP] Keyword[throws] identifier[IOException] { identifier[sendDevTimeError] operator[SEP] identifier[messageKey] , identifier[messageArgs] , identifier[cause] , identifier[productionTimeErrorCode] , identifier[request] , identifier[response] , identifier[servletContext] operator[SEP] operator[SEP] }
public synchronized void putAll(SerialArrayList<U> data, int startIndex) { ensureCapacity((startIndex * unitSize) + data.maxByte); System.arraycopy(data.buffer, 0, this.buffer, startIndex * unitSize, data.maxByte); }
class class_name[name] begin[{] method[putAll, return_type[void], modifier[synchronized public], parameter[data, startIndex]] begin[{] call[.ensureCapacity, parameter[binary_operation[binary_operation[member[.startIndex], *, member[.unitSize]], +, member[data.maxByte]]]] call[System.arraycopy, parameter[member[data.buffer], literal[0], THIS[member[None.buffer]], binary_operation[member[.startIndex], *, member[.unitSize]], member[data.maxByte]]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[putAll] operator[SEP] identifier[SerialArrayList] operator[<] identifier[U] operator[>] identifier[data] , Keyword[int] identifier[startIndex] operator[SEP] { identifier[ensureCapacity] operator[SEP] operator[SEP] identifier[startIndex] operator[*] identifier[unitSize] operator[SEP] operator[+] identifier[data] operator[SEP] identifier[maxByte] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[data] operator[SEP] identifier[buffer] , Other[0] , Keyword[this] operator[SEP] identifier[buffer] , identifier[startIndex] operator[*] identifier[unitSize] , identifier[data] operator[SEP] identifier[maxByte] operator[SEP] operator[SEP] }
public boolean isNamespacePresent(final String requestedNamespace) { checkArgument(requestedNamespace.length() > 0); checkArgument(!requestedNamespace.endsWith(DELIM)); final String probe = requestedNamespace + DELIM; return Iterables.any(params.keySet(), StringUtils.startsWith(probe)); }
class class_name[name] begin[{] method[isNamespacePresent, return_type[type[boolean]], modifier[public], parameter[requestedNamespace]] begin[{] call[.checkArgument, parameter[binary_operation[call[requestedNamespace.length, parameter[]], >, literal[0]]]] call[.checkArgument, parameter[call[requestedNamespace.endsWith, parameter[member[.DELIM]]]]] local_variable[type[String], probe] return[call[Iterables.any, parameter[call[params.keySet, parameter[]], call[StringUtils.startsWith, parameter[member[.probe]]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isNamespacePresent] operator[SEP] Keyword[final] identifier[String] identifier[requestedNamespace] operator[SEP] { identifier[checkArgument] operator[SEP] identifier[requestedNamespace] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] operator[!] identifier[requestedNamespace] operator[SEP] identifier[endsWith] operator[SEP] identifier[DELIM] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[probe] operator[=] identifier[requestedNamespace] operator[+] identifier[DELIM] operator[SEP] Keyword[return] identifier[Iterables] operator[SEP] identifier[any] operator[SEP] identifier[params] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] , identifier[StringUtils] operator[SEP] identifier[startsWith] operator[SEP] identifier[probe] operator[SEP] operator[SEP] operator[SEP] }
private void tryReactivate(WorkQueue w, WorkQueue[] ws, int r) { long c; int sp, wl; WorkQueue v; if ((sp = (int)(c = ctl)) != 0 && w != null && ws != null && (wl = ws.length) > 0 && ((sp ^ r) & SS_SEQ) == 0 && (v = ws[(wl - 1) & sp]) != null) { long nc = (v.stackPred & SP_MASK) | (UC_MASK & (c + AC_UNIT)); int ns = sp & ~UNSIGNALLED; if (w.scanState < 0 && v.scanState == sp && U.compareAndSwapLong(this, CTL, c, nc)) { v.scanState = ns; LockSupport.unpark(v.parker); } } }
class class_name[name] begin[{] method[tryReactivate, return_type[void], modifier[private], parameter[w, ws, r]] begin[{] local_variable[type[long], c] local_variable[type[int], sp] local_variable[type[WorkQueue], v] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[assign[member[.sp], Cast(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ctl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), type=BasicType(dimensions=[], name=int))], !=, literal[0]], &&, binary_operation[member[.w], !=, literal[null]]], &&, binary_operation[member[.ws], !=, literal[null]]], &&, binary_operation[assign[member[.wl], member[ws.length]], >, literal[0]]], &&, binary_operation[binary_operation[binary_operation[member[.sp], ^, member[.r]], &, member[.SS_SEQ]], ==, literal[0]]], &&, binary_operation[assign[member[.v], member[.ws]], !=, literal[null]]]] begin[{] local_variable[type[long], nc] local_variable[type[int], ns] if[binary_operation[binary_operation[binary_operation[member[w.scanState], <, literal[0]], &&, binary_operation[member[v.scanState], ==, member[.sp]]], &&, call[U.compareAndSwapLong, parameter[THIS[], member[.CTL], member[.c], member[.nc]]]]] begin[{] assign[member[v.scanState], member[.ns]] call[LockSupport.unpark, parameter[member[v.parker]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[tryReactivate] operator[SEP] identifier[WorkQueue] identifier[w] , identifier[WorkQueue] operator[SEP] operator[SEP] identifier[ws] , Keyword[int] identifier[r] operator[SEP] { Keyword[long] identifier[c] operator[SEP] Keyword[int] identifier[sp] , identifier[wl] operator[SEP] identifier[WorkQueue] identifier[v] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[sp] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[ctl] operator[SEP] operator[SEP] operator[!=] Other[0] operator[&&] identifier[w] operator[!=] Other[null] operator[&&] identifier[ws] operator[!=] Other[null] operator[&&] operator[SEP] identifier[wl] operator[=] identifier[ws] operator[SEP] identifier[length] operator[SEP] operator[>] Other[0] operator[&&] operator[SEP] operator[SEP] identifier[sp] operator[^] identifier[r] operator[SEP] operator[&] identifier[SS_SEQ] operator[SEP] operator[==] Other[0] operator[&&] operator[SEP] identifier[v] operator[=] identifier[ws] operator[SEP] operator[SEP] identifier[wl] operator[-] Other[1] operator[SEP] operator[&] identifier[sp] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[long] identifier[nc] operator[=] operator[SEP] identifier[v] operator[SEP] identifier[stackPred] operator[&] identifier[SP_MASK] operator[SEP] operator[|] operator[SEP] identifier[UC_MASK] operator[&] operator[SEP] identifier[c] operator[+] identifier[AC_UNIT] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[ns] operator[=] identifier[sp] operator[&] operator[~] identifier[UNSIGNALLED] operator[SEP] Keyword[if] operator[SEP] identifier[w] operator[SEP] identifier[scanState] operator[<] Other[0] operator[&&] identifier[v] operator[SEP] identifier[scanState] operator[==] identifier[sp] operator[&&] identifier[U] operator[SEP] identifier[compareAndSwapLong] operator[SEP] Keyword[this] , identifier[CTL] , identifier[c] , identifier[nc] operator[SEP] operator[SEP] { identifier[v] operator[SEP] identifier[scanState] operator[=] identifier[ns] operator[SEP] identifier[LockSupport] operator[SEP] identifier[unpark] operator[SEP] identifier[v] operator[SEP] identifier[parker] operator[SEP] operator[SEP] } } }
@Resource(name = "portletPropertyToAttributeMappings") public void setPropertyMappings(Map<String, String> propertyMappings) { this.propertyToAttributeMappings = ImmutableBiMap.copyOf(propertyMappings); this.attributeToPropertyMappings = this.propertyToAttributeMappings.inverse(); }
class class_name[name] begin[{] method[setPropertyMappings, return_type[void], modifier[public], parameter[propertyMappings]] begin[{] assign[THIS[member[None.propertyToAttributeMappings]], call[ImmutableBiMap.copyOf, parameter[member[.propertyMappings]]]] assign[THIS[member[None.attributeToPropertyMappings]], THIS[member[None.propertyToAttributeMappings]call[None.inverse, parameter[]]]] end[}] END[}]
annotation[@] identifier[Resource] operator[SEP] identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[setPropertyMappings] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[propertyMappings] operator[SEP] { Keyword[this] operator[SEP] identifier[propertyToAttributeMappings] operator[=] identifier[ImmutableBiMap] operator[SEP] identifier[copyOf] operator[SEP] identifier[propertyMappings] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[attributeToPropertyMappings] operator[=] Keyword[this] operator[SEP] identifier[propertyToAttributeMappings] operator[SEP] identifier[inverse] operator[SEP] operator[SEP] operator[SEP] }
public EClass getIfcCartesianTransformationOperator2D() { if (ifcCartesianTransformationOperator2DEClass == null) { ifcCartesianTransformationOperator2DEClass = (EClass) EPackage.Registry.INSTANCE .getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(69); } return ifcCartesianTransformationOperator2DEClass; }
class class_name[name] begin[{] method[getIfcCartesianTransformationOperator2D, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcCartesianTransformationOperator2DEClass], ==, literal[null]]] begin[{] assign[member[.ifcCartesianTransformationOperator2DEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, 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=69)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcCartesianTransformationOperator2DEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcCartesianTransformationOperator2D] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcCartesianTransformationOperator2DEClass] operator[==] Other[null] operator[SEP] { identifier[ifcCartesianTransformationOperator2DEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[69] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcCartesianTransformationOperator2DEClass] operator[SEP] }
public String objectToString(Object obj) { String string = BaseTransport.convertObjectToString(obj); return string; }
class class_name[name] begin[{] method[objectToString, return_type[type[String]], modifier[public], parameter[obj]] begin[{] local_variable[type[String], string] return[member[.string]] end[}] END[}]
Keyword[public] identifier[String] identifier[objectToString] operator[SEP] identifier[Object] identifier[obj] operator[SEP] { identifier[String] identifier[string] operator[=] identifier[BaseTransport] operator[SEP] identifier[convertObjectToString] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[return] identifier[string] operator[SEP] }
public static Date getEndOfMonth() { DateTime d = DateTime.now(); int y = d.getYear(); int m = d.getMonthOfYear(); return new DateTime(y, m, getDaysOfMonth(y, m), 23, 23, 59, 999) .toDate(); }
class class_name[name] begin[{] method[getEndOfMonth, return_type[type[Date]], modifier[public static], parameter[]] begin[{] local_variable[type[DateTime], d] local_variable[type[int], y] local_variable[type[int], m] return[ClassCreator(arguments=[MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDaysOfMonth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=23), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=23), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=59), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=999)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toDate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=DateTime, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[getEndOfMonth] operator[SEP] operator[SEP] { identifier[DateTime] identifier[d] operator[=] identifier[DateTime] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[y] operator[=] identifier[d] operator[SEP] identifier[getYear] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[m] operator[=] identifier[d] operator[SEP] identifier[getMonthOfYear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DateTime] operator[SEP] identifier[y] , identifier[m] , identifier[getDaysOfMonth] operator[SEP] identifier[y] , identifier[m] operator[SEP] , Other[23] , Other[23] , Other[59] , Other[999] operator[SEP] operator[SEP] identifier[toDate] operator[SEP] operator[SEP] operator[SEP] }
protected void parseBindVariable() { String expr = tokenizer.getToken(); peek().addChild(new BindVariableNode(this.position, expr, null, outputBindComment)); this.position = this.tokenizer.getPosition(); }
class class_name[name] begin[{] method[parseBindVariable, return_type[void], modifier[protected], parameter[]] begin[{] local_variable[type[String], expr] call[.peek, parameter[]] assign[THIS[member[None.position]], THIS[member[None.tokenizer]call[None.getPosition, parameter[]]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[parseBindVariable] operator[SEP] operator[SEP] { identifier[String] identifier[expr] operator[=] identifier[tokenizer] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[addChild] operator[SEP] Keyword[new] identifier[BindVariableNode] operator[SEP] Keyword[this] operator[SEP] identifier[position] , identifier[expr] , Other[null] , identifier[outputBindComment] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[position] operator[=] Keyword[this] operator[SEP] identifier[tokenizer] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] operator[SEP] }
public static float Sum(float[] data) { float sum = 0; for (int i = 0; i < data.length; i++) { sum += data[i]; } return sum; }
class class_name[name] begin[{] method[Sum, return_type[type[float]], modifier[public static], parameter[data]] begin[{] local_variable[type[float], sum] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=length, postfix_operators=[], prefix_operators=[], qualifier=data, 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[.sum]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[float] identifier[Sum] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[data] operator[SEP] { Keyword[float] identifier[sum] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[data] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[sum] operator[+=] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[sum] operator[SEP] }
public String getLineSeparator() { if (Strings.isNullOrEmpty(this.lineSeparator)) { final String nl = System.getProperty("line.separator"); //$NON-NLS-1$ if (Strings.isNullOrEmpty(nl)) { return "\n"; //$NON-NLS-1$ } return nl; } return this.lineSeparator; }
class class_name[name] begin[{] method[getLineSeparator, return_type[type[String]], modifier[public], parameter[]] begin[{] if[call[Strings.isNullOrEmpty, parameter[THIS[member[None.lineSeparator]]]]] begin[{] local_variable[type[String], nl] if[call[Strings.isNullOrEmpty, parameter[member[.nl]]]] begin[{] return[literal["\n"]] else begin[{] None end[}] return[member[.nl]] else begin[{] None end[}] return[THIS[member[None.lineSeparator]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getLineSeparator] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] Keyword[this] operator[SEP] identifier[lineSeparator] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[nl] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[nl] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[return] identifier[nl] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[lineSeparator] operator[SEP] }
public static ParquetWriterFactory<GenericRecord> forGenericRecord(Schema schema) { final String schemaString = schema.toString(); final ParquetBuilder<GenericRecord> builder = (out) -> createAvroParquetWriter(schemaString, GenericData.get(), out); return new ParquetWriterFactory<>(builder); }
class class_name[name] begin[{] method[forGenericRecord, return_type[type[ParquetWriterFactory]], modifier[public static], parameter[schema]] begin[{] local_variable[type[String], schemaString] local_variable[type[ParquetBuilder], builder] return[ClassCreator(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ParquetWriterFactory, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ParquetWriterFactory] operator[<] identifier[GenericRecord] operator[>] identifier[forGenericRecord] operator[SEP] identifier[Schema] identifier[schema] operator[SEP] { Keyword[final] identifier[String] identifier[schemaString] operator[=] identifier[schema] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ParquetBuilder] operator[<] identifier[GenericRecord] operator[>] identifier[builder] operator[=] operator[SEP] identifier[out] operator[SEP] operator[->] identifier[createAvroParquetWriter] operator[SEP] identifier[schemaString] , identifier[GenericData] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[out] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ParquetWriterFactory] operator[<] operator[>] operator[SEP] identifier[builder] operator[SEP] operator[SEP] }
public void activateWord2VecModelRules(File indexDir) throws IOException { Word2VecModel word2vecModel = language.getWord2VecModel(indexDir); if (word2vecModel != null) { ResourceBundle messages = getMessageBundle(language); List<Rule> rules = language.getRelevantWord2VecModelRules(messages, word2vecModel); userRules.addAll(rules); } }
class class_name[name] begin[{] method[activateWord2VecModelRules, return_type[void], modifier[public], parameter[indexDir]] begin[{] local_variable[type[Word2VecModel], word2vecModel] if[binary_operation[member[.word2vecModel], !=, literal[null]]] begin[{] local_variable[type[ResourceBundle], messages] local_variable[type[List], rules] call[userRules.addAll, parameter[member[.rules]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[activateWord2VecModelRules] operator[SEP] identifier[File] identifier[indexDir] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Word2VecModel] identifier[word2vecModel] operator[=] identifier[language] operator[SEP] identifier[getWord2VecModel] operator[SEP] identifier[indexDir] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[word2vecModel] operator[!=] Other[null] operator[SEP] { identifier[ResourceBundle] identifier[messages] operator[=] identifier[getMessageBundle] operator[SEP] identifier[language] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Rule] operator[>] identifier[rules] operator[=] identifier[language] operator[SEP] identifier[getRelevantWord2VecModelRules] operator[SEP] identifier[messages] , identifier[word2vecModel] operator[SEP] operator[SEP] identifier[userRules] operator[SEP] identifier[addAll] operator[SEP] identifier[rules] operator[SEP] operator[SEP] } }
public void setServers(java.util.Collection<ListedServer> servers) { if (servers == null) { this.servers = null; return; } this.servers = new java.util.ArrayList<ListedServer>(servers); }
class class_name[name] begin[{] method[setServers, return_type[void], modifier[public], parameter[servers]] begin[{] if[binary_operation[member[.servers], ==, literal[null]]] begin[{] assign[THIS[member[None.servers]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.servers]], ClassCreator(arguments=[MemberReference(member=servers, 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=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ListedServer, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setServers] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[ListedServer] operator[>] identifier[servers] operator[SEP] { Keyword[if] operator[SEP] identifier[servers] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[servers] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[servers] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ListedServer] operator[>] operator[SEP] identifier[servers] operator[SEP] operator[SEP] }
public EClass getIfcDoorStyle() { if (ifcDoorStyleEClass == null) { ifcDoorStyleEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(173); } return ifcDoorStyleEClass; }
class class_name[name] begin[{] method[getIfcDoorStyle, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcDoorStyleEClass], ==, literal[null]]] begin[{] assign[member[.ifcDoorStyleEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, 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=173)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcDoorStyleEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcDoorStyle] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcDoorStyleEClass] operator[==] Other[null] operator[SEP] { identifier[ifcDoorStyleEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[173] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcDoorStyleEClass] operator[SEP] }
public List<GitlabCommitStatus> getCommitStatuses(GitlabProject project, String commitHash) throws IOException { return getCommitStatuses(project.getId(), commitHash, new Pagination()); }
class class_name[name] begin[{] method[getCommitStatuses, return_type[type[List]], modifier[public], parameter[project, commitHash]] begin[{] return[call[.getCommitStatuses, parameter[call[project.getId, parameter[]], member[.commitHash], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Pagination, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[GitlabCommitStatus] operator[>] identifier[getCommitStatuses] operator[SEP] identifier[GitlabProject] identifier[project] , identifier[String] identifier[commitHash] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[getCommitStatuses] operator[SEP] identifier[project] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[commitHash] , Keyword[new] identifier[Pagination] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void interiorAreaInteriorPoint_(int cluster, int id_a) { if (m_matrix[MatrixPredicate.InteriorInterior] == 0) return; int clusterParentage = m_topo_graph.getClusterParentage(cluster); if ((clusterParentage & id_a) == 0) { int chain = m_topo_graph.getClusterChain(cluster); int chainParentage = m_topo_graph.getChainParentage(chain); if ((chainParentage & id_a) != 0) { m_matrix[MatrixPredicate.InteriorInterior] = 0; } } }
class class_name[name] begin[{] method[interiorAreaInteriorPoint_, return_type[void], modifier[private], parameter[cluster, id_a]] begin[{] if[binary_operation[member[.m_matrix], ==, literal[0]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], clusterParentage] if[binary_operation[binary_operation[member[.clusterParentage], &, member[.id_a]], ==, literal[0]]] begin[{] local_variable[type[int], chain] local_variable[type[int], chainParentage] if[binary_operation[binary_operation[member[.chainParentage], &, member[.id_a]], !=, literal[0]]] begin[{] assign[member[.m_matrix], literal[0]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[interiorAreaInteriorPoint_] operator[SEP] Keyword[int] identifier[cluster] , Keyword[int] identifier[id_a] operator[SEP] { Keyword[if] operator[SEP] identifier[m_matrix] operator[SEP] identifier[MatrixPredicate] operator[SEP] identifier[InteriorInterior] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] operator[SEP] Keyword[int] identifier[clusterParentage] operator[=] identifier[m_topo_graph] operator[SEP] identifier[getClusterParentage] operator[SEP] identifier[cluster] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[clusterParentage] operator[&] identifier[id_a] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[int] identifier[chain] operator[=] identifier[m_topo_graph] operator[SEP] identifier[getClusterChain] operator[SEP] identifier[cluster] operator[SEP] operator[SEP] Keyword[int] identifier[chainParentage] operator[=] identifier[m_topo_graph] operator[SEP] identifier[getChainParentage] operator[SEP] identifier[chain] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[chainParentage] operator[&] identifier[id_a] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[m_matrix] operator[SEP] identifier[MatrixPredicate] operator[SEP] identifier[InteriorInterior] operator[SEP] operator[=] Other[0] operator[SEP] } } }
public void putBeanDeployments(BeanDeploymentArchiveMapping bdaMapping) { for (Entry<BeanDeploymentArchive, BeanManagerImpl> entry : bdaMapping.getBdaToBeanManagerMap().entrySet()) { beanDeploymentArchives.put(entry.getKey(), entry.getValue()); addBeanManager(entry.getValue()); } }
class class_name[name] begin[{] method[putBeanDeployments, return_type[void], modifier[public], parameter[bdaMapping]] 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=put, postfix_operators=[], prefix_operators=[], qualifier=beanDeploymentArchives, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=addBeanManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getBdaToBeanManagerMap, postfix_operators=[], prefix_operators=[], qualifier=bdaMapping, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=BeanDeploymentArchive, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BeanManagerImpl, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[putBeanDeployments] operator[SEP] identifier[BeanDeploymentArchiveMapping] identifier[bdaMapping] operator[SEP] { Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[BeanDeploymentArchive] , identifier[BeanManagerImpl] operator[>] identifier[entry] operator[:] identifier[bdaMapping] operator[SEP] identifier[getBdaToBeanManagerMap] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[beanDeploymentArchives] operator[SEP] identifier[put] 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] identifier[addBeanManager] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public void printWarning() { System.out.print("Warning: "); System.out.print(description); if (value != null) System.out.print(" (" + value + ")"); System.out.println(); }
class class_name[name] begin[{] method[printWarning, return_type[void], modifier[public], parameter[]] begin[{] call[System.out.print, parameter[literal["Warning: "]]] call[System.out.print, parameter[member[.description]]] if[binary_operation[member[.value], !=, literal[null]]] begin[{] call[System.out.print, parameter[binary_operation[binary_operation[literal[" ("], +, member[.value]], +, literal[")"]]]] else begin[{] None end[}] call[System.out.println, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[printWarning] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[description] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[value] operator[+] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP] }
private boolean rename(FTPClient client, Path src, Path dst) throws IOException { Path workDir = new Path(client.printWorkingDirectory()); Path absoluteSrc = makeAbsolute(workDir, src); Path absoluteDst = makeAbsolute(workDir, dst); if (!exists(client, absoluteSrc)) { throw new IOException("Source path " + src + " does not exist"); } if (exists(client, absoluteDst)) { throw new IOException("Destination path " + dst + " already exist, cannot rename!"); } String parentSrc = absoluteSrc.getParent().toUri().toString(); String parentDst = absoluteDst.getParent().toUri().toString(); String from = src.getName(); String to = dst.getName(); if (!parentSrc.equals(parentDst)) { throw new IOException("Cannot rename parent(source): " + parentSrc + ", parent(destination): " + parentDst); } client.changeWorkingDirectory(parentSrc); boolean renamed = client.rename(from, to); return renamed; }
class class_name[name] begin[{] method[rename, return_type[type[boolean]], modifier[private], parameter[client, src, dst]] begin[{] local_variable[type[Path], workDir] local_variable[type[Path], absoluteSrc] local_variable[type[Path], absoluteDst] if[call[.exists, parameter[member[.client], member[.absoluteSrc]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source path "), operandr=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" does not exist"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] if[call[.exists, parameter[member[.client], member[.absoluteDst]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination path "), operandr=MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" already exist, cannot rename!"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], parentSrc] local_variable[type[String], parentDst] local_variable[type[String], from] local_variable[type[String], to] if[call[parentSrc.equals, parameter[member[.parentDst]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot rename parent(source): "), operandr=MemberReference(member=parentSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", parent(destination): "), operator=+), operandr=MemberReference(member=parentDst, 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=IOException, sub_type=None)), label=None) else begin[{] None end[}] call[client.changeWorkingDirectory, parameter[member[.parentSrc]]] local_variable[type[boolean], renamed] return[member[.renamed]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[rename] operator[SEP] identifier[FTPClient] identifier[client] , identifier[Path] identifier[src] , identifier[Path] identifier[dst] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Path] identifier[workDir] operator[=] Keyword[new] identifier[Path] operator[SEP] identifier[client] operator[SEP] identifier[printWorkingDirectory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[absoluteSrc] operator[=] identifier[makeAbsolute] operator[SEP] identifier[workDir] , identifier[src] operator[SEP] operator[SEP] identifier[Path] identifier[absoluteDst] operator[=] identifier[makeAbsolute] operator[SEP] identifier[workDir] , identifier[dst] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[exists] operator[SEP] identifier[client] , identifier[absoluteSrc] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[src] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[exists] operator[SEP] identifier[client] , identifier[absoluteDst] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[dst] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[parentSrc] operator[=] identifier[absoluteSrc] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[toUri] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[parentDst] operator[=] identifier[absoluteDst] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[toUri] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[from] operator[=] identifier[src] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[to] operator[=] identifier[dst] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[parentSrc] operator[SEP] identifier[equals] operator[SEP] identifier[parentDst] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[parentSrc] operator[+] literal[String] operator[+] identifier[parentDst] operator[SEP] operator[SEP] } identifier[client] operator[SEP] identifier[changeWorkingDirectory] operator[SEP] identifier[parentSrc] operator[SEP] operator[SEP] Keyword[boolean] identifier[renamed] operator[=] identifier[client] operator[SEP] identifier[rename] operator[SEP] identifier[from] , identifier[to] operator[SEP] operator[SEP] Keyword[return] identifier[renamed] operator[SEP] }
public int insert(String sql,Object[] params,String autoGeneratedColumnName) throws DataAccessException{ //dynamic change catalog name sql = changeCatalog(sql); ReturnIdPreparedStatementCreator psc = new ReturnIdPreparedStatementCreator(sql, params, autoGeneratedColumnName); KeyHolder keyHolder = new GeneratedKeyHolder(); try{ jdbcTemplate.update(psc, keyHolder); }catch(DataAccessException e){ StringBuilder sb = new StringBuilder(); sb.append("["); for(Object p:params){ sb.append(p + " | "); } sb.append("]"); logger.error("Error SQL: " + sql + " Params: " + sb.toString()); throw e; } return keyHolder.getKey().intValue(); }
class class_name[name] begin[{] method[insert, return_type[type[int]], modifier[public], parameter[sql, params, autoGeneratedColumnName]] begin[{] assign[member[.sql], call[.changeCatalog, parameter[member[.sql]]]] local_variable[type[ReturnIdPreparedStatementCreator], psc] local_variable[type[KeyHolder], keyHolder] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=psc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keyHolder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update, postfix_operators=[], prefix_operators=[], qualifier=jdbcTemplate, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" | "), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error SQL: "), operandr=MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Params: "), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DataAccessException']))], finally_block=None, label=None, resources=None) return[call[keyHolder.getKey, parameter[]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[insert] operator[SEP] identifier[String] identifier[sql] , identifier[Object] operator[SEP] operator[SEP] identifier[params] , identifier[String] identifier[autoGeneratedColumnName] operator[SEP] Keyword[throws] identifier[DataAccessException] { identifier[sql] operator[=] identifier[changeCatalog] operator[SEP] identifier[sql] operator[SEP] operator[SEP] identifier[ReturnIdPreparedStatementCreator] identifier[psc] operator[=] Keyword[new] identifier[ReturnIdPreparedStatementCreator] operator[SEP] identifier[sql] , identifier[params] , identifier[autoGeneratedColumnName] operator[SEP] operator[SEP] identifier[KeyHolder] identifier[keyHolder] operator[=] Keyword[new] identifier[GeneratedKeyHolder] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[jdbcTemplate] operator[SEP] identifier[update] operator[SEP] identifier[psc] , identifier[keyHolder] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DataAccessException] identifier[e] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[p] operator[:] identifier[params] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[p] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[sql] operator[+] literal[String] operator[+] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } Keyword[return] identifier[keyHolder] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] }
private SymlinkResult getSymlinkBase(final String base, final Path file) throws IOException { int nameCount = file.getNameCount(); Path root = fileSystem.getPath(base); int rootCount = root.getNameCount(); Path f = file; for (int i = nameCount - 1; i>=0; i--) { if (Files.isSymbolicLink(f)) { return new SymlinkResult(i+1 > rootCount, f); } f = f.getParent(); } return null; }
class class_name[name] begin[{] method[getSymlinkBase, return_type[type[SymlinkResult]], modifier[private], parameter[base, file]] begin[{] local_variable[type[int], nameCount] local_variable[type[Path], root] local_variable[type[int], rootCount] local_variable[type[Path], f] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSymbolicLink, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=rootCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), MemberReference(member=f, 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=SymlinkResult, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=nameCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[null]] end[}] END[}]
Keyword[private] identifier[SymlinkResult] identifier[getSymlinkBase] operator[SEP] Keyword[final] identifier[String] identifier[base] , Keyword[final] identifier[Path] identifier[file] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[nameCount] operator[=] identifier[file] operator[SEP] identifier[getNameCount] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[root] operator[=] identifier[fileSystem] operator[SEP] identifier[getPath] operator[SEP] identifier[base] operator[SEP] operator[SEP] Keyword[int] identifier[rootCount] operator[=] identifier[root] operator[SEP] identifier[getNameCount] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[f] operator[=] identifier[file] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[nameCount] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] { Keyword[if] operator[SEP] identifier[Files] operator[SEP] identifier[isSymbolicLink] operator[SEP] identifier[f] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[SymlinkResult] operator[SEP] identifier[i] operator[+] Other[1] operator[>] identifier[rootCount] , identifier[f] operator[SEP] operator[SEP] } identifier[f] operator[=] identifier[f] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public CmsAliasEditValidationReply saveAliases(CmsAliasSaveValidationRequest saveRequest) throws CmsException { CmsAliasEditValidationReply reply = validateAliases(saveRequest); if (m_hasErrors) { return reply; } else { List<CmsRewriteAliasTableRow> rewriteData = saveRequest.getRewriteData(); OpenCms.getAliasManager().saveRewriteAliases( m_cms, m_cms.getRequestContext().getSiteRoot(), convertRewriteData(rewriteData)); Set<CmsUUID> allTouchedIds = new HashSet<CmsUUID>(); List<CmsAliasTableRow> rows = saveRequest.getEditedData(); for (CmsAliasTableRow row : rows) { if (row.isEdited()) { allTouchedIds.add(row.getStructureId()); if (row.getOriginalStructureId() != null) { allTouchedIds.add(row.getOriginalStructureId()); } } } allTouchedIds.addAll(saveRequest.getDeletedIds()); CmsAliasManager aliasManager = OpenCms.getAliasManager(); String siteRoot = saveRequest.getSiteRoot(); List<CmsAlias> aliases = aliasManager.getAliasesForSite(m_cms, siteRoot); Set<CmsAlias> aliasSet = new HashSet<CmsAlias>(); Set<CmsAlias> editedAliasSet = new HashSet<CmsAlias>(); aliasSet.addAll(aliases); for (CmsAliasTableRow row : rows) { CmsAlias editedAlias = new CmsAlias(row.getStructureId(), siteRoot, row.getAliasPath(), row.getMode()); editedAliasSet.add(editedAlias); } Set<CmsAlias> toDelete = Sets.difference(aliasSet, editedAliasSet); toDelete = filterStructureId(toDelete, allTouchedIds); Set<CmsAlias> toAdd = Sets.difference(editedAliasSet, aliasSet); toAdd = filterStructureId(toAdd, allTouchedIds); aliasManager.updateAliases(m_cms, toDelete, toAdd); return null; } }
class class_name[name] begin[{] method[saveAliases, return_type[type[CmsAliasEditValidationReply]], modifier[public], parameter[saveRequest]] begin[{] local_variable[type[CmsAliasEditValidationReply], reply] if[member[.m_hasErrors]] begin[{] return[member[.reply]] else begin[{] local_variable[type[List], rewriteData] call[OpenCms.getAliasManager, parameter[]] local_variable[type[Set], allTouchedIds] local_variable[type[List], rows] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isEdited, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStructureId, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=allTouchedIds, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getOriginalStructureId, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), 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=[MethodInvocation(arguments=[], member=getOriginalStructureId, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=allTouchedIds, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsAliasTableRow, sub_type=None))), label=None) call[allTouchedIds.addAll, parameter[call[saveRequest.getDeletedIds, parameter[]]]] local_variable[type[CmsAliasManager], aliasManager] local_variable[type[String], siteRoot] local_variable[type[List], aliases] local_variable[type[Set], aliasSet] local_variable[type[Set], editedAliasSet] call[aliasSet.addAll, parameter[member[.aliases]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getStructureId, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), MemberReference(member=siteRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getAliasPath, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMode, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsAlias, sub_type=None)), name=editedAlias)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsAlias, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=editedAlias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=editedAliasSet, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsAliasTableRow, sub_type=None))), label=None) local_variable[type[Set], toDelete] assign[member[.toDelete], call[.filterStructureId, parameter[member[.toDelete], member[.allTouchedIds]]]] local_variable[type[Set], toAdd] assign[member[.toAdd], call[.filterStructureId, parameter[member[.toAdd], member[.allTouchedIds]]]] call[aliasManager.updateAliases, parameter[member[.m_cms], member[.toDelete], member[.toAdd]]] return[literal[null]] end[}] end[}] END[}]
Keyword[public] identifier[CmsAliasEditValidationReply] identifier[saveAliases] operator[SEP] identifier[CmsAliasSaveValidationRequest] identifier[saveRequest] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[CmsAliasEditValidationReply] identifier[reply] operator[=] identifier[validateAliases] operator[SEP] identifier[saveRequest] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_hasErrors] operator[SEP] { Keyword[return] identifier[reply] operator[SEP] } Keyword[else] { identifier[List] operator[<] identifier[CmsRewriteAliasTableRow] operator[>] identifier[rewriteData] operator[=] identifier[saveRequest] operator[SEP] identifier[getRewriteData] operator[SEP] operator[SEP] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getAliasManager] operator[SEP] operator[SEP] operator[SEP] identifier[saveRewriteAliases] operator[SEP] identifier[m_cms] , identifier[m_cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getSiteRoot] operator[SEP] operator[SEP] , identifier[convertRewriteData] operator[SEP] identifier[rewriteData] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[CmsUUID] operator[>] identifier[allTouchedIds] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[CmsUUID] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CmsAliasTableRow] operator[>] identifier[rows] operator[=] identifier[saveRequest] operator[SEP] identifier[getEditedData] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsAliasTableRow] identifier[row] operator[:] identifier[rows] operator[SEP] { Keyword[if] operator[SEP] identifier[row] operator[SEP] identifier[isEdited] operator[SEP] operator[SEP] operator[SEP] { identifier[allTouchedIds] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[row] operator[SEP] identifier[getOriginalStructureId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[allTouchedIds] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] identifier[getOriginalStructureId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } identifier[allTouchedIds] operator[SEP] identifier[addAll] operator[SEP] identifier[saveRequest] operator[SEP] identifier[getDeletedIds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CmsAliasManager] identifier[aliasManager] operator[=] identifier[OpenCms] operator[SEP] identifier[getAliasManager] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[siteRoot] operator[=] identifier[saveRequest] operator[SEP] identifier[getSiteRoot] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CmsAlias] operator[>] identifier[aliases] operator[=] identifier[aliasManager] operator[SEP] identifier[getAliasesForSite] operator[SEP] identifier[m_cms] , identifier[siteRoot] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[CmsAlias] operator[>] identifier[aliasSet] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[CmsAlias] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[CmsAlias] operator[>] identifier[editedAliasSet] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[CmsAlias] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[aliasSet] operator[SEP] identifier[addAll] operator[SEP] identifier[aliases] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsAliasTableRow] identifier[row] operator[:] identifier[rows] operator[SEP] { identifier[CmsAlias] identifier[editedAlias] operator[=] Keyword[new] identifier[CmsAlias] operator[SEP] identifier[row] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] , identifier[siteRoot] , identifier[row] operator[SEP] identifier[getAliasPath] operator[SEP] operator[SEP] , identifier[row] operator[SEP] identifier[getMode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[editedAliasSet] operator[SEP] identifier[add] operator[SEP] identifier[editedAlias] operator[SEP] operator[SEP] } identifier[Set] operator[<] identifier[CmsAlias] operator[>] identifier[toDelete] operator[=] identifier[Sets] operator[SEP] identifier[difference] operator[SEP] identifier[aliasSet] , identifier[editedAliasSet] operator[SEP] operator[SEP] identifier[toDelete] operator[=] identifier[filterStructureId] operator[SEP] identifier[toDelete] , identifier[allTouchedIds] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[CmsAlias] operator[>] identifier[toAdd] operator[=] identifier[Sets] operator[SEP] identifier[difference] operator[SEP] identifier[editedAliasSet] , identifier[aliasSet] operator[SEP] operator[SEP] identifier[toAdd] operator[=] identifier[filterStructureId] operator[SEP] identifier[toAdd] , identifier[allTouchedIds] operator[SEP] operator[SEP] identifier[aliasManager] operator[SEP] identifier[updateAliases] operator[SEP] identifier[m_cms] , identifier[toDelete] , identifier[toAdd] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public void setOnblur(java.lang.String onblur) { getStateHelper().put(PropertyKeys.onblur, onblur); handleAttribute("onblur", onblur); }
class class_name[name] begin[{] method[setOnblur, return_type[void], modifier[public], parameter[onblur]] begin[{] call[.getStateHelper, parameter[]] call[.handleAttribute, parameter[literal["onblur"], member[.onblur]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setOnblur] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[String] identifier[onblur] operator[SEP] { identifier[getStateHelper] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[PropertyKeys] operator[SEP] identifier[onblur] , identifier[onblur] operator[SEP] operator[SEP] identifier[handleAttribute] operator[SEP] literal[String] , identifier[onblur] operator[SEP] operator[SEP] }
public static String asString(ByteBuffer buffer, int length) { char[] chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = (char) buffer.get(i); } return String.valueOf(chars); }
class class_name[name] begin[{] method[asString, return_type[type[String]], modifier[public static], parameter[buffer, length]] begin[{] local_variable[type[char], chars] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=chars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=char))), 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=, 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[String.valueOf, parameter[member[.chars]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[asString] operator[SEP] identifier[ByteBuffer] identifier[buffer] , Keyword[int] identifier[length] operator[SEP] { Keyword[char] operator[SEP] operator[SEP] identifier[chars] operator[=] Keyword[new] Keyword[char] 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[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[chars] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[buffer] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[chars] operator[SEP] operator[SEP] }
public <T> T getObject(Class<T> classOfT, ResultSet rs, FieldMatcher fm) { return getObject(classOfT, rs, fm, null); }
class class_name[name] begin[{] method[getObject, return_type[type[T]], modifier[public], parameter[classOfT, rs, fm]] begin[{] return[call[.getObject, parameter[member[.classOfT], member[.rs], member[.fm], literal[null]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[getObject] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[classOfT] , identifier[ResultSet] identifier[rs] , identifier[FieldMatcher] identifier[fm] operator[SEP] { Keyword[return] identifier[getObject] operator[SEP] identifier[classOfT] , identifier[rs] , identifier[fm] , Other[null] operator[SEP] operator[SEP] }
public Object call(String uuid, GameMode mode, String procCall, JsonObject object) { return client.sendRpcAndWait(SERVICE, "call", uuid, mode.name(), procCall, object.toString()); }
class class_name[name] begin[{] method[call, return_type[type[Object]], modifier[public], parameter[uuid, mode, procCall, object]] begin[{] return[call[client.sendRpcAndWait, parameter[member[.SERVICE], literal["call"], member[.uuid], call[mode.name, parameter[]], member[.procCall], call[object.toString, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[call] operator[SEP] identifier[String] identifier[uuid] , identifier[GameMode] identifier[mode] , identifier[String] identifier[procCall] , identifier[JsonObject] identifier[object] operator[SEP] { Keyword[return] identifier[client] operator[SEP] identifier[sendRpcAndWait] operator[SEP] identifier[SERVICE] , literal[String] , identifier[uuid] , identifier[mode] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[procCall] , identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void unsetUserConfigurations(UserConfigurationsProvider provider) { if (userConfigurations.isPresent() && userConfigurations.get().equals(provider)) { this.userConfigurations = Optional.empty(); } }
class class_name[name] begin[{] method[unsetUserConfigurations, return_type[void], modifier[public], parameter[provider]] begin[{] if[binary_operation[call[userConfigurations.isPresent, parameter[]], &&, call[userConfigurations.get, parameter[]]]] begin[{] assign[THIS[member[None.userConfigurations]], call[Optional.empty, parameter[]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[unsetUserConfigurations] operator[SEP] identifier[UserConfigurationsProvider] identifier[provider] operator[SEP] { Keyword[if] operator[SEP] identifier[userConfigurations] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[&&] identifier[userConfigurations] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[provider] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[userConfigurations] operator[=] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } }
protected final void emptyLTrash() { if (_lVecTrash.isEmpty()) return; Futures fs = new Futures(); cleanupTrash(_lVecTrash, fs); fs.blockForPending(); }
class class_name[name] begin[{] method[emptyLTrash, return_type[void], modifier[final protected], parameter[]] begin[{] if[call[_lVecTrash.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Futures], fs] call[.cleanupTrash, parameter[member[._lVecTrash], member[.fs]]] call[fs.blockForPending, parameter[]] end[}] END[}]
Keyword[protected] Keyword[final] Keyword[void] identifier[emptyLTrash] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[_lVecTrash] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Futures] identifier[fs] operator[=] Keyword[new] identifier[Futures] operator[SEP] operator[SEP] operator[SEP] identifier[cleanupTrash] operator[SEP] identifier[_lVecTrash] , identifier[fs] operator[SEP] operator[SEP] identifier[fs] operator[SEP] identifier[blockForPending] operator[SEP] operator[SEP] operator[SEP] }
protected String getSelectedValue(CmsObject cms, I_CmsWidgetParameter param) { String paramValue = param.getStringValue(cms); if (CmsStringUtil.isEmpty(paramValue)) { CmsSelectWidgetOption option = CmsSelectWidgetOption.getDefaultOption(m_selectOptions); if (option != null) { paramValue = option.getValue(); } } return paramValue; }
class class_name[name] begin[{] method[getSelectedValue, return_type[type[String]], modifier[protected], parameter[cms, param]] begin[{] local_variable[type[String], paramValue] if[call[CmsStringUtil.isEmpty, parameter[member[.paramValue]]]] begin[{] local_variable[type[CmsSelectWidgetOption], option] if[binary_operation[member[.option], !=, literal[null]]] begin[{] assign[member[.paramValue], call[option.getValue, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.paramValue]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getSelectedValue] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[I_CmsWidgetParameter] identifier[param] operator[SEP] { identifier[String] identifier[paramValue] operator[=] identifier[param] operator[SEP] identifier[getStringValue] operator[SEP] identifier[cms] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[paramValue] operator[SEP] operator[SEP] { identifier[CmsSelectWidgetOption] identifier[option] operator[=] identifier[CmsSelectWidgetOption] operator[SEP] identifier[getDefaultOption] operator[SEP] identifier[m_selectOptions] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[option] operator[!=] Other[null] operator[SEP] { identifier[paramValue] operator[=] identifier[option] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[paramValue] operator[SEP] }
public String format(long number, String ruleSet) throws IllegalArgumentException { if (ruleSet.startsWith("%%")) { throw new IllegalArgumentException("Can't use internal rule set"); } return adjustForContext(format(number, findRuleSet(ruleSet))); }
class class_name[name] begin[{] method[format, return_type[type[String]], modifier[public], parameter[number, ruleSet]] begin[{] if[call[ruleSet.startsWith, parameter[literal["%%"]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't use internal rule set")], 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[}] return[call[.adjustForContext, parameter[call[.format, parameter[member[.number], call[.findRuleSet, parameter[member[.ruleSet]]]]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[format] operator[SEP] Keyword[long] identifier[number] , identifier[String] identifier[ruleSet] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { Keyword[if] operator[SEP] identifier[ruleSet] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[adjustForContext] operator[SEP] identifier[format] operator[SEP] identifier[number] , identifier[findRuleSet] operator[SEP] identifier[ruleSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private static HttpEntityEnclosingRequestBase getHttpEntityMethod(RequestMethod method, String uri) { HttpEntityEnclosingRequestBase hm; if (method != null) { switch (method) { case POST: hm = new HttpPost(uri); break; case PUT: hm = new HttpPut(uri); break; case PATCH: hm = new HttpPatch(uri); break; default: hm = new HttpPost(uri); break; } } else hm = new HttpPost(uri); return hm; }
class class_name[name] begin[{] method[getHttpEntityMethod, return_type[type[HttpEntityEnclosingRequestBase]], modifier[private static], parameter[method, uri]] begin[{] local_variable[type[HttpEntityEnclosingRequestBase], hm] if[binary_operation[member[.method], !=, literal[null]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['POST'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=uri, 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=HttpPost, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PUT'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=uri, 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=HttpPut, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PATCH'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=uri, 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=HttpPatch, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=uri, 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=HttpPost, sub_type=None))), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] assign[member[.hm], ClassCreator(arguments=[MemberReference(member=uri, 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=HttpPost, sub_type=None))] end[}] return[member[.hm]] end[}] END[}]
Keyword[private] Keyword[static] identifier[HttpEntityEnclosingRequestBase] identifier[getHttpEntityMethod] operator[SEP] identifier[RequestMethod] identifier[method] , identifier[String] identifier[uri] operator[SEP] { identifier[HttpEntityEnclosingRequestBase] identifier[hm] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[!=] Other[null] operator[SEP] { Keyword[switch] operator[SEP] identifier[method] operator[SEP] { Keyword[case] identifier[POST] operator[:] identifier[hm] operator[=] Keyword[new] identifier[HttpPost] operator[SEP] identifier[uri] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PUT] operator[:] identifier[hm] operator[=] Keyword[new] identifier[HttpPut] operator[SEP] identifier[uri] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[PATCH] operator[:] identifier[hm] operator[=] Keyword[new] identifier[HttpPatch] operator[SEP] identifier[uri] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[hm] operator[=] Keyword[new] identifier[HttpPost] operator[SEP] identifier[uri] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[else] identifier[hm] operator[=] Keyword[new] identifier[HttpPost] operator[SEP] identifier[uri] operator[SEP] operator[SEP] Keyword[return] identifier[hm] operator[SEP] }
public Vector3d unprojectInv(Vector3dc winCoords, int[] viewport, Vector3d dest) { return unprojectInv(winCoords.x(), winCoords.y(), winCoords.z(), viewport, dest); }
class class_name[name] begin[{] method[unprojectInv, return_type[type[Vector3d]], modifier[public], parameter[winCoords, viewport, dest]] begin[{] return[call[.unprojectInv, parameter[call[winCoords.x, parameter[]], call[winCoords.y, parameter[]], call[winCoords.z, parameter[]], member[.viewport], member[.dest]]]] end[}] END[}]
Keyword[public] identifier[Vector3d] identifier[unprojectInv] operator[SEP] identifier[Vector3dc] identifier[winCoords] , Keyword[int] operator[SEP] operator[SEP] identifier[viewport] , identifier[Vector3d] identifier[dest] operator[SEP] { Keyword[return] identifier[unprojectInv] operator[SEP] identifier[winCoords] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[winCoords] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[winCoords] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[viewport] , identifier[dest] operator[SEP] operator[SEP] }
@Override public void setScale(IReactionSet reactionSet) { double bondLength = AverageBondLengthCalculator.calculateAverageBondLength(reactionSet); double scale = this.calculateScaleForBondLength(bondLength); // store the scale so that other components can access it this.rendererModel.getParameter(Scale.class).setValue(scale); }
class class_name[name] begin[{] method[setScale, return_type[void], modifier[public], parameter[reactionSet]] begin[{] local_variable[type[double], bondLength] local_variable[type[double], scale] THIS[member[None.rendererModel]call[None.getParameter, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Scale, sub_type=None))]]call[None.setValue, parameter[member[.scale]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setScale] operator[SEP] identifier[IReactionSet] identifier[reactionSet] operator[SEP] { Keyword[double] identifier[bondLength] operator[=] identifier[AverageBondLengthCalculator] operator[SEP] identifier[calculateAverageBondLength] operator[SEP] identifier[reactionSet] operator[SEP] operator[SEP] Keyword[double] identifier[scale] operator[=] Keyword[this] operator[SEP] identifier[calculateScaleForBondLength] operator[SEP] identifier[bondLength] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[rendererModel] operator[SEP] identifier[getParameter] operator[SEP] identifier[Scale] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[scale] operator[SEP] operator[SEP] }
public ExternalID getPersonExternalIds(int personId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, personId); URL url = new ApiUrl(apiKey, MethodBase.PERSON).subMethod(MethodSub.EXTERNAL_IDS).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { return MAPPER.readValue(webpage, ExternalID.class); } catch (IOException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person external IDs", url, ex); } }
class class_name[name] begin[{] method[getPersonExternalIds, return_type[type[ExternalID]], modifier[public], parameter[personId]] begin[{] local_variable[type[TmdbParameters], parameters] call[parameters.add, parameter[member[Param.ID], member[.personId]]] local_variable[type[URL], url] local_variable[type[String], webpage] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=webpage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExternalID, sub_type=None))], member=readValue, postfix_operators=[], prefix_operators=[], qualifier=MAPPER, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=MAPPING_FAILED, postfix_operators=[], prefix_operators=[], qualifier=ApiExceptionType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to get person external IDs"), MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, 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=MovieDbException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[ExternalID] identifier[getPersonExternalIds] operator[SEP] Keyword[int] identifier[personId] operator[SEP] Keyword[throws] identifier[MovieDbException] { identifier[TmdbParameters] identifier[parameters] operator[=] Keyword[new] identifier[TmdbParameters] operator[SEP] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[add] operator[SEP] identifier[Param] operator[SEP] identifier[ID] , identifier[personId] operator[SEP] operator[SEP] identifier[URL] identifier[url] operator[=] Keyword[new] identifier[ApiUrl] operator[SEP] identifier[apiKey] , identifier[MethodBase] operator[SEP] identifier[PERSON] operator[SEP] operator[SEP] identifier[subMethod] operator[SEP] identifier[MethodSub] operator[SEP] identifier[EXTERNAL_IDS] operator[SEP] operator[SEP] identifier[buildUrl] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] identifier[String] identifier[webpage] operator[=] identifier[httpTools] operator[SEP] identifier[getRequest] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[MAPPER] operator[SEP] identifier[readValue] operator[SEP] identifier[webpage] , identifier[ExternalID] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[MovieDbException] operator[SEP] identifier[ApiExceptionType] operator[SEP] identifier[MAPPING_FAILED] , literal[String] , identifier[url] , identifier[ex] operator[SEP] operator[SEP] } }
@Override protected void performValidation(String path, Object value, List<ValidationResult> results) { path = path == null || path.length() == 0 ? _name : path + "." + _name; super.performValidation(path, value, results); performTypeValidation(path, _type, value, results); }
class class_name[name] begin[{] method[performValidation, return_type[void], modifier[protected], parameter[path, value, results]] begin[{] assign[member[.path], TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=path, 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=+), if_true=MemberReference(member=_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] SuperMethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=performValidation, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[.performTypeValidation, parameter[member[.path], member[._type], member[.value], member[.results]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[performValidation] operator[SEP] identifier[String] identifier[path] , identifier[Object] identifier[value] , identifier[List] operator[<] identifier[ValidationResult] operator[>] identifier[results] operator[SEP] { identifier[path] operator[=] identifier[path] operator[==] Other[null] operator[||] identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] identifier[_name] operator[:] identifier[path] operator[+] literal[String] operator[+] identifier[_name] operator[SEP] Keyword[super] operator[SEP] identifier[performValidation] operator[SEP] identifier[path] , identifier[value] , identifier[results] operator[SEP] operator[SEP] identifier[performTypeValidation] operator[SEP] identifier[path] , identifier[_type] , identifier[value] , identifier[results] operator[SEP] operator[SEP] }
protected String doGetString( NamespaceRegistry namespaceRegistry, TextEncoder encoder, TextEncoder delimiterEncoder ) { if (encoder == null) encoder = DEFAULT_ENCODER; final String delimiter = delimiterEncoder != null ? delimiterEncoder.encode(DELIMITER_STR) : DELIMITER_STR; // Since the segments are immutable, this code need not be synchronized because concurrent threads // may just compute the same value (with no harm done) StringBuilder sb = new StringBuilder(); if (this.isAbsolute()) sb.append(delimiter); boolean first = true; for (Segment segment : this) { if (first) { first = false; } else { sb.append(delimiter); } assert segment != null; sb.append(segment.getString(namespaceRegistry, encoder, delimiterEncoder)); } String result = sb.toString(); // Save the result to the internal string if this the default encoder is used. // This is not synchronized, but it's okay return result; }
class class_name[name] begin[{] method[doGetString, return_type[type[String]], modifier[protected], parameter[namespaceRegistry, encoder, delimiterEncoder]] begin[{] if[binary_operation[member[.encoder], ==, literal[null]]] begin[{] assign[member[.encoder], member[.DEFAULT_ENCODER]] else begin[{] None end[}] local_variable[type[String], delimiter] local_variable[type[StringBuilder], sb] if[THIS[call[None.isAbsolute, parameter[]]]] begin[{] call[sb.append, parameter[member[.delimiter]]] else begin[{] None end[}] local_variable[type[boolean], first] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=delimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=namespaceRegistry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=encoder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=delimiterEncoder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=segment, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=segment)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Segment, sub_type=None))), label=None) local_variable[type[String], result] return[member[.result]] end[}] END[}]
Keyword[protected] identifier[String] identifier[doGetString] operator[SEP] identifier[NamespaceRegistry] identifier[namespaceRegistry] , identifier[TextEncoder] identifier[encoder] , identifier[TextEncoder] identifier[delimiterEncoder] operator[SEP] { Keyword[if] operator[SEP] identifier[encoder] operator[==] Other[null] operator[SEP] identifier[encoder] operator[=] identifier[DEFAULT_ENCODER] operator[SEP] Keyword[final] identifier[String] identifier[delimiter] operator[=] identifier[delimiterEncoder] operator[!=] Other[null] operator[?] identifier[delimiterEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[DELIMITER_STR] operator[SEP] operator[:] identifier[DELIMITER_STR] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isAbsolute] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[delimiter] operator[SEP] operator[SEP] Keyword[boolean] identifier[first] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[Segment] identifier[segment] operator[:] Keyword[this] operator[SEP] { Keyword[if] operator[SEP] identifier[first] operator[SEP] { identifier[first] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[delimiter] operator[SEP] operator[SEP] } Keyword[assert] identifier[segment] operator[!=] Other[null] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[segment] operator[SEP] identifier[getString] operator[SEP] identifier[namespaceRegistry] , identifier[encoder] , identifier[delimiterEncoder] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[result] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public void execute(Trigger trigger) throws Exception { if (trigger.isDisabled()) return; try { ((Action1) trigger.getAction().newInstance()).call(trigger.getData()); } catch (Exception e) { throw new Exception(String.format("Exception occurred while executing trigger '%s'", trigger), e); } }
class class_name[name] begin[{] method[execute, return_type[void], modifier[public], parameter[trigger]] begin[{] if[call[trigger.isDisabled, parameter[]]] begin[{] return[None] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=Cast(expression=MethodInvocation(arguments=[], member=getAction, postfix_operators=[], prefix_operators=[], qualifier=trigger, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Action1, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception occurred while executing trigger '%s'"), MemberReference(member=trigger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), 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=Exception, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[Trigger] identifier[trigger] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[trigger] operator[SEP] identifier[isDisabled] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[try] { operator[SEP] operator[SEP] identifier[Action1] operator[SEP] identifier[trigger] operator[SEP] identifier[getAction] operator[SEP] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[call] operator[SEP] identifier[trigger] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[trigger] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private boolean readMetaHeader() throws IOException { try (ReadStream is = openRead(0, META_SEGMENT_SIZE)) { int crc = 17; long magic = BitsUtil.readLong(is); if (magic != KELP_MAGIC) { System.out.println("WRONG_MAGIC: " + magic); return false; } crc = Crc32Caucho.generate(crc, magic); _nonce = BitsUtil.readInt(is); crc = Crc32Caucho.generateInt32(crc, _nonce); int headers = BitsUtil.readInt(is); crc = Crc32Caucho.generateInt32(crc, headers); for (int i = 0; i < headers; i++) { int key = BitsUtil.readInt(is); crc = Crc32Caucho.generateInt32(crc, key); int value = BitsUtil.readInt(is); crc = Crc32Caucho.generateInt32(crc, value); } int count = BitsUtil.readInt(is); crc = Crc32Caucho.generateInt32(crc, count); ArrayList<Integer> segmentSizes = new ArrayList<>(); for (int i = 0; i < count; i++) { int size = BitsUtil.readInt(is); crc = Crc32Caucho.generateInt32(crc, size); segmentSizes.add(size); } int crcFile = BitsUtil.readInt(is); if (crc != crcFile) { System.out.println("MISMATCHED_CRC: " + crcFile); return false; } _metaSegment = new SegmentExtent10(0, 0, META_SEGMENT_SIZE); _segmentId = 1; _metaOffset = is.position(); } return true; }
class class_name[name] begin[{] method[readMetaHeader, return_type[type[boolean]], modifier[private], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=17), name=crc)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readLong, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None), name=magic)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=magic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=KELP_MAGIC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="WRONG_MAGIC: "), operandr=MemberReference(member=magic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=magic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generate, postfix_operators=[], prefix_operators=[], qualifier=Crc32Caucho, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_nonce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_nonce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateInt32, postfix_operators=[], prefix_operators=[], qualifier=Crc32Caucho, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None), name=headers)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateInt32, postfix_operators=[], prefix_operators=[], qualifier=Crc32Caucho, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateInt32, postfix_operators=[], prefix_operators=[], qualifier=Crc32Caucho, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateInt32, postfix_operators=[], prefix_operators=[], qualifier=Crc32Caucho, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=headers, 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), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateInt32, postfix_operators=[], prefix_operators=[], qualifier=Crc32Caucho, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=segmentSizes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateInt32, postfix_operators=[], prefix_operators=[], qualifier=Crc32Caucho, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=segmentSizes, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, 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), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=BitsUtil, selectors=[], type_arguments=None), name=crcFile)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=crc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=crcFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MISMATCHED_CRC: "), operandr=MemberReference(member=crcFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_metaSegment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=META_SEGMENT_SIZE, 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=SegmentExtent10, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_segmentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_metaOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=position, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None)), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=is, type=ReferenceType(arguments=None, dimensions=[], name=ReadStream, sub_type=None), value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=META_SEGMENT_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=openRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))]) return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[readMetaHeader] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] operator[SEP] identifier[ReadStream] identifier[is] operator[=] identifier[openRead] operator[SEP] Other[0] , identifier[META_SEGMENT_SIZE] operator[SEP] operator[SEP] { Keyword[int] identifier[crc] operator[=] Other[17] operator[SEP] Keyword[long] identifier[magic] operator[=] identifier[BitsUtil] operator[SEP] identifier[readLong] operator[SEP] identifier[is] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[magic] operator[!=] identifier[KELP_MAGIC] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[magic] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[crc] operator[=] identifier[Crc32Caucho] operator[SEP] identifier[generate] operator[SEP] identifier[crc] , identifier[magic] operator[SEP] operator[SEP] identifier[_nonce] operator[=] identifier[BitsUtil] operator[SEP] identifier[readInt] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[crc] operator[=] identifier[Crc32Caucho] operator[SEP] identifier[generateInt32] operator[SEP] identifier[crc] , identifier[_nonce] operator[SEP] operator[SEP] Keyword[int] identifier[headers] operator[=] identifier[BitsUtil] operator[SEP] identifier[readInt] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[crc] operator[=] identifier[Crc32Caucho] operator[SEP] identifier[generateInt32] operator[SEP] identifier[crc] , identifier[headers] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[headers] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[key] operator[=] identifier[BitsUtil] operator[SEP] identifier[readInt] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[crc] operator[=] identifier[Crc32Caucho] operator[SEP] identifier[generateInt32] operator[SEP] identifier[crc] , identifier[key] operator[SEP] operator[SEP] Keyword[int] identifier[value] operator[=] identifier[BitsUtil] operator[SEP] identifier[readInt] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[crc] operator[=] identifier[Crc32Caucho] operator[SEP] identifier[generateInt32] operator[SEP] identifier[crc] , identifier[value] operator[SEP] operator[SEP] } Keyword[int] identifier[count] operator[=] identifier[BitsUtil] operator[SEP] identifier[readInt] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[crc] operator[=] identifier[Crc32Caucho] operator[SEP] identifier[generateInt32] operator[SEP] identifier[crc] , identifier[count] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[segmentSizes] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[size] operator[=] identifier[BitsUtil] operator[SEP] identifier[readInt] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[crc] operator[=] identifier[Crc32Caucho] operator[SEP] identifier[generateInt32] operator[SEP] identifier[crc] , identifier[size] operator[SEP] operator[SEP] identifier[segmentSizes] operator[SEP] identifier[add] operator[SEP] identifier[size] operator[SEP] operator[SEP] } Keyword[int] identifier[crcFile] operator[=] identifier[BitsUtil] operator[SEP] identifier[readInt] operator[SEP] identifier[is] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[crc] operator[!=] identifier[crcFile] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[crcFile] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[_metaSegment] operator[=] Keyword[new] identifier[SegmentExtent10] operator[SEP] Other[0] , Other[0] , identifier[META_SEGMENT_SIZE] operator[SEP] operator[SEP] identifier[_segmentId] operator[=] Other[1] operator[SEP] identifier[_metaOffset] operator[=] identifier[is] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void write_ref(final String node, final int id, final int creation) { /* Always encode as an extended reference; all participating parties are now expected to be able to decode extended references. */ int ids[] = new int[1]; ids[0] = id; write_ref(node, ids, creation); }
class class_name[name] begin[{] method[write_ref, return_type[void], modifier[public], parameter[node, id, creation]] begin[{] local_variable[type[int], ids] assign[member[.ids], member[.id]] call[.write_ref, parameter[member[.node], member[.ids], member[.creation]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[write_ref] operator[SEP] Keyword[final] identifier[String] identifier[node] , Keyword[final] Keyword[int] identifier[id] , Keyword[final] Keyword[int] identifier[creation] operator[SEP] { Keyword[int] identifier[ids] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[ids] operator[SEP] Other[0] operator[SEP] operator[=] identifier[id] operator[SEP] identifier[write_ref] operator[SEP] identifier[node] , identifier[ids] , identifier[creation] operator[SEP] operator[SEP] }
@CheckReturnValue @NonNull public final ParallelFlowable<T> doOnRequest(@NonNull LongConsumer onRequest) { ObjectHelper.requireNonNull(onRequest, "onRequest is null"); return RxJavaPlugins.onAssembly(new ParallelPeek<T>(this, Functions.emptyConsumer(), Functions.emptyConsumer(), Functions.emptyConsumer(), Functions.EMPTY_ACTION, Functions.EMPTY_ACTION, Functions.emptyConsumer(), onRequest, Functions.EMPTY_ACTION )); }
class class_name[name] begin[{] method[doOnRequest, return_type[type[ParallelFlowable]], modifier[final public], parameter[onRequest]] begin[{] call[ObjectHelper.requireNonNull, parameter[member[.onRequest], literal["onRequest is null"]]] return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[], member=emptyConsumer, postfix_operators=[], prefix_operators=[], qualifier=Functions, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=emptyConsumer, postfix_operators=[], prefix_operators=[], qualifier=Functions, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=emptyConsumer, postfix_operators=[], prefix_operators=[], qualifier=Functions, selectors=[], type_arguments=None), MemberReference(member=EMPTY_ACTION, postfix_operators=[], prefix_operators=[], qualifier=Functions, selectors=[]), MemberReference(member=EMPTY_ACTION, postfix_operators=[], prefix_operators=[], qualifier=Functions, selectors=[]), MethodInvocation(arguments=[], member=emptyConsumer, postfix_operators=[], prefix_operators=[], qualifier=Functions, selectors=[], type_arguments=None), MemberReference(member=onRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EMPTY_ACTION, postfix_operators=[], prefix_operators=[], qualifier=Functions, 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=ParallelPeek, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[CheckReturnValue] annotation[@] identifier[NonNull] Keyword[public] Keyword[final] identifier[ParallelFlowable] operator[<] identifier[T] operator[>] identifier[doOnRequest] operator[SEP] annotation[@] identifier[NonNull] identifier[LongConsumer] identifier[onRequest] operator[SEP] { identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[onRequest] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[ParallelPeek] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[Functions] operator[SEP] identifier[emptyConsumer] operator[SEP] operator[SEP] , identifier[Functions] operator[SEP] identifier[emptyConsumer] operator[SEP] operator[SEP] , identifier[Functions] operator[SEP] identifier[emptyConsumer] operator[SEP] operator[SEP] , identifier[Functions] operator[SEP] identifier[EMPTY_ACTION] , identifier[Functions] operator[SEP] identifier[EMPTY_ACTION] , identifier[Functions] operator[SEP] identifier[emptyConsumer] operator[SEP] operator[SEP] , identifier[onRequest] , identifier[Functions] operator[SEP] identifier[EMPTY_ACTION] operator[SEP] operator[SEP] operator[SEP] }
@Override public DeleteAccessKeyResult deleteAccessKey(DeleteAccessKeyRequest request) { request = beforeClientExecution(request); return executeDeleteAccessKey(request); }
class class_name[name] begin[{] method[deleteAccessKey, return_type[type[DeleteAccessKeyResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDeleteAccessKey, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DeleteAccessKeyResult] identifier[deleteAccessKey] operator[SEP] identifier[DeleteAccessKeyRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDeleteAccessKey] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public ComputeNodeListOptions withOcpDate(DateTime ocpDate) { if (ocpDate == null) { this.ocpDate = null; } else { this.ocpDate = new DateTimeRfc1123(ocpDate); } return this; }
class class_name[name] begin[{] method[withOcpDate, return_type[type[ComputeNodeListOptions]], modifier[public], parameter[ocpDate]] begin[{] if[binary_operation[member[.ocpDate], ==, literal[null]]] begin[{] assign[THIS[member[None.ocpDate]], literal[null]] else begin[{] assign[THIS[member[None.ocpDate]], ClassCreator(arguments=[MemberReference(member=ocpDate, 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=DateTimeRfc1123, sub_type=None))] end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ComputeNodeListOptions] identifier[withOcpDate] operator[SEP] identifier[DateTime] identifier[ocpDate] operator[SEP] { Keyword[if] operator[SEP] identifier[ocpDate] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Other[null] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[ocpDate] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public OIndexInternal<?> create(final OIndexDefinition indexDefinition, final String clusterIndexName, final Set<String> clustersToIndex, boolean rebuild, final OProgressListener progressListener, final OBinarySerializer valueSerializer) { acquireExclusiveLock(); try { configuration = indexConfigurationInstance(new ODocument().setTrackingChanges(false)); this.indexDefinition = indexDefinition; if (clustersToIndex != null) this.clustersToIndex = new HashSet<>(clustersToIndex); else this.clustersToIndex = new HashSet<>(); // do not remove this, it is needed to remove index garbage if such one exists try { if (apiVersion == 0) { removeValuesContainer(); } } catch (Exception e) { OLogManager.instance().error(this, "Error during deletion of index '%s'", e, name); } indexId = storage.addIndexEngine(name, algorithm, type, indexDefinition, valueSerializer, isAutomatic(), true, version, 1, this instanceof OIndexMultiValues, getEngineProperties(), clustersToIndex, metadata); apiVersion = OAbstractPaginatedStorage.extractEngineAPIVersion(indexId); assert indexId >= 0; assert apiVersion >= 0; onIndexEngineChange(indexId); if (rebuild) fillIndex(progressListener, false); updateConfiguration(); } catch (Exception e) { OLogManager.instance().error(this, "Exception during index '%s' creation", e, name); while (true) try { if (indexId >= 0) storage.deleteIndexEngine(indexId); break; } catch (OInvalidIndexEngineIdException ignore) { doReloadIndexEngine(); } catch (Exception ex) { OLogManager.instance().error(this, "Exception during index '%s' deletion", ex, name); } if (e instanceof OIndexException) throw (OIndexException) e; throw OException.wrapException(new OIndexException("Cannot create the index '" + name + "'"), e); } finally { releaseExclusiveLock(); } return this; }
class class_name[name] begin[{] method[create, return_type[type[OIndexInternal]], modifier[public], parameter[indexDefinition, clusterIndexName, clustersToIndex, rebuild, progressListener, valueSerializer]] begin[{] call[.acquireExclusiveLock, parameter[]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=configuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setTrackingChanges, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ODocument, sub_type=None))], member=indexConfigurationInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=indexDefinition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=indexDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=clustersToIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=clustersToIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=clustersToIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=ClassCreator(arguments=[MemberReference(member=clustersToIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None))), label=None)), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=apiVersion, 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=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=removeValuesContainer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=instance, postfix_operators=[], prefix_operators=[], qualifier=OLogManager, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error during deletion of index '%s'"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=indexId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indexDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueSerializer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=isAutomatic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=OIndexMultiValues, sub_type=None), operator=instanceof), MethodInvocation(arguments=[], member=getEngineProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=clustersToIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addIndexEngine, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=apiVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=indexId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractEngineAPIVersion, postfix_operators=[], prefix_operators=[], qualifier=OAbstractPaginatedStorage, selectors=[], type_arguments=None)), label=None), AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=indexId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None, value=None), AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=apiVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None, value=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=indexId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onIndexEngineChange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=rebuild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=progressListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=fillIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=updateConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=instance, postfix_operators=[], prefix_operators=[], qualifier=OLogManager, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception during index '%s' creation"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), WhileStatement(body=TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=indexId, 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=[MemberReference(member=indexId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteIndexEngine, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), label=None)), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=doReloadIndexEngine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['OInvalidIndexEngineIdException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=instance, postfix_operators=[], prefix_operators=[], qualifier=OLogManager, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception during index '%s' deletion"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=OIndexException, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=ThrowStatement(expression=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OIndexException, sub_type=None)), label=None)), ThrowStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot create the index '"), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OIndexException, sub_type=None)), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrapException, postfix_operators=[], prefix_operators=[], qualifier=OException, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=releaseExclusiveLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[OIndexInternal] operator[<] operator[?] operator[>] identifier[create] operator[SEP] Keyword[final] identifier[OIndexDefinition] identifier[indexDefinition] , Keyword[final] identifier[String] identifier[clusterIndexName] , Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[clustersToIndex] , Keyword[boolean] identifier[rebuild] , Keyword[final] identifier[OProgressListener] identifier[progressListener] , Keyword[final] identifier[OBinarySerializer] identifier[valueSerializer] operator[SEP] { identifier[acquireExclusiveLock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[configuration] operator[=] identifier[indexConfigurationInstance] operator[SEP] Keyword[new] identifier[ODocument] operator[SEP] operator[SEP] operator[SEP] identifier[setTrackingChanges] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[indexDefinition] operator[=] identifier[indexDefinition] operator[SEP] Keyword[if] operator[SEP] identifier[clustersToIndex] operator[!=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[clustersToIndex] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] identifier[clustersToIndex] operator[SEP] operator[SEP] Keyword[else] Keyword[this] operator[SEP] identifier[clustersToIndex] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[apiVersion] operator[==] Other[0] operator[SEP] { identifier[removeValuesContainer] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[OLogManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] Keyword[this] , literal[String] , identifier[e] , identifier[name] operator[SEP] operator[SEP] } identifier[indexId] operator[=] identifier[storage] operator[SEP] identifier[addIndexEngine] operator[SEP] identifier[name] , identifier[algorithm] , identifier[type] , identifier[indexDefinition] , identifier[valueSerializer] , identifier[isAutomatic] operator[SEP] operator[SEP] , literal[boolean] , identifier[version] , Other[1] , Keyword[this] Keyword[instanceof] identifier[OIndexMultiValues] , identifier[getEngineProperties] operator[SEP] operator[SEP] , identifier[clustersToIndex] , identifier[metadata] operator[SEP] operator[SEP] identifier[apiVersion] operator[=] identifier[OAbstractPaginatedStorage] operator[SEP] identifier[extractEngineAPIVersion] operator[SEP] identifier[indexId] operator[SEP] operator[SEP] Keyword[assert] identifier[indexId] operator[>=] Other[0] operator[SEP] Keyword[assert] identifier[apiVersion] operator[>=] Other[0] operator[SEP] identifier[onIndexEngineChange] operator[SEP] identifier[indexId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rebuild] operator[SEP] identifier[fillIndex] operator[SEP] identifier[progressListener] , literal[boolean] operator[SEP] operator[SEP] identifier[updateConfiguration] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[OLogManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] Keyword[this] , literal[String] , identifier[e] , identifier[name] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[indexId] operator[>=] Other[0] operator[SEP] identifier[storage] operator[SEP] identifier[deleteIndexEngine] operator[SEP] identifier[indexId] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[catch] operator[SEP] identifier[OInvalidIndexEngineIdException] identifier[ignore] operator[SEP] { identifier[doReloadIndexEngine] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[OLogManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] Keyword[this] , literal[String] , identifier[ex] , identifier[name] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[OIndexException] operator[SEP] Keyword[throw] operator[SEP] identifier[OIndexException] operator[SEP] identifier[e] operator[SEP] Keyword[throw] identifier[OException] operator[SEP] identifier[wrapException] operator[SEP] Keyword[new] identifier[OIndexException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[releaseExclusiveLock] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void remove(int sequence) { int index = toIndex(sequence); ringItems[index] = null; isTask[index] = false; head--; callableCounter--; }
class class_name[name] begin[{] method[remove, return_type[void], modifier[public], parameter[sequence]] begin[{] local_variable[type[int], index] assign[member[.ringItems], literal[null]] assign[member[.isTask], literal[false]] member[.head] member[.callableCounter] end[}] END[}]
Keyword[public] Keyword[void] identifier[remove] operator[SEP] Keyword[int] identifier[sequence] operator[SEP] { Keyword[int] identifier[index] operator[=] identifier[toIndex] operator[SEP] identifier[sequence] operator[SEP] operator[SEP] identifier[ringItems] operator[SEP] identifier[index] operator[SEP] operator[=] Other[null] operator[SEP] identifier[isTask] operator[SEP] identifier[index] operator[SEP] operator[=] literal[boolean] operator[SEP] identifier[head] operator[--] operator[SEP] identifier[callableCounter] operator[--] operator[SEP] }
public com.google.api.ads.admanager.axis.v201808.Money getNetBillableRevenueOverride() { return netBillableRevenueOverride; }
class class_name[name] begin[{] method[getNetBillableRevenueOverride, return_type[type[com]], modifier[public], parameter[]] begin[{] return[member[.netBillableRevenueOverride]] end[}] END[}]
Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201808] operator[SEP] identifier[Money] identifier[getNetBillableRevenueOverride] operator[SEP] operator[SEP] { Keyword[return] identifier[netBillableRevenueOverride] operator[SEP] }
public static Object parseExpression(String expression, String path, int lineNumber) { try { return Ognl.parseExpression(expression); } catch (Exception ex) { throw new OgnlRuntimeException(ex, path, lineNumber); } }
class class_name[name] begin[{] method[parseExpression, return_type[type[Object]], modifier[public static], parameter[expression, path, lineNumber]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=expression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseExpression, postfix_operators=[], prefix_operators=[], qualifier=Ognl, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lineNumber, 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=OgnlRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[parseExpression] operator[SEP] identifier[String] identifier[expression] , identifier[String] identifier[path] , Keyword[int] identifier[lineNumber] operator[SEP] { Keyword[try] { Keyword[return] identifier[Ognl] operator[SEP] identifier[parseExpression] operator[SEP] identifier[expression] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[OgnlRuntimeException] operator[SEP] identifier[ex] , identifier[path] , identifier[lineNumber] operator[SEP] operator[SEP] } }
void tokenize(String pat) throws javax.xml.transform.TransformerException { tokenize(pat, null); }
class class_name[name] begin[{] method[tokenize, return_type[void], modifier[default], parameter[pat]] begin[{] call[.tokenize, parameter[member[.pat], literal[null]]] end[}] END[}]
Keyword[void] identifier[tokenize] operator[SEP] identifier[String] identifier[pat] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[transform] operator[SEP] identifier[TransformerException] { identifier[tokenize] operator[SEP] identifier[pat] , Other[null] operator[SEP] operator[SEP] }
public boolean isSuppressed(Tree tree) { SuppressWarnings suppression = ASTHelpers.getAnnotation(tree, SuppressWarnings.class); return suppression != null && !Collections.disjoint(Arrays.asList(suppression.value()), allNames()); }
class class_name[name] begin[{] method[isSuppressed, return_type[type[boolean]], modifier[public], parameter[tree]] begin[{] local_variable[type[SuppressWarnings], suppression] return[binary_operation[binary_operation[member[.suppression], !=, literal[null]], &&, call[Collections.disjoint, parameter[call[Arrays.asList, parameter[call[suppression.value, parameter[]]]], call[.allNames, parameter[]]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isSuppressed] operator[SEP] identifier[Tree] identifier[tree] operator[SEP] { identifier[SuppressWarnings] identifier[suppression] operator[=] identifier[ASTHelpers] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[tree] , identifier[SuppressWarnings] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[suppression] operator[!=] Other[null] operator[&&] operator[!] identifier[Collections] operator[SEP] identifier[disjoint] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[suppression] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] , identifier[allNames] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void publishTo(final K key, final Publisher<V> publisher) { registered.get(key).fromStream(Spouts.from(publisher)); }
class class_name[name] begin[{] method[publishTo, return_type[void], modifier[public], parameter[key, publisher]] begin[{] call[registered.get, parameter[member[.key]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[publishTo] operator[SEP] Keyword[final] identifier[K] identifier[key] , Keyword[final] identifier[Publisher] operator[<] identifier[V] operator[>] identifier[publisher] operator[SEP] { identifier[registered] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[fromStream] operator[SEP] identifier[Spouts] operator[SEP] identifier[from] operator[SEP] identifier[publisher] operator[SEP] operator[SEP] operator[SEP] }
private static String format(String message, Object... args) { if(message == null) { return null; } if(message.isEmpty()) { return ""; } if(args.length == 0) { return message; } for(int i = 0; i < args.length; i++) { // at this point args[i] could be null, condition silently ignored by next branching logic // and this is because all branch tests are null safe // anyway, if add new branch test takes care to be also null safe or test explicitly for args[i] == null if(args[i] instanceof Class) { args[i] = ((Class<?>)args[i]).getCanonicalName(); } else if(args[i] instanceof Throwable) { String s = ((Throwable)args[i]).getMessage(); if(s == null) { s = args[i].getClass().getCanonicalName(); } args[i] = s; } else if(args[i] instanceof Thread) { Thread thread = (Thread)args[i]; StringBuilder sb = new StringBuilder(); sb.append(thread.getName()); sb.append(':'); sb.append(thread.getId()); args[i] = sb.toString(); } else if(args[i] instanceof File) { args[i] = ((File)args[i]).getAbsolutePath(); } else if(isArrayLike(args[i])) { StringBuilder sb = new StringBuilder(); sb.append('['); int index = 0; for(Object object : iterable(args[i])) { if(object == null) { continue; } String value = object instanceof String ? (String)object : object.toString(); if(value.isEmpty()) { continue; } if(index++ > 0) { sb.append(','); } if(index == 4) { sb.append("..."); break; } sb.append(object); } sb.append(']'); args[i] = sb.toString(); } } try { return String.format(message, args); } catch(Throwable unused) { // return unformatted message if format fails return message; } }
class class_name[name] begin[{] method[format, return_type[type[String]], modifier[private static], parameter[message, args]] begin[{] if[binary_operation[member[.message], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[call[message.isEmpty, parameter[]]] begin[{] return[literal[""]] else begin[{] None end[}] if[binary_operation[member[args.length], ==, literal[0]]] begin[{] return[member[.message]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=ReferenceType(arguments=None, dimensions=[], name=Thread, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=isArrayLike, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='[')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, 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=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), if_true=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, 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=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="...")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=iterable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=Thread, sub_type=None)), name=thread)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Thread, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=thread, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=thread, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=s, 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=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=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=args, 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) TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=unused, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[format] operator[SEP] identifier[String] identifier[message] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[message] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[message] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[message] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[args] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[Class] operator[SEP] { identifier[args] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[Throwable] operator[SEP] { identifier[String] identifier[s] operator[=] operator[SEP] operator[SEP] identifier[Throwable] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] { identifier[s] operator[=] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] } identifier[args] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[s] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[Thread] operator[SEP] { identifier[Thread] identifier[thread] operator[=] operator[SEP] identifier[Thread] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[thread] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[thread] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[File] operator[SEP] { identifier[args] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] operator[SEP] identifier[File] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[isArrayLike] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[object] operator[:] identifier[iterable] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[String] identifier[value] operator[=] identifier[object] Keyword[instanceof] identifier[String] operator[?] operator[SEP] identifier[String] operator[SEP] identifier[object] operator[:] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[index] operator[++] operator[>] Other[0] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[index] operator[==] Other[4] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[object] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } } Keyword[try] { Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[message] , identifier[args] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[unused] operator[SEP] { Keyword[return] identifier[message] operator[SEP] } }
protected <T> T getResource(String path, Class<T> objectClass) throws SmartsheetException { Util.throwIfNull(path, objectClass); if(path.isEmpty()) { com.smartsheet.api.models.Error error = new com.smartsheet.api.models.Error(); error.setMessage("An empty path was provided."); throw new ResourceNotFoundException(error); } HttpRequest request = createHttpRequest(smartsheet.getBaseURI().resolve(path), HttpMethod.GET); T obj = null; String content = null; try { HttpResponse response = this.smartsheet.getHttpClient().request(request); InputStream inputStream = response.getEntity().getContent(); switch (response.getStatusCode()) { case 200: try { if (log.isInfoEnabled()) { ByteArrayOutputStream contentCopyStream = new ByteArrayOutputStream(); inputStream = StreamUtil.cloneContent(inputStream, response.getEntity().getContentLength(), contentCopyStream); content = StreamUtil.toUtf8StringOrHex(contentCopyStream, getResponseLogLength()); } obj = this.smartsheet.getJsonSerializer().deserialize(objectClass, inputStream); } catch (JsonParseException e) { log.info("failure parsing '{}'", content, e); throw new SmartsheetException(e); } catch (JsonMappingException e) { log.info("failure mapping '{}'", content, e); throw new SmartsheetException(e); } catch (IOException e) { log.info("failure loading '{}'", content, e); throw new SmartsheetException(e); } break; default: handleError(response); } } catch (JSONSerializerException jsx) { log.info("failed to parse '{}'", content, jsx); throw jsx; } finally { smartsheet.getHttpClient().releaseConnection(); } return obj; }
class class_name[name] begin[{] method[getResource, return_type[type[T]], modifier[protected], parameter[path, objectClass]] begin[{] call[Util.throwIfNull, parameter[member[.path], member[.objectClass]]] if[call[path.isEmpty, parameter[]]] begin[{] local_variable[type[com], error] call[error.setMessage, parameter[literal["An empty path was provided."]]] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=error, 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=ResourceNotFoundException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[HttpRequest], request] local_variable[type[T], obj] local_variable[type[String], content] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=smartsheet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getHttpClient, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=request, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=response)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpResponse, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[MethodInvocation(arguments=[], member=getContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=inputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=200)], statements=[TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isInfoEnabled, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None)), name=contentCopyStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getEntity, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[MethodInvocation(arguments=[], member=getContentLength, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=contentCopyStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cloneContent, postfix_operators=[], prefix_operators=[], qualifier=StreamUtil, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=contentCopyStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getResponseLogLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=toUtf8StringOrHex, postfix_operators=[], prefix_operators=[], qualifier=StreamUtil, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=smartsheet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getJsonSerializer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=objectClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deserialize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failure parsing '{}'"), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), 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=SmartsheetException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JsonParseException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failure mapping '{}'"), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), 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=SmartsheetException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JsonMappingException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failure loading '{}'"), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), 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=SmartsheetException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failed to parse '{}'"), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=jsx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=jsx, types=['JSONSerializerException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getHttpClient, postfix_operators=[], prefix_operators=[], qualifier=smartsheet, selectors=[MethodInvocation(arguments=[], member=releaseConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) return[member[.obj]] end[}] END[}]
Keyword[protected] operator[<] identifier[T] operator[>] identifier[T] identifier[getResource] operator[SEP] identifier[String] identifier[path] , identifier[Class] operator[<] identifier[T] operator[>] identifier[objectClass] operator[SEP] Keyword[throws] identifier[SmartsheetException] { identifier[Util] operator[SEP] identifier[throwIfNull] operator[SEP] identifier[path] , identifier[objectClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[com] operator[SEP] identifier[smartsheet] operator[SEP] identifier[api] operator[SEP] identifier[models] operator[SEP] identifier[Error] identifier[error] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[smartsheet] operator[SEP] identifier[api] operator[SEP] identifier[models] operator[SEP] identifier[Error] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] identifier[setMessage] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ResourceNotFoundException] operator[SEP] identifier[error] operator[SEP] operator[SEP] } identifier[HttpRequest] identifier[request] operator[=] identifier[createHttpRequest] operator[SEP] identifier[smartsheet] operator[SEP] identifier[getBaseURI] operator[SEP] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] identifier[path] operator[SEP] , identifier[HttpMethod] operator[SEP] identifier[GET] operator[SEP] operator[SEP] identifier[T] identifier[obj] operator[=] Other[null] operator[SEP] identifier[String] identifier[content] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[HttpResponse] identifier[response] operator[=] Keyword[this] operator[SEP] identifier[smartsheet] operator[SEP] identifier[getHttpClient] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[InputStream] identifier[inputStream] operator[=] identifier[response] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[response] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] Other[200] operator[:] Keyword[try] { Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[ByteArrayOutputStream] identifier[contentCopyStream] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[inputStream] operator[=] identifier[StreamUtil] operator[SEP] identifier[cloneContent] operator[SEP] identifier[inputStream] , identifier[response] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] , identifier[contentCopyStream] operator[SEP] operator[SEP] identifier[content] operator[=] identifier[StreamUtil] operator[SEP] identifier[toUtf8StringOrHex] operator[SEP] identifier[contentCopyStream] , identifier[getResponseLogLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[obj] operator[=] Keyword[this] operator[SEP] identifier[smartsheet] operator[SEP] identifier[getJsonSerializer] operator[SEP] operator[SEP] operator[SEP] identifier[deserialize] operator[SEP] identifier[objectClass] , identifier[inputStream] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[JsonParseException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[content] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SmartsheetException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[JsonMappingException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[content] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SmartsheetException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[content] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SmartsheetException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[handleError] operator[SEP] identifier[response] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[JSONSerializerException] identifier[jsx] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[content] , identifier[jsx] operator[SEP] operator[SEP] Keyword[throw] identifier[jsx] operator[SEP] } Keyword[finally] { identifier[smartsheet] operator[SEP] identifier[getHttpClient] operator[SEP] operator[SEP] operator[SEP] identifier[releaseConnection] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[obj] operator[SEP] }
public Element cloneNode(final INestableNode parent) { final Element element = new Element(this.elementName); element.addAttributes(this.attributes); for (final INode child : getChildren()) { final INode clonedChild = child.cloneNode(element); element.addChild(clonedChild); } element.setLine(getLine()); element.setCol(getCol()); element.setParent(parent); return element; }
class class_name[name] begin[{] method[cloneNode, return_type[type[Element]], modifier[public], parameter[parent]] begin[{] local_variable[type[Element], element] call[element.addAttributes, parameter[THIS[member[None.attributes]]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cloneNode, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), name=clonedChild)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=INode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=clonedChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=INode, sub_type=None))), label=None) call[element.setLine, parameter[call[.getLine, parameter[]]]] call[element.setCol, parameter[call[.getCol, parameter[]]]] call[element.setParent, parameter[member[.parent]]] return[member[.element]] end[}] END[}]
Keyword[public] identifier[Element] identifier[cloneNode] operator[SEP] Keyword[final] identifier[INestableNode] identifier[parent] operator[SEP] { Keyword[final] identifier[Element] identifier[element] operator[=] Keyword[new] identifier[Element] operator[SEP] Keyword[this] operator[SEP] identifier[elementName] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[addAttributes] operator[SEP] Keyword[this] operator[SEP] identifier[attributes] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[INode] identifier[child] operator[:] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[INode] identifier[clonedChild] operator[=] identifier[child] operator[SEP] identifier[cloneNode] operator[SEP] identifier[element] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[addChild] operator[SEP] identifier[clonedChild] operator[SEP] operator[SEP] } identifier[element] operator[SEP] identifier[setLine] operator[SEP] identifier[getLine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[setCol] operator[SEP] identifier[getCol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[setParent] operator[SEP] identifier[parent] operator[SEP] operator[SEP] Keyword[return] identifier[element] operator[SEP] }
public static int cusparseSsctr( cusparseHandle handle, int nnz, Pointer xVal, Pointer xInd, Pointer y, int idxBase) { return checkResult(cusparseSsctrNative(handle, nnz, xVal, xInd, y, idxBase)); }
class class_name[name] begin[{] method[cusparseSsctr, return_type[type[int]], modifier[public static], parameter[handle, nnz, xVal, xInd, y, idxBase]] begin[{] return[call[.checkResult, parameter[call[.cusparseSsctrNative, parameter[member[.handle], member[.nnz], member[.xVal], member[.xInd], member[.y], member[.idxBase]]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[cusparseSsctr] operator[SEP] identifier[cusparseHandle] identifier[handle] , Keyword[int] identifier[nnz] , identifier[Pointer] identifier[xVal] , identifier[Pointer] identifier[xInd] , identifier[Pointer] identifier[y] , Keyword[int] identifier[idxBase] operator[SEP] { Keyword[return] identifier[checkResult] operator[SEP] identifier[cusparseSsctrNative] operator[SEP] identifier[handle] , identifier[nnz] , identifier[xVal] , identifier[xInd] , identifier[y] , identifier[idxBase] operator[SEP] operator[SEP] operator[SEP] }
public static void generate(ConfigurationImpl configuration) { FrameOutputWriter framegen; DocPath filename = DocPath.empty; try { filename = DocPaths.INDEX; framegen = new FrameOutputWriter(configuration, filename); framegen.generateFrameFile(); framegen.close(); } catch (IOException exc) { configuration.standardmessage.error( "doclet.exception_encountered", exc.toString(), filename); throw new DocletAbortException(exc); } }
class class_name[name] begin[{] method[generate, return_type[void], modifier[public static], parameter[configuration]] begin[{] local_variable[type[FrameOutputWriter], framegen] local_variable[type[DocPath], filename] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=INDEX, postfix_operators=[], prefix_operators=[], qualifier=DocPaths, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=framegen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=configuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filename, 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=FrameOutputWriter, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=generateFrameFile, postfix_operators=[], prefix_operators=[], qualifier=framegen, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=framegen, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="doclet.exception_encountered"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=exc, selectors=[], type_arguments=None), MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=configuration.standardmessage, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exc, 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=DocletAbortException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[generate] operator[SEP] identifier[ConfigurationImpl] identifier[configuration] operator[SEP] { identifier[FrameOutputWriter] identifier[framegen] operator[SEP] identifier[DocPath] identifier[filename] operator[=] identifier[DocPath] operator[SEP] identifier[empty] operator[SEP] Keyword[try] { identifier[filename] operator[=] identifier[DocPaths] operator[SEP] identifier[INDEX] operator[SEP] identifier[framegen] operator[=] Keyword[new] identifier[FrameOutputWriter] operator[SEP] identifier[configuration] , identifier[filename] operator[SEP] operator[SEP] identifier[framegen] operator[SEP] identifier[generateFrameFile] operator[SEP] operator[SEP] operator[SEP] identifier[framegen] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[exc] operator[SEP] { identifier[configuration] operator[SEP] identifier[standardmessage] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[exc] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[filename] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DocletAbortException] operator[SEP] identifier[exc] operator[SEP] operator[SEP] } }
@Override public ConfigObject include(final ConfigIncludeContext context, String name) { ConfigObject obj = includeWithoutFallback(context, name); // now use the fallback includer if any and merge // its result. if (fallback != null) { return obj.withFallback(fallback.include(context, name)); } else { return obj; } }
class class_name[name] begin[{] method[include, return_type[type[ConfigObject]], modifier[public], parameter[context, name]] begin[{] local_variable[type[ConfigObject], obj] if[binary_operation[member[.fallback], !=, literal[null]]] begin[{] return[call[obj.withFallback, parameter[call[fallback.include, parameter[member[.context], member[.name]]]]]] else begin[{] return[member[.obj]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ConfigObject] identifier[include] operator[SEP] Keyword[final] identifier[ConfigIncludeContext] identifier[context] , identifier[String] identifier[name] operator[SEP] { identifier[ConfigObject] identifier[obj] operator[=] identifier[includeWithoutFallback] operator[SEP] identifier[context] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fallback] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[obj] operator[SEP] identifier[withFallback] operator[SEP] identifier[fallback] operator[SEP] identifier[include] operator[SEP] identifier[context] , identifier[name] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[obj] operator[SEP] } }
public Route bind(String name, Object value) { attributes.put(name, value); return this; }
class class_name[name] begin[{] method[bind, return_type[type[Route]], modifier[public], parameter[name, value]] begin[{] call[attributes.put, parameter[member[.name], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Route] identifier[bind] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] operator[SEP] { identifier[attributes] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private void emitLogHeader(Context context, String mapredTaskId) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); Text textId = new Text(mapredTaskId); for (Map.Entry<String, String> entry: conf) { StringBuilder sb = new StringBuilder(); sb.append(entry.getKey()); sb.append("="); sb.append(entry.getValue()); context.write(textId, new Text(sb.toString())); } context.write(textId, new Text("----- Properties -----")); String[] plist = { "mapred.local.dir", "mapred.child.java.opts", }; for (String k : plist) { String v = conf.get(k); if (v == null) { v = "(null)"; } context.write(textId, new Text(k + " " + v)); } String userDir = System.getProperty("user.dir"); context.write(textId, new Text("user.dir " + userDir)); try { java.net.InetAddress localMachine = java.net.InetAddress.getLocalHost(); context.write(textId, new Text("hostname " + localMachine.getHostName())); } catch (java.net.UnknownHostException uhe) { // handle exception } }
class class_name[name] begin[{] method[emitLogHeader, return_type[void], modifier[private], parameter[context, mapredTaskId]] begin[{] local_variable[type[Configuration], conf] local_variable[type[Text], textId] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=textId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Text, sub_type=None))], member=write, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), 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=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) call[context.write, parameter[member[.textId], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="----- Properties -----")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Text, sub_type=None))]] local_variable[type[String], plist] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None), name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=v, 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=v, 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=textId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MemberReference(member=v, 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=Text, sub_type=None))], member=write, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=plist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=k)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[String], userDir] call[context.write, parameter[member[.textId], ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user.dir "), operandr=MemberReference(member=userDir, 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=Text, sub_type=None))]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLocalHost, postfix_operators=[], prefix_operators=[], qualifier=java.net.InetAddress, selectors=[], type_arguments=None), name=localMachine)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=InetAddress, sub_type=None)))), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=textId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="hostname "), operandr=MethodInvocation(arguments=[], member=getHostName, postfix_operators=[], prefix_operators=[], qualifier=localMachine, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Text, sub_type=None))], member=write, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=uhe, types=['java.net.UnknownHostException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[emitLogHeader] operator[SEP] identifier[Context] identifier[context] , identifier[String] identifier[mapredTaskId] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { identifier[Configuration] identifier[conf] operator[=] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[Text] identifier[textId] operator[=] Keyword[new] identifier[Text] operator[SEP] identifier[mapredTaskId] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[conf] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[write] operator[SEP] identifier[textId] , Keyword[new] identifier[Text] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[context] operator[SEP] identifier[write] operator[SEP] identifier[textId] , Keyword[new] identifier[Text] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[plist] operator[=] { literal[String] , literal[String] , } operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[k] operator[:] identifier[plist] operator[SEP] { identifier[String] identifier[v] operator[=] identifier[conf] operator[SEP] identifier[get] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[==] Other[null] operator[SEP] { identifier[v] operator[=] literal[String] operator[SEP] } identifier[context] operator[SEP] identifier[write] operator[SEP] identifier[textId] , Keyword[new] identifier[Text] operator[SEP] identifier[k] operator[+] literal[String] operator[+] identifier[v] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[userDir] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[write] operator[SEP] identifier[textId] , Keyword[new] identifier[Text] operator[SEP] literal[String] operator[+] identifier[userDir] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[InetAddress] identifier[localMachine] operator[=] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[InetAddress] operator[SEP] identifier[getLocalHost] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[write] operator[SEP] identifier[textId] , Keyword[new] identifier[Text] operator[SEP] literal[String] operator[+] identifier[localMachine] operator[SEP] identifier[getHostName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[UnknownHostException] identifier[uhe] operator[SEP] { } }
@SuppressWarnings("unchecked") public void dataRemoved(FqnWrapper fqnWrapper) { final Fqn fqn = fqnWrapper.getFqn(); ra.dataRemoved((K)fqn.getLastElement()); }
class class_name[name] begin[{] method[dataRemoved, return_type[void], modifier[public], parameter[fqnWrapper]] begin[{] local_variable[type[Fqn], fqn] call[ra.dataRemoved, parameter[Cast(expression=MethodInvocation(arguments=[], member=getLastElement, postfix_operators=[], prefix_operators=[], qualifier=fqn, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None))]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[dataRemoved] operator[SEP] identifier[FqnWrapper] identifier[fqnWrapper] operator[SEP] { Keyword[final] identifier[Fqn] identifier[fqn] operator[=] identifier[fqnWrapper] operator[SEP] identifier[getFqn] operator[SEP] operator[SEP] operator[SEP] identifier[ra] operator[SEP] identifier[dataRemoved] operator[SEP] operator[SEP] identifier[K] operator[SEP] identifier[fqn] operator[SEP] identifier[getLastElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Date toUtcDate(TimeZone browserTZ, TimeZone targetTZ, long localDate) { return toUtcDate(browserTZ, targetTZ, new Date(localDate)); }
class class_name[name] begin[{] method[toUtcDate, return_type[type[Date]], modifier[public static], parameter[browserTZ, targetTZ, localDate]] begin[{] return[call[.toUtcDate, parameter[member[.browserTZ], member[.targetTZ], ClassCreator(arguments=[MemberReference(member=localDate, 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=Date, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[toUtcDate] operator[SEP] identifier[TimeZone] identifier[browserTZ] , identifier[TimeZone] identifier[targetTZ] , Keyword[long] identifier[localDate] operator[SEP] { Keyword[return] identifier[toUtcDate] operator[SEP] identifier[browserTZ] , identifier[targetTZ] , Keyword[new] identifier[Date] operator[SEP] identifier[localDate] operator[SEP] operator[SEP] operator[SEP] }