code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public ResidueNumber getResidue(int positionInRange, AtomPositionMap map) { if (map == null) throw new NullPointerException("The AtomPositionMap must be non-null"); int i = 0; for (Map.Entry<ResidueNumber, Integer> entry : map.getNavMap().entrySet()) { if (i == positionInRange) return entry.getKey(); if (contains(entry.getKey(), map)) { i++; } } return null; }
class class_name[name] begin[{] method[getResidue, return_type[type[ResidueNumber]], modifier[public], parameter[positionInRange, map]] begin[{] if[binary_operation[member[.map], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The AtomPositionMap must be non-null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=positionInRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), label=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getNavMap, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResidueNumber, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[ResidueNumber] identifier[getResidue] operator[SEP] Keyword[int] identifier[positionInRange] , identifier[AtomPositionMap] identifier[map] operator[SEP] { Keyword[if] operator[SEP] identifier[map] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[ResidueNumber] , identifier[Integer] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[getNavMap] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[==] identifier[positionInRange] operator[SEP] Keyword[return] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contains] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[map] operator[SEP] operator[SEP] { identifier[i] operator[++] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public final CircuitBreakerStatus withThroughputOneMinute(double value) { double newValue = value; return new CircuitBreakerStatus( this.id, this.timestamp, this.state, this.totalSuccessCount, this.totalFailureCount, this.latencyMicros, newValue, this.failedThroughputOneMinute); }
class class_name[name] begin[{] method[withThroughputOneMinute, return_type[type[CircuitBreakerStatus]], modifier[final public], parameter[value]] begin[{] local_variable[type[double], newValue] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=timestamp, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=state, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=totalSuccessCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=totalFailureCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=latencyMicros, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=failedThroughputOneMinute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CircuitBreakerStatus, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[final] identifier[CircuitBreakerStatus] identifier[withThroughputOneMinute] operator[SEP] Keyword[double] identifier[value] operator[SEP] { Keyword[double] identifier[newValue] operator[=] identifier[value] operator[SEP] Keyword[return] Keyword[new] identifier[CircuitBreakerStatus] operator[SEP] Keyword[this] operator[SEP] identifier[id] , Keyword[this] operator[SEP] identifier[timestamp] , Keyword[this] operator[SEP] identifier[state] , Keyword[this] operator[SEP] identifier[totalSuccessCount] , Keyword[this] operator[SEP] identifier[totalFailureCount] , Keyword[this] operator[SEP] identifier[latencyMicros] , identifier[newValue] , Keyword[this] operator[SEP] identifier[failedThroughputOneMinute] operator[SEP] operator[SEP] }
public static void showTextAligned(PdfContentByte canvas, int alignment, Phrase phrase, float x, float y, float rotation, int runDirection, int arabicOptions) { if (alignment != Element.ALIGN_LEFT && alignment != Element.ALIGN_CENTER && alignment != Element.ALIGN_RIGHT) alignment = Element.ALIGN_LEFT; canvas.saveState(); ColumnText ct = new ColumnText(canvas); float lly = -1; float ury = 2; float llx; float urx; switch (alignment) { case Element.ALIGN_LEFT: llx = 0; urx = 20000; break; case Element.ALIGN_RIGHT: llx = -20000; urx = 0; break; default: llx = -20000; urx = 20000; break; } if (rotation == 0) { llx += x; lly += y; urx += x; ury += y; } else { double alpha = rotation * Math.PI / 180.0; float cos = (float)Math.cos(alpha); float sin = (float)Math.sin(alpha); canvas.concatCTM(cos, sin, -sin, cos, x, y); } ct.setSimpleColumn(phrase, llx, lly, urx, ury, 2, alignment); if (runDirection == PdfWriter.RUN_DIRECTION_RTL) { if (alignment == Element.ALIGN_LEFT) alignment = Element.ALIGN_RIGHT; else if (alignment == Element.ALIGN_RIGHT) alignment = Element.ALIGN_LEFT; } ct.setAlignment(alignment); ct.setArabicOptions(arabicOptions); ct.setRunDirection(runDirection); try { ct.go(); } catch (DocumentException e) { throw new ExceptionConverter(e); } canvas.restoreState(); }
class class_name[name] begin[{] method[showTextAligned, return_type[void], modifier[public static], parameter[canvas, alignment, phrase, x, y, rotation, runDirection, arabicOptions]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.alignment], !=, member[Element.ALIGN_LEFT]], &&, binary_operation[member[.alignment], !=, member[Element.ALIGN_CENTER]]], &&, binary_operation[member[.alignment], !=, member[Element.ALIGN_RIGHT]]]] begin[{] assign[member[.alignment], member[Element.ALIGN_LEFT]] else begin[{] None end[}] call[canvas.saveState, parameter[]] local_variable[type[ColumnText], ct] local_variable[type[float], lly] local_variable[type[float], ury] local_variable[type[float], llx] local_variable[type[float], urx] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=ALIGN_LEFT, postfix_operators=[], prefix_operators=[], qualifier=Element, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=llx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=urx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=20000)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=ALIGN_RIGHT, postfix_operators=[], prefix_operators=[], qualifier=Element, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=llx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=20000)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=urx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=llx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=20000)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=urx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=20000)), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alignment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) if[binary_operation[member[.rotation], ==, literal[0]]] begin[{] assign[member[.llx], member[.x]] assign[member[.lly], member[.y]] assign[member[.urx], member[.x]] assign[member[.ury], member[.y]] else begin[{] local_variable[type[double], alpha] local_variable[type[float], cos] local_variable[type[float], sin] call[canvas.concatCTM, parameter[member[.cos], member[.sin], member[.sin], member[.cos], member[.x], member[.y]]] end[}] call[ct.setSimpleColumn, parameter[member[.phrase], member[.llx], member[.lly], member[.urx], member[.ury], literal[2], member[.alignment]]] if[binary_operation[member[.runDirection], ==, member[PdfWriter.RUN_DIRECTION_RTL]]] begin[{] if[binary_operation[member[.alignment], ==, member[Element.ALIGN_LEFT]]] begin[{] assign[member[.alignment], member[Element.ALIGN_RIGHT]] else begin[{] if[binary_operation[member[.alignment], ==, member[Element.ALIGN_RIGHT]]] begin[{] assign[member[.alignment], member[Element.ALIGN_LEFT]] else begin[{] None end[}] end[}] else begin[{] None end[}] call[ct.setAlignment, parameter[member[.alignment]]] call[ct.setArabicOptions, parameter[member[.arabicOptions]]] call[ct.setRunDirection, parameter[member[.runDirection]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=go, postfix_operators=[], prefix_operators=[], qualifier=ct, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExceptionConverter, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DocumentException']))], finally_block=None, label=None, resources=None) call[canvas.restoreState, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[showTextAligned] operator[SEP] identifier[PdfContentByte] identifier[canvas] , Keyword[int] identifier[alignment] , identifier[Phrase] identifier[phrase] , Keyword[float] identifier[x] , Keyword[float] identifier[y] , Keyword[float] identifier[rotation] , Keyword[int] identifier[runDirection] , Keyword[int] identifier[arabicOptions] operator[SEP] { Keyword[if] operator[SEP] identifier[alignment] operator[!=] identifier[Element] operator[SEP] identifier[ALIGN_LEFT] operator[&&] identifier[alignment] operator[!=] identifier[Element] operator[SEP] identifier[ALIGN_CENTER] operator[&&] identifier[alignment] operator[!=] identifier[Element] operator[SEP] identifier[ALIGN_RIGHT] operator[SEP] identifier[alignment] operator[=] identifier[Element] operator[SEP] identifier[ALIGN_LEFT] operator[SEP] identifier[canvas] operator[SEP] identifier[saveState] operator[SEP] operator[SEP] operator[SEP] identifier[ColumnText] identifier[ct] operator[=] Keyword[new] identifier[ColumnText] operator[SEP] identifier[canvas] operator[SEP] operator[SEP] Keyword[float] identifier[lly] operator[=] operator[-] Other[1] operator[SEP] Keyword[float] identifier[ury] operator[=] Other[2] operator[SEP] Keyword[float] identifier[llx] operator[SEP] Keyword[float] identifier[urx] operator[SEP] Keyword[switch] operator[SEP] identifier[alignment] operator[SEP] { Keyword[case] identifier[Element] operator[SEP] identifier[ALIGN_LEFT] operator[:] identifier[llx] operator[=] Other[0] operator[SEP] identifier[urx] operator[=] Other[20000] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Element] operator[SEP] identifier[ALIGN_RIGHT] operator[:] identifier[llx] operator[=] operator[-] Other[20000] operator[SEP] identifier[urx] operator[=] Other[0] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[llx] operator[=] operator[-] Other[20000] operator[SEP] identifier[urx] operator[=] Other[20000] operator[SEP] Keyword[break] operator[SEP] } Keyword[if] operator[SEP] identifier[rotation] operator[==] Other[0] operator[SEP] { identifier[llx] operator[+=] identifier[x] operator[SEP] identifier[lly] operator[+=] identifier[y] operator[SEP] identifier[urx] operator[+=] identifier[x] operator[SEP] identifier[ury] operator[+=] identifier[y] operator[SEP] } Keyword[else] { Keyword[double] identifier[alpha] operator[=] identifier[rotation] operator[*] identifier[Math] operator[SEP] identifier[PI] operator[/] literal[Float] operator[SEP] Keyword[float] identifier[cos] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[alpha] operator[SEP] operator[SEP] Keyword[float] identifier[sin] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[alpha] operator[SEP] operator[SEP] identifier[canvas] operator[SEP] identifier[concatCTM] operator[SEP] identifier[cos] , identifier[sin] , operator[-] identifier[sin] , identifier[cos] , identifier[x] , identifier[y] operator[SEP] operator[SEP] } identifier[ct] operator[SEP] identifier[setSimpleColumn] operator[SEP] identifier[phrase] , identifier[llx] , identifier[lly] , identifier[urx] , identifier[ury] , Other[2] , identifier[alignment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[runDirection] operator[==] identifier[PdfWriter] operator[SEP] identifier[RUN_DIRECTION_RTL] operator[SEP] { Keyword[if] operator[SEP] identifier[alignment] operator[==] identifier[Element] operator[SEP] identifier[ALIGN_LEFT] operator[SEP] identifier[alignment] operator[=] identifier[Element] operator[SEP] identifier[ALIGN_RIGHT] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[alignment] operator[==] identifier[Element] operator[SEP] identifier[ALIGN_RIGHT] operator[SEP] identifier[alignment] operator[=] identifier[Element] operator[SEP] identifier[ALIGN_LEFT] operator[SEP] } identifier[ct] operator[SEP] identifier[setAlignment] operator[SEP] identifier[alignment] operator[SEP] operator[SEP] identifier[ct] operator[SEP] identifier[setArabicOptions] operator[SEP] identifier[arabicOptions] operator[SEP] operator[SEP] identifier[ct] operator[SEP] identifier[setRunDirection] operator[SEP] identifier[runDirection] operator[SEP] operator[SEP] Keyword[try] { identifier[ct] operator[SEP] identifier[go] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DocumentException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ExceptionConverter] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[canvas] operator[SEP] identifier[restoreState] operator[SEP] operator[SEP] operator[SEP] }
protected byte[] toByteArray(HttpEntity entity, int maxBytes) throws IOException { if (entity == null) { return new byte[0]; } try (InputStream is = entity.getContent()) { int size = (int) entity.getContentLength(); int readBufferLength = size; if (readBufferLength <= 0) { readBufferLength = 4096; } // in case when the maxBytes is less than the actual page size readBufferLength = Math.min(readBufferLength, maxBytes); // We allocate the buffer with either the actual size of the entity (if available) // or with the default 4KiB if the server did not return a value to avoid allocating // the full maxBytes (for the cases when the actual size will be smaller than maxBytes). ByteArrayBuffer buffer = new ByteArrayBuffer(readBufferLength); byte[] tmpBuff = new byte[4096]; int dataLength; while ((dataLength = is.read(tmpBuff)) != -1) { if (maxBytes > 0 && (buffer.length() + dataLength) > maxBytes) { truncated = true; dataLength = maxBytes - buffer.length(); } buffer.append(tmpBuff, 0, dataLength); if (truncated) { break; } } return buffer.toByteArray(); } }
class class_name[name] begin[{] method[toByteArray, return_type[type[byte]], modifier[protected], parameter[entity, maxBytes]] begin[{] if[binary_operation[member[.entity], ==, literal[null]]] begin[{] return[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=readBufferLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=readBufferLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=readBufferLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=readBufferLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=readBufferLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=readBufferLength, 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=ByteArrayBuffer, sub_type=None)), name=buffer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayBuffer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=tmpBuff)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=dataLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=maxBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), operandr=MemberReference(member=dataLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=maxBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=truncated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dataLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=maxBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), operator=-)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmpBuff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=dataLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=truncated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=dataLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=tmpBuff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=is, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=MethodInvocation(arguments=[], member=getContent, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[protected] Keyword[byte] operator[SEP] operator[SEP] identifier[toByteArray] operator[SEP] identifier[HttpEntity] identifier[entity] , Keyword[int] identifier[maxBytes] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[entity] operator[==] Other[null] operator[SEP] { Keyword[return] Keyword[new] Keyword[byte] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[try] operator[SEP] identifier[InputStream] identifier[is] operator[=] identifier[entity] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[size] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[entity] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[readBufferLength] operator[=] identifier[size] operator[SEP] Keyword[if] operator[SEP] identifier[readBufferLength] operator[<=] Other[0] operator[SEP] { identifier[readBufferLength] operator[=] Other[4096] operator[SEP] } identifier[readBufferLength] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[readBufferLength] , identifier[maxBytes] operator[SEP] operator[SEP] identifier[ByteArrayBuffer] identifier[buffer] operator[=] Keyword[new] identifier[ByteArrayBuffer] operator[SEP] identifier[readBufferLength] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[tmpBuff] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[4096] operator[SEP] operator[SEP] Keyword[int] identifier[dataLength] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[dataLength] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] identifier[tmpBuff] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { Keyword[if] operator[SEP] identifier[maxBytes] operator[>] Other[0] operator[&&] operator[SEP] identifier[buffer] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] identifier[dataLength] operator[SEP] operator[>] identifier[maxBytes] operator[SEP] { identifier[truncated] operator[=] literal[boolean] operator[SEP] identifier[dataLength] operator[=] identifier[maxBytes] operator[-] identifier[buffer] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[tmpBuff] , Other[0] , identifier[dataLength] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[truncated] operator[SEP] { Keyword[break] operator[SEP] } } Keyword[return] identifier[buffer] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") public void setAccessToken(String token) { if (!StringUtils.isBlank(token)) { try { String payload = Utils.base64dec(StringUtils.substringBetween(token, ".", ".")); Map<String, Object> decoded = ParaObjectUtils.getJsonMapper().readValue(payload, Map.class); if (decoded != null && decoded.containsKey("exp")) { this.tokenKeyExpires = (Long) decoded.get("exp"); this.tokenKeyNextRefresh = (Long) decoded.get("refresh"); } } catch (Exception ex) { this.tokenKeyExpires = null; this.tokenKeyNextRefresh = null; } } this.tokenKey = token; }
class class_name[name] begin[{] method[setAccessToken, return_type[void], modifier[public], parameter[token]] begin[{] if[call[StringUtils.isBlank, parameter[member[.token]]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=substringBetween, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)], member=base64dec, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), name=payload)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getJsonMapper, postfix_operators=[], prefix_operators=[], qualifier=ParaObjectUtils, selectors=[MethodInvocation(arguments=[MemberReference(member=payload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None))], member=readValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=decoded)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=decoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="exp")], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=decoded, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=tokenKeyExpires, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="exp")], member=get, postfix_operators=[], prefix_operators=[], qualifier=decoded, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=tokenKeyNextRefresh, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="refresh")], member=get, postfix_operators=[], prefix_operators=[], qualifier=decoded, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=tokenKeyExpires, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=tokenKeyNextRefresh, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] assign[THIS[member[None.tokenKey]], member[.token]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[setAccessToken] operator[SEP] identifier[String] identifier[token] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[token] operator[SEP] operator[SEP] { Keyword[try] { identifier[String] identifier[payload] operator[=] identifier[Utils] operator[SEP] identifier[base64dec] operator[SEP] identifier[StringUtils] operator[SEP] identifier[substringBetween] operator[SEP] identifier[token] , literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[decoded] operator[=] identifier[ParaObjectUtils] operator[SEP] identifier[getJsonMapper] operator[SEP] operator[SEP] operator[SEP] identifier[readValue] operator[SEP] identifier[payload] , identifier[Map] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[decoded] operator[!=] Other[null] operator[&&] identifier[decoded] operator[SEP] identifier[containsKey] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[tokenKeyExpires] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[decoded] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[tokenKeyNextRefresh] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[decoded] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[this] operator[SEP] identifier[tokenKeyExpires] operator[=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[tokenKeyNextRefresh] operator[=] Other[null] operator[SEP] } } Keyword[this] operator[SEP] identifier[tokenKey] operator[=] identifier[token] operator[SEP] }
@Programmatic public CommunicationChannelOwnerLink findByCommunicationChannel(final CommunicationChannel communicationChannel) { return container.firstMatch( new QueryDefault<>(CommunicationChannelOwnerLink.class, "findByCommunicationChannel", "communicationChannel", communicationChannel)); }
class class_name[name] begin[{] method[findByCommunicationChannel, return_type[type[CommunicationChannelOwnerLink]], modifier[public], parameter[communicationChannel]] begin[{] return[call[container.firstMatch, parameter[ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommunicationChannelOwnerLink, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="findByCommunicationChannel"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="communicationChannel"), MemberReference(member=communicationChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=QueryDefault, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[Programmatic] Keyword[public] identifier[CommunicationChannelOwnerLink] identifier[findByCommunicationChannel] operator[SEP] Keyword[final] identifier[CommunicationChannel] identifier[communicationChannel] operator[SEP] { Keyword[return] identifier[container] operator[SEP] identifier[firstMatch] operator[SEP] Keyword[new] identifier[QueryDefault] operator[<] operator[>] operator[SEP] identifier[CommunicationChannelOwnerLink] operator[SEP] Keyword[class] , literal[String] , literal[String] , identifier[communicationChannel] operator[SEP] operator[SEP] operator[SEP] }
public JsonWriter object() { startValue(); stack.push(context); context = new JsonContext(JsonContext.Mode.MAP); writer.write('{'); return this; }
class class_name[name] begin[{] method[object, return_type[type[JsonWriter]], modifier[public], parameter[]] begin[{] call[.startValue, parameter[]] call[stack.push, parameter[member[.context]]] assign[member[.context], ClassCreator(arguments=[MemberReference(member=MAP, postfix_operators=[], prefix_operators=[], qualifier=JsonContext.Mode, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonContext, sub_type=None))] call[writer.write, parameter[literal['{']]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JsonWriter] identifier[object] operator[SEP] operator[SEP] { identifier[startValue] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[push] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[context] operator[=] Keyword[new] identifier[JsonContext] operator[SEP] identifier[JsonContext] operator[SEP] identifier[Mode] operator[SEP] identifier[MAP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void initFrom(SessionFactory sessionFactory) { Assert.notNull(sessionFactory); Stopwatch watch = new Stopwatch().start(); Map<String, ClassMetadata> classMetadatas = sessionFactory.getAllClassMetadata(); int entityCount = entityTypes.size(); int collectionCount = collectionTypes.size(); for (Iterator<ClassMetadata> iter = classMetadatas.values().iterator(); iter.hasNext();) { ClassMetadata cm = (ClassMetadata) iter.next(); buildEntityType(sessionFactory, cm.getEntityName()); } logger.info("Find {} entities,{} collections from hibernate in {}", new Object[] { entityTypes.size() - entityCount, collectionTypes.size() - collectionCount, watch }); if (logger.isDebugEnabled()) loggerTypeInfo(); collectionTypes.clear(); }
class class_name[name] begin[{] method[initFrom, return_type[void], modifier[public], parameter[sessionFactory]] begin[{] call[Assert.notNull, parameter[member[.sessionFactory]]] local_variable[type[Stopwatch], watch] local_variable[type[Map], classMetadatas] local_variable[type[int], entityCount] local_variable[type[int], collectionCount] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ClassMetadata, sub_type=None)), name=cm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassMetadata, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sessionFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getEntityName, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[], type_arguments=None)], member=buildEntityType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=classMetadatas, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClassMetadata, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) call[logger.info, parameter[literal["Find {} entities,{} collections from hibernate in {}"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=entityTypes, selectors=[], type_arguments=None), operandr=MemberReference(member=entityCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=collectionTypes, selectors=[], type_arguments=None), operandr=MemberReference(member=collectionCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=watch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[.loggerTypeInfo, parameter[]] else begin[{] None end[}] call[collectionTypes.clear, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[initFrom] operator[SEP] identifier[SessionFactory] identifier[sessionFactory] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[sessionFactory] operator[SEP] operator[SEP] identifier[Stopwatch] identifier[watch] operator[=] Keyword[new] identifier[Stopwatch] operator[SEP] operator[SEP] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[ClassMetadata] operator[>] identifier[classMetadatas] operator[=] identifier[sessionFactory] operator[SEP] identifier[getAllClassMetadata] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[entityCount] operator[=] identifier[entityTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[collectionCount] operator[=] identifier[collectionTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[ClassMetadata] operator[>] identifier[iter] operator[=] identifier[classMetadatas] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[ClassMetadata] identifier[cm] operator[=] operator[SEP] identifier[ClassMetadata] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[buildEntityType] operator[SEP] identifier[sessionFactory] , identifier[cm] operator[SEP] identifier[getEntityName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[entityTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] identifier[entityCount] , identifier[collectionTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] identifier[collectionCount] , identifier[watch] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[loggerTypeInfo] operator[SEP] operator[SEP] operator[SEP] identifier[collectionTypes] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] }
public static BufferedImage getDestination(final ImageReadParam param, final Iterator<ImageTypeSpecifier> types, final int width, final int height) throws IIOException { // Adapted from http://java.net/jira/secure/attachment/29712/TIFFImageReader.java.patch, // to allow reading parts/tiles of huge images. if (types == null || !types.hasNext()) { throw new IllegalArgumentException("imageTypes null or empty!"); } ImageTypeSpecifier imageType = null; // If param is non-null, use it if (param != null) { // Try to get the explicit destination image BufferedImage dest = param.getDestination(); if (dest != null) { boolean found = false; while (types.hasNext()) { ImageTypeSpecifier specifier = types.next(); int bufferedImageType = specifier.getBufferedImageType(); if (bufferedImageType != 0 && bufferedImageType == dest.getType()) { // Known types equal, perfect match found = true; break; } else { // If types are different, or TYPE_CUSTOM, test if // - transferType is ok // - bands are ok // TODO: Test if color model is ok? if (specifier.getSampleModel().getTransferType() == dest.getSampleModel().getTransferType() && specifier.getNumBands() <= dest.getSampleModel().getNumBands()) { found = true; break; } } } if (!found) { throw new IIOException(String.format("Destination image from ImageReadParam does not match legal imageTypes from reader: %s", dest)); } return dest; } // No image, get the image type imageType = param.getDestinationType(); } // No info from param, use fallback image type if (imageType == null) { imageType = types.next(); } else { boolean foundIt = false; while (types.hasNext()) { ImageTypeSpecifier type = types.next(); if (type.equals(imageType)) { foundIt = true; break; } } if (!foundIt) { throw new IIOException(String.format("Destination type from ImageReadParam does not match legal imageTypes from reader: %s", imageType)); } } Rectangle srcRegion = new Rectangle(0, 0, 0, 0); Rectangle destRegion = new Rectangle(0, 0, 0, 0); computeRegions(param, width, height, null, srcRegion, destRegion); int destWidth = destRegion.x + destRegion.width; int destHeight = destRegion.y + destRegion.height; if ((long) destWidth * destHeight > Integer.MAX_VALUE) { throw new IllegalArgumentException(String.format("destination width * height > Integer.MAX_VALUE: %d", (long) destWidth * destHeight)); } // Create a new image based on the type specifier return imageType.createBufferedImage(destWidth, destHeight); }
class class_name[name] begin[{] method[getDestination, return_type[type[BufferedImage]], modifier[public static], parameter[param, types, width, height]] begin[{] if[binary_operation[binary_operation[member[.types], ==, literal[null]], ||, call[types.hasNext, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="imageTypes null or empty!")], 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[ImageTypeSpecifier], imageType] if[binary_operation[member[.param], !=, literal[null]]] begin[{] local_variable[type[BufferedImage], dest] if[binary_operation[member[.dest], !=, literal[null]]] begin[{] local_variable[type[boolean], found] while[call[types.hasNext, parameter[]]] begin[{] local_variable[type[ImageTypeSpecifier], specifier] local_variable[type[int], bufferedImageType] if[binary_operation[binary_operation[member[.bufferedImageType], !=, literal[0]], &&, binary_operation[member[.bufferedImageType], ==, call[dest.getType, parameter[]]]]] begin[{] assign[member[.found], literal[true]] BreakStatement(goto=None, label=None) else begin[{] if[binary_operation[binary_operation[call[specifier.getSampleModel, parameter[]], ==, call[dest.getSampleModel, parameter[]]], &&, binary_operation[call[specifier.getNumBands, parameter[]], <=, call[dest.getSampleModel, parameter[]]]]] begin[{] assign[member[.found], literal[true]] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] end[}] if[member[.found]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination image from ImageReadParam does not match legal imageTypes from reader: %s"), MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IIOException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.dest]] else begin[{] None end[}] assign[member[.imageType], call[param.getDestinationType, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.imageType], ==, literal[null]]] begin[{] assign[member[.imageType], call[types.next, parameter[]]] else begin[{] local_variable[type[boolean], foundIt] while[call[types.hasNext, parameter[]]] begin[{] local_variable[type[ImageTypeSpecifier], type] if[call[type.equals, parameter[member[.imageType]]]] begin[{] assign[member[.foundIt], literal[true]] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] if[member[.foundIt]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination type from ImageReadParam does not match legal imageTypes from reader: %s"), MemberReference(member=imageType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IIOException, sub_type=None)), label=None) else begin[{] None end[}] end[}] local_variable[type[Rectangle], srcRegion] local_variable[type[Rectangle], destRegion] call[.computeRegions, parameter[member[.param], member[.width], member[.height], literal[null], member[.srcRegion], member[.destRegion]]] local_variable[type[int], destWidth] local_variable[type[int], destHeight] if[binary_operation[binary_operation[Cast(expression=MemberReference(member=destWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=long)), *, member[.destHeight]], >, member[Integer.MAX_VALUE]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="destination width * height > Integer.MAX_VALUE: %d"), BinaryOperation(operandl=Cast(expression=MemberReference(member=destWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=long)), operandr=MemberReference(member=destHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[imageType.createBufferedImage, parameter[member[.destWidth], member[.destHeight]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BufferedImage] identifier[getDestination] operator[SEP] Keyword[final] identifier[ImageReadParam] identifier[param] , Keyword[final] identifier[Iterator] operator[<] identifier[ImageTypeSpecifier] operator[>] identifier[types] , Keyword[final] Keyword[int] identifier[width] , Keyword[final] Keyword[int] identifier[height] operator[SEP] Keyword[throws] identifier[IIOException] { Keyword[if] operator[SEP] identifier[types] operator[==] Other[null] operator[||] operator[!] identifier[types] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[ImageTypeSpecifier] identifier[imageType] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[param] operator[!=] Other[null] operator[SEP] { identifier[BufferedImage] identifier[dest] operator[=] identifier[param] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dest] operator[!=] Other[null] operator[SEP] { Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[types] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[ImageTypeSpecifier] identifier[specifier] operator[=] identifier[types] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[bufferedImageType] operator[=] identifier[specifier] operator[SEP] identifier[getBufferedImageType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bufferedImageType] operator[!=] Other[0] operator[&&] identifier[bufferedImageType] operator[==] identifier[dest] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[specifier] operator[SEP] identifier[getSampleModel] operator[SEP] operator[SEP] operator[SEP] identifier[getTransferType] operator[SEP] operator[SEP] operator[==] identifier[dest] operator[SEP] identifier[getSampleModel] operator[SEP] operator[SEP] operator[SEP] identifier[getTransferType] operator[SEP] operator[SEP] operator[&&] identifier[specifier] operator[SEP] identifier[getNumBands] operator[SEP] operator[SEP] operator[<=] identifier[dest] operator[SEP] identifier[getSampleModel] operator[SEP] operator[SEP] operator[SEP] identifier[getNumBands] operator[SEP] operator[SEP] operator[SEP] { identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[if] operator[SEP] operator[!] identifier[found] operator[SEP] { Keyword[throw] Keyword[new] identifier[IIOException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[dest] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[dest] operator[SEP] } identifier[imageType] operator[=] identifier[param] operator[SEP] identifier[getDestinationType] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[imageType] operator[==] Other[null] operator[SEP] { identifier[imageType] operator[=] identifier[types] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[boolean] identifier[foundIt] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[types] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[ImageTypeSpecifier] identifier[type] operator[=] identifier[types] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[imageType] operator[SEP] operator[SEP] { identifier[foundIt] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[foundIt] operator[SEP] { Keyword[throw] Keyword[new] identifier[IIOException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[imageType] operator[SEP] operator[SEP] operator[SEP] } } identifier[Rectangle] identifier[srcRegion] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] Other[0] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[Rectangle] identifier[destRegion] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] Other[0] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[computeRegions] operator[SEP] identifier[param] , identifier[width] , identifier[height] , Other[null] , identifier[srcRegion] , identifier[destRegion] operator[SEP] operator[SEP] Keyword[int] identifier[destWidth] operator[=] identifier[destRegion] operator[SEP] identifier[x] operator[+] identifier[destRegion] operator[SEP] identifier[width] operator[SEP] Keyword[int] identifier[destHeight] operator[=] identifier[destRegion] operator[SEP] identifier[y] operator[+] identifier[destRegion] operator[SEP] identifier[height] operator[SEP] Keyword[if] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[destWidth] operator[*] identifier[destHeight] operator[>] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , operator[SEP] Keyword[long] operator[SEP] identifier[destWidth] operator[*] identifier[destHeight] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[imageType] operator[SEP] identifier[createBufferedImage] operator[SEP] identifier[destWidth] , identifier[destHeight] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public static Set<Reference> toReferencesList(Vector<Object> referencesParams) throws GreenPepperServerException { Set<Reference> references = new TreeSet<Reference>(); for(Object referenceParams : referencesParams) { references.add(toReference((Vector<Object>)referenceParams)); } return references; }
class class_name[name] begin[{] method[toReferencesList, return_type[type[Set]], modifier[public static], parameter[referencesParams]] begin[{] local_variable[type[Set], references] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=referenceParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Vector, sub_type=None))], member=toReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=references, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=referencesParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=referenceParams)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[member[.references]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[Reference] operator[>] identifier[toReferencesList] operator[SEP] identifier[Vector] operator[<] identifier[Object] operator[>] identifier[referencesParams] operator[SEP] Keyword[throws] identifier[GreenPepperServerException] { identifier[Set] operator[<] identifier[Reference] operator[>] identifier[references] operator[=] Keyword[new] identifier[TreeSet] operator[<] identifier[Reference] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[referenceParams] operator[:] identifier[referencesParams] operator[SEP] { identifier[references] operator[SEP] identifier[add] operator[SEP] identifier[toReference] operator[SEP] operator[SEP] identifier[Vector] operator[<] identifier[Object] operator[>] operator[SEP] identifier[referenceParams] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[references] operator[SEP] }
public static String escapeAttributeValue(Object value, Context cx) { XMLLib xmlLib = currentXMLLib(cx); return xmlLib.escapeAttributeValue(value); }
class class_name[name] begin[{] method[escapeAttributeValue, return_type[type[String]], modifier[public static], parameter[value, cx]] begin[{] local_variable[type[XMLLib], xmlLib] return[call[xmlLib.escapeAttributeValue, parameter[member[.value]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[escapeAttributeValue] operator[SEP] identifier[Object] identifier[value] , identifier[Context] identifier[cx] operator[SEP] { identifier[XMLLib] identifier[xmlLib] operator[=] identifier[currentXMLLib] operator[SEP] identifier[cx] operator[SEP] operator[SEP] Keyword[return] identifier[xmlLib] operator[SEP] identifier[escapeAttributeValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] }
private boolean isVisibleInFrontend(AccessControllable node) { if (node == null) { return false; } // check hidden flag if (node.isHidden()) { return false; } // Fetch already logged-in user, if present (don't try to login) final Principal user = getUser(false); if (user != null) { final Principal owner = node.getOwnerNode(); // owner is always allowed to do anything with its nodes if (user.equals(node) || user.equals(owner) || Iterables.toList(user.getParents()).contains(owner)) { return true; } } // Public nodes are visible to non-auth users only if (node.isVisibleToPublicUsers() && user == null) { return true; } // Ask for user only if node is visible for authenticated users if (node.isVisibleToAuthenticatedUsers()) { if (user != null) { return true; } } return node.isGranted(Permission.read, this); }
class class_name[name] begin[{] method[isVisibleInFrontend, return_type[type[boolean]], modifier[private], parameter[node]] begin[{] if[binary_operation[member[.node], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[node.isHidden, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[Principal], user] if[binary_operation[member[.user], !=, literal[null]]] begin[{] local_variable[type[Principal], owner] if[binary_operation[binary_operation[call[user.equals, parameter[member[.node]]], ||, call[user.equals, parameter[member[.owner]]]], ||, call[Iterables.toList, parameter[call[user.getParents, parameter[]]]]]] begin[{] return[literal[true]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[call[node.isVisibleToPublicUsers, parameter[]], &&, binary_operation[member[.user], ==, literal[null]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[call[node.isVisibleToAuthenticatedUsers, parameter[]]] begin[{] if[binary_operation[member[.user], !=, literal[null]]] begin[{] return[literal[true]] else begin[{] None end[}] else begin[{] None end[}] return[call[node.isGranted, parameter[member[Permission.read], THIS[]]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isVisibleInFrontend] operator[SEP] identifier[AccessControllable] identifier[node] operator[SEP] { Keyword[if] operator[SEP] identifier[node] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[isHidden] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[final] identifier[Principal] identifier[user] operator[=] identifier[getUser] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[Principal] identifier[owner] operator[=] identifier[node] operator[SEP] identifier[getOwnerNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[SEP] identifier[equals] operator[SEP] identifier[node] operator[SEP] operator[||] identifier[user] operator[SEP] identifier[equals] operator[SEP] identifier[owner] operator[SEP] operator[||] identifier[Iterables] operator[SEP] identifier[toList] operator[SEP] identifier[user] operator[SEP] identifier[getParents] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[owner] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[isVisibleToPublicUsers] operator[SEP] operator[SEP] operator[&&] identifier[user] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[isVisibleToAuthenticatedUsers] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[user] operator[!=] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] identifier[node] operator[SEP] identifier[isGranted] operator[SEP] identifier[Permission] operator[SEP] identifier[read] , Keyword[this] operator[SEP] operator[SEP] }
public static ExpectedCondition<Boolean> invisibilityOf(final WebElement element) { return new ExpectedCondition<Boolean>() { @Override public Boolean apply(WebDriver webDriver) { return isInvisible(element); } @Override public String toString() { return "invisibility of " + element; } }; }
class class_name[name] begin[{] method[invisibilityOf, return_type[type[ExpectedCondition]], modifier[public static], parameter[element]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInvisible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=webDriver, type=ReferenceType(arguments=None, dimensions=[], name=WebDriver, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invisibility of "), operandr=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), label=None)], documentation=None, modifiers={'public'}, name=toString, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=ExpectedCondition, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ExpectedCondition] operator[<] identifier[Boolean] operator[>] identifier[invisibilityOf] operator[SEP] Keyword[final] identifier[WebElement] identifier[element] operator[SEP] { Keyword[return] Keyword[new] identifier[ExpectedCondition] operator[<] identifier[Boolean] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Boolean] identifier[apply] operator[SEP] identifier[WebDriver] identifier[webDriver] operator[SEP] { Keyword[return] identifier[isInvisible] operator[SEP] identifier[element] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[+] identifier[element] operator[SEP] } } operator[SEP] }
public static Replacer makeTable(Map<String, String> dict) { if(dict == null || dict.isEmpty()) return new Replacer(Pattern.compile("$"), new DummySubstitution("")); TableSubstitution tab = new TableSubstitution(new LinkedHashMap<String, String>(dict)); StringBuilder sb = new StringBuilder(128); sb.append("(?>"); for(String s : tab.dictionary.keySet()) { sb.append("\\Q"); sb.append(s); sb.append("\\E|"); } if(sb.length() > 3) sb.setCharAt(sb.length() - 1, ')'); else sb.append(')'); return new Replacer(Pattern.compile(sb.toString()), tab); }
class class_name[name] begin[{] method[makeTable, return_type[type[Replacer]], modifier[public static], parameter[dict]] begin[{] if[binary_operation[binary_operation[member[.dict], ==, literal[null]], ||, call[dict.isEmpty, parameter[]]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="$")], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DummySubstitution, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Replacer, sub_type=None))] else begin[{] None end[}] local_variable[type[TableSubstitution], tab] local_variable[type[StringBuilder], sb] call[sb.append, parameter[literal["(?>"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\Q")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\E|")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=tab.dictionary, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[binary_operation[call[sb.length, parameter[]], >, literal[3]]] begin[{] call[sb.setCharAt, parameter[binary_operation[call[sb.length, parameter[]], -, literal[1]], literal[')']]] else begin[{] call[sb.append, parameter[literal[')']]] end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None), MemberReference(member=tab, 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=Replacer, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Replacer] identifier[makeTable] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[dict] operator[SEP] { Keyword[if] operator[SEP] identifier[dict] operator[==] Other[null] operator[||] identifier[dict] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Replacer] operator[SEP] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] literal[String] operator[SEP] , Keyword[new] identifier[DummySubstitution] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[TableSubstitution] identifier[tab] operator[=] Keyword[new] identifier[TableSubstitution] operator[SEP] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] identifier[dict] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[128] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[tab] operator[SEP] identifier[dictionary] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[3] operator[SEP] identifier[sb] operator[SEP] identifier[setCharAt] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] , literal[String] operator[SEP] operator[SEP] Keyword[else] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Replacer] operator[SEP] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] , identifier[tab] operator[SEP] operator[SEP] }
@Override public CompletableFuture<Acknowledge> triggerCheckpoint( ExecutionAttemptID executionAttemptID, long checkpointId, long checkpointTimestamp, CheckpointOptions checkpointOptions, boolean advanceToEndOfEventTime) { log.debug("Trigger checkpoint {}@{} for {}.", checkpointId, checkpointTimestamp, executionAttemptID); final CheckpointType checkpointType = checkpointOptions.getCheckpointType(); if (advanceToEndOfEventTime && !(checkpointType.isSynchronous() && checkpointType.isSavepoint())) { throw new IllegalArgumentException("Only synchronous savepoints are allowed to advance the watermark to MAX."); } final Task task = taskSlotTable.getTask(executionAttemptID); if (task != null) { task.triggerCheckpointBarrier(checkpointId, checkpointTimestamp, checkpointOptions, advanceToEndOfEventTime); return CompletableFuture.completedFuture(Acknowledge.get()); } else { final String message = "TaskManager received a checkpoint request for unknown task " + executionAttemptID + '.'; log.debug(message); return FutureUtils.completedExceptionally(new CheckpointException(message)); } }
class class_name[name] begin[{] method[triggerCheckpoint, return_type[type[CompletableFuture]], modifier[public], parameter[executionAttemptID, checkpointId, checkpointTimestamp, checkpointOptions, advanceToEndOfEventTime]] begin[{] call[log.debug, parameter[literal["Trigger checkpoint {}@{} for {}."], member[.checkpointId], member[.checkpointTimestamp], member[.executionAttemptID]]] local_variable[type[CheckpointType], checkpointType] if[binary_operation[member[.advanceToEndOfEventTime], &&, binary_operation[call[checkpointType.isSynchronous, parameter[]], &&, call[checkpointType.isSavepoint, parameter[]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only synchronous savepoints are allowed to advance the watermark to MAX.")], 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[Task], task] if[binary_operation[member[.task], !=, literal[null]]] begin[{] call[task.triggerCheckpointBarrier, parameter[member[.checkpointId], member[.checkpointTimestamp], member[.checkpointOptions], member[.advanceToEndOfEventTime]]] return[call[CompletableFuture.completedFuture, parameter[call[Acknowledge.get, parameter[]]]]] else begin[{] local_variable[type[String], message] call[log.debug, parameter[member[.message]]] return[call[FutureUtils.completedExceptionally, parameter[ClassCreator(arguments=[MemberReference(member=message, 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=CheckpointException, sub_type=None))]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CompletableFuture] operator[<] identifier[Acknowledge] operator[>] identifier[triggerCheckpoint] operator[SEP] identifier[ExecutionAttemptID] identifier[executionAttemptID] , Keyword[long] identifier[checkpointId] , Keyword[long] identifier[checkpointTimestamp] , identifier[CheckpointOptions] identifier[checkpointOptions] , Keyword[boolean] identifier[advanceToEndOfEventTime] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[checkpointId] , identifier[checkpointTimestamp] , identifier[executionAttemptID] operator[SEP] operator[SEP] Keyword[final] identifier[CheckpointType] identifier[checkpointType] operator[=] identifier[checkpointOptions] operator[SEP] identifier[getCheckpointType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[advanceToEndOfEventTime] operator[&&] operator[!] operator[SEP] identifier[checkpointType] operator[SEP] identifier[isSynchronous] operator[SEP] operator[SEP] operator[&&] identifier[checkpointType] operator[SEP] identifier[isSavepoint] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[Task] identifier[task] operator[=] identifier[taskSlotTable] operator[SEP] identifier[getTask] operator[SEP] identifier[executionAttemptID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[task] operator[!=] Other[null] operator[SEP] { identifier[task] operator[SEP] identifier[triggerCheckpointBarrier] operator[SEP] identifier[checkpointId] , identifier[checkpointTimestamp] , identifier[checkpointOptions] , identifier[advanceToEndOfEventTime] operator[SEP] operator[SEP] Keyword[return] identifier[CompletableFuture] operator[SEP] identifier[completedFuture] operator[SEP] identifier[Acknowledge] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[String] identifier[message] operator[=] literal[String] operator[+] identifier[executionAttemptID] operator[+] literal[String] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[message] operator[SEP] operator[SEP] Keyword[return] identifier[FutureUtils] operator[SEP] identifier[completedExceptionally] operator[SEP] Keyword[new] identifier[CheckpointException] operator[SEP] identifier[message] operator[SEP] operator[SEP] operator[SEP] } }
@XmlElementDecl(namespace = "http://www.w3.org/ns/prov#", name = "others") public JAXBElement<Other> createOthers(Other value) { return new JAXBElement<Other>(_Others_QNAME, Other.class, null, value); }
class class_name[name] begin[{] method[createOthers, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Others_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Other, 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=Other, 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] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[Other] operator[>] identifier[createOthers] operator[SEP] identifier[Other] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[Other] operator[>] operator[SEP] identifier[_Others_QNAME] , identifier[Other] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public Enumeration<String> getKeys() { Set<String> handleKeys = properties.stringPropertyNames(); return Collections.enumeration(handleKeys); }
class class_name[name] begin[{] method[getKeys, return_type[type[Enumeration]], modifier[public], parameter[]] begin[{] local_variable[type[Set], handleKeys] return[call[Collections.enumeration, parameter[member[.handleKeys]]]] end[}] END[}]
Keyword[public] identifier[Enumeration] operator[<] identifier[String] operator[>] identifier[getKeys] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[handleKeys] operator[=] identifier[properties] operator[SEP] identifier[stringPropertyNames] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[enumeration] operator[SEP] identifier[handleKeys] operator[SEP] operator[SEP] }
public List<String> listDefaultString(final List<?> target, final Object defaultValue) { if (target == null) { return null; } final List<String> result = new ArrayList<String>(target.size() + 2); for (final Object element : target) { result.add(defaultString(element, defaultValue)); } return result; }
class class_name[name] begin[{] method[listDefaultString, return_type[type[List]], modifier[public], parameter[target, defaultValue]] begin[{] if[binary_operation[member[.target], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=defaultString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[listDefaultString] operator[SEP] Keyword[final] identifier[List] operator[<] operator[?] operator[>] identifier[target] , Keyword[final] identifier[Object] identifier[defaultValue] operator[SEP] { Keyword[if] operator[SEP] identifier[target] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[target] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Object] identifier[element] operator[:] identifier[target] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[defaultString] operator[SEP] identifier[element] , identifier[defaultValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@Override public Object[] findIdsByColumn(String schemaName, String tableName, String pKeyName, String columnName, Object columnValue, Class entityClazz) { TermQueryBuilder filter = QueryBuilders.termQuery(columnName, columnValue); SearchResponse response = txClient.prepareSearch(schemaName.toLowerCase()).setTypes(tableName) .addField(pKeyName).setPostFilter(filter).execute().actionGet(); SearchHits hits = response.getHits(); Long length = hits.getTotalHits(); int absoluteLength = length.intValue(); Object[] ids = new Object[absoluteLength]; int counter = 0; for (SearchHit hit : hits.getHits()) { Map<String, SearchHitField> fields = hit.getFields(); ids[counter++] = fields.get(pKeyName).getValue(); } return ids; }
class class_name[name] begin[{] method[findIdsByColumn, return_type[type[Object]], modifier[public], parameter[schemaName, tableName, pKeyName, columnName, columnValue, entityClazz]] begin[{] local_variable[type[TermQueryBuilder], filter] local_variable[type[SearchResponse], response] local_variable[type[SearchHits], hits] local_variable[type[Long], length] local_variable[type[int], absoluteLength] local_variable[type[Object], ids] local_variable[type[int], counter] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFields, postfix_operators=[], prefix_operators=[], qualifier=hit, selectors=[], type_arguments=None), name=fields)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SearchHitField, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=counter, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=pKeyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getHits, postfix_operators=[], prefix_operators=[], qualifier=hits, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=hit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SearchHit, sub_type=None))), label=None) return[member[.ids]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] operator[SEP] operator[SEP] identifier[findIdsByColumn] operator[SEP] identifier[String] identifier[schemaName] , identifier[String] identifier[tableName] , identifier[String] identifier[pKeyName] , identifier[String] identifier[columnName] , identifier[Object] identifier[columnValue] , identifier[Class] identifier[entityClazz] operator[SEP] { identifier[TermQueryBuilder] identifier[filter] operator[=] identifier[QueryBuilders] operator[SEP] identifier[termQuery] operator[SEP] identifier[columnName] , identifier[columnValue] operator[SEP] operator[SEP] identifier[SearchResponse] identifier[response] operator[=] identifier[txClient] operator[SEP] identifier[prepareSearch] operator[SEP] identifier[schemaName] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setTypes] operator[SEP] identifier[tableName] operator[SEP] operator[SEP] identifier[addField] operator[SEP] identifier[pKeyName] operator[SEP] operator[SEP] identifier[setPostFilter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] identifier[actionGet] operator[SEP] operator[SEP] operator[SEP] identifier[SearchHits] identifier[hits] operator[=] identifier[response] operator[SEP] identifier[getHits] operator[SEP] operator[SEP] operator[SEP] identifier[Long] identifier[length] operator[=] identifier[hits] operator[SEP] identifier[getTotalHits] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[absoluteLength] operator[=] identifier[length] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[ids] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[absoluteLength] operator[SEP] operator[SEP] Keyword[int] identifier[counter] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[SearchHit] identifier[hit] operator[:] identifier[hits] operator[SEP] identifier[getHits] operator[SEP] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[SearchHitField] operator[>] identifier[fields] operator[=] identifier[hit] operator[SEP] identifier[getFields] operator[SEP] operator[SEP] operator[SEP] identifier[ids] operator[SEP] identifier[counter] operator[++] operator[SEP] operator[=] identifier[fields] operator[SEP] identifier[get] operator[SEP] identifier[pKeyName] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ids] operator[SEP] }
public static void cursorIntToContentValues(Cursor cursor, String field, ContentValues values, String key) { int colIndex = cursor.getColumnIndex(field); if (!cursor.isNull(colIndex)) { values.put(key, cursor.getInt(colIndex)); } else { values.put(key, (Integer) null); } }
class class_name[name] begin[{] method[cursorIntToContentValues, return_type[void], modifier[public static], parameter[cursor, field, values, key]] begin[{] local_variable[type[int], colIndex] if[call[cursor.isNull, parameter[member[.colIndex]]]] begin[{] call[values.put, parameter[member[.key], call[cursor.getInt, parameter[member[.colIndex]]]]] else begin[{] call[values.put, parameter[member[.key], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[cursorIntToContentValues] operator[SEP] identifier[Cursor] identifier[cursor] , identifier[String] identifier[field] , identifier[ContentValues] identifier[values] , identifier[String] identifier[key] operator[SEP] { Keyword[int] identifier[colIndex] operator[=] identifier[cursor] operator[SEP] identifier[getColumnIndex] operator[SEP] identifier[field] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[cursor] operator[SEP] identifier[isNull] operator[SEP] identifier[colIndex] operator[SEP] operator[SEP] { identifier[values] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[cursor] operator[SEP] identifier[getInt] operator[SEP] identifier[colIndex] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[values] operator[SEP] identifier[put] operator[SEP] identifier[key] , operator[SEP] identifier[Integer] operator[SEP] Other[null] operator[SEP] operator[SEP] } }
public static void copyStream(final File aFile, final OutputStream aOutStream) throws IOException { final FileInputStream input = new FileInputStream(aFile); final FileChannel channel = input.getChannel(); final byte[] buffer = new byte[256 * 1024]; final ByteBuffer byteBuffer = ByteBuffer.wrap(buffer); try { for (int length = 0; (length = channel.read(byteBuffer)) != -1;) { aOutStream.write(buffer, 0, length); byteBuffer.clear(); } } finally { input.close(); } }
class class_name[name] begin[{] method[copyStream, return_type[void], modifier[public static], parameter[aFile, aOutStream]] begin[{] local_variable[type[FileInputStream], input] local_variable[type[FileChannel], channel] local_variable[type[byte], buffer] local_variable[type[ByteBuffer], byteBuffer] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=aOutStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=byteBuffer, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=byteBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=length)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[copyStream] operator[SEP] Keyword[final] identifier[File] identifier[aFile] , Keyword[final] identifier[OutputStream] identifier[aOutStream] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] identifier[FileInputStream] identifier[input] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[aFile] operator[SEP] operator[SEP] Keyword[final] identifier[FileChannel] identifier[channel] operator[=] identifier[input] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[256] operator[*] Other[1024] operator[SEP] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[byteBuffer] operator[=] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] Keyword[int] identifier[length] operator[=] Other[0] operator[SEP] operator[SEP] identifier[length] operator[=] identifier[channel] operator[SEP] identifier[read] operator[SEP] identifier[byteBuffer] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] operator[SEP] { identifier[aOutStream] operator[SEP] identifier[write] operator[SEP] identifier[buffer] , Other[0] , identifier[length] operator[SEP] operator[SEP] identifier[byteBuffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[input] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
public void setPhoneNumbers(java.util.Collection<String> phoneNumbers) { if (phoneNumbers == null) { this.phoneNumbers = null; return; } this.phoneNumbers = new com.amazonaws.internal.SdkInternalList<String>(phoneNumbers); }
class class_name[name] begin[{] method[setPhoneNumbers, return_type[void], modifier[public], parameter[phoneNumbers]] begin[{] if[binary_operation[member[.phoneNumbers], ==, literal[null]]] begin[{] assign[THIS[member[None.phoneNumbers]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.phoneNumbers]], ClassCreator(arguments=[MemberReference(member=phoneNumbers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPhoneNumbers] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[phoneNumbers] operator[SEP] { Keyword[if] operator[SEP] identifier[phoneNumbers] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[phoneNumbers] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[phoneNumbers] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[phoneNumbers] operator[SEP] operator[SEP] }
private void doVerify(Parameter p) throws NamespaceSyntaxWarning { if (p.getValue() == null) { throw new InvalidArgument("parameter value is null"); } Namespace ns = p.getNamespace(); String resourceLocation = ns.getResourceLocation(); if (resourceLocation == null) { throw new InvalidArgument("resourceLocation", resourceLocation); } // get opened namespace and lookup namespace parameter encoding JDBMNamespaceLookup il = openNamespaces.get(ns.getResourceLocation()); if (il == null) { throw new IllegalStateException("namespace index is not open."); } String encoding = il.lookup(p.getValue()); if (encoding == null) { throw new NamespaceSyntaxWarning(ns.getResourceLocation(), ns.getPrefix(), p.getValue()); } }
class class_name[name] begin[{] method[doVerify, return_type[void], modifier[private], parameter[p]] begin[{] if[binary_operation[call[p.getValue, parameter[]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="parameter value is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidArgument, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Namespace], ns] local_variable[type[String], resourceLocation] if[binary_operation[member[.resourceLocation], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="resourceLocation"), MemberReference(member=resourceLocation, 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=InvalidArgument, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[JDBMNamespaceLookup], il] if[binary_operation[member[.il], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="namespace index is not open.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], encoding] if[binary_operation[member[.encoding], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getResourceLocation, postfix_operators=[], prefix_operators=[], qualifier=ns, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPrefix, postfix_operators=[], prefix_operators=[], qualifier=ns, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NamespaceSyntaxWarning, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[doVerify] operator[SEP] identifier[Parameter] identifier[p] operator[SEP] Keyword[throws] identifier[NamespaceSyntaxWarning] { Keyword[if] operator[SEP] identifier[p] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidArgument] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Namespace] identifier[ns] operator[=] identifier[p] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[resourceLocation] operator[=] identifier[ns] operator[SEP] identifier[getResourceLocation] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resourceLocation] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidArgument] operator[SEP] literal[String] , identifier[resourceLocation] operator[SEP] operator[SEP] } identifier[JDBMNamespaceLookup] identifier[il] operator[=] identifier[openNamespaces] operator[SEP] identifier[get] operator[SEP] identifier[ns] operator[SEP] identifier[getResourceLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[il] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[encoding] operator[=] identifier[il] operator[SEP] identifier[lookup] operator[SEP] identifier[p] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[encoding] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NamespaceSyntaxWarning] operator[SEP] identifier[ns] operator[SEP] identifier[getResourceLocation] operator[SEP] operator[SEP] , identifier[ns] operator[SEP] identifier[getPrefix] operator[SEP] operator[SEP] , identifier[p] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
protected final void finish(Split split) { if (split != null) { SimonManager.getStopwatch(sqlCmdLabel).addSplit(split.stop()); } }
class class_name[name] begin[{] method[finish, return_type[void], modifier[final protected], parameter[split]] begin[{] if[binary_operation[member[.split], !=, literal[null]]] begin[{] call[SimonManager.getStopwatch, parameter[member[.sqlCmdLabel]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[final] Keyword[void] identifier[finish] operator[SEP] identifier[Split] identifier[split] operator[SEP] { Keyword[if] operator[SEP] identifier[split] operator[!=] Other[null] operator[SEP] { identifier[SimonManager] operator[SEP] identifier[getStopwatch] operator[SEP] identifier[sqlCmdLabel] operator[SEP] operator[SEP] identifier[addSplit] operator[SEP] identifier[split] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private void checkEncodingLiteral(String encodingName) throws SAXException { if (encodingName == null) { return; } if (encodingName.length() == 0) { fatal("The empty string does not a legal encoding name."); } char c = encodingName.charAt(0); if (!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')))) { fatal("The encoding name must start with an ASCII letter."); } for (int i = 1; i < encodingName.length(); i++) { c = encodingName.charAt(i); if (!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')) || (c == '.') || (c == '_') || (c == '-'))) { fatal("Illegal character in encoding name: U+" + Integer.toHexString(c) + "."); } } }
class class_name[name] begin[{] method[checkEncodingLiteral, return_type[void], modifier[private], parameter[encodingName]] begin[{] if[binary_operation[member[.encodingName], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[call[encodingName.length, parameter[]], ==, literal[0]]] begin[{] call[.fatal, parameter[literal["The empty string does not a legal encoding name."]]] else begin[{] None end[}] local_variable[type[char], c] if[binary_operation[binary_operation[binary_operation[member[.c], >=, literal['a']], &&, binary_operation[member[.c], <=, literal['z']]], ||, binary_operation[binary_operation[member[.c], >=, literal['A']], &&, binary_operation[member[.c], <=, literal['Z']]]]] begin[{] call[.fatal, parameter[literal["The encoding name must start with an ASCII letter."]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=encodingName, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='z'), operator=<=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='Z'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='_'), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal character in encoding name: U+"), operandr=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+)], member=fatal, 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=length, postfix_operators=[], prefix_operators=[], qualifier=encodingName, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), 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[void] identifier[checkEncodingLiteral] operator[SEP] identifier[String] identifier[encodingName] operator[SEP] Keyword[throws] identifier[SAXException] { Keyword[if] operator[SEP] identifier[encodingName] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[encodingName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[fatal] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[char] identifier[c] operator[=] identifier[encodingName] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[>=] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[c] operator[<=] literal[String] operator[SEP] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[c] operator[>=] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[c] operator[<=] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[fatal] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[encodingName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[c] operator[=] identifier[encodingName] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[>=] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[c] operator[<=] literal[String] operator[SEP] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[c] operator[>=] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[c] operator[<=] literal[String] operator[SEP] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[c] operator[>=] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[c] operator[<=] literal[String] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[SEP] operator[SEP] { identifier[fatal] operator[SEP] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[c] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } } }
private Class<?> getClassForType(String typeName) throws GPUdbException { typeName = typeName.replace(" ", ""); if (typeName.equalsIgnoreCase(STRING_TYPE_NAME)) { return String.class; } else if (typeName.equalsIgnoreCase(LONG_TYPE_NAME)) { return Long.class; } else if (typeName.equalsIgnoreCase(INTEGER_TYPE_NAME)) { return Integer.class; } else if (typeName.equalsIgnoreCase(FLOAT_TYPE_NAME)) { return Float.class; } else if (typeName.equalsIgnoreCase(DOUBLE_TYPE_NAME)) { return Double.class; } else if (typeName.equalsIgnoreCase(BYTES_TYPE_NAME)) { return ByteBuffer.class; } else { throw new GPUdbException("Error: unknown type '" + typeName + "' in table schema"); } }
class class_name[name] begin[{] method[getClassForType, return_type[type[Class]], modifier[private], parameter[typeName]] begin[{] assign[member[.typeName], call[typeName.replace, parameter[literal[" "], literal[""]]]] if[call[typeName.equalsIgnoreCase, parameter[member[.STRING_TYPE_NAME]]]] begin[{] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] else begin[{] if[call[typeName.equalsIgnoreCase, parameter[member[.LONG_TYPE_NAME]]]] begin[{] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))] else begin[{] if[call[typeName.equalsIgnoreCase, parameter[member[.INTEGER_TYPE_NAME]]]] begin[{] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))] else begin[{] if[call[typeName.equalsIgnoreCase, parameter[member[.FLOAT_TYPE_NAME]]]] begin[{] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))] else begin[{] if[call[typeName.equalsIgnoreCase, parameter[member[.DOUBLE_TYPE_NAME]]]] begin[{] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))] else begin[{] if[call[typeName.equalsIgnoreCase, parameter[member[.BYTES_TYPE_NAME]]]] begin[{] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteBuffer, sub_type=None))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error: unknown type '"), operandr=MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' in table schema"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GPUdbException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[private] identifier[Class] operator[<] operator[?] operator[>] identifier[getClassForType] operator[SEP] identifier[String] identifier[typeName] operator[SEP] Keyword[throws] identifier[GPUdbException] { identifier[typeName] operator[=] identifier[typeName] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[STRING_TYPE_NAME] operator[SEP] operator[SEP] { Keyword[return] identifier[String] operator[SEP] Keyword[class] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[typeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[LONG_TYPE_NAME] operator[SEP] operator[SEP] { Keyword[return] identifier[Long] operator[SEP] Keyword[class] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[typeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[INTEGER_TYPE_NAME] operator[SEP] operator[SEP] { Keyword[return] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[typeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[FLOAT_TYPE_NAME] operator[SEP] operator[SEP] { Keyword[return] identifier[Float] operator[SEP] Keyword[class] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[typeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[DOUBLE_TYPE_NAME] operator[SEP] operator[SEP] { Keyword[return] identifier[Double] operator[SEP] Keyword[class] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[typeName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[BYTES_TYPE_NAME] operator[SEP] operator[SEP] { Keyword[return] identifier[ByteBuffer] operator[SEP] Keyword[class] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[GPUdbException] operator[SEP] literal[String] operator[+] identifier[typeName] operator[+] literal[String] operator[SEP] operator[SEP] } }
public boolean isAssignableFrom(final Type<?> type) { Utils.validateNotNull(type, "Type cannot be null"); final TypeRegistry typeRegistry = TypeRegistry.getInstance(); return typeRegistry.isAssignableFrom(this, type); }
class class_name[name] begin[{] method[isAssignableFrom, return_type[type[boolean]], modifier[public], parameter[type]] begin[{] call[Utils.validateNotNull, parameter[member[.type], literal["Type cannot be null"]]] local_variable[type[TypeRegistry], typeRegistry] return[call[typeRegistry.isAssignableFrom, parameter[THIS[], member[.type]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isAssignableFrom] operator[SEP] Keyword[final] identifier[Type] operator[<] operator[?] operator[>] identifier[type] operator[SEP] { identifier[Utils] operator[SEP] identifier[validateNotNull] operator[SEP] identifier[type] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[TypeRegistry] identifier[typeRegistry] operator[=] identifier[TypeRegistry] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[typeRegistry] operator[SEP] identifier[isAssignableFrom] operator[SEP] Keyword[this] , identifier[type] operator[SEP] operator[SEP] }
public static List<Pipe> getAllGramsPipes(String name, File inputFile, boolean ignoreCase) throws Exception { return getAllGramsPipes(name, inputFile, ignoreCase, 1); }
class class_name[name] begin[{] method[getAllGramsPipes, return_type[type[List]], modifier[public static], parameter[name, inputFile, ignoreCase]] begin[{] return[call[.getAllGramsPipes, parameter[member[.name], member[.inputFile], member[.ignoreCase], literal[1]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Pipe] operator[>] identifier[getAllGramsPipes] operator[SEP] identifier[String] identifier[name] , identifier[File] identifier[inputFile] , Keyword[boolean] identifier[ignoreCase] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[return] identifier[getAllGramsPipes] operator[SEP] identifier[name] , identifier[inputFile] , identifier[ignoreCase] , Other[1] operator[SEP] operator[SEP] }
public Iterable<BoxTaskAssignment.Info> getAllAssignments(String ... fields) { final QueryStringBuilder builder = new QueryStringBuilder(); if (fields.length > 0) { builder.appendParam("fields", fields); } return new Iterable<BoxTaskAssignment.Info>() { public Iterator<BoxTaskAssignment.Info> iterator() { URL url = GET_ASSIGNMENTS_URL_TEMPLATE.buildWithQuery( BoxTask.this.getAPI().getBaseURL(), builder.toString(), BoxTask.this.getID()); return new BoxTaskAssignmentIterator(BoxTask.this.getAPI(), url); } }; }
class class_name[name] begin[{] method[getAllAssignments, return_type[type[Iterable]], modifier[public], parameter[fields]] begin[{] local_variable[type[QueryStringBuilder], builder] if[binary_operation[member[fields.length], >, literal[0]]] begin[{] call[builder.appendParam, parameter[literal["fields"], member[.fields]]] else begin[{] None end[}] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=BoxTask, selectors=[MethodInvocation(arguments=[], member=getAPI, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getBaseURL, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=BoxTask, selectors=[MethodInvocation(arguments=[], member=getID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=buildWithQuery, postfix_operators=[], prefix_operators=[], qualifier=GET_ASSIGNMENTS_URL_TEMPLATE, selectors=[], type_arguments=None), name=url)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=BoxTask, selectors=[MethodInvocation(arguments=[], member=getAPI, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MemberReference(member=url, 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=BoxTaskAssignmentIterator, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=iterator, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BoxTaskAssignment, sub_type=ReferenceType(arguments=None, dimensions=None, name=Info, sub_type=None)))], dimensions=[], name=Iterator, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BoxTaskAssignment, sub_type=ReferenceType(arguments=None, dimensions=None, name=Info, sub_type=None)))], dimensions=None, name=Iterable, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Iterable] operator[<] identifier[BoxTaskAssignment] operator[SEP] identifier[Info] operator[>] identifier[getAllAssignments] operator[SEP] identifier[String] operator[...] identifier[fields] operator[SEP] { Keyword[final] identifier[QueryStringBuilder] identifier[builder] operator[=] Keyword[new] identifier[QueryStringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fields] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[builder] operator[SEP] identifier[appendParam] operator[SEP] literal[String] , identifier[fields] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Iterable] operator[<] identifier[BoxTaskAssignment] operator[SEP] identifier[Info] operator[>] operator[SEP] operator[SEP] { Keyword[public] identifier[Iterator] operator[<] identifier[BoxTaskAssignment] operator[SEP] identifier[Info] operator[>] identifier[iterator] operator[SEP] operator[SEP] { identifier[URL] identifier[url] operator[=] identifier[GET_ASSIGNMENTS_URL_TEMPLATE] operator[SEP] identifier[buildWithQuery] operator[SEP] identifier[BoxTask] operator[SEP] Keyword[this] operator[SEP] identifier[getAPI] operator[SEP] operator[SEP] operator[SEP] identifier[getBaseURL] operator[SEP] operator[SEP] , identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[BoxTask] operator[SEP] Keyword[this] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[BoxTaskAssignmentIterator] operator[SEP] identifier[BoxTask] operator[SEP] Keyword[this] operator[SEP] identifier[getAPI] operator[SEP] operator[SEP] , identifier[url] operator[SEP] operator[SEP] } } operator[SEP] }
public Span nextSpan(Message<?> message) { MessageHeaderAccessor headers = mutableHeaderAccessor(message); TraceContextOrSamplingFlags extracted = this.extractor.extract(headers); headers.setImmutable(); Span result = this.tracer.nextSpan(extracted); if (extracted.context() == null && !result.isNoop()) { addTags(message, result, null); } if (log.isDebugEnabled()) { log.debug("Created a new span " + result); } return result; }
class class_name[name] begin[{] method[nextSpan, return_type[type[Span]], modifier[public], parameter[message]] begin[{] local_variable[type[MessageHeaderAccessor], headers] local_variable[type[TraceContextOrSamplingFlags], extracted] call[headers.setImmutable, parameter[]] local_variable[type[Span], result] if[binary_operation[binary_operation[call[extracted.context, parameter[]], ==, literal[null]], &&, call[result.isNoop, parameter[]]]] begin[{] call[.addTags, parameter[member[.message], member[.result], literal[null]]] else begin[{] None end[}] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[literal["Created a new span "], +, member[.result]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[Span] identifier[nextSpan] operator[SEP] identifier[Message] operator[<] operator[?] operator[>] identifier[message] operator[SEP] { identifier[MessageHeaderAccessor] identifier[headers] operator[=] identifier[mutableHeaderAccessor] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[TraceContextOrSamplingFlags] identifier[extracted] operator[=] Keyword[this] operator[SEP] identifier[extractor] operator[SEP] identifier[extract] operator[SEP] identifier[headers] operator[SEP] operator[SEP] identifier[headers] operator[SEP] identifier[setImmutable] operator[SEP] operator[SEP] operator[SEP] identifier[Span] identifier[result] operator[=] Keyword[this] operator[SEP] identifier[tracer] operator[SEP] identifier[nextSpan] operator[SEP] identifier[extracted] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extracted] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[==] Other[null] operator[&&] operator[!] identifier[result] operator[SEP] identifier[isNoop] operator[SEP] operator[SEP] operator[SEP] { identifier[addTags] operator[SEP] identifier[message] , identifier[result] , Other[null] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[result] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@ShellMethod(key = "validate-endpoint", value = "Test connections to an endpoint to verify connectivity, SSL, etc") public void validateEndpoint( @ShellOption(value = {"url"}, help = "Endpoint URL to test") final String url, @ShellOption(value = {"proxy"}, help = "Proxy address to use when testing the endpoint url") final String proxy, @ShellOption(value = {"timeout"}, help = "Timeout to use in milliseconds when testing the url", defaultValue = "5000") final int timeout) { try { LOGGER.info("Trying to connect to [{}]", url); val conn = createConnection(url, proxy); LOGGER.info("Setting connection timeout to [{}]", timeout); conn.setConnectTimeout(timeout); try (val reader = new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8); val in = new BufferedReader(reader)) { in.readLine(); if (conn instanceof HttpURLConnection) { val code = ((HttpURLConnection) conn).getResponseCode(); LOGGER.info("Response status code received: [{}]", code); } LOGGER.info("Successfully connected to url [{}]", url); } } catch (final Exception e) { LOGGER.info("Could not connect to the host address [{}]", url); LOGGER.info("The error is: [{}]", e.getMessage()); LOGGER.info("Here are the details:"); LOGGER.error(consolidateExceptionMessages(e)); testBadTlsConnection(url, proxy); } }
class class_name[name] begin[{] method[validateEndpoint, return_type[void], modifier[public], parameter[url, proxy, timeout]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Trying to connect to [{}]"), MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=proxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=conn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Setting connection timeout to [{}]"), MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConnectTimeout, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None)), name=code)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Response status code received: [{}]"), MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Successfully connected to url [{}]"), MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=reader, type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None), value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=StandardCharsets, 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))), TryResource(annotations=[], modifiers=set(), name=in, type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=reader, 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=BufferedReader, sub_type=None)))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not connect to the host address [{}]"), MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The error is: [{}]"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Here are the details:")], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=consolidateExceptionMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=proxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=testBadTlsConnection, 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) end[}] END[}]
annotation[@] identifier[ShellMethod] operator[SEP] identifier[key] operator[=] literal[String] , identifier[value] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[validateEndpoint] operator[SEP] annotation[@] identifier[ShellOption] operator[SEP] identifier[value] operator[=] { literal[String] } , identifier[help] operator[=] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[url] , annotation[@] identifier[ShellOption] operator[SEP] identifier[value] operator[=] { literal[String] } , identifier[help] operator[=] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[proxy] , annotation[@] identifier[ShellOption] operator[SEP] identifier[value] operator[=] { literal[String] } , identifier[help] operator[=] literal[String] , identifier[defaultValue] operator[=] literal[String] operator[SEP] Keyword[final] Keyword[int] identifier[timeout] operator[SEP] { Keyword[try] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[url] operator[SEP] operator[SEP] identifier[val] identifier[conn] operator[=] identifier[createConnection] operator[SEP] identifier[url] , identifier[proxy] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[timeout] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setConnectTimeout] operator[SEP] identifier[timeout] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[val] identifier[reader] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[conn] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] identifier[val] identifier[in] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] identifier[reader] operator[SEP] operator[SEP] { identifier[in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conn] Keyword[instanceof] identifier[HttpURLConnection] operator[SEP] { identifier[val] identifier[code] operator[=] operator[SEP] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[conn] operator[SEP] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[code] operator[SEP] operator[SEP] } identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[url] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[url] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] identifier[consolidateExceptionMessages] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] identifier[testBadTlsConnection] operator[SEP] identifier[url] , identifier[proxy] operator[SEP] operator[SEP] } }
public static RePairGrammar parse(String inputStr) { Date start0 = new Date(); LOGGER.debug("input string (" + String.valueOf(countSpaces(inputStr) + 1) + " tokens) "); RePairGrammar grammar = new RePairGrammar(); // two data structures // // 1.0. - the string ArrayList<RePairSymbolRecord> symbolizedString = new ArrayList<RePairSymbolRecord>( countSpaces(inputStr) + 1); // 2.0. - the priority queue RepairPriorityQueue digramsQueue = new RepairPriorityQueue(); // 3.0. - the R0 digrams occurrence hashtable: <digram string> -> <R0 occurrence indexes> HashMap<String, ArrayList<Integer>> digramsTable = new HashMap<String, ArrayList<Integer>>(); // 3.1. - all digrams ever seen will be here // HashMap<String, ArrayList<Integer>> allDigramsTable = new HashMap<String, // ArrayList<Integer>>(); // tokenize the input string StringTokenizer st = new StringTokenizer(inputStr, " "); // while there are tokens, populate digrams hash and construct the table // int stringPositionCounter = 0; while (st.hasMoreTokens()) { // got token, make a symbol String token = st.nextToken(); RePairSymbol symbol = new RePairSymbol(token, stringPositionCounter); // LOGGER.debug("token @" + stringPositionCounter + ": " + token); // add it to the string RePairSymbolRecord sr = new RePairSymbolRecord(symbol); symbolizedString.add(sr); // make a digram if we at the second and all consecutive places if (stringPositionCounter > 0) { // digram str StringBuffer digramStr = new StringBuffer(); digramStr.append(symbolizedString.get(stringPositionCounter - 1).getPayload().toString()) .append(SPACE) .append(symbolizedString.get(stringPositionCounter).getPayload().toString()); // fill the digram occurrence frequency if (digramsTable.containsKey(digramStr.toString())) { digramsTable.get(digramStr.toString()).add(stringPositionCounter - 1); // LOGGER.debug(" .added a digram entry to: " + digramStr.toString()); } else { ArrayList<Integer> arr = new ArrayList<Integer>(); arr.add(stringPositionCounter - 1); digramsTable.put(digramStr.toString(), arr); // LOGGER.debug(" .created a digram entry for: " + digramStr.toString()); } symbolizedString.get(stringPositionCounter - 1).setNext(sr); sr.setPrevious(symbolizedString.get(stringPositionCounter - 1)); } // go on stringPositionCounter++; } Date start1 = new Date(); LOGGER.debug("tokenized input and extracted all pairs in " + SAXProcessor.timeToString(start0.getTime(), start1.getTime()) + ", " + digramsTable.size() + " distinct pairs found"); // LOGGER.debug("parsed the input string into the doubly linked list of tokens ..."); // LOGGER.debug("RePair input: " + asString(symbolizedString)); // LOGGER.debug("digrams table: " + printHash(digramsTable).replace("\n", // "\n ")); // allDigramsTable.putAll(digramsTable); // LOGGER.debug("populating the priority queue..."); // populate the priority queue and the index -> digram record map // for (Entry<String, ArrayList<Integer>> e : digramsTable.entrySet()) { if (e.getValue().size() > 1) { // create a digram record RepairDigramRecord dr = new RepairDigramRecord(e.getKey(), e.getValue().size()); // put the record into the priority queue digramsQueue.enqueue(dr); } } Date start2 = new Date(); // LOGGER.debug("built the priority queue in " // + SAXProcessor.timeToString(start1.getTime(), start2.getTime()) + ", " + digramsQueue.size() // + " digrams in the queue"); // LOGGER.debug(digramsQueue.toString().replace("\n", // "\n ")); // System.out.println(digramsQueue.toString()); // start the Re-Pair cycle // RepairDigramRecord entry = null; while ((entry = digramsQueue.dequeue()) != null) { // LOGGER.debug(" *the current R0: " + asString(symbolizedString)); // LOGGER.debug(" *digrams table: " + printHash(digramsTable).replace("\n", // "\n ")); // // LOGGER.debug(" *polled a priority queue entry: " + entry.str + " : " + entry.freq); // LOGGER.debug(" *" + digramsQueue.toString().replace("\n", // "\n ")); // digramsQueue.runCheck(); // create a new rule // ArrayList<Integer> occurrences = digramsTable.get(entry.str); RePairSymbolRecord first = symbolizedString.get(occurrences.get(0)); RePairSymbolRecord second = first.getNext(); RePairRule r = new RePairRule(grammar); // System.out.println("polled a priority queue entry: " + entry.str + " : " + entry.freq + " -> created the rule " + r.ruleNumber); r.setFirst(first.getPayload()); r.setSecond(second.getPayload()); r.assignLevel(); r.setExpandedRule( first.getPayload().toExpandedString() + SPACE + second.getPayload().toExpandedString()); // LOGGER.debug(" .creating the rule: " + r.toInfoString()); // // // substitute each digram entry with the rule // // // LOGGER.debug(" .substituting the digram at locations: " + occurrences.toString()); HashSet<String> newDigrams = new HashSet<String>(occurrences.size()); // sometimes we remove some of those... ArrayList<Integer> loopOccurrences = new ArrayList<Integer>(occurrences.size()); for (Integer i : occurrences) { loopOccurrences.add(i); } while (!(loopOccurrences.isEmpty())) { // secure the position // int currentIndex = loopOccurrences.remove(0); RePairSymbolRecord currentS = symbolizedString.get(currentIndex); RePairSymbolRecord nextS = symbolizedString.get(currentIndex).getNext(); // 1.0. create a new guard to replace the digram // RePairGuard g = new RePairGuard(r); g.setStringPosition(currentS.getIndex()); r.addOccurrence(currentS.getIndex()); RePairSymbolRecord guard = new RePairSymbolRecord(g); symbolizedString.set(currentIndex, guard); // also place a NULL placeholder next RePairSymbolRecord nextNotNull = nextS.getNext(); guard.setNext(nextNotNull); if (null != nextNotNull) { nextNotNull.setPrevious(guard); } RePairSymbolRecord prevNotNull = currentS.getPrevious(); guard.setPrevious(prevNotNull); if (null != prevNotNull) { prevNotNull.setNext(guard); } // 2.0 correct entry at the left // if (currentIndex > 0 && null != prevNotNull) { // cleanup old left digram String oldLeftDigram = prevNotNull.getPayload().toString() + " " + currentS.getPayload().toString(); int newFreq = digramsTable.get(oldLeftDigram).size() - 1; // consoleLogger // .debug(" .removed left digram entry @" + prevNotNull.getPayload().getStringPosition() // + " " + oldLeftDigram + ", new freq: " + newFreq); digramsTable.get(oldLeftDigram).remove(Integer.valueOf(prevNotNull.getIndex())); if (oldLeftDigram.equalsIgnoreCase(entry.str)) { loopOccurrences.remove(Integer.valueOf(prevNotNull.getIndex())); } digramsQueue.updateDigramFrequency(oldLeftDigram, newFreq); // if it was the last entry... if (0 == newFreq) { digramsTable.remove(oldLeftDigram); newDigrams.remove(oldLeftDigram); } // and place the new digram entry String newLeftDigram = prevNotNull.getPayload().toString() + " " + r.toString(); // see the new freq.. if (digramsTable.containsKey(newLeftDigram)) { digramsTable.get(newLeftDigram).add(prevNotNull.getPayload().getStringPosition()); // LOGGER.debug(" .added a digram entry to: " + newLeftDigram + ", @" // + prevNotNull.getPayload().getStringPosition()); } else { ArrayList<Integer> arr = new ArrayList<Integer>(); arr.add(prevNotNull.getPayload().getStringPosition()); digramsTable.put(newLeftDigram, arr); // LOGGER.debug(" .created a digram entry for: " + newLeftDigram.toString() // + ", @" + prevNotNull.getPayload().getStringPosition()); } newDigrams.add(newLeftDigram); } // 3.0 correct entry at the right // RePairSymbolRecord nextSS = nextS.getNext(); if (currentIndex < symbolizedString.size() - 2 && null != nextSS) { // cleanup old left digram String oldRightDigram = nextS.getPayload().toString() + " " + nextSS.getPayload().toString(); int newFreq = digramsTable.get(oldRightDigram).size() - 1; // consoleLogger // .debug(" .removed right digram entry @" + nextSS.getPayload().getStringPosition() // + " " + oldRightDigram + ", new freq: " + newFreq); digramsTable.get(oldRightDigram).remove(Integer.valueOf(nextS.getIndex())); if (oldRightDigram.equalsIgnoreCase(entry.str)) { loopOccurrences.remove(Integer.valueOf(nextS.getIndex())); } digramsQueue.updateDigramFrequency(oldRightDigram, newFreq); // if it was the last entry... if (0 == newFreq) { digramsTable.remove(oldRightDigram); newDigrams.remove(oldRightDigram); } // and place the new digram entry String newRightDigram = r.toString() + " " + nextSS.getPayload().toString(); // see the new freq.. if (digramsTable.containsKey(newRightDigram)) { digramsTable.get(newRightDigram).add(currentS.getPayload().getStringPosition()); // LOGGER.debug(" .added a digram entry to: " + newRightDigram + ", @" // + currentS.getPayload().getStringPosition()); } else { ArrayList<Integer> arr = new ArrayList<Integer>(); arr.add(currentS.getPayload().getStringPosition()); digramsTable.put(newRightDigram, arr); // LOGGER.debug(" .created a digram entry for: " + newRightDigram.toString() // + ", @" + currentS.getPayload().getStringPosition()); } newDigrams.add(newRightDigram); } } // walk over all occurrences // voila -- remove the digram itself from the tracking table digramsTable.remove(entry.str); // update new digram frequencies and if needed place those into priority queue // for (String digramStr : newDigrams) { if (digramsTable.get(digramStr).size() > 1) { if (digramsQueue.containsDigram(digramStr)) { digramsQueue.updateDigramFrequency(digramStr, digramsTable.get(digramStr).size()); } else { digramsQueue .enqueue(new RepairDigramRecord(digramStr, digramsTable.get(digramStr).size())); } } } } Date start3 = new Date(); LOGGER.debug("finished repair grammar construction in " + SAXProcessor.timeToString(start2.getTime(), start3.getTime())); // LOGGER.debug("finished RePair run ..."); // LOGGER.debug("R0: " + asString(symbolizedString)); // LOGGER.debug("digrams table: " + printHash(digramsTable).replace("\n", // "\n ")); // LOGGER.debug("digrams queue: " + digramsQueue.toString().replace("\n", // "\n ")); grammar.setR0String(asString(symbolizedString)); // and since all completed, set the expanded string too grammar.setR0ExpnadedString(inputStr.substring(0)); return grammar; }
class class_name[name] begin[{] method[parse, return_type[type[RePairGrammar]], modifier[public static], parameter[inputStr]] begin[{] local_variable[type[Date], start0] call[LOGGER.debug, parameter[binary_operation[binary_operation[literal["input string ("], +, call[String.valueOf, parameter[binary_operation[call[.countSpaces, parameter[member[.inputStr]]], +, literal[1]]]]], +, literal[" tokens) "]]]] local_variable[type[RePairGrammar], grammar] local_variable[type[ArrayList], symbolizedString] local_variable[type[RepairPriorityQueue], digramsQueue] local_variable[type[HashMap], digramsTable] local_variable[type[StringTokenizer], st] local_variable[type[int], stringPositionCounter] while[call[st.hasMoreTokens, parameter[]]] begin[{] local_variable[type[String], token] local_variable[type[RePairSymbol], symbol] local_variable[type[RePairSymbolRecord], sr] call[symbolizedString.add, parameter[member[.sr]]] if[binary_operation[member[.stringPositionCounter], >, literal[0]]] begin[{] local_variable[type[StringBuffer], digramStr] call[digramStr.append, parameter[call[symbolizedString.get, parameter[binary_operation[member[.stringPositionCounter], -, literal[1]]]]]] if[call[digramsTable.containsKey, parameter[call[digramStr.toString, parameter[]]]]] begin[{] call[digramsTable.get, parameter[call[digramStr.toString, parameter[]]]] else begin[{] local_variable[type[ArrayList], arr] call[arr.add, parameter[binary_operation[member[.stringPositionCounter], -, literal[1]]]] call[digramsTable.put, parameter[call[digramStr.toString, parameter[]], member[.arr]]] end[}] call[symbolizedString.get, parameter[binary_operation[member[.stringPositionCounter], -, literal[1]]]] call[sr.setPrevious, parameter[call[symbolizedString.get, parameter[binary_operation[member[.stringPositionCounter], -, literal[1]]]]]] else begin[{] None end[}] member[.stringPositionCounter] end[}] local_variable[type[Date], start1] call[LOGGER.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["tokenized input and extracted all pairs in "], +, call[SAXProcessor.timeToString, parameter[call[start0.getTime, parameter[]], call[start1.getTime, parameter[]]]]], +, literal[", "]], +, call[digramsTable.size, parameter[]]], +, literal[" distinct pairs found"]]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=size, 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=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[], member=size, 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=RepairDigramRecord, sub_type=None)), name=dr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RepairDigramRecord, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=enqueue, postfix_operators=[], prefix_operators=[], qualifier=digramsQueue, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=digramsTable, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) local_variable[type[Date], start2] local_variable[type[RepairDigramRecord], entry] while[binary_operation[assign[member[.entry], call[digramsQueue.dequeue, parameter[]]], !=, literal[null]]] begin[{] local_variable[type[ArrayList], occurrences] local_variable[type[RePairSymbolRecord], first] local_variable[type[RePairSymbolRecord], second] local_variable[type[RePairRule], r] call[r.setFirst, parameter[call[first.getPayload, parameter[]]]] call[r.setSecond, parameter[call[second.getPayload, parameter[]]]] call[r.assignLevel, parameter[]] call[r.setExpandedRule, parameter[binary_operation[binary_operation[call[first.getPayload, parameter[]], +, member[.SPACE]], +, call[second.getPayload, parameter[]]]]] local_variable[type[HashSet], newDigrams] local_variable[type[ArrayList], loopOccurrences] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=loopOccurrences, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=occurrences, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None) while[call[loopOccurrences.isEmpty, parameter[]]] begin[{] local_variable[type[int], currentIndex] local_variable[type[RePairSymbolRecord], currentS] local_variable[type[RePairSymbolRecord], nextS] local_variable[type[RePairGuard], g] call[g.setStringPosition, parameter[call[currentS.getIndex, parameter[]]]] call[r.addOccurrence, parameter[call[currentS.getIndex, parameter[]]]] local_variable[type[RePairSymbolRecord], guard] call[symbolizedString.set, parameter[member[.currentIndex], member[.guard]]] local_variable[type[RePairSymbolRecord], nextNotNull] call[guard.setNext, parameter[member[.nextNotNull]]] if[binary_operation[literal[null], !=, member[.nextNotNull]]] begin[{] call[nextNotNull.setPrevious, parameter[member[.guard]]] else begin[{] None end[}] local_variable[type[RePairSymbolRecord], prevNotNull] call[guard.setPrevious, parameter[member[.prevNotNull]]] if[binary_operation[literal[null], !=, member[.prevNotNull]]] begin[{] call[prevNotNull.setNext, parameter[member[.guard]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.currentIndex], >, literal[0]], &&, binary_operation[literal[null], !=, member[.prevNotNull]]]] begin[{] local_variable[type[String], oldLeftDigram] local_variable[type[int], newFreq] call[digramsTable.get, parameter[member[.oldLeftDigram]]] if[call[oldLeftDigram.equalsIgnoreCase, parameter[member[entry.str]]]] begin[{] call[loopOccurrences.remove, parameter[call[Integer.valueOf, parameter[call[prevNotNull.getIndex, parameter[]]]]]] else begin[{] None end[}] call[digramsQueue.updateDigramFrequency, parameter[member[.oldLeftDigram], member[.newFreq]]] if[binary_operation[literal[0], ==, member[.newFreq]]] begin[{] call[digramsTable.remove, parameter[member[.oldLeftDigram]]] call[newDigrams.remove, parameter[member[.oldLeftDigram]]] else begin[{] None end[}] local_variable[type[String], newLeftDigram] if[call[digramsTable.containsKey, parameter[member[.newLeftDigram]]]] begin[{] call[digramsTable.get, parameter[member[.newLeftDigram]]] else begin[{] local_variable[type[ArrayList], arr] call[arr.add, parameter[call[prevNotNull.getPayload, parameter[]]]] call[digramsTable.put, parameter[member[.newLeftDigram], member[.arr]]] end[}] call[newDigrams.add, parameter[member[.newLeftDigram]]] else begin[{] None end[}] local_variable[type[RePairSymbolRecord], nextSS] if[binary_operation[binary_operation[member[.currentIndex], <, binary_operation[call[symbolizedString.size, parameter[]], -, literal[2]]], &&, binary_operation[literal[null], !=, member[.nextSS]]]] begin[{] local_variable[type[String], oldRightDigram] local_variable[type[int], newFreq] call[digramsTable.get, parameter[member[.oldRightDigram]]] if[call[oldRightDigram.equalsIgnoreCase, parameter[member[entry.str]]]] begin[{] call[loopOccurrences.remove, parameter[call[Integer.valueOf, parameter[call[nextS.getIndex, parameter[]]]]]] else begin[{] None end[}] call[digramsQueue.updateDigramFrequency, parameter[member[.oldRightDigram], member[.newFreq]]] if[binary_operation[literal[0], ==, member[.newFreq]]] begin[{] call[digramsTable.remove, parameter[member[.oldRightDigram]]] call[newDigrams.remove, parameter[member[.oldRightDigram]]] else begin[{] None end[}] local_variable[type[String], newRightDigram] if[call[digramsTable.containsKey, parameter[member[.newRightDigram]]]] begin[{] call[digramsTable.get, parameter[member[.newRightDigram]]] else begin[{] local_variable[type[ArrayList], arr] call[arr.add, parameter[call[currentS.getPayload, parameter[]]]] call[digramsTable.put, parameter[member[.newRightDigram], member[.arr]]] end[}] call[newDigrams.add, parameter[member[.newRightDigram]]] else begin[{] None end[}] end[}] call[digramsTable.remove, parameter[member[entry.str]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=digramStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=digramsTable, selectors=[MethodInvocation(arguments=[], member=size, 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=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=digramStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsDigram, postfix_operators=[], prefix_operators=[], qualifier=digramsQueue, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=digramStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=digramStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=digramsTable, selectors=[MethodInvocation(arguments=[], member=size, 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=RepairDigramRecord, sub_type=None))], member=enqueue, postfix_operators=[], prefix_operators=[], qualifier=digramsQueue, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=digramStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=digramStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=digramsTable, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=updateDigramFrequency, postfix_operators=[], prefix_operators=[], qualifier=digramsQueue, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=newDigrams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=digramStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] local_variable[type[Date], start3] call[LOGGER.debug, parameter[binary_operation[literal["finished repair grammar construction in "], +, call[SAXProcessor.timeToString, parameter[call[start2.getTime, parameter[]], call[start3.getTime, parameter[]]]]]]] call[grammar.setR0String, parameter[call[.asString, parameter[member[.symbolizedString]]]]] call[grammar.setR0ExpnadedString, parameter[call[inputStr.substring, parameter[literal[0]]]]] return[member[.grammar]] end[}] END[}]
Keyword[public] Keyword[static] identifier[RePairGrammar] identifier[parse] operator[SEP] identifier[String] identifier[inputStr] operator[SEP] { identifier[Date] identifier[start0] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[countSpaces] operator[SEP] identifier[inputStr] operator[SEP] operator[+] Other[1] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[RePairGrammar] identifier[grammar] operator[=] Keyword[new] identifier[RePairGrammar] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[RePairSymbolRecord] operator[>] identifier[symbolizedString] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[RePairSymbolRecord] operator[>] operator[SEP] identifier[countSpaces] operator[SEP] identifier[inputStr] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] identifier[RepairPriorityQueue] identifier[digramsQueue] operator[=] Keyword[new] identifier[RepairPriorityQueue] operator[SEP] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[>] identifier[digramsTable] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[st] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[inputStr] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[stringPositionCounter] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[st] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[token] operator[=] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[RePairSymbol] identifier[symbol] operator[=] Keyword[new] identifier[RePairSymbol] operator[SEP] identifier[token] , identifier[stringPositionCounter] operator[SEP] operator[SEP] identifier[RePairSymbolRecord] identifier[sr] operator[=] Keyword[new] identifier[RePairSymbolRecord] operator[SEP] identifier[symbol] operator[SEP] operator[SEP] identifier[symbolizedString] operator[SEP] identifier[add] operator[SEP] identifier[sr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stringPositionCounter] operator[>] Other[0] operator[SEP] { identifier[StringBuffer] identifier[digramStr] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[digramStr] operator[SEP] identifier[append] operator[SEP] identifier[symbolizedString] operator[SEP] identifier[get] operator[SEP] identifier[stringPositionCounter] operator[-] Other[1] operator[SEP] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[SPACE] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[symbolizedString] operator[SEP] identifier[get] operator[SEP] identifier[stringPositionCounter] operator[SEP] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[digramsTable] operator[SEP] identifier[containsKey] operator[SEP] identifier[digramStr] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[digramStr] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[stringPositionCounter] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[else] { identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[arr] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[add] operator[SEP] identifier[stringPositionCounter] operator[-] Other[1] operator[SEP] operator[SEP] identifier[digramsTable] operator[SEP] identifier[put] operator[SEP] identifier[digramStr] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[arr] operator[SEP] operator[SEP] } identifier[symbolizedString] operator[SEP] identifier[get] operator[SEP] identifier[stringPositionCounter] operator[-] Other[1] operator[SEP] operator[SEP] identifier[setNext] operator[SEP] identifier[sr] operator[SEP] operator[SEP] identifier[sr] operator[SEP] identifier[setPrevious] operator[SEP] identifier[symbolizedString] operator[SEP] identifier[get] operator[SEP] identifier[stringPositionCounter] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } identifier[stringPositionCounter] operator[++] operator[SEP] } identifier[Date] identifier[start1] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[SAXProcessor] operator[SEP] identifier[timeToString] operator[SEP] identifier[start0] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] , identifier[start1] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[digramsTable] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[>] identifier[e] operator[:] identifier[digramsTable] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[RepairDigramRecord] identifier[dr] operator[=] Keyword[new] identifier[RepairDigramRecord] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[digramsQueue] operator[SEP] identifier[enqueue] operator[SEP] identifier[dr] operator[SEP] operator[SEP] } } identifier[Date] identifier[start2] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[RepairDigramRecord] identifier[entry] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[entry] operator[=] identifier[digramsQueue] operator[SEP] identifier[dequeue] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[occurrences] operator[=] identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[entry] operator[SEP] identifier[str] operator[SEP] operator[SEP] identifier[RePairSymbolRecord] identifier[first] operator[=] identifier[symbolizedString] operator[SEP] identifier[get] operator[SEP] identifier[occurrences] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[RePairSymbolRecord] identifier[second] operator[=] identifier[first] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] identifier[RePairRule] identifier[r] operator[=] Keyword[new] identifier[RePairRule] operator[SEP] identifier[grammar] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[setFirst] operator[SEP] identifier[first] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[setSecond] operator[SEP] identifier[second] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[assignLevel] operator[SEP] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[setExpandedRule] operator[SEP] identifier[first] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toExpandedString] operator[SEP] operator[SEP] operator[+] identifier[SPACE] operator[+] identifier[second] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toExpandedString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[HashSet] operator[<] identifier[String] operator[>] identifier[newDigrams] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] identifier[occurrences] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[loopOccurrences] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] identifier[occurrences] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Integer] identifier[i] operator[:] identifier[occurrences] operator[SEP] { identifier[loopOccurrences] operator[SEP] identifier[add] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] operator[!] operator[SEP] identifier[loopOccurrences] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[currentIndex] operator[=] identifier[loopOccurrences] operator[SEP] identifier[remove] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[RePairSymbolRecord] identifier[currentS] operator[=] identifier[symbolizedString] operator[SEP] identifier[get] operator[SEP] identifier[currentIndex] operator[SEP] operator[SEP] identifier[RePairSymbolRecord] identifier[nextS] operator[=] identifier[symbolizedString] operator[SEP] identifier[get] operator[SEP] identifier[currentIndex] operator[SEP] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] identifier[RePairGuard] identifier[g] operator[=] Keyword[new] identifier[RePairGuard] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[setStringPosition] operator[SEP] identifier[currentS] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[addOccurrence] operator[SEP] identifier[currentS] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[RePairSymbolRecord] identifier[guard] operator[=] Keyword[new] identifier[RePairSymbolRecord] operator[SEP] identifier[g] operator[SEP] operator[SEP] identifier[symbolizedString] operator[SEP] identifier[set] operator[SEP] identifier[currentIndex] , identifier[guard] operator[SEP] operator[SEP] identifier[RePairSymbolRecord] identifier[nextNotNull] operator[=] identifier[nextS] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] identifier[guard] operator[SEP] identifier[setNext] operator[SEP] identifier[nextNotNull] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[nextNotNull] operator[SEP] { identifier[nextNotNull] operator[SEP] identifier[setPrevious] operator[SEP] identifier[guard] operator[SEP] operator[SEP] } identifier[RePairSymbolRecord] identifier[prevNotNull] operator[=] identifier[currentS] operator[SEP] identifier[getPrevious] operator[SEP] operator[SEP] operator[SEP] identifier[guard] operator[SEP] identifier[setPrevious] operator[SEP] identifier[prevNotNull] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[prevNotNull] operator[SEP] { identifier[prevNotNull] operator[SEP] identifier[setNext] operator[SEP] identifier[guard] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[currentIndex] operator[>] Other[0] operator[&&] Other[null] operator[!=] identifier[prevNotNull] operator[SEP] { identifier[String] identifier[oldLeftDigram] operator[=] identifier[prevNotNull] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[currentS] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[newFreq] operator[=] identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[oldLeftDigram] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[oldLeftDigram] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[prevNotNull] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldLeftDigram] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[entry] operator[SEP] identifier[str] operator[SEP] operator[SEP] { identifier[loopOccurrences] operator[SEP] identifier[remove] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[prevNotNull] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[digramsQueue] operator[SEP] identifier[updateDigramFrequency] operator[SEP] identifier[oldLeftDigram] , identifier[newFreq] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[0] operator[==] identifier[newFreq] operator[SEP] { identifier[digramsTable] operator[SEP] identifier[remove] operator[SEP] identifier[oldLeftDigram] operator[SEP] operator[SEP] identifier[newDigrams] operator[SEP] identifier[remove] operator[SEP] identifier[oldLeftDigram] operator[SEP] operator[SEP] } identifier[String] identifier[newLeftDigram] operator[=] identifier[prevNotNull] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[r] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[digramsTable] operator[SEP] identifier[containsKey] operator[SEP] identifier[newLeftDigram] operator[SEP] operator[SEP] { identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[newLeftDigram] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[prevNotNull] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[getStringPosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[arr] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[add] operator[SEP] identifier[prevNotNull] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[getStringPosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[digramsTable] operator[SEP] identifier[put] operator[SEP] identifier[newLeftDigram] , identifier[arr] operator[SEP] operator[SEP] } identifier[newDigrams] operator[SEP] identifier[add] operator[SEP] identifier[newLeftDigram] operator[SEP] operator[SEP] } identifier[RePairSymbolRecord] identifier[nextSS] operator[=] identifier[nextS] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentIndex] operator[<] identifier[symbolizedString] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[2] operator[&&] Other[null] operator[!=] identifier[nextSS] operator[SEP] { identifier[String] identifier[oldRightDigram] operator[=] identifier[nextS] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[nextSS] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[newFreq] operator[=] identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[oldRightDigram] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[oldRightDigram] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[nextS] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldRightDigram] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[entry] operator[SEP] identifier[str] operator[SEP] operator[SEP] { identifier[loopOccurrences] operator[SEP] identifier[remove] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[nextS] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[digramsQueue] operator[SEP] identifier[updateDigramFrequency] operator[SEP] identifier[oldRightDigram] , identifier[newFreq] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[0] operator[==] identifier[newFreq] operator[SEP] { identifier[digramsTable] operator[SEP] identifier[remove] operator[SEP] identifier[oldRightDigram] operator[SEP] operator[SEP] identifier[newDigrams] operator[SEP] identifier[remove] operator[SEP] identifier[oldRightDigram] operator[SEP] operator[SEP] } identifier[String] identifier[newRightDigram] operator[=] identifier[r] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[nextSS] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[digramsTable] operator[SEP] identifier[containsKey] operator[SEP] identifier[newRightDigram] operator[SEP] operator[SEP] { identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[newRightDigram] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[currentS] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[getStringPosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[ArrayList] operator[<] identifier[Integer] operator[>] identifier[arr] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[add] operator[SEP] identifier[currentS] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[getStringPosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[digramsTable] operator[SEP] identifier[put] operator[SEP] identifier[newRightDigram] , identifier[arr] operator[SEP] operator[SEP] } identifier[newDigrams] operator[SEP] identifier[add] operator[SEP] identifier[newRightDigram] operator[SEP] operator[SEP] } } identifier[digramsTable] operator[SEP] identifier[remove] operator[SEP] identifier[entry] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[digramStr] operator[:] identifier[newDigrams] operator[SEP] { Keyword[if] operator[SEP] identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[digramStr] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { Keyword[if] operator[SEP] identifier[digramsQueue] operator[SEP] identifier[containsDigram] operator[SEP] identifier[digramStr] operator[SEP] operator[SEP] { identifier[digramsQueue] operator[SEP] identifier[updateDigramFrequency] operator[SEP] identifier[digramStr] , identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[digramStr] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[digramsQueue] operator[SEP] identifier[enqueue] operator[SEP] Keyword[new] identifier[RepairDigramRecord] operator[SEP] identifier[digramStr] , identifier[digramsTable] operator[SEP] identifier[get] operator[SEP] identifier[digramStr] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } identifier[Date] identifier[start3] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[SAXProcessor] operator[SEP] identifier[timeToString] operator[SEP] identifier[start2] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] , identifier[start3] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[grammar] operator[SEP] identifier[setR0String] operator[SEP] identifier[asString] operator[SEP] identifier[symbolizedString] operator[SEP] operator[SEP] operator[SEP] identifier[grammar] operator[SEP] identifier[setR0ExpnadedString] operator[SEP] identifier[inputStr] operator[SEP] identifier[substring] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[grammar] operator[SEP] }
@Override public String invoke(Object connection, String request, int timeout, Map<String,String> headers) throws ConnectionException, AdapterException { HttpHelper httpHelper = null; try { // invoke service over http // allow users to override httpHelper = getHttpHelper(connection); int connectTimeout = getConnectTimeout(); if (connectTimeout > 0) httpHelper.setConnectTimeout(connectTimeout); int readTimeout = getReadTimeout(); if (readTimeout > 0) httpHelper.setReadTimeout(readTimeout); httpHelper.setHeaders(headers); String response = httpHelper.post(request); if (response != null) { int codeThreshold = DEFAULT_RETRY_HTTP_CODE; String retryCodes = getAttributeValueSmart(RETRY_HTTP_CODES); if (retryCodes != null) { try { codeThreshold = Integer.parseInt(retryCodes); } catch (NumberFormatException ex) {} // Use default in this case } Response httpResponse = super.getResponse(connection, response); if (httpResponse.getStatusCode() >= codeThreshold) throw new IOException("Server returned HTTP response code: " + httpResponse.getStatusCode()); } return response; } catch (IOException ex) { if (httpHelper != null && httpHelper.getResponse() != null) logResponse(new Response(httpHelper.getResponse())); this.logexception(ex.getMessage(), ex); throw new ConnectionException(-1, ex.getMessage(), ex); } catch (Exception ex) { this.logexception(ex.getMessage(), ex); throw new AdapterException(-1, ex.getMessage(), ex); } finally { if (httpHelper != null) { if (getResponseHeaders() == null) setResponseHeaders(new HashMap<String,String>()); getResponseHeaders().putAll(httpHelper.getHeaders()); } } }
class class_name[name] begin[{] method[invoke, return_type[type[String]], modifier[public], parameter[connection, request, timeout, headers]] begin[{] local_variable[type[HttpHelper], httpHelper] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=httpHelper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHttpHelper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConnectTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=connectTimeout)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=connectTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=connectTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConnectTimeout, postfix_operators=[], prefix_operators=[], qualifier=httpHelper, selectors=[], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getReadTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=readTimeout)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=readTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=readTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setReadTimeout, postfix_operators=[], prefix_operators=[], qualifier=httpHelper, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=headers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHeaders, postfix_operators=[], prefix_operators=[], qualifier=httpHelper, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=post, postfix_operators=[], prefix_operators=[], qualifier=httpHelper, selectors=[], type_arguments=None), name=response)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_RETRY_HTTP_CODE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=codeThreshold)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=RETRY_HTTP_CODES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributeValueSmart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=retryCodes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=retryCodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=codeThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=retryCodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=SuperMethodInvocation(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), name=httpResponse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Response, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=[], prefix_operators=[], qualifier=httpResponse, selectors=[], type_arguments=None), operandr=MemberReference(member=codeThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Server returned HTTP response code: "), operandr=MethodInvocation(arguments=[], member=getStatusCode, postfix_operators=[], prefix_operators=[], qualifier=httpResponse, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None))])), ReturnStatement(expression=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=httpHelper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=httpHelper, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=httpHelper, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))], member=logResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logexception, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConnectionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException'])), CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logexception, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AdapterException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=httpHelper, 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=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getResponseHeaders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))], member=setResponseHeaders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getResponseHeaders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHeaders, postfix_operators=[], prefix_operators=[], qualifier=httpHelper, selectors=[], type_arguments=None)], member=putAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[invoke] operator[SEP] identifier[Object] identifier[connection] , identifier[String] identifier[request] , Keyword[int] identifier[timeout] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[headers] operator[SEP] Keyword[throws] identifier[ConnectionException] , identifier[AdapterException] { identifier[HttpHelper] identifier[httpHelper] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[httpHelper] operator[=] identifier[getHttpHelper] operator[SEP] identifier[connection] operator[SEP] operator[SEP] Keyword[int] identifier[connectTimeout] operator[=] identifier[getConnectTimeout] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connectTimeout] operator[>] Other[0] operator[SEP] identifier[httpHelper] operator[SEP] identifier[setConnectTimeout] operator[SEP] identifier[connectTimeout] operator[SEP] operator[SEP] Keyword[int] identifier[readTimeout] operator[=] identifier[getReadTimeout] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readTimeout] operator[>] Other[0] operator[SEP] identifier[httpHelper] operator[SEP] identifier[setReadTimeout] operator[SEP] identifier[readTimeout] operator[SEP] operator[SEP] identifier[httpHelper] operator[SEP] identifier[setHeaders] operator[SEP] identifier[headers] operator[SEP] operator[SEP] identifier[String] identifier[response] operator[=] identifier[httpHelper] operator[SEP] identifier[post] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[codeThreshold] operator[=] identifier[DEFAULT_RETRY_HTTP_CODE] operator[SEP] identifier[String] identifier[retryCodes] operator[=] identifier[getAttributeValueSmart] operator[SEP] identifier[RETRY_HTTP_CODES] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[retryCodes] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[codeThreshold] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[retryCodes] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[ex] operator[SEP] { } } identifier[Response] identifier[httpResponse] operator[=] Keyword[super] operator[SEP] identifier[getResponse] operator[SEP] identifier[connection] , identifier[response] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[httpResponse] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[>=] identifier[codeThreshold] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[httpResponse] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[response] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] identifier[httpHelper] operator[!=] Other[null] operator[&&] identifier[httpHelper] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[logResponse] operator[SEP] Keyword[new] identifier[Response] operator[SEP] identifier[httpHelper] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[logexception] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ConnectionException] operator[SEP] operator[-] Other[1] , identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[this] operator[SEP] identifier[logexception] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AdapterException] operator[SEP] operator[-] Other[1] , identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[httpHelper] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[getResponseHeaders] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] identifier[setResponseHeaders] operator[SEP] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getResponseHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[putAll] operator[SEP] identifier[httpHelper] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
public static LongBinding decrementExact(final ObservableLongValue a) { return createLongBinding(() -> Math.decrementExact(a.get()), a); }
class class_name[name] begin[{] method[decrementExact, return_type[type[LongBinding]], modifier[public static], parameter[a]] begin[{] return[call[.createLongBinding, parameter[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None)], member=decrementExact, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), parameters=[]), member[.a]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[LongBinding] identifier[decrementExact] operator[SEP] Keyword[final] identifier[ObservableLongValue] identifier[a] operator[SEP] { Keyword[return] identifier[createLongBinding] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[Math] operator[SEP] identifier[decrementExact] operator[SEP] identifier[a] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] , identifier[a] operator[SEP] operator[SEP] }
public static String getTableNameFromId(Database catalog, int tableId) { String tableName = null; for (Table table: catalog.getTables()) { if (table.getRelativeIndex() == tableId) { tableName = table.getTypeName(); } } return tableName; }
class class_name[name] begin[{] method[getTableNameFromId, return_type[type[String]], modifier[public static], parameter[catalog, tableId]] begin[{] local_variable[type[String], tableName] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRelativeIndex, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), operandr=MemberReference(member=tableId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTypeName, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTables, postfix_operators=[], prefix_operators=[], qualifier=catalog, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=table)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))), label=None) return[member[.tableName]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getTableNameFromId] operator[SEP] identifier[Database] identifier[catalog] , Keyword[int] identifier[tableId] operator[SEP] { identifier[String] identifier[tableName] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Table] identifier[table] operator[:] identifier[catalog] operator[SEP] identifier[getTables] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[table] operator[SEP] identifier[getRelativeIndex] operator[SEP] operator[SEP] operator[==] identifier[tableId] operator[SEP] { identifier[tableName] operator[=] identifier[table] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[tableName] operator[SEP] }
private static <T> T statementToObject(final PreparedStatement stmt, final T target, final Object... args) throws SQLException { populateStatementParameters(stmt, args); try (final ResultSet resultSet = stmt.executeQuery()) { if (resultSet.next()) { return resultSetToObject(resultSet, target); } return null; } catch (Exception e) { throw new RuntimeException(e); } finally { stmt.close(); } }
class class_name[name] begin[{] method[statementToObject, return_type[type[T]], modifier[private static], parameter[stmt, target, args]] begin[{] call[.populateStatementParameters, parameter[member[.stmt], member[.args]]] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=resultSet, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=resultSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resultSetToObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None)], label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=resultSet, type=ReferenceType(arguments=None, dimensions=[], name=ResultSet, sub_type=None), value=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[statementToObject] operator[SEP] Keyword[final] identifier[PreparedStatement] identifier[stmt] , Keyword[final] identifier[T] identifier[target] , Keyword[final] identifier[Object] operator[...] identifier[args] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[populateStatementParameters] operator[SEP] identifier[stmt] , identifier[args] operator[SEP] operator[SEP] Keyword[try] operator[SEP] Keyword[final] identifier[ResultSet] identifier[resultSet] operator[=] identifier[stmt] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[resultSet] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[resultSetToObject] operator[SEP] identifier[resultSet] , identifier[target] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[stmt] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
@Override public LambdaExpression visitStandardLambdaExpression(StandardLambdaExpressionContext ctx) { return configureAST(this.createLambda(ctx.standardLambdaParameters(), ctx.lambdaBody()), ctx); }
class class_name[name] begin[{] method[visitStandardLambdaExpression, return_type[type[LambdaExpression]], modifier[public], parameter[ctx]] begin[{] return[call[.configureAST, parameter[THIS[call[None.createLambda, parameter[call[ctx.standardLambdaParameters, parameter[]], call[ctx.lambdaBody, parameter[]]]]], member[.ctx]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[LambdaExpression] identifier[visitStandardLambdaExpression] operator[SEP] identifier[StandardLambdaExpressionContext] identifier[ctx] operator[SEP] { Keyword[return] identifier[configureAST] operator[SEP] Keyword[this] operator[SEP] identifier[createLambda] operator[SEP] identifier[ctx] operator[SEP] identifier[standardLambdaParameters] operator[SEP] operator[SEP] , identifier[ctx] operator[SEP] identifier[lambdaBody] operator[SEP] operator[SEP] operator[SEP] , identifier[ctx] operator[SEP] operator[SEP] }
public static <S extends Sequence<S>> int calculateScore(S seq1, Mutations<S> mutations, AlignmentScoring<S> scoring) { return calculateScore(seq1, new Range(0, seq1.size()), mutations, scoring); }
class class_name[name] begin[{] method[calculateScore, return_type[type[int]], modifier[public static], parameter[seq1, mutations, scoring]] begin[{] return[call[.calculateScore, parameter[member[.seq1], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=seq1, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Range, sub_type=None)), member[.mutations], member[.scoring]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[S] Keyword[extends] identifier[Sequence] operator[<] identifier[S] operator[>] operator[>] Keyword[int] identifier[calculateScore] operator[SEP] identifier[S] identifier[seq1] , identifier[Mutations] operator[<] identifier[S] operator[>] identifier[mutations] , identifier[AlignmentScoring] operator[<] identifier[S] operator[>] identifier[scoring] operator[SEP] { Keyword[return] identifier[calculateScore] operator[SEP] identifier[seq1] , Keyword[new] identifier[Range] operator[SEP] Other[0] , identifier[seq1] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] , identifier[mutations] , identifier[scoring] operator[SEP] operator[SEP] }
protected String parseLocalName2(int start, int hash) throws XMLStreamException { int ptr = mInputEnd - start; // Let's assume fairly short names char[] outBuf = getNameBuffer(ptr+8); if (ptr > 0) { System.arraycopy(mInputBuffer, start, outBuf, 0, ptr); } int outLen = outBuf.length; while (true) { // note: names can not cross input block (entity) boundaries... if (mInputPtr >= mInputEnd) { if (!loadMoreFromCurrent()) { break; } } char c = mInputBuffer[mInputPtr]; if (c < CHAR_LOWEST_LEGAL_LOCALNAME_CHAR) { break; } if (!isNameChar(c)) { break; } ++mInputPtr; if (ptr >= outLen) { mNameBuffer = outBuf = expandBy50Pct(outBuf); outLen = outBuf.length; } outBuf[ptr++] = c; hash = (hash * 31) + c; } // Still need to canonicalize the name: return mSymbols.findSymbol(outBuf, 0, ptr, hash); }
class class_name[name] begin[{] method[parseLocalName2, return_type[type[String]], modifier[protected], parameter[start, hash]] begin[{] local_variable[type[int], ptr] local_variable[type[char], outBuf] if[binary_operation[member[.ptr], >, literal[0]]] begin[{] call[System.arraycopy, parameter[member[.mInputBuffer], member[.start], member[.outBuf], literal[0], member[.ptr]]] else begin[{] None end[}] local_variable[type[int], outLen] while[literal[true]] begin[{] if[binary_operation[member[.mInputPtr], >=, member[.mInputEnd]]] begin[{] if[call[.loadMoreFromCurrent, parameter[]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] else begin[{] None end[}] local_variable[type[char], c] if[binary_operation[member[.c], <, member[.CHAR_LOWEST_LEGAL_LOCALNAME_CHAR]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] if[call[.isNameChar, parameter[member[.c]]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] member[.mInputPtr] if[binary_operation[member[.ptr], >=, member[.outLen]]] begin[{] assign[member[.mNameBuffer], assign[member[.outBuf], call[.expandBy50Pct, parameter[member[.outBuf]]]]] assign[member[.outLen], member[outBuf.length]] else begin[{] None end[}] assign[member[.outBuf], member[.c]] assign[member[.hash], binary_operation[binary_operation[member[.hash], *, literal[31]], +, member[.c]]] end[}] return[call[mSymbols.findSymbol, parameter[member[.outBuf], literal[0], member[.ptr], member[.hash]]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[parseLocalName2] operator[SEP] Keyword[int] identifier[start] , Keyword[int] identifier[hash] operator[SEP] Keyword[throws] identifier[XMLStreamException] { Keyword[int] identifier[ptr] operator[=] identifier[mInputEnd] operator[-] identifier[start] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[outBuf] operator[=] identifier[getNameBuffer] operator[SEP] identifier[ptr] operator[+] Other[8] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ptr] operator[>] Other[0] operator[SEP] { identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[mInputBuffer] , identifier[start] , identifier[outBuf] , Other[0] , identifier[ptr] operator[SEP] operator[SEP] } Keyword[int] identifier[outLen] operator[=] identifier[outBuf] operator[SEP] identifier[length] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[mInputPtr] operator[>=] identifier[mInputEnd] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[loadMoreFromCurrent] operator[SEP] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } } Keyword[char] identifier[c] operator[=] identifier[mInputBuffer] operator[SEP] identifier[mInputPtr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<] identifier[CHAR_LOWEST_LEGAL_LOCALNAME_CHAR] operator[SEP] { Keyword[break] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isNameChar] operator[SEP] identifier[c] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } operator[++] identifier[mInputPtr] operator[SEP] Keyword[if] operator[SEP] identifier[ptr] operator[>=] identifier[outLen] operator[SEP] { identifier[mNameBuffer] operator[=] identifier[outBuf] operator[=] identifier[expandBy50Pct] operator[SEP] identifier[outBuf] operator[SEP] operator[SEP] identifier[outLen] operator[=] identifier[outBuf] operator[SEP] identifier[length] operator[SEP] } identifier[outBuf] operator[SEP] identifier[ptr] operator[++] operator[SEP] operator[=] identifier[c] operator[SEP] identifier[hash] operator[=] operator[SEP] identifier[hash] operator[*] Other[31] operator[SEP] operator[+] identifier[c] operator[SEP] } Keyword[return] identifier[mSymbols] operator[SEP] identifier[findSymbol] operator[SEP] identifier[outBuf] , Other[0] , identifier[ptr] , identifier[hash] operator[SEP] operator[SEP] }
private UserProfile removeUserProfile(Session session, String userName, boolean broadcast) throws Exception { Node profileNode; try { profileNode = utils.getProfileNode(session, userName); } catch (PathNotFoundException e) { return null; } UserProfile profile = readProfile(userName, profileNode); if (broadcast) { preDelete(profile, broadcast); } profileNode.remove(); session.save(); removeFromCache(profile); if (broadcast) { postDelete(profile); } return profile; }
class class_name[name] begin[{] method[removeUserProfile, return_type[type[UserProfile]], modifier[private], parameter[session, userName, broadcast]] begin[{] local_variable[type[Node], profileNode] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=profileNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProfileNode, postfix_operators=[], prefix_operators=[], qualifier=utils, 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=e, types=['PathNotFoundException']))], finally_block=None, label=None, resources=None) local_variable[type[UserProfile], profile] if[member[.broadcast]] begin[{] call[.preDelete, parameter[member[.profile], member[.broadcast]]] else begin[{] None end[}] call[profileNode.remove, parameter[]] call[session.save, parameter[]] call[.removeFromCache, parameter[member[.profile]]] if[member[.broadcast]] begin[{] call[.postDelete, parameter[member[.profile]]] else begin[{] None end[}] return[member[.profile]] end[}] END[}]
Keyword[private] identifier[UserProfile] identifier[removeUserProfile] operator[SEP] identifier[Session] identifier[session] , identifier[String] identifier[userName] , Keyword[boolean] identifier[broadcast] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Node] identifier[profileNode] operator[SEP] Keyword[try] { identifier[profileNode] operator[=] identifier[utils] operator[SEP] identifier[getProfileNode] operator[SEP] identifier[session] , identifier[userName] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PathNotFoundException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[UserProfile] identifier[profile] operator[=] identifier[readProfile] operator[SEP] identifier[userName] , identifier[profileNode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[broadcast] operator[SEP] { identifier[preDelete] operator[SEP] identifier[profile] , identifier[broadcast] operator[SEP] operator[SEP] } identifier[profileNode] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] identifier[removeFromCache] operator[SEP] identifier[profile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[broadcast] operator[SEP] { identifier[postDelete] operator[SEP] identifier[profile] operator[SEP] operator[SEP] } Keyword[return] identifier[profile] operator[SEP] }
@Override public void dispose() throws Exception { Exception exception = null; StreamTask<?, ?> containingTask = getContainingTask(); CloseableRegistry taskCloseableRegistry = containingTask != null ? containingTask.getCancelables() : null; try { if (taskCloseableRegistry == null || taskCloseableRegistry.unregisterCloseable(operatorStateBackend)) { operatorStateBackend.close(); } } catch (Exception e) { exception = e; } try { if (taskCloseableRegistry == null || taskCloseableRegistry.unregisterCloseable(keyedStateBackend)) { keyedStateBackend.close(); } } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } try { if (operatorStateBackend != null) { operatorStateBackend.dispose(); } } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } try { if (keyedStateBackend != null) { keyedStateBackend.dispose(); } } catch (Exception e) { exception = ExceptionUtils.firstOrSuppressed(e, exception); } if (exception != null) { throw exception; } }
class class_name[name] begin[{] method[dispose, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[Exception], exception] local_variable[type[StreamTask], containingTask] local_variable[type[CloseableRegistry], taskCloseableRegistry] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=taskCloseableRegistry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=operatorStateBackend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unregisterCloseable, postfix_operators=[], prefix_operators=[], qualifier=taskCloseableRegistry, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=operatorStateBackend, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=taskCloseableRegistry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=keyedStateBackend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unregisterCloseable, postfix_operators=[], prefix_operators=[], qualifier=taskCloseableRegistry, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=keyedStateBackend, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=firstOrSuppressed, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, 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) TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=operatorStateBackend, 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=[], member=dispose, postfix_operators=[], prefix_operators=[], qualifier=operatorStateBackend, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=firstOrSuppressed, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, 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) TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=keyedStateBackend, 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=[], member=dispose, postfix_operators=[], prefix_operators=[], qualifier=keyedStateBackend, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=firstOrSuppressed, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.exception], !=, literal[null]]] begin[{] ThrowStatement(expression=MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[dispose] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Exception] identifier[exception] operator[=] Other[null] operator[SEP] identifier[StreamTask] operator[<] operator[?] , operator[?] operator[>] identifier[containingTask] operator[=] identifier[getContainingTask] operator[SEP] operator[SEP] operator[SEP] identifier[CloseableRegistry] identifier[taskCloseableRegistry] operator[=] identifier[containingTask] operator[!=] Other[null] operator[?] identifier[containingTask] operator[SEP] identifier[getCancelables] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[taskCloseableRegistry] operator[==] Other[null] operator[||] identifier[taskCloseableRegistry] operator[SEP] identifier[unregisterCloseable] operator[SEP] identifier[operatorStateBackend] operator[SEP] operator[SEP] { identifier[operatorStateBackend] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[exception] operator[=] identifier[e] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[taskCloseableRegistry] operator[==] Other[null] operator[||] identifier[taskCloseableRegistry] operator[SEP] identifier[unregisterCloseable] operator[SEP] identifier[keyedStateBackend] operator[SEP] operator[SEP] { identifier[keyedStateBackend] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[exception] operator[=] identifier[ExceptionUtils] operator[SEP] identifier[firstOrSuppressed] operator[SEP] identifier[e] , identifier[exception] operator[SEP] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[operatorStateBackend] operator[!=] Other[null] operator[SEP] { identifier[operatorStateBackend] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[exception] operator[=] identifier[ExceptionUtils] operator[SEP] identifier[firstOrSuppressed] operator[SEP] identifier[e] , identifier[exception] operator[SEP] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[keyedStateBackend] operator[!=] Other[null] operator[SEP] { identifier[keyedStateBackend] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[exception] operator[=] identifier[ExceptionUtils] operator[SEP] identifier[firstOrSuppressed] operator[SEP] identifier[e] , identifier[exception] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[exception] operator[!=] Other[null] operator[SEP] { Keyword[throw] identifier[exception] operator[SEP] } }
public static BigInteger getVarIntBI(byte[] varInt) { BigInteger result=BigInteger.ZERO; if (varInt.length==0) { return result; } int unsignedByte=varInt[0] & 0xFF; if (unsignedByte<0xFD) { return new BigInteger(new byte[] {(byte) unsignedByte}); } int intSize=0; if (unsignedByte==0xFD) { intSize=3; } else if (unsignedByte==0xFE) { intSize=5; } else if (unsignedByte==0XFF) { intSize=9; } byte[] rawDataInt=reverseByteArray(Arrays.copyOfRange(varInt, 1, intSize)); return new BigInteger(rawDataInt); }
class class_name[name] begin[{] method[getVarIntBI, return_type[type[BigInteger]], modifier[public static], parameter[varInt]] begin[{] local_variable[type[BigInteger], result] if[binary_operation[member[varInt.length], ==, literal[0]]] begin[{] return[member[.result]] else begin[{] None end[}] local_variable[type[int], unsignedByte] if[binary_operation[member[.unsignedByte], <, literal[0xFD]]] begin[{] return[ClassCreator(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Cast(expression=MemberReference(member=unsignedByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))] else begin[{] None end[}] local_variable[type[int], intSize] if[binary_operation[member[.unsignedByte], ==, literal[0xFD]]] begin[{] assign[member[.intSize], literal[3]] else begin[{] if[binary_operation[member[.unsignedByte], ==, literal[0xFE]]] begin[{] assign[member[.intSize], literal[5]] else begin[{] if[binary_operation[member[.unsignedByte], ==, literal[0XFF]]] begin[{] assign[member[.intSize], literal[9]] else begin[{] None end[}] end[}] end[}] local_variable[type[byte], rawDataInt] return[ClassCreator(arguments=[MemberReference(member=rawDataInt, 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=BigInteger, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[BigInteger] identifier[getVarIntBI] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[varInt] operator[SEP] { identifier[BigInteger] identifier[result] operator[=] identifier[BigInteger] operator[SEP] identifier[ZERO] operator[SEP] Keyword[if] operator[SEP] identifier[varInt] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[result] operator[SEP] } Keyword[int] identifier[unsignedByte] operator[=] identifier[varInt] operator[SEP] Other[0] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[if] operator[SEP] identifier[unsignedByte] operator[<] literal[Integer] operator[SEP] { Keyword[return] Keyword[new] identifier[BigInteger] operator[SEP] Keyword[new] Keyword[byte] operator[SEP] operator[SEP] { operator[SEP] Keyword[byte] operator[SEP] identifier[unsignedByte] } operator[SEP] operator[SEP] } Keyword[int] identifier[intSize] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[unsignedByte] operator[==] literal[Integer] operator[SEP] { identifier[intSize] operator[=] Other[3] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[unsignedByte] operator[==] literal[Integer] operator[SEP] { identifier[intSize] operator[=] Other[5] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[unsignedByte] operator[==] literal[Integer] operator[SEP] { identifier[intSize] operator[=] Other[9] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[rawDataInt] operator[=] identifier[reverseByteArray] operator[SEP] identifier[Arrays] operator[SEP] identifier[copyOfRange] operator[SEP] identifier[varInt] , Other[1] , identifier[intSize] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[BigInteger] operator[SEP] identifier[rawDataInt] operator[SEP] operator[SEP] }
void putAll(BaseRow sortKey, Collection<BaseRow> values) { treeMap.put(sortKey, values); currentTopNum += values.size(); }
class class_name[name] begin[{] method[putAll, return_type[void], modifier[default], parameter[sortKey, values]] begin[{] call[treeMap.put, parameter[member[.sortKey], member[.values]]] assign[member[.currentTopNum], call[values.size, parameter[]]] end[}] END[}]
Keyword[void] identifier[putAll] operator[SEP] identifier[BaseRow] identifier[sortKey] , identifier[Collection] operator[<] identifier[BaseRow] operator[>] identifier[values] operator[SEP] { identifier[treeMap] operator[SEP] identifier[put] operator[SEP] identifier[sortKey] , identifier[values] operator[SEP] operator[SEP] identifier[currentTopNum] operator[+=] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] }
public static PredicateTemplate predicateTemplate(String template, Object... args) { return predicateTemplate(TemplateFactory.DEFAULT.create(template), ImmutableList.copyOf(args)); }
class class_name[name] begin[{] method[predicateTemplate, return_type[type[PredicateTemplate]], modifier[public static], parameter[template, args]] begin[{] return[call[.predicateTemplate, parameter[call[TemplateFactory.DEFAULT.create, parameter[member[.template]]], call[ImmutableList.copyOf, parameter[member[.args]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[PredicateTemplate] identifier[predicateTemplate] operator[SEP] identifier[String] identifier[template] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[return] identifier[predicateTemplate] operator[SEP] identifier[TemplateFactory] operator[SEP] identifier[DEFAULT] operator[SEP] identifier[create] operator[SEP] identifier[template] operator[SEP] , identifier[ImmutableList] operator[SEP] identifier[copyOf] operator[SEP] identifier[args] operator[SEP] operator[SEP] operator[SEP] }
static Key str2Key(String s) { Key k = str2Key_impl(s); assert key2Str_impl(k, decodeType(s)).equals(s) : "bijection fail " + s + " <-> " + k; return k; }
class class_name[name] begin[{] method[str2Key, return_type[type[Key]], modifier[static], parameter[s]] begin[{] local_variable[type[Key], k] AssertStatement(condition=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decodeType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=key2Str_impl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bijection fail "), operandr=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" <-> "), operator=+), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)) return[member[.k]] end[}] END[}]
Keyword[static] identifier[Key] identifier[str2Key] operator[SEP] identifier[String] identifier[s] operator[SEP] { identifier[Key] identifier[k] operator[=] identifier[str2Key_impl] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[assert] identifier[key2Str_impl] operator[SEP] identifier[k] , identifier[decodeType] operator[SEP] identifier[s] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[s] operator[SEP] operator[:] literal[String] operator[+] identifier[s] operator[+] literal[String] operator[+] identifier[k] operator[SEP] Keyword[return] identifier[k] operator[SEP] }
public static CurrencyFunction currency(String fieldName) { Assert.hasText(fieldName, "FieldName must not be empty!"); return currency(fieldName, null); }
class class_name[name] begin[{] method[currency, return_type[type[CurrencyFunction]], modifier[public static], parameter[fieldName]] begin[{] call[Assert.hasText, parameter[member[.fieldName], literal["FieldName must not be empty!"]]] return[call[.currency, parameter[member[.fieldName], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CurrencyFunction] identifier[currency] operator[SEP] identifier[String] identifier[fieldName] operator[SEP] { identifier[Assert] operator[SEP] identifier[hasText] operator[SEP] identifier[fieldName] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[currency] operator[SEP] identifier[fieldName] , Other[null] operator[SEP] operator[SEP] }
public List<CmsResource> readResourcesVisitedBy(CmsDbContext dbc, String poolName, CmsVisitedByFilter filter) throws CmsException { List<CmsResource> result = getSubscriptionDriver().readResourcesVisitedBy(dbc, poolName, filter); result = filterPermissions(dbc, result, CmsResourceFilter.DEFAULT); return result; }
class class_name[name] begin[{] method[readResourcesVisitedBy, return_type[type[List]], modifier[public], parameter[dbc, poolName, filter]] begin[{] local_variable[type[List], result] assign[member[.result], call[.filterPermissions, parameter[member[.dbc], member[.result], member[CmsResourceFilter.DEFAULT]]]] return[member[.result]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[readResourcesVisitedBy] operator[SEP] identifier[CmsDbContext] identifier[dbc] , identifier[String] identifier[poolName] , identifier[CmsVisitedByFilter] identifier[filter] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[result] operator[=] identifier[getSubscriptionDriver] operator[SEP] operator[SEP] operator[SEP] identifier[readResourcesVisitedBy] operator[SEP] identifier[dbc] , identifier[poolName] , identifier[filter] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[filterPermissions] operator[SEP] identifier[dbc] , identifier[result] , identifier[CmsResourceFilter] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
protected void percolateDownMaxHeap(final int index) { final Activation element = elements[index]; int hole = index; while ((hole * 2) <= size) { int child = hole * 2; // if we have a right child and that child can not be percolated // up then move onto other child if (child != size && compare(elements[child + 1], elements[child]) > 0) { child++; } // if we found resting place of bubble then terminate search if (compare(elements[child], element) <= 0) { break; } setElement( hole, elements[child] ); hole = child; } setElement( hole, element); }
class class_name[name] begin[{] method[percolateDownMaxHeap, return_type[void], modifier[protected], parameter[index]] begin[{] local_variable[type[Activation], element] local_variable[type[int], hole] while[binary_operation[binary_operation[member[.hole], *, literal[2]], <=, member[.size]]] begin[{] local_variable[type[int], child] if[binary_operation[binary_operation[member[.child], !=, member[.size]], &&, binary_operation[call[.compare, parameter[member[.elements], member[.elements]]], >, literal[0]]]] begin[{] member[.child] else begin[{] None end[}] if[binary_operation[call[.compare, parameter[member[.elements], member[.element]]], <=, literal[0]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] call[.setElement, parameter[member[.hole], member[.elements]]] assign[member[.hole], member[.child]] end[}] call[.setElement, parameter[member[.hole], member[.element]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[percolateDownMaxHeap] operator[SEP] Keyword[final] Keyword[int] identifier[index] operator[SEP] { Keyword[final] identifier[Activation] identifier[element] operator[=] identifier[elements] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[int] identifier[hole] operator[=] identifier[index] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[hole] operator[*] Other[2] operator[SEP] operator[<=] identifier[size] operator[SEP] { Keyword[int] identifier[child] operator[=] identifier[hole] operator[*] Other[2] operator[SEP] Keyword[if] operator[SEP] identifier[child] operator[!=] identifier[size] operator[&&] identifier[compare] operator[SEP] identifier[elements] operator[SEP] identifier[child] operator[+] Other[1] operator[SEP] , identifier[elements] operator[SEP] identifier[child] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[child] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[compare] operator[SEP] identifier[elements] operator[SEP] identifier[child] operator[SEP] , identifier[element] operator[SEP] operator[<=] Other[0] operator[SEP] { Keyword[break] operator[SEP] } identifier[setElement] operator[SEP] identifier[hole] , identifier[elements] operator[SEP] identifier[child] operator[SEP] operator[SEP] operator[SEP] identifier[hole] operator[=] identifier[child] operator[SEP] } identifier[setElement] operator[SEP] identifier[hole] , identifier[element] operator[SEP] operator[SEP] }
@NotNull public Optional<T> executeIfAbsent(@NotNull Runnable action) { if (value == null) action.run(); return this; }
class class_name[name] begin[{] method[executeIfAbsent, return_type[type[Optional]], modifier[public], parameter[action]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] call[action.run, parameter[]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[NotNull] Keyword[public] identifier[Optional] operator[<] identifier[T] operator[>] identifier[executeIfAbsent] operator[SEP] annotation[@] identifier[NotNull] identifier[Runnable] identifier[action] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] identifier[action] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public boolean satisfies(Match match, int... ind) { BioPAXElement ele = match.get(ind[0]); if (!idMap.containsKey(ele)) idMap.put(ele, idFetcher.fetchID(ele)); return idMap.get(ele) != null && !idMap.get(ele).isEmpty(); }
class class_name[name] begin[{] method[satisfies, return_type[type[boolean]], modifier[public], parameter[match, ind]] begin[{] local_variable[type[BioPAXElement], ele] if[call[idMap.containsKey, parameter[member[.ele]]]] begin[{] call[idMap.put, parameter[member[.ele], call[idFetcher.fetchID, parameter[member[.ele]]]]] else begin[{] None end[}] return[binary_operation[binary_operation[call[idMap.get, parameter[member[.ele]]], !=, literal[null]], &&, call[idMap.get, parameter[member[.ele]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[satisfies] operator[SEP] identifier[Match] identifier[match] , Keyword[int] operator[...] identifier[ind] operator[SEP] { identifier[BioPAXElement] identifier[ele] operator[=] identifier[match] operator[SEP] identifier[get] operator[SEP] identifier[ind] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[idMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[ele] operator[SEP] operator[SEP] identifier[idMap] operator[SEP] identifier[put] operator[SEP] identifier[ele] , identifier[idFetcher] operator[SEP] identifier[fetchID] operator[SEP] identifier[ele] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[idMap] operator[SEP] identifier[get] operator[SEP] identifier[ele] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] identifier[idMap] operator[SEP] identifier[get] operator[SEP] identifier[ele] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] }
public CmsElementSettingsConfig getElementSettingsConfig( CmsResource page, CmsContainerElementBean element, String containerId, Collection<CmsContainer> containers) throws CmsException { Locale wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms); Locale requestLocale = m_cms.getRequestContext().getLocale(); m_cms.getRequestContext().setLocale(m_locale); element.initResource(m_cms); if (element.getResource().isFolder()) { return null; } String schema = null; try { I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(element.getResource()); schema = type.getConfiguration().getString("schema", null); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); } CmsContainerElementData elementData = getBaseElementData(page, element); Supplier<CmsXmlContent> contentSupplier = Suppliers.memoize(() -> { try { return CmsXmlContentFactory.unmarshal(m_cms, m_cms.readFile(element.getResource())); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); return null; } }); if (!element.isGroupContainer(m_cms) && !element.isInheritedContainer(m_cms)) { CmsFormatterConfiguration formatterConfiguraton = getFormatterConfiguration(element.getResource()); Map<String, Map<String, CmsFormatterConfig>> formatters = new HashMap<String, Map<String, CmsFormatterConfig>>(); for (CmsContainer cnt : containers) { if (cnt.getName().equals(containerId)) { Map<String, CmsFormatterConfig> containerFormatters = new LinkedHashMap<String, CmsFormatterConfig>(); boolean missesFormatterSetting = !elementData.getSettings().containsKey( CmsFormatterConfig.getSettingsKeyForContainer(cnt.getName())); Map<String, I_CmsFormatterBean> formatterSelection = formatterConfiguraton.getFormatterSelection( cnt.getType(), cnt.getWidth()); for (Entry<String, I_CmsFormatterBean> formatterEntry : formatterSelection.entrySet()) { I_CmsFormatterBean formatter = formatterEntry.getValue(); String id = formatterEntry.getKey(); if (missesFormatterSetting && ((element.getFormatterId() == null) || element.getFormatterId().equals(formatter.getJspStructureId()))) { elementData.getSettings().put( CmsFormatterConfig.getSettingsKeyForContainer(cnt.getName()), id); missesFormatterSetting = false; } String label = formatter.getNiceName(OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms)); if (formatterEntry.getKey().startsWith(CmsFormatterConfig.SCHEMA_FORMATTER_ID)) { label = Messages.get().getBundle().key(Messages.GUI_SCHEMA_FORMATTER_LABEL_0) + " [" + CmsResource.getName(formatter.getJspRootPath()) + "]"; } if (CmsStringUtil.isEmptyOrWhitespaceOnly(label)) { label = id; } CmsFormatterConfig config = new CmsFormatterConfig(id); Set<String> cssResources = new LinkedHashSet<String>(); for (String cssSitePath : formatter.getCssHeadIncludes()) { cssResources.add(OpenCms.getLinkManager().getOnlineLink(m_cms, cssSitePath)); } config.setCssResources(cssResources); config.setInlineCss(formatter.getInlineCss()); config.setLabel(label); config.setDescription( formatter.getDescription(OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms))); Map<String, CmsXmlContentProperty> settingsConfig = OpenCms.getADEManager().getFormatterSettings( m_cms, formatter, element.getResource(), m_locale, m_req); Function<String, String> templateSource = createStringTemplateSource( formatter, contentSupplier); settingsConfig = CmsXmlContentPropertyHelper.resolveMacrosForPropertyInfo( m_cms, page, element.getResource(), contentSupplier, templateSource, settingsConfig); config.setSettingConfig(settingsConfig); List<I_CmsFormatterBean> nestedFormatters = OpenCms.getADEManager().getNestedFormatters( m_cms, element.getResource(), m_locale, m_req); if ((nestedFormatters != null) && !nestedFormatters.isEmpty()) { Map<String, String> settingPrefixes = new LinkedHashMap<String, String>(); for (I_CmsFormatterBean nested : nestedFormatters) { settingPrefixes.put( nested.getId(), nested.getNiceName(OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms))); } config.setNestedFormatterPrefixes(settingPrefixes); } config.setJspRootPath(formatter.getJspRootPath()); containerFormatters.put(id, config); } formatters.put(cnt.getName(), containerFormatters); } } elementData.setFormatters(formatters); } m_cms.getRequestContext().setLocale(requestLocale); ArrayList<CmsAdditionalInfoBean> infos = new ArrayList<>(); CmsResource resource = element.getResource(); String resTypeName = OpenCms.getResourceManager().getResourceType(resource).getTypeName(); CmsExplorerTypeSettings cmsExplorerTypeSettings = OpenCms.getWorkplaceManager().getExplorerTypeSetting( resTypeName); if (null == cmsExplorerTypeSettings) { CmsMessageContainer errMsg = org.opencms.gwt.Messages.get().container( org.opencms.gwt.Messages.ERR_EXPLORER_TYPE_SETTINGS_FOR_RESOURCE_TYPE_NOT_FOUND_3, resource.getRootPath(), resTypeName, Integer.valueOf(resource.getTypeId())); throw new CmsConfigurationException(errMsg); } String key = cmsExplorerTypeSettings.getKey(); Locale currentLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms); CmsMessages messages = OpenCms.getWorkplaceManager().getMessages(currentLocale); String resTypeNiceName = messages.key(key); infos.add( new CmsAdditionalInfoBean( messages.key(org.opencms.workplace.commons.Messages.GUI_LABEL_TYPE_0), resTypeNiceName, null)); try { CmsRelationFilter filter = CmsRelationFilter.relationsFromStructureId( element.getResource().getStructureId()).filterType(CmsRelationType.XSD); for (CmsRelation relation : m_cms.readRelations(filter)) { CmsResource target = relation.getTarget(m_cms, CmsResourceFilter.IGNORE_EXPIRATION); String label = Messages.get().getBundle(wpLocale).key(Messages.GUI_ADDINFO_SCHEMA_0); infos.add(new CmsAdditionalInfoBean(label, target.getRootPath(), null)); break; } } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); } CmsResourceState state = element.getResource().getState(); return new CmsElementSettingsConfig(elementData, state, infos, schema); }
class class_name[name] begin[{] method[getElementSettingsConfig, return_type[type[CmsElementSettingsConfig]], modifier[public], parameter[page, element, containerId, containers]] begin[{] local_variable[type[Locale], wpLocale] local_variable[type[Locale], requestLocale] call[m_cms.getRequestContext, parameter[]] call[element.initResource, parameter[member[.m_cms]]] if[call[element.getResource, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], schema] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResourceManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None)], member=getResourceType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsResourceType, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="schema"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=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) local_variable[type[CmsContainerElementData], elementData] local_variable[type[Supplier], contentSupplier] if[binary_operation[call[element.isGroupContainer, parameter[member[.m_cms]]], &&, call[element.isInheritedContainer, parameter[member[.m_cms]]]]] begin[{] local_variable[type[CmsFormatterConfiguration], formatterConfiguraton] local_variable[type[Map], formatters] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cnt, selectors=[MethodInvocation(arguments=[MemberReference(member=containerId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsFormatterConfig, sub_type=None))], dimensions=None, name=LinkedHashMap, sub_type=None)), name=containerFormatters)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsFormatterConfig, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSettings, postfix_operators=[], prefix_operators=['!'], qualifier=elementData, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cnt, selectors=[], type_arguments=None)], member=getSettingsKeyForContainer, postfix_operators=[], prefix_operators=[], qualifier=CmsFormatterConfig, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=missesFormatterSetting)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=cnt, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=cnt, selectors=[], type_arguments=None)], member=getFormatterSelection, postfix_operators=[], prefix_operators=[], qualifier=formatterConfiguraton, selectors=[], type_arguments=None), name=formatterSelection)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=I_CmsFormatterBean, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=formatterEntry, selectors=[], type_arguments=None), name=formatter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsFormatterBean, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=formatterEntry, selectors=[], type_arguments=None), name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=missesFormatterSetting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFormatterId, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=getFormatterId, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getJspStructureId, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None)], member=equals, 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=[], member=getSettings, postfix_operators=[], prefix_operators=[], qualifier=elementData, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cnt, selectors=[], type_arguments=None)], member=getSettingsKeyForContainer, postfix_operators=[], prefix_operators=[], qualifier=CmsFormatterConfig, selectors=[], type_arguments=None), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=missesFormatterSetting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWorkplaceManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWorkplaceLocale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getNiceName, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None), name=label)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=formatterEntry, selectors=[MethodInvocation(arguments=[MemberReference(member=SCHEMA_FORMATTER_ID, postfix_operators=[], prefix_operators=[], qualifier=CmsFormatterConfig, selectors=[])], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=GUI_SCHEMA_FORMATTER_LABEL_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, 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=" ["), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getJspRootPath, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None)], member=getName, postfix_operators=[], prefix_operators=[], qualifier=CmsResource, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmptyOrWhitespaceOnly, postfix_operators=[], prefix_operators=[], qualifier=CmsStringUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsFormatterConfig, sub_type=None)), name=config)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsFormatterConfig, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=LinkedHashSet, sub_type=None)), name=cssResources)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLinkManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cssSitePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOnlineLink, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=cssResources, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCssHeadIncludes, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cssSitePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cssResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCssResources, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInlineCss, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None)], member=setInlineCss, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setLabel, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWorkplaceManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWorkplaceLocale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getDescription, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None)], member=setDescription, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getADEManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=formatter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), MemberReference(member=m_locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFormatterSettings, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=settingsConfig)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsXmlContentProperty, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=formatter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentSupplier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createStringTemplateSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=templateSource)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Function, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=settingsConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=page, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), MemberReference(member=contentSupplier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=templateSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=settingsConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resolveMacrosForPropertyInfo, postfix_operators=[], prefix_operators=[], qualifier=CmsXmlContentPropertyHelper, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=settingsConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSettingConfig, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getADEManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), MemberReference(member=m_locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m_req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNestedFormatters, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=nestedFormatters)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=I_CmsFormatterBean, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=nestedFormatters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=nestedFormatters, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=LinkedHashMap, sub_type=None)), name=settingPrefixes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=nested, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWorkplaceManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWorkplaceLocale, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getNiceName, postfix_operators=[], prefix_operators=[], qualifier=nested, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=settingPrefixes, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nestedFormatters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=nested)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I_CmsFormatterBean, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=settingPrefixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNestedFormatterPrefixes, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getJspRootPath, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None)], member=setJspRootPath, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=containerFormatters, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=formatterSelection, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=formatterEntry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=I_CmsFormatterBean, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cnt, selectors=[], type_arguments=None), MemberReference(member=containerFormatters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=formatters, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=containers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cnt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsContainer, sub_type=None))), label=None) call[elementData.setFormatters, parameter[member[.formatters]]] else begin[{] None end[}] call[m_cms.getRequestContext, parameter[]] local_variable[type[ArrayList], infos] local_variable[type[CmsResource], resource] local_variable[type[String], resTypeName] local_variable[type[CmsExplorerTypeSettings], cmsExplorerTypeSettings] if[binary_operation[literal[null], ==, member[.cmsExplorerTypeSettings]]] begin[{] local_variable[type[CmsMessageContainer], errMsg] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errMsg, 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=CmsConfigurationException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], key] local_variable[type[Locale], currentLocale] local_variable[type[CmsMessages], messages] local_variable[type[String], resTypeNiceName] call[infos.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=GUI_LABEL_TYPE_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.workplace.commons.Messages, selectors=[])], member=key, postfix_operators=[], prefix_operators=[], qualifier=messages, selectors=[], type_arguments=None), MemberReference(member=resTypeNiceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsAdditionalInfoBean, sub_type=None))]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[MethodInvocation(arguments=[], member=getStructureId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=relationsFromStructureId, postfix_operators=[], prefix_operators=[], qualifier=CmsRelationFilter, selectors=[MethodInvocation(arguments=[MemberReference(member=XSD, postfix_operators=[], prefix_operators=[], qualifier=CmsRelationType, selectors=[])], member=filterType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=filter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsRelationFilter, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=IGNORE_EXPIRATION, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[])], member=getTarget, postfix_operators=[], prefix_operators=[], qualifier=relation, selectors=[], type_arguments=None), name=target)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=wpLocale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=GUI_ADDINFO_SCHEMA_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=label)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsAdditionalInfoBean, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=infos, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readRelations, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=relation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsRelation, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalizedMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None) local_variable[type[CmsResourceState], state] return[ClassCreator(arguments=[MemberReference(member=elementData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=infos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schema, 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=CmsElementSettingsConfig, sub_type=None))] end[}] END[}]
Keyword[public] identifier[CmsElementSettingsConfig] identifier[getElementSettingsConfig] operator[SEP] identifier[CmsResource] identifier[page] , identifier[CmsContainerElementBean] identifier[element] , identifier[String] identifier[containerId] , identifier[Collection] operator[<] identifier[CmsContainer] operator[>] identifier[containers] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[Locale] identifier[wpLocale] operator[=] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkplaceLocale] operator[SEP] identifier[m_cms] operator[SEP] operator[SEP] identifier[Locale] identifier[requestLocale] operator[=] identifier[m_cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] identifier[m_cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[setLocale] operator[SEP] identifier[m_locale] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[initResource] operator[SEP] identifier[m_cms] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] identifier[isFolder] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[schema] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[I_CmsResourceType] identifier[type] operator[=] identifier[OpenCms] operator[SEP] identifier[getResourceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceType] operator[SEP] identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[schema] operator[=] identifier[type] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] literal[String] , Other[null] 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[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } identifier[CmsContainerElementData] identifier[elementData] operator[=] identifier[getBaseElementData] operator[SEP] identifier[page] , identifier[element] operator[SEP] operator[SEP] identifier[Supplier] operator[<] identifier[CmsXmlContent] operator[>] identifier[contentSupplier] operator[=] identifier[Suppliers] operator[SEP] identifier[memoize] operator[SEP] operator[SEP] operator[SEP] operator[->] { Keyword[try] { Keyword[return] identifier[CmsXmlContentFactory] operator[SEP] identifier[unmarshal] operator[SEP] identifier[m_cms] , identifier[m_cms] operator[SEP] identifier[readFile] operator[SEP] identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[element] operator[SEP] identifier[isGroupContainer] operator[SEP] identifier[m_cms] operator[SEP] operator[&&] operator[!] identifier[element] operator[SEP] identifier[isInheritedContainer] operator[SEP] identifier[m_cms] operator[SEP] operator[SEP] { identifier[CmsFormatterConfiguration] identifier[formatterConfiguraton] operator[=] identifier[getFormatterConfiguration] operator[SEP] identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[CmsFormatterConfig] operator[>] operator[>] identifier[formatters] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[CmsFormatterConfig] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsContainer] identifier[cnt] operator[:] identifier[containers] operator[SEP] { Keyword[if] operator[SEP] identifier[cnt] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[containerId] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[CmsFormatterConfig] operator[>] identifier[containerFormatters] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[CmsFormatterConfig] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[missesFormatterSetting] operator[=] operator[!] identifier[elementData] operator[SEP] identifier[getSettings] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[CmsFormatterConfig] operator[SEP] identifier[getSettingsKeyForContainer] operator[SEP] identifier[cnt] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[I_CmsFormatterBean] operator[>] identifier[formatterSelection] operator[=] identifier[formatterConfiguraton] operator[SEP] identifier[getFormatterSelection] operator[SEP] identifier[cnt] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[cnt] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[I_CmsFormatterBean] operator[>] identifier[formatterEntry] operator[:] identifier[formatterSelection] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[I_CmsFormatterBean] identifier[formatter] operator[=] identifier[formatterEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[=] identifier[formatterEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[missesFormatterSetting] operator[&&] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[getFormatterId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] identifier[element] operator[SEP] identifier[getFormatterId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[formatter] operator[SEP] identifier[getJspStructureId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[elementData] operator[SEP] identifier[getSettings] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[CmsFormatterConfig] operator[SEP] identifier[getSettingsKeyForContainer] operator[SEP] identifier[cnt] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , identifier[id] operator[SEP] operator[SEP] identifier[missesFormatterSetting] operator[=] literal[boolean] operator[SEP] } identifier[String] identifier[label] operator[=] identifier[formatter] operator[SEP] identifier[getNiceName] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkplaceLocale] operator[SEP] identifier[m_cms] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[formatterEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[CmsFormatterConfig] operator[SEP] identifier[SCHEMA_FORMATTER_ID] operator[SEP] operator[SEP] { identifier[label] operator[=] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_SCHEMA_FORMATTER_LABEL_0] operator[SEP] operator[+] literal[String] operator[+] identifier[CmsResource] operator[SEP] identifier[getName] operator[SEP] identifier[formatter] operator[SEP] identifier[getJspRootPath] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[label] operator[SEP] operator[SEP] { identifier[label] operator[=] identifier[id] operator[SEP] } identifier[CmsFormatterConfig] identifier[config] operator[=] Keyword[new] identifier[CmsFormatterConfig] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[cssResources] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[cssSitePath] operator[:] identifier[formatter] operator[SEP] identifier[getCssHeadIncludes] operator[SEP] operator[SEP] operator[SEP] { identifier[cssResources] operator[SEP] identifier[add] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getLinkManager] operator[SEP] operator[SEP] operator[SEP] identifier[getOnlineLink] operator[SEP] identifier[m_cms] , identifier[cssSitePath] operator[SEP] operator[SEP] operator[SEP] } identifier[config] operator[SEP] identifier[setCssResources] operator[SEP] identifier[cssResources] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setInlineCss] operator[SEP] identifier[formatter] operator[SEP] identifier[getInlineCss] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setLabel] operator[SEP] identifier[label] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setDescription] operator[SEP] identifier[formatter] operator[SEP] identifier[getDescription] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkplaceLocale] operator[SEP] identifier[m_cms] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[CmsXmlContentProperty] operator[>] identifier[settingsConfig] operator[=] identifier[OpenCms] operator[SEP] identifier[getADEManager] operator[SEP] operator[SEP] operator[SEP] identifier[getFormatterSettings] operator[SEP] identifier[m_cms] , identifier[formatter] , identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] , identifier[m_locale] , identifier[m_req] operator[SEP] operator[SEP] identifier[Function] operator[<] identifier[String] , identifier[String] operator[>] identifier[templateSource] operator[=] identifier[createStringTemplateSource] operator[SEP] identifier[formatter] , identifier[contentSupplier] operator[SEP] operator[SEP] identifier[settingsConfig] operator[=] identifier[CmsXmlContentPropertyHelper] operator[SEP] identifier[resolveMacrosForPropertyInfo] operator[SEP] identifier[m_cms] , identifier[page] , identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] , identifier[contentSupplier] , identifier[templateSource] , identifier[settingsConfig] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setSettingConfig] operator[SEP] identifier[settingsConfig] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[I_CmsFormatterBean] operator[>] identifier[nestedFormatters] operator[=] identifier[OpenCms] operator[SEP] identifier[getADEManager] operator[SEP] operator[SEP] operator[SEP] identifier[getNestedFormatters] operator[SEP] identifier[m_cms] , identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] , identifier[m_locale] , identifier[m_req] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[nestedFormatters] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[nestedFormatters] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[settingPrefixes] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[I_CmsFormatterBean] identifier[nested] operator[:] identifier[nestedFormatters] operator[SEP] { identifier[settingPrefixes] operator[SEP] identifier[put] operator[SEP] identifier[nested] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[nested] operator[SEP] identifier[getNiceName] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkplaceLocale] operator[SEP] identifier[m_cms] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[config] operator[SEP] identifier[setNestedFormatterPrefixes] operator[SEP] identifier[settingPrefixes] operator[SEP] operator[SEP] } identifier[config] operator[SEP] identifier[setJspRootPath] operator[SEP] identifier[formatter] operator[SEP] identifier[getJspRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[containerFormatters] operator[SEP] identifier[put] operator[SEP] identifier[id] , identifier[config] operator[SEP] operator[SEP] } identifier[formatters] operator[SEP] identifier[put] operator[SEP] identifier[cnt] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[containerFormatters] operator[SEP] operator[SEP] } } identifier[elementData] operator[SEP] identifier[setFormatters] operator[SEP] identifier[formatters] operator[SEP] operator[SEP] } identifier[m_cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[setLocale] operator[SEP] identifier[requestLocale] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[CmsAdditionalInfoBean] operator[>] identifier[infos] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[CmsResource] identifier[resource] operator[=] identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[resTypeName] operator[=] identifier[OpenCms] operator[SEP] identifier[getResourceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceType] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] identifier[CmsExplorerTypeSettings] identifier[cmsExplorerTypeSettings] operator[=] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getExplorerTypeSetting] operator[SEP] identifier[resTypeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[cmsExplorerTypeSettings] operator[SEP] { identifier[CmsMessageContainer] identifier[errMsg] operator[=] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[gwt] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[gwt] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_EXPLORER_TYPE_SETTINGS_FOR_RESOURCE_TYPE_NOT_FOUND_3] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] , identifier[resTypeName] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[resource] operator[SEP] identifier[getTypeId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CmsConfigurationException] operator[SEP] identifier[errMsg] operator[SEP] operator[SEP] } identifier[String] identifier[key] operator[=] identifier[cmsExplorerTypeSettings] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Locale] identifier[currentLocale] operator[=] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkplaceLocale] operator[SEP] identifier[m_cms] operator[SEP] operator[SEP] identifier[CmsMessages] identifier[messages] operator[=] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getMessages] operator[SEP] identifier[currentLocale] operator[SEP] operator[SEP] identifier[String] identifier[resTypeNiceName] operator[=] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[infos] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsAdditionalInfoBean] operator[SEP] identifier[messages] operator[SEP] identifier[key] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[workplace] operator[SEP] identifier[commons] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LABEL_TYPE_0] operator[SEP] , identifier[resTypeNiceName] , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[CmsRelationFilter] identifier[filter] operator[=] identifier[CmsRelationFilter] operator[SEP] identifier[relationsFromStructureId] operator[SEP] identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[filterType] operator[SEP] identifier[CmsRelationType] operator[SEP] identifier[XSD] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsRelation] identifier[relation] operator[:] identifier[m_cms] operator[SEP] identifier[readRelations] operator[SEP] identifier[filter] operator[SEP] operator[SEP] { identifier[CmsResource] identifier[target] operator[=] identifier[relation] operator[SEP] identifier[getTarget] operator[SEP] identifier[m_cms] , identifier[CmsResourceFilter] operator[SEP] identifier[IGNORE_EXPIRATION] operator[SEP] operator[SEP] identifier[String] identifier[label] operator[=] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] identifier[wpLocale] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_ADDINFO_SCHEMA_0] operator[SEP] operator[SEP] identifier[infos] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsAdditionalInfoBean] operator[SEP] identifier[label] , identifier[target] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } identifier[CmsResourceState] identifier[state] operator[=] identifier[element] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CmsElementSettingsConfig] operator[SEP] identifier[elementData] , identifier[state] , identifier[infos] , identifier[schema] operator[SEP] operator[SEP] }
public static Object getProperty(Stanza packet, String name) { Object res = null; JivePropertiesExtension jpe = (JivePropertiesExtension) packet.getExtension(JivePropertiesExtension.NAMESPACE); if (jpe != null) { res = jpe.getProperty(name); } return res; }
class class_name[name] begin[{] method[getProperty, return_type[type[Object]], modifier[public static], parameter[packet, name]] begin[{] local_variable[type[Object], res] local_variable[type[JivePropertiesExtension], jpe] if[binary_operation[member[.jpe], !=, literal[null]]] begin[{] assign[member[.res], call[jpe.getProperty, parameter[member[.name]]]] else begin[{] None end[}] return[member[.res]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[getProperty] operator[SEP] identifier[Stanza] identifier[packet] , identifier[String] identifier[name] operator[SEP] { identifier[Object] identifier[res] operator[=] Other[null] operator[SEP] identifier[JivePropertiesExtension] identifier[jpe] operator[=] operator[SEP] identifier[JivePropertiesExtension] operator[SEP] identifier[packet] operator[SEP] identifier[getExtension] operator[SEP] identifier[JivePropertiesExtension] operator[SEP] identifier[NAMESPACE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jpe] operator[!=] Other[null] operator[SEP] { identifier[res] operator[=] identifier[jpe] operator[SEP] identifier[getProperty] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[return] identifier[res] operator[SEP] }
public ImmutableRangeSet<C> union(RangeSet<C> other) { return unionOf(Iterables.concat(asRanges(), other.asRanges())); }
class class_name[name] begin[{] method[union, return_type[type[ImmutableRangeSet]], modifier[public], parameter[other]] begin[{] return[call[.unionOf, parameter[call[Iterables.concat, parameter[call[.asRanges, parameter[]], call[other.asRanges, parameter[]]]]]]] end[}] END[}]
Keyword[public] identifier[ImmutableRangeSet] operator[<] identifier[C] operator[>] identifier[union] operator[SEP] identifier[RangeSet] operator[<] identifier[C] operator[>] identifier[other] operator[SEP] { Keyword[return] identifier[unionOf] operator[SEP] identifier[Iterables] operator[SEP] identifier[concat] operator[SEP] identifier[asRanges] operator[SEP] operator[SEP] , identifier[other] operator[SEP] identifier[asRanges] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
boolean subSequenceEquals(CharSequence cs1, int offset1, CharSequence cs2, int offset2, int length) { if (offset1 + length > cs1.length() || offset2 + length > cs2.length()) { return false; } if (isCaseSensitive()) { for (int i = 0; i < length; i++) { char ch1 = cs1.charAt(offset1 + i); char ch2 = cs2.charAt(offset2 + i); if (ch1 != ch2) { return false; } } } else { for (int i = 0; i < length; i++) { char ch1 = cs1.charAt(offset1 + i); char ch2 = cs2.charAt(offset2 + i); if (ch1 != ch2 && Character.toUpperCase(ch1) != Character.toUpperCase(ch2) && Character.toLowerCase(ch1) != Character.toLowerCase(ch2)) { return false; } } } return true; }
class class_name[name] begin[{] method[subSequenceEquals, return_type[type[boolean]], modifier[default], parameter[cs1, offset1, cs2, offset2, length]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.offset1], +, member[.length]], >, call[cs1.length, parameter[]]], ||, binary_operation[binary_operation[member[.offset2], +, member[.length]], >, call[cs2.length, parameter[]]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[.isCaseSensitive, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=offset1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=cs1, selectors=[], type_arguments=None), name=ch1)], modifiers=set(), type=BasicType(dimensions=[], name=char)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=offset2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=cs2, selectors=[], type_arguments=None), name=ch2)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ch1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ch2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=offset1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=cs1, selectors=[], type_arguments=None), name=ch1)], modifiers=set(), type=BasicType(dimensions=[], name=char)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=offset2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=cs2, selectors=[], type_arguments=None), name=ch2)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ch2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ch1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=ch2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=!=), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ch1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=ch2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] return[literal[true]] end[}] END[}]
Keyword[boolean] identifier[subSequenceEquals] operator[SEP] identifier[CharSequence] identifier[cs1] , Keyword[int] identifier[offset1] , identifier[CharSequence] identifier[cs2] , Keyword[int] identifier[offset2] , Keyword[int] identifier[length] operator[SEP] { Keyword[if] operator[SEP] identifier[offset1] operator[+] identifier[length] operator[>] identifier[cs1] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[||] identifier[offset2] operator[+] identifier[length] operator[>] identifier[cs2] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[isCaseSensitive] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[ch1] operator[=] identifier[cs1] operator[SEP] identifier[charAt] operator[SEP] identifier[offset1] operator[+] identifier[i] operator[SEP] operator[SEP] Keyword[char] identifier[ch2] operator[=] identifier[cs2] operator[SEP] identifier[charAt] operator[SEP] identifier[offset2] operator[+] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch1] operator[!=] identifier[ch2] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[ch1] operator[=] identifier[cs1] operator[SEP] identifier[charAt] operator[SEP] identifier[offset1] operator[+] identifier[i] operator[SEP] operator[SEP] Keyword[char] identifier[ch2] operator[=] identifier[cs2] operator[SEP] identifier[charAt] operator[SEP] identifier[offset2] operator[+] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch1] operator[!=] identifier[ch2] operator[&&] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[ch1] operator[SEP] operator[!=] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[ch2] operator[SEP] operator[&&] identifier[Character] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[ch1] operator[SEP] operator[!=] identifier[Character] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[ch2] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
private static Field findIdField(final Object value) { Field res = null; final Class<?> type = value.getClass(); if (ODatabaseRecordThreadLocal.instance().isDefined()) { res = OObjectEntitySerializer.getIdField(type); } else { final String idField = OObjectSerializerHelper.getObjectIDFieldName(value); if (idField != null) { try { res = type.getDeclaredField(idField); } catch (NoSuchFieldException e) { LOGGER.warn(String .format("Id field '%s' not found in class '%s'.", idField, type.getSimpleName()), e); } } } return res; }
class class_name[name] begin[{] method[findIdField, return_type[type[Field]], modifier[private static], parameter[value]] begin[{] local_variable[type[Field], res] local_variable[type[Class], type] if[call[ODatabaseRecordThreadLocal.instance, parameter[]]] begin[{] assign[member[.res], call[OObjectEntitySerializer.getIdField, parameter[member[.type]]]] else begin[{] local_variable[type[String], idField] if[binary_operation[member[.idField], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=idField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDeclaredField, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Id field '%s' not found in class '%s'."), MemberReference(member=idField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchFieldException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] return[member[.res]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Field] identifier[findIdField] operator[SEP] Keyword[final] identifier[Object] identifier[value] operator[SEP] { identifier[Field] identifier[res] operator[=] Other[null] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ODatabaseRecordThreadLocal] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[isDefined] operator[SEP] operator[SEP] operator[SEP] { identifier[res] operator[=] identifier[OObjectEntitySerializer] operator[SEP] identifier[getIdField] operator[SEP] identifier[type] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[String] identifier[idField] operator[=] identifier[OObjectSerializerHelper] operator[SEP] identifier[getObjectIDFieldName] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[idField] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[res] operator[=] identifier[type] operator[SEP] identifier[getDeclaredField] operator[SEP] identifier[idField] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchFieldException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[idField] , identifier[type] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[return] identifier[res] operator[SEP] }
public <X> X newProxy(Class<X> interfaces) { return (X) newProxy(new Class[] {interfaces}); }
class class_name[name] begin[{] method[newProxy, return_type[type[X]], modifier[public], parameter[interfaces]] begin[{] return[Cast(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=interfaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))], member=newProxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=X, sub_type=None))] end[}] END[}]
Keyword[public] operator[<] identifier[X] operator[>] identifier[X] identifier[newProxy] operator[SEP] identifier[Class] operator[<] identifier[X] operator[>] identifier[interfaces] operator[SEP] { Keyword[return] operator[SEP] identifier[X] operator[SEP] identifier[newProxy] operator[SEP] Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[interfaces] } operator[SEP] operator[SEP] }
public static TimerJobEntity createTimerEntityForTimerEventDefinition(TimerEventDefinition timerEventDefinition, boolean isInterruptingTimer, ExecutionEntity executionEntity, String jobHandlerType, String jobHandlerConfig) { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); String businessCalendarRef = null; Expression expression = null; ExpressionManager expressionManager = processEngineConfiguration.getExpressionManager(); // ACT-1415: timer-declaration on start-event may contain expressions NOT // evaluating variables but other context, evaluating should happen nevertheless VariableScope scopeForExpression = executionEntity; if (scopeForExpression == null) { scopeForExpression = NoExecutionVariableScope.getSharedInstance(); } if (StringUtils.isNotEmpty(timerEventDefinition.getTimeDate())) { businessCalendarRef = DueDateBusinessCalendar.NAME; expression = expressionManager.createExpression(timerEventDefinition.getTimeDate()); } else if (StringUtils.isNotEmpty(timerEventDefinition.getTimeCycle())) { businessCalendarRef = CycleBusinessCalendar.NAME; expression = expressionManager.createExpression(timerEventDefinition.getTimeCycle()); } else if (StringUtils.isNotEmpty(timerEventDefinition.getTimeDuration())) { businessCalendarRef = DurationBusinessCalendar.NAME; expression = expressionManager.createExpression(timerEventDefinition.getTimeDuration()); } if (StringUtils.isNotEmpty(timerEventDefinition.getCalendarName())) { businessCalendarRef = timerEventDefinition.getCalendarName(); Expression businessCalendarExpression = expressionManager.createExpression(businessCalendarRef); businessCalendarRef = businessCalendarExpression.getValue(scopeForExpression).toString(); } if (expression == null) { throw new ActivitiException("Timer needs configuration (either timeDate, timeCycle or timeDuration is needed) (" + timerEventDefinition.getId() + ")"); } BusinessCalendar businessCalendar = processEngineConfiguration.getBusinessCalendarManager().getBusinessCalendar(businessCalendarRef); String dueDateString = null; Date duedate = null; Object dueDateValue = expression.getValue(scopeForExpression); if (dueDateValue instanceof String) { dueDateString = (String) dueDateValue; } else if (dueDateValue instanceof Date) { duedate = (Date) dueDateValue; } else if (dueDateValue instanceof DateTime) { //JodaTime support duedate = ((DateTime) dueDateValue).toDate(); } else if (dueDateValue != null) { throw new ActivitiException("Timer '" + executionEntity.getActivityId() + "' was not configured with a valid duration/time, either hand in a java.util.Date or a String in format 'yyyy-MM-dd'T'hh:mm:ss'"); } if (duedate == null && dueDateString != null) { duedate = businessCalendar.resolveDuedate(dueDateString); } TimerJobEntity timer = null; if (duedate != null) { timer = Context.getCommandContext().getTimerJobEntityManager().create(); timer.setJobType(JobEntity.JOB_TYPE_TIMER); timer.setRevision(1); timer.setJobHandlerType(jobHandlerType); timer.setJobHandlerConfiguration(jobHandlerConfig); timer.setExclusive(true); timer.setRetries(processEngineConfiguration.getAsyncExecutorNumberOfRetries()); timer.setDuedate(duedate); if (executionEntity != null) { timer.setExecution(executionEntity); timer.setProcessDefinitionId(executionEntity.getProcessDefinitionId()); timer.setProcessInstanceId(executionEntity.getProcessInstanceId()); // Inherit tenant identifier (if applicable) if (executionEntity.getTenantId() != null) { timer.setTenantId(executionEntity.getTenantId()); } } } if (StringUtils.isNotEmpty(timerEventDefinition.getTimeCycle())) { // See ACT-1427: A boundary timer with a cancelActivity='true', doesn't need to repeat itself boolean repeat = !isInterruptingTimer; // ACT-1951: intermediate catching timer events shouldn't repeat according to spec if (executionEntity != null) { FlowElement currentElement = executionEntity.getCurrentFlowElement(); if (currentElement instanceof IntermediateCatchEvent) { repeat = false; } } if (repeat) { String prepared = prepareRepeat(dueDateString); timer.setRepeat(prepared); } } if (timer != null && executionEntity != null) { timer.setExecution(executionEntity); timer.setProcessDefinitionId(executionEntity.getProcessDefinitionId()); // Inherit tenant identifier (if applicable) if (executionEntity.getTenantId() != null) { timer.setTenantId(executionEntity.getTenantId()); } } return timer; }
class class_name[name] begin[{] method[createTimerEntityForTimerEventDefinition, return_type[type[TimerJobEntity]], modifier[public static], parameter[timerEventDefinition, isInterruptingTimer, executionEntity, jobHandlerType, jobHandlerConfig]] begin[{] local_variable[type[ProcessEngineConfigurationImpl], processEngineConfiguration] local_variable[type[String], businessCalendarRef] local_variable[type[Expression], expression] local_variable[type[ExpressionManager], expressionManager] local_variable[type[VariableScope], scopeForExpression] if[binary_operation[member[.scopeForExpression], ==, literal[null]]] begin[{] assign[member[.scopeForExpression], call[NoExecutionVariableScope.getSharedInstance, parameter[]]] else begin[{] None end[}] if[call[StringUtils.isNotEmpty, parameter[call[timerEventDefinition.getTimeDate, parameter[]]]]] begin[{] assign[member[.businessCalendarRef], member[DueDateBusinessCalendar.NAME]] assign[member[.expression], call[expressionManager.createExpression, parameter[call[timerEventDefinition.getTimeDate, parameter[]]]]] else begin[{] if[call[StringUtils.isNotEmpty, parameter[call[timerEventDefinition.getTimeCycle, parameter[]]]]] begin[{] assign[member[.businessCalendarRef], member[CycleBusinessCalendar.NAME]] assign[member[.expression], call[expressionManager.createExpression, parameter[call[timerEventDefinition.getTimeCycle, parameter[]]]]] else begin[{] if[call[StringUtils.isNotEmpty, parameter[call[timerEventDefinition.getTimeDuration, parameter[]]]]] begin[{] assign[member[.businessCalendarRef], member[DurationBusinessCalendar.NAME]] assign[member[.expression], call[expressionManager.createExpression, parameter[call[timerEventDefinition.getTimeDuration, parameter[]]]]] else begin[{] None end[}] end[}] end[}] if[call[StringUtils.isNotEmpty, parameter[call[timerEventDefinition.getCalendarName, parameter[]]]]] begin[{] assign[member[.businessCalendarRef], call[timerEventDefinition.getCalendarName, parameter[]]] local_variable[type[Expression], businessCalendarExpression] assign[member[.businessCalendarRef], call[businessCalendarExpression.getValue, parameter[member[.scopeForExpression]]]] else begin[{] None end[}] if[binary_operation[member[.expression], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Timer needs configuration (either timeDate, timeCycle or timeDuration is needed) ("), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=timerEventDefinition, 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=ActivitiException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[BusinessCalendar], businessCalendar] local_variable[type[String], dueDateString] local_variable[type[Date], duedate] local_variable[type[Object], dueDateValue] if[binary_operation[member[.dueDateValue], instanceof, type[String]]] begin[{] assign[member[.dueDateString], Cast(expression=MemberReference(member=dueDateValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))] else begin[{] if[binary_operation[member[.dueDateValue], instanceof, type[Date]]] begin[{] assign[member[.duedate], Cast(expression=MemberReference(member=dueDateValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None))] else begin[{] if[binary_operation[member[.dueDateValue], instanceof, type[DateTime]]] begin[{] assign[member[.duedate], Cast(expression=MemberReference(member=dueDateValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DateTime, sub_type=None))] else begin[{] if[binary_operation[member[.dueDateValue], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Timer '"), operandr=MethodInvocation(arguments=[], member=getActivityId, postfix_operators=[], prefix_operators=[], qualifier=executionEntity, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' was not configured with a valid duration/time, either hand in a java.util.Date or a String in format 'yyyy-MM-dd'T'hh:mm:ss'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ActivitiException, sub_type=None)), label=None) else begin[{] None end[}] end[}] end[}] end[}] if[binary_operation[binary_operation[member[.duedate], ==, literal[null]], &&, binary_operation[member[.dueDateString], !=, literal[null]]]] begin[{] assign[member[.duedate], call[businessCalendar.resolveDuedate, parameter[member[.dueDateString]]]] else begin[{] None end[}] local_variable[type[TimerJobEntity], timer] if[binary_operation[member[.duedate], !=, literal[null]]] begin[{] assign[member[.timer], call[Context.getCommandContext, parameter[]]] call[timer.setJobType, parameter[member[JobEntity.JOB_TYPE_TIMER]]] call[timer.setRevision, parameter[literal[1]]] call[timer.setJobHandlerType, parameter[member[.jobHandlerType]]] call[timer.setJobHandlerConfiguration, parameter[member[.jobHandlerConfig]]] call[timer.setExclusive, parameter[literal[true]]] call[timer.setRetries, parameter[call[processEngineConfiguration.getAsyncExecutorNumberOfRetries, parameter[]]]] call[timer.setDuedate, parameter[member[.duedate]]] if[binary_operation[member[.executionEntity], !=, literal[null]]] begin[{] call[timer.setExecution, parameter[member[.executionEntity]]] call[timer.setProcessDefinitionId, parameter[call[executionEntity.getProcessDefinitionId, parameter[]]]] call[timer.setProcessInstanceId, parameter[call[executionEntity.getProcessInstanceId, parameter[]]]] if[binary_operation[call[executionEntity.getTenantId, parameter[]], !=, literal[null]]] begin[{] call[timer.setTenantId, parameter[call[executionEntity.getTenantId, parameter[]]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[call[StringUtils.isNotEmpty, parameter[call[timerEventDefinition.getTimeCycle, parameter[]]]]] begin[{] local_variable[type[boolean], repeat] if[binary_operation[member[.executionEntity], !=, literal[null]]] begin[{] local_variable[type[FlowElement], currentElement] if[binary_operation[member[.currentElement], instanceof, type[IntermediateCatchEvent]]] begin[{] assign[member[.repeat], literal[false]] else begin[{] None end[}] else begin[{] None end[}] if[member[.repeat]] begin[{] local_variable[type[String], prepared] call[timer.setRepeat, parameter[member[.prepared]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[.timer], !=, literal[null]], &&, binary_operation[member[.executionEntity], !=, literal[null]]]] begin[{] call[timer.setExecution, parameter[member[.executionEntity]]] call[timer.setProcessDefinitionId, parameter[call[executionEntity.getProcessDefinitionId, parameter[]]]] if[binary_operation[call[executionEntity.getTenantId, parameter[]], !=, literal[null]]] begin[{] call[timer.setTenantId, parameter[call[executionEntity.getTenantId, parameter[]]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.timer]] end[}] END[}]
Keyword[public] Keyword[static] identifier[TimerJobEntity] identifier[createTimerEntityForTimerEventDefinition] operator[SEP] identifier[TimerEventDefinition] identifier[timerEventDefinition] , Keyword[boolean] identifier[isInterruptingTimer] , identifier[ExecutionEntity] identifier[executionEntity] , identifier[String] identifier[jobHandlerType] , identifier[String] identifier[jobHandlerConfig] operator[SEP] { identifier[ProcessEngineConfigurationImpl] identifier[processEngineConfiguration] operator[=] identifier[Context] operator[SEP] identifier[getProcessEngineConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[businessCalendarRef] operator[=] Other[null] operator[SEP] identifier[Expression] identifier[expression] operator[=] Other[null] operator[SEP] identifier[ExpressionManager] identifier[expressionManager] operator[=] identifier[processEngineConfiguration] operator[SEP] identifier[getExpressionManager] operator[SEP] operator[SEP] operator[SEP] identifier[VariableScope] identifier[scopeForExpression] operator[=] identifier[executionEntity] operator[SEP] Keyword[if] operator[SEP] identifier[scopeForExpression] operator[==] Other[null] operator[SEP] { identifier[scopeForExpression] operator[=] identifier[NoExecutionVariableScope] operator[SEP] identifier[getSharedInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[timerEventDefinition] operator[SEP] identifier[getTimeDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[businessCalendarRef] operator[=] identifier[DueDateBusinessCalendar] operator[SEP] identifier[NAME] operator[SEP] identifier[expression] operator[=] identifier[expressionManager] operator[SEP] identifier[createExpression] operator[SEP] identifier[timerEventDefinition] operator[SEP] identifier[getTimeDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[timerEventDefinition] operator[SEP] identifier[getTimeCycle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[businessCalendarRef] operator[=] identifier[CycleBusinessCalendar] operator[SEP] identifier[NAME] operator[SEP] identifier[expression] operator[=] identifier[expressionManager] operator[SEP] identifier[createExpression] operator[SEP] identifier[timerEventDefinition] operator[SEP] identifier[getTimeCycle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[timerEventDefinition] operator[SEP] identifier[getTimeDuration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[businessCalendarRef] operator[=] identifier[DurationBusinessCalendar] operator[SEP] identifier[NAME] operator[SEP] identifier[expression] operator[=] identifier[expressionManager] operator[SEP] identifier[createExpression] operator[SEP] identifier[timerEventDefinition] operator[SEP] identifier[getTimeDuration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[timerEventDefinition] operator[SEP] identifier[getCalendarName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[businessCalendarRef] operator[=] identifier[timerEventDefinition] operator[SEP] identifier[getCalendarName] operator[SEP] operator[SEP] operator[SEP] identifier[Expression] identifier[businessCalendarExpression] operator[=] identifier[expressionManager] operator[SEP] identifier[createExpression] operator[SEP] identifier[businessCalendarRef] operator[SEP] operator[SEP] identifier[businessCalendarRef] operator[=] identifier[businessCalendarExpression] operator[SEP] identifier[getValue] operator[SEP] identifier[scopeForExpression] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[expression] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ActivitiException] operator[SEP] literal[String] operator[+] identifier[timerEventDefinition] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[BusinessCalendar] identifier[businessCalendar] operator[=] identifier[processEngineConfiguration] operator[SEP] identifier[getBusinessCalendarManager] operator[SEP] operator[SEP] operator[SEP] identifier[getBusinessCalendar] operator[SEP] identifier[businessCalendarRef] operator[SEP] operator[SEP] identifier[String] identifier[dueDateString] operator[=] Other[null] operator[SEP] identifier[Date] identifier[duedate] operator[=] Other[null] operator[SEP] identifier[Object] identifier[dueDateValue] operator[=] identifier[expression] operator[SEP] identifier[getValue] operator[SEP] identifier[scopeForExpression] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dueDateValue] Keyword[instanceof] identifier[String] operator[SEP] { identifier[dueDateString] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[dueDateValue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[dueDateValue] Keyword[instanceof] identifier[Date] operator[SEP] { identifier[duedate] operator[=] operator[SEP] identifier[Date] operator[SEP] identifier[dueDateValue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[dueDateValue] Keyword[instanceof] identifier[DateTime] operator[SEP] { identifier[duedate] operator[=] operator[SEP] operator[SEP] identifier[DateTime] operator[SEP] identifier[dueDateValue] operator[SEP] operator[SEP] identifier[toDate] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[dueDateValue] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ActivitiException] operator[SEP] literal[String] operator[+] identifier[executionEntity] operator[SEP] identifier[getActivityId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[duedate] operator[==] Other[null] operator[&&] identifier[dueDateString] operator[!=] Other[null] operator[SEP] { identifier[duedate] operator[=] identifier[businessCalendar] operator[SEP] identifier[resolveDuedate] operator[SEP] identifier[dueDateString] operator[SEP] operator[SEP] } identifier[TimerJobEntity] identifier[timer] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[duedate] operator[!=] Other[null] operator[SEP] { identifier[timer] operator[=] identifier[Context] operator[SEP] identifier[getCommandContext] operator[SEP] operator[SEP] operator[SEP] identifier[getTimerJobEntityManager] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setJobType] operator[SEP] identifier[JobEntity] operator[SEP] identifier[JOB_TYPE_TIMER] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setRevision] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setJobHandlerType] operator[SEP] identifier[jobHandlerType] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setJobHandlerConfiguration] operator[SEP] identifier[jobHandlerConfig] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setExclusive] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setRetries] operator[SEP] identifier[processEngineConfiguration] operator[SEP] identifier[getAsyncExecutorNumberOfRetries] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setDuedate] operator[SEP] identifier[duedate] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[executionEntity] operator[!=] Other[null] operator[SEP] { identifier[timer] operator[SEP] identifier[setExecution] operator[SEP] identifier[executionEntity] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setProcessDefinitionId] operator[SEP] identifier[executionEntity] operator[SEP] identifier[getProcessDefinitionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setProcessInstanceId] operator[SEP] identifier[executionEntity] operator[SEP] identifier[getProcessInstanceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[executionEntity] operator[SEP] identifier[getTenantId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[timer] operator[SEP] identifier[setTenantId] operator[SEP] identifier[executionEntity] operator[SEP] identifier[getTenantId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[timerEventDefinition] operator[SEP] identifier[getTimeCycle] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[repeat] operator[=] operator[!] identifier[isInterruptingTimer] operator[SEP] Keyword[if] operator[SEP] identifier[executionEntity] operator[!=] Other[null] operator[SEP] { identifier[FlowElement] identifier[currentElement] operator[=] identifier[executionEntity] operator[SEP] identifier[getCurrentFlowElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentElement] Keyword[instanceof] identifier[IntermediateCatchEvent] operator[SEP] { identifier[repeat] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[repeat] operator[SEP] { identifier[String] identifier[prepared] operator[=] identifier[prepareRepeat] operator[SEP] identifier[dueDateString] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setRepeat] operator[SEP] identifier[prepared] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[timer] operator[!=] Other[null] operator[&&] identifier[executionEntity] operator[!=] Other[null] operator[SEP] { identifier[timer] operator[SEP] identifier[setExecution] operator[SEP] identifier[executionEntity] operator[SEP] operator[SEP] identifier[timer] operator[SEP] identifier[setProcessDefinitionId] operator[SEP] identifier[executionEntity] operator[SEP] identifier[getProcessDefinitionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[executionEntity] operator[SEP] identifier[getTenantId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[timer] operator[SEP] identifier[setTenantId] operator[SEP] identifier[executionEntity] operator[SEP] identifier[getTenantId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[timer] operator[SEP] }
public <T> Future<T> executeMethod(Callable<T> call,Content content){ LogProcessContext logProcessContext = getLogProcessContext(); return logProcessContext.getExecuteManager().cacheCall(call, content); }
class class_name[name] begin[{] method[executeMethod, return_type[type[Future]], modifier[public], parameter[call, content]] begin[{] local_variable[type[LogProcessContext], logProcessContext] return[call[logProcessContext.getExecuteManager, parameter[]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[Future] operator[<] identifier[T] operator[>] identifier[executeMethod] operator[SEP] identifier[Callable] operator[<] identifier[T] operator[>] identifier[call] , identifier[Content] identifier[content] operator[SEP] { identifier[LogProcessContext] identifier[logProcessContext] operator[=] identifier[getLogProcessContext] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[logProcessContext] operator[SEP] identifier[getExecuteManager] operator[SEP] operator[SEP] operator[SEP] identifier[cacheCall] operator[SEP] identifier[call] , identifier[content] operator[SEP] operator[SEP] }
public void logTimes(String src, long mtime, long atime) { TimesOp op = TimesOp.getInstance(); op.set(src, mtime, atime); logEdit(op); }
class class_name[name] begin[{] method[logTimes, return_type[void], modifier[public], parameter[src, mtime, atime]] begin[{] local_variable[type[TimesOp], op] call[op.set, parameter[member[.src], member[.mtime], member[.atime]]] call[.logEdit, parameter[member[.op]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[logTimes] operator[SEP] identifier[String] identifier[src] , Keyword[long] identifier[mtime] , Keyword[long] identifier[atime] operator[SEP] { identifier[TimesOp] identifier[op] operator[=] identifier[TimesOp] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[op] operator[SEP] identifier[set] operator[SEP] identifier[src] , identifier[mtime] , identifier[atime] operator[SEP] operator[SEP] identifier[logEdit] operator[SEP] identifier[op] operator[SEP] operator[SEP] }
@Override public synchronized void close() throws SecurityException { if (logging != null) { try { logging.close(); } catch (Exception ex) { // ignore } } logging = null; }
class class_name[name] begin[{] method[close, return_type[void], modifier[synchronized public], parameter[]] begin[{] if[binary_operation[member[.logging], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=logging, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] assign[member[.logging], literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[SecurityException] { Keyword[if] operator[SEP] identifier[logging] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[logging] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { } } identifier[logging] operator[=] Other[null] operator[SEP] }
static <T> CompletableFuture<T> toFuture(Call<T> callToWrap) { final CallbackAdaptor<T> completableFuture = new CallbackAdaptor<>(); callToWrap.enqueue(completableFuture); return completableFuture; }
class class_name[name] begin[{] method[toFuture, return_type[type[CompletableFuture]], modifier[static], parameter[callToWrap]] begin[{] local_variable[type[CallbackAdaptor], completableFuture] call[callToWrap.enqueue, parameter[member[.completableFuture]]] return[member[.completableFuture]] end[}] END[}]
Keyword[static] operator[<] identifier[T] operator[>] identifier[CompletableFuture] operator[<] identifier[T] operator[>] identifier[toFuture] operator[SEP] identifier[Call] operator[<] identifier[T] operator[>] identifier[callToWrap] operator[SEP] { Keyword[final] identifier[CallbackAdaptor] operator[<] identifier[T] operator[>] identifier[completableFuture] operator[=] Keyword[new] identifier[CallbackAdaptor] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[callToWrap] operator[SEP] identifier[enqueue] operator[SEP] identifier[completableFuture] operator[SEP] operator[SEP] Keyword[return] identifier[completableFuture] operator[SEP] }
public static <E> E checkNotInstanceOf(Class type, E object, String errorMessage) { isNotNull(type, "type"); if (type.isInstance(object)) { throw new IllegalArgumentException(errorMessage); } return object; }
class class_name[name] begin[{] method[checkNotInstanceOf, return_type[type[E]], modifier[public static], parameter[type, object, errorMessage]] begin[{] call[.isNotNull, parameter[member[.type], literal["type"]]] if[call[type.isInstance, parameter[member[.object]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=errorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.object]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[E] identifier[checkNotInstanceOf] operator[SEP] identifier[Class] identifier[type] , identifier[E] identifier[object] , identifier[String] identifier[errorMessage] operator[SEP] { identifier[isNotNull] operator[SEP] identifier[type] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[isInstance] operator[SEP] identifier[object] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[errorMessage] operator[SEP] operator[SEP] } Keyword[return] identifier[object] operator[SEP] }
public void doConfigure(final InputStream inputStream, LoggerRepository repository) throws FactoryConfigurationError { ParseAction action = new ParseAction() { public Document parse(final DocumentBuilder parser) throws SAXException, IOException { InputSource inputSource = new InputSource(inputStream); inputSource.setSystemId("dummy://log4j.dtd"); return parser.parse(inputSource); } public String toString() { return "input stream [" + inputStream.toString() + "]"; } }; doConfigure(action, repository); }
class class_name[name] begin[{] method[doConfigure, return_type[void], modifier[public], parameter[inputStream, repository]] begin[{] local_variable[type[ParseAction], action] call[.doConfigure, parameter[member[.action], member[.repository]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[doConfigure] operator[SEP] Keyword[final] identifier[InputStream] identifier[inputStream] , identifier[LoggerRepository] identifier[repository] operator[SEP] Keyword[throws] identifier[FactoryConfigurationError] { identifier[ParseAction] identifier[action] operator[=] Keyword[new] identifier[ParseAction] operator[SEP] operator[SEP] { Keyword[public] identifier[Document] identifier[parse] operator[SEP] Keyword[final] identifier[DocumentBuilder] identifier[parser] operator[SEP] Keyword[throws] identifier[SAXException] , identifier[IOException] { identifier[InputSource] identifier[inputSource] operator[=] Keyword[new] identifier[InputSource] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] identifier[inputSource] operator[SEP] identifier[setSystemId] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[parser] operator[SEP] identifier[parse] operator[SEP] identifier[inputSource] operator[SEP] operator[SEP] } Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[+] identifier[inputStream] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] } } operator[SEP] identifier[doConfigure] operator[SEP] identifier[action] , identifier[repository] operator[SEP] operator[SEP] }
public Matrix4d scale(Vector3dc xyz, Matrix4d dest) { return scale(xyz.x(), xyz.y(), xyz.z(), dest); }
class class_name[name] begin[{] method[scale, return_type[type[Matrix4d]], modifier[public], parameter[xyz, dest]] begin[{] return[call[.scale, parameter[call[xyz.x, parameter[]], call[xyz.y, parameter[]], call[xyz.z, parameter[]], member[.dest]]]] end[}] END[}]
Keyword[public] identifier[Matrix4d] identifier[scale] operator[SEP] identifier[Vector3dc] identifier[xyz] , identifier[Matrix4d] identifier[dest] operator[SEP] { Keyword[return] identifier[scale] operator[SEP] identifier[xyz] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[xyz] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[xyz] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[dest] operator[SEP] operator[SEP] }
private File withPath(Path path, File dir) { return new File(dir, path.getPath()); }
class class_name[name] begin[{] method[withPath, return_type[type[File]], modifier[private], parameter[path, dir]] begin[{] return[ClassCreator(arguments=[MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] end[}] END[}]
Keyword[private] identifier[File] identifier[withPath] operator[SEP] identifier[Path] identifier[path] , identifier[File] identifier[dir] operator[SEP] { Keyword[return] Keyword[new] identifier[File] operator[SEP] identifier[dir] , identifier[path] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void elementMult( DMatrix3 a , DMatrix3 b) { a.a1 *= b.a1; a.a2 *= b.a2; a.a3 *= b.a3; }
class class_name[name] begin[{] method[elementMult, return_type[void], modifier[public static], parameter[a, b]] begin[{] assign[member[a.a1], member[b.a1]] assign[member[a.a2], member[b.a2]] assign[member[a.a3], member[b.a3]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[elementMult] operator[SEP] identifier[DMatrix3] identifier[a] , identifier[DMatrix3] identifier[b] operator[SEP] { identifier[a] operator[SEP] identifier[a1] operator[*=] identifier[b] operator[SEP] identifier[a1] operator[SEP] identifier[a] operator[SEP] identifier[a2] operator[*=] identifier[b] operator[SEP] identifier[a2] operator[SEP] identifier[a] operator[SEP] identifier[a3] operator[*=] identifier[b] operator[SEP] identifier[a3] operator[SEP] }
public static String decryptByDES(SecretKey key, String sInfo) { // 定义 加密算法, String algorithm = "DES"; // 加密随机数生成器 (RNG) SecureRandom sr = new SecureRandom(); byte[] cipherByte = null; try { // 得到加密/解密器 Cipher c1 = Cipher.getInstance(algorithm); // 用指定的密钥和模式初始化Cipher对象 c1.init(Cipher.DECRYPT_MODE, key, sr); // 对要解密的内容进行编码处理 cipherByte = c1.doFinal(hex2byte(sInfo)); } catch (Exception e) { e.printStackTrace(); } // return byte2hex(cipherByte); return new String(cipherByte); }
class class_name[name] begin[{] method[decryptByDES, return_type[type[String]], modifier[public static], parameter[key, sInfo]] begin[{] local_variable[type[String], algorithm] local_variable[type[SecureRandom], sr] local_variable[type[byte], cipherByte] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[], type_arguments=None), name=c1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cipher, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DECRYPT_MODE, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=c1, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cipherByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=sInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hex2byte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=doFinal, postfix_operators=[], prefix_operators=[], qualifier=c1, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[ClassCreator(arguments=[MemberReference(member=cipherByte, 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=String, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[decryptByDES] operator[SEP] identifier[SecretKey] identifier[key] , identifier[String] identifier[sInfo] operator[SEP] { identifier[String] identifier[algorithm] operator[=] literal[String] operator[SEP] identifier[SecureRandom] identifier[sr] operator[=] Keyword[new] identifier[SecureRandom] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[cipherByte] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[Cipher] identifier[c1] operator[=] identifier[Cipher] operator[SEP] identifier[getInstance] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP] identifier[c1] operator[SEP] identifier[init] operator[SEP] identifier[Cipher] operator[SEP] identifier[DECRYPT_MODE] , identifier[key] , identifier[sr] operator[SEP] operator[SEP] identifier[cipherByte] operator[=] identifier[c1] operator[SEP] identifier[doFinal] operator[SEP] identifier[hex2byte] operator[SEP] identifier[sInfo] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[cipherByte] operator[SEP] operator[SEP] }
public static Condition like(final String content, final String value) { int attrIndex = content.lastIndexOf('.'); String paramName = ":" + ( attrIndex == -1 ? content + System.currentTimeMillis() : content.substring(attrIndex + 1) + System.currentTimeMillis() ); return new Condition(content + " like " + paramName, "%" + value + "%"); }
class class_name[name] begin[{] method[like, return_type[type[Condition]], modifier[public static], parameter[content, value]] begin[{] local_variable[type[int], attrIndex] local_variable[type[String], paramName] return[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" like "), operator=+), operandr=MemberReference(member=paramName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%"), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Condition, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Condition] identifier[like] operator[SEP] Keyword[final] identifier[String] identifier[content] , Keyword[final] identifier[String] identifier[value] operator[SEP] { Keyword[int] identifier[attrIndex] operator[=] identifier[content] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[paramName] operator[=] literal[String] operator[+] operator[SEP] identifier[attrIndex] operator[==] operator[-] Other[1] operator[?] identifier[content] operator[+] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[:] identifier[content] operator[SEP] identifier[substring] operator[SEP] identifier[attrIndex] operator[+] Other[1] operator[SEP] operator[+] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Condition] operator[SEP] identifier[content] operator[+] literal[String] operator[+] identifier[paramName] , literal[String] operator[+] identifier[value] operator[+] literal[String] operator[SEP] operator[SEP] }
protected void selectBusSlave(final I2CDevice device) throws IOException { final int addr = device.getAddress(); if (lastAddress != addr) { lastAddress = addr; file.ioctl(I2CConstants.I2C_SLAVE, addr & 0xFF); } }
class class_name[name] begin[{] method[selectBusSlave, return_type[void], modifier[protected], parameter[device]] begin[{] local_variable[type[int], addr] if[binary_operation[member[.lastAddress], !=, member[.addr]]] begin[{] assign[member[.lastAddress], member[.addr]] call[file.ioctl, parameter[member[I2CConstants.I2C_SLAVE], binary_operation[member[.addr], &, literal[0xFF]]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[selectBusSlave] operator[SEP] Keyword[final] identifier[I2CDevice] identifier[device] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] Keyword[int] identifier[addr] operator[=] identifier[device] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastAddress] operator[!=] identifier[addr] operator[SEP] { identifier[lastAddress] operator[=] identifier[addr] operator[SEP] identifier[file] operator[SEP] identifier[ioctl] operator[SEP] identifier[I2CConstants] operator[SEP] identifier[I2C_SLAVE] , identifier[addr] operator[&] literal[Integer] operator[SEP] operator[SEP] } }
<T> Gauge gauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction) { return registerMeterIfNecessary(Gauge.class, id, id2 -> newGauge(id2, obj, valueFunction), NoopGauge::new); }
class class_name[name] begin[{] method[gauge, return_type[type[Gauge]], modifier[default], parameter[id, obj, valueFunction]] begin[{] return[call[.registerMeterIfNecessary, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Gauge, sub_type=None)), member[.id], LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=id2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueFunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newGauge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=id2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), MethodReference(expression=MemberReference(member=NoopGauge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=new, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), type_arguments=[])]]] end[}] END[}]
operator[<] identifier[T] operator[>] identifier[Gauge] identifier[gauge] operator[SEP] identifier[Meter] operator[SEP] identifier[Id] identifier[id] , annotation[@] identifier[Nullable] identifier[T] identifier[obj] , identifier[ToDoubleFunction] operator[<] identifier[T] operator[>] identifier[valueFunction] operator[SEP] { Keyword[return] identifier[registerMeterIfNecessary] operator[SEP] identifier[Gauge] operator[SEP] Keyword[class] , identifier[id] , identifier[id2] operator[->] identifier[newGauge] operator[SEP] identifier[id2] , identifier[obj] , identifier[valueFunction] operator[SEP] , identifier[NoopGauge] operator[::] Keyword[new] operator[SEP] operator[SEP] }
public OvhExchangeInformation serviceName_account_userPrincipalName_exchange_GET(String serviceName, String userPrincipalName) throws IOException { String qPath = "/msServices/{serviceName}/account/{userPrincipalName}/exchange"; StringBuilder sb = path(qPath, serviceName, userPrincipalName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhExchangeInformation.class); }
class class_name[name] begin[{] method[serviceName_account_userPrincipalName_exchange_GET, return_type[type[OvhExchangeInformation]], modifier[public], parameter[serviceName, userPrincipalName]] 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=OvhExchangeInformation, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhExchangeInformation] identifier[serviceName_account_userPrincipalName_exchange_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[userPrincipalName] 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[userPrincipalName] 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[OvhExchangeInformation] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
protected boolean isPersistedLockHolder(NodeData node) throws RepositoryException { LockData lData = lockManager.getExactNodeOrCloseParentLock(node); return lData != null && isLockHolder(lData); }
class class_name[name] begin[{] method[isPersistedLockHolder, return_type[type[boolean]], modifier[protected], parameter[node]] begin[{] local_variable[type[LockData], lData] return[binary_operation[binary_operation[member[.lData], !=, literal[null]], &&, call[.isLockHolder, parameter[member[.lData]]]]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[isPersistedLockHolder] operator[SEP] identifier[NodeData] identifier[node] operator[SEP] Keyword[throws] identifier[RepositoryException] { identifier[LockData] identifier[lData] operator[=] identifier[lockManager] operator[SEP] identifier[getExactNodeOrCloseParentLock] operator[SEP] identifier[node] operator[SEP] operator[SEP] Keyword[return] identifier[lData] operator[!=] Other[null] operator[&&] identifier[isLockHolder] operator[SEP] identifier[lData] operator[SEP] operator[SEP] }
public DataSink<T> write(FileOutputFormat<T> outputFormat, String filePath) { Preconditions.checkNotNull(filePath, "File path must not be null."); Preconditions.checkNotNull(outputFormat, "Output format must not be null."); outputFormat.setOutputFilePath(new Path(filePath)); return output(outputFormat); }
class class_name[name] begin[{] method[write, return_type[type[DataSink]], modifier[public], parameter[outputFormat, filePath]] begin[{] call[Preconditions.checkNotNull, parameter[member[.filePath], literal["File path must not be null."]]] call[Preconditions.checkNotNull, parameter[member[.outputFormat], literal["Output format must not be null."]]] call[outputFormat.setOutputFilePath, parameter[ClassCreator(arguments=[MemberReference(member=filePath, 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=Path, sub_type=None))]] return[call[.output, parameter[member[.outputFormat]]]] end[}] END[}]
Keyword[public] identifier[DataSink] operator[<] identifier[T] operator[>] identifier[write] operator[SEP] identifier[FileOutputFormat] operator[<] identifier[T] operator[>] identifier[outputFormat] , identifier[String] identifier[filePath] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[filePath] , literal[String] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[outputFormat] , literal[String] operator[SEP] operator[SEP] identifier[outputFormat] operator[SEP] identifier[setOutputFilePath] operator[SEP] Keyword[new] identifier[Path] operator[SEP] identifier[filePath] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[output] operator[SEP] identifier[outputFormat] operator[SEP] operator[SEP] }
static String computeMd5ChecksumLimit6(String inAsHex2) { byte[] bytes = computeMd5ChecksumFull(inAsHex2); String md5checksum = bytesToHexString(bytes[2], bytes[1], bytes[0]); return md5checksum; }
class class_name[name] begin[{] method[computeMd5ChecksumLimit6, return_type[type[String]], modifier[static], parameter[inAsHex2]] begin[{] local_variable[type[byte], bytes] local_variable[type[String], md5checksum] return[member[.md5checksum]] end[}] END[}]
Keyword[static] identifier[String] identifier[computeMd5ChecksumLimit6] operator[SEP] identifier[String] identifier[inAsHex2] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] identifier[computeMd5ChecksumFull] operator[SEP] identifier[inAsHex2] operator[SEP] operator[SEP] identifier[String] identifier[md5checksum] operator[=] identifier[bytesToHexString] operator[SEP] identifier[bytes] operator[SEP] Other[2] operator[SEP] , identifier[bytes] operator[SEP] Other[1] operator[SEP] , identifier[bytes] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[md5checksum] operator[SEP] }
public <K, C> ColumnMutation prepareColumnMutation(ColumnFamily<K, C> cf, K rowKey, C column, ConsistencyLevel consistency) { return _astyanaxKeyspace.prepareColumnMutation(cf, rowKey, column).setConsistencyLevel(clamp(consistency)); }
class class_name[name] begin[{] method[prepareColumnMutation, return_type[type[ColumnMutation]], modifier[public], parameter[cf, rowKey, column, consistency]] begin[{] return[call[_astyanaxKeyspace.prepareColumnMutation, parameter[member[.cf], member[.rowKey], member[.column]]]] end[}] END[}]
Keyword[public] operator[<] identifier[K] , identifier[C] operator[>] identifier[ColumnMutation] identifier[prepareColumnMutation] operator[SEP] identifier[ColumnFamily] operator[<] identifier[K] , identifier[C] operator[>] identifier[cf] , identifier[K] identifier[rowKey] , identifier[C] identifier[column] , identifier[ConsistencyLevel] identifier[consistency] operator[SEP] { Keyword[return] identifier[_astyanaxKeyspace] operator[SEP] identifier[prepareColumnMutation] operator[SEP] identifier[cf] , identifier[rowKey] , identifier[column] operator[SEP] operator[SEP] identifier[setConsistencyLevel] operator[SEP] identifier[clamp] operator[SEP] identifier[consistency] operator[SEP] operator[SEP] operator[SEP] }
@Nonnull public JSFormatter outdentAlways () { if (m_nIndentLevel == 0) throw new IllegalStateException ("Nothing left to outdent!"); m_nIndentLevel--; m_sIndentCache = m_sIndentCache.substring (0, m_nIndentLevel * m_aSettings.getIndent ().length ()); return this; }
class class_name[name] begin[{] method[outdentAlways, return_type[type[JSFormatter]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.m_nIndentLevel], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Nothing left to outdent!")], 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[}] member[.m_nIndentLevel] assign[member[.m_sIndentCache], call[m_sIndentCache.substring, parameter[literal[0], binary_operation[member[.m_nIndentLevel], *, call[m_aSettings.getIndent, parameter[]]]]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] identifier[JSFormatter] identifier[outdentAlways] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_nIndentLevel] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[m_nIndentLevel] operator[--] operator[SEP] identifier[m_sIndentCache] operator[=] identifier[m_sIndentCache] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[m_nIndentLevel] operator[*] identifier[m_aSettings] operator[SEP] identifier[getIndent] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public boolean search(Collection<String> names) { while (next()) { if (names.contains(getName())) { return true; } } return false; }
class class_name[name] begin[{] method[search, return_type[type[boolean]], modifier[public], parameter[names]] begin[{] while[call[.next, parameter[]]] begin[{] if[call[names.contains, parameter[call[.getName, parameter[]]]]] begin[{] return[literal[true]] else begin[{] None end[}] end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[search] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[names] operator[SEP] { Keyword[while] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[names] operator[SEP] identifier[contains] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
private Collection<ImmutableMember> handleSync(ImmutableMember member) { updateState(member); return new ArrayList<>(members.values().stream().map(SwimMember::copy).collect(Collectors.toList())); }
class class_name[name] begin[{] method[handleSync, return_type[type[Collection]], modifier[private], parameter[member]] begin[{] call[.updateState, parameter[member[.member]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=members, selectors=[MethodInvocation(arguments=[], member=stream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=SwimMember, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=copy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toList, postfix_operators=[], prefix_operators=[], qualifier=Collectors, selectors=[], type_arguments=None)], member=collect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] end[}] END[}]
Keyword[private] identifier[Collection] operator[<] identifier[ImmutableMember] operator[>] identifier[handleSync] operator[SEP] identifier[ImmutableMember] identifier[member] operator[SEP] { identifier[updateState] operator[SEP] identifier[member] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[members] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[SwimMember] operator[::] identifier[copy] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private Trigger getTrigger(JobKey jobKey, Properties jobProps) { // Build a trigger for the job with the given cron-style schedule return TriggerBuilder.newTrigger() .withIdentity(jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY), Strings.nullToEmpty(jobProps.getProperty(ConfigurationKeys.JOB_GROUP_KEY))) .forJob(jobKey) .withSchedule(CronScheduleBuilder.cronSchedule(jobProps.getProperty(ConfigurationKeys.JOB_SCHEDULE_KEY))) .build(); }
class class_name[name] begin[{] method[getTrigger, return_type[type[Trigger]], modifier[private], parameter[jobKey, jobProps]] begin[{] return[call[TriggerBuilder.newTrigger, parameter[]]] end[}] END[}]
Keyword[private] identifier[Trigger] identifier[getTrigger] operator[SEP] identifier[JobKey] identifier[jobKey] , identifier[Properties] identifier[jobProps] operator[SEP] { Keyword[return] identifier[TriggerBuilder] operator[SEP] identifier[newTrigger] operator[SEP] operator[SEP] operator[SEP] identifier[withIdentity] operator[SEP] identifier[jobProps] operator[SEP] identifier[getProperty] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[JOB_NAME_KEY] operator[SEP] , identifier[Strings] operator[SEP] identifier[nullToEmpty] operator[SEP] identifier[jobProps] operator[SEP] identifier[getProperty] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[JOB_GROUP_KEY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[forJob] operator[SEP] identifier[jobKey] operator[SEP] operator[SEP] identifier[withSchedule] operator[SEP] identifier[CronScheduleBuilder] operator[SEP] identifier[cronSchedule] operator[SEP] identifier[jobProps] operator[SEP] identifier[getProperty] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[JOB_SCHEDULE_KEY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
private Graph<Module> buildGraph(Map<Module, Set<Module>> edges) { Graph.Builder<Module> builder = new Graph.Builder<>(); Set<Module> visited = new HashSet<>(); Deque<Module> deque = new LinkedList<>(); edges.entrySet().stream().forEach(e -> { Module m = e.getKey(); deque.add(m); e.getValue().stream().forEach(v -> { deque.add(v); builder.addEdge(m, v); }); }); // read requires transitive from ModuleDescriptor Module source; while ((source = deque.poll()) != null) { if (visited.contains(source)) continue; visited.add(source); builder.addNode(source); Module from = source; requiresTransitive(from).forEach(m -> { deque.add(m); builder.addEdge(from, m); }); } return builder.build(); }
class class_name[name] begin[{] method[buildGraph, return_type[type[Graph]], modifier[private], parameter[edges]] begin[{] local_variable[type[Graph], builder] local_variable[type[Set], visited] local_variable[type[Deque], deque] call[edges.entrySet, parameter[]] local_variable[type[Module], source] while[binary_operation[assign[member[.source], call[deque.poll, parameter[]]], !=, literal[null]]] begin[{] if[call[visited.contains, parameter[member[.source]]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] call[visited.add, parameter[member[.source]]] call[builder.addNode, parameter[member[.source]]] local_variable[type[Module], from] call[.requiresTransitive, parameter[member[.from]]] end[}] return[call[builder.build, parameter[]]] end[}] END[}]
Keyword[private] identifier[Graph] operator[<] identifier[Module] operator[>] identifier[buildGraph] operator[SEP] identifier[Map] operator[<] identifier[Module] , identifier[Set] operator[<] identifier[Module] operator[>] operator[>] identifier[edges] operator[SEP] { identifier[Graph] operator[SEP] identifier[Builder] operator[<] identifier[Module] operator[>] identifier[builder] operator[=] Keyword[new] identifier[Graph] operator[SEP] identifier[Builder] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Module] operator[>] identifier[visited] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Deque] operator[<] identifier[Module] operator[>] identifier[deque] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[edges] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[e] operator[->] { identifier[Module] identifier[m] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[deque] operator[SEP] identifier[add] operator[SEP] identifier[m] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[v] operator[->] { identifier[deque] operator[SEP] identifier[add] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addEdge] operator[SEP] identifier[m] , identifier[v] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[Module] identifier[source] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[source] operator[=] identifier[deque] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[visited] operator[SEP] identifier[contains] operator[SEP] identifier[source] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[visited] operator[SEP] identifier[add] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addNode] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[Module] identifier[from] operator[=] identifier[source] operator[SEP] identifier[requiresTransitive] operator[SEP] identifier[from] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[m] operator[->] { identifier[deque] operator[SEP] identifier[add] operator[SEP] identifier[m] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addEdge] operator[SEP] identifier[from] , identifier[m] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public void setDefaultTimeout(Duration timeout) { LettuceAssert.notNull(timeout, "Timeout duration must not be null"); LettuceAssert.isTrue(!timeout.isNegative(), "Timeout duration must be greater or equal to zero"); this.timeout = timeout; }
class class_name[name] begin[{] method[setDefaultTimeout, return_type[void], modifier[public], parameter[timeout]] begin[{] call[LettuceAssert.notNull, parameter[member[.timeout], literal["Timeout duration must not be null"]]] call[LettuceAssert.isTrue, parameter[call[timeout.isNegative, parameter[]], literal["Timeout duration must be greater or equal to zero"]]] assign[THIS[member[None.timeout]], member[.timeout]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDefaultTimeout] operator[SEP] identifier[Duration] identifier[timeout] operator[SEP] { identifier[LettuceAssert] operator[SEP] identifier[notNull] operator[SEP] identifier[timeout] , literal[String] operator[SEP] operator[SEP] identifier[LettuceAssert] operator[SEP] identifier[isTrue] operator[SEP] operator[!] identifier[timeout] operator[SEP] identifier[isNegative] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[timeout] operator[=] identifier[timeout] operator[SEP] }
public static InetAddress[] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[]{addr}; } catch (UnknownHostException e) { Record[] records = lookupHostName(name); InetAddress[] addrs = new InetAddress[records.length]; for (int i = 0; i < records.length; i++) addrs[i] = addrFromRecord(name, records[i]); return addrs; } }
class class_name[name] begin[{] method[getAllByName, return_type[type[InetAddress]], modifier[public static], parameter[name]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=addr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetAddress, sub_type=None)), ReturnStatement(expression=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=addr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetAddress, sub_type=None)), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lookupHostName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=records)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Record, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=records, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InetAddress, sub_type=None)), name=addrs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=InetAddress, sub_type=None)), ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=addrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=records, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=addrFromRecord, 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=records, 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=addrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnknownHostException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[InetAddress] operator[SEP] operator[SEP] identifier[getAllByName] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[UnknownHostException] { Keyword[try] { identifier[InetAddress] identifier[addr] operator[=] identifier[getByAddress] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[InetAddress] operator[SEP] operator[SEP] { identifier[addr] } operator[SEP] } Keyword[catch] operator[SEP] identifier[UnknownHostException] identifier[e] operator[SEP] { identifier[Record] operator[SEP] operator[SEP] identifier[records] operator[=] identifier[lookupHostName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[InetAddress] operator[SEP] operator[SEP] identifier[addrs] operator[=] Keyword[new] identifier[InetAddress] operator[SEP] identifier[records] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[records] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[addrs] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[addrFromRecord] operator[SEP] identifier[name] , identifier[records] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[addrs] operator[SEP] } }
private DateTime parseFromDate(String fromDate) { // Default to the last 30 days DateTime defaultFrom = new DateTime().withZone(DateTimeZone.UTC).minusDays(30).withHourOfDay(0) .withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0); return parseDate(fromDate, defaultFrom, true); }
class class_name[name] begin[{] method[parseFromDate, return_type[type[DateTime]], modifier[private], parameter[fromDate]] begin[{] local_variable[type[DateTime], defaultFrom] return[call[.parseDate, parameter[member[.fromDate], member[.defaultFrom], literal[true]]]] end[}] END[}]
Keyword[private] identifier[DateTime] identifier[parseFromDate] operator[SEP] identifier[String] identifier[fromDate] operator[SEP] { identifier[DateTime] identifier[defaultFrom] operator[=] Keyword[new] identifier[DateTime] operator[SEP] operator[SEP] operator[SEP] identifier[withZone] operator[SEP] identifier[DateTimeZone] operator[SEP] identifier[UTC] operator[SEP] operator[SEP] identifier[minusDays] operator[SEP] Other[30] operator[SEP] operator[SEP] identifier[withHourOfDay] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[withMinuteOfHour] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[withSecondOfMinute] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[withMillisOfSecond] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[parseDate] operator[SEP] identifier[fromDate] , identifier[defaultFrom] , literal[boolean] operator[SEP] operator[SEP] }
public boolean useReturnValueWithPath(JmxRequest pJmxRequest) { JsonRequestHandler handler = requestHandlerManager.getRequestHandler(pJmxRequest.getType()); return handler.useReturnValueWithPath(); }
class class_name[name] begin[{] method[useReturnValueWithPath, return_type[type[boolean]], modifier[public], parameter[pJmxRequest]] begin[{] local_variable[type[JsonRequestHandler], handler] return[call[handler.useReturnValueWithPath, parameter[]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[useReturnValueWithPath] operator[SEP] identifier[JmxRequest] identifier[pJmxRequest] operator[SEP] { identifier[JsonRequestHandler] identifier[handler] operator[=] identifier[requestHandlerManager] operator[SEP] identifier[getRequestHandler] operator[SEP] identifier[pJmxRequest] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[handler] operator[SEP] identifier[useReturnValueWithPath] operator[SEP] operator[SEP] operator[SEP] }
@Override protected Scorer createScorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException { return new MatchAllScorer(reader, field); }
class class_name[name] begin[{] method[createScorer, return_type[type[Scorer]], modifier[protected], parameter[reader, scoreDocsInOrder, topScorer]] begin[{] return[ClassCreator(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=field, 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=MatchAllScorer, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Scorer] identifier[createScorer] operator[SEP] identifier[IndexReader] identifier[reader] , Keyword[boolean] identifier[scoreDocsInOrder] , Keyword[boolean] identifier[topScorer] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] Keyword[new] identifier[MatchAllScorer] operator[SEP] identifier[reader] , identifier[field] operator[SEP] operator[SEP] }
@Override public <T extends Query> T setSpellcheckOptions(SpellcheckOptions spellcheckOptions) { return query.setSpellcheckOptions(spellcheckOptions); }
class class_name[name] begin[{] method[setSpellcheckOptions, return_type[type[T]], modifier[public], parameter[spellcheckOptions]] begin[{] return[call[query.setSpellcheckOptions, parameter[member[.spellcheckOptions]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Query] operator[>] identifier[T] identifier[setSpellcheckOptions] operator[SEP] identifier[SpellcheckOptions] identifier[spellcheckOptions] operator[SEP] { Keyword[return] identifier[query] operator[SEP] identifier[setSpellcheckOptions] operator[SEP] identifier[spellcheckOptions] operator[SEP] operator[SEP] }
public void addInterceptor(Interceptor interceptor) { if (interceptor == null) { throw new NullPointerException("interceptor can't be null"); } if (interceptorChain == null) { interceptorChain = new InterceptorChain(); } interceptorChain.addInterceptor(interceptor); }
class class_name[name] begin[{] method[addInterceptor, return_type[void], modifier[public], parameter[interceptor]] begin[{] if[binary_operation[member[.interceptor], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="interceptor can't be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.interceptorChain], ==, literal[null]]] begin[{] assign[member[.interceptorChain], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InterceptorChain, sub_type=None))] else begin[{] None end[}] call[interceptorChain.addInterceptor, parameter[member[.interceptor]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addInterceptor] operator[SEP] identifier[Interceptor] identifier[interceptor] operator[SEP] { Keyword[if] operator[SEP] identifier[interceptor] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[interceptorChain] operator[==] Other[null] operator[SEP] { identifier[interceptorChain] operator[=] Keyword[new] identifier[InterceptorChain] operator[SEP] operator[SEP] operator[SEP] } identifier[interceptorChain] operator[SEP] identifier[addInterceptor] operator[SEP] identifier[interceptor] operator[SEP] operator[SEP] }
public static ConcurrentRuntimeException extractCauseUnchecked( final ExecutionException ex) { if (ex == null || ex.getCause() == null) { return null; } throwCause(ex); return new ConcurrentRuntimeException(ex.getMessage(), ex.getCause()); }
class class_name[name] begin[{] method[extractCauseUnchecked, return_type[type[ConcurrentRuntimeException]], modifier[public static], parameter[ex]] begin[{] if[binary_operation[binary_operation[member[.ex], ==, literal[null]], ||, binary_operation[call[ex.getCause, parameter[]], ==, literal[null]]]] begin[{] return[literal[null]] else begin[{] None end[}] call[.throwCause, parameter[member[.ex]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConcurrentRuntimeException, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ConcurrentRuntimeException] identifier[extractCauseUnchecked] operator[SEP] Keyword[final] identifier[ExecutionException] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] identifier[ex] operator[==] Other[null] operator[||] identifier[ex] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[throwCause] operator[SEP] identifier[ex] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ConcurrentRuntimeException] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@RequirePOST public synchronized void doConfigSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { JSONObject src = req.getSubmittedForm(); String newName = src.getString("name"), redirect = "."; XmlFile oldFile = null; if(!name.equals(newName)) { Jenkins.checkGoodName(newName); oldFile = getConfigFile(); // rename getParent().logRecorders.remove(name); this.name = newName; getParent().logRecorders.put(name,this); redirect = "../" + Util.rawEncode(newName) + '/'; } List<Target> newTargets = req.bindJSONToList(Target.class, src.get("targets")); for (Target t : newTargets) t.enable(); targets.replaceBy(newTargets); save(); if (oldFile!=null) oldFile.delete(); rsp.sendRedirect2(redirect); }
class class_name[name] begin[{] method[doConfigSubmit, return_type[void], modifier[synchronized public], parameter[req, rsp]] begin[{] local_variable[type[JSONObject], src] local_variable[type[String], newName] local_variable[type[XmlFile], oldFile] if[call[name.equals, parameter[member[.newName]]]] begin[{] call[Jenkins.checkGoodName, parameter[member[.newName]]] assign[member[.oldFile], call[.getConfigFile, parameter[]]] call[.getParent, parameter[]] assign[THIS[member[None.name]], member[.newName]] call[.getParent, parameter[]] assign[member[.redirect], binary_operation[binary_operation[literal["../"], +, call[Util.rawEncode, parameter[member[.newName]]]], +, literal['/']]] else begin[{] None end[}] local_variable[type[List], newTargets] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[], member=enable, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=newTargets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Target, sub_type=None))), label=None) call[targets.replaceBy, parameter[member[.newTargets]]] call[.save, parameter[]] if[binary_operation[member[.oldFile], !=, literal[null]]] begin[{] call[oldFile.delete, parameter[]] else begin[{] None end[}] call[rsp.sendRedirect2, parameter[member[.redirect]]] end[}] END[}]
annotation[@] identifier[RequirePOST] Keyword[public] Keyword[synchronized] Keyword[void] identifier[doConfigSubmit] operator[SEP] identifier[StaplerRequest] identifier[req] , identifier[StaplerResponse] identifier[rsp] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { identifier[JSONObject] identifier[src] operator[=] identifier[req] operator[SEP] identifier[getSubmittedForm] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[newName] operator[=] identifier[src] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] , identifier[redirect] operator[=] literal[String] operator[SEP] identifier[XmlFile] identifier[oldFile] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[newName] operator[SEP] operator[SEP] { identifier[Jenkins] operator[SEP] identifier[checkGoodName] operator[SEP] identifier[newName] operator[SEP] operator[SEP] identifier[oldFile] operator[=] identifier[getConfigFile] operator[SEP] operator[SEP] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[logRecorders] operator[SEP] identifier[remove] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[name] operator[=] identifier[newName] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[logRecorders] operator[SEP] identifier[put] operator[SEP] identifier[name] , Keyword[this] operator[SEP] operator[SEP] identifier[redirect] operator[=] literal[String] operator[+] identifier[Util] operator[SEP] identifier[rawEncode] operator[SEP] identifier[newName] operator[SEP] operator[+] literal[String] operator[SEP] } identifier[List] operator[<] identifier[Target] operator[>] identifier[newTargets] operator[=] identifier[req] operator[SEP] identifier[bindJSONToList] operator[SEP] identifier[Target] operator[SEP] Keyword[class] , identifier[src] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Target] identifier[t] operator[:] identifier[newTargets] operator[SEP] identifier[t] operator[SEP] identifier[enable] operator[SEP] operator[SEP] operator[SEP] identifier[targets] operator[SEP] identifier[replaceBy] operator[SEP] identifier[newTargets] operator[SEP] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldFile] operator[!=] Other[null] operator[SEP] identifier[oldFile] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[rsp] operator[SEP] identifier[sendRedirect2] operator[SEP] identifier[redirect] operator[SEP] operator[SEP] }
public static Date getYear(String string) { if (string == null) { return null; } Date date = null; try { date = ((SimpleDateFormat)year.clone()) .parse(string); } catch (ParseException ex) { return null; } return date; }
class class_name[name] begin[{] method[getYear, return_type[type[Date]], modifier[public static], parameter[string]] begin[{] if[binary_operation[member[.string], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Date], date] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=year, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SimpleDateFormat, sub_type=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=ex, types=['ParseException']))], finally_block=None, label=None, resources=None) return[member[.date]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[getYear] operator[SEP] identifier[String] identifier[string] operator[SEP] { Keyword[if] operator[SEP] identifier[string] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Date] identifier[date] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[date] operator[=] operator[SEP] operator[SEP] identifier[SimpleDateFormat] operator[SEP] identifier[year] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[string] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParseException] identifier[ex] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[date] operator[SEP] }
public static PhasedBackoffWaitStrategy withLiteLock( long spinTimeout, long yieldTimeout, TimeUnit units) { return new PhasedBackoffWaitStrategy( spinTimeout, yieldTimeout, units, new LiteBlockingWaitStrategy()); }
class class_name[name] begin[{] method[withLiteLock, return_type[type[PhasedBackoffWaitStrategy]], modifier[public static], parameter[spinTimeout, yieldTimeout, units]] begin[{] return[ClassCreator(arguments=[MemberReference(member=spinTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=yieldTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=units, 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=LiteBlockingWaitStrategy, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PhasedBackoffWaitStrategy, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[PhasedBackoffWaitStrategy] identifier[withLiteLock] operator[SEP] Keyword[long] identifier[spinTimeout] , Keyword[long] identifier[yieldTimeout] , identifier[TimeUnit] identifier[units] operator[SEP] { Keyword[return] Keyword[new] identifier[PhasedBackoffWaitStrategy] operator[SEP] identifier[spinTimeout] , identifier[yieldTimeout] , identifier[units] , Keyword[new] identifier[LiteBlockingWaitStrategy] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void link(Activity context, String token, String secret, SocializeAuthListener listener) { TwitterAuthProviderInfo twInfo = new TwitterAuthProviderInfo(); twInfo.setConsumerKey(config.getProperty(SocializeConfig.TWITTER_CONSUMER_KEY)); twInfo.setConsumerSecret(config.getProperty(SocializeConfig.TWITTER_CONSUMER_SECRET)); DefaultUserProviderCredentials credentials = new DefaultUserProviderCredentials(); credentials.setAuthProviderInfo(twInfo); credentials.setAccessToken(token); credentials.setTokenSecret(secret); getSocialize().authenticateKnownUser( context, credentials, listener); }
class class_name[name] begin[{] method[link, return_type[void], modifier[public], parameter[context, token, secret, listener]] begin[{] local_variable[type[TwitterAuthProviderInfo], twInfo] call[twInfo.setConsumerKey, parameter[call[config.getProperty, parameter[member[SocializeConfig.TWITTER_CONSUMER_KEY]]]]] call[twInfo.setConsumerSecret, parameter[call[config.getProperty, parameter[member[SocializeConfig.TWITTER_CONSUMER_SECRET]]]]] local_variable[type[DefaultUserProviderCredentials], credentials] call[credentials.setAuthProviderInfo, parameter[member[.twInfo]]] call[credentials.setAccessToken, parameter[member[.token]]] call[credentials.setTokenSecret, parameter[member[.secret]]] call[.getSocialize, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[link] operator[SEP] identifier[Activity] identifier[context] , identifier[String] identifier[token] , identifier[String] identifier[secret] , identifier[SocializeAuthListener] identifier[listener] operator[SEP] { identifier[TwitterAuthProviderInfo] identifier[twInfo] operator[=] Keyword[new] identifier[TwitterAuthProviderInfo] operator[SEP] operator[SEP] operator[SEP] identifier[twInfo] operator[SEP] identifier[setConsumerKey] operator[SEP] identifier[config] operator[SEP] identifier[getProperty] operator[SEP] identifier[SocializeConfig] operator[SEP] identifier[TWITTER_CONSUMER_KEY] operator[SEP] operator[SEP] operator[SEP] identifier[twInfo] operator[SEP] identifier[setConsumerSecret] operator[SEP] identifier[config] operator[SEP] identifier[getProperty] operator[SEP] identifier[SocializeConfig] operator[SEP] identifier[TWITTER_CONSUMER_SECRET] operator[SEP] operator[SEP] operator[SEP] identifier[DefaultUserProviderCredentials] identifier[credentials] operator[=] Keyword[new] identifier[DefaultUserProviderCredentials] operator[SEP] operator[SEP] operator[SEP] identifier[credentials] operator[SEP] identifier[setAuthProviderInfo] operator[SEP] identifier[twInfo] operator[SEP] operator[SEP] identifier[credentials] operator[SEP] identifier[setAccessToken] operator[SEP] identifier[token] operator[SEP] operator[SEP] identifier[credentials] operator[SEP] identifier[setTokenSecret] operator[SEP] identifier[secret] operator[SEP] operator[SEP] identifier[getSocialize] operator[SEP] operator[SEP] operator[SEP] identifier[authenticateKnownUser] operator[SEP] identifier[context] , identifier[credentials] , identifier[listener] operator[SEP] operator[SEP] }
public static String format(final LocalDate self, FormatStyle dateStyle) { return self.format(DateTimeFormatter.ofLocalizedDate(dateStyle)); }
class class_name[name] begin[{] method[format, return_type[type[String]], modifier[public static], parameter[self, dateStyle]] begin[{] return[call[self.format, parameter[call[DateTimeFormatter.ofLocalizedDate, parameter[member[.dateStyle]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[format] operator[SEP] Keyword[final] identifier[LocalDate] identifier[self] , identifier[FormatStyle] identifier[dateStyle] operator[SEP] { Keyword[return] identifier[self] operator[SEP] identifier[format] operator[SEP] identifier[DateTimeFormatter] operator[SEP] identifier[ofLocalizedDate] operator[SEP] identifier[dateStyle] operator[SEP] operator[SEP] operator[SEP] }
public Observable<ServiceResponseWithHeaders<CloudTask, TaskGetHeaders>> getWithServiceResponseAsync(String jobId, String taskId, TaskGetOptions taskGetOptions) { if (this.client.batchUrl() == null) { throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null."); } if (jobId == null) { throw new IllegalArgumentException("Parameter jobId is required and cannot be null."); } if (taskId == null) { throw new IllegalArgumentException("Parameter taskId is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(taskGetOptions); String select = null; if (taskGetOptions != null) { select = taskGetOptions.select(); } String expand = null; if (taskGetOptions != null) { expand = taskGetOptions.expand(); } Integer timeout = null; if (taskGetOptions != null) { timeout = taskGetOptions.timeout(); } UUID clientRequestId = null; if (taskGetOptions != null) { clientRequestId = taskGetOptions.clientRequestId(); } Boolean returnClientRequestId = null; if (taskGetOptions != null) { returnClientRequestId = taskGetOptions.returnClientRequestId(); } DateTime ocpDate = null; if (taskGetOptions != null) { ocpDate = taskGetOptions.ocpDate(); } String ifMatch = null; if (taskGetOptions != null) { ifMatch = taskGetOptions.ifMatch(); } String ifNoneMatch = null; if (taskGetOptions != null) { ifNoneMatch = taskGetOptions.ifNoneMatch(); } DateTime ifModifiedSince = null; if (taskGetOptions != null) { ifModifiedSince = taskGetOptions.ifModifiedSince(); } DateTime ifUnmodifiedSince = null; if (taskGetOptions != null) { ifUnmodifiedSince = taskGetOptions.ifUnmodifiedSince(); } String parameterizedHost = Joiner.on(", ").join("{batchUrl}", this.client.batchUrl()); DateTimeRfc1123 ocpDateConverted = null; if (ocpDate != null) { ocpDateConverted = new DateTimeRfc1123(ocpDate); } DateTimeRfc1123 ifModifiedSinceConverted = null; if (ifModifiedSince != null) { ifModifiedSinceConverted = new DateTimeRfc1123(ifModifiedSince); } DateTimeRfc1123 ifUnmodifiedSinceConverted = null; if (ifUnmodifiedSince != null) { ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince); } return service.get(jobId, taskId, this.client.apiVersion(), this.client.acceptLanguage(), select, expand, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<CloudTask, TaskGetHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<CloudTask, TaskGetHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<CloudTask, TaskGetHeaders> clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[getWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[jobId, taskId, taskGetOptions]] begin[{] if[binary_operation[THIS[member[None.client]call[None.batchUrl, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.batchUrl() is required and 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[.jobId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter jobId is required and 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[.taskId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter taskId is required and 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[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and 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[}] call[Validator.validate, parameter[member[.taskGetOptions]]] local_variable[type[String], select] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.select], call[taskGetOptions.select, parameter[]]] else begin[{] None end[}] local_variable[type[String], expand] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.expand], call[taskGetOptions.expand, parameter[]]] else begin[{] None end[}] local_variable[type[Integer], timeout] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.timeout], call[taskGetOptions.timeout, parameter[]]] else begin[{] None end[}] local_variable[type[UUID], clientRequestId] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.clientRequestId], call[taskGetOptions.clientRequestId, parameter[]]] else begin[{] None end[}] local_variable[type[Boolean], returnClientRequestId] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.returnClientRequestId], call[taskGetOptions.returnClientRequestId, parameter[]]] else begin[{] None end[}] local_variable[type[DateTime], ocpDate] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.ocpDate], call[taskGetOptions.ocpDate, parameter[]]] else begin[{] None end[}] local_variable[type[String], ifMatch] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.ifMatch], call[taskGetOptions.ifMatch, parameter[]]] else begin[{] None end[}] local_variable[type[String], ifNoneMatch] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.ifNoneMatch], call[taskGetOptions.ifNoneMatch, parameter[]]] else begin[{] None end[}] local_variable[type[DateTime], ifModifiedSince] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.ifModifiedSince], call[taskGetOptions.ifModifiedSince, parameter[]]] else begin[{] None end[}] local_variable[type[DateTime], ifUnmodifiedSince] if[binary_operation[member[.taskGetOptions], !=, literal[null]]] begin[{] assign[member[.ifUnmodifiedSince], call[taskGetOptions.ifUnmodifiedSince, parameter[]]] else begin[{] None end[}] local_variable[type[String], parameterizedHost] local_variable[type[DateTimeRfc1123], ocpDateConverted] if[binary_operation[member[.ocpDate], !=, literal[null]]] begin[{] assign[member[.ocpDateConverted], ClassCreator(arguments=[MemberReference(member=ocpDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeRfc1123, sub_type=None))] else begin[{] None end[}] local_variable[type[DateTimeRfc1123], ifModifiedSinceConverted] if[binary_operation[member[.ifModifiedSince], !=, literal[null]]] begin[{] assign[member[.ifModifiedSinceConverted], ClassCreator(arguments=[MemberReference(member=ifModifiedSince, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeRfc1123, sub_type=None))] else begin[{] None end[}] local_variable[type[DateTimeRfc1123], ifUnmodifiedSinceConverted] if[binary_operation[member[.ifUnmodifiedSince], !=, literal[null]]] begin[{] assign[member[.ifUnmodifiedSinceConverted], ClassCreator(arguments=[MemberReference(member=ifUnmodifiedSince, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeRfc1123, sub_type=None))] else begin[{] None end[}] return[call[service.get, parameter[member[.jobId], member[.taskId], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], member[.select], member[.expand], member[.timeout], member[.clientRequestId], member[.returnClientRequestId], member[.ocpDateConverted], member[.ifMatch], member[.ifNoneMatch], member[.ifModifiedSinceConverted], member[.ifUnmodifiedSinceConverted], member[.parameterizedHost], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[CloudTask] , identifier[TaskGetHeaders] operator[>] operator[>] identifier[getWithServiceResponseAsync] operator[SEP] identifier[String] identifier[jobId] , identifier[String] identifier[taskId] , identifier[TaskGetOptions] identifier[taskGetOptions] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[batchUrl] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[jobId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[taskId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[taskGetOptions] operator[SEP] operator[SEP] identifier[String] identifier[select] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[select] operator[=] identifier[taskGetOptions] operator[SEP] identifier[select] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[expand] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[expand] operator[=] identifier[taskGetOptions] operator[SEP] identifier[expand] operator[SEP] operator[SEP] operator[SEP] } identifier[Integer] identifier[timeout] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[timeout] operator[=] identifier[taskGetOptions] operator[SEP] identifier[timeout] operator[SEP] operator[SEP] operator[SEP] } identifier[UUID] identifier[clientRequestId] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[clientRequestId] operator[=] identifier[taskGetOptions] operator[SEP] identifier[clientRequestId] operator[SEP] operator[SEP] operator[SEP] } identifier[Boolean] identifier[returnClientRequestId] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[returnClientRequestId] operator[=] identifier[taskGetOptions] operator[SEP] identifier[returnClientRequestId] operator[SEP] operator[SEP] operator[SEP] } identifier[DateTime] identifier[ocpDate] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[ocpDate] operator[=] identifier[taskGetOptions] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[ifMatch] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[ifMatch] operator[=] identifier[taskGetOptions] operator[SEP] identifier[ifMatch] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[ifNoneMatch] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[ifNoneMatch] operator[=] identifier[taskGetOptions] operator[SEP] identifier[ifNoneMatch] operator[SEP] operator[SEP] operator[SEP] } identifier[DateTime] identifier[ifModifiedSince] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[ifModifiedSince] operator[=] identifier[taskGetOptions] operator[SEP] identifier[ifModifiedSince] operator[SEP] operator[SEP] operator[SEP] } identifier[DateTime] identifier[ifUnmodifiedSince] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[taskGetOptions] operator[!=] Other[null] operator[SEP] { identifier[ifUnmodifiedSince] operator[=] identifier[taskGetOptions] operator[SEP] identifier[ifUnmodifiedSince] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[parameterizedHost] operator[=] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[batchUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DateTimeRfc1123] identifier[ocpDateConverted] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ocpDate] operator[!=] Other[null] operator[SEP] { identifier[ocpDateConverted] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP] } identifier[DateTimeRfc1123] identifier[ifModifiedSinceConverted] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ifModifiedSince] operator[!=] Other[null] operator[SEP] { identifier[ifModifiedSinceConverted] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ifModifiedSince] operator[SEP] operator[SEP] } identifier[DateTimeRfc1123] identifier[ifUnmodifiedSinceConverted] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ifUnmodifiedSince] operator[!=] Other[null] operator[SEP] { identifier[ifUnmodifiedSinceConverted] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ifUnmodifiedSince] operator[SEP] operator[SEP] } Keyword[return] identifier[service] operator[SEP] identifier[get] operator[SEP] identifier[jobId] , identifier[taskId] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , identifier[select] , identifier[expand] , identifier[timeout] , identifier[clientRequestId] , identifier[returnClientRequestId] , identifier[ocpDateConverted] , identifier[ifMatch] , identifier[ifNoneMatch] , identifier[ifModifiedSinceConverted] , identifier[ifUnmodifiedSinceConverted] , identifier[parameterizedHost] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[CloudTask] , identifier[TaskGetHeaders] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[CloudTask] , identifier[TaskGetHeaders] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponseWithHeaders] operator[<] identifier[CloudTask] , identifier[TaskGetHeaders] operator[>] identifier[clientResponse] operator[=] identifier[getDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public Response serveFile( String uri, Properties header, File homeDir, boolean allowDirectoryListing ) { Response res = null; // Make sure we won't die of an exception later if ( !homeDir.isDirectory()) res = new Response( HTTP_INTERNALERROR, MIME_PLAINTEXT, "INTERNAL ERRROR: serveFile(): given homeDir is not a directory." ); if ( res == null ) { // Remove URL arguments uri = uri.trim().replace( File.separatorChar, '/' ); if ( uri.indexOf( '?' ) >= 0 ) uri = uri.substring(0, uri.indexOf( '?' )); // Prohibit getting out of current directory if ( uri.startsWith( ".." ) || uri.endsWith( ".." ) || uri.indexOf( "../" ) >= 0 ) res = new Response( HTTP_FORBIDDEN, MIME_PLAINTEXT, "FORBIDDEN: Won't serve ../ for security reasons." ); } File f = new File( homeDir, uri ); if ( res == null && !f.exists()) res = new Response( HTTP_NOTFOUND, MIME_PLAINTEXT, "Error 404, file not found." ); // List the directory, if necessary if ( res == null && f.isDirectory()) { // Browsers get confused without '/' after the // directory, send a redirect. if ( !uri.endsWith( "/" )) { uri += "/"; res = new Response( HTTP_REDIRECT, MIME_HTML, "<html><body>Redirected: <a href=\"" + uri + "\">" + uri + "</a></body></html>"); res.addHeader( "Location", uri ); } if ( res == null ) { // First try index.html and index.htm if ( new File( f, "index.html" ).exists()) f = new File( homeDir, uri + "/index.html" ); else if ( new File( f, "index.htm" ).exists()) f = new File( homeDir, uri + "/index.htm" ); // No index file, list the directory if it is readable else if ( allowDirectoryListing && f.canRead() ) { String[] files = f.list(); String msg = "<html><body><h1>Directory " + uri + "</h1><br/>"; if ( uri.length() > 1 ) { String u = uri.substring( 0, uri.length()-1 ); int slash = u.lastIndexOf( '/' ); if ( slash >= 0 && slash < u.length()) msg += "<b><a href=\"" + uri.substring(0, slash+1) + "\">..</a></b><br/>"; } if (files!=null) { for ( int i=0; i<files.length; ++i ) { File curFile = new File( f, files[i] ); boolean dir = curFile.isDirectory(); if ( dir ) { msg += "<b>"; files[i] += "/"; } msg += "<a href=\"" + encodeUri( uri + files[i] ) + "\">" + files[i] + "</a>"; // Show file size if ( curFile.isFile()) { long len = curFile.length(); msg += " &nbsp;<font size=2>("; if ( len < 1024 ) msg += len + " bytes"; else if ( len < 1024 * 1024 ) msg += len/1024 + "." + (len%1024/10%100) + " KB"; else msg += len/(1024*1024) + "." + len%(1024*1024)/10%100 + " MB"; msg += ")</font>"; } msg += "<br/>"; if ( dir ) msg += "</b>"; } } msg += "</body></html>"; res = new Response( HTTP_OK, MIME_HTML, msg ); } else { res = new Response( HTTP_FORBIDDEN, MIME_PLAINTEXT, "FORBIDDEN: No directory listing." ); } } } try { if ( res == null ) { // Get MIME type from file name extension, if possible String mime = null; int dot = f.getCanonicalPath().lastIndexOf( '.' ); if ( dot >= 0 ) mime = (String)theMimeTypes.get( f.getCanonicalPath().substring( dot + 1 ).toLowerCase()); if ( mime == null ) mime = MIME_DEFAULT_BINARY; // Calculate etag String etag = Integer.toHexString((f.getAbsolutePath() + f.lastModified() + "" + f.length()).hashCode()); // Support (simple) skipping: long startFrom = 0; long endAt = -1; String range = header.getProperty( "range" ); if ( range != null ) { if ( range.startsWith( "bytes=" )) { range = range.substring( "bytes=".length()); int minus = range.indexOf( '-' ); try { if ( minus > 0 ) { startFrom = Long.parseLong( range.substring( 0, minus )); endAt = Long.parseLong( range.substring( minus+1 )); } } catch ( NumberFormatException nfe ) {} } } // Change return code and add Content-Range header when skipping is requested long fileLen = f.length(); if (range != null && startFrom >= 0) { if ( startFrom >= fileLen) { res = new Response( HTTP_RANGE_NOT_SATISFIABLE, MIME_PLAINTEXT, "" ); res.addHeader( "Content-Range", "bytes 0-0/" + fileLen); res.addHeader( "ETag", etag); } else { if ( endAt < 0 ) endAt = fileLen-1; long newLen = endAt - startFrom + 1; if ( newLen < 0 ) newLen = 0; final long dataLen = newLen; FileInputStream fis = new FileInputStream( f ) { public int available() throws IOException { return (int)dataLen; } }; fis.skip( startFrom ); res = new Response( HTTP_PARTIALCONTENT, mime, fis ); res.addHeader( "Content-Length", "" + dataLen); res.addHeader( "Content-Range", "bytes " + startFrom + "-" + endAt + "/" + fileLen); res.addHeader( "ETag", etag); } } else { if (etag.equals(header.getProperty("if-none-match"))) res = new Response( HTTP_NOTMODIFIED, mime, ""); else { res = new Response( HTTP_OK, mime, new FileInputStream( f )); res.addHeader( "Content-Length", "" + fileLen); res.addHeader( "ETag", etag); } } } } catch( IOException ioe ) { res = new Response( HTTP_FORBIDDEN, MIME_PLAINTEXT, "FORBIDDEN: Reading file failed." ); } res.addHeader( "Accept-Ranges", "bytes"); // Announce that the file server accepts partial content requestes return res; }
class class_name[name] begin[{] method[serveFile, return_type[type[Response]], modifier[public], parameter[uri, header, homeDir, allowDirectoryListing]] begin[{] local_variable[type[Response], res] if[call[homeDir.isDirectory, parameter[]]] begin[{] assign[member[.res], ClassCreator(arguments=[MemberReference(member=HTTP_INTERNALERROR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MIME_PLAINTEXT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTERNAL ERRROR: serveFile(): given homeDir is not a directory.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.res], ==, literal[null]]] begin[{] assign[member[.uri], call[uri.trim, parameter[]]] if[binary_operation[call[uri.indexOf, parameter[literal['?']]], >=, literal[0]]] begin[{] assign[member[.uri], call[uri.substring, parameter[literal[0], call[uri.indexOf, parameter[literal['?']]]]]] else begin[{] None end[}] if[binary_operation[binary_operation[call[uri.startsWith, parameter[literal[".."]]], ||, call[uri.endsWith, parameter[literal[".."]]]], ||, binary_operation[call[uri.indexOf, parameter[literal["../"]]], >=, literal[0]]]] begin[{] assign[member[.res], ClassCreator(arguments=[MemberReference(member=HTTP_FORBIDDEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MIME_PLAINTEXT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FORBIDDEN: Won't serve ../ for security reasons.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[File], f] if[binary_operation[binary_operation[member[.res], ==, literal[null]], &&, call[f.exists, parameter[]]]] begin[{] assign[member[.res], ClassCreator(arguments=[MemberReference(member=HTTP_NOTFOUND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MIME_PLAINTEXT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error 404, file not found.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))] else begin[{] None end[}] if[binary_operation[binary_operation[member[.res], ==, literal[null]], &&, call[f.isDirectory, parameter[]]]] begin[{] if[call[uri.endsWith, parameter[literal["/"]]]] begin[{] assign[member[.uri], literal["/"]] assign[member[.res], ClassCreator(arguments=[MemberReference(member=HTTP_REDIRECT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MIME_HTML, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<html><body>Redirected: <a href=\""), operandr=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\">"), operator=+), operandr=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="</a></body></html>"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))] call[res.addHeader, parameter[literal["Location"], member[.uri]]] else begin[{] None end[}] if[binary_operation[member[.res], ==, literal[null]]] begin[{] if[ClassCreator(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="index.html")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=exists, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] begin[{] assign[member[.f], ClassCreator(arguments=[MemberReference(member=homeDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/index.html"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] else begin[{] if[ClassCreator(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="index.htm")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=exists, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] begin[{] assign[member[.f], ClassCreator(arguments=[MemberReference(member=homeDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/index.htm"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] else begin[{] if[binary_operation[member[.allowDirectoryListing], &&, call[f.canRead, parameter[]]]] begin[{] local_variable[type[String], files] local_variable[type[String], msg] if[binary_operation[call[uri.length, parameter[]], >, literal[1]]] begin[{] local_variable[type[String], u] local_variable[type[int], slash] if[binary_operation[binary_operation[member[.slash], >=, literal[0]], &&, binary_operation[member[.slash], <, call[u.length, parameter[]]]]] begin[{] assign[member[.msg], binary_operation[binary_operation[literal["<b><a href=\""], +, call[uri.substring, parameter[literal[0], binary_operation[member[.slash], +, literal[1]]]]], +, literal["\">..</a></b><br/>"]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.files], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=files, 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=File, sub_type=None)), name=curFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=curFile, selectors=[], type_arguments=None), name=dir)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<b>")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=files, 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="/")), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<a href=\""), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=encodeUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\">"), operator=+), operandr=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="</a>"), operator=+)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isFile, postfix_operators=[], prefix_operators=[], qualifier=curFile, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=curFile, selectors=[], type_arguments=None), name=len)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" &nbsp;<font size=2>(")), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=<), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=*), operator=<), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=*), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=*), operator=%), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100), operator=%), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" MB"), operator=+)), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1024), operator=%), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100), operator=%), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" KB"), operator=+)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" bytes"), operator=+)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")</font>")), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<br/>")), label=None), IfStatement(condition=MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="</b>")), 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=files, 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) else begin[{] None end[}] assign[member[.msg], literal["</body></html>"]] assign[member[.res], ClassCreator(arguments=[MemberReference(member=HTTP_OK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MIME_HTML, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=msg, 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=Response, sub_type=None))] else begin[{] assign[member[.res], ClassCreator(arguments=[MemberReference(member=HTTP_FORBIDDEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MIME_PLAINTEXT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FORBIDDEN: No directory listing.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))] end[}] end[}] end[}] else begin[{] None end[}] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=res, 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=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=mime)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCanonicalPath, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=lastIndexOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=dot)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dot, 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=mime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCanonicalPath, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=dot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=theMimeTypes, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mime, 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=mime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=MIME_DEFAULT_BINARY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=lastModified, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operator=+), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operator=+)], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=etag)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=startFrom)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=endAt)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="range")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None), name=range)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=range, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bytes=")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=range, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="bytes=")], member=substring, postfix_operators=[], prefix_operators=[], qualifier=range, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=range, selectors=[], type_arguments=None), name=minus)], modifiers=set(), type=BasicType(dimensions=[], name=int)), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=minus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=startFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=minus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=range, selectors=[], type_arguments=None)], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=endAt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=minus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=range, selectors=[], type_arguments=None)], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfe, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), name=fileLen)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=startFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="if-none-match")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=etag, 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=ClassCreator(arguments=[MemberReference(member=HTTP_OK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content-Length"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=fileLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ETag"), MemberReference(member=etag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=HTTP_NOTMODIFIED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))), label=None))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=startFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=fileLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=endAt, 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=endAt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=fileLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=endAt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=startFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=newLen)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=newLen, 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=newLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=newLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=dataLen)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=Cast(expression=MemberReference(member=dataLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int)), label=None)], documentation=None, modifiers={'public'}, name=available, parameters=[], return_type=BasicType(dimensions=[], name=int), throws=['IOException'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)), name=fis)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=startFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=skip, postfix_operators=[], prefix_operators=[], qualifier=fis, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=HTTP_PARTIALCONTENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fis, 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=Response, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content-Length"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=dataLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content-Range"), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bytes "), operandr=MemberReference(member=startFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), operator=+), operandr=MemberReference(member=endAt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=fileLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ETag"), MemberReference(member=etag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=HTTP_RANGE_NOT_SATISFIABLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MIME_PLAINTEXT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content-Range"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bytes 0-0/"), operandr=MemberReference(member=fileLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ETag"), MemberReference(member=etag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), label=None)]))]))]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=HTTP_FORBIDDEN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MIME_PLAINTEXT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FORBIDDEN: Reading file failed.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None) call[res.addHeader, parameter[literal["Accept-Ranges"], literal["bytes"]]] return[member[.res]] end[}] END[}]
Keyword[public] identifier[Response] identifier[serveFile] operator[SEP] identifier[String] identifier[uri] , identifier[Properties] identifier[header] , identifier[File] identifier[homeDir] , Keyword[boolean] identifier[allowDirectoryListing] operator[SEP] { identifier[Response] identifier[res] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[homeDir] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_INTERNALERROR] , identifier[MIME_PLAINTEXT] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[res] operator[==] Other[null] operator[SEP] { identifier[uri] operator[=] identifier[uri] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] identifier[File] operator[SEP] identifier[separatorChar] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[uri] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[SEP] identifier[uri] operator[=] identifier[uri] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[uri] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[uri] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[uri] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[uri] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[SEP] identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_FORBIDDEN] , identifier[MIME_PLAINTEXT] , literal[String] operator[SEP] operator[SEP] } identifier[File] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[homeDir] , identifier[uri] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[res] operator[==] Other[null] operator[&&] operator[!] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_NOTFOUND] , identifier[MIME_PLAINTEXT] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[res] operator[==] Other[null] operator[&&] identifier[f] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[uri] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[uri] operator[+=] literal[String] operator[SEP] identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_REDIRECT] , identifier[MIME_HTML] , literal[String] operator[+] identifier[uri] operator[+] literal[String] operator[+] identifier[uri] operator[+] literal[String] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , identifier[uri] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[res] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[f] , literal[String] operator[SEP] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[homeDir] , identifier[uri] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[f] , literal[String] operator[SEP] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[homeDir] , identifier[uri] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[allowDirectoryListing] operator[&&] identifier[f] operator[SEP] identifier[canRead] operator[SEP] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[files] operator[=] identifier[f] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[uri] operator[+] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[uri] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[String] identifier[u] operator[=] identifier[uri] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[uri] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[slash] operator[=] identifier[u] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[slash] operator[>=] Other[0] operator[&&] identifier[slash] operator[<] identifier[u] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[+=] literal[String] operator[+] identifier[uri] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[slash] operator[+] Other[1] operator[SEP] operator[+] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[files] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[files] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[File] identifier[curFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[f] , identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[dir] operator[=] identifier[curFile] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dir] operator[SEP] { identifier[msg] operator[+=] literal[String] operator[SEP] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[+=] literal[String] operator[SEP] } identifier[msg] operator[+=] literal[String] operator[+] identifier[encodeUri] operator[SEP] identifier[uri] operator[+] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[files] operator[SEP] identifier[i] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[curFile] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] { Keyword[long] identifier[len] operator[=] identifier[curFile] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[+=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[<] Other[1024] operator[SEP] identifier[msg] operator[+=] identifier[len] operator[+] literal[String] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[len] operator[<] Other[1024] operator[*] Other[1024] operator[SEP] identifier[msg] operator[+=] identifier[len] operator[/] Other[1024] operator[+] literal[String] operator[+] operator[SEP] identifier[len] operator[%] Other[1024] operator[/] Other[10] operator[%] Other[100] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[else] identifier[msg] operator[+=] identifier[len] operator[/] operator[SEP] Other[1024] operator[*] Other[1024] operator[SEP] operator[+] literal[String] operator[+] identifier[len] operator[%] operator[SEP] Other[1024] operator[*] Other[1024] operator[SEP] operator[/] Other[10] operator[%] Other[100] operator[+] literal[String] operator[SEP] identifier[msg] operator[+=] literal[String] operator[SEP] } identifier[msg] operator[+=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[dir] operator[SEP] identifier[msg] operator[+=] literal[String] operator[SEP] } } identifier[msg] operator[+=] literal[String] operator[SEP] identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_OK] , identifier[MIME_HTML] , identifier[msg] operator[SEP] operator[SEP] } Keyword[else] { identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_FORBIDDEN] , identifier[MIME_PLAINTEXT] , literal[String] operator[SEP] operator[SEP] } } } Keyword[try] { Keyword[if] operator[SEP] identifier[res] operator[==] Other[null] operator[SEP] { identifier[String] identifier[mime] operator[=] Other[null] operator[SEP] Keyword[int] identifier[dot] operator[=] identifier[f] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dot] operator[>=] Other[0] operator[SEP] identifier[mime] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[theMimeTypes] operator[SEP] identifier[get] operator[SEP] identifier[f] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] identifier[dot] operator[+] Other[1] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mime] operator[==] Other[null] operator[SEP] identifier[mime] operator[=] identifier[MIME_DEFAULT_BINARY] operator[SEP] identifier[String] identifier[etag] operator[=] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] identifier[f] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[f] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[startFrom] operator[=] Other[0] operator[SEP] Keyword[long] identifier[endAt] operator[=] operator[-] Other[1] operator[SEP] identifier[String] identifier[range] operator[=] identifier[header] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[range] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[range] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[range] operator[=] identifier[range] operator[SEP] identifier[substring] operator[SEP] literal[String] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[minus] operator[=] identifier[range] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[minus] operator[>] Other[0] operator[SEP] { identifier[startFrom] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[range] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[minus] operator[SEP] operator[SEP] operator[SEP] identifier[endAt] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[range] operator[SEP] identifier[substring] operator[SEP] identifier[minus] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[nfe] operator[SEP] { } } } Keyword[long] identifier[fileLen] operator[=] identifier[f] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[range] operator[!=] Other[null] operator[&&] identifier[startFrom] operator[>=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[startFrom] operator[>=] identifier[fileLen] operator[SEP] { identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_RANGE_NOT_SATISFIABLE] , identifier[MIME_PLAINTEXT] , literal[String] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[fileLen] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , identifier[etag] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[endAt] operator[<] Other[0] operator[SEP] identifier[endAt] operator[=] identifier[fileLen] operator[-] Other[1] operator[SEP] Keyword[long] identifier[newLen] operator[=] identifier[endAt] operator[-] identifier[startFrom] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[newLen] operator[<] Other[0] operator[SEP] identifier[newLen] operator[=] Other[0] operator[SEP] Keyword[final] Keyword[long] identifier[dataLen] operator[=] identifier[newLen] operator[SEP] identifier[FileInputStream] identifier[fis] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[f] operator[SEP] { Keyword[public] Keyword[int] identifier[available] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] operator[SEP] Keyword[int] operator[SEP] identifier[dataLen] operator[SEP] } } operator[SEP] identifier[fis] operator[SEP] identifier[skip] operator[SEP] identifier[startFrom] operator[SEP] operator[SEP] identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_PARTIALCONTENT] , identifier[mime] , identifier[fis] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[dataLen] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[startFrom] operator[+] literal[String] operator[+] identifier[endAt] operator[+] literal[String] operator[+] identifier[fileLen] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , identifier[etag] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[etag] operator[SEP] identifier[equals] operator[SEP] identifier[header] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_NOTMODIFIED] , identifier[mime] , literal[String] operator[SEP] operator[SEP] Keyword[else] { identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_OK] , identifier[mime] , Keyword[new] identifier[FileInputStream] operator[SEP] identifier[f] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[fileLen] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , identifier[etag] operator[SEP] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { identifier[res] operator[=] Keyword[new] identifier[Response] operator[SEP] identifier[HTTP_FORBIDDEN] , identifier[MIME_PLAINTEXT] , literal[String] operator[SEP] operator[SEP] } identifier[res] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[SEP] }
public void setParseGit(boolean parseGit) { this.parseGit = parseGit; getConfig().setProperty(SPIDER_PARSE_GIT, Boolean.toString(parseGit)); }
class class_name[name] begin[{] method[setParseGit, return_type[void], modifier[public], parameter[parseGit]] begin[{] assign[THIS[member[None.parseGit]], member[.parseGit]] call[.getConfig, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setParseGit] operator[SEP] Keyword[boolean] identifier[parseGit] operator[SEP] { Keyword[this] operator[SEP] identifier[parseGit] operator[=] identifier[parseGit] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[setProperty] operator[SEP] identifier[SPIDER_PARSE_GIT] , identifier[Boolean] operator[SEP] identifier[toString] operator[SEP] identifier[parseGit] operator[SEP] operator[SEP] operator[SEP] }
public static List<String> split(@Nullable final String str, final char separatorChar) { return split(str, separatorChar, 10); }
class class_name[name] begin[{] method[split, return_type[type[List]], modifier[public static], parameter[str, separatorChar]] begin[{] return[call[.split, parameter[member[.str], member[.separatorChar], literal[10]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[split] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[str] , Keyword[final] Keyword[char] identifier[separatorChar] operator[SEP] { Keyword[return] identifier[split] operator[SEP] identifier[str] , identifier[separatorChar] , Other[10] operator[SEP] operator[SEP] }
public static String generateLoginHtmlFragment(CmsObject cms, VaadinRequest request) throws IOException { LoginParameters parameters = CmsLoginHelper.getLoginParameters(cms, (HttpServletRequest)request, true); request.getWrappedSession().setAttribute(CmsLoginUI.INIT_DATA_SESSION_ATTR, parameters); byte[] pageBytes; pageBytes = CmsFileUtil.readFully( Thread.currentThread().getContextClassLoader().getResourceAsStream( "org/opencms/ui/login/login-fragment.html")); String html = new String(pageBytes, "UTF-8"); String autocomplete = ((parameters.getPcType() == null) || parameters.getPcType().equals(CmsLoginHelper.PCTYPE_PRIVATE)) ? "on" : "off"; CmsMacroResolver resolver = new CmsMacroResolver(); resolver.addMacro("autocompplete", autocomplete); if ((parameters.getPcType() == null) || parameters.getPcType().equals(CmsLoginHelper.PCTYPE_PRIVATE)) { resolver.addMacro( "hiddenPasswordField", " <input type=\"password\" id=\"hidden-password\" name=\"ocPword\" autocomplete=\"%(autocomplete)\" >"); } if (parameters.getUsername() != null) { resolver.addMacro("predefUser", "value=\"" + CmsEncoder.escapeXml(parameters.getUsername()) + "\""); } html = resolver.resolveMacros(html); return html; }
class class_name[name] begin[{] method[generateLoginHtmlFragment, return_type[type[String]], modifier[public static], parameter[cms, request]] begin[{] local_variable[type[LoginParameters], parameters] call[request.getWrappedSession, parameter[]] local_variable[type[byte], pageBytes] assign[member[.pageBytes], call[CmsFileUtil.readFully, parameter[call[Thread.currentThread, parameter[]]]]] local_variable[type[String], html] local_variable[type[String], autocomplete] local_variable[type[CmsMacroResolver], resolver] call[resolver.addMacro, parameter[literal["autocompplete"], member[.autocomplete]]] if[binary_operation[binary_operation[call[parameters.getPcType, parameter[]], ==, literal[null]], ||, call[parameters.getPcType, parameter[]]]] begin[{] call[resolver.addMacro, parameter[literal["hiddenPasswordField"], literal[" <input type=\"password\" id=\"hidden-password\" name=\"ocPword\" autocomplete=\"%(autocomplete)\" >"]]] else begin[{] None end[}] if[binary_operation[call[parameters.getUsername, parameter[]], !=, literal[null]]] begin[{] call[resolver.addMacro, parameter[literal["predefUser"], binary_operation[binary_operation[literal["value=\""], +, call[CmsEncoder.escapeXml, parameter[call[parameters.getUsername, parameter[]]]]], +, literal["\""]]]] else begin[{] None end[}] assign[member[.html], call[resolver.resolveMacros, parameter[member[.html]]]] return[member[.html]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[generateLoginHtmlFragment] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[VaadinRequest] identifier[request] operator[SEP] Keyword[throws] identifier[IOException] { identifier[LoginParameters] identifier[parameters] operator[=] identifier[CmsLoginHelper] operator[SEP] identifier[getLoginParameters] operator[SEP] identifier[cms] , operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[request] , literal[boolean] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[getWrappedSession] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] identifier[CmsLoginUI] operator[SEP] identifier[INIT_DATA_SESSION_ATTR] , identifier[parameters] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[pageBytes] operator[SEP] identifier[pageBytes] operator[=] identifier[CmsFileUtil] operator[SEP] identifier[readFully] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[html] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[pageBytes] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[autocomplete] operator[=] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[getPcType] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] identifier[parameters] operator[SEP] identifier[getPcType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[CmsLoginHelper] operator[SEP] identifier[PCTYPE_PRIVATE] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] identifier[CmsMacroResolver] identifier[resolver] operator[=] Keyword[new] identifier[CmsMacroResolver] operator[SEP] operator[SEP] operator[SEP] identifier[resolver] operator[SEP] identifier[addMacro] operator[SEP] literal[String] , identifier[autocomplete] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[getPcType] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] identifier[parameters] operator[SEP] identifier[getPcType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[CmsLoginHelper] operator[SEP] identifier[PCTYPE_PRIVATE] operator[SEP] operator[SEP] { identifier[resolver] operator[SEP] identifier[addMacro] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[parameters] operator[SEP] identifier[getUsername] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[resolver] operator[SEP] identifier[addMacro] operator[SEP] literal[String] , literal[String] operator[+] identifier[CmsEncoder] operator[SEP] identifier[escapeXml] operator[SEP] identifier[parameters] operator[SEP] identifier[getUsername] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[html] operator[=] identifier[resolver] operator[SEP] identifier[resolveMacros] operator[SEP] identifier[html] operator[SEP] operator[SEP] Keyword[return] identifier[html] operator[SEP] }
public boolean moreRBSPData() throws IOException { if (nBit == 8) { advance(); } int tail = 1 << (8 - nBit - 1); int mask = ((tail << 1) - 1); boolean hasTail = (curByte & mask) == tail; return !(curByte == -1 || (nextByte == -1 && hasTail)); }
class class_name[name] begin[{] method[moreRBSPData, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.nBit], ==, literal[8]]] begin[{] call[.advance, parameter[]] else begin[{] None end[}] local_variable[type[int], tail] local_variable[type[int], mask] local_variable[type[boolean], hasTail] return[binary_operation[binary_operation[member[.curByte], ==, literal[1]], ||, binary_operation[binary_operation[member[.nextByte], ==, literal[1]], &&, member[.hasTail]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[moreRBSPData] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[nBit] operator[==] Other[8] operator[SEP] { identifier[advance] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[tail] operator[=] Other[1] operator[<<] operator[SEP] Other[8] operator[-] identifier[nBit] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[mask] operator[=] operator[SEP] operator[SEP] identifier[tail] operator[<<] Other[1] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[boolean] identifier[hasTail] operator[=] operator[SEP] identifier[curByte] operator[&] identifier[mask] operator[SEP] operator[==] identifier[tail] operator[SEP] Keyword[return] operator[!] operator[SEP] identifier[curByte] operator[==] operator[-] Other[1] operator[||] operator[SEP] identifier[nextByte] operator[==] operator[-] Other[1] operator[&&] identifier[hasTail] operator[SEP] operator[SEP] operator[SEP] }
public void throwException(CmsMessageContainer message, Throwable throwable) throws CmsVfsException, CmsException { if (throwable instanceof CmsException) { throw ((CmsException)throwable).createException(message, throwable); } else if (throwable instanceof CmsRuntimeException) { throw ((CmsRuntimeException)throwable).createException(message, throwable); } else { throw new CmsVfsException(message, throwable); } }
class class_name[name] begin[{] method[throwException, return_type[void], modifier[public], parameter[message, throwable]] begin[{] if[binary_operation[member[.throwable], instanceof, type[CmsException]]] begin[{] ThrowStatement(expression=Cast(expression=MemberReference(member=throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CmsException, sub_type=None)), label=None) else begin[{] if[binary_operation[member[.throwable], instanceof, type[CmsRuntimeException]]] begin[{] ThrowStatement(expression=Cast(expression=MemberReference(member=throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CmsRuntimeException, sub_type=None)), label=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=throwable, 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=CmsVfsException, sub_type=None)), label=None) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[throwException] operator[SEP] identifier[CmsMessageContainer] identifier[message] , identifier[Throwable] identifier[throwable] operator[SEP] Keyword[throws] identifier[CmsVfsException] , identifier[CmsException] { Keyword[if] operator[SEP] identifier[throwable] Keyword[instanceof] identifier[CmsException] operator[SEP] { Keyword[throw] operator[SEP] operator[SEP] identifier[CmsException] operator[SEP] identifier[throwable] operator[SEP] operator[SEP] identifier[createException] operator[SEP] identifier[message] , identifier[throwable] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[throwable] Keyword[instanceof] identifier[CmsRuntimeException] operator[SEP] { Keyword[throw] operator[SEP] operator[SEP] identifier[CmsRuntimeException] operator[SEP] identifier[throwable] operator[SEP] operator[SEP] identifier[createException] operator[SEP] identifier[message] , identifier[throwable] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[CmsVfsException] operator[SEP] identifier[message] , identifier[throwable] operator[SEP] operator[SEP] } }