code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public String getAsShortText(int fieldValue, Locale locale) { return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToShortText(fieldValue); }
class class_name[name] begin[{] method[getAsShortText, return_type[type[String]], modifier[public], parameter[fieldValue, locale]] begin[{] return[call[GJLocaleSymbols.forLocale, parameter[member[.locale]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getAsShortText] operator[SEP] Keyword[int] identifier[fieldValue] , identifier[Locale] identifier[locale] operator[SEP] { Keyword[return] identifier[GJLocaleSymbols] operator[SEP] identifier[forLocale] operator[SEP] identifier[locale] operator[SEP] operator[SEP] identifier[dayOfWeekValueToShortText] operator[SEP] identifier[fieldValue] operator[SEP] operator[SEP] }
private int findCoordElementDiscontiguousInterval(double target, boolean bounded) { int idx = findSingleHit(target); if (idx >= 0) return idx; if (idx == -1) return -1; // no hits // multiple hits = choose closest to the midpoint return findClosest(target); }
class class_name[name] begin[{] method[findCoordElementDiscontiguousInterval, return_type[type[int]], modifier[private], parameter[target, bounded]] begin[{] local_variable[type[int], idx] if[binary_operation[member[.idx], >=, literal[0]]] begin[{] return[member[.idx]] else begin[{] None end[}] if[binary_operation[member[.idx], ==, literal[1]]] begin[{] return[literal[1]] else begin[{] None end[}] return[call[.findClosest, parameter[member[.target]]]] end[}] END[}]
Keyword[private] Keyword[int] identifier[findCoordElementDiscontiguousInterval] operator[SEP] Keyword[double] identifier[target] , Keyword[boolean] identifier[bounded] operator[SEP] { Keyword[int] identifier[idx] operator[=] identifier[findSingleHit] operator[SEP] identifier[target] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[idx] operator[>=] Other[0] operator[SEP] Keyword[return] identifier[idx] operator[SEP] Keyword[if] operator[SEP] identifier[idx] operator[==] operator[-] Other[1] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[return] identifier[findClosest] operator[SEP] identifier[target] operator[SEP] operator[SEP] }
public void init(BaseDatabase database, Record record) { super.init(database, record); m_gridList = new DataRecordList(); m_iEndOfFileIndex = UNKNOWN_POSITION; // Actual end of file (-1 means don't know) m_gridBuffer = new DataRecordBuffer(); m_gridNew = new DataRecordBuffer(); m_iPhysicalFilePosition = UNKNOWN_POSITION; m_iLogicalFilePosition = UNKNOWN_POSITION; if (((record.getOpenMode() & DBConstants.OPEN_READ_ONLY) != DBConstants.OPEN_READ_ONLY) && (record.getCounterField() != null)) record.setOpenMode(record.getOpenMode() | DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY); // Must have for GridTable to re-read. }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[database, record]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=database, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) assign[member[.m_gridList], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataRecordList, sub_type=None))] assign[member[.m_iEndOfFileIndex], member[.UNKNOWN_POSITION]] assign[member[.m_gridBuffer], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataRecordBuffer, sub_type=None))] assign[member[.m_gridNew], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataRecordBuffer, sub_type=None))] assign[member[.m_iPhysicalFilePosition], member[.UNKNOWN_POSITION]] assign[member[.m_iLogicalFilePosition], member[.UNKNOWN_POSITION]] if[binary_operation[binary_operation[binary_operation[call[record.getOpenMode, parameter[]], &, member[DBConstants.OPEN_READ_ONLY]], !=, member[DBConstants.OPEN_READ_ONLY]], &&, binary_operation[call[record.getCounterField, parameter[]], !=, literal[null]]]] begin[{] call[record.setOpenMode, parameter[binary_operation[call[record.getOpenMode, parameter[]], |, member[DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[BaseDatabase] identifier[database] , identifier[Record] identifier[record] operator[SEP] { Keyword[super] operator[SEP] identifier[init] operator[SEP] identifier[database] , identifier[record] operator[SEP] operator[SEP] identifier[m_gridList] operator[=] Keyword[new] identifier[DataRecordList] operator[SEP] operator[SEP] operator[SEP] identifier[m_iEndOfFileIndex] operator[=] identifier[UNKNOWN_POSITION] operator[SEP] identifier[m_gridBuffer] operator[=] Keyword[new] identifier[DataRecordBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[m_gridNew] operator[=] Keyword[new] identifier[DataRecordBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[m_iPhysicalFilePosition] operator[=] identifier[UNKNOWN_POSITION] operator[SEP] identifier[m_iLogicalFilePosition] operator[=] identifier[UNKNOWN_POSITION] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[getOpenMode] operator[SEP] operator[SEP] operator[&] identifier[DBConstants] operator[SEP] identifier[OPEN_READ_ONLY] operator[SEP] operator[!=] identifier[DBConstants] operator[SEP] identifier[OPEN_READ_ONLY] operator[SEP] operator[&&] operator[SEP] identifier[record] operator[SEP] identifier[getCounterField] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[setOpenMode] operator[SEP] identifier[record] operator[SEP] identifier[getOpenMode] operator[SEP] operator[SEP] operator[|] identifier[DBConstants] operator[SEP] identifier[OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY] operator[SEP] operator[SEP] }
private void passViolations(ConstraintValidatorContext context, Set<ConstraintViolation<Object>> source) { for (final ConstraintViolation<Object> violation : source) { final Iterator<Node> nodeIter = violation.getPropertyPath() .iterator(); final ConstraintViolationBuilder builder = context .buildConstraintViolationWithTemplate(violation .getMessageTemplate()); ConstraintValidatorContext nodeContext; if (nodeIter.hasNext()) { StringBuilder sb = new StringBuilder(nodeIter.next().getName()); if (supportsConstraintComposition) { while (nodeIter.hasNext()) { sb.append('.').append(nodeIter.next()); } } builder.addNode(sb.toString()).addConstraintViolation(); } else { builder.addConstraintViolation(); } } }
class class_name[name] begin[{] method[passViolations, return_type[void], modifier[private], parameter[context, source]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPropertyPath, postfix_operators=[], prefix_operators=[], qualifier=violation, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=nodeIter)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessageTemplate, postfix_operators=[], prefix_operators=[], qualifier=violation, selectors=[], type_arguments=None)], member=buildConstraintViolationWithTemplate, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), name=builder)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ConstraintViolationBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=nodeContext)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConstraintValidatorContext, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=nodeIter, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=addConstraintViolation, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=nodeIter, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], 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)), IfStatement(condition=MemberReference(member=supportsConstraintComposition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[WhileStatement(body=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=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=nodeIter, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=nodeIter, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=addNode, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[], member=addConstraintViolation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=violation)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=ConstraintViolation, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[passViolations] operator[SEP] identifier[ConstraintValidatorContext] identifier[context] , identifier[Set] operator[<] identifier[ConstraintViolation] operator[<] identifier[Object] operator[>] operator[>] identifier[source] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[ConstraintViolation] operator[<] identifier[Object] operator[>] identifier[violation] operator[:] identifier[source] operator[SEP] { Keyword[final] identifier[Iterator] operator[<] identifier[Node] operator[>] identifier[nodeIter] operator[=] identifier[violation] operator[SEP] identifier[getPropertyPath] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ConstraintViolationBuilder] identifier[builder] operator[=] identifier[context] operator[SEP] identifier[buildConstraintViolationWithTemplate] operator[SEP] identifier[violation] operator[SEP] identifier[getMessageTemplate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ConstraintValidatorContext] identifier[nodeContext] operator[SEP] Keyword[if] operator[SEP] identifier[nodeIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[nodeIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[supportsConstraintComposition] operator[SEP] { Keyword[while] operator[SEP] identifier[nodeIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[nodeIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[builder] operator[SEP] identifier[addNode] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addConstraintViolation] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[builder] operator[SEP] identifier[addConstraintViolation] operator[SEP] operator[SEP] operator[SEP] } } }
public void resetRow(int filepos, int rowsize) throws IOException { if (out != null) { out.reset(rowsize); buf = out.getBuffer(); } super.resetRow(filepos, rowsize); }
class class_name[name] begin[{] method[resetRow, return_type[void], modifier[public], parameter[filepos, rowsize]] begin[{] if[binary_operation[member[.out], !=, literal[null]]] begin[{] call[out.reset, parameter[member[.rowsize]]] assign[member[.buf], call[out.getBuffer, parameter[]]] else begin[{] None end[}] SuperMethodInvocation(arguments=[MemberReference(member=filepos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rowsize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resetRow, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[resetRow] operator[SEP] Keyword[int] identifier[filepos] , Keyword[int] identifier[rowsize] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[out] operator[!=] Other[null] operator[SEP] { identifier[out] operator[SEP] identifier[reset] operator[SEP] identifier[rowsize] operator[SEP] operator[SEP] identifier[buf] operator[=] identifier[out] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] } Keyword[super] operator[SEP] identifier[resetRow] operator[SEP] identifier[filepos] , identifier[rowsize] operator[SEP] operator[SEP] }
public void check(String action, String expectedResult, String actualResult) { checks++; recordStep(action, expectedResult, actualResult, true, Success.CHECK); }
class class_name[name] begin[{] method[check, return_type[void], modifier[public], parameter[action, expectedResult, actualResult]] begin[{] member[.checks] call[.recordStep, parameter[member[.action], member[.expectedResult], member[.actualResult], literal[true], member[Success.CHECK]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[check] operator[SEP] identifier[String] identifier[action] , identifier[String] identifier[expectedResult] , identifier[String] identifier[actualResult] operator[SEP] { identifier[checks] operator[++] operator[SEP] identifier[recordStep] operator[SEP] identifier[action] , identifier[expectedResult] , identifier[actualResult] , literal[boolean] , identifier[Success] operator[SEP] identifier[CHECK] operator[SEP] operator[SEP] }
public OvhTrunkExternalDisplayedNumber billingAccount_trunk_serviceName_externalDisplayedNumber_number_GET(String billingAccount, String serviceName, String number) throws IOException { String qPath = "/telephony/{billingAccount}/trunk/{serviceName}/externalDisplayedNumber/{number}"; StringBuilder sb = path(qPath, billingAccount, serviceName, number); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhTrunkExternalDisplayedNumber.class); }
class class_name[name] begin[{] method[billingAccount_trunk_serviceName_externalDisplayedNumber_number_GET, return_type[type[OvhTrunkExternalDisplayedNumber]], modifier[public], parameter[billingAccount, serviceName, number]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhTrunkExternalDisplayedNumber, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhTrunkExternalDisplayedNumber] identifier[billingAccount_trunk_serviceName_externalDisplayedNumber_number_GET] operator[SEP] identifier[String] identifier[billingAccount] , identifier[String] identifier[serviceName] , identifier[String] identifier[number] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[billingAccount] , identifier[serviceName] , identifier[number] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhTrunkExternalDisplayedNumber] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public AtomSymbolElement generateElement(IAtom atom, int alignment, RendererModel model) { String text; if (atom instanceof IPseudoAtom) { text = ((IPseudoAtom) atom).getLabel(); } else { text = atom.getSymbol(); } return new AtomSymbolElement(atom.getPoint2d().x, atom.getPoint2d().y, text, atom.getFormalCharge(), atom.getImplicitHydrogenCount(), alignment, getAtomColor(atom, model)); }
class class_name[name] begin[{] method[generateElement, return_type[type[AtomSymbolElement]], modifier[public], parameter[atom, alignment, model]] begin[{] local_variable[type[String], text] if[binary_operation[member[.atom], instanceof, type[IPseudoAtom]]] begin[{] assign[member[.text], Cast(expression=MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IPseudoAtom, sub_type=None))] else begin[{] assign[member[.text], call[atom.getSymbol, parameter[]]] end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPoint2d, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[MemberReference(member=x, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), MethodInvocation(arguments=[], member=getPoint2d, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[MemberReference(member=y, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getFormalCharge, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getImplicitHydrogenCount, postfix_operators=[], prefix_operators=[], qualifier=atom, selectors=[], type_arguments=None), MemberReference(member=alignment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAtomColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AtomSymbolElement, sub_type=None))] end[}] END[}]
Keyword[public] identifier[AtomSymbolElement] identifier[generateElement] operator[SEP] identifier[IAtom] identifier[atom] , Keyword[int] identifier[alignment] , identifier[RendererModel] identifier[model] operator[SEP] { identifier[String] identifier[text] operator[SEP] Keyword[if] operator[SEP] identifier[atom] Keyword[instanceof] identifier[IPseudoAtom] operator[SEP] { identifier[text] operator[=] operator[SEP] operator[SEP] identifier[IPseudoAtom] operator[SEP] identifier[atom] operator[SEP] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[text] operator[=] identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[AtomSymbolElement] operator[SEP] identifier[atom] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] identifier[x] , identifier[atom] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] identifier[y] , identifier[text] , identifier[atom] operator[SEP] identifier[getFormalCharge] operator[SEP] operator[SEP] , identifier[atom] operator[SEP] identifier[getImplicitHydrogenCount] operator[SEP] operator[SEP] , identifier[alignment] , identifier[getAtomColor] operator[SEP] identifier[atom] , identifier[model] operator[SEP] operator[SEP] operator[SEP] }
MockMvcRequestSpecBuilder addSessionAttr(String name, Object value) { spec.sessionAttr(name, value); return this; }
class class_name[name] begin[{] method[addSessionAttr, return_type[type[MockMvcRequestSpecBuilder]], modifier[default], parameter[name, value]] begin[{] call[spec.sessionAttr, parameter[member[.name], member[.value]]] return[THIS[]] end[}] END[}]
identifier[MockMvcRequestSpecBuilder] identifier[addSessionAttr] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] operator[SEP] { identifier[spec] operator[SEP] identifier[sessionAttr] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
static protected synchronized void track(HTTPSession session) { if(!TESTING) throw new UnsupportedOperationException(); if(sessionList == null) sessionList = new ConcurrentSkipListSet<HTTPSession>(); sessionList.add(session); }
class class_name[name] begin[{] method[track, return_type[void], modifier[protected synchronized static], parameter[session]] begin[{] if[member[.TESTING]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.sessionList], ==, literal[null]]] begin[{] assign[member[.sessionList], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=HTTPSession, sub_type=None))], dimensions=None, name=ConcurrentSkipListSet, sub_type=None))] else begin[{] None end[}] call[sessionList.add, parameter[member[.session]]] end[}] END[}]
Keyword[static] Keyword[protected] Keyword[synchronized] Keyword[void] identifier[track] operator[SEP] identifier[HTTPSession] identifier[session] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[TESTING] operator[SEP] Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sessionList] operator[==] Other[null] operator[SEP] identifier[sessionList] operator[=] Keyword[new] identifier[ConcurrentSkipListSet] operator[<] identifier[HTTPSession] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[sessionList] operator[SEP] identifier[add] operator[SEP] identifier[session] operator[SEP] operator[SEP] }
public static Route DELETE(String uriPattern, RouteHandler routeHandler) { return new Route(HttpConstants.Method.DELETE, uriPattern, routeHandler); }
class class_name[name] begin[{] method[DELETE, return_type[type[Route]], modifier[public static], parameter[uriPattern, routeHandler]] begin[{] return[ClassCreator(arguments=[MemberReference(member=DELETE, postfix_operators=[], prefix_operators=[], qualifier=HttpConstants.Method, selectors=[]), MemberReference(member=uriPattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=routeHandler, 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=Route, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Route] identifier[DELETE] operator[SEP] identifier[String] identifier[uriPattern] , identifier[RouteHandler] identifier[routeHandler] operator[SEP] { Keyword[return] Keyword[new] identifier[Route] operator[SEP] identifier[HttpConstants] operator[SEP] identifier[Method] operator[SEP] identifier[DELETE] , identifier[uriPattern] , identifier[routeHandler] operator[SEP] operator[SEP] }
@Override public MapDataStore getMapDataStore(String mapName, int partitionId) { return MapDataStores.createWriteBehindStore(mapStoreContext, partitionId, writeBehindProcessor); }
class class_name[name] begin[{] method[getMapDataStore, return_type[type[MapDataStore]], modifier[public], parameter[mapName, partitionId]] begin[{] return[call[MapDataStores.createWriteBehindStore, parameter[member[.mapStoreContext], member[.partitionId], member[.writeBehindProcessor]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[MapDataStore] identifier[getMapDataStore] operator[SEP] identifier[String] identifier[mapName] , Keyword[int] identifier[partitionId] operator[SEP] { Keyword[return] identifier[MapDataStores] operator[SEP] identifier[createWriteBehindStore] operator[SEP] identifier[mapStoreContext] , identifier[partitionId] , identifier[writeBehindProcessor] operator[SEP] operator[SEP] }
private static boolean needIncrement(MutableBigInteger mdivisor, int roundingMode, int qsign, MutableBigInteger mq, MutableBigInteger mr) { assert !mr.isZero(); int cmpFracHalf = mr.compareHalf(mdivisor); return commonNeedIncrement(roundingMode, qsign, cmpFracHalf, mq.isOdd()); }
class class_name[name] begin[{] method[needIncrement, return_type[type[boolean]], modifier[private static], parameter[mdivisor, roundingMode, qsign, mq, mr]] begin[{] AssertStatement(condition=MethodInvocation(arguments=[], member=isZero, postfix_operators=[], prefix_operators=['!'], qualifier=mr, selectors=[], type_arguments=None), label=None, value=None) local_variable[type[int], cmpFracHalf] return[call[.commonNeedIncrement, parameter[member[.roundingMode], member[.qsign], member[.cmpFracHalf], call[mq.isOdd, parameter[]]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[needIncrement] operator[SEP] identifier[MutableBigInteger] identifier[mdivisor] , Keyword[int] identifier[roundingMode] , Keyword[int] identifier[qsign] , identifier[MutableBigInteger] identifier[mq] , identifier[MutableBigInteger] identifier[mr] operator[SEP] { Keyword[assert] operator[!] identifier[mr] operator[SEP] identifier[isZero] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[cmpFracHalf] operator[=] identifier[mr] operator[SEP] identifier[compareHalf] operator[SEP] identifier[mdivisor] operator[SEP] operator[SEP] Keyword[return] identifier[commonNeedIncrement] operator[SEP] identifier[roundingMode] , identifier[qsign] , identifier[cmpFracHalf] , identifier[mq] operator[SEP] identifier[isOdd] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public AttachmentResource getMainAttachment() throws RepositoryBackendException, RepositoryResourceException { Collection<AttachmentResource> attachments = getAttachments(); for (AttachmentResource at : attachments) { if (isMainAttachment(at)) { return at; } } return null; }
class class_name[name] begin[{] method[getMainAttachment, return_type[type[AttachmentResource]], modifier[public], parameter[]] begin[{] local_variable[type[Collection], attachments] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=at, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isMainAttachment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=at, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=attachments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=at)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttachmentResource, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[AttachmentResource] identifier[getMainAttachment] operator[SEP] operator[SEP] Keyword[throws] identifier[RepositoryBackendException] , identifier[RepositoryResourceException] { identifier[Collection] operator[<] identifier[AttachmentResource] operator[>] identifier[attachments] operator[=] identifier[getAttachments] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AttachmentResource] identifier[at] operator[:] identifier[attachments] operator[SEP] { Keyword[if] operator[SEP] identifier[isMainAttachment] operator[SEP] identifier[at] operator[SEP] operator[SEP] { Keyword[return] identifier[at] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
@SuppressWarnings("unchecked") static <S extends Storable> Class<? extends S> getStorableClass(Class<S> type, boolean isMaster) throws SupportException { synchronized (cCache) { Class<? extends S> storableClass; RawStorableGenerator.Flavors<S> flavors = (RawStorableGenerator.Flavors<S>) cCache.get(type); if (flavors == null) { flavors = new RawStorableGenerator.Flavors<S>(); cCache.put(type, flavors); } else if ((storableClass = flavors.getClass(isMaster)) != null) { return storableClass; } storableClass = generateStorableClass(type, isMaster); flavors.setClass(storableClass, isMaster); return storableClass; } }
class class_name[name] begin[{] method[getStorableClass, return_type[type[Class]], modifier[static], parameter[type, isMaster]] begin[{] SYNCHRONIZED[member[.cCache]] BEGIN[{] local_variable[type[Class], storableClass] local_variable[type[RawStorableGenerator], flavors] if[binary_operation[member[.flavors], ==, literal[null]]] begin[{] assign[member[.flavors], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RawStorableGenerator, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None))], dimensions=None, name=Flavors, sub_type=None)))] call[cCache.put, parameter[member[.type], member[.flavors]]] else begin[{] if[binary_operation[assign[member[.storableClass], call[flavors.getClass, parameter[member[.isMaster]]]], !=, literal[null]]] begin[{] return[member[.storableClass]] else begin[{] None end[}] end[}] assign[member[.storableClass], call[.generateStorableClass, parameter[member[.type], member[.isMaster]]]] call[flavors.setClass, parameter[member[.storableClass], member[.isMaster]]] return[member[.storableClass]] END[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[static] operator[<] identifier[S] Keyword[extends] identifier[Storable] operator[>] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] identifier[getStorableClass] operator[SEP] identifier[Class] operator[<] identifier[S] operator[>] identifier[type] , Keyword[boolean] identifier[isMaster] operator[SEP] Keyword[throws] identifier[SupportException] { Keyword[synchronized] operator[SEP] identifier[cCache] operator[SEP] { identifier[Class] operator[<] operator[?] Keyword[extends] identifier[S] operator[>] identifier[storableClass] operator[SEP] identifier[RawStorableGenerator] operator[SEP] identifier[Flavors] operator[<] identifier[S] operator[>] identifier[flavors] operator[=] operator[SEP] identifier[RawStorableGenerator] operator[SEP] identifier[Flavors] operator[<] identifier[S] operator[>] operator[SEP] identifier[cCache] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[flavors] operator[==] Other[null] operator[SEP] { identifier[flavors] operator[=] Keyword[new] identifier[RawStorableGenerator] operator[SEP] identifier[Flavors] operator[<] identifier[S] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[cCache] operator[SEP] identifier[put] operator[SEP] identifier[type] , identifier[flavors] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[storableClass] operator[=] identifier[flavors] operator[SEP] identifier[getClass] operator[SEP] identifier[isMaster] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[storableClass] operator[SEP] } identifier[storableClass] operator[=] identifier[generateStorableClass] operator[SEP] identifier[type] , identifier[isMaster] operator[SEP] operator[SEP] identifier[flavors] operator[SEP] identifier[setClass] operator[SEP] identifier[storableClass] , identifier[isMaster] operator[SEP] operator[SEP] Keyword[return] identifier[storableClass] operator[SEP] } }
Entry<K,V> removeEntryForKey(Object key) throws ConcurrentModificationException { Object k = maskNull(key); int hash = hash(k); int i = indexFor(hash, table.length); Entry<K,V> prev = table[i]; Entry<K,V> e = prev; while (e != null) { Entry<K,V> next = e.next; if (e.hash == hash && validEntry(e) && eq(k, e.key)) { if (e.is(Entry.DELETED, null) && !e.is(Entry.DELETED, getCurrentThreadId())) throw new ConcurrentModificationException(); if (auto_commit) { modCount++; size--; if (prev == e) table[i] = next; else prev.next = next; return e; } else e.setStatus(Entry.DELETED, getCurrentThreadId()); } prev = e; e = next; } return e; }
class class_name[name] begin[{] method[removeEntryForKey, return_type[type[Entry]], modifier[default], parameter[key]] begin[{] local_variable[type[Object], k] local_variable[type[int], hash] local_variable[type[int], i] local_variable[type[Entry], prev] local_variable[type[Entry], e] while[binary_operation[member[.e], !=, literal[null]]] begin[{] local_variable[type[Entry], next] if[binary_operation[binary_operation[binary_operation[member[e.hash], ==, member[.hash]], &&, call[.validEntry, parameter[member[.e]]]], &&, call[.eq, parameter[member[.k], member[e.key]]]]] begin[{] if[binary_operation[call[e.is, parameter[member[Entry.DELETED], literal[null]]], &&, call[e.is, parameter[member[Entry.DELETED], call[.getCurrentThreadId, parameter[]]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConcurrentModificationException, sub_type=None)), label=None) else begin[{] None end[}] if[member[.auto_commit]] begin[{] member[.modCount] member[.size] if[binary_operation[member[.prev], ==, member[.e]]] begin[{] assign[member[.table], member[.next]] else begin[{] assign[member[prev.next], member[.next]] end[}] return[member[.e]] else begin[{] call[e.setStatus, parameter[member[Entry.DELETED], call[.getCurrentThreadId, parameter[]]]] end[}] else begin[{] None end[}] assign[member[.prev], member[.e]] assign[member[.e], member[.next]] end[}] return[member[.e]] end[}] END[}]
identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[removeEntryForKey] operator[SEP] identifier[Object] identifier[key] operator[SEP] Keyword[throws] identifier[ConcurrentModificationException] { identifier[Object] identifier[k] operator[=] identifier[maskNull] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[int] identifier[hash] operator[=] identifier[hash] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[indexFor] operator[SEP] identifier[hash] , identifier[table] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[prev] operator[=] identifier[table] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[e] operator[=] identifier[prev] operator[SEP] Keyword[while] operator[SEP] identifier[e] operator[!=] Other[null] operator[SEP] { identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[next] operator[=] identifier[e] operator[SEP] identifier[next] operator[SEP] Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[hash] operator[==] identifier[hash] operator[&&] identifier[validEntry] operator[SEP] identifier[e] operator[SEP] operator[&&] identifier[eq] operator[SEP] identifier[k] , identifier[e] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[is] operator[SEP] identifier[Entry] operator[SEP] identifier[DELETED] , Other[null] operator[SEP] operator[&&] operator[!] identifier[e] operator[SEP] identifier[is] operator[SEP] identifier[Entry] operator[SEP] identifier[DELETED] , identifier[getCurrentThreadId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ConcurrentModificationException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[auto_commit] operator[SEP] { identifier[modCount] operator[++] operator[SEP] identifier[size] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[prev] operator[==] identifier[e] operator[SEP] identifier[table] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[next] operator[SEP] Keyword[else] identifier[prev] operator[SEP] identifier[next] operator[=] identifier[next] operator[SEP] Keyword[return] identifier[e] operator[SEP] } Keyword[else] identifier[e] operator[SEP] identifier[setStatus] operator[SEP] identifier[Entry] operator[SEP] identifier[DELETED] , identifier[getCurrentThreadId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[prev] operator[=] identifier[e] operator[SEP] identifier[e] operator[=] identifier[next] operator[SEP] } Keyword[return] identifier[e] operator[SEP] }
public void marshall(Target target, ProtocolMarshaller protocolMarshaller) { if (target == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(target.getId(), ID_BINDING); protocolMarshaller.marshall(target.getArn(), ARN_BINDING); protocolMarshaller.marshall(target.getRoleArn(), ROLEARN_BINDING); protocolMarshaller.marshall(target.getInput(), INPUT_BINDING); protocolMarshaller.marshall(target.getInputPath(), INPUTPATH_BINDING); protocolMarshaller.marshall(target.getInputTransformer(), INPUTTRANSFORMER_BINDING); protocolMarshaller.marshall(target.getKinesisParameters(), KINESISPARAMETERS_BINDING); protocolMarshaller.marshall(target.getRunCommandParameters(), RUNCOMMANDPARAMETERS_BINDING); protocolMarshaller.marshall(target.getEcsParameters(), ECSPARAMETERS_BINDING); protocolMarshaller.marshall(target.getBatchParameters(), BATCHPARAMETERS_BINDING); protocolMarshaller.marshall(target.getSqsParameters(), SQSPARAMETERS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[target, protocolMarshaller]] begin[{] if[binary_operation[member[.target], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=ID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getArn, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=ARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRoleArn, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=ROLEARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInput, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=INPUT_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInputPath, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=INPUTPATH_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInputTransformer, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=INPUTTRANSFORMER_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKinesisParameters, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=KINESISPARAMETERS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRunCommandParameters, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=RUNCOMMANDPARAMETERS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEcsParameters, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=ECSPARAMETERS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBatchParameters, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=BATCHPARAMETERS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSqsParameters, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), MemberReference(member=SQSPARAMETERS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), 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=SdkClientException, 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[marshall] operator[SEP] identifier[Target] identifier[target] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[target] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[ID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getArn] operator[SEP] operator[SEP] , identifier[ARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getRoleArn] operator[SEP] operator[SEP] , identifier[ROLEARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getInput] operator[SEP] operator[SEP] , identifier[INPUT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getInputPath] operator[SEP] operator[SEP] , identifier[INPUTPATH_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getInputTransformer] operator[SEP] operator[SEP] , identifier[INPUTTRANSFORMER_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getKinesisParameters] operator[SEP] operator[SEP] , identifier[KINESISPARAMETERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getRunCommandParameters] operator[SEP] operator[SEP] , identifier[RUNCOMMANDPARAMETERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getEcsParameters] operator[SEP] operator[SEP] , identifier[ECSPARAMETERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getBatchParameters] operator[SEP] operator[SEP] , identifier[BATCHPARAMETERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[target] operator[SEP] identifier[getSqsParameters] operator[SEP] operator[SEP] , identifier[SQSPARAMETERS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public List<UserDto> selectByUuids(DbSession session, Collection<String> uuids) { return executeLargeInputs(uuids, mapper(session)::selectByUuids); }
class class_name[name] begin[{] method[selectByUuids, return_type[type[List]], modifier[public], parameter[session, uuids]] begin[{] return[call[.executeLargeInputs, parameter[member[.uuids], MethodReference(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), method=MemberReference(member=selectByUuids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[UserDto] operator[>] identifier[selectByUuids] operator[SEP] identifier[DbSession] identifier[session] , identifier[Collection] operator[<] identifier[String] operator[>] identifier[uuids] operator[SEP] { Keyword[return] identifier[executeLargeInputs] operator[SEP] identifier[uuids] , identifier[mapper] operator[SEP] identifier[session] operator[SEP] operator[::] identifier[selectByUuids] operator[SEP] operator[SEP] }
public Instant truncatedTo(TemporalUnit unit) { if (unit == ChronoUnit.NANOS) { return this; } Duration unitDur = unit.getDuration(); if (unitDur.getSeconds() > LocalTime.SECONDS_PER_DAY) { throw new UnsupportedTemporalTypeException("Unit is too large to be used for truncation"); } long dur = unitDur.toNanos(); if ((LocalTime.NANOS_PER_DAY % dur) != 0) { throw new UnsupportedTemporalTypeException("Unit must divide into a standard day without remainder"); } long nod = (seconds % LocalTime.SECONDS_PER_DAY) * LocalTime.NANOS_PER_SECOND + nanos; long result = (nod / dur) * dur; return plusNanos(result - nod); }
class class_name[name] begin[{] method[truncatedTo, return_type[type[Instant]], modifier[public], parameter[unit]] begin[{] if[binary_operation[member[.unit], ==, member[ChronoUnit.NANOS]]] begin[{] return[THIS[]] else begin[{] None end[}] local_variable[type[Duration], unitDur] if[binary_operation[call[unitDur.getSeconds, parameter[]], >, member[LocalTime.SECONDS_PER_DAY]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unit is too large to be used for truncation")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedTemporalTypeException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[long], dur] if[binary_operation[binary_operation[member[LocalTime.NANOS_PER_DAY], %, member[.dur]], !=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unit must divide into a standard day without remainder")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedTemporalTypeException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[long], nod] local_variable[type[long], result] return[call[.plusNanos, parameter[binary_operation[member[.result], -, member[.nod]]]]] end[}] END[}]
Keyword[public] identifier[Instant] identifier[truncatedTo] operator[SEP] identifier[TemporalUnit] identifier[unit] operator[SEP] { Keyword[if] operator[SEP] identifier[unit] operator[==] identifier[ChronoUnit] operator[SEP] identifier[NANOS] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } identifier[Duration] identifier[unitDur] operator[=] identifier[unit] operator[SEP] identifier[getDuration] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[unitDur] operator[SEP] identifier[getSeconds] operator[SEP] operator[SEP] operator[>] identifier[LocalTime] operator[SEP] identifier[SECONDS_PER_DAY] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedTemporalTypeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[long] identifier[dur] operator[=] identifier[unitDur] operator[SEP] identifier[toNanos] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LocalTime] operator[SEP] identifier[NANOS_PER_DAY] operator[%] identifier[dur] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedTemporalTypeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[long] identifier[nod] operator[=] operator[SEP] identifier[seconds] operator[%] identifier[LocalTime] operator[SEP] identifier[SECONDS_PER_DAY] operator[SEP] operator[*] identifier[LocalTime] operator[SEP] identifier[NANOS_PER_SECOND] operator[+] identifier[nanos] operator[SEP] Keyword[long] identifier[result] operator[=] operator[SEP] identifier[nod] operator[/] identifier[dur] operator[SEP] operator[*] identifier[dur] operator[SEP] Keyword[return] identifier[plusNanos] operator[SEP] identifier[result] operator[-] identifier[nod] operator[SEP] operator[SEP] }
public byte[] toBytesSparse(int nonEmptyBuckets) { int size = SERDE_HEADER_SIZE + getSparseStorageSize(nonEmptyBuckets); ByteBuffer buf = ByteBuffer.allocate(size); writeByteBufferSparse(buf, nonEmptyBuckets); return buf.array(); }
class class_name[name] begin[{] method[toBytesSparse, return_type[type[byte]], modifier[public], parameter[nonEmptyBuckets]] begin[{] local_variable[type[int], size] local_variable[type[ByteBuffer], buf] call[.writeByteBufferSparse, parameter[member[.buf], member[.nonEmptyBuckets]]] return[call[buf.array, parameter[]]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[toBytesSparse] operator[SEP] Keyword[int] identifier[nonEmptyBuckets] operator[SEP] { Keyword[int] identifier[size] operator[=] identifier[SERDE_HEADER_SIZE] operator[+] identifier[getSparseStorageSize] operator[SEP] identifier[nonEmptyBuckets] operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[buf] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[writeByteBufferSparse] operator[SEP] identifier[buf] , identifier[nonEmptyBuckets] operator[SEP] operator[SEP] Keyword[return] identifier[buf] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP] }
private static boolean isAssignableFrom(Class<?> type1, Class<?> type2) { return boxedClass(type1).equals(boxedClass(type2)); }
class class_name[name] begin[{] method[isAssignableFrom, return_type[type[boolean]], modifier[private static], parameter[type1, type2]] begin[{] return[call[.boxedClass, parameter[member[.type1]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[isAssignableFrom] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type1] , identifier[Class] operator[<] operator[?] operator[>] identifier[type2] operator[SEP] { Keyword[return] identifier[boxedClass] operator[SEP] identifier[type1] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[boxedClass] operator[SEP] identifier[type2] operator[SEP] operator[SEP] operator[SEP] }
protected void println(String line) { if (output instanceof PrintStream) { ((PrintStream) output).println(line); } else { ((PrintWriter) output).println(line); } }
class class_name[name] begin[{] method[println, return_type[void], modifier[protected], parameter[line]] begin[{] if[binary_operation[member[.output], instanceof, type[PrintStream]]] begin[{] Cast(expression=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PrintStream, sub_type=None)) else begin[{] Cast(expression=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PrintWriter, sub_type=None)) end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[println] operator[SEP] identifier[String] identifier[line] operator[SEP] { Keyword[if] operator[SEP] identifier[output] Keyword[instanceof] identifier[PrintStream] operator[SEP] { operator[SEP] operator[SEP] identifier[PrintStream] operator[SEP] identifier[output] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[line] operator[SEP] operator[SEP] } Keyword[else] { operator[SEP] operator[SEP] identifier[PrintWriter] operator[SEP] identifier[output] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[line] operator[SEP] operator[SEP] } }
public alluxio.grpc.CreateDirectoryPOptions getOptions() { return options_ == null ? alluxio.grpc.CreateDirectoryPOptions.getDefaultInstance() : options_; }
class class_name[name] begin[{] method[getOptions, return_type[type[alluxio]], modifier[public], parameter[]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=options_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=options_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=getDefaultInstance, postfix_operators=[], prefix_operators=[], qualifier=alluxio.grpc.CreateDirectoryPOptions, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] identifier[alluxio] operator[SEP] identifier[grpc] operator[SEP] identifier[CreateDirectoryPOptions] identifier[getOptions] operator[SEP] operator[SEP] { Keyword[return] identifier[options_] operator[==] Other[null] operator[?] identifier[alluxio] operator[SEP] identifier[grpc] operator[SEP] identifier[CreateDirectoryPOptions] operator[SEP] identifier[getDefaultInstance] operator[SEP] operator[SEP] operator[:] identifier[options_] operator[SEP] }
public JSONObject put(String key, double value) throws JSONException { put(key, Double.valueOf(value)); return this; }
class class_name[name] begin[{] method[put, return_type[type[JSONObject]], modifier[public], parameter[key, value]] begin[{] call[.put, parameter[member[.key], call[Double.valueOf, parameter[member[.value]]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JSONObject] identifier[put] operator[SEP] identifier[String] identifier[key] , Keyword[double] identifier[value] operator[SEP] Keyword[throws] identifier[JSONException] { identifier[put] operator[SEP] identifier[key] , identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private static Object findJarServiceProvider(final String factoryId) throws ConfigurationError { final String serviceId = "META-INF/services/" + factoryId; InputStream is = null; // First try the Context ClassLoader ClassLoader cl = ss.getContextClassLoader(); if (cl != null) { is = ss.getResourceAsStream(cl, serviceId); // If no provider found then try the current ClassLoader if (is == null) { cl = FactoryFinder.class.getClassLoader(); is = ss.getResourceAsStream(cl, serviceId); } } else { // No Context ClassLoader, try the current // ClassLoader cl = FactoryFinder.class.getClassLoader(); is = ss.getResourceAsStream(cl, serviceId); } if (is == null) { // No provider found return null; } dPrint("found jar resource=" + serviceId + " using ClassLoader: " + cl); // Read the service provider name in UTF-8 as specified in // the jar spec. Unfortunately this fails in Microsoft // VJ++, which does not implement the UTF-8 // encoding. Theoretically, we should simply let it fail in // that case, since the JVM is obviously broken if it // doesn't support such a basic standard. But since there // are still some users attempting to use VJ++ for // development, we have dropped in a fallback which makes a // second attempt using the platform's default encoding. In // VJ++ this is apparently ASCII, which is a subset of // UTF-8... and since the strings we'll be reading here are // also primarily limited to the 7-bit ASCII range (at // least, in English versions), this should work well // enough to keep us on the air until we're ready to // officially decommit from VJ++. [Edited comment from // jkesselm] BufferedReader rd; try { rd = new BufferedReader(new InputStreamReader(is, "UTF-8")); } catch (final java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); } String factoryClassName = null; try { // XXX Does not handle all possible input as specified by the // Jar Service Provider specification factoryClassName = rd.readLine(); rd.close(); } catch (final IOException x) { // No provider found return null; } if (factoryClassName != null && !"".equals(factoryClassName)) { dPrint("found in resource, value=" + factoryClassName); // Note: here we do not want to fall back to the current // ClassLoader because we want to avoid the case where the // resource file was found using one ClassLoader and the // provider class was instantiated using a different one. return newInstance(factoryClassName, cl, false); } // No provider found return null; }
class class_name[name] begin[{] method[findJarServiceProvider, return_type[type[Object]], modifier[private static], parameter[factoryId]] begin[{] local_variable[type[String], serviceId] local_variable[type[InputStream], is] local_variable[type[ClassLoader], cl] if[binary_operation[member[.cl], !=, literal[null]]] begin[{] assign[member[.is], call[ss.getResourceAsStream, parameter[member[.cl], member[.serviceId]]]] if[binary_operation[member[.is], ==, literal[null]]] begin[{] assign[member[.cl], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=FactoryFinder, sub_type=None))] assign[member[.is], call[ss.getResourceAsStream, parameter[member[.cl], member[.serviceId]]]] else begin[{] None end[}] else begin[{] assign[member[.cl], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=FactoryFinder, sub_type=None))] assign[member[.is], call[ss.getResourceAsStream, parameter[member[.cl], member[.serviceId]]]] end[}] if[binary_operation[member[.is], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] call[.dPrint, parameter[binary_operation[binary_operation[binary_operation[literal["found jar resource="], +, member[.serviceId]], +, literal[" using ClassLoader: "]], +, member[.cl]]]] local_variable[type[BufferedReader], rd] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=is, 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=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['java.io.UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) local_variable[type[String], factoryClassName] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=factoryClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=rd, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=rd, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['IOException']))], finally_block=None, label=None, resources=None) if[binary_operation[binary_operation[member[.factoryClassName], !=, literal[null]], &&, literal[""]]] begin[{] call[.dPrint, parameter[binary_operation[literal["found in resource, value="], +, member[.factoryClassName]]]] return[call[.newInstance, parameter[member[.factoryClassName], member[.cl], literal[false]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Object] identifier[findJarServiceProvider] operator[SEP] Keyword[final] identifier[String] identifier[factoryId] operator[SEP] Keyword[throws] identifier[ConfigurationError] { Keyword[final] identifier[String] identifier[serviceId] operator[=] literal[String] operator[+] identifier[factoryId] operator[SEP] identifier[InputStream] identifier[is] operator[=] Other[null] operator[SEP] identifier[ClassLoader] identifier[cl] operator[=] identifier[ss] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cl] operator[!=] Other[null] operator[SEP] { identifier[is] operator[=] identifier[ss] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[cl] , identifier[serviceId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[is] operator[==] Other[null] operator[SEP] { identifier[cl] operator[=] identifier[FactoryFinder] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[is] operator[=] identifier[ss] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[cl] , identifier[serviceId] operator[SEP] operator[SEP] } } Keyword[else] { identifier[cl] operator[=] identifier[FactoryFinder] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[is] operator[=] identifier[ss] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[cl] , identifier[serviceId] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[is] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[dPrint] operator[SEP] literal[String] operator[+] identifier[serviceId] operator[+] literal[String] operator[+] identifier[cl] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[rd] operator[SEP] Keyword[try] { identifier[rd] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[is] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { identifier[rd] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[is] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[factoryClassName] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[factoryClassName] operator[=] identifier[rd] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] identifier[rd] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[x] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[factoryClassName] operator[!=] Other[null] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[factoryClassName] operator[SEP] operator[SEP] { identifier[dPrint] operator[SEP] literal[String] operator[+] identifier[factoryClassName] operator[SEP] operator[SEP] Keyword[return] identifier[newInstance] operator[SEP] identifier[factoryClassName] , identifier[cl] , literal[boolean] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public static boolean hasBody(Response response) { // HEAD requests never yield a body regardless of the response headers. if (response.request().method().equals("HEAD")) { return false; } int responseCode = response.code(); if ((responseCode < HTTP_CONTINUE || responseCode >= 200) && responseCode != HTTP_NO_CONTENT && responseCode != HTTP_NOT_MODIFIED) { return true; } // If the Content-Length or Transfer-Encoding headers disagree with the response code, the // response is malformed. For best compatibility, we honor the headers. if (contentLength(response) != -1 || "chunked".equalsIgnoreCase(response.header("Transfer-Encoding"))) { return true; } return false; }
class class_name[name] begin[{] method[hasBody, return_type[type[boolean]], modifier[public static], parameter[response]] begin[{] if[call[response.request, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[int], responseCode] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.responseCode], <, member[.HTTP_CONTINUE]], ||, binary_operation[member[.responseCode], >=, literal[200]]], &&, binary_operation[member[.responseCode], !=, member[.HTTP_NO_CONTENT]]], &&, binary_operation[member[.responseCode], !=, member[.HTTP_NOT_MODIFIED]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[call[.contentLength, parameter[member[.response]]], !=, literal[1]], ||, literal["chunked"]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[hasBody] operator[SEP] identifier[Response] identifier[response] operator[SEP] { Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[request] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[int] identifier[responseCode] operator[=] identifier[response] operator[SEP] identifier[code] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[responseCode] operator[<] identifier[HTTP_CONTINUE] operator[||] identifier[responseCode] operator[>=] Other[200] operator[SEP] operator[&&] identifier[responseCode] operator[!=] identifier[HTTP_NO_CONTENT] operator[&&] identifier[responseCode] operator[!=] identifier[HTTP_NOT_MODIFIED] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[contentLength] operator[SEP] identifier[response] operator[SEP] operator[!=] operator[-] Other[1] operator[||] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[response] operator[SEP] identifier[header] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static lucee.runtime.config.DebugEntry getDebugEntry(PageContext pc) { String addr = pc.getHttpServletRequest().getRemoteAddr(); lucee.runtime.config.DebugEntry debugEntry = ((ConfigImpl) pc.getConfig()).getDebugEntry(addr, null); return debugEntry; }
class class_name[name] begin[{] method[getDebugEntry, return_type[type[lucee]], modifier[public static], parameter[pc]] begin[{] local_variable[type[String], addr] local_variable[type[lucee], debugEntry] return[member[.debugEntry]] end[}] END[}]
Keyword[public] Keyword[static] identifier[lucee] operator[SEP] identifier[runtime] operator[SEP] identifier[config] operator[SEP] identifier[DebugEntry] identifier[getDebugEntry] operator[SEP] identifier[PageContext] identifier[pc] operator[SEP] { identifier[String] identifier[addr] operator[=] identifier[pc] operator[SEP] identifier[getHttpServletRequest] operator[SEP] operator[SEP] operator[SEP] identifier[getRemoteAddr] operator[SEP] operator[SEP] operator[SEP] identifier[lucee] operator[SEP] identifier[runtime] operator[SEP] identifier[config] operator[SEP] identifier[DebugEntry] identifier[debugEntry] operator[=] operator[SEP] operator[SEP] identifier[ConfigImpl] operator[SEP] identifier[pc] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getDebugEntry] operator[SEP] identifier[addr] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[debugEntry] operator[SEP] }
public static List<ClassInfo> getAnnotatedClasses(List<AnnotationInstance> instances) { List<ClassInfo> result = new ArrayList<ClassInfo>(); for (AnnotationInstance instance : instances) { AnnotationTarget target = instance.target(); if (target instanceof ClassInfo) { result.add((ClassInfo) target); } } return result; }
class class_name[name] begin[{] method[getAnnotatedClasses, return_type[type[List]], modifier[public static], parameter[instances]] begin[{] local_variable[type[List], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=target, postfix_operators=[], prefix_operators=[], qualifier=instance, selectors=[], type_arguments=None), name=target)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationTarget, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ClassInfo, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ClassInfo, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=instance)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationInstance, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[ClassInfo] operator[>] identifier[getAnnotatedClasses] operator[SEP] identifier[List] operator[<] identifier[AnnotationInstance] operator[>] identifier[instances] operator[SEP] { identifier[List] operator[<] identifier[ClassInfo] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ClassInfo] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AnnotationInstance] identifier[instance] operator[:] identifier[instances] operator[SEP] { identifier[AnnotationTarget] identifier[target] operator[=] identifier[instance] operator[SEP] identifier[target] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target] Keyword[instanceof] identifier[ClassInfo] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[target] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public boolean seen(long msgId) { boolean seen = nonContiguousMsgIds.contains(msgId) || msgId <= highestContiguousMsgId; tryReconcile(); return seen; }
class class_name[name] begin[{] method[seen, return_type[type[boolean]], modifier[public], parameter[msgId]] begin[{] local_variable[type[boolean], seen] call[.tryReconcile, parameter[]] return[member[.seen]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[seen] operator[SEP] Keyword[long] identifier[msgId] operator[SEP] { Keyword[boolean] identifier[seen] operator[=] identifier[nonContiguousMsgIds] operator[SEP] identifier[contains] operator[SEP] identifier[msgId] operator[SEP] operator[||] identifier[msgId] operator[<=] identifier[highestContiguousMsgId] operator[SEP] identifier[tryReconcile] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[seen] operator[SEP] }
public void setBoolean2(String parameterName, Boolean value) throws java.sql.SQLException { if (value == null) { setNull(parameterName, Types.BIT); } else { setBoolean(parameterName, value); } }
class class_name[name] begin[{] method[setBoolean2, return_type[void], modifier[public], parameter[parameterName, value]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] call[.setNull, parameter[member[.parameterName], member[Types.BIT]]] else begin[{] call[.setBoolean, parameter[member[.parameterName], member[.value]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setBoolean2] operator[SEP] identifier[String] identifier[parameterName] , identifier[Boolean] identifier[value] operator[SEP] Keyword[throws] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[SQLException] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { identifier[setNull] operator[SEP] identifier[parameterName] , identifier[Types] operator[SEP] identifier[BIT] operator[SEP] operator[SEP] } Keyword[else] { identifier[setBoolean] operator[SEP] identifier[parameterName] , identifier[value] operator[SEP] operator[SEP] } }
public static Argument[] args(String... nameValuePairs) { int length = nameValuePairs.length; if (length == 0) { return NO_ARGUMENTS; } // even number of arguments ? if ((length & 1) != 0) { throw new IllegalArgumentException("Expecting even number of arguments, but got: " + length); } // allocating array by a half of an input Argument[] args = new Argument[length >> 1]; for (int i = 0, j = 0; i < args.length; i++) { args[i] = arg(nameValuePairs[j++], nameValuePairs[j++]); } return args; }
class class_name[name] begin[{] method[args, return_type[type[Argument]], modifier[public static], parameter[nameValuePairs]] begin[{] local_variable[type[int], length] if[binary_operation[member[.length], ==, literal[0]]] begin[{] return[member[.NO_ARGUMENTS]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.length], &, literal[1]], !=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expecting even number of arguments, but got: "), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Argument], args] ForStatement(body=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=MethodInvocation(arguments=[MemberReference(member=nameValuePairs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=nameValuePairs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))])], member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], 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=args, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.args]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Argument] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[String] operator[...] identifier[nameValuePairs] operator[SEP] { Keyword[int] identifier[length] operator[=] identifier[nameValuePairs] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[NO_ARGUMENTS] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[length] operator[&] Other[1] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[length] operator[SEP] operator[SEP] } identifier[Argument] operator[SEP] operator[SEP] identifier[args] operator[=] Keyword[new] identifier[Argument] operator[SEP] identifier[length] operator[>] operator[>] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[j] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[args] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[args] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[arg] operator[SEP] identifier[nameValuePairs] operator[SEP] identifier[j] operator[++] operator[SEP] , identifier[nameValuePairs] operator[SEP] identifier[j] operator[++] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[args] operator[SEP] }
public void setCheckInterval(long checkInterval) { if (checkInterval < 0 || checkInterval > Long.MAX_VALUE / 2) _checkInterval = Long.MAX_VALUE / 2; else _checkInterval = checkInterval; _checkExpiresTime = 0; }
class class_name[name] begin[{] method[setCheckInterval, return_type[void], modifier[public], parameter[checkInterval]] begin[{] if[binary_operation[binary_operation[member[.checkInterval], <, literal[0]], ||, binary_operation[member[.checkInterval], >, binary_operation[member[Long.MAX_VALUE], /, literal[2]]]]] begin[{] assign[member[._checkInterval], binary_operation[member[Long.MAX_VALUE], /, literal[2]]] else begin[{] assign[member[._checkInterval], member[.checkInterval]] end[}] assign[member[._checkExpiresTime], literal[0]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setCheckInterval] operator[SEP] Keyword[long] identifier[checkInterval] operator[SEP] { Keyword[if] operator[SEP] identifier[checkInterval] operator[<] Other[0] operator[||] identifier[checkInterval] operator[>] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[/] Other[2] operator[SEP] identifier[_checkInterval] operator[=] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[/] Other[2] operator[SEP] Keyword[else] identifier[_checkInterval] operator[=] identifier[checkInterval] operator[SEP] identifier[_checkExpiresTime] operator[=] Other[0] operator[SEP] }
public static <T> T createInternal(Config config, Class<T> clazz) { if (((SimpleConfig)config).root().resolveStatus() != ResolveStatus.RESOLVED) throw new ConfigException.NotResolved( "need to Config#resolve() a config before using it to initialize a bean, see the API docs for Config#resolve()"); Map<String, AbstractConfigValue> configProps = new HashMap<String, AbstractConfigValue>(); Map<String, String> originalNames = new HashMap<String, String>(); for (Map.Entry<String, ConfigValue> configProp : config.root().entrySet()) { String originalName = configProp.getKey(); String camelName = ConfigImplUtil.toCamelCase(originalName); // if a setting is in there both as some hyphen name and the camel name, // the camel one wins if (originalNames.containsKey(camelName) && !originalName.equals(camelName)) { // if we aren't a camel name to start with, we lose. // if we are or we are the first matching key, we win. } else { configProps.put(camelName, (AbstractConfigValue) configProp.getValue()); originalNames.put(camelName, originalName); } } BeanInfo beanInfo = null; try { beanInfo = Introspector.getBeanInfo(clazz); } catch (IntrospectionException e) { throw new ConfigException.BadBean("Could not get bean information for class " + clazz.getName(), e); } try { List<PropertyDescriptor> beanProps = new ArrayList<PropertyDescriptor>(); for (PropertyDescriptor beanProp : beanInfo.getPropertyDescriptors()) { if (beanProp.getReadMethod() == null || beanProp.getWriteMethod() == null) { continue; } beanProps.add(beanProp); } // Try to throw all validation issues at once (this does not comprehensively // find every issue, but it should find common ones). List<ConfigException.ValidationProblem> problems = new ArrayList<ConfigException.ValidationProblem>(); for (PropertyDescriptor beanProp : beanProps) { Method setter = beanProp.getWriteMethod(); Class<?> parameterClass = setter.getParameterTypes()[0]; ConfigValueType expectedType = getValueTypeOrNull(parameterClass); if (expectedType != null) { String name = originalNames.get(beanProp.getName()); if (name == null) name = beanProp.getName(); Path path = Path.newKey(name); AbstractConfigValue configValue = configProps.get(beanProp.getName()); if (configValue != null) { SimpleConfig.checkValid(path, expectedType, configValue, problems); } else { if (!isOptionalProperty(clazz, beanProp)) { SimpleConfig.addMissing(problems, expectedType, path, config.origin()); } } } } if (!problems.isEmpty()) { throw new ConfigException.ValidationFailed(problems); } // Fill in the bean instance T bean = clazz.newInstance(); for (PropertyDescriptor beanProp : beanProps) { Method setter = beanProp.getWriteMethod(); Type parameterType = setter.getGenericParameterTypes()[0]; Class<?> parameterClass = setter.getParameterTypes()[0]; String configPropName = originalNames.get(beanProp.getName()); // Is the property key missing in the config? if (configPropName == null) { // If so, continue if the field is marked as @{link Optional} if (isOptionalProperty(clazz, beanProp)) { continue; } // Otherwise, raise a {@link Missing} exception right here throw new ConfigException.Missing(beanProp.getName()); } Object unwrapped = getValue(clazz, parameterType, parameterClass, config, configPropName); setter.invoke(bean, unwrapped); } return bean; } catch (InstantiationException e) { throw new ConfigException.BadBean(clazz.getName() + " needs a public no-args constructor to be used as a bean", e); } catch (IllegalAccessException e) { throw new ConfigException.BadBean(clazz.getName() + " getters and setters are not accessible, they must be for use as a bean", e); } catch (InvocationTargetException e) { throw new ConfigException.BadBean("Calling bean method on " + clazz.getName() + " caused an exception", e); } }
class class_name[name] begin[{] method[createInternal, return_type[type[T]], modifier[public static], parameter[config, clazz]] begin[{] if[binary_operation[Cast(expression=MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SimpleConfig, sub_type=None)), !=, member[ResolveStatus.RESOLVED]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="need to Config#resolve() a config before using it to initialize a bean, see the API docs for Config#resolve()")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=NotResolved, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[Map], configProps] local_variable[type[Map], originalNames] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=configProp, selectors=[], type_arguments=None), name=originalName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=originalName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toCamelCase, postfix_operators=[], prefix_operators=[], qualifier=ConfigImplUtil, selectors=[], type_arguments=None), name=camelName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=camelName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=originalNames, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=camelName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=originalName, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=camelName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=configProp, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractConfigValue, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=configProps, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=camelName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=originalName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=originalNames, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=root, postfix_operators=[], prefix_operators=[], qualifier=config, 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=configProp)], 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=ConfigValue, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) local_variable[type[BeanInfo], beanInfo] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=beanInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBeanInfo, postfix_operators=[], prefix_operators=[], qualifier=Introspector, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not get bean information for class "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=clazz, 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=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=BadBean, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IntrospectionException']))], finally_block=None, label=None, resources=None) TryStatement(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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=beanProps)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getReadMethod, postfix_operators=[], prefix_operators=[], qualifier=beanProp, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getWriteMethod, postfix_operators=[], prefix_operators=[], qualifier=beanProp, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=beanProp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=beanProps, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPropertyDescriptors, postfix_operators=[], prefix_operators=[], qualifier=beanInfo, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=beanProp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=ValidationProblem, sub_type=None)))], dimensions=None, name=ArrayList, sub_type=None)), name=problems)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=ValidationProblem, sub_type=None)))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getWriteMethod, postfix_operators=[], prefix_operators=[], qualifier=beanProp, selectors=[], type_arguments=None), name=setter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=setter, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None), name=parameterClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=parameterClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueTypeOrNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=expectedType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigValueType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=expectedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=beanProp, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=originalNames, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=name, 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=StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=beanProp, selectors=[], type_arguments=None)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newKey, postfix_operators=[], prefix_operators=[], qualifier=Path, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=beanProp, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=configProps, selectors=[], type_arguments=None), name=configValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractConfigValue, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=configValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=beanProp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isOptionalProperty, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=problems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=expectedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=origin, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None)], member=addMissing, postfix_operators=[], prefix_operators=[], qualifier=SimpleConfig, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=expectedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=configValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=problems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkValid, postfix_operators=[], prefix_operators=[], qualifier=SimpleConfig, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=beanProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=beanProp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None))), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=problems, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=problems, 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=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=ValidationFailed, sub_type=None))), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), name=bean)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getWriteMethod, postfix_operators=[], prefix_operators=[], qualifier=beanProp, selectors=[], type_arguments=None), name=setter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getGenericParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=setter, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None), name=parameterType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=setter, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None), name=parameterClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=beanProp, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=originalNames, selectors=[], type_arguments=None), name=configPropName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=configPropName, 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=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=beanProp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isOptionalProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=beanProp, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=Missing, sub_type=None))), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameterType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameterClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=configPropName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=unwrapped)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unwrapped, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=setter, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=beanProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=beanProp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None))), label=None), ReturnStatement(expression=MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" needs a public no-args constructor to be used as a bean"), 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=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=BadBean, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InstantiationException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" getters and setters are not accessible, they must be for use as a bean"), 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=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=BadBean, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Calling bean method on "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" caused an exception"), 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=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=BadBean, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvocationTargetException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[createInternal] operator[SEP] identifier[Config] identifier[config] , identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[SimpleConfig] operator[SEP] identifier[config] operator[SEP] operator[SEP] identifier[root] operator[SEP] operator[SEP] operator[SEP] identifier[resolveStatus] operator[SEP] operator[SEP] operator[!=] identifier[ResolveStatus] operator[SEP] identifier[RESOLVED] operator[SEP] Keyword[throw] Keyword[new] identifier[ConfigException] operator[SEP] identifier[NotResolved] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[AbstractConfigValue] operator[>] identifier[configProps] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[AbstractConfigValue] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[originalNames] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[ConfigValue] operator[>] identifier[configProp] operator[:] identifier[config] operator[SEP] identifier[root] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[originalName] operator[=] identifier[configProp] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[camelName] operator[=] identifier[ConfigImplUtil] operator[SEP] identifier[toCamelCase] operator[SEP] identifier[originalName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[originalNames] operator[SEP] identifier[containsKey] operator[SEP] identifier[camelName] operator[SEP] operator[&&] operator[!] identifier[originalName] operator[SEP] identifier[equals] operator[SEP] identifier[camelName] operator[SEP] operator[SEP] { } Keyword[else] { identifier[configProps] operator[SEP] identifier[put] operator[SEP] identifier[camelName] , operator[SEP] identifier[AbstractConfigValue] operator[SEP] identifier[configProp] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[originalNames] operator[SEP] identifier[put] operator[SEP] identifier[camelName] , identifier[originalName] operator[SEP] operator[SEP] } } identifier[BeanInfo] identifier[beanInfo] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[beanInfo] operator[=] identifier[Introspector] operator[SEP] identifier[getBeanInfo] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IntrospectionException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ConfigException] operator[SEP] identifier[BadBean] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[try] { identifier[List] operator[<] identifier[PropertyDescriptor] operator[>] identifier[beanProps] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[PropertyDescriptor] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PropertyDescriptor] identifier[beanProp] operator[:] identifier[beanInfo] operator[SEP] identifier[getPropertyDescriptors] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[beanProp] operator[SEP] identifier[getReadMethod] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[beanProp] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[beanProps] operator[SEP] identifier[add] operator[SEP] identifier[beanProp] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[ConfigException] operator[SEP] identifier[ValidationProblem] operator[>] identifier[problems] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ConfigException] operator[SEP] identifier[ValidationProblem] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PropertyDescriptor] identifier[beanProp] operator[:] identifier[beanProps] operator[SEP] { identifier[Method] identifier[setter] operator[=] identifier[beanProp] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[parameterClass] operator[=] identifier[setter] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[ConfigValueType] identifier[expectedType] operator[=] identifier[getValueTypeOrNull] operator[SEP] identifier[parameterClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[expectedType] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[originalNames] operator[SEP] identifier[get] operator[SEP] identifier[beanProp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] identifier[name] operator[=] identifier[beanProp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[Path] identifier[path] operator[=] identifier[Path] operator[SEP] identifier[newKey] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[AbstractConfigValue] identifier[configValue] operator[=] identifier[configProps] operator[SEP] identifier[get] operator[SEP] identifier[beanProp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[configValue] operator[!=] Other[null] operator[SEP] { identifier[SimpleConfig] operator[SEP] identifier[checkValid] operator[SEP] identifier[path] , identifier[expectedType] , identifier[configValue] , identifier[problems] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[isOptionalProperty] operator[SEP] identifier[clazz] , identifier[beanProp] operator[SEP] operator[SEP] { identifier[SimpleConfig] operator[SEP] identifier[addMissing] operator[SEP] identifier[problems] , identifier[expectedType] , identifier[path] , identifier[config] operator[SEP] identifier[origin] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[if] operator[SEP] operator[!] identifier[problems] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ConfigException] operator[SEP] identifier[ValidationFailed] operator[SEP] identifier[problems] operator[SEP] operator[SEP] } identifier[T] identifier[bean] operator[=] identifier[clazz] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PropertyDescriptor] identifier[beanProp] operator[:] identifier[beanProps] operator[SEP] { identifier[Method] identifier[setter] operator[=] identifier[beanProp] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[SEP] identifier[Type] identifier[parameterType] operator[=] identifier[setter] operator[SEP] identifier[getGenericParameterTypes] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[parameterClass] operator[=] identifier[setter] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[configPropName] operator[=] identifier[originalNames] operator[SEP] identifier[get] operator[SEP] identifier[beanProp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[configPropName] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[isOptionalProperty] operator[SEP] identifier[clazz] , identifier[beanProp] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[throw] Keyword[new] identifier[ConfigException] operator[SEP] identifier[Missing] operator[SEP] identifier[beanProp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Object] identifier[unwrapped] operator[=] identifier[getValue] operator[SEP] identifier[clazz] , identifier[parameterType] , identifier[parameterClass] , identifier[config] , identifier[configPropName] operator[SEP] operator[SEP] identifier[setter] operator[SEP] identifier[invoke] operator[SEP] identifier[bean] , identifier[unwrapped] operator[SEP] operator[SEP] } Keyword[return] identifier[bean] operator[SEP] } Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ConfigException] operator[SEP] identifier[BadBean] operator[SEP] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ConfigException] operator[SEP] identifier[BadBean] operator[SEP] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ConfigException] operator[SEP] identifier[BadBean] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public static GrayU8 invert(GrayU8 input, int max , GrayU8 output) { output = InputSanityCheck.checkDeclare(input, output); ImplGrayImageOps.invert(input,max,output); return output; }
class class_name[name] begin[{] method[invert, return_type[type[GrayU8]], modifier[public static], parameter[input, max, output]] begin[{] assign[member[.output], call[InputSanityCheck.checkDeclare, parameter[member[.input], member[.output]]]] call[ImplGrayImageOps.invert, parameter[member[.input], member[.max], member[.output]]] return[member[.output]] end[}] END[}]
Keyword[public] Keyword[static] identifier[GrayU8] identifier[invert] operator[SEP] identifier[GrayU8] identifier[input] , Keyword[int] identifier[max] , identifier[GrayU8] identifier[output] operator[SEP] { identifier[output] operator[=] identifier[InputSanityCheck] operator[SEP] identifier[checkDeclare] operator[SEP] identifier[input] , identifier[output] operator[SEP] operator[SEP] identifier[ImplGrayImageOps] operator[SEP] identifier[invert] operator[SEP] identifier[input] , identifier[max] , identifier[output] operator[SEP] operator[SEP] Keyword[return] identifier[output] operator[SEP] }
@Override public HttpServletRequest getRequest() { final HttpServletRequest request = LaRequestUtil.getRequest(); if (request == null) { throw new IllegalStateException("Not found the request, not web environment?"); } return request; }
class class_name[name] begin[{] method[getRequest, return_type[type[HttpServletRequest]], modifier[public], parameter[]] begin[{] local_variable[type[HttpServletRequest], request] if[binary_operation[member[.request], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not found the request, not web environment?")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.request]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[HttpServletRequest] identifier[getRequest] operator[SEP] operator[SEP] { Keyword[final] identifier[HttpServletRequest] identifier[request] operator[=] identifier[LaRequestUtil] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[request] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[request] operator[SEP] }
public final String getOpeningTag() { if (isRebuild() || isModified()) { final Lock lock = sharedObject.getLock(ACCESS_OBJECT).writeLock(); try { lock.lock(); buildOpeningTag(true); } finally { lock.unlock(); } } return openingTag; }
class class_name[name] begin[{] method[getOpeningTag, return_type[type[String]], modifier[final public], parameter[]] begin[{] if[binary_operation[call[.isRebuild, parameter[]], ||, call[.isModified, parameter[]]]] begin[{] local_variable[type[Lock], lock] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=lock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=buildOpeningTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] return[member[.openingTag]] end[}] END[}]
Keyword[public] Keyword[final] identifier[String] identifier[getOpeningTag] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isRebuild] operator[SEP] operator[SEP] operator[||] identifier[isModified] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[Lock] identifier[lock] operator[=] identifier[sharedObject] operator[SEP] identifier[getLock] operator[SEP] identifier[ACCESS_OBJECT] operator[SEP] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] identifier[buildOpeningTag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[finally] { identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[openingTag] operator[SEP] }
public static void main(final String[] args) { if (System.getProperty("db.name") == null) { System.out.println("Not running in multi-instance mode: no DB to connect to"); System.exit(1); } while (true) { try { Class.forName("org.postgresql.Driver"); DriverManager.getConnection("jdbc:postgresql://" + System.getProperty("db.host") + ":5432/" + System.getProperty("db.name"), System.getProperty("db.username"), System.getProperty("db.password")); System.out.println("Opened database successfully. Running in multi-instance mode"); System.exit(0); return; } catch (Exception e) { System.out.println("Failed to connect to the DB: " + e.toString()); try { Thread.sleep(1000); } catch (InterruptedException e1) { //ignored } } } }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] if[binary_operation[call[System.getProperty, parameter[literal["db.name"]]], ==, literal[null]]] begin[{] call[System.out.println, parameter[literal["Not running in multi-instance mode: no DB to connect to"]]] call[System.exit, parameter[literal[1]]] else begin[{] None end[}] while[literal[true]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.postgresql.Driver")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, 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="jdbc:postgresql://"), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="db.host")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":5432/"), operator=+), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="db.name")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operator=+), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="db.username")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="db.password")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=DriverManager, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Opened database successfully. Running in multi-instance mode")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to connect to the DB: "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['InterruptedException']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[try] { identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[DriverManager] operator[SEP] identifier[getConnection] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[+] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] , identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] , identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[1000] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e1] operator[SEP] { } } } }
private static void listData(final Memory mem, final long offsetBytes, final long lengthInts, final StringBuilder sb) { final long memCap = mem.getCapacity(); final long expectedCap = offsetBytes + (4L * lengthInts); checkCapacity(memCap, expectedCap); for (int i = 0; i < lengthInts; i++) { sb.append(String.format(fmt, i, mem.getInt(offsetBytes + (4L * i)))).append(LS); } }
class class_name[name] begin[{] method[listData, return_type[void], modifier[private static], parameter[mem, offsetBytes, lengthInts, sb]] begin[{] local_variable[type[long], memCap] local_variable[type[long], expectedCap] call[.checkCapacity, parameter[member[.memCap], member[.expectedCap]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=offsetBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4L), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+)], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=mem, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[MemberReference(member=LS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lengthInts, 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) end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[listData] operator[SEP] Keyword[final] identifier[Memory] identifier[mem] , Keyword[final] Keyword[long] identifier[offsetBytes] , Keyword[final] Keyword[long] identifier[lengthInts] , Keyword[final] identifier[StringBuilder] identifier[sb] operator[SEP] { Keyword[final] Keyword[long] identifier[memCap] operator[=] identifier[mem] operator[SEP] identifier[getCapacity] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[expectedCap] operator[=] identifier[offsetBytes] operator[+] operator[SEP] Other[4L] operator[*] identifier[lengthInts] operator[SEP] operator[SEP] identifier[checkCapacity] operator[SEP] identifier[memCap] , identifier[expectedCap] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[lengthInts] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[fmt] , identifier[i] , identifier[mem] operator[SEP] identifier[getInt] operator[SEP] identifier[offsetBytes] operator[+] operator[SEP] Other[4L] operator[*] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[LS] operator[SEP] operator[SEP] } }
public static String getSchemePrefix(String spec) { int colon = spec.indexOf(':'); if (colon < 1) { return null; } for (int i = 0; i < colon; i++) { char c = spec.charAt(i); if (!isValidSchemeChar(i, c)) { return null; } } return spec.substring(0, colon).toLowerCase(Locale.US); }
class class_name[name] begin[{] method[getSchemePrefix, return_type[type[String]], modifier[public static], parameter[spec]] begin[{] local_variable[type[int], colon] if[binary_operation[member[.colon], <, literal[1]]] begin[{] return[literal[null]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=spec, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isValidSchemeChar, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=colon, 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[spec.substring, parameter[literal[0], member[.colon]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getSchemePrefix] operator[SEP] identifier[String] identifier[spec] operator[SEP] { Keyword[int] identifier[colon] operator[=] identifier[spec] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colon] operator[<] Other[1] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[colon] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[spec] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isValidSchemeChar] operator[SEP] identifier[i] , identifier[c] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } Keyword[return] identifier[spec] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[colon] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[US] operator[SEP] operator[SEP] }
private void addInfoElements(Element infoElement) { Element el = new DOMElement("name"); el.addText(this.project.getName()); infoElement.add(el); el = new DOMElement("description"); String description = this.project.getDescription(); if (description == null) { el.addText(""); } else { el.addText(description); } infoElement.add(el); el = new DOMElement("licence"); el.addText(""); infoElement.add(el); el = new DOMElement("author"); el.addText("XWiki.Admin"); infoElement.add(el); el = new DOMElement("extensionId"); el.addText(this.project.getGroupId() + ':' + this.project.getArtifactId()); infoElement.add(el); el = new DOMElement("version"); el.addText(this.project.getVersion()); infoElement.add(el); el = new DOMElement("backupPack"); el.addText("false"); infoElement.add(el); }
class class_name[name] begin[{] method[addInfoElements, return_type[void], modifier[private], parameter[infoElement]] begin[{] local_variable[type[Element], el] call[el.addText, parameter[THIS[member[None.project]call[None.getName, parameter[]]]]] call[infoElement.add, parameter[member[.el]]] assign[member[.el], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="description")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMElement, sub_type=None))] local_variable[type[String], description] if[binary_operation[member[.description], ==, literal[null]]] begin[{] call[el.addText, parameter[literal[""]]] else begin[{] call[el.addText, parameter[member[.description]]] end[}] call[infoElement.add, parameter[member[.el]]] assign[member[.el], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="licence")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMElement, sub_type=None))] call[el.addText, parameter[literal[""]]] call[infoElement.add, parameter[member[.el]]] assign[member[.el], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="author")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMElement, sub_type=None))] call[el.addText, parameter[literal["XWiki.Admin"]]] call[infoElement.add, parameter[member[.el]]] assign[member[.el], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="extensionId")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMElement, sub_type=None))] call[el.addText, parameter[binary_operation[binary_operation[THIS[member[None.project]call[None.getGroupId, parameter[]]], +, literal[':']], +, THIS[member[None.project]call[None.getArtifactId, parameter[]]]]]] call[infoElement.add, parameter[member[.el]]] assign[member[.el], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="version")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMElement, sub_type=None))] call[el.addText, parameter[THIS[member[None.project]call[None.getVersion, parameter[]]]]] call[infoElement.add, parameter[member[.el]]] assign[member[.el], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="backupPack")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMElement, sub_type=None))] call[el.addText, parameter[literal["false"]]] call[infoElement.add, parameter[member[.el]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addInfoElements] operator[SEP] identifier[Element] identifier[infoElement] operator[SEP] { identifier[Element] identifier[el] operator[=] Keyword[new] identifier[DOMElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[el] operator[SEP] identifier[addText] operator[SEP] Keyword[this] operator[SEP] identifier[project] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[infoElement] operator[SEP] identifier[add] operator[SEP] identifier[el] operator[SEP] operator[SEP] identifier[el] operator[=] Keyword[new] identifier[DOMElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[description] operator[=] Keyword[this] operator[SEP] identifier[project] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[description] operator[==] Other[null] operator[SEP] { identifier[el] operator[SEP] identifier[addText] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[el] operator[SEP] identifier[addText] operator[SEP] identifier[description] operator[SEP] operator[SEP] } identifier[infoElement] operator[SEP] identifier[add] operator[SEP] identifier[el] operator[SEP] operator[SEP] identifier[el] operator[=] Keyword[new] identifier[DOMElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[el] operator[SEP] identifier[addText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[infoElement] operator[SEP] identifier[add] operator[SEP] identifier[el] operator[SEP] operator[SEP] identifier[el] operator[=] Keyword[new] identifier[DOMElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[el] operator[SEP] identifier[addText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[infoElement] operator[SEP] identifier[add] operator[SEP] identifier[el] operator[SEP] operator[SEP] identifier[el] operator[=] Keyword[new] identifier[DOMElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[el] operator[SEP] identifier[addText] operator[SEP] Keyword[this] operator[SEP] identifier[project] operator[SEP] identifier[getGroupId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[project] operator[SEP] identifier[getArtifactId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[infoElement] operator[SEP] identifier[add] operator[SEP] identifier[el] operator[SEP] operator[SEP] identifier[el] operator[=] Keyword[new] identifier[DOMElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[el] operator[SEP] identifier[addText] operator[SEP] Keyword[this] operator[SEP] identifier[project] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[infoElement] operator[SEP] identifier[add] operator[SEP] identifier[el] operator[SEP] operator[SEP] identifier[el] operator[=] Keyword[new] identifier[DOMElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[el] operator[SEP] identifier[addText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[infoElement] operator[SEP] identifier[add] operator[SEP] identifier[el] operator[SEP] operator[SEP] }
public void setUserName(String userName) { SystemAssert.requireArgument(userName != null && !userName.isEmpty(), "Username cannot be null or empty."); this.userName = userName; }
class class_name[name] begin[{] method[setUserName, return_type[void], modifier[public], parameter[userName]] begin[{] call[SystemAssert.requireArgument, parameter[binary_operation[binary_operation[member[.userName], !=, literal[null]], &&, call[userName.isEmpty, parameter[]]], literal["Username cannot be null or empty."]]] assign[THIS[member[None.userName]], member[.userName]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setUserName] operator[SEP] identifier[String] identifier[userName] operator[SEP] { identifier[SystemAssert] operator[SEP] identifier[requireArgument] operator[SEP] identifier[userName] operator[!=] Other[null] operator[&&] operator[!] identifier[userName] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[userName] operator[=] identifier[userName] operator[SEP] }
public Collection<License> getInfo() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_INFO); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } List<License> licenses = new ArrayList<License>(); Element licensesElement = response.getPayload(); NodeList licenseElements = licensesElement.getElementsByTagName("license"); for (int i = 0; i < licenseElements.getLength(); i++) { Element licenseElement = (Element) licenseElements.item(i); License license = new License(); license.setId(licenseElement.getAttribute("id")); license.setName(licenseElement.getAttribute("name")); license.setUrl(licenseElement.getAttribute("url")); licenses.add(license); } return licenses; }
class class_name[name] begin[{] method[getInfo, return_type[type[Collection]], modifier[public], parameter[]] begin[{] local_variable[type[Map], parameters] call[parameters.put, parameter[literal["method"], member[.METHOD_GET_INFO]]] local_variable[type[Response], response] if[call[response.isError, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getErrorCode, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FlickrException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[List], licenses] local_variable[type[Element], licensesElement] local_variable[type[NodeList], licenseElements] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=licenseElements, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), name=licenseElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, 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=License, sub_type=None)), name=license)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=License, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="id")], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=licenseElement, selectors=[], type_arguments=None)], member=setId, postfix_operators=[], prefix_operators=[], qualifier=license, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name")], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=licenseElement, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=license, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="url")], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=licenseElement, selectors=[], type_arguments=None)], member=setUrl, postfix_operators=[], prefix_operators=[], qualifier=license, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=license, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=licenses, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=licenseElements, selectors=[], type_arguments=None), 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[.licenses]] end[}] END[}]
Keyword[public] identifier[Collection] operator[<] identifier[License] operator[>] identifier[getInfo] operator[SEP] operator[SEP] Keyword[throws] identifier[FlickrException] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parameters] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[METHOD_GET_INFO] operator[SEP] operator[SEP] identifier[Response] identifier[response] operator[=] identifier[transportAPI] operator[SEP] identifier[get] operator[SEP] identifier[transportAPI] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[parameters] , identifier[apiKey] , identifier[sharedSecret] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[isError] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[FlickrException] operator[SEP] identifier[response] operator[SEP] identifier[getErrorCode] operator[SEP] operator[SEP] , identifier[response] operator[SEP] identifier[getErrorMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[License] operator[>] identifier[licenses] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[License] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Element] identifier[licensesElement] operator[=] identifier[response] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[licenseElements] operator[=] identifier[licensesElement] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[licenseElements] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Element] identifier[licenseElement] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[licenseElements] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[License] identifier[license] operator[=] Keyword[new] identifier[License] operator[SEP] operator[SEP] operator[SEP] identifier[license] operator[SEP] identifier[setId] operator[SEP] identifier[licenseElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[license] operator[SEP] identifier[setName] operator[SEP] identifier[licenseElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[license] operator[SEP] identifier[setUrl] operator[SEP] identifier[licenseElement] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[licenses] operator[SEP] identifier[add] operator[SEP] identifier[license] operator[SEP] operator[SEP] } Keyword[return] identifier[licenses] operator[SEP] }
protected void modified(String id, Map<String, Object> properties) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "modified " + id, properties); } config = properties; myProps = null; }
class class_name[name] begin[{] method[modified, return_type[void], modifier[protected], parameter[id, properties]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]]] begin[{] call[Tr.event, parameter[THIS[], member[.tc], binary_operation[literal["modified "], +, member[.id]], member[.properties]]] else begin[{] None end[}] assign[member[.config], member[.properties]] assign[member[.myProps], literal[null]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[modified] operator[SEP] identifier[String] identifier[id] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[event] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[+] identifier[id] , identifier[properties] operator[SEP] operator[SEP] } identifier[config] operator[=] identifier[properties] operator[SEP] identifier[myProps] operator[=] Other[null] operator[SEP] }
public void setDateTimeZone(Object dtz) throws JspTagException { if (dtz == null || dtz instanceof String && ((String) dtz).length() == 0) { this.dateTimeZone = null; } else if (dtz instanceof DateTimeZone) { this.dateTimeZone = (DateTimeZone) dtz; } else { try { this.dateTimeZone = DateTimeZone.forID((String) dtz); } catch (IllegalArgumentException iae) { this.dateTimeZone = DateTimeZone.UTC; } } }
class class_name[name] begin[{] method[setDateTimeZone, return_type[void], modifier[public], parameter[dtz]] begin[{] if[binary_operation[binary_operation[member[.dtz], ==, literal[null]], ||, binary_operation[binary_operation[member[.dtz], instanceof, type[String]], &&, binary_operation[Cast(expression=MemberReference(member=dtz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ==, literal[0]]]]] begin[{] assign[THIS[member[None.dateTimeZone]], literal[null]] else begin[{] if[binary_operation[member[.dtz], instanceof, type[DateTimeZone]]] begin[{] assign[THIS[member[None.dateTimeZone]], Cast(expression=MemberReference(member=dtz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DateTimeZone, sub_type=None))] else begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dateTimeZone, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=dtz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=forID, postfix_operators=[], prefix_operators=[], qualifier=DateTimeZone, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dateTimeZone, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=UTC, postfix_operators=[], prefix_operators=[], qualifier=DateTimeZone, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=iae, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDateTimeZone] operator[SEP] identifier[Object] identifier[dtz] operator[SEP] Keyword[throws] identifier[JspTagException] { Keyword[if] operator[SEP] identifier[dtz] operator[==] Other[null] operator[||] identifier[dtz] Keyword[instanceof] identifier[String] operator[&&] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[dtz] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[this] operator[SEP] identifier[dateTimeZone] operator[=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[dtz] Keyword[instanceof] identifier[DateTimeZone] operator[SEP] { Keyword[this] operator[SEP] identifier[dateTimeZone] operator[=] operator[SEP] identifier[DateTimeZone] operator[SEP] identifier[dtz] operator[SEP] } Keyword[else] { Keyword[try] { Keyword[this] operator[SEP] identifier[dateTimeZone] operator[=] identifier[DateTimeZone] operator[SEP] identifier[forID] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[dtz] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[iae] operator[SEP] { Keyword[this] operator[SEP] identifier[dateTimeZone] operator[=] identifier[DateTimeZone] operator[SEP] identifier[UTC] operator[SEP] } } }
public WxCpXmlOutMessage route(final WxCpXmlMessage wxMessage) { if (isDuplicateMessage(wxMessage)) { // 如果是重复消息,那么就不做处理 return null; } final List<WxCpMessageRouterRule> matchRules = new ArrayList<WxCpMessageRouterRule>(); // 收集匹配的规则 for (final WxCpMessageRouterRule rule : rules) { if (rule.test(wxMessage)) { matchRules.add(rule); if(!rule.isReEnter()) { break; } } } if (matchRules.size() == 0) { return null; } WxCpXmlOutMessage res = null; final List<Future> futures = new ArrayList<Future>(); for (final WxCpMessageRouterRule rule : matchRules) { // 返回最后一个非异步的rule的执行结果 if(rule.isAsync()) { futures.add( executorService.submit(new Runnable() { public void run() { rule.service(wxMessage, wxCpService, sessionManager, exceptionHandler); } }) ); } else { res = rule.service(wxMessage, wxCpService, sessionManager, exceptionHandler); // 在同步操作结束,session访问结束 log.debug("End session access: async=false, sessionId={}", wxMessage.getFromUserName()); sessionEndAccess(wxMessage); } } if (futures.size() > 0) { executorService.submit(new Runnable() { @Override public void run() { for (Future future : futures) { try { future.get(); log.debug("End session access: async=true, sessionId={}", wxMessage.getFromUserName()); // 异步操作结束,session访问结束 sessionEndAccess(wxMessage); } catch (InterruptedException e) { log.error("Error happened when wait task finish", e); } catch (ExecutionException e) { log.error("Error happened when wait task finish", e); } } } }); } return res; }
class class_name[name] begin[{] method[route, return_type[type[WxCpXmlOutMessage]], modifier[public], parameter[wxMessage]] begin[{] if[call[.isDuplicateMessage, parameter[member[.wxMessage]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], matchRules] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=wxMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=test, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=matchRules, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isReEnter, postfix_operators=[], prefix_operators=['!'], qualifier=rule, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=rules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rule)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=WxCpMessageRouterRule, sub_type=None))), label=None) if[binary_operation[call[matchRules.size, parameter[]], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[WxCpXmlOutMessage], res] local_variable[type[List], futures] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isAsync, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=wxMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wxCpService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sessionManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exceptionHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=service, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="End session access: async=false, sessionId={}"), MethodInvocation(arguments=[], member=getFromUserName, postfix_operators=[], prefix_operators=[], qualifier=wxMessage, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=wxMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sessionEndAccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=wxMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wxCpService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sessionManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exceptionHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=service, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))], member=submit, postfix_operators=[], prefix_operators=[], qualifier=executorService, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=futures, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=matchRules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rule)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=WxCpMessageRouterRule, sub_type=None))), label=None) if[binary_operation[call[futures.size, parameter[]], >, literal[0]]] begin[{] call[executorService.submit, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="End session access: async=true, sessionId={}"), MethodInvocation(arguments=[], member=getFromUserName, postfix_operators=[], prefix_operators=[], qualifier=wxMessage, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=wxMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sessionEndAccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error happened when wait task finish"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error happened when wait task finish"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ExecutionException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=futures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=future)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Future, sub_type=None))), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))]] else begin[{] None end[}] return[member[.res]] end[}] END[}]
Keyword[public] identifier[WxCpXmlOutMessage] identifier[route] operator[SEP] Keyword[final] identifier[WxCpXmlMessage] identifier[wxMessage] operator[SEP] { Keyword[if] operator[SEP] identifier[isDuplicateMessage] operator[SEP] identifier[wxMessage] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] identifier[List] operator[<] identifier[WxCpMessageRouterRule] operator[>] identifier[matchRules] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[WxCpMessageRouterRule] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[WxCpMessageRouterRule] identifier[rule] operator[:] identifier[rules] operator[SEP] { Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[test] operator[SEP] identifier[wxMessage] operator[SEP] operator[SEP] { identifier[matchRules] operator[SEP] identifier[add] operator[SEP] identifier[rule] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[rule] operator[SEP] identifier[isReEnter] operator[SEP] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } } } Keyword[if] operator[SEP] identifier[matchRules] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[WxCpXmlOutMessage] identifier[res] operator[=] Other[null] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Future] operator[>] identifier[futures] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Future] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[WxCpMessageRouterRule] identifier[rule] operator[:] identifier[matchRules] operator[SEP] { Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[isAsync] operator[SEP] operator[SEP] operator[SEP] { identifier[futures] operator[SEP] identifier[add] operator[SEP] identifier[executorService] operator[SEP] identifier[submit] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[rule] operator[SEP] identifier[service] operator[SEP] identifier[wxMessage] , identifier[wxCpService] , identifier[sessionManager] , identifier[exceptionHandler] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[res] operator[=] identifier[rule] operator[SEP] identifier[service] operator[SEP] identifier[wxMessage] , identifier[wxCpService] , identifier[sessionManager] , identifier[exceptionHandler] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[wxMessage] operator[SEP] identifier[getFromUserName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sessionEndAccess] operator[SEP] identifier[wxMessage] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[futures] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[executorService] operator[SEP] identifier[submit] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Future] identifier[future] operator[:] identifier[futures] operator[SEP] { Keyword[try] { identifier[future] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[wxMessage] operator[SEP] identifier[getFromUserName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sessionEndAccess] operator[SEP] identifier[wxMessage] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ExecutionException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } } } operator[SEP] operator[SEP] } Keyword[return] identifier[res] operator[SEP] }
public void setReadTimeout(int timeout) { Assert.isTrue(timeout >= 0, "Timeout must be a non-negative value"); this.socketTimeout = timeout; setLegacySocketTimeout(getHttpClient(), timeout); }
class class_name[name] begin[{] method[setReadTimeout, return_type[void], modifier[public], parameter[timeout]] begin[{] call[Assert.isTrue, parameter[binary_operation[member[.timeout], >=, literal[0]], literal["Timeout must be a non-negative value"]]] assign[THIS[member[None.socketTimeout]], member[.timeout]] call[.setLegacySocketTimeout, parameter[call[.getHttpClient, parameter[]], member[.timeout]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setReadTimeout] operator[SEP] Keyword[int] identifier[timeout] operator[SEP] { identifier[Assert] operator[SEP] identifier[isTrue] operator[SEP] identifier[timeout] operator[>=] Other[0] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[socketTimeout] operator[=] identifier[timeout] operator[SEP] identifier[setLegacySocketTimeout] operator[SEP] identifier[getHttpClient] operator[SEP] operator[SEP] , identifier[timeout] operator[SEP] operator[SEP] }
public void clazz(String unexpectedClass) { String clazz = checkClazz(unexpectedClass, 0, 0); assertNotNull(NO_ELEMENT_FOUND, clazz); assertFalse("Class Mismatch: class of '" + clazz + CONTAINS + unexpectedClass + "'", clazz.contains(unexpectedClass)); }
class class_name[name] begin[{] method[clazz, return_type[void], modifier[public], parameter[unexpectedClass]] begin[{] local_variable[type[String], clazz] call[.assertNotNull, parameter[member[.NO_ELEMENT_FOUND], member[.clazz]]] call[.assertFalse, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Class Mismatch: class of '"], +, member[.clazz]], +, member[.CONTAINS]], +, member[.unexpectedClass]], +, literal["'"]], call[clazz.contains, parameter[member[.unexpectedClass]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[clazz] operator[SEP] identifier[String] identifier[unexpectedClass] operator[SEP] { identifier[String] identifier[clazz] operator[=] identifier[checkClazz] operator[SEP] identifier[unexpectedClass] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[assertNotNull] operator[SEP] identifier[NO_ELEMENT_FOUND] , identifier[clazz] operator[SEP] operator[SEP] identifier[assertFalse] operator[SEP] literal[String] operator[+] identifier[clazz] operator[+] identifier[CONTAINS] operator[+] identifier[unexpectedClass] operator[+] literal[String] , identifier[clazz] operator[SEP] identifier[contains] operator[SEP] identifier[unexpectedClass] operator[SEP] operator[SEP] operator[SEP] }
@Override public OAuthToken get(String envKey) { if (!oAuthToken.containsKey(envKey)) return null; return oAuthToken.get(envKey); }
class class_name[name] begin[{] method[get, return_type[type[OAuthToken]], modifier[public], parameter[envKey]] begin[{] if[call[oAuthToken.containsKey, parameter[member[.envKey]]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[oAuthToken.get, parameter[member[.envKey]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[OAuthToken] identifier[get] operator[SEP] identifier[String] identifier[envKey] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[oAuthToken] operator[SEP] identifier[containsKey] operator[SEP] identifier[envKey] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] identifier[oAuthToken] operator[SEP] identifier[get] operator[SEP] identifier[envKey] operator[SEP] operator[SEP] }
public static Validator<CharSequence> beginsWithUppercaseLetter(@NonNull final Context context, @StringRes final int resourceId) { return new BeginsWithUppercaseLetterValidator(context, resourceId); }
class class_name[name] begin[{] method[beginsWithUppercaseLetter, return_type[type[Validator]], modifier[public static], parameter[context, resourceId]] begin[{] return[ClassCreator(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resourceId, 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=BeginsWithUppercaseLetterValidator, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Validator] operator[<] identifier[CharSequence] operator[>] identifier[beginsWithUppercaseLetter] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[Context] identifier[context] , annotation[@] identifier[StringRes] Keyword[final] Keyword[int] identifier[resourceId] operator[SEP] { Keyword[return] Keyword[new] identifier[BeginsWithUppercaseLetterValidator] operator[SEP] identifier[context] , identifier[resourceId] operator[SEP] operator[SEP] }
public void addTrailingPairsToProperties(Properties properties) { if (trailingProperties != null) { for (Object propKey : trailingProperties.keySet()) { String name = (String) propKey; String value = trailingProperties.getProperty(name); properties.setProperty(name, value); } } }
class class_name[name] begin[{] method[addTrailingPairsToProperties, return_type[void], modifier[public], parameter[properties]] begin[{] if[binary_operation[member[.trailingProperties], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=propKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=trailingProperties, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=trailingProperties, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=propKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addTrailingPairsToProperties] operator[SEP] identifier[Properties] identifier[properties] operator[SEP] { Keyword[if] operator[SEP] identifier[trailingProperties] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Object] identifier[propKey] operator[:] identifier[trailingProperties] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[propKey] operator[SEP] identifier[String] identifier[value] operator[=] identifier[trailingProperties] operator[SEP] identifier[getProperty] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[setProperty] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } } }
public void loadBalancing_serviceName_backend_backend_PUT(String serviceName, String backend, OvhLoadBalancingBackendIp body) throws IOException { String qPath = "/ip/loadBalancing/{serviceName}/backend/{backend}"; StringBuilder sb = path(qPath, serviceName, backend); exec(qPath, "PUT", sb.toString(), body); }
class class_name[name] begin[{] method[loadBalancing_serviceName_backend_backend_PUT, return_type[void], modifier[public], parameter[serviceName, backend, body]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.exec, parameter[member[.qPath], literal["PUT"], call[sb.toString, parameter[]], member[.body]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[loadBalancing_serviceName_backend_backend_PUT] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[backend] , identifier[OvhLoadBalancingBackendIp] identifier[body] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[backend] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[body] operator[SEP] operator[SEP] }
public static double[][] getMatrix(IAtomContainer container) { IBond bond = null; int indexAtom1; int indexAtom2; double[][] conMat = new double[container.getAtomCount()][container.getAtomCount()]; for (int f = 0; f < container.getBondCount(); f++) { bond = container.getBond(f); indexAtom1 = container.indexOf(bond.getBegin()); indexAtom2 = container.indexOf(bond.getEnd()); conMat[indexAtom1][indexAtom2] = BondManipulator.destroyBondOrder(bond.getOrder()); conMat[indexAtom2][indexAtom1] = BondManipulator.destroyBondOrder(bond.getOrder()); } return conMat; }
class class_name[name] begin[{] method[getMatrix, return_type[type[double]], modifier[public static], parameter[container]] begin[{] local_variable[type[IBond], bond] local_variable[type[int], indexAtom1] local_variable[type[int], indexAtom2] local_variable[type[double], conMat] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBond, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=indexAtom1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBegin, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=indexAtom2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=conMat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexAtom1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=indexAtom2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None)], member=destroyBondOrder, postfix_operators=[], prefix_operators=[], qualifier=BondManipulator, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=conMat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=indexAtom2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=indexAtom1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None)], member=destroyBondOrder, postfix_operators=[], prefix_operators=[], qualifier=BondManipulator, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getBondCount, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=f)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=f, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.conMat]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getMatrix] operator[SEP] identifier[IAtomContainer] identifier[container] operator[SEP] { identifier[IBond] identifier[bond] operator[=] Other[null] operator[SEP] Keyword[int] identifier[indexAtom1] operator[SEP] Keyword[int] identifier[indexAtom2] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[conMat] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[container] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[f] operator[=] Other[0] operator[SEP] identifier[f] operator[<] identifier[container] operator[SEP] identifier[getBondCount] operator[SEP] operator[SEP] operator[SEP] identifier[f] operator[++] operator[SEP] { identifier[bond] operator[=] identifier[container] operator[SEP] identifier[getBond] operator[SEP] identifier[f] operator[SEP] operator[SEP] identifier[indexAtom1] operator[=] identifier[container] operator[SEP] identifier[indexOf] operator[SEP] identifier[bond] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[indexAtom2] operator[=] identifier[container] operator[SEP] identifier[indexOf] operator[SEP] identifier[bond] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[conMat] operator[SEP] identifier[indexAtom1] operator[SEP] operator[SEP] identifier[indexAtom2] operator[SEP] operator[=] identifier[BondManipulator] operator[SEP] identifier[destroyBondOrder] operator[SEP] identifier[bond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[conMat] operator[SEP] identifier[indexAtom2] operator[SEP] operator[SEP] identifier[indexAtom1] operator[SEP] operator[=] identifier[BondManipulator] operator[SEP] identifier[destroyBondOrder] operator[SEP] identifier[bond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[conMat] operator[SEP] }
protected void buildRevisionHistory(final BuildData buildData, final Map<String, String> overrides) throws BuildProcessingException { final ContentSpec contentSpec = buildData.getContentSpec(); // Replace the basic injection data inside the revision history final String revisionHistoryXml = stringConstantProvider.getStringConstant( buildData.getServerEntities().getRevisionHistoryStringConstantId()).getValue(); // DocBook 5 shouldn't have the <revhistory> wrapped in a <simpara> final String fixedRevisionHistoryXml; if (buildData.getDocBookVersion() == DocBookVersion.DOCBOOK_50) { fixedRevisionHistoryXml = revisionHistoryXml.replaceAll(BuilderConstants.ESCAPED_TITLE_REGEX, buildData.getEscapedBookTitle()).replace("<simpara>", "").replace("</simpara>", ""); } else { fixedRevisionHistoryXml = revisionHistoryXml.replaceAll(BuilderConstants.ESCAPED_TITLE_REGEX, buildData.getEscapedBookTitle()); } // Setup Revision_History.xml if (overrides.containsKey(CSConstants.REVISION_HISTORY_OVERRIDE) && buildData.getOverrideFiles().containsKey( CSConstants.REVISION_HISTORY_OVERRIDE)) { byte[] revHistory = buildData.getOverrideFiles().get(CSConstants.REVISION_HISTORY_OVERRIDE); if (buildData.getBuildOptions().getRevisionMessages() != null && !buildData.getBuildOptions().getRevisionMessages().isEmpty()) { try { // Parse the Revision History and add the new entry/entries final ByteArrayInputStream bais = new ByteArrayInputStream(revHistory); final BufferedReader reader = new BufferedReader(new InputStreamReader(bais)); final StringBuilder buffer = new StringBuilder(); String line = ""; while ((line = reader.readLine()) != null) { buffer.append(line + "\n"); } if (buildData.getBuildOptions().getRevisionMessages() != null && !buildData.getBuildOptions().getRevisionMessages() .isEmpty()) { // Add a revision message to the Revision_History.xml final String revHistoryOverride = buffer.toString(); final String docType = XMLUtilities.findDocumentType(revHistoryOverride); if (docType != null) { buildRevisionHistoryFromTemplate(buildData, revHistoryOverride.replace(docType, "")); } else { buildRevisionHistoryFromTemplate(buildData, revHistoryOverride); } } else { addToZip(buildData.getBookLocaleFolder() + "Revision_History.xml", buffer.toString(), buildData); } } catch (Exception e) { log.error(e.getMessage()); buildRevisionHistoryFromTemplate(buildData, fixedRevisionHistoryXml); } } else { // Add the revision history directly to the book buildData.getOutputFiles().put(buildData.getBookLocaleFolder() + REVISION_HISTORY_FILE_NAME, revHistory); } } else if (contentSpec.getRevisionHistory() != null) { final TopicErrorData errorData = buildData.getErrorDatabase().getErrorData(contentSpec.getRevisionHistory().getTopic()); final String revisionHistoryXML = DocBookBuildUtilities.convertDocumentToDocBookFormattedString(buildData.getDocBookVersion(), contentSpec.getRevisionHistory().getXMLDocument(), "appendix", buildData.getEntityFileName(), getXMLFormatProperties()); if (buildData.getBuildOptions().getRevisionMessages() != null && !buildData.getBuildOptions().getRevisionMessages().isEmpty()) { buildRevisionHistoryFromTemplate(buildData, revisionHistoryXML); } else if (errorData != null && errorData.hasFatalErrors()) { buildRevisionHistoryFromTemplate(buildData, revisionHistoryXML); } else { // Add the revision history directly to the book addToZip(buildData.getBookLocaleFolder() + REVISION_HISTORY_FILE_NAME, revisionHistoryXML, buildData); } } else { buildRevisionHistoryFromTemplate(buildData, fixedRevisionHistoryXml); } }
class class_name[name] begin[{] method[buildRevisionHistory, return_type[void], modifier[protected], parameter[buildData, overrides]] begin[{] local_variable[type[ContentSpec], contentSpec] local_variable[type[String], revisionHistoryXml] local_variable[type[String], fixedRevisionHistoryXml] if[binary_operation[call[buildData.getDocBookVersion, parameter[]], ==, member[DocBookVersion.DOCBOOK_50]]] begin[{] assign[member[.fixedRevisionHistoryXml], call[revisionHistoryXml.replaceAll, parameter[member[BuilderConstants.ESCAPED_TITLE_REGEX], call[buildData.getEscapedBookTitle, parameter[]]]]] else begin[{] assign[member[.fixedRevisionHistoryXml], call[revisionHistoryXml.replaceAll, parameter[member[BuilderConstants.ESCAPED_TITLE_REGEX], call[buildData.getEscapedBookTitle, parameter[]]]]] end[}] if[binary_operation[call[overrides.containsKey, parameter[member[CSConstants.REVISION_HISTORY_OVERRIDE]]], &&, call[buildData.getOverrideFiles, parameter[]]]] begin[{] local_variable[type[byte], revHistory] if[binary_operation[binary_operation[call[buildData.getBuildOptions, parameter[]], !=, literal[null]], &&, call[buildData.getBuildOptions, parameter[]]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=revHistory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None)), name=bais)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=bais, 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=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)), name=reader)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, 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=buffer)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBuildOptions, postfix_operators=[], prefix_operators=[], qualifier=buildData, selectors=[MethodInvocation(arguments=[], member=getRevisionMessages, 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=null), operator=!=), operandr=MethodInvocation(arguments=[], member=getBuildOptions, postfix_operators=[], prefix_operators=['!'], qualifier=buildData, selectors=[MethodInvocation(arguments=[], member=getRevisionMessages, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBookLocaleFolder, postfix_operators=[], prefix_operators=[], qualifier=buildData, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Revision_History.xml"), operator=+), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), MemberReference(member=buildData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addToZip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), name=revHistoryOverride)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=revHistoryOverride, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findDocumentType, postfix_operators=[], prefix_operators=[], qualifier=XMLUtilities, selectors=[], type_arguments=None), name=docType)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=docType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buildData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=revHistoryOverride, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildRevisionHistoryFromTemplate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buildData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=docType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=revHistoryOverride, selectors=[], type_arguments=None)], member=buildRevisionHistoryFromTemplate, postfix_operators=[], prefix_operators=[], qualifier=, 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)], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buildData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fixedRevisionHistoryXml, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildRevisionHistoryFromTemplate, postfix_operators=[], prefix_operators=[], qualifier=, 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) else begin[{] call[buildData.getOutputFiles, parameter[]] end[}] else begin[{] if[binary_operation[call[contentSpec.getRevisionHistory, parameter[]], !=, literal[null]]] begin[{] local_variable[type[TopicErrorData], errorData] local_variable[type[String], revisionHistoryXML] if[binary_operation[binary_operation[call[buildData.getBuildOptions, parameter[]], !=, literal[null]], &&, call[buildData.getBuildOptions, parameter[]]]] begin[{] call[.buildRevisionHistoryFromTemplate, parameter[member[.buildData], member[.revisionHistoryXML]]] else begin[{] if[binary_operation[binary_operation[member[.errorData], !=, literal[null]], &&, call[errorData.hasFatalErrors, parameter[]]]] begin[{] call[.buildRevisionHistoryFromTemplate, parameter[member[.buildData], member[.revisionHistoryXML]]] else begin[{] call[.addToZip, parameter[binary_operation[call[buildData.getBookLocaleFolder, parameter[]], +, member[.REVISION_HISTORY_FILE_NAME]], member[.revisionHistoryXML], member[.buildData]]] end[}] end[}] else begin[{] call[.buildRevisionHistoryFromTemplate, parameter[member[.buildData], member[.fixedRevisionHistoryXml]]] end[}] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[buildRevisionHistory] operator[SEP] Keyword[final] identifier[BuildData] identifier[buildData] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[overrides] operator[SEP] Keyword[throws] identifier[BuildProcessingException] { Keyword[final] identifier[ContentSpec] identifier[contentSpec] operator[=] identifier[buildData] operator[SEP] identifier[getContentSpec] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[revisionHistoryXml] operator[=] identifier[stringConstantProvider] operator[SEP] identifier[getStringConstant] operator[SEP] identifier[buildData] operator[SEP] identifier[getServerEntities] operator[SEP] operator[SEP] operator[SEP] identifier[getRevisionHistoryStringConstantId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[fixedRevisionHistoryXml] operator[SEP] Keyword[if] operator[SEP] identifier[buildData] operator[SEP] identifier[getDocBookVersion] operator[SEP] operator[SEP] operator[==] identifier[DocBookVersion] operator[SEP] identifier[DOCBOOK_50] operator[SEP] { identifier[fixedRevisionHistoryXml] operator[=] identifier[revisionHistoryXml] operator[SEP] identifier[replaceAll] operator[SEP] identifier[BuilderConstants] operator[SEP] identifier[ESCAPED_TITLE_REGEX] , identifier[buildData] operator[SEP] identifier[getEscapedBookTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[fixedRevisionHistoryXml] operator[=] identifier[revisionHistoryXml] operator[SEP] identifier[replaceAll] operator[SEP] identifier[BuilderConstants] operator[SEP] identifier[ESCAPED_TITLE_REGEX] , identifier[buildData] operator[SEP] identifier[getEscapedBookTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[overrides] operator[SEP] identifier[containsKey] operator[SEP] identifier[CSConstants] operator[SEP] identifier[REVISION_HISTORY_OVERRIDE] operator[SEP] operator[&&] identifier[buildData] operator[SEP] identifier[getOverrideFiles] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[CSConstants] operator[SEP] identifier[REVISION_HISTORY_OVERRIDE] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[revHistory] operator[=] identifier[buildData] operator[SEP] identifier[getOverrideFiles] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[CSConstants] operator[SEP] identifier[REVISION_HISTORY_OVERRIDE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buildData] operator[SEP] identifier[getBuildOptions] operator[SEP] operator[SEP] operator[SEP] identifier[getRevisionMessages] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] identifier[buildData] operator[SEP] identifier[getBuildOptions] operator[SEP] operator[SEP] operator[SEP] identifier[getRevisionMessages] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { Keyword[final] identifier[ByteArrayInputStream] identifier[bais] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[revHistory] operator[SEP] operator[SEP] Keyword[final] identifier[BufferedReader] identifier[reader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[bais] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[line] operator[=] literal[String] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[reader] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[buildData] operator[SEP] identifier[getBuildOptions] operator[SEP] operator[SEP] operator[SEP] identifier[getRevisionMessages] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] identifier[buildData] operator[SEP] identifier[getBuildOptions] operator[SEP] operator[SEP] operator[SEP] identifier[getRevisionMessages] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[revHistoryOverride] operator[=] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[docType] operator[=] identifier[XMLUtilities] operator[SEP] identifier[findDocumentType] operator[SEP] identifier[revHistoryOverride] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[docType] operator[!=] Other[null] operator[SEP] { identifier[buildRevisionHistoryFromTemplate] operator[SEP] identifier[buildData] , identifier[revHistoryOverride] operator[SEP] identifier[replace] operator[SEP] identifier[docType] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[buildRevisionHistoryFromTemplate] operator[SEP] identifier[buildData] , identifier[revHistoryOverride] operator[SEP] operator[SEP] } } Keyword[else] { identifier[addToZip] operator[SEP] identifier[buildData] operator[SEP] identifier[getBookLocaleFolder] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[buildData] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buildRevisionHistoryFromTemplate] operator[SEP] identifier[buildData] , identifier[fixedRevisionHistoryXml] operator[SEP] operator[SEP] } } Keyword[else] { identifier[buildData] operator[SEP] identifier[getOutputFiles] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[buildData] operator[SEP] identifier[getBookLocaleFolder] operator[SEP] operator[SEP] operator[+] identifier[REVISION_HISTORY_FILE_NAME] , identifier[revHistory] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[contentSpec] operator[SEP] identifier[getRevisionHistory] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[TopicErrorData] identifier[errorData] operator[=] identifier[buildData] operator[SEP] identifier[getErrorDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getErrorData] operator[SEP] identifier[contentSpec] operator[SEP] identifier[getRevisionHistory] operator[SEP] operator[SEP] operator[SEP] identifier[getTopic] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[revisionHistoryXML] operator[=] identifier[DocBookBuildUtilities] operator[SEP] identifier[convertDocumentToDocBookFormattedString] operator[SEP] identifier[buildData] operator[SEP] identifier[getDocBookVersion] operator[SEP] operator[SEP] , identifier[contentSpec] operator[SEP] identifier[getRevisionHistory] operator[SEP] operator[SEP] operator[SEP] identifier[getXMLDocument] operator[SEP] operator[SEP] , literal[String] , identifier[buildData] operator[SEP] identifier[getEntityFileName] operator[SEP] operator[SEP] , identifier[getXMLFormatProperties] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buildData] operator[SEP] identifier[getBuildOptions] operator[SEP] operator[SEP] operator[SEP] identifier[getRevisionMessages] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] identifier[buildData] operator[SEP] identifier[getBuildOptions] operator[SEP] operator[SEP] operator[SEP] identifier[getRevisionMessages] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[buildRevisionHistoryFromTemplate] operator[SEP] identifier[buildData] , identifier[revisionHistoryXML] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[errorData] operator[!=] Other[null] operator[&&] identifier[errorData] operator[SEP] identifier[hasFatalErrors] operator[SEP] operator[SEP] operator[SEP] { identifier[buildRevisionHistoryFromTemplate] operator[SEP] identifier[buildData] , identifier[revisionHistoryXML] operator[SEP] operator[SEP] } Keyword[else] { identifier[addToZip] operator[SEP] identifier[buildData] operator[SEP] identifier[getBookLocaleFolder] operator[SEP] operator[SEP] operator[+] identifier[REVISION_HISTORY_FILE_NAME] , identifier[revisionHistoryXML] , identifier[buildData] operator[SEP] operator[SEP] } } Keyword[else] { identifier[buildRevisionHistoryFromTemplate] operator[SEP] identifier[buildData] , identifier[fixedRevisionHistoryXml] operator[SEP] operator[SEP] } }
@Nonnull public static final <T extends AbstractRequestSingleton> T getRequestSingleton (@Nonnull final Class <T> aClass) { return getSingleton (_getStaticScope (true), aClass); }
class class_name[name] begin[{] method[getRequestSingleton, return_type[type[T]], modifier[final public static], parameter[aClass]] begin[{] return[call[.getSingleton, parameter[call[._getStaticScope, parameter[literal[true]]], member[.aClass]]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] Keyword[final] operator[<] identifier[T] Keyword[extends] identifier[AbstractRequestSingleton] operator[>] identifier[T] identifier[getRequestSingleton] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[aClass] operator[SEP] { Keyword[return] identifier[getSingleton] operator[SEP] identifier[_getStaticScope] operator[SEP] literal[boolean] operator[SEP] , identifier[aClass] operator[SEP] operator[SEP] }
public int read(byte[] b) throws IOException { try { ByteBlock block = source.read(b); System.arraycopy(block.data, 0, b, 0, block.count); return block.count; } catch (RemoteException e) { throw new IOException("There was a Remote Exception.", e); } }
class class_name[name] begin[{] method[read, return_type[type[int]], modifier[public], parameter[b]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), name=block)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteBlock, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=block, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=block, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=block, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="There was a Remote Exception."), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RemoteException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[int] identifier[read] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[b] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { identifier[ByteBlock] identifier[block] operator[=] identifier[source] operator[SEP] identifier[read] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[block] operator[SEP] identifier[data] , Other[0] , identifier[b] , Other[0] , identifier[block] operator[SEP] identifier[count] operator[SEP] operator[SEP] Keyword[return] identifier[block] operator[SEP] identifier[count] operator[SEP] } Keyword[catch] operator[SEP] identifier[RemoteException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public static Class<?> boxType( Class<?> primitiveType ) { Class<?> c = wrapperMap.get( primitiveType ); if ( c != null ) return c; throw new InterpreterError( "Not a primitive type: "+ primitiveType ); }
class class_name[name] begin[{] method[boxType, return_type[type[Class]], modifier[public static], parameter[primitiveType]] begin[{] local_variable[type[Class], c] if[binary_operation[member[.c], !=, literal[null]]] begin[{] return[member[.c]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not a primitive type: "), operandr=MemberReference(member=primitiveType, 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=InterpreterError, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[boxType] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[primitiveType] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[c] operator[=] identifier[wrapperMap] operator[SEP] identifier[get] operator[SEP] identifier[primitiveType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[c] operator[SEP] Keyword[throw] Keyword[new] identifier[InterpreterError] operator[SEP] literal[String] operator[+] identifier[primitiveType] operator[SEP] operator[SEP] }
@Override public SendBulkTemplatedEmailResult sendBulkTemplatedEmail(SendBulkTemplatedEmailRequest request) { request = beforeClientExecution(request); return executeSendBulkTemplatedEmail(request); }
class class_name[name] begin[{] method[sendBulkTemplatedEmail, return_type[type[SendBulkTemplatedEmailResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeSendBulkTemplatedEmail, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[SendBulkTemplatedEmailResult] identifier[sendBulkTemplatedEmail] operator[SEP] identifier[SendBulkTemplatedEmailRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeSendBulkTemplatedEmail] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public AttributeInfo[] get_attribute_info(final DeviceProxy deviceProxy, final String[] attributeNames) throws DevFailed { build_connection(deviceProxy); final int retries = deviceProxy.transparent_reconnection ? 2 : 1; for (int oneTry=1 ; oneTry<=retries ; oneTry++) { try { AttributeInfo[] result; AttributeConfig[] ac = new AttributeConfig[0]; AttributeConfig_2[] ac_2 = null; if (deviceProxy.url.protocol == TANGO) { // Check IDL version if (deviceProxy.device_2 != null) { ac_2 = deviceProxy.device_2.get_attribute_config_2(attributeNames); } else { ac = deviceProxy.device.get_attribute_config(attributeNames); } } else { ac = deviceProxy.taco_device.get_attribute_config(attributeNames); } // Convert AttributeConfig(_2) object to AttributeInfo object final int size = ac_2 != null ? ac_2.length : ac.length; result = new AttributeInfo[size]; for (int i = 0; i < size; i++) { if (ac_2 != null) { result[i] = new AttributeInfo(ac_2[i]); } else { result[i] = new AttributeInfo(ac[i]); } } return result; } catch (final DevFailed e) { if (oneTry>=retries) { throw e; } } catch (final Exception e) { if (oneTry>=retries) { ApiUtilDAODefaultImpl.removePendingRepliesOfDevice(deviceProxy); throw_dev_failed(deviceProxy, e, "get_attribute_config", true); } } } return null; }
class class_name[name] begin[{] method[get_attribute_info, return_type[type[AttributeInfo]], modifier[public], parameter[deviceProxy, attributeNames]] begin[{] call[.build_connection, parameter[member[.deviceProxy]]] local_variable[type[int], retries] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=AttributeInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttributeConfig, sub_type=None)), name=ac)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=AttributeConfig, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=ac_2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=AttributeConfig_2, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=protocol, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.url, selectors=[]), operandr=MemberReference(member=TANGO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_attribute_config, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.taco_device, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=device_2, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_attribute_config, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.device, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ac_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=attributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get_attribute_config_2, postfix_operators=[], prefix_operators=[], qualifier=deviceProxy.device_2, selectors=[], type_arguments=None)), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ac_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[]), if_true=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ac_2, selectors=[])), name=size)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttributeInfo, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ac_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=AttributeInfo, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=ac_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=AttributeInfo, sub_type=None))), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=oneTry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=retries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DevFailed'])), CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=oneTry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=retries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=deviceProxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removePendingRepliesOfDevice, postfix_operators=[], prefix_operators=[], qualifier=ApiUtilDAODefaultImpl, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=deviceProxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="get_attribute_config"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=throw_dev_failed, postfix_operators=[], prefix_operators=[], qualifier=, 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=ForControl(condition=BinaryOperation(operandl=MemberReference(member=oneTry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=retries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=oneTry)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=oneTry, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[AttributeInfo] operator[SEP] operator[SEP] identifier[get_attribute_info] operator[SEP] Keyword[final] identifier[DeviceProxy] identifier[deviceProxy] , Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[attributeNames] operator[SEP] Keyword[throws] identifier[DevFailed] { identifier[build_connection] operator[SEP] identifier[deviceProxy] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[retries] operator[=] identifier[deviceProxy] operator[SEP] identifier[transparent_reconnection] operator[?] Other[2] operator[:] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[oneTry] operator[=] Other[1] operator[SEP] identifier[oneTry] operator[<=] identifier[retries] operator[SEP] identifier[oneTry] operator[++] operator[SEP] { Keyword[try] { identifier[AttributeInfo] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[AttributeConfig] operator[SEP] operator[SEP] identifier[ac] operator[=] Keyword[new] identifier[AttributeConfig] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[AttributeConfig_2] operator[SEP] operator[SEP] identifier[ac_2] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[url] operator[SEP] identifier[protocol] operator[==] identifier[TANGO] operator[SEP] { Keyword[if] operator[SEP] identifier[deviceProxy] operator[SEP] identifier[device_2] operator[!=] Other[null] operator[SEP] { identifier[ac_2] operator[=] identifier[deviceProxy] operator[SEP] identifier[device_2] operator[SEP] identifier[get_attribute_config_2] operator[SEP] identifier[attributeNames] operator[SEP] operator[SEP] } Keyword[else] { identifier[ac] operator[=] identifier[deviceProxy] operator[SEP] identifier[device] operator[SEP] identifier[get_attribute_config] operator[SEP] identifier[attributeNames] operator[SEP] operator[SEP] } } Keyword[else] { identifier[ac] operator[=] identifier[deviceProxy] operator[SEP] identifier[taco_device] operator[SEP] identifier[get_attribute_config] operator[SEP] identifier[attributeNames] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[size] operator[=] identifier[ac_2] operator[!=] Other[null] operator[?] identifier[ac_2] operator[SEP] identifier[length] operator[:] identifier[ac] operator[SEP] identifier[length] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[AttributeInfo] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[ac_2] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[AttributeInfo] operator[SEP] identifier[ac_2] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[AttributeInfo] operator[SEP] identifier[ac] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[DevFailed] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[oneTry] operator[>=] identifier[retries] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[oneTry] operator[>=] identifier[retries] operator[SEP] { identifier[ApiUtilDAODefaultImpl] operator[SEP] identifier[removePendingRepliesOfDevice] operator[SEP] identifier[deviceProxy] operator[SEP] operator[SEP] identifier[throw_dev_failed] operator[SEP] identifier[deviceProxy] , identifier[e] , literal[String] , literal[boolean] operator[SEP] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
@Override public ManifestDescriptor fromFile(File file) throws IllegalArgumentException, DescriptorImportException { if (file == null) throw new IllegalArgumentException("File cannot be null"); try { return new ManifestDescriptorImpl(descriptorName, new ManifestModel(file)); } catch (Exception e) { throw new DescriptorImportException(e.getMessage(), e); } }
class class_name[name] begin[{] method[fromFile, return_type[type[ManifestDescriptor]], modifier[public], parameter[file]] begin[{] if[binary_operation[member[.file], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File cannot be null")], 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=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=descriptorName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=file, 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=ManifestModel, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ManifestDescriptorImpl, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, 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=DescriptorImportException, 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[}]
annotation[@] identifier[Override] Keyword[public] identifier[ManifestDescriptor] identifier[fromFile] operator[SEP] identifier[File] identifier[file] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] , identifier[DescriptorImportException] { Keyword[if] operator[SEP] identifier[file] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] Keyword[new] identifier[ManifestDescriptorImpl] operator[SEP] identifier[descriptorName] , Keyword[new] identifier[ManifestModel] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[DescriptorImportException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void marshall(DnsProperties dnsProperties, ProtocolMarshaller protocolMarshaller) { if (dnsProperties == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(dnsProperties.getHostedZoneId(), HOSTEDZONEID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[dnsProperties, protocolMarshaller]] begin[{] if[binary_operation[member[.dnsProperties], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHostedZoneId, postfix_operators=[], prefix_operators=[], qualifier=dnsProperties, selectors=[], type_arguments=None), MemberReference(member=HOSTEDZONEID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), 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=SdkClientException, 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[marshall] operator[SEP] identifier[DnsProperties] identifier[dnsProperties] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[dnsProperties] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[dnsProperties] operator[SEP] identifier[getHostedZoneId] operator[SEP] operator[SEP] , identifier[HOSTEDZONEID_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override public Description matchClass(ClassTree tree, VisitorState state) { // TODO(b/36395371): filter here to exclude some classes (e.g. not immutable) if (TEST_CLASS.matches(tree, state)) { return NO_MATCH; } for (Tree member : tree.getMembers()) { if (isSuppressed(member)) { continue; } if ((member instanceof MethodTree && Matchers.methodIsConstructor().matches((MethodTree) member, state)) || (member instanceof BlockTree && !((BlockTree) member).isStatic()) || (member instanceof VariableTree && !Matchers.isStatic().matches(member, state))) { traverse(member, state); } } return NO_MATCH; }
class class_name[name] begin[{] method[matchClass, return_type[type[Description]], modifier[public], parameter[tree, state]] begin[{] if[call[TEST_CLASS.matches, parameter[member[.tree], member[.state]]]] begin[{] return[member[.NO_MATCH]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSuppressed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=MethodTree, sub_type=None), operator=instanceof), operandr=MethodInvocation(arguments=[], member=methodIsConstructor, postfix_operators=[], prefix_operators=[], qualifier=Matchers, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MethodTree, sub_type=None)), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BlockTree, sub_type=None), operator=instanceof), operandr=Cast(expression=MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BlockTree, sub_type=None)), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=VariableTree, sub_type=None), operator=instanceof), operandr=MethodInvocation(arguments=[], member=isStatic, postfix_operators=[], prefix_operators=['!'], qualifier=Matchers, selectors=[MethodInvocation(arguments=[MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=member, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMembers, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=member)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Tree, sub_type=None))), label=None) return[member[.NO_MATCH]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Description] identifier[matchClass] operator[SEP] identifier[ClassTree] identifier[tree] , identifier[VisitorState] identifier[state] operator[SEP] { Keyword[if] operator[SEP] identifier[TEST_CLASS] operator[SEP] identifier[matches] operator[SEP] identifier[tree] , identifier[state] operator[SEP] operator[SEP] { Keyword[return] identifier[NO_MATCH] operator[SEP] } Keyword[for] operator[SEP] identifier[Tree] identifier[member] operator[:] identifier[tree] operator[SEP] identifier[getMembers] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isSuppressed] operator[SEP] identifier[member] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[member] Keyword[instanceof] identifier[MethodTree] operator[&&] identifier[Matchers] operator[SEP] identifier[methodIsConstructor] operator[SEP] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] identifier[MethodTree] operator[SEP] identifier[member] , identifier[state] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[member] Keyword[instanceof] identifier[BlockTree] operator[&&] operator[!] operator[SEP] operator[SEP] identifier[BlockTree] operator[SEP] identifier[member] operator[SEP] operator[SEP] identifier[isStatic] operator[SEP] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[member] Keyword[instanceof] identifier[VariableTree] operator[&&] operator[!] identifier[Matchers] operator[SEP] identifier[isStatic] operator[SEP] operator[SEP] operator[SEP] identifier[matches] operator[SEP] identifier[member] , identifier[state] operator[SEP] operator[SEP] operator[SEP] { identifier[traverse] operator[SEP] identifier[member] , identifier[state] operator[SEP] operator[SEP] } } Keyword[return] identifier[NO_MATCH] operator[SEP] }
@Override protected Options getOptions() { final Options options = super.getOptions(); final Option filenameOption = new Option("f", "the name of the output file, default name is " + DEFAULT_FILENAME + " [optional]"); filenameOption.setArgName("FILENAME"); filenameOption.setLongOpt("filename"); filenameOption.setRequired(false); filenameOption.setArgs(1); options.addOption(filenameOption); final Option errorFilenameOption = new Option("ef", "the name of the error output file, default name is " + DEFAULT_ERROR_FILENAME + " [optional]"); errorFilenameOption.setArgName("ERRORFILENAME"); errorFilenameOption.setLongOpt("errorfilename"); errorFilenameOption.setRequired(false); errorFilenameOption.setArgs(1); options.addOption(errorFilenameOption); final Option verboseOption = new Option("ve", "verbose logging, default is false [optional]"); verboseOption.setArgName("VERBOSE"); verboseOption.setLongOpt("verbose"); verboseOption.setRequired(false); verboseOption.setArgs(1); verboseOption.setType(Boolean.class); options.addOption(verboseOption); return options; }
class class_name[name] begin[{] method[getOptions, return_type[type[Options]], modifier[protected], parameter[]] begin[{] local_variable[type[Options], options] local_variable[type[Option], filenameOption] call[filenameOption.setArgName, parameter[literal["FILENAME"]]] call[filenameOption.setLongOpt, parameter[literal["filename"]]] call[filenameOption.setRequired, parameter[literal[false]]] call[filenameOption.setArgs, parameter[literal[1]]] call[options.addOption, parameter[member[.filenameOption]]] local_variable[type[Option], errorFilenameOption] call[errorFilenameOption.setArgName, parameter[literal["ERRORFILENAME"]]] call[errorFilenameOption.setLongOpt, parameter[literal["errorfilename"]]] call[errorFilenameOption.setRequired, parameter[literal[false]]] call[errorFilenameOption.setArgs, parameter[literal[1]]] call[options.addOption, parameter[member[.errorFilenameOption]]] local_variable[type[Option], verboseOption] call[verboseOption.setArgName, parameter[literal["VERBOSE"]]] call[verboseOption.setLongOpt, parameter[literal["verbose"]]] call[verboseOption.setRequired, parameter[literal[false]]] call[verboseOption.setArgs, parameter[literal[1]]] call[verboseOption.setType, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]] call[options.addOption, parameter[member[.verboseOption]]] return[member[.options]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Options] identifier[getOptions] operator[SEP] operator[SEP] { Keyword[final] identifier[Options] identifier[options] operator[=] Keyword[super] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Option] identifier[filenameOption] operator[=] Keyword[new] identifier[Option] operator[SEP] literal[String] , literal[String] operator[+] identifier[DEFAULT_FILENAME] operator[+] literal[String] operator[SEP] operator[SEP] identifier[filenameOption] operator[SEP] identifier[setArgName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[filenameOption] operator[SEP] identifier[setLongOpt] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[filenameOption] operator[SEP] identifier[setRequired] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[filenameOption] operator[SEP] identifier[setArgs] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[addOption] operator[SEP] identifier[filenameOption] operator[SEP] operator[SEP] Keyword[final] identifier[Option] identifier[errorFilenameOption] operator[=] Keyword[new] identifier[Option] operator[SEP] literal[String] , literal[String] operator[+] identifier[DEFAULT_ERROR_FILENAME] operator[+] literal[String] operator[SEP] operator[SEP] identifier[errorFilenameOption] operator[SEP] identifier[setArgName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[errorFilenameOption] operator[SEP] identifier[setLongOpt] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[errorFilenameOption] operator[SEP] identifier[setRequired] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[errorFilenameOption] operator[SEP] identifier[setArgs] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[addOption] operator[SEP] identifier[errorFilenameOption] operator[SEP] operator[SEP] Keyword[final] identifier[Option] identifier[verboseOption] operator[=] Keyword[new] identifier[Option] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[verboseOption] operator[SEP] identifier[setArgName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[verboseOption] operator[SEP] identifier[setLongOpt] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[verboseOption] operator[SEP] identifier[setRequired] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[verboseOption] operator[SEP] identifier[setArgs] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[verboseOption] operator[SEP] identifier[setType] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[addOption] operator[SEP] identifier[verboseOption] operator[SEP] operator[SEP] Keyword[return] identifier[options] operator[SEP] }
@Override public final int getInt(final String key) { Integer result = optInt(key); if (result == null) { throw new ObjectMissingException(this, key); } return result; }
class class_name[name] begin[{] method[getInt, return_type[type[int]], modifier[final public], parameter[key]] begin[{] local_variable[type[Integer], result] if[binary_operation[member[.result], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=key, 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=ObjectMissingException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[int] identifier[getInt] operator[SEP] Keyword[final] identifier[String] identifier[key] operator[SEP] { identifier[Integer] identifier[result] operator[=] identifier[optInt] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ObjectMissingException] operator[SEP] Keyword[this] , identifier[key] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static void applyToHierarchy (Component comp, ComponentOp op) { applyToHierarchy(comp, Integer.MAX_VALUE, op); }
class class_name[name] begin[{] method[applyToHierarchy, return_type[void], modifier[public static], parameter[comp, op]] begin[{] call[.applyToHierarchy, parameter[member[.comp], member[Integer.MAX_VALUE], member[.op]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[applyToHierarchy] operator[SEP] identifier[Component] identifier[comp] , identifier[ComponentOp] identifier[op] operator[SEP] { identifier[applyToHierarchy] operator[SEP] identifier[comp] , identifier[Integer] operator[SEP] identifier[MAX_VALUE] , identifier[op] operator[SEP] operator[SEP] }
private void addClassInfoAndIncrementCount(Class<?> type, ClassInfo classInfo) { classes.putIfAbsent(type, classInfo); classSerializationCount.compute(type, BeanReferences::incrementOrOne); }
class class_name[name] begin[{] method[addClassInfoAndIncrementCount, return_type[void], modifier[private], parameter[type, classInfo]] begin[{] call[classes.putIfAbsent, parameter[member[.type], member[.classInfo]]] call[classSerializationCount.compute, parameter[member[.type], MethodReference(expression=MemberReference(member=BeanReferences, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=incrementOrOne, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addClassInfoAndIncrementCount] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] , identifier[ClassInfo] identifier[classInfo] operator[SEP] { identifier[classes] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[type] , identifier[classInfo] operator[SEP] operator[SEP] identifier[classSerializationCount] operator[SEP] identifier[compute] operator[SEP] identifier[type] , identifier[BeanReferences] operator[::] identifier[incrementOrOne] operator[SEP] operator[SEP] }
public static <E extends Comparable<E>> E maximum(Iterator<E> iterator, E init) { return Reductions.reduce(iterator, BinaryOperator.maxBy(new ComparableComparator<E>()), init); }
class class_name[name] begin[{] method[maximum, return_type[type[E]], modifier[public static], parameter[iterator, init]] begin[{] return[call[Reductions.reduce, parameter[member[.iterator], call[BinaryOperator.maxBy, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=None, name=ComparableComparator, sub_type=None))]], member[.init]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] Keyword[extends] identifier[Comparable] operator[<] identifier[E] operator[>] operator[>] identifier[E] identifier[maximum] operator[SEP] identifier[Iterator] operator[<] identifier[E] operator[>] identifier[iterator] , identifier[E] identifier[init] operator[SEP] { Keyword[return] identifier[Reductions] operator[SEP] identifier[reduce] operator[SEP] identifier[iterator] , identifier[BinaryOperator] operator[SEP] identifier[maxBy] operator[SEP] Keyword[new] identifier[ComparableComparator] operator[<] identifier[E] operator[>] operator[SEP] operator[SEP] operator[SEP] , identifier[init] operator[SEP] operator[SEP] }
public void enableJob(String jobId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { JobEnableOptions options = new JobEnableOptions(); BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors); bhMgr.applyRequestBehaviors(options); this.parentBatchClient.protocolLayer().jobs().enable(jobId, options); }
class class_name[name] begin[{] method[enableJob, return_type[void], modifier[public], parameter[jobId, additionalBehaviors]] begin[{] local_variable[type[JobEnableOptions], options] local_variable[type[BehaviorManager], bhMgr] call[bhMgr.applyRequestBehaviors, parameter[member[.options]]] THIS[member[None.parentBatchClient]call[None.protocolLayer, parameter[]]call[None.jobs, parameter[]]call[None.enable, parameter[member[.jobId], member[.options]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[enableJob] operator[SEP] identifier[String] identifier[jobId] , identifier[Iterable] operator[<] identifier[BatchClientBehavior] operator[>] identifier[additionalBehaviors] operator[SEP] Keyword[throws] identifier[BatchErrorException] , identifier[IOException] { identifier[JobEnableOptions] identifier[options] operator[=] Keyword[new] identifier[JobEnableOptions] operator[SEP] operator[SEP] operator[SEP] identifier[BehaviorManager] identifier[bhMgr] operator[=] Keyword[new] identifier[BehaviorManager] operator[SEP] Keyword[this] operator[SEP] identifier[customBehaviors] operator[SEP] operator[SEP] , identifier[additionalBehaviors] operator[SEP] operator[SEP] identifier[bhMgr] operator[SEP] identifier[applyRequestBehaviors] operator[SEP] identifier[options] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parentBatchClient] operator[SEP] identifier[protocolLayer] operator[SEP] operator[SEP] operator[SEP] identifier[jobs] operator[SEP] operator[SEP] operator[SEP] identifier[enable] operator[SEP] identifier[jobId] , identifier[options] operator[SEP] operator[SEP] }
private StringBuilder formatNumeric(Number[] hms, StringBuilder appendable) { // find the start and end of non-nil values in hms array. We have to know if we // have hour-minute; minute-second; or hour-minute-second. int startIndex = -1; int endIndex = -1; for (int i = 0; i < hms.length; i++) { if (hms[i] != null) { endIndex = i; if (startIndex == -1) { startIndex = endIndex; } } else { // Replace nil value with 0. hms[i] = Integer.valueOf(0); } } // convert hours, minutes, seconds into milliseconds. long millis = (long) (((Math.floor(hms[0].doubleValue()) * 60.0 + Math.floor(hms[1].doubleValue())) * 60.0 + Math.floor(hms[2].doubleValue())) * 1000.0); Date d = new Date(millis); // if hour-minute-second if (startIndex == 0 && endIndex == 2) { return formatNumeric( d, numericFormatters.getHourMinuteSecond(), DateFormat.Field.SECOND, hms[endIndex], appendable); } // if minute-second if (startIndex == 1 && endIndex == 2) { return formatNumeric( d, numericFormatters.getMinuteSecond(), DateFormat.Field.SECOND, hms[endIndex], appendable); } // if hour-minute if (startIndex == 0 && endIndex == 1) { return formatNumeric( d, numericFormatters.getHourMinute(), DateFormat.Field.MINUTE, hms[endIndex], appendable); } throw new IllegalStateException(); }
class class_name[name] begin[{] method[formatNumeric, return_type[type[StringBuilder]], modifier[private], parameter[hms, appendable]] begin[{] local_variable[type[int], startIndex] local_variable[type[int], endIndex] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=hms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=endIndex, 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=hms, 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) local_variable[type[long], millis] local_variable[type[Date], d] if[binary_operation[binary_operation[member[.startIndex], ==, literal[0]], &&, binary_operation[member[.endIndex], ==, literal[2]]]] begin[{] return[call[.formatNumeric, parameter[member[.d], call[numericFormatters.getHourMinuteSecond, parameter[]], member[DateFormat.Field.SECOND], member[.hms], member[.appendable]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.startIndex], ==, literal[1]], &&, binary_operation[member[.endIndex], ==, literal[2]]]] begin[{] return[call[.formatNumeric, parameter[member[.d], call[numericFormatters.getMinuteSecond, parameter[]], member[DateFormat.Field.SECOND], member[.hms], member[.appendable]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.startIndex], ==, literal[0]], &&, binary_operation[member[.endIndex], ==, literal[1]]]] begin[{] return[call[.formatNumeric, parameter[member[.d], call[numericFormatters.getHourMinute, parameter[]], member[DateFormat.Field.MINUTE], member[.hms], member[.appendable]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] END[}]
Keyword[private] identifier[StringBuilder] identifier[formatNumeric] operator[SEP] identifier[Number] operator[SEP] operator[SEP] identifier[hms] , identifier[StringBuilder] identifier[appendable] operator[SEP] { Keyword[int] identifier[startIndex] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[endIndex] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[hms] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[hms] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[endIndex] operator[=] identifier[i] operator[SEP] Keyword[if] operator[SEP] identifier[startIndex] operator[==] operator[-] Other[1] operator[SEP] { identifier[startIndex] operator[=] identifier[endIndex] operator[SEP] } } Keyword[else] { identifier[hms] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] Other[0] operator[SEP] operator[SEP] } } Keyword[long] identifier[millis] operator[=] operator[SEP] Keyword[long] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[floor] operator[SEP] identifier[hms] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] operator[*] literal[Float] operator[+] identifier[Math] operator[SEP] identifier[floor] operator[SEP] identifier[hms] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[*] literal[Float] operator[+] identifier[Math] operator[SEP] identifier[floor] operator[SEP] identifier[hms] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[*] literal[Float] operator[SEP] operator[SEP] identifier[Date] identifier[d] operator[=] Keyword[new] identifier[Date] operator[SEP] identifier[millis] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startIndex] operator[==] Other[0] operator[&&] identifier[endIndex] operator[==] Other[2] operator[SEP] { Keyword[return] identifier[formatNumeric] operator[SEP] identifier[d] , identifier[numericFormatters] operator[SEP] identifier[getHourMinuteSecond] operator[SEP] operator[SEP] , identifier[DateFormat] operator[SEP] identifier[Field] operator[SEP] identifier[SECOND] , identifier[hms] operator[SEP] identifier[endIndex] operator[SEP] , identifier[appendable] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[startIndex] operator[==] Other[1] operator[&&] identifier[endIndex] operator[==] Other[2] operator[SEP] { Keyword[return] identifier[formatNumeric] operator[SEP] identifier[d] , identifier[numericFormatters] operator[SEP] identifier[getMinuteSecond] operator[SEP] operator[SEP] , identifier[DateFormat] operator[SEP] identifier[Field] operator[SEP] identifier[SECOND] , identifier[hms] operator[SEP] identifier[endIndex] operator[SEP] , identifier[appendable] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[startIndex] operator[==] Other[0] operator[&&] identifier[endIndex] operator[==] Other[1] operator[SEP] { Keyword[return] identifier[formatNumeric] operator[SEP] identifier[d] , identifier[numericFormatters] operator[SEP] identifier[getHourMinute] operator[SEP] operator[SEP] , identifier[DateFormat] operator[SEP] identifier[Field] operator[SEP] identifier[MINUTE] , identifier[hms] operator[SEP] identifier[endIndex] operator[SEP] , identifier[appendable] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP] }
public static String getHttpMethod(Span span) { if (isHttp(span)) { BinaryAnnotation ba = span.getBinaryAnnotation("http.method"); String httpMethod = null; if (ba != null) { httpMethod = ba.getValue().toUpperCase(); } else if (span.getName() != null) { httpMethod = span.getName().toUpperCase(); } if (HTTP_METHODS.contains(httpMethod)) { return httpMethod; } } return null; }
class class_name[name] begin[{] method[getHttpMethod, return_type[type[String]], modifier[public static], parameter[span]] begin[{] if[call[.isHttp, parameter[member[.span]]]] begin[{] local_variable[type[BinaryAnnotation], ba] local_variable[type[String], httpMethod] if[binary_operation[member[.ba], !=, literal[null]]] begin[{] assign[member[.httpMethod], call[ba.getValue, parameter[]]] else begin[{] if[binary_operation[call[span.getName, parameter[]], !=, literal[null]]] begin[{] assign[member[.httpMethod], call[span.getName, parameter[]]] else begin[{] None end[}] end[}] if[call[HTTP_METHODS.contains, parameter[member[.httpMethod]]]] begin[{] return[member[.httpMethod]] else begin[{] None end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getHttpMethod] operator[SEP] identifier[Span] identifier[span] operator[SEP] { Keyword[if] operator[SEP] identifier[isHttp] operator[SEP] identifier[span] operator[SEP] operator[SEP] { identifier[BinaryAnnotation] identifier[ba] operator[=] identifier[span] operator[SEP] identifier[getBinaryAnnotation] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[httpMethod] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ba] operator[!=] Other[null] operator[SEP] { identifier[httpMethod] operator[=] identifier[ba] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[span] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[httpMethod] operator[=] identifier[span] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[HTTP_METHODS] operator[SEP] identifier[contains] operator[SEP] identifier[httpMethod] operator[SEP] operator[SEP] { Keyword[return] identifier[httpMethod] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static FileStatus[] listStatus(FileSystem fs, Path f, int depth) throws IOException { if (null == f) { throw new IllegalArgumentException("Path cannot be null."); } if (null == fs) { throw new IllegalArgumentException("File system cannot be null."); } if (depth < 0) { throw new IllegalArgumentException("Depth cannot be negative."); } if (depth == 0) { FileStatus[] fileStatus = {fs.getFileStatus(f)}; return fileStatus; } List<FileStatus> fileStatuses = listStatusHelper(fs, f, depth, new ArrayList<FileStatus>()); return fileStatuses.toArray(new FileStatus[fileStatuses.size()]); }
class class_name[name] begin[{] method[listStatus, return_type[type[FileStatus]], modifier[public static], parameter[fs, f, depth]] begin[{] if[binary_operation[literal[null], ==, member[.f]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Path cannot be null.")], 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[literal[null], ==, member[.fs]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File system cannot be null.")], 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[member[.depth], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Depth cannot be negative.")], 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[member[.depth], ==, literal[0]]] begin[{] local_variable[type[FileStatus], fileStatus] return[member[.fileStatus]] else begin[{] None end[}] local_variable[type[List], fileStatuses] return[call[fileStatuses.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=fileStatuses, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileStatus, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[FileStatus] operator[SEP] operator[SEP] identifier[listStatus] operator[SEP] identifier[FileSystem] identifier[fs] , identifier[Path] identifier[f] , Keyword[int] identifier[depth] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[f] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Other[null] operator[==] identifier[fs] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[depth] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[depth] operator[==] Other[0] operator[SEP] { identifier[FileStatus] operator[SEP] operator[SEP] identifier[fileStatus] operator[=] { identifier[fs] operator[SEP] identifier[getFileStatus] operator[SEP] identifier[f] operator[SEP] } operator[SEP] Keyword[return] identifier[fileStatus] operator[SEP] } identifier[List] operator[<] identifier[FileStatus] operator[>] identifier[fileStatuses] operator[=] identifier[listStatusHelper] operator[SEP] identifier[fs] , identifier[f] , identifier[depth] , Keyword[new] identifier[ArrayList] operator[<] identifier[FileStatus] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[fileStatuses] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[FileStatus] operator[SEP] identifier[fileStatuses] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static boolean rewritePointObsDataset(String fileIn, String fileOut, boolean inMemory) throws IOException { System.out.println("Rewrite2 .nc files from " + fileIn + " to " + fileOut + " inMemory= " + inMemory); long start = System.currentTimeMillis(); // do it in memory for speed NetcdfFile ncfile = inMemory ? NetcdfFile.openInMemory(fileIn) : NetcdfFile.open(fileIn); NetcdfDataset ncd = new NetcdfDataset(ncfile); StringBuilder errlog = new StringBuilder(); PointObsDataset pobsDataset = (PointObsDataset) TypedDatasetFactory.open(FeatureType.POINT, ncd, null, errlog); if (pobsDataset == null) return false; writePointObsDataset(pobsDataset, fileOut); pobsDataset.close(); long took = System.currentTimeMillis() - start; System.out.println(" that took " + (took - start) + " msecs"); return true; }
class class_name[name] begin[{] method[rewritePointObsDataset, return_type[type[boolean]], modifier[public static], parameter[fileIn, fileOut, inMemory]] begin[{] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Rewrite2 .nc files from "], +, member[.fileIn]], +, literal[" to "]], +, member[.fileOut]], +, literal[" inMemory= "]], +, member[.inMemory]]]] local_variable[type[long], start] local_variable[type[NetcdfFile], ncfile] local_variable[type[NetcdfDataset], ncd] local_variable[type[StringBuilder], errlog] local_variable[type[PointObsDataset], pobsDataset] if[binary_operation[member[.pobsDataset], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] call[.writePointObsDataset, parameter[member[.pobsDataset], member[.fileOut]]] call[pobsDataset.close, parameter[]] local_variable[type[long], took] call[System.out.println, parameter[binary_operation[binary_operation[literal[" that took "], +, binary_operation[member[.took], -, member[.start]]], +, literal[" msecs"]]]] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[rewritePointObsDataset] operator[SEP] identifier[String] identifier[fileIn] , identifier[String] identifier[fileOut] , Keyword[boolean] identifier[inMemory] operator[SEP] Keyword[throws] identifier[IOException] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[fileIn] operator[+] literal[String] operator[+] identifier[fileOut] operator[+] literal[String] operator[+] identifier[inMemory] operator[SEP] operator[SEP] Keyword[long] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[NetcdfFile] identifier[ncfile] operator[=] identifier[inMemory] operator[?] identifier[NetcdfFile] operator[SEP] identifier[openInMemory] operator[SEP] identifier[fileIn] operator[SEP] operator[:] identifier[NetcdfFile] operator[SEP] identifier[open] operator[SEP] identifier[fileIn] operator[SEP] operator[SEP] identifier[NetcdfDataset] identifier[ncd] operator[=] Keyword[new] identifier[NetcdfDataset] operator[SEP] identifier[ncfile] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[errlog] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[PointObsDataset] identifier[pobsDataset] operator[=] operator[SEP] identifier[PointObsDataset] operator[SEP] identifier[TypedDatasetFactory] operator[SEP] identifier[open] operator[SEP] identifier[FeatureType] operator[SEP] identifier[POINT] , identifier[ncd] , Other[null] , identifier[errlog] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pobsDataset] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[writePointObsDataset] operator[SEP] identifier[pobsDataset] , identifier[fileOut] operator[SEP] operator[SEP] identifier[pobsDataset] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[took] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[start] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] operator[SEP] identifier[took] operator[-] identifier[start] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public static GJChronology getInstance( DateTimeZone zone, ReadableInstant gregorianCutover, int minDaysInFirstWeek) { zone = DateTimeUtils.getZone(zone); Instant cutoverInstant; if (gregorianCutover == null) { cutoverInstant = DEFAULT_CUTOVER; } else { cutoverInstant = gregorianCutover.toInstant(); LocalDate cutoverDate = new LocalDate(cutoverInstant.getMillis(), GregorianChronology.getInstance(zone)); if (cutoverDate.getYear() <= 0) { throw new IllegalArgumentException("Cutover too early. Must be on or after 0001-01-01."); } } GJCacheKey cacheKey = new GJCacheKey(zone, cutoverInstant, minDaysInFirstWeek); GJChronology chrono = cCache.get(cacheKey); if (chrono == null) { if (zone == DateTimeZone.UTC) { chrono = new GJChronology (JulianChronology.getInstance(zone, minDaysInFirstWeek), GregorianChronology.getInstance(zone, minDaysInFirstWeek), cutoverInstant); } else { chrono = getInstance(DateTimeZone.UTC, cutoverInstant, minDaysInFirstWeek); chrono = new GJChronology (ZonedChronology.getInstance(chrono, zone), chrono.iJulianChronology, chrono.iGregorianChronology, chrono.iCutoverInstant); } GJChronology oldChrono = cCache.putIfAbsent(cacheKey, chrono); if (oldChrono != null) { chrono = oldChrono; } } return chrono; }
class class_name[name] begin[{] method[getInstance, return_type[type[GJChronology]], modifier[public static], parameter[zone, gregorianCutover, minDaysInFirstWeek]] begin[{] assign[member[.zone], call[DateTimeUtils.getZone, parameter[member[.zone]]]] local_variable[type[Instant], cutoverInstant] if[binary_operation[member[.gregorianCutover], ==, literal[null]]] begin[{] assign[member[.cutoverInstant], member[.DEFAULT_CUTOVER]] else begin[{] assign[member[.cutoverInstant], call[gregorianCutover.toInstant, parameter[]]] local_variable[type[LocalDate], cutoverDate] if[binary_operation[call[cutoverDate.getYear, parameter[]], <=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cutover too early. Must be on or after 0001-01-01.")], 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[}] end[}] local_variable[type[GJCacheKey], cacheKey] local_variable[type[GJChronology], chrono] if[binary_operation[member[.chrono], ==, literal[null]]] begin[{] if[binary_operation[member[.zone], ==, member[DateTimeZone.UTC]]] begin[{] assign[member[.chrono], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=zone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=minDaysInFirstWeek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=JulianChronology, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=zone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=minDaysInFirstWeek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=GregorianChronology, selectors=[], type_arguments=None), MemberReference(member=cutoverInstant, 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=GJChronology, sub_type=None))] else begin[{] assign[member[.chrono], call[.getInstance, parameter[member[DateTimeZone.UTC], member[.cutoverInstant], member[.minDaysInFirstWeek]]]] assign[member[.chrono], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=chrono, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=zone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=ZonedChronology, selectors=[], type_arguments=None), MemberReference(member=iJulianChronology, postfix_operators=[], prefix_operators=[], qualifier=chrono, selectors=[]), MemberReference(member=iGregorianChronology, postfix_operators=[], prefix_operators=[], qualifier=chrono, selectors=[]), MemberReference(member=iCutoverInstant, postfix_operators=[], prefix_operators=[], qualifier=chrono, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GJChronology, sub_type=None))] end[}] local_variable[type[GJChronology], oldChrono] if[binary_operation[member[.oldChrono], !=, literal[null]]] begin[{] assign[member[.chrono], member[.oldChrono]] else begin[{] None end[}] else begin[{] None end[}] return[member[.chrono]] end[}] END[}]
Keyword[public] Keyword[static] identifier[GJChronology] identifier[getInstance] operator[SEP] identifier[DateTimeZone] identifier[zone] , identifier[ReadableInstant] identifier[gregorianCutover] , Keyword[int] identifier[minDaysInFirstWeek] operator[SEP] { identifier[zone] operator[=] identifier[DateTimeUtils] operator[SEP] identifier[getZone] operator[SEP] identifier[zone] operator[SEP] operator[SEP] identifier[Instant] identifier[cutoverInstant] operator[SEP] Keyword[if] operator[SEP] identifier[gregorianCutover] operator[==] Other[null] operator[SEP] { identifier[cutoverInstant] operator[=] identifier[DEFAULT_CUTOVER] operator[SEP] } Keyword[else] { identifier[cutoverInstant] operator[=] identifier[gregorianCutover] operator[SEP] identifier[toInstant] operator[SEP] operator[SEP] operator[SEP] identifier[LocalDate] identifier[cutoverDate] operator[=] Keyword[new] identifier[LocalDate] operator[SEP] identifier[cutoverInstant] operator[SEP] identifier[getMillis] operator[SEP] operator[SEP] , identifier[GregorianChronology] operator[SEP] identifier[getInstance] operator[SEP] identifier[zone] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cutoverDate] operator[SEP] identifier[getYear] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[GJCacheKey] identifier[cacheKey] operator[=] Keyword[new] identifier[GJCacheKey] operator[SEP] identifier[zone] , identifier[cutoverInstant] , identifier[minDaysInFirstWeek] operator[SEP] operator[SEP] identifier[GJChronology] identifier[chrono] operator[=] identifier[cCache] operator[SEP] identifier[get] operator[SEP] identifier[cacheKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[chrono] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[zone] operator[==] identifier[DateTimeZone] operator[SEP] identifier[UTC] operator[SEP] { identifier[chrono] operator[=] Keyword[new] identifier[GJChronology] operator[SEP] identifier[JulianChronology] operator[SEP] identifier[getInstance] operator[SEP] identifier[zone] , identifier[minDaysInFirstWeek] operator[SEP] , identifier[GregorianChronology] operator[SEP] identifier[getInstance] operator[SEP] identifier[zone] , identifier[minDaysInFirstWeek] operator[SEP] , identifier[cutoverInstant] operator[SEP] operator[SEP] } Keyword[else] { identifier[chrono] operator[=] identifier[getInstance] operator[SEP] identifier[DateTimeZone] operator[SEP] identifier[UTC] , identifier[cutoverInstant] , identifier[minDaysInFirstWeek] operator[SEP] operator[SEP] identifier[chrono] operator[=] Keyword[new] identifier[GJChronology] operator[SEP] identifier[ZonedChronology] operator[SEP] identifier[getInstance] operator[SEP] identifier[chrono] , identifier[zone] operator[SEP] , identifier[chrono] operator[SEP] identifier[iJulianChronology] , identifier[chrono] operator[SEP] identifier[iGregorianChronology] , identifier[chrono] operator[SEP] identifier[iCutoverInstant] operator[SEP] operator[SEP] } identifier[GJChronology] identifier[oldChrono] operator[=] identifier[cCache] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[cacheKey] , identifier[chrono] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldChrono] operator[!=] Other[null] operator[SEP] { identifier[chrono] operator[=] identifier[oldChrono] operator[SEP] } } Keyword[return] identifier[chrono] operator[SEP] }
public com.google.api.Logging.LoggingDestinationOrBuilder getProducerDestinationsOrBuilder( int index) { return producerDestinations_.get(index); }
class class_name[name] begin[{] method[getProducerDestinationsOrBuilder, return_type[type[com]], modifier[public], parameter[index]] begin[{] return[call[producerDestinations_.get, parameter[member[.index]]]] end[}] END[}]
Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[Logging] operator[SEP] identifier[LoggingDestinationOrBuilder] identifier[getProducerDestinationsOrBuilder] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[return] identifier[producerDestinations_] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] }
private void disconnect(final Handler<AsyncResult<Void>> doneHandler) { eventBus.sendWithTimeout(inAddress, new JsonObject().putString("action", "disconnect"), 5000, new Handler<AsyncResult<Message<Boolean>>>() { @Override public void handle(AsyncResult<Message<Boolean>> result) { if (result.failed()) { ReplyException failure = (ReplyException) result.cause(); if (failure.failureType().equals(ReplyFailure.RECIPIENT_FAILURE)) { log.warn(String.format("%s - Failed to disconnect from %s", DefaultOutputConnection.this, context.target()), result.cause()); new DefaultFutureResult<Void>(failure).setHandler(doneHandler); } else if (failure.failureType().equals(ReplyFailure.NO_HANDLERS)) { log.info(String.format("%s - Disconnected from %s", DefaultOutputConnection.this, context.target())); new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler); } else { log.debug(String.format("%s - Disconnection from %s failed, retrying", DefaultOutputConnection.this, context.target())); disconnect(doneHandler); } } else if (result.result().body()) { log.info(String.format("%s - Disconnected from %s", DefaultOutputConnection.this, context.target())); open = false; new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler); } else { log.debug(String.format("%s - Disconnection from %s failed, retrying", DefaultOutputConnection.this, context.target())); vertx.setTimer(500, new Handler<Long>() { @Override public void handle(Long timerID) { disconnect(doneHandler); } }); } } }); }
class class_name[name] begin[{] method[disconnect, return_type[void], modifier[private], parameter[doneHandler]] begin[{] call[eventBus.sendWithTimeout, parameter[member[.inAddress], 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="action"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="disconnect")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None)), literal[5000], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=MethodInvocation(arguments=[], member=failed, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=result, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[], member=body, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s - Disconnection from %s failed, retrying"), This(postfix_operators=[], prefix_operators=[], qualifier=DefaultOutputConnection, selectors=[]), MethodInvocation(arguments=[], member=target, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=500), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=doneHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=timerID, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=None, name=Handler, sub_type=None))], member=setTimer, postfix_operators=[], prefix_operators=[], qualifier=vertx, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s - Disconnected from %s"), This(postfix_operators=[], prefix_operators=[], qualifier=DefaultOutputConnection, selectors=[]), MethodInvocation(arguments=[], member=target, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=ClassCreator(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=doneHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHandler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=DefaultFutureResult, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=cause, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ReplyException, sub_type=None)), name=failure)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ReplyException, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=failureType, postfix_operators=[], prefix_operators=[], qualifier=failure, selectors=[MethodInvocation(arguments=[MemberReference(member=RECIPIENT_FAILURE, postfix_operators=[], prefix_operators=[], qualifier=ReplyFailure, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=failureType, postfix_operators=[], prefix_operators=[], qualifier=failure, selectors=[MethodInvocation(arguments=[MemberReference(member=NO_HANDLERS, postfix_operators=[], prefix_operators=[], qualifier=ReplyFailure, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s - Disconnection from %s failed, retrying"), This(postfix_operators=[], prefix_operators=[], qualifier=DefaultOutputConnection, selectors=[]), MethodInvocation(arguments=[], member=target, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=doneHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s - Disconnected from %s"), This(postfix_operators=[], prefix_operators=[], qualifier=DefaultOutputConnection, selectors=[]), MethodInvocation(arguments=[], member=target, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=ClassCreator(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=doneHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHandler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=DefaultFutureResult, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s - Failed to disconnect from %s"), This(postfix_operators=[], prefix_operators=[], qualifier=DefaultOutputConnection, selectors=[]), MethodInvocation(arguments=[], member=target, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=cause, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=ClassCreator(arguments=[MemberReference(member=failure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=doneHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHandler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=DefaultFutureResult, sub_type=None)), label=None)]))]))], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=[], name=Message, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=[], name=Message, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None))], dimensions=None, name=Handler, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[disconnect] operator[SEP] Keyword[final] identifier[Handler] operator[<] identifier[AsyncResult] operator[<] identifier[Void] operator[>] operator[>] identifier[doneHandler] operator[SEP] { identifier[eventBus] operator[SEP] identifier[sendWithTimeout] operator[SEP] identifier[inAddress] , Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] , Other[5000] , Keyword[new] identifier[Handler] operator[<] identifier[AsyncResult] operator[<] identifier[Message] operator[<] identifier[Boolean] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[AsyncResult] operator[<] identifier[Message] operator[<] identifier[Boolean] operator[>] operator[>] identifier[result] operator[SEP] { Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[failed] operator[SEP] operator[SEP] operator[SEP] { identifier[ReplyException] identifier[failure] operator[=] operator[SEP] identifier[ReplyException] operator[SEP] identifier[result] operator[SEP] identifier[cause] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[failure] operator[SEP] identifier[failureType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ReplyFailure] operator[SEP] identifier[RECIPIENT_FAILURE] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[DefaultOutputConnection] operator[SEP] Keyword[this] , identifier[context] operator[SEP] identifier[target] operator[SEP] operator[SEP] operator[SEP] , identifier[result] operator[SEP] identifier[cause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[DefaultFutureResult] operator[<] identifier[Void] operator[>] operator[SEP] identifier[failure] operator[SEP] operator[SEP] identifier[setHandler] operator[SEP] identifier[doneHandler] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[failure] operator[SEP] identifier[failureType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ReplyFailure] operator[SEP] identifier[NO_HANDLERS] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[DefaultOutputConnection] operator[SEP] Keyword[this] , identifier[context] operator[SEP] identifier[target] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[DefaultFutureResult] operator[<] identifier[Void] operator[>] operator[SEP] operator[SEP] identifier[Void] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[setHandler] operator[SEP] identifier[doneHandler] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[DefaultOutputConnection] operator[SEP] Keyword[this] , identifier[context] operator[SEP] identifier[target] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[disconnect] operator[SEP] identifier[doneHandler] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[DefaultOutputConnection] operator[SEP] Keyword[this] , identifier[context] operator[SEP] identifier[target] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[open] operator[=] literal[boolean] operator[SEP] Keyword[new] identifier[DefaultFutureResult] operator[<] identifier[Void] operator[>] operator[SEP] operator[SEP] identifier[Void] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[setHandler] operator[SEP] identifier[doneHandler] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[DefaultOutputConnection] operator[SEP] Keyword[this] , identifier[context] operator[SEP] identifier[target] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[vertx] operator[SEP] identifier[setTimer] operator[SEP] Other[500] , Keyword[new] identifier[Handler] operator[<] identifier[Long] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[Long] identifier[timerID] operator[SEP] { identifier[disconnect] operator[SEP] identifier[doneHandler] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public void setInput(long seed, final double[] data) { // Log.info("Data: " + ArrayUtils.toString(data)); assert(_dinfo != null); double [] nums = MemoryManager.malloc8d(_dinfo._nums); // a bit wasteful - reallocated each time int [] cats = MemoryManager.malloc4(_dinfo._cats); // a bit wasteful - reallocated each time int i = 0, ncats = 0; for(; i < _dinfo._cats; ++i){ // This can occur when testing data has categorical levels that are not part of training (or if there's a missing value) if (Double.isNaN(data[i])) { if (_dinfo._catMissing[i]!=0) cats[ncats++] = (_dinfo._catOffsets[i+1]-1); //use the extra level made during training else { if (!_dinfo._useAllFactorLevels) throw new IllegalArgumentException("Model was built without missing categorical factors in column " + _dinfo.coefNames()[i] + ", but found unknown (or missing) categorical factors during scoring." + "\nThe model needs to be built with use_all_factor_levels=true for this to work."); // else just leave all activations at 0, and since all factor levels were enabled, // this is OK (missing or new categorical doesn't activate any levels seen during training) } } else { int c = (int)data[i]; if (_dinfo._useAllFactorLevels) cats[ncats++] = c + _dinfo._catOffsets[i]; else if (c!=0) cats[ncats++] = c + _dinfo._catOffsets[i] - 1; } } final int n = data.length; // data contains only input features - no response is included for(;i < n;++i){ double d = data[i]; if(_dinfo._normMul != null) d = (d - _dinfo._normSub[i-_dinfo._cats])*_dinfo._normMul[i-_dinfo._cats]; nums[i-_dinfo._cats] = d; //can be NaN for missing numerical data } setInput(seed, nums, ncats, cats); }
class class_name[name] begin[{] method[setInput, return_type[void], modifier[public], parameter[seed, data]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=_dinfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) local_variable[type[double], nums] local_variable[type[int], cats] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=isNaN, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=int)), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MemberReference(member=_useAllFactorLevels, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[]), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, 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=Assignment(expressionl=MemberReference(member=cats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ncats, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_catOffsets, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=cats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ncats, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_catOffsets, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)), label=None))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_catMissing, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=_useAllFactorLevels, postfix_operators=[], prefix_operators=['!'], qualifier=_dinfo, selectors=[]), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Model was built without missing categorical factors in column "), operandr=MethodInvocation(arguments=[], member=coefNames, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", but found unknown (or missing) categorical factors during scoring."), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nThe model needs to be built with use_all_factor_levels=true for this to work."), 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))]), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=cats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ncats, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=_catOffsets, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), label=None))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_cats, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[]), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[int], n] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=d)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=_normMul, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_normSub, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_cats, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[]), operator=-))]), operator=-), operandr=MemberReference(member=_normMul, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_cats, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[]), operator=-))]), operator=*)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nums, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_cats, postfix_operators=[], prefix_operators=[], qualifier=_dinfo, selectors=[]), operator=-))]), type==, value=MemberReference(member=d, 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=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) call[.setInput, parameter[member[.seed], member[.nums], member[.ncats], member[.cats]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setInput] operator[SEP] Keyword[long] identifier[seed] , Keyword[final] Keyword[double] operator[SEP] operator[SEP] identifier[data] operator[SEP] { Keyword[assert] operator[SEP] identifier[_dinfo] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[nums] operator[=] identifier[MemoryManager] operator[SEP] identifier[malloc8d] operator[SEP] identifier[_dinfo] operator[SEP] identifier[_nums] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[cats] operator[=] identifier[MemoryManager] operator[SEP] identifier[malloc4] operator[SEP] identifier[_dinfo] operator[SEP] identifier[_cats] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[ncats] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[_dinfo] operator[SEP] identifier[_cats] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[_dinfo] operator[SEP] identifier[_catMissing] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[cats] operator[SEP] identifier[ncats] operator[++] operator[SEP] operator[=] operator[SEP] identifier[_dinfo] operator[SEP] identifier[_catOffsets] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[_dinfo] operator[SEP] identifier[_useAllFactorLevels] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[_dinfo] operator[SEP] identifier[coefNames] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[int] identifier[c] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_dinfo] operator[SEP] identifier[_useAllFactorLevels] operator[SEP] identifier[cats] operator[SEP] identifier[ncats] operator[++] operator[SEP] operator[=] identifier[c] operator[+] identifier[_dinfo] operator[SEP] identifier[_catOffsets] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[!=] Other[0] operator[SEP] identifier[cats] operator[SEP] identifier[ncats] operator[++] operator[SEP] operator[=] identifier[c] operator[+] identifier[_dinfo] operator[SEP] identifier[_catOffsets] operator[SEP] identifier[i] operator[SEP] operator[-] Other[1] operator[SEP] } } Keyword[final] Keyword[int] identifier[n] operator[=] identifier[data] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[double] identifier[d] operator[=] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_dinfo] operator[SEP] identifier[_normMul] operator[!=] Other[null] operator[SEP] identifier[d] operator[=] operator[SEP] identifier[d] operator[-] identifier[_dinfo] operator[SEP] identifier[_normSub] operator[SEP] identifier[i] operator[-] identifier[_dinfo] operator[SEP] identifier[_cats] operator[SEP] operator[SEP] operator[*] identifier[_dinfo] operator[SEP] identifier[_normMul] operator[SEP] identifier[i] operator[-] identifier[_dinfo] operator[SEP] identifier[_cats] operator[SEP] operator[SEP] identifier[nums] operator[SEP] identifier[i] operator[-] identifier[_dinfo] operator[SEP] identifier[_cats] operator[SEP] operator[=] identifier[d] operator[SEP] } identifier[setInput] operator[SEP] identifier[seed] , identifier[nums] , identifier[ncats] , identifier[cats] operator[SEP] operator[SEP] }
public boolean waitForCondition(Condition condition, final int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForCondition("+condition+","+timeout+")"); } return waiter.waitForCondition(condition, timeout); }
class class_name[name] begin[{] method[waitForCondition, return_type[type[boolean]], modifier[public], parameter[condition, timeout]] begin[{] if[member[config.commandLogging]] begin[{] call[Log.d, parameter[member[config.commandLoggingTag], binary_operation[binary_operation[binary_operation[binary_operation[literal["waitForCondition("], +, member[.condition]], +, literal[","]], +, member[.timeout]], +, literal[")"]]]] else begin[{] None end[}] return[call[waiter.waitForCondition, parameter[member[.condition], member[.timeout]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[waitForCondition] operator[SEP] identifier[Condition] identifier[condition] , Keyword[final] Keyword[int] identifier[timeout] operator[SEP] { Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[commandLogging] operator[SEP] { identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[config] operator[SEP] identifier[commandLoggingTag] , literal[String] operator[+] identifier[condition] operator[+] literal[String] operator[+] identifier[timeout] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[waiter] operator[SEP] identifier[waitForCondition] operator[SEP] identifier[condition] , identifier[timeout] operator[SEP] operator[SEP] }
@Override protected Widget createChild(final GVRContext context, GVRSceneObject sceneObjectChild) throws InstantiationException { return super.createChild(context, sceneObjectChild); }
class class_name[name] begin[{] method[createChild, return_type[type[Widget]], modifier[protected], parameter[context, sceneObjectChild]] begin[{] return[SuperMethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sceneObjectChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createChild, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Widget] identifier[createChild] operator[SEP] Keyword[final] identifier[GVRContext] identifier[context] , identifier[GVRSceneObject] identifier[sceneObjectChild] operator[SEP] Keyword[throws] identifier[InstantiationException] { Keyword[return] Keyword[super] operator[SEP] identifier[createChild] operator[SEP] identifier[context] , identifier[sceneObjectChild] operator[SEP] operator[SEP] }
private void initialize(final Reader xmlFileStream) { // Build a DOM model. final Document parsedDocument = XsdGeneratorHelper.parseXmlStream(xmlFileStream); // Process the DOM model. XsdGeneratorHelper.process(parsedDocument.getFirstChild(), true, new NamespaceAttributeNodeProcessor()); }
class class_name[name] begin[{] method[initialize, return_type[void], modifier[private], parameter[xmlFileStream]] begin[{] local_variable[type[Document], parsedDocument] call[XsdGeneratorHelper.process, parameter[call[parsedDocument.getFirstChild, parameter[]], literal[true], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NamespaceAttributeNodeProcessor, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[initialize] operator[SEP] Keyword[final] identifier[Reader] identifier[xmlFileStream] operator[SEP] { Keyword[final] identifier[Document] identifier[parsedDocument] operator[=] identifier[XsdGeneratorHelper] operator[SEP] identifier[parseXmlStream] operator[SEP] identifier[xmlFileStream] operator[SEP] operator[SEP] identifier[XsdGeneratorHelper] operator[SEP] identifier[process] operator[SEP] identifier[parsedDocument] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] , literal[boolean] , Keyword[new] identifier[NamespaceAttributeNodeProcessor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void copyFromFileToFile(File source, File dest) throws IOException{ try { FileInputStream in = new FileInputStream(source); FileOutputStream out = new FileOutputStream(dest); try { FileChannel canalFuente = in.getChannel(); FileChannel canalDestino = out.getChannel(); canalFuente.transferTo(0, canalFuente.size(), canalDestino); } catch (IOException e) { throw new IOException("copiando ficheros orig:'" + source.getAbsolutePath() + "' destino:'" + dest.getAbsolutePath() + "'", e); } finally { IOUtils.closeQuietly(in); IOUtils.closeQuietly(out); // try { // in.close(); // } catch (IOException e) { // } // try { // out.close(); // } catch (IOException e) { // } } } catch (FileNotFoundException e) { throw new IOException("copiando ficheros orig:'" + source.getAbsolutePath() + "' destino:'" + dest.getAbsolutePath() + "'", e); } }
class class_name[name] begin[{] method[copyFromFileToFile, return_type[void], modifier[public static], parameter[source, dest]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)), name=in)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None)), name=out)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), name=canalFuente)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileChannel, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), name=canalDestino)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileChannel, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=canalFuente, selectors=[], type_arguments=None), MemberReference(member=canalDestino, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transferTo, postfix_operators=[], prefix_operators=[], qualifier=canalFuente, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="copiando ficheros orig:'"), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' destino:'"), operator=+), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=dest, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="copiando ficheros orig:'"), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' destino:'"), operator=+), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=dest, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[copyFromFileToFile] operator[SEP] identifier[File] identifier[source] , identifier[File] identifier[dest] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { identifier[FileInputStream] identifier[in] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[FileOutputStream] identifier[out] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[dest] operator[SEP] operator[SEP] Keyword[try] { identifier[FileChannel] identifier[canalFuente] operator[=] identifier[in] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] identifier[FileChannel] identifier[canalDestino] operator[=] identifier[out] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] identifier[canalFuente] operator[SEP] identifier[transferTo] operator[SEP] Other[0] , identifier[canalFuente] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[canalDestino] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[source] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[dest] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[in] operator[SEP] operator[SEP] identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[out] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[source] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[dest] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public Object getAttribute(String key, Object defaultValue) { Object attributeValue = getUserAttribute(key, null); if (attributeValue != null) return attributeValue; attributeValue = getSessionAttribute(key, null); if (attributeValue != null) return attributeValue; return defaultValue; }
class class_name[name] begin[{] method[getAttribute, return_type[type[Object]], modifier[public], parameter[key, defaultValue]] begin[{] local_variable[type[Object], attributeValue] if[binary_operation[member[.attributeValue], !=, literal[null]]] begin[{] return[member[.attributeValue]] else begin[{] None end[}] assign[member[.attributeValue], call[.getSessionAttribute, parameter[member[.key], literal[null]]]] if[binary_operation[member[.attributeValue], !=, literal[null]]] begin[{] return[member[.attributeValue]] else begin[{] None end[}] return[member[.defaultValue]] end[}] END[}]
Keyword[public] identifier[Object] identifier[getAttribute] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[defaultValue] operator[SEP] { identifier[Object] identifier[attributeValue] operator[=] identifier[getUserAttribute] operator[SEP] identifier[key] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attributeValue] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[attributeValue] operator[SEP] identifier[attributeValue] operator[=] identifier[getSessionAttribute] operator[SEP] identifier[key] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attributeValue] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[attributeValue] operator[SEP] Keyword[return] identifier[defaultValue] operator[SEP] }
public ProviderEndPoint getEndPoint() { if (mode != PropertiesType.HOST_PORT) { throw new SIErrorException( nls.getFormattedMessage("INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006", null, "INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006") // D270373 ); } return endPoint; }
class class_name[name] begin[{] method[getEndPoint, return_type[type[ProviderEndPoint]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.mode], !=, member[PropertiesType.HOST_PORT]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006")], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIErrorException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.endPoint]] end[}] END[}]
Keyword[public] identifier[ProviderEndPoint] identifier[getEndPoint] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[mode] operator[!=] identifier[PropertiesType] operator[SEP] identifier[HOST_PORT] operator[SEP] { Keyword[throw] Keyword[new] identifier[SIErrorException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Other[null] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[endPoint] operator[SEP] }
private void addTileCollisions(MapTileCollision mapCollision, TileCollision tileCollision, Tile tile) { final TileRef ref = new TileRef(tile); for (final CollisionGroup collision : mapCollision.getCollisionGroups()) { final Collection<TileRef> group = mapGroup.getGroup(collision.getName()); if (group.contains(ref)) { for (final CollisionFormula formula : collision.getFormulas()) { tileCollision.addCollisionFormula(formula); } } } }
class class_name[name] begin[{] method[addTileCollisions, return_type[void], modifier[private], parameter[mapCollision, tileCollision, tile]] begin[{] local_variable[type[TileRef], ref] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=collision, selectors=[], type_arguments=None)], member=getGroup, postfix_operators=[], prefix_operators=[], qualifier=mapGroup, selectors=[], type_arguments=None), name=group)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TileRef, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=group, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=formula, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addCollisionFormula, postfix_operators=[], prefix_operators=[], qualifier=tileCollision, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getFormulas, postfix_operators=[], prefix_operators=[], qualifier=collision, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=formula)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=CollisionFormula, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCollisionGroups, postfix_operators=[], prefix_operators=[], qualifier=mapCollision, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=collision)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=CollisionGroup, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[addTileCollisions] operator[SEP] identifier[MapTileCollision] identifier[mapCollision] , identifier[TileCollision] identifier[tileCollision] , identifier[Tile] identifier[tile] operator[SEP] { Keyword[final] identifier[TileRef] identifier[ref] operator[=] Keyword[new] identifier[TileRef] operator[SEP] identifier[tile] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[CollisionGroup] identifier[collision] operator[:] identifier[mapCollision] operator[SEP] identifier[getCollisionGroups] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[Collection] operator[<] identifier[TileRef] operator[>] identifier[group] operator[=] identifier[mapGroup] operator[SEP] identifier[getGroup] operator[SEP] identifier[collision] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[group] operator[SEP] identifier[contains] operator[SEP] identifier[ref] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[CollisionFormula] identifier[formula] operator[:] identifier[collision] operator[SEP] identifier[getFormulas] operator[SEP] operator[SEP] operator[SEP] { identifier[tileCollision] operator[SEP] identifier[addCollisionFormula] operator[SEP] identifier[formula] operator[SEP] operator[SEP] } } } }
public DescribeMatchmakingConfigurationsResult withConfigurations(MatchmakingConfiguration... configurations) { if (this.configurations == null) { setConfigurations(new java.util.ArrayList<MatchmakingConfiguration>(configurations.length)); } for (MatchmakingConfiguration ele : configurations) { this.configurations.add(ele); } return this; }
class class_name[name] begin[{] method[withConfigurations, return_type[type[DescribeMatchmakingConfigurationsResult]], modifier[public], parameter[configurations]] begin[{] if[binary_operation[THIS[member[None.configurations]], ==, literal[null]]] begin[{] call[.setConfigurations, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=configurations, 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=MatchmakingConfiguration, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=configurations, 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=configurations, 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=MatchmakingConfiguration, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DescribeMatchmakingConfigurationsResult] identifier[withConfigurations] operator[SEP] identifier[MatchmakingConfiguration] operator[...] identifier[configurations] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[configurations] operator[==] Other[null] operator[SEP] { identifier[setConfigurations] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[MatchmakingConfiguration] operator[>] operator[SEP] identifier[configurations] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[MatchmakingConfiguration] identifier[ele] operator[:] identifier[configurations] operator[SEP] { Keyword[this] operator[SEP] identifier[configurations] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private boolean doVisitChildren(VisitContext context, boolean visitRows) { // Just need to check whether there are any ids under this // subtree. Make sure row index is cleared out since // getSubtreeIdsToVisit() needs our row-less client id. if (visitRows) { setRowIndex(-1); } Collection<String> idsToVisit = context.getSubtreeIdsToVisit(this); assert(idsToVisit != null); // All ids or non-empty collection means we need to visit our children. return (!idsToVisit.isEmpty()); }
class class_name[name] begin[{] method[doVisitChildren, return_type[type[boolean]], modifier[private], parameter[context, visitRows]] begin[{] if[member[.visitRows]] begin[{] call[.setRowIndex, parameter[literal[1]]] else begin[{] None end[}] local_variable[type[Collection], idsToVisit] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=idsToVisit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) return[call[idsToVisit.isEmpty, parameter[]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[doVisitChildren] operator[SEP] identifier[VisitContext] identifier[context] , Keyword[boolean] identifier[visitRows] operator[SEP] { Keyword[if] operator[SEP] identifier[visitRows] operator[SEP] { identifier[setRowIndex] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } identifier[Collection] operator[<] identifier[String] operator[>] identifier[idsToVisit] operator[=] identifier[context] operator[SEP] identifier[getSubtreeIdsToVisit] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[idsToVisit] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[!] identifier[idsToVisit] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected E getSelectedEnumFromRadioButtons() { for (final E enumValue : this.radioButtonMap.keySet()) { final JRadioButton btn = this.radioButtonMap.get(enumValue); if (btn.isSelected()) { return enumValue; } } return null; }
class class_name[name] begin[{] method[getSelectedEnumFromRadioButtons, return_type[type[E]], modifier[protected], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=radioButtonMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=enumValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=btn)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=JRadioButton, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isSelected, postfix_operators=[], prefix_operators=[], qualifier=btn, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=enumValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=radioButtonMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=enumValue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[protected] identifier[E] identifier[getSelectedEnumFromRadioButtons] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[E] identifier[enumValue] operator[:] Keyword[this] operator[SEP] identifier[radioButtonMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[JRadioButton] identifier[btn] operator[=] Keyword[this] operator[SEP] identifier[radioButtonMap] operator[SEP] identifier[get] operator[SEP] identifier[enumValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[btn] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[enumValue] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "SphericalCS", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "_CoordinateSystem") public JAXBElement<SphericalCSType> createSphericalCS(SphericalCSType value) { return new JAXBElement<SphericalCSType>(_SphericalCS_QNAME, SphericalCSType.class, null, value); }
class class_name[name] begin[{] method[createSphericalCS, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_SphericalCS_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SphericalCSType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, 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=SphericalCSType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[substitutionHeadNamespace] operator[=] literal[String] , identifier[substitutionHeadName] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[SphericalCSType] operator[>] identifier[createSphericalCS] operator[SEP] identifier[SphericalCSType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[SphericalCSType] operator[>] operator[SEP] identifier[_SphericalCS_QNAME] , identifier[SphericalCSType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
@Override public void renewToken() { CreateTokenRequest createTokenRequest = new CreateTokenRequest(); createTokenRequest.setUser(credentials.getUserName()); createTokenRequest.setPassword(credentials.getPassword()); CreateTokenResponse createTokenResponse; try { createTokenResponse = send(createTokenRequest); } catch (ValidationConstraintViolationException vcve) { throw new AuthorizationException(vcve); } HttpStatus status = HttpStatus.getStatus(createTokenResponse.getStatusCode()); if (status.isError()) { if (status.equals(HttpStatus.Unauthorized)) { throw new AuthorizationException(HttpStatus.Unauthorized.toString()); } else { throw new CommunicationErrorException(status); } } String newToken = createTokenResponse.getToken(); tokenStore.setToken(newToken); }
class class_name[name] begin[{] method[renewToken, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[CreateTokenRequest], createTokenRequest] call[createTokenRequest.setUser, parameter[call[credentials.getUserName, parameter[]]]] call[createTokenRequest.setPassword, parameter[call[credentials.getPassword, parameter[]]]] local_variable[type[CreateTokenResponse], createTokenResponse] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=createTokenResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=createTokenRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=send, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=vcve, 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=AuthorizationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=vcve, types=['ValidationConstraintViolationException']))], finally_block=None, label=None, resources=None) local_variable[type[HttpStatus], status] if[call[status.isError, parameter[]]] begin[{] if[call[status.equals, parameter[member[HttpStatus.Unauthorized]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=HttpStatus.Unauthorized, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthorizationException, sub_type=None)), label=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=status, 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=CommunicationErrorException, sub_type=None)), label=None) end[}] else begin[{] None end[}] local_variable[type[String], newToken] call[tokenStore.setToken, parameter[member[.newToken]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[renewToken] operator[SEP] operator[SEP] { identifier[CreateTokenRequest] identifier[createTokenRequest] operator[=] Keyword[new] identifier[CreateTokenRequest] operator[SEP] operator[SEP] operator[SEP] identifier[createTokenRequest] operator[SEP] identifier[setUser] operator[SEP] identifier[credentials] operator[SEP] identifier[getUserName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[createTokenRequest] operator[SEP] identifier[setPassword] operator[SEP] identifier[credentials] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CreateTokenResponse] identifier[createTokenResponse] operator[SEP] Keyword[try] { identifier[createTokenResponse] operator[=] identifier[send] operator[SEP] identifier[createTokenRequest] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ValidationConstraintViolationException] identifier[vcve] operator[SEP] { Keyword[throw] Keyword[new] identifier[AuthorizationException] operator[SEP] identifier[vcve] operator[SEP] operator[SEP] } identifier[HttpStatus] identifier[status] operator[=] identifier[HttpStatus] operator[SEP] identifier[getStatus] operator[SEP] identifier[createTokenResponse] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[status] operator[SEP] identifier[isError] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[status] operator[SEP] identifier[equals] operator[SEP] identifier[HttpStatus] operator[SEP] identifier[Unauthorized] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[AuthorizationException] operator[SEP] identifier[HttpStatus] operator[SEP] identifier[Unauthorized] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[CommunicationErrorException] operator[SEP] identifier[status] operator[SEP] operator[SEP] } } identifier[String] identifier[newToken] operator[=] identifier[createTokenResponse] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] identifier[tokenStore] operator[SEP] identifier[setToken] operator[SEP] identifier[newToken] operator[SEP] operator[SEP] }
void writeBootstrapMethods() { int alenIdx = writeAttr(names.BootstrapMethods); databuf.appendChar(bootstrapMethods.size()); for (Map.Entry<DynamicMethod, MethodHandle> entry : bootstrapMethods.entrySet()) { DynamicMethod dmeth = entry.getKey(); DynamicMethodSymbol dsym = (DynamicMethodSymbol)dmeth.baseSymbol(); //write BSM handle databuf.appendChar(pool.get(entry.getValue())); //write static args length databuf.appendChar(dsym.staticArgs.length); //write static args array Object[] uniqueArgs = dmeth.uniqueStaticArgs; for (Object o : uniqueArgs) { databuf.appendChar(pool.get(o)); } } endAttr(alenIdx); }
class class_name[name] begin[{] method[writeBootstrapMethods, return_type[void], modifier[default], parameter[]] begin[{] local_variable[type[int], alenIdx] call[databuf.appendChar, parameter[call[bootstrapMethods.size, parameter[]]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=dmeth)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DynamicMethod, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=baseSymbol, postfix_operators=[], prefix_operators=[], qualifier=dmeth, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DynamicMethodSymbol, sub_type=None)), name=dsym)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DynamicMethodSymbol, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=pool, selectors=[], type_arguments=None)], member=appendChar, postfix_operators=[], prefix_operators=[], qualifier=databuf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=dsym.staticArgs, selectors=[])], member=appendChar, postfix_operators=[], prefix_operators=[], qualifier=databuf, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=uniqueStaticArgs, postfix_operators=[], prefix_operators=[], qualifier=dmeth, selectors=[]), name=uniqueArgs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=pool, selectors=[], type_arguments=None)], member=appendChar, postfix_operators=[], prefix_operators=[], qualifier=databuf, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=uniqueArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=bootstrapMethods, selectors=[], type_arguments=None), 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=DynamicMethod, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MethodHandle, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) call[.endAttr, parameter[member[.alenIdx]]] end[}] END[}]
Keyword[void] identifier[writeBootstrapMethods] operator[SEP] operator[SEP] { Keyword[int] identifier[alenIdx] operator[=] identifier[writeAttr] operator[SEP] identifier[names] operator[SEP] identifier[BootstrapMethods] operator[SEP] operator[SEP] identifier[databuf] operator[SEP] identifier[appendChar] operator[SEP] identifier[bootstrapMethods] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[DynamicMethod] , identifier[MethodHandle] operator[>] identifier[entry] operator[:] identifier[bootstrapMethods] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[DynamicMethod] identifier[dmeth] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[DynamicMethodSymbol] identifier[dsym] operator[=] operator[SEP] identifier[DynamicMethodSymbol] operator[SEP] identifier[dmeth] operator[SEP] identifier[baseSymbol] operator[SEP] operator[SEP] operator[SEP] identifier[databuf] operator[SEP] identifier[appendChar] operator[SEP] identifier[pool] operator[SEP] identifier[get] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[databuf] operator[SEP] identifier[appendChar] operator[SEP] identifier[dsym] operator[SEP] identifier[staticArgs] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[uniqueArgs] operator[=] identifier[dmeth] operator[SEP] identifier[uniqueStaticArgs] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[o] operator[:] identifier[uniqueArgs] operator[SEP] { identifier[databuf] operator[SEP] identifier[appendChar] operator[SEP] identifier[pool] operator[SEP] identifier[get] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP] } } identifier[endAttr] operator[SEP] identifier[alenIdx] operator[SEP] operator[SEP] }
int grabFlowControlBytes(int bytesToGrab) { if(bytesToGrab <= 0) { return 0; } int min; synchronized (flowControlLock) { min = (int) Math.min(bytesToGrab, sendWindowSize); if (bytesToGrab > FLOW_CONTROL_MIN_WINDOW && min <= FLOW_CONTROL_MIN_WINDOW) { //this can cause problems with padding, so we just return 0 return 0; } min = Math.min(sendMaxFrameSize, min); sendWindowSize -= min; } return min; }
class class_name[name] begin[{] method[grabFlowControlBytes, return_type[type[int]], modifier[default], parameter[bytesToGrab]] begin[{] if[binary_operation[member[.bytesToGrab], <=, literal[0]]] begin[{] return[literal[0]] else begin[{] None end[}] local_variable[type[int], min] SYNCHRONIZED[member[.flowControlLock]] BEGIN[{] assign[member[.min], Cast(expression=MethodInvocation(arguments=[MemberReference(member=bytesToGrab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sendWindowSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))] if[binary_operation[binary_operation[member[.bytesToGrab], >, member[.FLOW_CONTROL_MIN_WINDOW]], &&, binary_operation[member[.min], <=, member[.FLOW_CONTROL_MIN_WINDOW]]]] begin[{] return[literal[0]] else begin[{] None end[}] assign[member[.min], call[Math.min, parameter[member[.sendMaxFrameSize], member[.min]]]] assign[member[.sendWindowSize], member[.min]] END[}] return[member[.min]] end[}] END[}]
Keyword[int] identifier[grabFlowControlBytes] operator[SEP] Keyword[int] identifier[bytesToGrab] operator[SEP] { Keyword[if] operator[SEP] identifier[bytesToGrab] operator[<=] Other[0] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[int] identifier[min] operator[SEP] Keyword[synchronized] operator[SEP] identifier[flowControlLock] operator[SEP] { identifier[min] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[bytesToGrab] , identifier[sendWindowSize] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bytesToGrab] operator[>] identifier[FLOW_CONTROL_MIN_WINDOW] operator[&&] identifier[min] operator[<=] identifier[FLOW_CONTROL_MIN_WINDOW] operator[SEP] { Keyword[return] Other[0] operator[SEP] } identifier[min] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[sendMaxFrameSize] , identifier[min] operator[SEP] operator[SEP] identifier[sendWindowSize] operator[-=] identifier[min] operator[SEP] } Keyword[return] identifier[min] operator[SEP] }
private int computeMaxRows(Method method) { Class returnType = method.getReturnType(); final boolean isArray = returnType.isArray(); final boolean isRowSet = returnType.equals(RowSet.class); int maxSet = _maxRows; if (isArray && _maxArray != JdbcControl.MAXROWS_ALL) { maxSet = _maxRows == JdbcControl.MAXROWS_ALL ? _maxArray + 1 : Math.min(_maxArray + 1, _maxRows); } else if (isRowSet && _maxRows > 0) { maxSet = _maxRows + 1; } return maxSet; }
class class_name[name] begin[{] method[computeMaxRows, return_type[type[int]], modifier[private], parameter[method]] begin[{] local_variable[type[Class], returnType] local_variable[type[boolean], isArray] local_variable[type[boolean], isRowSet] local_variable[type[int], maxSet] if[binary_operation[member[.isArray], &&, binary_operation[member[._maxArray], !=, member[JdbcControl.MAXROWS_ALL]]]] begin[{] assign[member[.maxSet], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=_maxRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAXROWS_ALL, postfix_operators=[], prefix_operators=[], qualifier=JdbcControl, selectors=[]), operator===), if_false=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=_maxArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=_maxRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=MemberReference(member=_maxArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))] else begin[{] if[binary_operation[member[.isRowSet], &&, binary_operation[member[._maxRows], >, literal[0]]]] begin[{] assign[member[.maxSet], binary_operation[member[._maxRows], +, literal[1]]] else begin[{] None end[}] end[}] return[member[.maxSet]] end[}] END[}]
Keyword[private] Keyword[int] identifier[computeMaxRows] operator[SEP] identifier[Method] identifier[method] operator[SEP] { identifier[Class] identifier[returnType] operator[=] identifier[method] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[isArray] operator[=] identifier[returnType] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[isRowSet] operator[=] identifier[returnType] operator[SEP] identifier[equals] operator[SEP] identifier[RowSet] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[int] identifier[maxSet] operator[=] identifier[_maxRows] operator[SEP] Keyword[if] operator[SEP] identifier[isArray] operator[&&] identifier[_maxArray] operator[!=] identifier[JdbcControl] operator[SEP] identifier[MAXROWS_ALL] operator[SEP] { identifier[maxSet] operator[=] identifier[_maxRows] operator[==] identifier[JdbcControl] operator[SEP] identifier[MAXROWS_ALL] operator[?] identifier[_maxArray] operator[+] Other[1] operator[:] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[_maxArray] operator[+] Other[1] , identifier[_maxRows] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[isRowSet] operator[&&] identifier[_maxRows] operator[>] Other[0] operator[SEP] { identifier[maxSet] operator[=] identifier[_maxRows] operator[+] Other[1] operator[SEP] } Keyword[return] identifier[maxSet] operator[SEP] }
public void deleteSeen(SITransaction transaction) throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException, SIResourceException, SIConnectionLostException, SILimitExceededException, SIIncorrectCallException, SIMessageNotLockedException, SIErrorException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"deleteSeen", transaction); synchronized(lmeOperationMonitor) { checkValid(); // If we have seen any messages.... int numSeenMsgs = getSeenMessageCount(); if (numSeenMsgs > 0) { // Start d181719 JsMessage[] seenRecoverableMessages = new JsMessage[numSeenMsgs]; int numOfMessagesNeedingDeleting = 0; // Go through each seen message for (int i=0; i < nextIndex; ++i) { if (messages[i] != null) { // Only add the message to the list of messages to delete if it is recoverable if (CommsUtils.isRecoverable(messages[i], consumerSession.getUnrecoverableReliability())) // f177889 { // f177889 seenRecoverableMessages[numOfMessagesNeedingDeleting] = messages[i]; // f177889 ++numOfMessagesNeedingDeleting; } // f177889 // Delete it from the main pile messages[i] = null; } } if (numOfMessagesNeedingDeleting > 0) { if (transaction != null) { synchronized (transaction) { // Check transaction is in a valid state. // Enlisted for an XA UOW and not rolledback or // completed for a local transaction. if (!((Transaction) transaction).isValid()) { throw new SIIncorrectCallException( nls.getFormattedMessage("TRANSACTION_COMPLETE_SICO1022", null, null) ); } deleteMessages(seenRecoverableMessages, transaction); } } else { deleteMessages(seenRecoverableMessages, null); } } // End d181719 } // End f191114 } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"deleteSeen"); }
class class_name[name] begin[{] method[deleteSeen, return_type[void], modifier[public], parameter[transaction]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["deleteSeen"], member[.transaction]]] else begin[{] None end[}] SYNCHRONIZED[member[.lmeOperationMonitor]] BEGIN[{] call[.checkValid, parameter[]] local_variable[type[int], numSeenMsgs] if[binary_operation[member[.numSeenMsgs], >, literal[0]]] begin[{] local_variable[type[JsMessage], seenRecoverableMessages] local_variable[type[int], numOfMessagesNeedingDeleting] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MethodInvocation(arguments=[], member=getUnrecoverableReliability, postfix_operators=[], prefix_operators=[], qualifier=consumerSession, selectors=[], type_arguments=None)], member=isRecoverable, postfix_operators=[], prefix_operators=[], qualifier=CommsUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=seenRecoverableMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=numOfMessagesNeedingDeleting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=MemberReference(member=numOfMessagesNeedingDeleting, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=messages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nextIndex, 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) if[binary_operation[member[.numOfMessagesNeedingDeleting], >, literal[0]]] begin[{] if[binary_operation[member[.transaction], !=, literal[null]]] begin[{] SYNCHRONIZED[member[.transaction]] BEGIN[{] if[Cast(expression=MemberReference(member=transaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Transaction, sub_type=None))] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TRANSACTION_COMPLETE_SICO1022"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIIncorrectCallException, sub_type=None)), label=None) else begin[{] None end[}] call[.deleteMessages, parameter[member[.seenRecoverableMessages], member[.transaction]]] END[}] else begin[{] call[.deleteMessages, parameter[member[.seenRecoverableMessages], literal[null]]] end[}] else begin[{] None end[}] else begin[{] None end[}] END[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["deleteSeen"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[deleteSeen] operator[SEP] identifier[SITransaction] identifier[transaction] operator[SEP] Keyword[throws] identifier[SISessionUnavailableException] , identifier[SISessionDroppedException] , identifier[SIConnectionUnavailableException] , identifier[SIConnectionDroppedException] , identifier[SIResourceException] , identifier[SIConnectionLostException] , identifier[SILimitExceededException] , identifier[SIIncorrectCallException] , identifier[SIMessageNotLockedException] , identifier[SIErrorException] { 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] , identifier[transaction] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[lmeOperationMonitor] operator[SEP] { identifier[checkValid] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numSeenMsgs] operator[=] identifier[getSeenMessageCount] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numSeenMsgs] operator[>] Other[0] operator[SEP] { identifier[JsMessage] operator[SEP] operator[SEP] identifier[seenRecoverableMessages] operator[=] Keyword[new] identifier[JsMessage] operator[SEP] identifier[numSeenMsgs] operator[SEP] operator[SEP] Keyword[int] identifier[numOfMessagesNeedingDeleting] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nextIndex] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[messages] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[CommsUtils] operator[SEP] identifier[isRecoverable] operator[SEP] identifier[messages] operator[SEP] identifier[i] operator[SEP] , identifier[consumerSession] operator[SEP] identifier[getUnrecoverableReliability] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[seenRecoverableMessages] operator[SEP] identifier[numOfMessagesNeedingDeleting] operator[SEP] operator[=] identifier[messages] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[++] identifier[numOfMessagesNeedingDeleting] operator[SEP] } identifier[messages] operator[SEP] identifier[i] operator[SEP] operator[=] Other[null] operator[SEP] } } Keyword[if] operator[SEP] identifier[numOfMessagesNeedingDeleting] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[transaction] operator[!=] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[transaction] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] identifier[Transaction] operator[SEP] identifier[transaction] operator[SEP] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[SIIncorrectCallException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Other[null] , Other[null] operator[SEP] operator[SEP] operator[SEP] } identifier[deleteMessages] operator[SEP] identifier[seenRecoverableMessages] , identifier[transaction] operator[SEP] operator[SEP] } } Keyword[else] { identifier[deleteMessages] operator[SEP] identifier[seenRecoverableMessages] , Other[null] 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] operator[SEP] operator[SEP] }
@Deprecated public static List<StringToNodeCollection> getTranslatableStringsV1(final Document xml, final boolean allowDuplicates) { if (xml == null) return null; final List<StringToNodeCollection> retValue = new ArrayList<StringToNodeCollection>(); final NodeList nodes = xml.getDocumentElement().getChildNodes(); for (int i = 0; i < nodes.getLength(); ++i) { final Node node = nodes.item(i); getTranslatableStringsFromNodeV1(node, retValue, allowDuplicates, new XMLProperties()); } return retValue; }
class class_name[name] begin[{] method[getTranslatableStringsV1, return_type[type[List]], modifier[public static], parameter[xml, allowDuplicates]] begin[{] if[binary_operation[member[.xml], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], retValue] local_variable[type[NodeList], nodes] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=nodes, selectors=[], type_arguments=None), name=node)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=retValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=allowDuplicates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XMLProperties, sub_type=None))], member=getTranslatableStringsFromNodeV1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=nodes, selectors=[], type_arguments=None), 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[.retValue]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[List] operator[<] identifier[StringToNodeCollection] operator[>] identifier[getTranslatableStringsV1] operator[SEP] Keyword[final] identifier[Document] identifier[xml] , Keyword[final] Keyword[boolean] identifier[allowDuplicates] operator[SEP] { Keyword[if] operator[SEP] identifier[xml] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[StringToNodeCollection] operator[>] identifier[retValue] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[StringToNodeCollection] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[NodeList] identifier[nodes] operator[=] identifier[xml] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nodes] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[final] identifier[Node] identifier[node] operator[=] identifier[nodes] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getTranslatableStringsFromNodeV1] operator[SEP] identifier[node] , identifier[retValue] , identifier[allowDuplicates] , Keyword[new] identifier[XMLProperties] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[retValue] operator[SEP] }
public IfcChangeActionEnum createIfcChangeActionEnumFromString(EDataType eDataType, String initialValue) { IfcChangeActionEnum result = IfcChangeActionEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
class class_name[name] begin[{] method[createIfcChangeActionEnumFromString, return_type[type[IfcChangeActionEnum]], modifier[public], parameter[eDataType, initialValue]] begin[{] local_variable[type[IfcChangeActionEnum], result] if[binary_operation[member[.result], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), 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=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[IfcChangeActionEnum] identifier[createIfcChangeActionEnumFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] { identifier[IfcChangeActionEnum] identifier[result] operator[=] identifier[IfcChangeActionEnum] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
@Override public double distance(NumberVector v1, NumberVector v2) { return 1 - Math.abs(PearsonCorrelation.coefficient(v1, v2)); }
class class_name[name] begin[{] method[distance, return_type[type[double]], modifier[public], parameter[v1, v2]] begin[{] return[binary_operation[literal[1], -, call[Math.abs, parameter[call[PearsonCorrelation.coefficient, parameter[member[.v1], member[.v2]]]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[double] identifier[distance] operator[SEP] identifier[NumberVector] identifier[v1] , identifier[NumberVector] identifier[v2] operator[SEP] { Keyword[return] Other[1] operator[-] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[PearsonCorrelation] operator[SEP] identifier[coefficient] operator[SEP] identifier[v1] , identifier[v2] operator[SEP] operator[SEP] operator[SEP] }
public void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException { if (name == null) { throw new IllegalArgumentException("feature name can not be null"); } if (FEATURE_NAMES_INTERNED.equals(name)) { namesInterned = state; } else if (FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE.equals(name)) { attributeUseApostrophe = state; } else { throw new IllegalStateException("unsupported feature " + name); } }
class class_name[name] begin[{] method[setFeature, return_type[void], modifier[public], parameter[name, state]] begin[{] if[binary_operation[member[.name], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="feature name can not be null")], 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[call[FEATURE_NAMES_INTERNED.equals, parameter[member[.name]]]] begin[{] assign[member[.namesInterned], member[.state]] else begin[{] if[call[FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE.equals, parameter[member[.name]]]] begin[{] assign[member[.attributeUseApostrophe], member[.state]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unsupported feature "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setFeature] operator[SEP] identifier[String] identifier[name] , Keyword[boolean] identifier[state] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] , identifier[IllegalStateException] { Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[FEATURE_NAMES_INTERNED] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[namesInterned] operator[=] identifier[state] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[attributeUseApostrophe] operator[=] identifier[state] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[name] operator[SEP] operator[SEP] } }
private void sendContinuousReplicationChanges(Map<String, Object> activity) { try { String jsonString = Manager.getObjectMapper().writeValueAsString(activity); if (callbackBlock != null) { byte[] json = (jsonString + '\n').getBytes(); OutputStream os = connection.getResponseOutputStream(); try { os.write(json); os.flush(); } catch (Exception e) { Log.e(TAG, "IOException writing to internal streams", e); } } } catch (Exception e) { Log.w("Unable to serialize change to JSON", e); } }
class class_name[name] begin[{] method[sendContinuousReplicationChanges, return_type[void], modifier[private], parameter[activity]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getObjectMapper, postfix_operators=[], prefix_operators=[], qualifier=Manager, selectors=[MethodInvocation(arguments=[MemberReference(member=activity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeValueAsString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=jsonString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=callbackBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=jsonString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'), operator=+), name=json)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResponseOutputStream, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), name=os)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OutputStream, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=json, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOException writing to internal streams"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=e, postfix_operators=[], prefix_operators=[], qualifier=Log, 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)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to serialize change to JSON"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=w, postfix_operators=[], prefix_operators=[], qualifier=Log, 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) end[}] END[}]
Keyword[private] Keyword[void] identifier[sendContinuousReplicationChanges] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[activity] operator[SEP] { Keyword[try] { identifier[String] identifier[jsonString] operator[=] identifier[Manager] operator[SEP] identifier[getObjectMapper] operator[SEP] operator[SEP] operator[SEP] identifier[writeValueAsString] operator[SEP] identifier[activity] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[callbackBlock] operator[!=] Other[null] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[json] operator[=] operator[SEP] identifier[jsonString] operator[+] literal[String] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] identifier[OutputStream] identifier[os] operator[=] identifier[connection] operator[SEP] identifier[getResponseOutputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[os] operator[SEP] identifier[write] operator[SEP] identifier[json] operator[SEP] operator[SEP] identifier[os] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , literal[String] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[Log] operator[SEP] identifier[w] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
@Override public void removeHandler(Handler handler) { synchronized (this) { ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { loader = _systemClassLoader; } for (int i = _loaders.size() - 1; i >= 0; i--) { WeakReference<ClassLoader> ref = _loaders.get(i); ClassLoader refLoader = ref.get(); if (refLoader == null) { _loaders.remove(i); } if (isParentLoader(loader, refLoader)) { removeHandler(handler, refLoader); } } HandlerEntry ownHandlers = _ownHandlers.get(); if (ownHandlers != null) ownHandlers.removeHandler(handler); } }
class class_name[name] begin[{] method[removeHandler, return_type[void], modifier[public], parameter[handler]] begin[{] SYNCHRONIZED[THIS[]] BEGIN[{] local_variable[type[ClassLoader], loader] if[binary_operation[member[.loader], ==, literal[null]]] begin[{] assign[member[.loader], member[._systemClassLoader]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_loaders, selectors=[], type_arguments=None), name=ref)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None))], dimensions=[], name=WeakReference, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=ref, selectors=[], type_arguments=None), name=refLoader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=refLoader, 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=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=_loaders, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=loader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=refLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isParentLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=refLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeHandler, postfix_operators=[], prefix_operators=[], qualifier=, 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=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_loaders, selectors=[], type_arguments=None), 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) local_variable[type[HandlerEntry], ownHandlers] if[binary_operation[member[.ownHandlers], !=, literal[null]]] begin[{] call[ownHandlers.removeHandler, parameter[member[.handler]]] else begin[{] None end[}] END[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeHandler] operator[SEP] identifier[Handler] identifier[handler] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[ClassLoader] identifier[loader] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[loader] operator[==] Other[null] operator[SEP] { identifier[loader] operator[=] identifier[_systemClassLoader] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[_loaders] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] { identifier[WeakReference] operator[<] identifier[ClassLoader] operator[>] identifier[ref] operator[=] identifier[_loaders] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ClassLoader] identifier[refLoader] operator[=] identifier[ref] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[refLoader] operator[==] Other[null] operator[SEP] { identifier[_loaders] operator[SEP] identifier[remove] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isParentLoader] operator[SEP] identifier[loader] , identifier[refLoader] operator[SEP] operator[SEP] { identifier[removeHandler] operator[SEP] identifier[handler] , identifier[refLoader] operator[SEP] operator[SEP] } } identifier[HandlerEntry] identifier[ownHandlers] operator[=] identifier[_ownHandlers] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ownHandlers] operator[!=] Other[null] operator[SEP] identifier[ownHandlers] operator[SEP] identifier[removeHandler] operator[SEP] identifier[handler] operator[SEP] operator[SEP] } }
public int disconnect(int v) { Set<T> types = edges.remove(v); if (types != null) { int edges = types.size(); size -= edges; return edges; } return 0; }
class class_name[name] begin[{] method[disconnect, return_type[type[int]], modifier[public], parameter[v]] begin[{] local_variable[type[Set], types] if[binary_operation[member[.types], !=, literal[null]]] begin[{] local_variable[type[int], edges] assign[member[.size], member[.edges]] return[member[.edges]] else begin[{] None end[}] return[literal[0]] end[}] END[}]
Keyword[public] Keyword[int] identifier[disconnect] operator[SEP] Keyword[int] identifier[v] operator[SEP] { identifier[Set] operator[<] identifier[T] operator[>] identifier[types] operator[=] identifier[edges] operator[SEP] identifier[remove] operator[SEP] identifier[v] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[types] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[edges] operator[=] identifier[types] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[-=] identifier[edges] operator[SEP] Keyword[return] identifier[edges] operator[SEP] } Keyword[return] Other[0] operator[SEP] }
public static <A, B> Generator<PMatrix3x3D<A, B>> createNormal() { return new PMatrix3x3DGenerator<>(PrimitiveGenerators.doubles( GeneratorConstants.BOUND_NORMAL_DOUBLE_LOWER, GeneratorConstants.BOUND_NORMAL_DOUBLE_UPPER )); }
class class_name[name] begin[{] method[createNormal, return_type[type[Generator]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=BOUND_NORMAL_DOUBLE_LOWER, postfix_operators=[], prefix_operators=[], qualifier=GeneratorConstants, selectors=[]), MemberReference(member=BOUND_NORMAL_DOUBLE_UPPER, postfix_operators=[], prefix_operators=[], qualifier=GeneratorConstants, selectors=[])], member=doubles, postfix_operators=[], prefix_operators=[], qualifier=PrimitiveGenerators, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=PMatrix3x3DGenerator, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[A] , identifier[B] operator[>] identifier[Generator] operator[<] identifier[PMatrix3x3D] operator[<] identifier[A] , identifier[B] operator[>] operator[>] identifier[createNormal] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[PMatrix3x3DGenerator] operator[<] operator[>] operator[SEP] identifier[PrimitiveGenerators] operator[SEP] identifier[doubles] operator[SEP] identifier[GeneratorConstants] operator[SEP] identifier[BOUND_NORMAL_DOUBLE_LOWER] , identifier[GeneratorConstants] operator[SEP] identifier[BOUND_NORMAL_DOUBLE_UPPER] operator[SEP] operator[SEP] operator[SEP] }
@Override public void setRollbackOnly() { Optional<LocalTransactionContext> txContext = currentTxContext(); if (txContext.isPresent()) { txContext.get().setRollbackOnly(); } else { this.unmanagedTransaction.ifPresent(LocalTransactionContext::setRollbackOnly); } }
class class_name[name] begin[{] method[setRollbackOnly, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[Optional], txContext] if[call[txContext.isPresent, parameter[]]] begin[{] call[txContext.get, parameter[]] else begin[{] THIS[member[None.unmanagedTransaction]call[None.ifPresent, parameter[MethodReference(expression=MemberReference(member=LocalTransactionContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=setRollbackOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setRollbackOnly] operator[SEP] operator[SEP] { identifier[Optional] operator[<] identifier[LocalTransactionContext] operator[>] identifier[txContext] operator[=] identifier[currentTxContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[txContext] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { identifier[txContext] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[setRollbackOnly] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[unmanagedTransaction] operator[SEP] identifier[ifPresent] operator[SEP] identifier[LocalTransactionContext] operator[::] identifier[setRollbackOnly] operator[SEP] operator[SEP] } }