code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
protected double distance(DBIDRef a, DBIDRef b) { ++distComputations; return distanceQuery.distance(a, b); }
class class_name[name] begin[{] method[distance, return_type[type[double]], modifier[protected], parameter[a, b]] begin[{] member[.distComputations] return[call[distanceQuery.distance, parameter[member[.a], member[.b]]]] end[}] END[}]
Keyword[protected] Keyword[double] identifier[distance] operator[SEP] identifier[DBIDRef] identifier[a] , identifier[DBIDRef] identifier[b] operator[SEP] { operator[++] identifier[distComputations] operator[SEP] Keyword[return] identifier[distanceQuery] operator[SEP] identifier[distance] operator[SEP] identifier[a] , identifier[b] operator[SEP] operator[SEP] }
private void finishValue() { final ContainerInfo current = currentContainer(); if (current != null && current.type == ContainerType.ANNOTATION) { // close out and patch the length popContainer(); } hasWrittenValuesSinceFinished = true; hasWrittenValuesSinceConstructed = true; }
class class_name[name] begin[{] method[finishValue, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[ContainerInfo], current] if[binary_operation[binary_operation[member[.current], !=, literal[null]], &&, binary_operation[member[current.type], ==, member[ContainerType.ANNOTATION]]]] begin[{] call[.popContainer, parameter[]] else begin[{] None end[}] assign[member[.hasWrittenValuesSinceFinished], literal[true]] assign[member[.hasWrittenValuesSinceConstructed], literal[true]] end[}] END[}]
Keyword[private] Keyword[void] identifier[finishValue] operator[SEP] operator[SEP] { Keyword[final] identifier[ContainerInfo] identifier[current] operator[=] identifier[currentContainer] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[current] operator[!=] Other[null] operator[&&] identifier[current] operator[SEP] identifier[type] operator[==] identifier[ContainerType] operator[SEP] identifier[ANNOTATION] operator[SEP] { identifier[popContainer] operator[SEP] operator[SEP] operator[SEP] } identifier[hasWrittenValuesSinceFinished] operator[=] literal[boolean] operator[SEP] identifier[hasWrittenValuesSinceConstructed] operator[=] literal[boolean] operator[SEP] }
protected boolean isListsStenoEvent(@Nullable final Marker marker) { return marker != null && marker.contains(StenoMarker.LISTS_MARKER); }
class class_name[name] begin[{] method[isListsStenoEvent, return_type[type[boolean]], modifier[protected], parameter[marker]] begin[{] return[binary_operation[binary_operation[member[.marker], !=, literal[null]], &&, call[marker.contains, parameter[member[StenoMarker.LISTS_MARKER]]]]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[isListsStenoEvent] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[Marker] identifier[marker] operator[SEP] { Keyword[return] identifier[marker] operator[!=] Other[null] operator[&&] identifier[marker] operator[SEP] identifier[contains] operator[SEP] identifier[StenoMarker] operator[SEP] identifier[LISTS_MARKER] operator[SEP] operator[SEP] }
@Deprecated public static List<Footer> readFooters(Configuration configuration, FileStatus pathStatus, boolean skipRowGroups) throws IOException { List<FileStatus> files = listFiles(configuration, pathStatus); return readAllFootersInParallelUsingSummaryFiles(configuration, files, skipRowGroups); }
class class_name[name] begin[{] method[readFooters, return_type[type[List]], modifier[public static], parameter[configuration, pathStatus, skipRowGroups]] begin[{] local_variable[type[List], files] return[call[.readAllFootersInParallelUsingSummaryFiles, parameter[member[.configuration], member[.files], member[.skipRowGroups]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Footer] operator[>] identifier[readFooters] operator[SEP] identifier[Configuration] identifier[configuration] , identifier[FileStatus] identifier[pathStatus] , Keyword[boolean] identifier[skipRowGroups] operator[SEP] Keyword[throws] identifier[IOException] { identifier[List] operator[<] identifier[FileStatus] operator[>] identifier[files] operator[=] identifier[listFiles] operator[SEP] identifier[configuration] , identifier[pathStatus] operator[SEP] operator[SEP] Keyword[return] identifier[readAllFootersInParallelUsingSummaryFiles] operator[SEP] identifier[configuration] , identifier[files] , identifier[skipRowGroups] operator[SEP] operator[SEP] }
public Observable<Page<RunCommandDocumentBaseInner>> listAsync(final String location) { return listWithServiceResponseAsync(location) .map(new Func1<ServiceResponse<Page<RunCommandDocumentBaseInner>>, Page<RunCommandDocumentBaseInner>>() { @Override public Page<RunCommandDocumentBaseInner> call(ServiceResponse<Page<RunCommandDocumentBaseInner>> response) { return response.body(); } }); }
class class_name[name] begin[{] method[listAsync, return_type[type[Observable]], modifier[public], parameter[location]] begin[{] return[call[.listWithServiceResponseAsync, parameter[member[.location]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[RunCommandDocumentBaseInner] operator[>] operator[>] identifier[listAsync] operator[SEP] Keyword[final] identifier[String] identifier[location] operator[SEP] { Keyword[return] identifier[listWithServiceResponseAsync] operator[SEP] identifier[location] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RunCommandDocumentBaseInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[RunCommandDocumentBaseInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[RunCommandDocumentBaseInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RunCommandDocumentBaseInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
private JButton getBtnCancel() { if (btnCancel == null) { btnCancel = new JButton(); btnCancel.setText(Constant.messages.getString("edit.find.button.cancel")); btnCancel.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { FindDialog.this.discard(); FindDialog.this.dispatchEvent(new WindowEvent(FindDialog.this, WindowEvent.WINDOW_CLOSING)); } }); } return btnCancel; }
class class_name[name] begin[{] method[getBtnCancel, return_type[type[JButton]], modifier[private], parameter[]] begin[{] if[binary_operation[member[.btnCancel], ==, literal[null]]] begin[{] assign[member[.btnCancel], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JButton, sub_type=None))] call[btnCancel.setText, parameter[call[Constant.messages.getString, parameter[literal["edit.find.button.cancel"]]]]] call[btnCancel.addActionListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=FindDialog, selectors=[MethodInvocation(arguments=[], member=discard, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=FindDialog, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=FindDialog, selectors=[]), MemberReference(member=WINDOW_CLOSING, postfix_operators=[], prefix_operators=[], qualifier=WindowEvent, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WindowEvent, sub_type=None))], member=dispatchEvent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], documentation=None, modifiers={'public'}, name=actionPerformed, parameters=[FormalParameter(annotations=[], modifiers=set(), name=e, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ActionEvent, sub_type=None)))), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ActionListener, sub_type=None)))))]] else begin[{] None end[}] return[member[.btnCancel]] end[}] END[}]
Keyword[private] identifier[JButton] identifier[getBtnCancel] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[btnCancel] operator[==] Other[null] operator[SEP] { identifier[btnCancel] operator[=] Keyword[new] identifier[JButton] operator[SEP] operator[SEP] operator[SEP] identifier[btnCancel] operator[SEP] identifier[setText] operator[SEP] identifier[Constant] operator[SEP] identifier[messages] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[btnCancel] operator[SEP] identifier[addActionListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[actionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[e] operator[SEP] { identifier[FindDialog] operator[SEP] Keyword[this] operator[SEP] identifier[discard] operator[SEP] operator[SEP] operator[SEP] identifier[FindDialog] operator[SEP] Keyword[this] operator[SEP] identifier[dispatchEvent] operator[SEP] Keyword[new] identifier[WindowEvent] operator[SEP] identifier[FindDialog] operator[SEP] Keyword[this] , identifier[WindowEvent] operator[SEP] identifier[WINDOW_CLOSING] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } Keyword[return] identifier[btnCancel] operator[SEP] }
public void assertEqual(Description description, Float actual, Float expected, Offset<Float> offset) { checkOffsetIsNotNull(offset); checkNumberIsNotNull(expected); assertNotNull(description, actual); if (!isEqualTo(actual, expected, offset)) { throw failures.failure(description, shouldBeEqual(actual, expected, offset, abs(expected.floatValue() - actual.floatValue()))); } }
class class_name[name] begin[{] method[assertEqual, return_type[void], modifier[public], parameter[description, actual, expected, offset]] begin[{] call[.checkOffsetIsNotNull, parameter[member[.offset]]] call[.checkNumberIsNotNull, parameter[member[.expected]]] call[.assertNotNull, parameter[member[.description], member[.actual]]] if[call[.isEqualTo, parameter[member[.actual], member[.expected], member[.offset]]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=expected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=floatValue, postfix_operators=[], prefix_operators=[], qualifier=expected, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=floatValue, postfix_operators=[], prefix_operators=[], qualifier=actual, selectors=[], type_arguments=None), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=shouldBeEqual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=failure, postfix_operators=[], prefix_operators=[], qualifier=failures, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[assertEqual] operator[SEP] identifier[Description] identifier[description] , identifier[Float] identifier[actual] , identifier[Float] identifier[expected] , identifier[Offset] operator[<] identifier[Float] operator[>] identifier[offset] operator[SEP] { identifier[checkOffsetIsNotNull] operator[SEP] identifier[offset] operator[SEP] operator[SEP] identifier[checkNumberIsNotNull] operator[SEP] identifier[expected] operator[SEP] operator[SEP] identifier[assertNotNull] operator[SEP] identifier[description] , identifier[actual] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isEqualTo] operator[SEP] identifier[actual] , identifier[expected] , identifier[offset] operator[SEP] operator[SEP] { Keyword[throw] identifier[failures] operator[SEP] identifier[failure] operator[SEP] identifier[description] , identifier[shouldBeEqual] operator[SEP] identifier[actual] , identifier[expected] , identifier[offset] , identifier[abs] operator[SEP] identifier[expected] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[-] identifier[actual] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public Mono<Void> deleteById(String id) { return findSession(id) .flatMap(document -> this.mongoOperations.remove(document, this.collectionName).then(Mono.just(document))) .map(document -> convertToSession(this.mongoSessionConverter, document)) .doOnSuccess(mongoSession -> publishEvent(new SessionDeletedEvent(this, mongoSession))) // .then(); }
class class_name[name] begin[{] method[deleteById, return_type[type[Mono]], modifier[public], parameter[id]] begin[{] return[call[.findSession, parameter[member[.id]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Mono] operator[<] identifier[Void] operator[>] identifier[deleteById] operator[SEP] identifier[String] identifier[id] operator[SEP] { Keyword[return] identifier[findSession] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[document] operator[->] Keyword[this] operator[SEP] identifier[mongoOperations] operator[SEP] identifier[remove] operator[SEP] identifier[document] , Keyword[this] operator[SEP] identifier[collectionName] operator[SEP] operator[SEP] identifier[then] operator[SEP] identifier[Mono] operator[SEP] identifier[just] operator[SEP] identifier[document] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[document] operator[->] identifier[convertToSession] operator[SEP] Keyword[this] operator[SEP] identifier[mongoSessionConverter] , identifier[document] operator[SEP] operator[SEP] operator[SEP] identifier[doOnSuccess] operator[SEP] identifier[mongoSession] operator[->] identifier[publishEvent] operator[SEP] Keyword[new] identifier[SessionDeletedEvent] operator[SEP] Keyword[this] , identifier[mongoSession] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[then] operator[SEP] operator[SEP] operator[SEP] }
public Observable<AvailableProvidersListInner> beginListAvailableProvidersAsync(String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { return beginListAvailableProvidersWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1<ServiceResponse<AvailableProvidersListInner>, AvailableProvidersListInner>() { @Override public AvailableProvidersListInner call(ServiceResponse<AvailableProvidersListInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[beginListAvailableProvidersAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, networkWatcherName, parameters]] begin[{] return[call[.beginListAvailableProvidersWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.networkWatcherName], member[.parameters]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[AvailableProvidersListInner] operator[>] identifier[beginListAvailableProvidersAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[networkWatcherName] , identifier[AvailableProvidersListParameters] identifier[parameters] operator[SEP] { Keyword[return] identifier[beginListAvailableProvidersWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[networkWatcherName] , identifier[parameters] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[AvailableProvidersListInner] operator[>] , identifier[AvailableProvidersListInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[AvailableProvidersListInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[AvailableProvidersListInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public static Supplier<Type> receiverType() { return new Supplier<Type>() { @Override public Type get(VisitorState state) { MethodInvocationTree methodInvocation = (MethodInvocationTree) state.getPath().getLeaf(); return ASTHelpers.getReceiverType(methodInvocation.getMethodSelect()); } }; }
class class_name[name] begin[{] method[receiverType, return_type[type[Supplier]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[MethodInvocation(arguments=[], member=getLeaf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=MethodInvocationTree, sub_type=None)), name=methodInvocation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodInvocationTree, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMethodSelect, postfix_operators=[], prefix_operators=[], qualifier=methodInvocation, selectors=[], type_arguments=None)], member=getReceiverType, postfix_operators=[], prefix_operators=[], qualifier=ASTHelpers, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=get, parameters=[FormalParameter(annotations=[], modifiers=set(), name=state, type=ReferenceType(arguments=None, dimensions=[], name=VisitorState, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Type, 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=Type, sub_type=None))], dimensions=None, name=Supplier, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Supplier] operator[<] identifier[Type] operator[>] identifier[receiverType] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Supplier] operator[<] identifier[Type] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Type] identifier[get] operator[SEP] identifier[VisitorState] identifier[state] operator[SEP] { identifier[MethodInvocationTree] identifier[methodInvocation] operator[=] operator[SEP] identifier[MethodInvocationTree] operator[SEP] identifier[state] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[getLeaf] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ASTHelpers] operator[SEP] identifier[getReceiverType] operator[SEP] identifier[methodInvocation] operator[SEP] identifier[getMethodSelect] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public void setValue (int value) { _slider.setValue(value); _value.setText(Integer.toString(value)); }
class class_name[name] begin[{] method[setValue, return_type[void], modifier[public], parameter[value]] begin[{] call[_slider.setValue, parameter[member[.value]]] call[_value.setText, parameter[call[Integer.toString, parameter[member[.value]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setValue] operator[SEP] Keyword[int] identifier[value] operator[SEP] { identifier[_slider] operator[SEP] identifier[setValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[_value] operator[SEP] identifier[setText] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] }
private void initHasMasterMode() throws CmsException { if (hasDescriptor() && m_cms.hasPermissions(m_desc, CmsPermissionSet.ACCESS_WRITE, false, CmsResourceFilter.ALL)) { m_hasMasterMode = true; } else { m_hasMasterMode = false; } }
class class_name[name] begin[{] method[initHasMasterMode, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[call[.hasDescriptor, parameter[]], &&, call[m_cms.hasPermissions, parameter[member[.m_desc], member[CmsPermissionSet.ACCESS_WRITE], literal[false], member[CmsResourceFilter.ALL]]]]] begin[{] assign[member[.m_hasMasterMode], literal[true]] else begin[{] assign[member[.m_hasMasterMode], literal[false]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[initHasMasterMode] operator[SEP] operator[SEP] Keyword[throws] identifier[CmsException] { Keyword[if] operator[SEP] identifier[hasDescriptor] operator[SEP] operator[SEP] operator[&&] identifier[m_cms] operator[SEP] identifier[hasPermissions] operator[SEP] identifier[m_desc] , identifier[CmsPermissionSet] operator[SEP] identifier[ACCESS_WRITE] , literal[boolean] , identifier[CmsResourceFilter] operator[SEP] identifier[ALL] operator[SEP] operator[SEP] { identifier[m_hasMasterMode] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[m_hasMasterMode] operator[=] literal[boolean] operator[SEP] } }
private static AdGroup createAdGroup( AdWordsServicesInterface adWordsServices, AdWordsSession session, Campaign campaign) throws ApiException, RemoteException { // Get the AdGroupService. AdGroupServiceInterface adGroupService = adWordsServices.get(session, AdGroupServiceInterface.class); // Create the ad group. AdGroup adGroup = new AdGroup(); // Required: Set the ad group's type to Dynamic Search Ads. adGroup.setAdGroupType(AdGroupType.SEARCH_DYNAMIC_ADS); adGroup.setName("Earth to Mars Cruises #" + System.currentTimeMillis()); adGroup.setCampaignId(campaign.getId()); adGroup.setStatus(AdGroupStatus.PAUSED); // Recommended: Set a tracking URL template for your ad group if you want to use URL // tracking software. adGroup.setTrackingUrlTemplate("http://tracker.example.com/traveltracker/{escapedlpurl}"); // Set the ad group bids. BiddingStrategyConfiguration biddingConfig = new BiddingStrategyConfiguration(); CpcBid cpcBid = new CpcBid(); cpcBid.setBid(new Money()); cpcBid.getBid().setMicroAmount(3000000L); biddingConfig.setBids(new Bids[] {cpcBid}); adGroup.setBiddingStrategyConfiguration(biddingConfig); // Create the operation. AdGroupOperation operation = new AdGroupOperation(); operation.setOperand(adGroup); operation.setOperator(Operator.ADD); AdGroup newAdGroup = adGroupService.mutate(new AdGroupOperation[] {operation}).getValue(0); System.out.printf( "Ad group with name '%s' and ID %d was added.%n", newAdGroup.getName(), newAdGroup.getId()); return newAdGroup; }
class class_name[name] begin[{] method[createAdGroup, return_type[type[AdGroup]], modifier[private static], parameter[adWordsServices, session, campaign]] begin[{] local_variable[type[AdGroupServiceInterface], adGroupService] local_variable[type[AdGroup], adGroup] call[adGroup.setAdGroupType, parameter[member[AdGroupType.SEARCH_DYNAMIC_ADS]]] call[adGroup.setName, parameter[binary_operation[literal["Earth to Mars Cruises #"], +, call[System.currentTimeMillis, parameter[]]]]] call[adGroup.setCampaignId, parameter[call[campaign.getId, parameter[]]]] call[adGroup.setStatus, parameter[member[AdGroupStatus.PAUSED]]] call[adGroup.setTrackingUrlTemplate, parameter[literal["http://tracker.example.com/traveltracker/{escapedlpurl}"]]] local_variable[type[BiddingStrategyConfiguration], biddingConfig] local_variable[type[CpcBid], cpcBid] call[cpcBid.setBid, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Money, sub_type=None))]] call[cpcBid.getBid, parameter[]] call[biddingConfig.setBids, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=cpcBid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Bids, sub_type=None))]] call[adGroup.setBiddingStrategyConfiguration, parameter[member[.biddingConfig]]] local_variable[type[AdGroupOperation], operation] call[operation.setOperand, parameter[member[.adGroup]]] call[operation.setOperator, parameter[member[Operator.ADD]]] local_variable[type[AdGroup], newAdGroup] call[System.out.printf, parameter[literal["Ad group with name '%s' and ID %d was added.%n"], call[newAdGroup.getName, parameter[]], call[newAdGroup.getId, parameter[]]]] return[member[.newAdGroup]] end[}] END[}]
Keyword[private] Keyword[static] identifier[AdGroup] identifier[createAdGroup] operator[SEP] identifier[AdWordsServicesInterface] identifier[adWordsServices] , identifier[AdWordsSession] identifier[session] , identifier[Campaign] identifier[campaign] operator[SEP] Keyword[throws] identifier[ApiException] , identifier[RemoteException] { identifier[AdGroupServiceInterface] identifier[adGroupService] operator[=] identifier[adWordsServices] operator[SEP] identifier[get] operator[SEP] identifier[session] , identifier[AdGroupServiceInterface] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[AdGroup] identifier[adGroup] operator[=] Keyword[new] identifier[AdGroup] operator[SEP] operator[SEP] operator[SEP] identifier[adGroup] operator[SEP] identifier[setAdGroupType] operator[SEP] identifier[AdGroupType] operator[SEP] identifier[SEARCH_DYNAMIC_ADS] operator[SEP] operator[SEP] identifier[adGroup] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[adGroup] operator[SEP] identifier[setCampaignId] operator[SEP] identifier[campaign] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[adGroup] operator[SEP] identifier[setStatus] operator[SEP] identifier[AdGroupStatus] operator[SEP] identifier[PAUSED] operator[SEP] operator[SEP] identifier[adGroup] operator[SEP] identifier[setTrackingUrlTemplate] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[BiddingStrategyConfiguration] identifier[biddingConfig] operator[=] Keyword[new] identifier[BiddingStrategyConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[CpcBid] identifier[cpcBid] operator[=] Keyword[new] identifier[CpcBid] operator[SEP] operator[SEP] operator[SEP] identifier[cpcBid] operator[SEP] identifier[setBid] operator[SEP] Keyword[new] identifier[Money] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cpcBid] operator[SEP] identifier[getBid] operator[SEP] operator[SEP] operator[SEP] identifier[setMicroAmount] operator[SEP] Other[3000000L] operator[SEP] operator[SEP] identifier[biddingConfig] operator[SEP] identifier[setBids] operator[SEP] Keyword[new] identifier[Bids] operator[SEP] operator[SEP] { identifier[cpcBid] } operator[SEP] operator[SEP] identifier[adGroup] operator[SEP] identifier[setBiddingStrategyConfiguration] operator[SEP] identifier[biddingConfig] operator[SEP] operator[SEP] identifier[AdGroupOperation] identifier[operation] operator[=] Keyword[new] identifier[AdGroupOperation] operator[SEP] operator[SEP] operator[SEP] identifier[operation] operator[SEP] identifier[setOperand] operator[SEP] identifier[adGroup] operator[SEP] operator[SEP] identifier[operation] operator[SEP] identifier[setOperator] operator[SEP] identifier[Operator] operator[SEP] identifier[ADD] operator[SEP] operator[SEP] identifier[AdGroup] identifier[newAdGroup] operator[=] identifier[adGroupService] operator[SEP] identifier[mutate] operator[SEP] Keyword[new] identifier[AdGroupOperation] operator[SEP] operator[SEP] { identifier[operation] } operator[SEP] operator[SEP] identifier[getValue] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[newAdGroup] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[newAdGroup] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[newAdGroup] operator[SEP] }
public static boolean transactionIsTerminated(TerminationGuard db) { try { db.check(); return false; } catch (TransactionGuardException | TransactionTerminatedException | NotInTransactionException tge) { return true; } }
class class_name[name] begin[{] method[transactionIsTerminated, return_type[type[boolean]], modifier[public static], parameter[db]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=check, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=tge, types=['TransactionGuardException', 'TransactionTerminatedException', 'NotInTransactionException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[transactionIsTerminated] operator[SEP] identifier[TerminationGuard] identifier[db] operator[SEP] { Keyword[try] { identifier[db] operator[SEP] identifier[check] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransactionGuardException] operator[|] identifier[TransactionTerminatedException] operator[|] identifier[NotInTransactionException] identifier[tge] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } }
public boolean addVerb(String action, Date dateStart, Date dateEnd, String[] description, String comment) { Map<String, Object> container = new HashMap<String, Object>(); if (action != null) { container.put("action", action); } else { return false; } if (dateStart != null && dateEnd != null) { container.put("date", df.format(dateStart) + "/" + df.format(dateEnd)); } else if (dateStart != null) { container.put("date", df.format(dateStart)); } if (description != null && description.length > 0) { container.put("description", description); } if (comment != null) { container.put("comment", comment); } return addChild("verb", container, null); }
class class_name[name] begin[{] method[addVerb, return_type[type[boolean]], modifier[public], parameter[action, dateStart, dateEnd, description, comment]] begin[{] local_variable[type[Map], container] if[binary_operation[member[.action], !=, literal[null]]] begin[{] call[container.put, parameter[literal["action"], member[.action]]] else begin[{] return[literal[false]] end[}] if[binary_operation[binary_operation[member[.dateStart], !=, literal[null]], &&, binary_operation[member[.dateEnd], !=, literal[null]]]] begin[{] call[container.put, parameter[literal["date"], binary_operation[binary_operation[call[df.format, parameter[member[.dateStart]]], +, literal["/"]], +, call[df.format, parameter[member[.dateEnd]]]]]] else begin[{] if[binary_operation[member[.dateStart], !=, literal[null]]] begin[{] call[container.put, parameter[literal["date"], call[df.format, parameter[member[.dateStart]]]]] else begin[{] None end[}] end[}] if[binary_operation[binary_operation[member[.description], !=, literal[null]], &&, binary_operation[member[description.length], >, literal[0]]]] begin[{] call[container.put, parameter[literal["description"], member[.description]]] else begin[{] None end[}] if[binary_operation[member[.comment], !=, literal[null]]] begin[{] call[container.put, parameter[literal["comment"], member[.comment]]] else begin[{] None end[}] return[call[.addChild, parameter[literal["verb"], member[.container], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[addVerb] operator[SEP] identifier[String] identifier[action] , identifier[Date] identifier[dateStart] , identifier[Date] identifier[dateEnd] , identifier[String] operator[SEP] operator[SEP] identifier[description] , identifier[String] identifier[comment] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[container] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[action] operator[!=] Other[null] operator[SEP] { identifier[container] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[action] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[dateStart] operator[!=] Other[null] operator[&&] identifier[dateEnd] operator[!=] Other[null] operator[SEP] { identifier[container] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[df] operator[SEP] identifier[format] operator[SEP] identifier[dateStart] operator[SEP] operator[+] literal[String] operator[+] identifier[df] operator[SEP] identifier[format] operator[SEP] identifier[dateEnd] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[dateStart] operator[!=] Other[null] operator[SEP] { identifier[container] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[df] operator[SEP] identifier[format] operator[SEP] identifier[dateStart] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[description] operator[!=] Other[null] operator[&&] identifier[description] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[container] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[description] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[comment] operator[!=] Other[null] operator[SEP] { identifier[container] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[comment] operator[SEP] operator[SEP] } Keyword[return] identifier[addChild] operator[SEP] literal[String] , identifier[container] , Other[null] operator[SEP] operator[SEP] }
@Override public void perform() throws PortalException { // push the change into the PLF if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) { // we are dealing with an incorporated node, so get a plf ghost // node, set its attribute, then add a directive indicating the // attribute that should be pushed into the ilf during merge Element plfNode = HandlerUtils.getPLFNode( ilfNode, person, true, // create node if not found false); // don't create children plfNode.setAttribute(name, value); /* * add directive to hold override value. This is not necessary for * folder names since they are overridden at render time with their * locale specific version and persisted via a different mechanism. */ EditManager.addEditDirective(plfNode, name, person); } else { // node owned by user so change attribute in child directly Document plf = RDBMDistributedLayoutStore.getPLF(person); Element plfNode = plf.getElementById(nodeId); if (plfNode != null) // should always be non-null { plfNode.setAttribute(name, value); } } /* * push the change into the ILF if not the name attribute. For names * the rendering will inject the localized name via a special processor. * So it doesn't matter what is in the ILF's folder name attribute. */ if (!name.equals(Constants.ATT_NAME)) // should always be non-null { ilfNode.setAttribute(name, value); } }
class class_name[name] begin[{] method[perform, return_type[void], modifier[public], parameter[]] begin[{] if[call[nodeId.startsWith, parameter[member[Constants.FRAGMENT_ID_USER_PREFIX]]]] begin[{] local_variable[type[Element], plfNode] call[plfNode.setAttribute, parameter[member[.name], member[.value]]] call[EditManager.addEditDirective, parameter[member[.plfNode], member[.name], member[.person]]] else begin[{] local_variable[type[Document], plf] local_variable[type[Element], plfNode] if[binary_operation[member[.plfNode], !=, literal[null]]] begin[{] call[plfNode.setAttribute, parameter[member[.name], member[.value]]] else begin[{] None end[}] end[}] if[call[name.equals, parameter[member[Constants.ATT_NAME]]]] begin[{] call[ilfNode.setAttribute, parameter[member[.name], member[.value]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[perform] operator[SEP] operator[SEP] Keyword[throws] identifier[PortalException] { Keyword[if] operator[SEP] identifier[nodeId] operator[SEP] identifier[startsWith] operator[SEP] identifier[Constants] operator[SEP] identifier[FRAGMENT_ID_USER_PREFIX] operator[SEP] operator[SEP] { identifier[Element] identifier[plfNode] operator[=] identifier[HandlerUtils] operator[SEP] identifier[getPLFNode] operator[SEP] identifier[ilfNode] , identifier[person] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[plfNode] operator[SEP] identifier[setAttribute] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] identifier[EditManager] operator[SEP] identifier[addEditDirective] operator[SEP] identifier[plfNode] , identifier[name] , identifier[person] operator[SEP] operator[SEP] } Keyword[else] { identifier[Document] identifier[plf] operator[=] identifier[RDBMDistributedLayoutStore] operator[SEP] identifier[getPLF] operator[SEP] identifier[person] operator[SEP] operator[SEP] identifier[Element] identifier[plfNode] operator[=] identifier[plf] operator[SEP] identifier[getElementById] operator[SEP] identifier[nodeId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[plfNode] operator[!=] Other[null] operator[SEP] { identifier[plfNode] operator[SEP] identifier[setAttribute] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[Constants] operator[SEP] identifier[ATT_NAME] operator[SEP] operator[SEP] { identifier[ilfNode] operator[SEP] identifier[setAttribute] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } }
public static boolean verify(EventModel eventModel, Capabilities capabilities, Identifiable player, List<Identifiable> activators) { if (!eventModel.containsDescriptor(StartMusicRequest.ID)) return false; if (!capabilities.handlesPlayRequestFromOutside()) { if (activators.stream() .noneMatch(identifiable -> identifiable.isOwner(eventModel.getSource()))) return false; } if (!PlaylistResource.getPlaylist(eventModel).map(playlist -> playlist.verify(capabilities)).orElse(true)) { return false; } return SelectorResource.isTarget(eventModel, player) .orElse(false); }
class class_name[name] begin[{] method[verify, return_type[type[boolean]], modifier[public static], parameter[eventModel, capabilities, player, activators]] begin[{] if[call[eventModel.containsDescriptor, parameter[member[StartMusicRequest.ID]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[capabilities.handlesPlayRequestFromOutside, parameter[]]] begin[{] if[call[activators.stream, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] None end[}] if[call[PlaylistResource.getPlaylist, parameter[member[.eventModel]]]] begin[{] return[literal[false]] else begin[{] None end[}] return[call[SelectorResource.isTarget, parameter[member[.eventModel], member[.player]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[verify] operator[SEP] identifier[EventModel] identifier[eventModel] , identifier[Capabilities] identifier[capabilities] , identifier[Identifiable] identifier[player] , identifier[List] operator[<] identifier[Identifiable] operator[>] identifier[activators] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[eventModel] operator[SEP] identifier[containsDescriptor] operator[SEP] identifier[StartMusicRequest] operator[SEP] identifier[ID] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[capabilities] operator[SEP] identifier[handlesPlayRequestFromOutside] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[activators] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[noneMatch] operator[SEP] identifier[identifiable] operator[->] identifier[identifiable] operator[SEP] identifier[isOwner] operator[SEP] identifier[eventModel] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[PlaylistResource] operator[SEP] identifier[getPlaylist] operator[SEP] identifier[eventModel] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[playlist] operator[->] identifier[playlist] operator[SEP] identifier[verify] operator[SEP] identifier[capabilities] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] literal[boolean] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[SelectorResource] operator[SEP] identifier[isTarget] operator[SEP] identifier[eventModel] , identifier[player] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
public Matrix4f perspectiveRect(float width, float height, float zNear, float zFar, boolean zZeroToOne) { return perspectiveRect(width, height, zNear, zFar, zZeroToOne, thisOrNew()); }
class class_name[name] begin[{] method[perspectiveRect, return_type[type[Matrix4f]], modifier[public], parameter[width, height, zNear, zFar, zZeroToOne]] begin[{] return[call[.perspectiveRect, parameter[member[.width], member[.height], member[.zNear], member[.zFar], member[.zZeroToOne], call[.thisOrNew, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[Matrix4f] identifier[perspectiveRect] operator[SEP] Keyword[float] identifier[width] , Keyword[float] identifier[height] , Keyword[float] identifier[zNear] , Keyword[float] identifier[zFar] , Keyword[boolean] identifier[zZeroToOne] operator[SEP] { Keyword[return] identifier[perspectiveRect] operator[SEP] identifier[width] , identifier[height] , identifier[zNear] , identifier[zFar] , identifier[zZeroToOne] , identifier[thisOrNew] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private TransactionReceipt send(String toAddress, BigDecimal value, Convert.Unit unit) throws IOException, InterruptedException, TransactionException { BigInteger gasPrice = requestCurrentGasPrice(); return send(toAddress, value, unit, gasPrice, GAS_LIMIT); }
class class_name[name] begin[{] method[send, return_type[type[TransactionReceipt]], modifier[private], parameter[toAddress, value, unit]] begin[{] local_variable[type[BigInteger], gasPrice] return[call[.send, parameter[member[.toAddress], member[.value], member[.unit], member[.gasPrice], member[.GAS_LIMIT]]]] end[}] END[}]
Keyword[private] identifier[TransactionReceipt] identifier[send] operator[SEP] identifier[String] identifier[toAddress] , identifier[BigDecimal] identifier[value] , identifier[Convert] operator[SEP] identifier[Unit] identifier[unit] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] , identifier[TransactionException] { identifier[BigInteger] identifier[gasPrice] operator[=] identifier[requestCurrentGasPrice] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[send] operator[SEP] identifier[toAddress] , identifier[value] , identifier[unit] , identifier[gasPrice] , identifier[GAS_LIMIT] operator[SEP] operator[SEP] }
protected static CmsTreeItem getLastOpenedItem(CmsTreeItem item, int stopLevel, boolean requiresDropEnabled) { if (stopLevel != -1) { // stop level is set int currentLevel = getPathLevel(item.getPath()); if (currentLevel > stopLevel) { // we are past the stop level, prevent further checks stopLevel = -1; } else if (currentLevel == stopLevel) { // matches stop level return item; } } if (item.getChildCount() > 0) { int childIndex = item.getChildCount() - 1; CmsTreeItem child = item.getChild(childIndex); if (requiresDropEnabled) { while (!child.isDropEnabled()) { childIndex--; if (childIndex < 0) { return item; } child = item.getChild(childIndex); } } if (child.isOpen()) { return CmsTreeItem.getLastOpenedItem(child, stopLevel, requiresDropEnabled); } } return item; }
class class_name[name] begin[{] method[getLastOpenedItem, return_type[type[CmsTreeItem]], modifier[static protected], parameter[item, stopLevel, requiresDropEnabled]] begin[{] if[binary_operation[member[.stopLevel], !=, literal[1]]] begin[{] local_variable[type[int], currentLevel] if[binary_operation[member[.currentLevel], >, member[.stopLevel]]] begin[{] assign[member[.stopLevel], literal[1]] else begin[{] if[binary_operation[member[.currentLevel], ==, member[.stopLevel]]] begin[{] return[member[.item]] else begin[{] None end[}] end[}] else begin[{] None end[}] if[binary_operation[call[item.getChildCount, parameter[]], >, literal[0]]] begin[{] local_variable[type[int], childIndex] local_variable[type[CmsTreeItem], child] if[member[.requiresDropEnabled]] begin[{] while[call[child.isDropEnabled, parameter[]]] begin[{] member[.childIndex] if[binary_operation[member[.childIndex], <, literal[0]]] begin[{] return[member[.item]] else begin[{] None end[}] assign[member[.child], call[item.getChild, parameter[member[.childIndex]]]] end[}] else begin[{] None end[}] if[call[child.isOpen, parameter[]]] begin[{] return[call[CmsTreeItem.getLastOpenedItem, parameter[member[.child], member[.stopLevel], member[.requiresDropEnabled]]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.item]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[CmsTreeItem] identifier[getLastOpenedItem] operator[SEP] identifier[CmsTreeItem] identifier[item] , Keyword[int] identifier[stopLevel] , Keyword[boolean] identifier[requiresDropEnabled] operator[SEP] { Keyword[if] operator[SEP] identifier[stopLevel] operator[!=] operator[-] Other[1] operator[SEP] { Keyword[int] identifier[currentLevel] operator[=] identifier[getPathLevel] operator[SEP] identifier[item] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentLevel] operator[>] identifier[stopLevel] operator[SEP] { identifier[stopLevel] operator[=] operator[-] Other[1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[currentLevel] operator[==] identifier[stopLevel] operator[SEP] { Keyword[return] identifier[item] operator[SEP] } } Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[childIndex] operator[=] identifier[item] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[CmsTreeItem] identifier[child] operator[=] identifier[item] operator[SEP] identifier[getChild] operator[SEP] identifier[childIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[requiresDropEnabled] operator[SEP] { Keyword[while] operator[SEP] operator[!] identifier[child] operator[SEP] identifier[isDropEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[childIndex] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[childIndex] operator[<] Other[0] operator[SEP] { Keyword[return] identifier[item] operator[SEP] } identifier[child] operator[=] identifier[item] operator[SEP] identifier[getChild] operator[SEP] identifier[childIndex] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[CmsTreeItem] operator[SEP] identifier[getLastOpenedItem] operator[SEP] identifier[child] , identifier[stopLevel] , identifier[requiresDropEnabled] operator[SEP] operator[SEP] } } Keyword[return] identifier[item] operator[SEP] }
public static String getClassName(Descriptor descriptor, ProtoFlavor flavor) { return getClassName(classNameWithoutPackage(descriptor, flavor), descriptor.getFile(), flavor); }
class class_name[name] begin[{] method[getClassName, return_type[type[String]], modifier[public static], parameter[descriptor, flavor]] begin[{] return[call[.getClassName, parameter[call[.classNameWithoutPackage, parameter[member[.descriptor], member[.flavor]]], call[descriptor.getFile, parameter[]], member[.flavor]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getClassName] operator[SEP] identifier[Descriptor] identifier[descriptor] , identifier[ProtoFlavor] identifier[flavor] operator[SEP] { Keyword[return] identifier[getClassName] operator[SEP] identifier[classNameWithoutPackage] operator[SEP] identifier[descriptor] , identifier[flavor] operator[SEP] , identifier[descriptor] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] , identifier[flavor] operator[SEP] operator[SEP] }
public void marshall(DocumentParameter documentParameter, ProtocolMarshaller protocolMarshaller) { if (documentParameter == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(documentParameter.getName(), NAME_BINDING); protocolMarshaller.marshall(documentParameter.getType(), TYPE_BINDING); protocolMarshaller.marshall(documentParameter.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(documentParameter.getDefaultValue(), DEFAULTVALUE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[documentParameter, protocolMarshaller]] begin[{] if[binary_operation[member[.documentParameter], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=documentParameter, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=documentParameter, selectors=[], type_arguments=None), MemberReference(member=TYPE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDescription, postfix_operators=[], prefix_operators=[], qualifier=documentParameter, selectors=[], type_arguments=None), MemberReference(member=DESCRIPTION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=documentParameter, selectors=[], type_arguments=None), MemberReference(member=DEFAULTVALUE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DocumentParameter] identifier[documentParameter] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[documentParameter] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[documentParameter] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[documentParameter] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[TYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[documentParameter] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] , identifier[DESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[documentParameter] operator[SEP] identifier[getDefaultValue] operator[SEP] operator[SEP] , identifier[DEFAULTVALUE_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@SafeVarargs public static <T> CloseableIterable<T> chain(CloseableIterable<? extends T>... iterables) { return chain(asList(iterables)); }
class class_name[name] begin[{] method[chain, return_type[type[CloseableIterable]], modifier[public static], parameter[iterables]] begin[{] return[call[.chain, parameter[call[.asList, parameter[member[.iterables]]]]]] end[}] END[}]
annotation[@] identifier[SafeVarargs] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[CloseableIterable] operator[<] identifier[T] operator[>] identifier[chain] operator[SEP] identifier[CloseableIterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[...] identifier[iterables] operator[SEP] { Keyword[return] identifier[chain] operator[SEP] identifier[asList] operator[SEP] identifier[iterables] operator[SEP] operator[SEP] operator[SEP] }
public RequestSpecBuilder addQueryParam(String parameterName, Object... parameterValues) { spec.queryParam(parameterName, parameterValues); return this; }
class class_name[name] begin[{] method[addQueryParam, return_type[type[RequestSpecBuilder]], modifier[public], parameter[parameterName, parameterValues]] begin[{] call[spec.queryParam, parameter[member[.parameterName], member[.parameterValues]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[RequestSpecBuilder] identifier[addQueryParam] operator[SEP] identifier[String] identifier[parameterName] , identifier[Object] operator[...] identifier[parameterValues] operator[SEP] { identifier[spec] operator[SEP] identifier[queryParam] operator[SEP] identifier[parameterName] , identifier[parameterValues] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void set(boolean index, double x, double y) { this.MODE = LINES; if (index == true) { this.x1 = x; this.y1 = y; } else { this.x2 = x; this.y2 = y; } calcG(); dx[0] = x1 - this.x; dx[1] = x2 - this.x; dy[0] = y1 - this.y; dy[1] = y2 - this.y; dz[0] = z1 - 0; dz[1] = z2 - 0; if (dashed) calcDashedLine(); }
class class_name[name] begin[{] method[set, return_type[void], modifier[public], parameter[index, x, y]] begin[{] assign[THIS[member[None.MODE]], member[.LINES]] if[binary_operation[member[.index], ==, literal[true]]] begin[{] assign[THIS[member[None.x1]], member[.x]] assign[THIS[member[None.y1]], member[.y]] else begin[{] assign[THIS[member[None.x2]], member[.x]] assign[THIS[member[None.y2]], member[.y]] end[}] call[.calcG, parameter[]] assign[member[.dx], binary_operation[member[.x1], -, THIS[member[None.x]]]] assign[member[.dx], binary_operation[member[.x2], -, THIS[member[None.x]]]] assign[member[.dy], binary_operation[member[.y1], -, THIS[member[None.y]]]] assign[member[.dy], binary_operation[member[.y2], -, THIS[member[None.y]]]] assign[member[.dz], binary_operation[member[.z1], -, literal[0]]] assign[member[.dz], binary_operation[member[.z2], -, literal[0]]] if[member[.dashed]] begin[{] call[.calcDashedLine, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[set] operator[SEP] Keyword[boolean] identifier[index] , Keyword[double] identifier[x] , Keyword[double] identifier[y] operator[SEP] { Keyword[this] operator[SEP] identifier[MODE] operator[=] identifier[LINES] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] literal[boolean] operator[SEP] { Keyword[this] operator[SEP] identifier[x1] operator[=] identifier[x] operator[SEP] Keyword[this] operator[SEP] identifier[y1] operator[=] identifier[y] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[x2] operator[=] identifier[x] operator[SEP] Keyword[this] operator[SEP] identifier[y2] operator[=] identifier[y] operator[SEP] } identifier[calcG] operator[SEP] operator[SEP] operator[SEP] identifier[dx] operator[SEP] Other[0] operator[SEP] operator[=] identifier[x1] operator[-] Keyword[this] operator[SEP] identifier[x] operator[SEP] identifier[dx] operator[SEP] Other[1] operator[SEP] operator[=] identifier[x2] operator[-] Keyword[this] operator[SEP] identifier[x] operator[SEP] identifier[dy] operator[SEP] Other[0] operator[SEP] operator[=] identifier[y1] operator[-] Keyword[this] operator[SEP] identifier[y] operator[SEP] identifier[dy] operator[SEP] Other[1] operator[SEP] operator[=] identifier[y2] operator[-] Keyword[this] operator[SEP] identifier[y] operator[SEP] identifier[dz] operator[SEP] Other[0] operator[SEP] operator[=] identifier[z1] operator[-] Other[0] operator[SEP] identifier[dz] operator[SEP] Other[1] operator[SEP] operator[=] identifier[z2] operator[-] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[dashed] operator[SEP] identifier[calcDashedLine] operator[SEP] operator[SEP] operator[SEP] }
public static Concatenator holdsTrue(IPredicateFunction I) { Concatenator ret = P.holdsTrue(I); ASTNode an = APIObjectAccess.getAstNode(ret); an.setClauseType(ClauseType.WHERE); return ret; }
class class_name[name] begin[{] method[holdsTrue, return_type[type[Concatenator]], modifier[public static], parameter[I]] begin[{] local_variable[type[Concatenator], ret] local_variable[type[ASTNode], an] call[an.setClauseType, parameter[member[ClauseType.WHERE]]] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Concatenator] identifier[holdsTrue] operator[SEP] identifier[IPredicateFunction] identifier[I] operator[SEP] { identifier[Concatenator] identifier[ret] operator[=] identifier[P] operator[SEP] identifier[holdsTrue] operator[SEP] identifier[I] operator[SEP] operator[SEP] identifier[ASTNode] identifier[an] operator[=] identifier[APIObjectAccess] operator[SEP] identifier[getAstNode] operator[SEP] identifier[ret] operator[SEP] operator[SEP] identifier[an] operator[SEP] identifier[setClauseType] operator[SEP] identifier[ClauseType] operator[SEP] identifier[WHERE] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
public ListenableFuture<SegmentsAndMetadata> publish( final TransactionalSegmentPublisher publisher, final Committer committer, final Collection<String> sequenceNames ) { final List<SegmentIdWithShardSpec> theSegments = getSegmentWithStates(sequenceNames) .map(SegmentWithState::getSegmentIdentifier) .collect(Collectors.toList()); final ListenableFuture<SegmentsAndMetadata> publishFuture = ListenableFutures.transformAsync( // useUniquePath=true prevents inconsistencies in segment data when task failures or replicas leads to a second // version of a segment with the same identifier containing different data; see DataSegmentPusher.push() docs pushInBackground(wrapCommitter(committer), theSegments, true), sam -> publishInBackground( sam, publisher ) ); return Futures.transform( publishFuture, (Function<? super SegmentsAndMetadata, ? extends SegmentsAndMetadata>) sam -> { synchronized (segments) { sequenceNames.forEach(segments::remove); } return sam; } ); }
class class_name[name] begin[{] method[publish, return_type[type[ListenableFuture]], modifier[public], parameter[publisher, committer, sequenceNames]] begin[{] local_variable[type[List], theSegments] local_variable[type[ListenableFuture], publishFuture] return[call[Futures.transform, parameter[member[.publishFuture], LambdaExpression(body=[SynchronizedStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=segments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=forEach, postfix_operators=[], prefix_operators=[], qualifier=sequenceNames, selectors=[], type_arguments=None), label=None)], label=None, lock=MemberReference(member=segments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ReturnStatement(expression=MemberReference(member=sam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], parameters=[Cast(expression=MemberReference(member=sam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=super, type=ReferenceType(arguments=None, dimensions=[], name=SegmentsAndMetadata, sub_type=None)), TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=SegmentsAndMetadata, sub_type=None))], dimensions=[], name=Function, sub_type=None))])]]] end[}] END[}]
Keyword[public] identifier[ListenableFuture] operator[<] identifier[SegmentsAndMetadata] operator[>] identifier[publish] operator[SEP] Keyword[final] identifier[TransactionalSegmentPublisher] identifier[publisher] , Keyword[final] identifier[Committer] identifier[committer] , Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[sequenceNames] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[SegmentIdWithShardSpec] operator[>] identifier[theSegments] operator[=] identifier[getSegmentWithStates] operator[SEP] identifier[sequenceNames] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[SegmentWithState] operator[::] identifier[getSegmentIdentifier] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ListenableFuture] operator[<] identifier[SegmentsAndMetadata] operator[>] identifier[publishFuture] operator[=] identifier[ListenableFutures] operator[SEP] identifier[transformAsync] operator[SEP] identifier[pushInBackground] operator[SEP] identifier[wrapCommitter] operator[SEP] identifier[committer] operator[SEP] , identifier[theSegments] , literal[boolean] operator[SEP] , identifier[sam] operator[->] identifier[publishInBackground] operator[SEP] identifier[sam] , identifier[publisher] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Futures] operator[SEP] identifier[transform] operator[SEP] identifier[publishFuture] , operator[SEP] identifier[Function] operator[<] operator[?] Keyword[super] identifier[SegmentsAndMetadata] , operator[?] Keyword[extends] identifier[SegmentsAndMetadata] operator[>] operator[SEP] identifier[sam] operator[->] { Keyword[synchronized] operator[SEP] identifier[segments] operator[SEP] { identifier[sequenceNames] operator[SEP] identifier[forEach] operator[SEP] identifier[segments] operator[::] identifier[remove] operator[SEP] operator[SEP] } Keyword[return] identifier[sam] operator[SEP] } operator[SEP] operator[SEP] }
public int binarySearchFromTo(Object key, int from, int to) { int low = from; int high = to; while (low <= high) { int mid =(low + high)/2; Object midVal = elements[mid]; int cmp = ((Comparable)midVal).compareTo(key); if (cmp < 0) low = mid + 1; else if (cmp > 0) high = mid - 1; else return mid; // key found } return -(low + 1); // key not found. }
class class_name[name] begin[{] method[binarySearchFromTo, return_type[type[int]], modifier[public], parameter[key, from, to]] begin[{] local_variable[type[int], low] local_variable[type[int], high] while[binary_operation[member[.low], <=, member[.high]]] begin[{] local_variable[type[int], mid] local_variable[type[Object], midVal] local_variable[type[int], cmp] if[binary_operation[member[.cmp], <, literal[0]]] begin[{] assign[member[.low], binary_operation[member[.mid], +, literal[1]]] else begin[{] if[binary_operation[member[.cmp], >, literal[0]]] begin[{] assign[member[.high], binary_operation[member[.mid], -, literal[1]]] else begin[{] return[member[.mid]] end[}] end[}] end[}] return[binary_operation[member[.low], +, literal[1]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[binarySearchFromTo] operator[SEP] identifier[Object] identifier[key] , Keyword[int] identifier[from] , Keyword[int] identifier[to] operator[SEP] { Keyword[int] identifier[low] operator[=] identifier[from] operator[SEP] Keyword[int] identifier[high] operator[=] identifier[to] operator[SEP] Keyword[while] operator[SEP] identifier[low] operator[<=] identifier[high] operator[SEP] { Keyword[int] identifier[mid] operator[=] operator[SEP] identifier[low] operator[+] identifier[high] operator[SEP] operator[/] Other[2] operator[SEP] identifier[Object] identifier[midVal] operator[=] identifier[elements] operator[SEP] identifier[mid] operator[SEP] operator[SEP] Keyword[int] identifier[cmp] operator[=] operator[SEP] operator[SEP] identifier[Comparable] operator[SEP] identifier[midVal] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmp] operator[<] Other[0] operator[SEP] identifier[low] operator[=] identifier[mid] operator[+] Other[1] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[cmp] operator[>] Other[0] operator[SEP] identifier[high] operator[=] identifier[mid] operator[-] Other[1] operator[SEP] Keyword[else] Keyword[return] identifier[mid] operator[SEP] } Keyword[return] operator[-] operator[SEP] identifier[low] operator[+] Other[1] operator[SEP] operator[SEP] }
private Graphics2D getGraphics(int layer) { Graphics2D graphics = layeredGraphics[layer]; if (graphics == null) { createImageAndGraphics(layer); graphics = layeredGraphics[layer]; } return graphics; }
class class_name[name] begin[{] method[getGraphics, return_type[type[Graphics2D]], modifier[private], parameter[layer]] begin[{] local_variable[type[Graphics2D], graphics] if[binary_operation[member[.graphics], ==, literal[null]]] begin[{] call[.createImageAndGraphics, parameter[member[.layer]]] assign[member[.graphics], member[.layeredGraphics]] else begin[{] None end[}] return[member[.graphics]] end[}] END[}]
Keyword[private] identifier[Graphics2D] identifier[getGraphics] operator[SEP] Keyword[int] identifier[layer] operator[SEP] { identifier[Graphics2D] identifier[graphics] operator[=] identifier[layeredGraphics] operator[SEP] identifier[layer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[graphics] operator[==] Other[null] operator[SEP] { identifier[createImageAndGraphics] operator[SEP] identifier[layer] operator[SEP] operator[SEP] identifier[graphics] operator[=] identifier[layeredGraphics] operator[SEP] identifier[layer] operator[SEP] operator[SEP] } Keyword[return] identifier[graphics] operator[SEP] }
private static ListenerAdapter createListenerAdapter(EntryEventType eventType, EntryListener listener) { final ConstructorFunction<EntryListener, ListenerAdapter> constructorFunction = CONSTRUCTORS.get(eventType); if (constructorFunction == null) { throw new IllegalArgumentException("First, define a ListenerAdapter for the event EntryEventType." + eventType); } return constructorFunction.createNew(listener); }
class class_name[name] begin[{] method[createListenerAdapter, return_type[type[ListenerAdapter]], modifier[private static], parameter[eventType, listener]] begin[{] local_variable[type[ConstructorFunction], constructorFunction] if[binary_operation[member[.constructorFunction], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="First, define a ListenerAdapter for the event EntryEventType."), operandr=MemberReference(member=eventType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[constructorFunction.createNew, parameter[member[.listener]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[ListenerAdapter] identifier[createListenerAdapter] operator[SEP] identifier[EntryEventType] identifier[eventType] , identifier[EntryListener] identifier[listener] operator[SEP] { Keyword[final] identifier[ConstructorFunction] operator[<] identifier[EntryListener] , identifier[ListenerAdapter] operator[>] identifier[constructorFunction] operator[=] identifier[CONSTRUCTORS] operator[SEP] identifier[get] operator[SEP] identifier[eventType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[constructorFunction] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[eventType] operator[SEP] operator[SEP] } Keyword[return] identifier[constructorFunction] operator[SEP] identifier[createNew] operator[SEP] identifier[listener] operator[SEP] operator[SEP] }
public Nfs3CreateRequest makeCreateRequest(NfsCreateMode createMode, byte[] parentDirectoryFileHandle, String name, NfsSetAttributes attributes, byte[] verifier) throws FileNotFoundException { return new Nfs3CreateRequest(createMode, parentDirectoryFileHandle, name, attributes, verifier, _credential); }
class class_name[name] begin[{] method[makeCreateRequest, return_type[type[Nfs3CreateRequest]], modifier[public], parameter[createMode, parentDirectoryFileHandle, name, attributes, verifier]] begin[{] return[ClassCreator(arguments=[MemberReference(member=createMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentDirectoryFileHandle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=verifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_credential, 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=Nfs3CreateRequest, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Nfs3CreateRequest] identifier[makeCreateRequest] operator[SEP] identifier[NfsCreateMode] identifier[createMode] , Keyword[byte] operator[SEP] operator[SEP] identifier[parentDirectoryFileHandle] , identifier[String] identifier[name] , identifier[NfsSetAttributes] identifier[attributes] , Keyword[byte] operator[SEP] operator[SEP] identifier[verifier] operator[SEP] Keyword[throws] identifier[FileNotFoundException] { Keyword[return] Keyword[new] identifier[Nfs3CreateRequest] operator[SEP] identifier[createMode] , identifier[parentDirectoryFileHandle] , identifier[name] , identifier[attributes] , identifier[verifier] , identifier[_credential] operator[SEP] operator[SEP] }
public SourceBuilder addLine(String fmt, Object... args) { add(fmt, args); source.append(LINE_SEPARATOR); return this; }
class class_name[name] begin[{] method[addLine, return_type[type[SourceBuilder]], modifier[public], parameter[fmt, args]] begin[{] call[.add, parameter[member[.fmt], member[.args]]] call[source.append, parameter[member[.LINE_SEPARATOR]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[SourceBuilder] identifier[addLine] operator[SEP] identifier[String] identifier[fmt] , identifier[Object] operator[...] identifier[args] operator[SEP] { identifier[add] operator[SEP] identifier[fmt] , identifier[args] operator[SEP] operator[SEP] identifier[source] operator[SEP] identifier[append] operator[SEP] identifier[LINE_SEPARATOR] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void beginRestart(String resourceGroupName, String containerGroupName) { beginRestartWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); }
class class_name[name] begin[{] method[beginRestart, return_type[void], modifier[public], parameter[resourceGroupName, containerGroupName]] begin[{] call[.beginRestartWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.containerGroupName]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[beginRestart] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[containerGroupName] operator[SEP] { identifier[beginRestartWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[containerGroupName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public int[] enumerateColorIds (String className) { // make sure the class exists ClassRecord record = getClassRecord(className); if (record == null) { return null; } int[] cids = new int[record.colors.size()]; Iterator<ColorRecord> crecs = record.colors.values().iterator(); for (int ii = 0; crecs.hasNext(); ii++) { cids[ii] = crecs.next().colorId; } return cids; }
class class_name[name] begin[{] method[enumerateColorIds, return_type[type[int]], modifier[public], parameter[className]] begin[{] local_variable[type[ClassRecord], record] if[binary_operation[member[.record], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], cids] local_variable[type[Iterator], crecs] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=crecs, selectors=[MemberReference(member=colorId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=crecs, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=ii)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.cids]] end[}] END[}]
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[enumerateColorIds] operator[SEP] identifier[String] identifier[className] operator[SEP] { identifier[ClassRecord] identifier[record] operator[=] identifier[getClassRecord] operator[SEP] identifier[className] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[int] operator[SEP] operator[SEP] identifier[cids] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[record] operator[SEP] identifier[colors] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[ColorRecord] operator[>] identifier[crecs] operator[=] identifier[record] operator[SEP] identifier[colors] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] Other[0] operator[SEP] identifier[crecs] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[ii] operator[++] operator[SEP] { identifier[cids] operator[SEP] identifier[ii] operator[SEP] operator[=] identifier[crecs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[colorId] operator[SEP] } Keyword[return] identifier[cids] operator[SEP] }
protected static SubstitutedLine doParse(String str, ParsingStateCallbackHandler callbackHandler, ParsingState initialState, boolean strict, boolean disableResolutionException, CommandContext cmdCtx) throws CommandFormatException { if (str == null || str.isEmpty()) { return new SubstitutedLine(str); } ParsingContextImpl ctx = new ParsingContextImpl(); ctx.initialState = initialState; ctx.callbackHandler = callbackHandler; ctx.input = str; ctx.strict = strict; ctx.cmdCtx = cmdCtx; ctx.disableResolutionException = disableResolutionException; ctx.substitued.substitued = ctx.parse(); return ctx.substitued; }
class class_name[name] begin[{] method[doParse, return_type[type[SubstitutedLine]], modifier[static protected], parameter[str, callbackHandler, initialState, strict, disableResolutionException, cmdCtx]] begin[{] if[binary_operation[binary_operation[member[.str], ==, literal[null]], ||, call[str.isEmpty, parameter[]]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=str, 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=SubstitutedLine, sub_type=None))] else begin[{] None end[}] local_variable[type[ParsingContextImpl], ctx] assign[member[ctx.initialState], member[.initialState]] assign[member[ctx.callbackHandler], member[.callbackHandler]] assign[member[ctx.input], member[.str]] assign[member[ctx.strict], member[.strict]] assign[member[ctx.cmdCtx], member[.cmdCtx]] assign[member[ctx.disableResolutionException], member[.disableResolutionException]] assign[member[ctx.substitued.substitued], call[ctx.parse, parameter[]]] return[member[ctx.substitued]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[SubstitutedLine] identifier[doParse] operator[SEP] identifier[String] identifier[str] , identifier[ParsingStateCallbackHandler] identifier[callbackHandler] , identifier[ParsingState] identifier[initialState] , Keyword[boolean] identifier[strict] , Keyword[boolean] identifier[disableResolutionException] , identifier[CommandContext] identifier[cmdCtx] operator[SEP] Keyword[throws] identifier[CommandFormatException] { Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[||] identifier[str] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[SubstitutedLine] operator[SEP] identifier[str] operator[SEP] operator[SEP] } identifier[ParsingContextImpl] identifier[ctx] operator[=] Keyword[new] identifier[ParsingContextImpl] operator[SEP] operator[SEP] operator[SEP] identifier[ctx] operator[SEP] identifier[initialState] operator[=] identifier[initialState] operator[SEP] identifier[ctx] operator[SEP] identifier[callbackHandler] operator[=] identifier[callbackHandler] operator[SEP] identifier[ctx] operator[SEP] identifier[input] operator[=] identifier[str] operator[SEP] identifier[ctx] operator[SEP] identifier[strict] operator[=] identifier[strict] operator[SEP] identifier[ctx] operator[SEP] identifier[cmdCtx] operator[=] identifier[cmdCtx] operator[SEP] identifier[ctx] operator[SEP] identifier[disableResolutionException] operator[=] identifier[disableResolutionException] operator[SEP] identifier[ctx] operator[SEP] identifier[substitued] operator[SEP] identifier[substitued] operator[=] identifier[ctx] operator[SEP] identifier[parse] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ctx] operator[SEP] identifier[substitued] operator[SEP] }
public void beginDelete(String resourceGroupName, String domainName) { beginDeleteWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().body(); }
class class_name[name] begin[{] method[beginDelete, return_type[void], modifier[public], parameter[resourceGroupName, domainName]] begin[{] call[.beginDeleteWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.domainName]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[beginDelete] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[domainName] operator[SEP] { identifier[beginDeleteWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[domainName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
private void cascadeMarkedForDeletion() { List alreadyPrepared = new ArrayList(); for(int i = 0; i < markedForDeletionList.size(); i++) { ObjectEnvelope mod = (ObjectEnvelope) markedForDeletionList.get(i); // if the object wasn't associated with another object, start cascade delete if(!isNewAssociatedObject(mod.getIdentity())) { cascadeDeleteFor(mod, alreadyPrepared); alreadyPrepared.clear(); } } markedForDeletionList.clear(); }
class class_name[name] begin[{] method[cascadeMarkedForDeletion, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[List], alreadyPrepared] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=markedForDeletionList, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ObjectEnvelope, sub_type=None)), name=mod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectEnvelope, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIdentity, postfix_operators=[], prefix_operators=[], qualifier=mod, selectors=[], type_arguments=None)], member=isNewAssociatedObject, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alreadyPrepared, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cascadeDeleteFor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=alreadyPrepared, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=markedForDeletionList, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[markedForDeletionList.clear, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[cascadeMarkedForDeletion] operator[SEP] operator[SEP] { identifier[List] identifier[alreadyPrepared] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[markedForDeletionList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ObjectEnvelope] identifier[mod] operator[=] operator[SEP] identifier[ObjectEnvelope] operator[SEP] identifier[markedForDeletionList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isNewAssociatedObject] operator[SEP] identifier[mod] operator[SEP] identifier[getIdentity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[cascadeDeleteFor] operator[SEP] identifier[mod] , identifier[alreadyPrepared] operator[SEP] operator[SEP] identifier[alreadyPrepared] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } } identifier[markedForDeletionList] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] }
static public String nullify(String path) { return (path != null && path.length() == 0 ? null : path); }
class class_name[name] begin[{] method[nullify, return_type[type[String]], modifier[public static], parameter[path]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), if_false=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[static] Keyword[public] identifier[String] identifier[nullify] operator[SEP] identifier[String] identifier[path] operator[SEP] { Keyword[return] operator[SEP] identifier[path] operator[!=] Other[null] operator[&&] identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] Other[null] operator[:] identifier[path] operator[SEP] operator[SEP] }
public CoinbaseUser createCoinbaseUser(CoinbaseUser user, final String oAuthClientId) throws IOException { final CoinbaseUser createdUser = coinbase.createUser(user.withoAuthClientId(oAuthClientId)); return handleResponse(createdUser); }
class class_name[name] begin[{] method[createCoinbaseUser, return_type[type[CoinbaseUser]], modifier[public], parameter[user, oAuthClientId]] begin[{] local_variable[type[CoinbaseUser], createdUser] return[call[.handleResponse, parameter[member[.createdUser]]]] end[}] END[}]
Keyword[public] identifier[CoinbaseUser] identifier[createCoinbaseUser] operator[SEP] identifier[CoinbaseUser] identifier[user] , Keyword[final] identifier[String] identifier[oAuthClientId] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] identifier[CoinbaseUser] identifier[createdUser] operator[=] identifier[coinbase] operator[SEP] identifier[createUser] operator[SEP] identifier[user] operator[SEP] identifier[withoAuthClientId] operator[SEP] identifier[oAuthClientId] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[handleResponse] operator[SEP] identifier[createdUser] operator[SEP] operator[SEP] }
public String convertIfcSpaceTypeEnumToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
class class_name[name] begin[{] method[convertIfcSpaceTypeEnumToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[String] identifier[convertIfcSpaceTypeEnumToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] { Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
@Override public void setRow (final RowVector rv, final int r) throws MatrixException { super.setRow (rv, r); reset (); }
class class_name[name] begin[{] method[setRow, return_type[void], modifier[public], parameter[rv, r]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=rv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRow, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[.reset, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setRow] operator[SEP] Keyword[final] identifier[RowVector] identifier[rv] , Keyword[final] Keyword[int] identifier[r] operator[SEP] Keyword[throws] identifier[MatrixException] { Keyword[super] operator[SEP] identifier[setRow] operator[SEP] identifier[rv] , identifier[r] operator[SEP] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] }
public static ContentType parse( final String s) throws ParseException, UnsupportedCharsetException { if (s == null) { throw new IllegalArgumentException("Content type may not be null"); } HeaderElement[] elements = BasicHeaderValueParser.parseElements(s, null); if (elements.length > 0) { return create(elements[0]); } else { throw new ParseException("Invalid content type: " + s); } }
class class_name[name] begin[{] method[parse, return_type[type[ContentType]], modifier[public static], parameter[s]] begin[{] if[binary_operation[member[.s], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Content type may not be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[HeaderElement], elements] if[binary_operation[member[elements.length], >, literal[0]]] begin[{] return[call[.create, parameter[member[.elements]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid content type: "), operandr=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParseException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[ContentType] identifier[parse] operator[SEP] Keyword[final] identifier[String] identifier[s] operator[SEP] Keyword[throws] identifier[ParseException] , identifier[UnsupportedCharsetException] { Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[HeaderElement] operator[SEP] operator[SEP] identifier[elements] operator[=] identifier[BasicHeaderValueParser] operator[SEP] identifier[parseElements] operator[SEP] identifier[s] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elements] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[return] identifier[create] operator[SEP] identifier[elements] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[ParseException] operator[SEP] literal[String] operator[+] identifier[s] operator[SEP] operator[SEP] } }
private static <S extends Storable> Map<String, StorableProperty<S>> examineProperties(Class<S> type, List<NameAndDirection> primaryKeyProps, List<List<NameAndDirection>> alternateKeyProps, List<NameAndDirection> partitionKeyProps) throws MalformedTypeException { if (Storable.class.isAssignableFrom(type)) { if (Storable.class == type) { throw new MalformedTypeException(type, "Storable interface must be extended"); } } else { throw new MalformedTypeException(type, "Does not implement Storable interface"); } int modifiers = type.getModifiers(); if (Modifier.isFinal(modifiers)) { throw new MalformedTypeException(type, "Class is declared final"); } if (!Modifier.isPublic(modifiers)) { throw new MalformedTypeException(type, "Class is not public"); } List<String> errorMessages = new ArrayList<String>(); checkTypeParameter(errorMessages, type); // If type is a class, it must have a public or protected no-arg // constructor. if (!type.isInterface()) { Constructor[] ctors = type.getDeclaredConstructors(); findCtor: { for (Constructor c : ctors) { if (c.getParameterTypes().length == 0) { modifiers = c.getModifiers(); if (!Modifier.isPublic(modifiers) && !Modifier.isProtected(modifiers)) { errorMessages.add("Cannot call constructor: " + c); } break findCtor; } } if (type.getEnclosingClass() == null) { errorMessages.add ("Class must have a public or protected constructor " + "that accepts no arguments"); } else { errorMessages.add ("Inner class must have a public or protected constructor " + "that accepts no arguments"); } } } // All methods to be implemented must be bean property methods that // operate on a supported type. // First, gather all methods that must be implemented. // Gather all methods. We'll be removing them as we implement them, // and if there are any abstract ones left over at the end, why, // that would be bad. Map<String, Method> methods = gatherAllDeclaredMethods(type); // Remove methods not abstract or defined explicitly in // Storable. Storable methods still must be implemented, but not as // properties. for (Iterator<Method> it = methods.values().iterator(); it.hasNext(); ) { Method m = it.next(); if (!Modifier.isAbstract(m.getModifiers()) || m.getDeclaringClass() == Storable.class) { it.remove(); continue; } // Check if abstract method is just redefining a method in // Storable. try { Method m2 = Storable.class.getMethod(m.getName(), (Class[]) m.getParameterTypes()); if (m.getReturnType() == m2.getReturnType()) { it.remove(); } // Copy method can be redefined with specialized return type. if (m.getName().equals("copy") && type.isAssignableFrom(m.getReturnType())) { it.remove(); } } catch (NoSuchMethodException e) { // Not defined in Storable. } } // Identify which properties are members of a primary, alternate or partition key. Set<String> pkPropertyNames, altKeyPropertyNames, parKeyPropertyNames; { pkPropertyNames = new HashSet<String>(); altKeyPropertyNames = new HashSet<String>(); parKeyPropertyNames = new HashSet<String>(); for (NameAndDirection nameAndDir : primaryKeyProps) { pkPropertyNames.add(nameAndDir.name); } for (List<NameAndDirection> list : alternateKeyProps) { for (NameAndDirection nameAndDir : list) { altKeyPropertyNames.add(nameAndDir.name); } } if (partitionKeyProps != null) { for (NameAndDirection nameAndDir : partitionKeyProps) { parKeyPropertyNames.add(nameAndDir.name); } } } Map allProperties = BeanIntrospector.getAllProperties(type); // Copy only the properties that should be implemented here. Map<String, StorableProperty<S>> properties = new HashMap<String, StorableProperty<S>>(); // Remove methods for properties that can be implemented. Iterator it = allProperties.values().iterator(); while (it.hasNext()) { BeanProperty property = BeanProperty.class.cast(it.next()); Method readMethod = property.getReadMethod(); Method writeMethod = property.getWriteMethod(); if (readMethod == null) { if (writeMethod == null) { continue; } else if (!Modifier.isAbstract(writeMethod.getModifiers()) && writeMethod.getAnnotation(Derived.class) == null) { // Ignore concrete property methods unless they're derived. continue; } } else if (!Modifier.isAbstract(readMethod.getModifiers()) && readMethod.getAnnotation(Derived.class) == null) { // Ignore concrete property methods unless they're derived. continue; } StorableProperty<S> storableProp = makeStorableProperty(errorMessages, property, type, pkPropertyNames, altKeyPropertyNames, parKeyPropertyNames); if (storableProp == null) { // Errors. continue; } if (properties.containsKey(storableProp.getName())) { errorMessages.add("Duplicate property defined: " + storableProp.getName()); continue; } if (readMethod != null) { String sig = createSig(readMethod); if (storableProp.isDerived() || methods.containsKey(sig)) { methods.remove(sig); properties.put(storableProp.getName(), storableProp); } else { continue; } } if (writeMethod != null) { String sig = createSig(writeMethod); if (storableProp.isDerived() || methods.containsKey(sig)) { methods.remove(sig); properties.put(storableProp.getName(), storableProp); } else { continue; } } } // Only include errors on unimplementable methods if there are no other // errors. This prevents producing errors caused by other errors. if (errorMessages.size() == 0) { Iterator<Method> iter = methods.values().iterator(); while (iter.hasNext()) { Method m = iter.next(); int methodModifiers = m.getModifiers(); if (Modifier.isAbstract(methodModifiers)) { String message; if (!Modifier.isPublic(methodModifiers) && !Modifier.isProtected(methodModifiers)) { message = "Abstract method cannot be defined " + "(neither public or protected): "; } else if (!isCovariant(allProperties, m)) { message = "Abstract method cannot be defined (not a bean property): "; } else { message = null; } if (message != null) { errorMessages.add(message + m); } // We've reported an error or validated method. No need to // check it again. iter.remove(); } } } // Verify at most one version property exists. { boolean hasVersionProp = false; for (StorableProperty property : properties.values()) { if (property.isVersion()) { if (hasVersionProp) { errorMessages.add ("At most one property may be designated as the version number"); break; } hasVersionProp = true; } } } // Only include errors on unimplementable methods if there are no other // errors. This prevents producing errors caused by other errors. if (errorMessages.size() == 0 && methods.size() > 0) { for (Method m : methods.values()) { errorMessages.add("Method cannot be implemented: " + m); } } if (errorMessages.size() > 0) { throw new MalformedTypeException(type, errorMessages); } return Collections.unmodifiableMap(properties); }
class class_name[name] begin[{] method[examineProperties, return_type[type[Map]], modifier[private static], parameter[type, primaryKeyProps, alternateKeyProps, partitionKeyProps]] begin[{] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Storable, sub_type=None))] begin[{] if[binary_operation[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Storable, sub_type=None)), ==, member[.type]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Storable interface must be extended")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MalformedTypeException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Does not implement Storable interface")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MalformedTypeException, sub_type=None)), label=None) end[}] local_variable[type[int], modifiers] if[call[Modifier.isFinal, parameter[member[.modifiers]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Class is declared final")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MalformedTypeException, sub_type=None)), label=None) else begin[{] None end[}] if[call[Modifier.isPublic, parameter[member[.modifiers]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Class is not public")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MalformedTypeException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[List], errorMessages] call[.checkTypeParameter, parameter[member[.errorMessages], member[.type]]] if[call[type.isInterface, parameter[]]] begin[{] local_variable[type[Constructor], ctors] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPublic, postfix_operators=[], prefix_operators=['!'], qualifier=Modifier, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isProtected, postfix_operators=[], prefix_operators=['!'], qualifier=Modifier, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot call constructor: "), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=add, postfix_operators=[], prefix_operators=[], qualifier=errorMessages, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=findCtor, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=ctors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Constructor, sub_type=None))), label=None) if[binary_operation[call[type.getEnclosingClass, parameter[]], ==, literal[null]]] begin[{] call[errorMessages.add, parameter[binary_operation[literal["Class must have a public or protected constructor "], +, literal["that accepts no arguments"]]]] else begin[{] call[errorMessages.add, parameter[binary_operation[literal["Inner class must have a public or protected constructor "], +, literal["that accepts no arguments"]]]] end[}] else begin[{] None end[}] local_variable[type[Map], methods] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=isAbstract, postfix_operators=[], prefix_operators=['!'], qualifier=Modifier, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDeclaringClass, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Storable, sub_type=None)), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), Cast(expression=MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=Class, sub_type=None))], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Storable, sub_type=None)), name=m2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getReturnType, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getReturnType, postfix_operators=[], prefix_operators=[], qualifier=m2, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="copy")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getReturnType, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=methods, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) local_variable[type[Set], pkPropertyNames] assign[member[.pkPropertyNames], 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=HashSet, sub_type=None))] assign[member[.altKeyPropertyNames], 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=HashSet, sub_type=None))] assign[member[.parKeyPropertyNames], 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=HashSet, sub_type=None))] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=nameAndDir, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=pkPropertyNames, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=primaryKeyProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=nameAndDir)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NameAndDirection, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=nameAndDir, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=altKeyPropertyNames, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=nameAndDir)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NameAndDirection, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=alternateKeyProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=list)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NameAndDirection, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) if[binary_operation[member[.partitionKeyProps], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=nameAndDir, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=parKeyPropertyNames, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=partitionKeyProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=nameAndDir)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NameAndDirection, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[Map], allProperties] local_variable[type[Map], properties] local_variable[type[Iterator], it] while[call[it.hasNext, parameter[]]] begin[{] local_variable[type[BeanProperty], property] local_variable[type[Method], readMethod] local_variable[type[Method], writeMethod] if[binary_operation[member[.readMethod], ==, literal[null]]] begin[{] if[binary_operation[member[.writeMethod], ==, literal[null]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] if[binary_operation[call[Modifier.isAbstract, parameter[call[writeMethod.getModifiers, parameter[]]]], &&, binary_operation[call[writeMethod.getAnnotation, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Derived, sub_type=None))]], ==, literal[null]]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] end[}] else begin[{] if[binary_operation[call[Modifier.isAbstract, parameter[call[readMethod.getModifiers, parameter[]]]], &&, binary_operation[call[readMethod.getAnnotation, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Derived, sub_type=None))]], ==, literal[null]]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] end[}] local_variable[type[StorableProperty], storableProp] if[binary_operation[member[.storableProp], ==, literal[null]]] begin[{] ContinueStatement(goto=None, label=None) else begin[{] None end[}] if[call[properties.containsKey, parameter[call[storableProp.getName, parameter[]]]]] begin[{] call[errorMessages.add, parameter[binary_operation[literal["Duplicate property defined: "], +, call[storableProp.getName, parameter[]]]]] ContinueStatement(goto=None, label=None) else begin[{] None end[}] if[binary_operation[member[.readMethod], !=, literal[null]]] begin[{] local_variable[type[String], sig] if[binary_operation[call[storableProp.isDerived, parameter[]], ||, call[methods.containsKey, parameter[member[.sig]]]]] begin[{] call[methods.remove, parameter[member[.sig]]] call[properties.put, parameter[call[storableProp.getName, parameter[]], member[.storableProp]]] else begin[{] ContinueStatement(goto=None, label=None) end[}] else begin[{] None end[}] if[binary_operation[member[.writeMethod], !=, literal[null]]] begin[{] local_variable[type[String], sig] if[binary_operation[call[storableProp.isDerived, parameter[]], ||, call[methods.containsKey, parameter[member[.sig]]]]] begin[{] call[methods.remove, parameter[member[.sig]]] call[properties.put, parameter[call[storableProp.getName, parameter[]], member[.storableProp]]] else begin[{] ContinueStatement(goto=None, label=None) end[}] else begin[{] None end[}] end[}] if[binary_operation[call[errorMessages.size, parameter[]], ==, literal[0]]] begin[{] local_variable[type[Iterator], iter] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[Method], m] local_variable[type[int], methodModifiers] if[call[Modifier.isAbstract, parameter[member[.methodModifiers]]]] begin[{] local_variable[type[String], message] if[binary_operation[call[Modifier.isPublic, parameter[member[.methodModifiers]]], &&, call[Modifier.isProtected, parameter[member[.methodModifiers]]]]] begin[{] assign[member[.message], binary_operation[literal["Abstract method cannot be defined "], +, literal["(neither public or protected): "]]] else begin[{] if[call[.isCovariant, parameter[member[.allProperties], member[.m]]]] begin[{] assign[member[.message], literal["Abstract method cannot be defined (not a bean property): "]] else begin[{] assign[member[.message], literal[null]] end[}] end[}] if[binary_operation[member[.message], !=, literal[null]]] begin[{] call[errorMessages.add, parameter[binary_operation[member[.message], +, member[.m]]]] else begin[{] None end[}] call[iter.remove, parameter[]] else begin[{] None end[}] end[}] else begin[{] None end[}] local_variable[type[boolean], hasVersionProp] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isVersion, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=hasVersionProp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="At most one property may be designated as the version number")], member=add, postfix_operators=[], prefix_operators=[], qualifier=errorMessages, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasVersionProp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=property)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StorableProperty, sub_type=None))), label=None) if[binary_operation[binary_operation[call[errorMessages.size, parameter[]], ==, literal[0]], &&, binary_operation[call[methods.size, parameter[]], >, literal[0]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Method cannot be implemented: "), operandr=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=add, postfix_operators=[], prefix_operators=[], qualifier=errorMessages, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=methods, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None) else begin[{] None end[}] if[binary_operation[call[errorMessages.size, parameter[]], >, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=errorMessages, 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=MalformedTypeException, sub_type=None)), label=None) else begin[{] None end[}] return[call[Collections.unmodifiableMap, parameter[member[.properties]]]] end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[S] Keyword[extends] identifier[Storable] operator[>] identifier[Map] operator[<] identifier[String] , identifier[StorableProperty] operator[<] identifier[S] operator[>] operator[>] identifier[examineProperties] operator[SEP] identifier[Class] operator[<] identifier[S] operator[>] identifier[type] , identifier[List] operator[<] identifier[NameAndDirection] operator[>] identifier[primaryKeyProps] , identifier[List] operator[<] identifier[List] operator[<] identifier[NameAndDirection] operator[>] operator[>] identifier[alternateKeyProps] , identifier[List] operator[<] identifier[NameAndDirection] operator[>] identifier[partitionKeyProps] operator[SEP] Keyword[throws] identifier[MalformedTypeException] { Keyword[if] operator[SEP] identifier[Storable] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[type] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Storable] operator[SEP] Keyword[class] operator[==] identifier[type] operator[SEP] { Keyword[throw] Keyword[new] identifier[MalformedTypeException] operator[SEP] identifier[type] , literal[String] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[throw] Keyword[new] identifier[MalformedTypeException] operator[SEP] identifier[type] , literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[modifiers] operator[=] identifier[type] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isFinal] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[MalformedTypeException] operator[SEP] identifier[type] , literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[Modifier] operator[SEP] identifier[isPublic] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[MalformedTypeException] operator[SEP] identifier[type] , literal[String] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[errorMessages] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[checkTypeParameter] operator[SEP] identifier[errorMessages] , identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[type] operator[SEP] identifier[isInterface] operator[SEP] operator[SEP] operator[SEP] { identifier[Constructor] operator[SEP] operator[SEP] identifier[ctors] operator[=] identifier[type] operator[SEP] identifier[getDeclaredConstructors] operator[SEP] operator[SEP] operator[SEP] identifier[findCtor] operator[:] { Keyword[for] operator[SEP] identifier[Constructor] identifier[c] operator[:] identifier[ctors] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[modifiers] operator[=] identifier[c] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Modifier] operator[SEP] identifier[isPublic] operator[SEP] identifier[modifiers] operator[SEP] operator[&&] operator[!] identifier[Modifier] operator[SEP] identifier[isProtected] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] { identifier[errorMessages] operator[SEP] identifier[add] operator[SEP] literal[String] operator[+] identifier[c] operator[SEP] operator[SEP] } Keyword[break] identifier[findCtor] operator[SEP] } } Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[getEnclosingClass] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[errorMessages] operator[SEP] identifier[add] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[errorMessages] operator[SEP] identifier[add] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } } } identifier[Map] operator[<] identifier[String] , identifier[Method] operator[>] identifier[methods] operator[=] identifier[gatherAllDeclaredMethods] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[Method] operator[>] identifier[it] operator[=] identifier[methods] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Method] identifier[m] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[m] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[m] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[==] identifier[Storable] operator[SEP] Keyword[class] operator[SEP] { identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[try] { identifier[Method] identifier[m2] operator[=] identifier[Storable] operator[SEP] Keyword[class] operator[SEP] identifier[getMethod] operator[SEP] identifier[m] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , operator[SEP] identifier[Class] operator[SEP] operator[SEP] operator[SEP] identifier[m] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[==] identifier[m2] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] { identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[type] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[m] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] { } } identifier[Set] operator[<] identifier[String] operator[>] identifier[pkPropertyNames] , identifier[altKeyPropertyNames] , identifier[parKeyPropertyNames] operator[SEP] { identifier[pkPropertyNames] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[altKeyPropertyNames] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[parKeyPropertyNames] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[NameAndDirection] identifier[nameAndDir] operator[:] identifier[primaryKeyProps] operator[SEP] { identifier[pkPropertyNames] operator[SEP] identifier[add] operator[SEP] identifier[nameAndDir] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[List] operator[<] identifier[NameAndDirection] operator[>] identifier[list] operator[:] identifier[alternateKeyProps] operator[SEP] { Keyword[for] operator[SEP] identifier[NameAndDirection] identifier[nameAndDir] operator[:] identifier[list] operator[SEP] { identifier[altKeyPropertyNames] operator[SEP] identifier[add] operator[SEP] identifier[nameAndDir] operator[SEP] identifier[name] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[partitionKeyProps] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[NameAndDirection] identifier[nameAndDir] operator[:] identifier[partitionKeyProps] operator[SEP] { identifier[parKeyPropertyNames] operator[SEP] identifier[add] operator[SEP] identifier[nameAndDir] operator[SEP] identifier[name] operator[SEP] operator[SEP] } } } identifier[Map] identifier[allProperties] operator[=] identifier[BeanIntrospector] operator[SEP] identifier[getAllProperties] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[StorableProperty] operator[<] identifier[S] operator[>] operator[>] identifier[properties] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[StorableProperty] operator[<] identifier[S] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] identifier[it] operator[=] identifier[allProperties] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[BeanProperty] identifier[property] operator[=] identifier[BeanProperty] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Method] identifier[readMethod] operator[=] identifier[property] operator[SEP] identifier[getReadMethod] operator[SEP] operator[SEP] operator[SEP] identifier[Method] identifier[writeMethod] operator[=] identifier[property] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readMethod] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[writeMethod] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[writeMethod] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[writeMethod] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[Derived] operator[SEP] Keyword[class] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[readMethod] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[readMethod] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[Derived] operator[SEP] Keyword[class] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[StorableProperty] operator[<] identifier[S] operator[>] identifier[storableProp] operator[=] identifier[makeStorableProperty] operator[SEP] identifier[errorMessages] , identifier[property] , identifier[type] , identifier[pkPropertyNames] , identifier[altKeyPropertyNames] , identifier[parKeyPropertyNames] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[storableProp] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[containsKey] operator[SEP] identifier[storableProp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[errorMessages] operator[SEP] identifier[add] operator[SEP] literal[String] operator[+] identifier[storableProp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[readMethod] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[sig] operator[=] identifier[createSig] operator[SEP] identifier[readMethod] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[storableProp] operator[SEP] identifier[isDerived] operator[SEP] operator[SEP] operator[||] identifier[methods] operator[SEP] identifier[containsKey] operator[SEP] identifier[sig] operator[SEP] operator[SEP] { identifier[methods] operator[SEP] identifier[remove] operator[SEP] identifier[sig] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[storableProp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[storableProp] operator[SEP] operator[SEP] } Keyword[else] { Keyword[continue] operator[SEP] } } Keyword[if] operator[SEP] identifier[writeMethod] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[sig] operator[=] identifier[createSig] operator[SEP] identifier[writeMethod] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[storableProp] operator[SEP] identifier[isDerived] operator[SEP] operator[SEP] operator[||] identifier[methods] operator[SEP] identifier[containsKey] operator[SEP] identifier[sig] operator[SEP] operator[SEP] { identifier[methods] operator[SEP] identifier[remove] operator[SEP] identifier[sig] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[storableProp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[storableProp] operator[SEP] operator[SEP] } Keyword[else] { Keyword[continue] operator[SEP] } } } Keyword[if] operator[SEP] identifier[errorMessages] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[Iterator] operator[<] identifier[Method] operator[>] identifier[iter] operator[=] identifier[methods] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Method] identifier[m] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[methodModifiers] operator[=] identifier[m] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[methodModifiers] operator[SEP] operator[SEP] { identifier[String] identifier[message] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Modifier] operator[SEP] identifier[isPublic] operator[SEP] identifier[methodModifiers] operator[SEP] operator[&&] operator[!] identifier[Modifier] operator[SEP] identifier[isProtected] operator[SEP] identifier[methodModifiers] operator[SEP] operator[SEP] { identifier[message] operator[=] literal[String] operator[+] literal[String] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[isCovariant] operator[SEP] identifier[allProperties] , identifier[m] operator[SEP] operator[SEP] { identifier[message] operator[=] literal[String] operator[SEP] } Keyword[else] { identifier[message] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[message] operator[!=] Other[null] operator[SEP] { identifier[errorMessages] operator[SEP] identifier[add] operator[SEP] identifier[message] operator[+] identifier[m] operator[SEP] operator[SEP] } identifier[iter] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } } } { Keyword[boolean] identifier[hasVersionProp] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[StorableProperty] identifier[property] operator[:] identifier[properties] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[property] operator[SEP] identifier[isVersion] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[hasVersionProp] operator[SEP] { identifier[errorMessages] operator[SEP] identifier[add] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[hasVersionProp] operator[=] literal[boolean] operator[SEP] } } } Keyword[if] operator[SEP] identifier[errorMessages] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[&&] identifier[methods] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] identifier[Method] identifier[m] operator[:] identifier[methods] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[errorMessages] operator[SEP] identifier[add] operator[SEP] literal[String] operator[+] identifier[m] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[errorMessages] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[MalformedTypeException] operator[SEP] identifier[type] , identifier[errorMessages] operator[SEP] operator[SEP] } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] identifier[properties] operator[SEP] operator[SEP] }
public static String getDate(Date date, Format format) { DateTimeFormat df; switch (format) { case FULL: df = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_FULL); break; case LONG: df = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_LONG); break; case MEDIUM: df = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_MEDIUM); break; case SHORT: df = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_SHORT); break; default: // can never happen, just to prevent stupid warning return ""; } return df.format(date); }
class class_name[name] begin[{] method[getDate, return_type[type[String]], modifier[public static], parameter[date, format]] begin[{] local_variable[type[DateTimeFormat], df] SwitchStatement(cases=[SwitchStatementCase(case=['FULL'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=DATE_FULL, postfix_operators=[], prefix_operators=[], qualifier=DateTimeFormat.PredefinedFormat, selectors=[])], member=getFormat, postfix_operators=[], prefix_operators=[], qualifier=DateTimeFormat, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['LONG'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=DATE_LONG, postfix_operators=[], prefix_operators=[], qualifier=DateTimeFormat.PredefinedFormat, selectors=[])], member=getFormat, postfix_operators=[], prefix_operators=[], qualifier=DateTimeFormat, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['MEDIUM'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=DATE_MEDIUM, postfix_operators=[], prefix_operators=[], qualifier=DateTimeFormat.PredefinedFormat, selectors=[])], member=getFormat, postfix_operators=[], prefix_operators=[], qualifier=DateTimeFormat, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['SHORT'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=DATE_SHORT, postfix_operators=[], prefix_operators=[], qualifier=DateTimeFormat.PredefinedFormat, selectors=[])], member=getFormat, postfix_operators=[], prefix_operators=[], qualifier=DateTimeFormat, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), label=None)])], expression=MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[call[df.format, parameter[member[.date]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getDate] operator[SEP] identifier[Date] identifier[date] , identifier[Format] identifier[format] operator[SEP] { identifier[DateTimeFormat] identifier[df] operator[SEP] Keyword[switch] operator[SEP] identifier[format] operator[SEP] { Keyword[case] identifier[FULL] operator[:] identifier[df] operator[=] identifier[DateTimeFormat] operator[SEP] identifier[getFormat] operator[SEP] identifier[DateTimeFormat] operator[SEP] identifier[PredefinedFormat] operator[SEP] identifier[DATE_FULL] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[LONG] operator[:] identifier[df] operator[=] identifier[DateTimeFormat] operator[SEP] identifier[getFormat] operator[SEP] identifier[DateTimeFormat] operator[SEP] identifier[PredefinedFormat] operator[SEP] identifier[DATE_LONG] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[MEDIUM] operator[:] identifier[df] operator[=] identifier[DateTimeFormat] operator[SEP] identifier[getFormat] operator[SEP] identifier[DateTimeFormat] operator[SEP] identifier[PredefinedFormat] operator[SEP] identifier[DATE_MEDIUM] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[SHORT] operator[:] identifier[df] operator[=] identifier[DateTimeFormat] operator[SEP] identifier[getFormat] operator[SEP] identifier[DateTimeFormat] operator[SEP] identifier[PredefinedFormat] operator[SEP] identifier[DATE_SHORT] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[return] literal[String] operator[SEP] } Keyword[return] identifier[df] operator[SEP] identifier[format] operator[SEP] identifier[date] operator[SEP] operator[SEP] }
public Reflect create(Class[] types, Object... args) throws ReflectionException { try { return on(clazz.getConstructor(types), accessAll, args); } catch (NoSuchMethodException e) { for (Constructor constructor : getConstructors()) { if (ReflectionUtils.typesMatch(constructor.getParameterTypes(), types)) { return on(constructor, accessAll, args); } } throw new ReflectionException(e); } }
class class_name[name] begin[{] method[create, return_type[type[Reflect]], modifier[public], parameter[types, args]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=types, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), MemberReference(member=accessAll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=on, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[], type_arguments=None), MemberReference(member=types, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=typesMatch, postfix_operators=[], prefix_operators=[], qualifier=ReflectionUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=constructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=accessAll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=on, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getConstructors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=constructor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Constructor, sub_type=None))), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReflectionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Reflect] identifier[create] operator[SEP] identifier[Class] operator[SEP] operator[SEP] identifier[types] , identifier[Object] operator[...] identifier[args] operator[SEP] Keyword[throws] identifier[ReflectionException] { Keyword[try] { Keyword[return] identifier[on] operator[SEP] identifier[clazz] operator[SEP] identifier[getConstructor] operator[SEP] identifier[types] operator[SEP] , identifier[accessAll] , identifier[args] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] { Keyword[for] operator[SEP] identifier[Constructor] identifier[constructor] operator[:] identifier[getConstructors] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ReflectionUtils] operator[SEP] identifier[typesMatch] operator[SEP] identifier[constructor] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] , identifier[types] operator[SEP] operator[SEP] { Keyword[return] identifier[on] operator[SEP] identifier[constructor] , identifier[accessAll] , identifier[args] operator[SEP] operator[SEP] } } Keyword[throw] Keyword[new] identifier[ReflectionException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static TrustingNullnessAnalysis instance(Context context) { TrustingNullnessAnalysis instance = context.get(TRUSTING_NULLNESS_KEY); if (instance == null) { instance = new TrustingNullnessAnalysis(); context.put(TRUSTING_NULLNESS_KEY, instance); } return instance; }
class class_name[name] begin[{] method[instance, return_type[type[TrustingNullnessAnalysis]], modifier[public static], parameter[context]] begin[{] local_variable[type[TrustingNullnessAnalysis], instance] if[binary_operation[member[.instance], ==, literal[null]]] begin[{] assign[member[.instance], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TrustingNullnessAnalysis, sub_type=None))] call[context.put, parameter[member[.TRUSTING_NULLNESS_KEY], member[.instance]]] else begin[{] None end[}] return[member[.instance]] end[}] END[}]
Keyword[public] Keyword[static] identifier[TrustingNullnessAnalysis] identifier[instance] operator[SEP] identifier[Context] identifier[context] operator[SEP] { identifier[TrustingNullnessAnalysis] identifier[instance] operator[=] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[TRUSTING_NULLNESS_KEY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[instance] operator[==] Other[null] operator[SEP] { identifier[instance] operator[=] Keyword[new] identifier[TrustingNullnessAnalysis] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[put] operator[SEP] identifier[TRUSTING_NULLNESS_KEY] , identifier[instance] operator[SEP] operator[SEP] } Keyword[return] identifier[instance] operator[SEP] }
public void hmget(final String key, final String... fields) { final byte[][] bfields = new byte[fields.length][]; for (int i = 0; i < bfields.length; i++) { bfields[i] = SafeEncoder.encode(fields[i]); } hmget(SafeEncoder.encode(key), bfields); }
class class_name[name] begin[{] method[hmget, return_type[void], modifier[public], parameter[key, fields]] begin[{] local_variable[type[byte], bfields] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=SafeEncoder, 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=bfields, 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) call[.hmget, parameter[call[SafeEncoder.encode, parameter[member[.key]]], member[.bfields]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[hmget] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] identifier[String] operator[...] identifier[fields] operator[SEP] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bfields] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[fields] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[bfields] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[bfields] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[SafeEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[fields] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } identifier[hmget] operator[SEP] identifier[SafeEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[key] operator[SEP] , identifier[bfields] operator[SEP] operator[SEP] }
private static CommunicationHandler newHandlerPreference(String handlerProp, String url, String user, String pass, SSLSocketFactory sslSocketFactory, HostnameVerifier verifier, int initialConnectionTimeout) throws InitializationException { if (handlerProp == null) { throw new NullPointerException(); } if (handlerProp.equals("java")) { return new JavaCommunicationHandler(url, user, pass, sslSocketFactory, verifier, initialConnectionTimeout); } else if (handlerProp.equals("apache")) { try { return new ApacheCoreCommunicationHandler(url, user, pass, sslSocketFactory, verifier, initialConnectionTimeout); } catch (NoClassDefFoundError e) { throw new InitializationException("Could not initialize ApacheCommunicationHandler"); } } else { throw new InitializationException("Invalid " + HANDLER_PROPERTY + " value"); } }
class class_name[name] begin[{] method[newHandlerPreference, return_type[type[CommunicationHandler]], modifier[private static], parameter[handlerProp, url, user, pass, sslSocketFactory, verifier, initialConnectionTimeout]] begin[{] if[binary_operation[member[.handlerProp], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] if[call[handlerProp.equals, parameter[literal["java"]]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sslSocketFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=verifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=initialConnectionTimeout, 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=JavaCommunicationHandler, sub_type=None))] else begin[{] if[call[handlerProp.equals, parameter[literal["apache"]]]] begin[{] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sslSocketFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=verifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=initialConnectionTimeout, 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=ApacheCoreCommunicationHandler, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not initialize ApacheCommunicationHandler")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InitializationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoClassDefFoundError']))], finally_block=None, label=None, resources=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid "), operandr=MemberReference(member=HANDLER_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" value"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InitializationException, sub_type=None)), label=None) end[}] end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[CommunicationHandler] identifier[newHandlerPreference] operator[SEP] identifier[String] identifier[handlerProp] , identifier[String] identifier[url] , identifier[String] identifier[user] , identifier[String] identifier[pass] , identifier[SSLSocketFactory] identifier[sslSocketFactory] , identifier[HostnameVerifier] identifier[verifier] , Keyword[int] identifier[initialConnectionTimeout] operator[SEP] Keyword[throws] identifier[InitializationException] { Keyword[if] operator[SEP] identifier[handlerProp] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[handlerProp] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[JavaCommunicationHandler] operator[SEP] identifier[url] , identifier[user] , identifier[pass] , identifier[sslSocketFactory] , identifier[verifier] , identifier[initialConnectionTimeout] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[handlerProp] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] Keyword[new] identifier[ApacheCoreCommunicationHandler] operator[SEP] identifier[url] , identifier[user] , identifier[pass] , identifier[sslSocketFactory] , identifier[verifier] , identifier[initialConnectionTimeout] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoClassDefFoundError] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[InitializationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[throw] Keyword[new] identifier[InitializationException] operator[SEP] literal[String] operator[+] identifier[HANDLER_PROPERTY] operator[+] literal[String] operator[SEP] operator[SEP] } }
CRC32 fixErasedBlock( FileSystem srcFs, FileStatus srcStat, FileSystem parityFs, Path parityFile, boolean fixSource, long blockSize, long errorOffset, long limit, boolean partial, OutputStream out, StripeInfo si, Context context, boolean skipVerify) throws IOException, InterruptedException { configureBuffers(blockSize); Progressable reporter = context; if (reporter == null) { reporter = RaidUtils.NULL_PROGRESSABLE; } Path srcFile = srcStat.getPath(); LOG.info("Code: " + this.codec.id + " simulation: " + this.codec.simulateBlockFix); if (this.codec.simulateBlockFix) { String oldId = getOldCodeId(srcStat); if (oldId == null) { // Couldn't find old codec for block fixing, throw exception instead throw new IOException("Couldn't find old parity files for " + srcFile + ". Won't reconstruct the block since code " + this.codec.id + " is still under test"); } if (partial) { throw new IOException("Couldn't reconstruct the partial data because " + "old decoders don't support it"); } Decoder decoder = (oldId.equals("xor"))? new XORDecoder(conf): new ReedSolomonDecoder(conf); CRC32 newCRC = null; long newLen = 0; if (!skipVerify) { newCRC = new CRC32(); newLen = this.fixErasedBlockImpl(srcFs, srcFile, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, null, context, newCRC, null, false, null); } CRC32 oldCRC = (skipVerify && checksumStore == null)? null: new CRC32(); long oldLen = decoder.fixErasedBlockImpl(srcFs, srcFile, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, out, context, oldCRC, si, false, null); if (!skipVerify) { if (newCRC.getValue() != oldCRC.getValue() || newLen != oldLen) { LOG.error(" New code " + codec.id + " produces different data from old code " + oldId + " during fixing " + (fixSource ? srcFile.toString() : parityFile.toString()) + " (offset=" + errorOffset + ", limit=" + limit + ")" + " checksum:" + newCRC.getValue() + ", " + oldCRC.getValue() + " len:" + newLen + ", " + oldLen); LogUtils.logRaidReconstructionMetrics(LOGRESULTS.FAILURE, 0, codec, -1, -1, -1, numReadBytes, numReadBytesRemoteRack, (fixSource ? srcFile : parityFile), errorOffset, LOGTYPES.OFFLINE_RECONSTRUCTION_SIMULATION, (fixSource ? srcFs : parityFs), null, context, -1); if (context != null) { context.getCounter(RaidCounter.BLOCK_FIX_SIMULATION_FAILED).increment(1L); // The key includes the file path and simulation failure state String outkey = DistBlockIntegrityMonitor.SIMULATION_FAILED_FILE + ","; if (fixSource) { outkey += srcFile.toUri().getPath(); } else { outkey += parityFile.toUri().getPath(); } // The value is the task id String outval = context.getConfiguration().get("mapred.task.id"); context.write(new Text(outkey), new Text(outval)); } } else { LOG.info(" New code " + codec.id + " produces the same data with old code " + oldId + " during fixing " + (fixSource ? srcFile.toString() : parityFile.toString()) + " (offset=" + errorOffset + ", limit=" + limit + ")" ); if (context != null) { context.getCounter(RaidCounter.BLOCK_FIX_SIMULATION_SUCCEEDED).increment(1L); } } } return oldCRC; } else { CRC32 crc = null; if (checksumStore != null) { crc = new CRC32(); } fixErasedBlockImpl(srcFs, srcFile, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, out, context, crc, si, false, null); return crc; } }
class class_name[name] begin[{] method[fixErasedBlock, return_type[type[CRC32]], modifier[default], parameter[srcFs, srcStat, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, out, si, context, skipVerify]] begin[{] call[.configureBuffers, parameter[member[.blockSize]]] local_variable[type[Progressable], reporter] if[binary_operation[member[.reporter], ==, literal[null]]] begin[{] assign[member[.reporter], member[RaidUtils.NULL_PROGRESSABLE]] else begin[{] None end[}] local_variable[type[Path], srcFile] call[LOG.info, parameter[binary_operation[binary_operation[binary_operation[literal["Code: "], +, THIS[member[None.codec]member[None.id]]], +, literal[" simulation: "]], +, THIS[member[None.codec]member[None.simulateBlockFix]]]]] if[THIS[member[None.codec]member[None.simulateBlockFix]]] begin[{] local_variable[type[String], oldId] if[binary_operation[member[.oldId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't find old parity files for "), operandr=MemberReference(member=srcFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Won't reconstruct the block since code "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=codec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is still under test"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] if[member[.partial]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't reconstruct the partial data because "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="old decoders don't support it"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Decoder], decoder] local_variable[type[CRC32], newCRC] local_variable[type[long], newLen] if[member[.skipVerify]] begin[{] assign[member[.newCRC], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CRC32, sub_type=None))] assign[member[.newLen], THIS[call[None.fixErasedBlockImpl, parameter[member[.srcFs], member[.srcFile], member[.parityFs], member[.parityFile], member[.fixSource], member[.blockSize], member[.errorOffset], member[.limit], member[.partial], literal[null], member[.context], member[.newCRC], literal[null], literal[false], literal[null]]]]] else begin[{] None end[}] local_variable[type[CRC32], oldCRC] local_variable[type[long], oldLen] if[member[.skipVerify]] begin[{] if[binary_operation[binary_operation[call[newCRC.getValue, parameter[]], !=, call[oldCRC.getValue, parameter[]]], ||, binary_operation[member[.newLen], !=, member[.oldLen]]]] begin[{] call[LOG.error, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal[" New code "], +, member[codec.id]], +, literal[" produces different data from old code "]], +, member[.oldId]], +, literal[" during fixing "]], +, TernaryExpression(condition=MemberReference(member=fixSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=parityFile, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=srcFile, selectors=[], type_arguments=None))], +, literal[" (offset="]], +, member[.errorOffset]], +, literal[", limit="]], +, member[.limit]], +, literal[")"]], +, literal[" checksum:"]], +, call[newCRC.getValue, parameter[]]], +, literal[", "]], +, call[oldCRC.getValue, parameter[]]], +, literal[" len:"]], +, member[.newLen]], +, literal[", "]], +, member[.oldLen]]]] call[LogUtils.logRaidReconstructionMetrics, parameter[member[LOGRESULTS.FAILURE], literal[0], member[.codec], literal[1], literal[1], literal[1], member[.numReadBytes], member[.numReadBytesRemoteRack], TernaryExpression(condition=MemberReference(member=fixSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=parityFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=srcFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), member[.errorOffset], member[LOGTYPES.OFFLINE_RECONSTRUCTION_SIMULATION], TernaryExpression(condition=MemberReference(member=fixSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=parityFs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=srcFs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), literal[null], member[.context], literal[1]]] if[binary_operation[member[.context], !=, literal[null]]] begin[{] call[context.getCounter, parameter[member[RaidCounter.BLOCK_FIX_SIMULATION_FAILED]]] local_variable[type[String], outkey] if[member[.fixSource]] begin[{] assign[member[.outkey], call[srcFile.toUri, parameter[]]] else begin[{] assign[member[.outkey], call[parityFile.toUri, parameter[]]] end[}] local_variable[type[String], outval] call[context.write, parameter[ClassCreator(arguments=[MemberReference(member=outkey, 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=Text, sub_type=None)), ClassCreator(arguments=[MemberReference(member=outval, 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=Text, sub_type=None))]] else begin[{] None end[}] else begin[{] call[LOG.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal[" New code "], +, member[codec.id]], +, literal[" produces the same data with old code "]], +, member[.oldId]], +, literal[" during fixing "]], +, TernaryExpression(condition=MemberReference(member=fixSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=parityFile, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=srcFile, selectors=[], type_arguments=None))], +, literal[" (offset="]], +, member[.errorOffset]], +, literal[", limit="]], +, member[.limit]], +, literal[")"]]]] if[binary_operation[member[.context], !=, literal[null]]] begin[{] call[context.getCounter, parameter[member[RaidCounter.BLOCK_FIX_SIMULATION_SUCCEEDED]]] else begin[{] None end[}] end[}] else begin[{] None end[}] return[member[.oldCRC]] else begin[{] local_variable[type[CRC32], crc] if[binary_operation[member[.checksumStore], !=, literal[null]]] begin[{] assign[member[.crc], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CRC32, sub_type=None))] else begin[{] None end[}] call[.fixErasedBlockImpl, parameter[member[.srcFs], member[.srcFile], member[.parityFs], member[.parityFile], member[.fixSource], member[.blockSize], member[.errorOffset], member[.limit], member[.partial], member[.out], member[.context], member[.crc], member[.si], literal[false], literal[null]]] return[member[.crc]] end[}] end[}] END[}]
identifier[CRC32] identifier[fixErasedBlock] operator[SEP] identifier[FileSystem] identifier[srcFs] , identifier[FileStatus] identifier[srcStat] , identifier[FileSystem] identifier[parityFs] , identifier[Path] identifier[parityFile] , Keyword[boolean] identifier[fixSource] , Keyword[long] identifier[blockSize] , Keyword[long] identifier[errorOffset] , Keyword[long] identifier[limit] , Keyword[boolean] identifier[partial] , identifier[OutputStream] identifier[out] , identifier[StripeInfo] identifier[si] , identifier[Context] identifier[context] , Keyword[boolean] identifier[skipVerify] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { identifier[configureBuffers] operator[SEP] identifier[blockSize] operator[SEP] operator[SEP] identifier[Progressable] identifier[reporter] operator[=] identifier[context] operator[SEP] Keyword[if] operator[SEP] identifier[reporter] operator[==] Other[null] operator[SEP] { identifier[reporter] operator[=] identifier[RaidUtils] operator[SEP] identifier[NULL_PROGRESSABLE] operator[SEP] } identifier[Path] identifier[srcFile] operator[=] identifier[srcStat] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[codec] operator[SEP] identifier[id] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[codec] operator[SEP] identifier[simulateBlockFix] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[codec] operator[SEP] identifier[simulateBlockFix] operator[SEP] { identifier[String] identifier[oldId] operator[=] identifier[getOldCodeId] operator[SEP] identifier[srcStat] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[srcFile] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[codec] operator[SEP] identifier[id] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[partial] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[Decoder] identifier[decoder] operator[=] operator[SEP] identifier[oldId] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[?] Keyword[new] identifier[XORDecoder] operator[SEP] identifier[conf] operator[SEP] operator[:] Keyword[new] identifier[ReedSolomonDecoder] operator[SEP] identifier[conf] operator[SEP] operator[SEP] identifier[CRC32] identifier[newCRC] operator[=] Other[null] operator[SEP] Keyword[long] identifier[newLen] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[skipVerify] operator[SEP] { identifier[newCRC] operator[=] Keyword[new] identifier[CRC32] operator[SEP] operator[SEP] operator[SEP] identifier[newLen] operator[=] Keyword[this] operator[SEP] identifier[fixErasedBlockImpl] operator[SEP] identifier[srcFs] , identifier[srcFile] , identifier[parityFs] , identifier[parityFile] , identifier[fixSource] , identifier[blockSize] , identifier[errorOffset] , identifier[limit] , identifier[partial] , Other[null] , identifier[context] , identifier[newCRC] , Other[null] , literal[boolean] , Other[null] operator[SEP] operator[SEP] } identifier[CRC32] identifier[oldCRC] operator[=] operator[SEP] identifier[skipVerify] operator[&&] identifier[checksumStore] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] Keyword[new] identifier[CRC32] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[oldLen] operator[=] identifier[decoder] operator[SEP] identifier[fixErasedBlockImpl] operator[SEP] identifier[srcFs] , identifier[srcFile] , identifier[parityFs] , identifier[parityFile] , identifier[fixSource] , identifier[blockSize] , identifier[errorOffset] , identifier[limit] , identifier[partial] , identifier[out] , identifier[context] , identifier[oldCRC] , identifier[si] , literal[boolean] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[skipVerify] operator[SEP] { Keyword[if] operator[SEP] identifier[newCRC] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] identifier[oldCRC] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[||] identifier[newLen] operator[!=] identifier[oldLen] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[codec] operator[SEP] identifier[id] operator[+] literal[String] operator[+] identifier[oldId] operator[+] literal[String] operator[+] operator[SEP] identifier[fixSource] operator[?] identifier[srcFile] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[:] identifier[parityFile] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[errorOffset] operator[+] literal[String] operator[+] identifier[limit] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[newCRC] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[oldCRC] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[newLen] operator[+] literal[String] operator[+] identifier[oldLen] operator[SEP] operator[SEP] identifier[LogUtils] operator[SEP] identifier[logRaidReconstructionMetrics] operator[SEP] identifier[LOGRESULTS] operator[SEP] identifier[FAILURE] , Other[0] , identifier[codec] , operator[-] Other[1] , operator[-] Other[1] , operator[-] Other[1] , identifier[numReadBytes] , identifier[numReadBytesRemoteRack] , operator[SEP] identifier[fixSource] operator[?] identifier[srcFile] operator[:] identifier[parityFile] operator[SEP] , identifier[errorOffset] , identifier[LOGTYPES] operator[SEP] identifier[OFFLINE_RECONSTRUCTION_SIMULATION] , operator[SEP] identifier[fixSource] operator[?] identifier[srcFs] operator[:] identifier[parityFs] operator[SEP] , Other[null] , identifier[context] , operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[!=] Other[null] operator[SEP] { identifier[context] operator[SEP] identifier[getCounter] operator[SEP] identifier[RaidCounter] operator[SEP] identifier[BLOCK_FIX_SIMULATION_FAILED] operator[SEP] operator[SEP] identifier[increment] operator[SEP] Other[1L] operator[SEP] operator[SEP] identifier[String] identifier[outkey] operator[=] identifier[DistBlockIntegrityMonitor] operator[SEP] identifier[SIMULATION_FAILED_FILE] operator[+] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[fixSource] operator[SEP] { identifier[outkey] operator[+=] identifier[srcFile] operator[SEP] identifier[toUri] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[outkey] operator[+=] identifier[parityFile] operator[SEP] identifier[toUri] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[outval] operator[=] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[write] operator[SEP] Keyword[new] identifier[Text] operator[SEP] identifier[outkey] operator[SEP] , Keyword[new] identifier[Text] operator[SEP] identifier[outval] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[codec] operator[SEP] identifier[id] operator[+] literal[String] operator[+] identifier[oldId] operator[+] literal[String] operator[+] operator[SEP] identifier[fixSource] operator[?] identifier[srcFile] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[:] identifier[parityFile] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[errorOffset] operator[+] literal[String] operator[+] identifier[limit] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[!=] Other[null] operator[SEP] { identifier[context] operator[SEP] identifier[getCounter] operator[SEP] identifier[RaidCounter] operator[SEP] identifier[BLOCK_FIX_SIMULATION_SUCCEEDED] operator[SEP] operator[SEP] identifier[increment] operator[SEP] Other[1L] operator[SEP] operator[SEP] } } } Keyword[return] identifier[oldCRC] operator[SEP] } Keyword[else] { identifier[CRC32] identifier[crc] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[checksumStore] operator[!=] Other[null] operator[SEP] { identifier[crc] operator[=] Keyword[new] identifier[CRC32] operator[SEP] operator[SEP] operator[SEP] } identifier[fixErasedBlockImpl] operator[SEP] identifier[srcFs] , identifier[srcFile] , identifier[parityFs] , identifier[parityFile] , identifier[fixSource] , identifier[blockSize] , identifier[errorOffset] , identifier[limit] , identifier[partial] , identifier[out] , identifier[context] , identifier[crc] , identifier[si] , literal[boolean] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[crc] operator[SEP] } }
public static String buildTimeDifference(final Calendar pStartCalendar, final Calendar pEndCalendar) { if (pStartCalendar == null) { return CALENDAR_IS_NULL_ERROR_MESSAGE; } if (pEndCalendar == null) { return CALENDAR_IS_NULL_ERROR_MESSAGE; } if (pEndCalendar.before(pStartCalendar)) { return CALENDAR_CAUSATION_ERROR_MESSAGE; } int dateDiff = pEndCalendar.get(Calendar.DATE) - pStartCalendar.get(Calendar.DATE); int hourDiff = pEndCalendar.get(Calendar.HOUR_OF_DAY) - pStartCalendar.get(Calendar.HOUR_OF_DAY); int minuteDiff = pEndCalendar.get(Calendar.MINUTE) - pStartCalendar.get(Calendar.MINUTE); int secondDiff = pEndCalendar.get(Calendar.SECOND) - pStartCalendar.get(Calendar.SECOND); int milliSecondDiff = pEndCalendar.get(Calendar.MILLISECOND) - pStartCalendar.get(Calendar.MILLISECOND); if (milliSecondDiff < 0) { secondDiff--; milliSecondDiff += 1000; } if (secondDiff < 0) { minuteDiff--; secondDiff += 60; } if (minuteDiff < 0) { hourDiff--; minuteDiff += 60; } while (dateDiff > 0) { dateDiff--; hourDiff += 24; } // Time difference presentation format StringBuilder buffer = new StringBuilder(); if ((hourDiff == 0) && (minuteDiff == 0) && (secondDiff == 0)) { buffer.append(milliSecondDiff); buffer.append("ms"); } else if ((hourDiff == 0) && (minuteDiff == 0)) { buffer.append(secondDiff); buffer.append("s "); buffer.append(milliSecondDiff); buffer.append("ms"); } else if (hourDiff == 0) { buffer.append(minuteDiff); buffer.append("m "); buffer.append(secondDiff); buffer.append(","); buffer.append(milliSecondDiff); buffer.append("s"); } else { buffer.append(hourDiff); buffer.append("h "); buffer.append(minuteDiff); buffer.append("m "); buffer.append(secondDiff); buffer.append(","); buffer.append(milliSecondDiff); buffer.append("s"); } return buffer.toString(); }
class class_name[name] begin[{] method[buildTimeDifference, return_type[type[String]], modifier[public static], parameter[pStartCalendar, pEndCalendar]] begin[{] if[binary_operation[member[.pStartCalendar], ==, literal[null]]] begin[{] return[member[.CALENDAR_IS_NULL_ERROR_MESSAGE]] else begin[{] None end[}] if[binary_operation[member[.pEndCalendar], ==, literal[null]]] begin[{] return[member[.CALENDAR_IS_NULL_ERROR_MESSAGE]] else begin[{] None end[}] if[call[pEndCalendar.before, parameter[member[.pStartCalendar]]]] begin[{] return[member[.CALENDAR_CAUSATION_ERROR_MESSAGE]] else begin[{] None end[}] local_variable[type[int], dateDiff] local_variable[type[int], hourDiff] local_variable[type[int], minuteDiff] local_variable[type[int], secondDiff] local_variable[type[int], milliSecondDiff] if[binary_operation[member[.milliSecondDiff], <, literal[0]]] begin[{] member[.secondDiff] assign[member[.milliSecondDiff], literal[1000]] else begin[{] None end[}] if[binary_operation[member[.secondDiff], <, literal[0]]] begin[{] member[.minuteDiff] assign[member[.secondDiff], literal[60]] else begin[{] None end[}] if[binary_operation[member[.minuteDiff], <, literal[0]]] begin[{] member[.hourDiff] assign[member[.minuteDiff], literal[60]] else begin[{] None end[}] while[binary_operation[member[.dateDiff], >, literal[0]]] begin[{] member[.dateDiff] assign[member[.hourDiff], literal[24]] end[}] local_variable[type[StringBuilder], buffer] if[binary_operation[binary_operation[binary_operation[member[.hourDiff], ==, literal[0]], &&, binary_operation[member[.minuteDiff], ==, literal[0]]], &&, binary_operation[member[.secondDiff], ==, literal[0]]]] begin[{] call[buffer.append, parameter[member[.milliSecondDiff]]] call[buffer.append, parameter[literal["ms"]]] else begin[{] if[binary_operation[binary_operation[member[.hourDiff], ==, literal[0]], &&, binary_operation[member[.minuteDiff], ==, literal[0]]]] begin[{] call[buffer.append, parameter[member[.secondDiff]]] call[buffer.append, parameter[literal["s "]]] call[buffer.append, parameter[member[.milliSecondDiff]]] call[buffer.append, parameter[literal["ms"]]] else begin[{] if[binary_operation[member[.hourDiff], ==, literal[0]]] begin[{] call[buffer.append, parameter[member[.minuteDiff]]] call[buffer.append, parameter[literal["m "]]] call[buffer.append, parameter[member[.secondDiff]]] call[buffer.append, parameter[literal[","]]] call[buffer.append, parameter[member[.milliSecondDiff]]] call[buffer.append, parameter[literal["s"]]] else begin[{] call[buffer.append, parameter[member[.hourDiff]]] call[buffer.append, parameter[literal["h "]]] call[buffer.append, parameter[member[.minuteDiff]]] call[buffer.append, parameter[literal["m "]]] call[buffer.append, parameter[member[.secondDiff]]] call[buffer.append, parameter[literal[","]]] call[buffer.append, parameter[member[.milliSecondDiff]]] call[buffer.append, parameter[literal["s"]]] end[}] end[}] end[}] return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[buildTimeDifference] operator[SEP] Keyword[final] identifier[Calendar] identifier[pStartCalendar] , Keyword[final] identifier[Calendar] identifier[pEndCalendar] operator[SEP] { Keyword[if] operator[SEP] identifier[pStartCalendar] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[CALENDAR_IS_NULL_ERROR_MESSAGE] operator[SEP] } Keyword[if] operator[SEP] identifier[pEndCalendar] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[CALENDAR_IS_NULL_ERROR_MESSAGE] operator[SEP] } Keyword[if] operator[SEP] identifier[pEndCalendar] operator[SEP] identifier[before] operator[SEP] identifier[pStartCalendar] operator[SEP] operator[SEP] { Keyword[return] identifier[CALENDAR_CAUSATION_ERROR_MESSAGE] operator[SEP] } Keyword[int] identifier[dateDiff] operator[=] identifier[pEndCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DATE] operator[SEP] operator[-] identifier[pStartCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DATE] operator[SEP] operator[SEP] Keyword[int] identifier[hourDiff] operator[=] identifier[pEndCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR_OF_DAY] operator[SEP] operator[-] identifier[pStartCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR_OF_DAY] operator[SEP] operator[SEP] Keyword[int] identifier[minuteDiff] operator[=] identifier[pEndCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[MINUTE] operator[SEP] operator[-] identifier[pStartCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[MINUTE] operator[SEP] operator[SEP] Keyword[int] identifier[secondDiff] operator[=] identifier[pEndCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[SECOND] operator[SEP] operator[-] identifier[pStartCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[SECOND] operator[SEP] operator[SEP] Keyword[int] identifier[milliSecondDiff] operator[=] identifier[pEndCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[MILLISECOND] operator[SEP] operator[-] identifier[pStartCalendar] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[MILLISECOND] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[milliSecondDiff] operator[<] Other[0] operator[SEP] { identifier[secondDiff] operator[--] operator[SEP] identifier[milliSecondDiff] operator[+=] Other[1000] operator[SEP] } Keyword[if] operator[SEP] identifier[secondDiff] operator[<] Other[0] operator[SEP] { identifier[minuteDiff] operator[--] operator[SEP] identifier[secondDiff] operator[+=] Other[60] operator[SEP] } Keyword[if] operator[SEP] identifier[minuteDiff] operator[<] Other[0] operator[SEP] { identifier[hourDiff] operator[--] operator[SEP] identifier[minuteDiff] operator[+=] Other[60] operator[SEP] } Keyword[while] operator[SEP] identifier[dateDiff] operator[>] Other[0] operator[SEP] { identifier[dateDiff] operator[--] operator[SEP] identifier[hourDiff] operator[+=] Other[24] operator[SEP] } identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[hourDiff] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[minuteDiff] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[secondDiff] operator[==] Other[0] operator[SEP] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[milliSecondDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[hourDiff] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[minuteDiff] operator[==] Other[0] operator[SEP] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[secondDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[milliSecondDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[hourDiff] operator[==] Other[0] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[minuteDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[secondDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[milliSecondDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[hourDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[minuteDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[secondDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[milliSecondDiff] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static NbtAddress[] getAllByAddress( String host, int type, String scope ) throws UnknownHostException { return getAllByAddress( getByName( host, type, scope )); }
class class_name[name] begin[{] method[getAllByAddress, return_type[type[NbtAddress]], modifier[public static], parameter[host, type, scope]] begin[{] return[call[.getAllByAddress, parameter[call[.getByName, parameter[member[.host], member[.type], member[.scope]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[NbtAddress] operator[SEP] operator[SEP] identifier[getAllByAddress] operator[SEP] identifier[String] identifier[host] , Keyword[int] identifier[type] , identifier[String] identifier[scope] operator[SEP] Keyword[throws] identifier[UnknownHostException] { Keyword[return] identifier[getAllByAddress] operator[SEP] identifier[getByName] operator[SEP] identifier[host] , identifier[type] , identifier[scope] operator[SEP] operator[SEP] operator[SEP] }
public DescribeConfigurationRecorderStatusResult withConfigurationRecordersStatus(ConfigurationRecorderStatus... configurationRecordersStatus) { if (this.configurationRecordersStatus == null) { setConfigurationRecordersStatus(new com.amazonaws.internal.SdkInternalList<ConfigurationRecorderStatus>(configurationRecordersStatus.length)); } for (ConfigurationRecorderStatus ele : configurationRecordersStatus) { this.configurationRecordersStatus.add(ele); } return this; }
class class_name[name] begin[{] method[withConfigurationRecordersStatus, return_type[type[DescribeConfigurationRecorderStatusResult]], modifier[public], parameter[configurationRecordersStatus]] begin[{] if[binary_operation[THIS[member[None.configurationRecordersStatus]], ==, literal[null]]] begin[{] call[.setConfigurationRecordersStatus, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=configurationRecordersStatus, 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=ConfigurationRecorderStatus, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=configurationRecordersStatus, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=configurationRecordersStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationRecorderStatus, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DescribeConfigurationRecorderStatusResult] identifier[withConfigurationRecordersStatus] operator[SEP] identifier[ConfigurationRecorderStatus] operator[...] identifier[configurationRecordersStatus] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[configurationRecordersStatus] operator[==] Other[null] operator[SEP] { identifier[setConfigurationRecordersStatus] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ConfigurationRecorderStatus] operator[>] operator[SEP] identifier[configurationRecordersStatus] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ConfigurationRecorderStatus] identifier[ele] operator[:] identifier[configurationRecordersStatus] operator[SEP] { Keyword[this] operator[SEP] identifier[configurationRecordersStatus] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public String decrypt(String encrypted) throws Exception { byte[] decodedValue = Base64Coder.decode(encrypted.toCharArray()); Cipher c = getCipher(Cipher.DECRYPT_MODE); byte[] decValue = c.doFinal(decodedValue); return new String(decValue); }
class class_name[name] begin[{] method[decrypt, return_type[type[String]], modifier[public], parameter[encrypted]] begin[{] local_variable[type[byte], decodedValue] local_variable[type[Cipher], c] local_variable[type[byte], decValue] return[ClassCreator(arguments=[MemberReference(member=decValue, 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] identifier[String] identifier[decrypt] operator[SEP] identifier[String] identifier[encrypted] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[byte] operator[SEP] operator[SEP] identifier[decodedValue] operator[=] identifier[Base64Coder] operator[SEP] identifier[decode] operator[SEP] identifier[encrypted] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Cipher] identifier[c] operator[=] identifier[getCipher] operator[SEP] identifier[Cipher] operator[SEP] identifier[DECRYPT_MODE] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[decValue] operator[=] identifier[c] operator[SEP] identifier[doFinal] operator[SEP] identifier[decodedValue] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[decValue] operator[SEP] operator[SEP] }
public static Vector<Object> toXmlRpcRunnersParameters(Collection<Runner> runners) { Vector<Object> runnersParams = new Vector<Object>(); for(Runner runner : runners) { runnersParams.add(runner.marshallize()); } return runnersParams; }
class class_name[name] begin[{] method[toXmlRpcRunnersParameters, return_type[type[Vector]], modifier[public static], parameter[runners]] begin[{] local_variable[type[Vector], runnersParams] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=marshallize, postfix_operators=[], prefix_operators=[], qualifier=runner, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=runnersParams, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=runners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=runner)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Runner, sub_type=None))), label=None) return[member[.runnersParams]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Vector] operator[<] identifier[Object] operator[>] identifier[toXmlRpcRunnersParameters] operator[SEP] identifier[Collection] operator[<] identifier[Runner] operator[>] identifier[runners] operator[SEP] { identifier[Vector] operator[<] identifier[Object] operator[>] identifier[runnersParams] operator[=] Keyword[new] identifier[Vector] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Runner] identifier[runner] operator[:] identifier[runners] operator[SEP] { identifier[runnersParams] operator[SEP] identifier[add] operator[SEP] identifier[runner] operator[SEP] identifier[marshallize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[runnersParams] operator[SEP] }
@Override public CommerceNotificationTemplate findByUUID_G(String uuid, long groupId) throws NoSuchNotificationTemplateException { CommerceNotificationTemplate commerceNotificationTemplate = fetchByUUID_G(uuid, groupId); if (commerceNotificationTemplate == null) { StringBundler msg = new StringBundler(6); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("uuid="); msg.append(uuid); msg.append(", groupId="); msg.append(groupId); msg.append("}"); if (_log.isDebugEnabled()) { _log.debug(msg.toString()); } throw new NoSuchNotificationTemplateException(msg.toString()); } return commerceNotificationTemplate; }
class class_name[name] begin[{] method[findByUUID_G, return_type[type[CommerceNotificationTemplate]], modifier[public], parameter[uuid, groupId]] begin[{] local_variable[type[CommerceNotificationTemplate], commerceNotificationTemplate] if[binary_operation[member[.commerceNotificationTemplate], ==, literal[null]]] begin[{] local_variable[type[StringBundler], msg] call[msg.append, parameter[member[._NO_SUCH_ENTITY_WITH_KEY]]] call[msg.append, parameter[literal["uuid="]]] call[msg.append, parameter[member[.uuid]]] call[msg.append, parameter[literal[", groupId="]]] call[msg.append, parameter[member[.groupId]]] call[msg.append, parameter[literal["}"]]] if[call[_log.isDebugEnabled, parameter[]]] begin[{] call[_log.debug, parameter[call[msg.toString, parameter[]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchNotificationTemplateException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.commerceNotificationTemplate]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceNotificationTemplate] identifier[findByUUID_G] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[groupId] operator[SEP] Keyword[throws] identifier[NoSuchNotificationTemplateException] { identifier[CommerceNotificationTemplate] identifier[commerceNotificationTemplate] operator[=] identifier[fetchByUUID_G] operator[SEP] identifier[uuid] , identifier[groupId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceNotificationTemplate] operator[==] Other[null] operator[SEP] { identifier[StringBundler] identifier[msg] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[6] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_KEY] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[groupId] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] 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] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[NoSuchNotificationTemplateException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[commerceNotificationTemplate] operator[SEP] }
public <T> T doReadEntity(Class<T> cls, Type t, Annotation[] anns) throws ProcessingException, IllegalStateException { return doReadEntity(cls, t, anns, false); }
class class_name[name] begin[{] method[doReadEntity, return_type[type[T]], modifier[public], parameter[cls, t, anns]] begin[{] return[call[.doReadEntity, parameter[member[.cls], member[.t], member[.anns], literal[false]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[doReadEntity] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[cls] , identifier[Type] identifier[t] , identifier[Annotation] operator[SEP] operator[SEP] identifier[anns] operator[SEP] Keyword[throws] identifier[ProcessingException] , identifier[IllegalStateException] { Keyword[return] identifier[doReadEntity] operator[SEP] identifier[cls] , identifier[t] , identifier[anns] , literal[boolean] operator[SEP] operator[SEP] }
public MultimapJoiner useForNull(final String nullText) { return new MultimapJoiner(entryJoiner.useForNull(nullText), separator, keyValueSeparator) { @Override protected CharSequence toString(Object part) { return (part == null) ? nullText : MultimapJoiner.this.toString(part); } @Override public MultimapJoiner useForNull(String nullText) { throw new UnsupportedOperationException("already specified useForNull"); } @Override public MultimapJoiner skipNulls() { throw new UnsupportedOperationException("already specified useForNull"); } }; }
class class_name[name] begin[{] method[useForNull, return_type[type[MultimapJoiner]], modifier[public], parameter[nullText]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=nullText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=useForNull, postfix_operators=[], prefix_operators=[], qualifier=entryJoiner, selectors=[], type_arguments=None), MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keyValueSeparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=part, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=This(postfix_operators=[], prefix_operators=[], qualifier=MultimapJoiner, selectors=[MethodInvocation(arguments=[MemberReference(member=part, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), if_true=MemberReference(member=nullText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], documentation=None, modifiers={'protected'}, name=toString, parameters=[FormalParameter(annotations=[], modifiers=set(), name=part, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=CharSequence, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="already specified useForNull")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=useForNull, parameters=[FormalParameter(annotations=[], modifiers=set(), name=nullText, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=MultimapJoiner, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="already specified useForNull")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=skipNulls, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=MultimapJoiner, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultimapJoiner, sub_type=None))] end[}] END[}]
Keyword[public] identifier[MultimapJoiner] identifier[useForNull] operator[SEP] Keyword[final] identifier[String] identifier[nullText] operator[SEP] { Keyword[return] Keyword[new] identifier[MultimapJoiner] operator[SEP] identifier[entryJoiner] operator[SEP] identifier[useForNull] operator[SEP] identifier[nullText] operator[SEP] , identifier[separator] , identifier[keyValueSeparator] operator[SEP] { annotation[@] identifier[Override] Keyword[protected] identifier[CharSequence] identifier[toString] operator[SEP] identifier[Object] identifier[part] operator[SEP] { Keyword[return] operator[SEP] identifier[part] operator[==] Other[null] operator[SEP] operator[?] identifier[nullText] operator[:] identifier[MultimapJoiner] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] identifier[part] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[MultimapJoiner] identifier[useForNull] operator[SEP] identifier[String] identifier[nullText] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[MultimapJoiner] identifier[skipNulls] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } operator[SEP] }
public void single(EtlEventData data) { Assert.notNull(data); String path = StagePathUtils.getExtractStage(data.getPipelineId(), data.getProcessId()); data.setCurrNid(ArbitrateConfigUtils.getCurrentNid()); // 序列化 byte[] bytes = JsonUtils.marshalToByte(data, SerializerFeature.WriteClassName); try { zookeeper.create(path, bytes, CreateMode.PERSISTENT); } catch (ZkNoNodeException e) { // process节点不存在,出现了rollback/shutdown操作,直接忽略 logger.warn("pipelineId[{}] extract ignore processId[{}] single by data:{}", new Object[] { data.getPipelineId(), data.getProcessId(), data }); } catch (ZkNodeExistsException e) { // process节点已存在,出现了ConnectionLoss retry操作 logger.warn("pipelineId[{}] extract ignore processId[{}] single by data:{}", new Object[] { data.getPipelineId(), data.getProcessId(), data }); } catch (ZkInterruptedException e) { // ignore } catch (ZkException e) { throw new ArbitrateException("Extract_single", e.getMessage(), e); } }
class class_name[name] begin[{] method[single, return_type[void], modifier[public], parameter[data]] begin[{] call[Assert.notNull, parameter[member[.data]]] local_variable[type[String], path] call[data.setCurrNid, parameter[call[ArbitrateConfigUtils.getCurrentNid, parameter[]]]] local_variable[type[byte], bytes] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PERSISTENT, postfix_operators=[], prefix_operators=[], qualifier=CreateMode, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=zookeeper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipelineId[{}] extract ignore processId[{}] single by data:{}"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getPipelineId, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getProcessId, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], 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=['ZkNoNodeException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipelineId[{}] extract ignore processId[{}] single by data:{}"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getPipelineId, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getProcessId, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], 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=['ZkNodeExistsException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ZkInterruptedException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Extract_single"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArbitrateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ZkException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[single] operator[SEP] identifier[EtlEventData] identifier[data] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[String] identifier[path] operator[=] identifier[StagePathUtils] operator[SEP] identifier[getExtractStage] operator[SEP] identifier[data] operator[SEP] identifier[getPipelineId] operator[SEP] operator[SEP] , identifier[data] operator[SEP] identifier[getProcessId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[setCurrNid] operator[SEP] identifier[ArbitrateConfigUtils] operator[SEP] identifier[getCurrentNid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] identifier[JsonUtils] operator[SEP] identifier[marshalToByte] operator[SEP] identifier[data] , identifier[SerializerFeature] operator[SEP] identifier[WriteClassName] operator[SEP] operator[SEP] Keyword[try] { identifier[zookeeper] operator[SEP] identifier[create] operator[SEP] identifier[path] , identifier[bytes] , identifier[CreateMode] operator[SEP] identifier[PERSISTENT] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ZkNoNodeException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[data] operator[SEP] identifier[getPipelineId] operator[SEP] operator[SEP] , identifier[data] operator[SEP] identifier[getProcessId] operator[SEP] operator[SEP] , identifier[data] } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ZkNodeExistsException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[data] operator[SEP] identifier[getPipelineId] operator[SEP] operator[SEP] , identifier[data] operator[SEP] identifier[getProcessId] operator[SEP] operator[SEP] , identifier[data] } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ZkInterruptedException] identifier[e] operator[SEP] { } Keyword[catch] operator[SEP] identifier[ZkException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ArbitrateException] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override protected boolean initiateClient() { for (String host : hosts) { if (host == null) { LOGGER.error("Host Name should not be null."); throw new IllegalArgumentException("Host Name should not be null."); } } cluster = CouchbaseCluster.create(hosts); if (userName != null && password != null) { clusterManager = cluster.clusterManager(userName, password); } else { clusterManager = cluster.clusterManager(); } return true; }
class class_name[name] begin[{] method[initiateClient, return_type[type[boolean]], modifier[protected], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=host, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Host Name should not be null.")], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Host Name should not be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=hosts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=host)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) assign[member[.cluster], call[CouchbaseCluster.create, parameter[member[.hosts]]]] if[binary_operation[binary_operation[member[.userName], !=, literal[null]], &&, binary_operation[member[.password], !=, literal[null]]]] begin[{] assign[member[.clusterManager], call[cluster.clusterManager, parameter[member[.userName], member[.password]]]] else begin[{] assign[member[.clusterManager], call[cluster.clusterManager, parameter[]]] end[}] return[literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[initiateClient] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[host] operator[:] identifier[hosts] operator[SEP] { Keyword[if] operator[SEP] identifier[host] operator[==] Other[null] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[cluster] operator[=] identifier[CouchbaseCluster] operator[SEP] identifier[create] operator[SEP] identifier[hosts] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[userName] operator[!=] Other[null] operator[&&] identifier[password] operator[!=] Other[null] operator[SEP] { identifier[clusterManager] operator[=] identifier[cluster] operator[SEP] identifier[clusterManager] operator[SEP] identifier[userName] , identifier[password] operator[SEP] operator[SEP] } Keyword[else] { identifier[clusterManager] operator[=] identifier[cluster] operator[SEP] identifier[clusterManager] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@Override public final Optional<C> getCredentials(final WebContext context) { init(); final Optional<C> optCredentials = retrieveCredentials(context); // no credentials -> save this authentication has already been tried and failed if (!optCredentials.isPresent()) { context.getSessionStore().set(context, getName() + ATTEMPTED_AUTHENTICATION_SUFFIX, "true"); } else { cleanAttemptedAuthentication(context); } return optCredentials; }
class class_name[name] begin[{] method[getCredentials, return_type[type[Optional]], modifier[final public], parameter[context]] begin[{] call[.init, parameter[]] local_variable[type[Optional], optCredentials] if[call[optCredentials.isPresent, parameter[]]] begin[{] call[context.getSessionStore, parameter[]] else begin[{] call[.cleanAttemptedAuthentication, parameter[member[.context]]] end[}] return[member[.optCredentials]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] identifier[Optional] operator[<] identifier[C] operator[>] identifier[getCredentials] operator[SEP] Keyword[final] identifier[WebContext] identifier[context] operator[SEP] { identifier[init] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Optional] operator[<] identifier[C] operator[>] identifier[optCredentials] operator[=] identifier[retrieveCredentials] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[optCredentials] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { identifier[context] operator[SEP] identifier[getSessionStore] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[context] , identifier[getName] operator[SEP] operator[SEP] operator[+] identifier[ATTEMPTED_AUTHENTICATION_SUFFIX] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[cleanAttemptedAuthentication] operator[SEP] identifier[context] operator[SEP] operator[SEP] } Keyword[return] identifier[optCredentials] operator[SEP] }
@Pure public static <K, V> Map<K, V> operator_minus(Map<K, V> left, final Map<? extends K, ? extends V> right) { return Maps.filterEntries(left, new Predicate<Entry<K, V>>() { @Override public boolean apply(Entry<K, V> input) { final V value = right.get(input.getKey()); if (value == null) { return input.getValue() == null && right.containsKey(input.getKey()); } return !Objects.equal(input.getValue(), value); } }); }
class class_name[name] begin[{] method[operator_minus, return_type[type[Map]], modifier[public static], parameter[left, right]] begin[{] return[call[Maps.filterEntries, parameter[member[.left], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[], type_arguments=None), name=value)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, 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=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[], type_arguments=None), operator=&&), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equal, postfix_operators=[], prefix_operators=['!'], qualifier=Objects, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=input, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=Entry, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=Entry, sub_type=None))], dimensions=None, name=Predicate, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[operator_minus] operator[SEP] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[left] , Keyword[final] identifier[Map] operator[<] operator[?] Keyword[extends] identifier[K] , operator[?] Keyword[extends] identifier[V] operator[>] identifier[right] operator[SEP] { Keyword[return] identifier[Maps] operator[SEP] identifier[filterEntries] operator[SEP] identifier[left] , Keyword[new] identifier[Predicate] operator[<] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[apply] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[input] operator[SEP] { Keyword[final] identifier[V] identifier[value] operator[=] identifier[right] operator[SEP] identifier[get] operator[SEP] identifier[input] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[input] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[==] Other[null] operator[&&] identifier[right] operator[SEP] identifier[containsKey] operator[SEP] identifier[input] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[!] identifier[Objects] operator[SEP] identifier[equal] operator[SEP] identifier[input] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public TransformInner createOrUpdate(String resourceGroupName, String accountName, String transformName, TransformInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).toBlocking().single().body(); }
class class_name[name] begin[{] method[createOrUpdate, return_type[type[TransformInner]], modifier[public], parameter[resourceGroupName, accountName, transformName, parameters]] begin[{] return[call[.createOrUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.accountName], member[.transformName], member[.parameters]]]] end[}] END[}]
Keyword[public] identifier[TransformInner] identifier[createOrUpdate] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[String] identifier[transformName] , identifier[TransformInner] identifier[parameters] operator[SEP] { Keyword[return] identifier[createOrUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , identifier[transformName] , identifier[parameters] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public static String formatDate(final Date value, final String pattern) { return new SimpleDateFormat(pattern, currentLocale()).format(value); }
class class_name[name] begin[{] method[formatDate, return_type[type[String]], modifier[public static], parameter[value, pattern]] begin[{] return[ClassCreator(arguments=[MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=currentLocale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SimpleDateFormat, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[formatDate] operator[SEP] Keyword[final] identifier[Date] identifier[value] , Keyword[final] identifier[String] identifier[pattern] operator[SEP] { Keyword[return] Keyword[new] identifier[SimpleDateFormat] operator[SEP] identifier[pattern] , identifier[currentLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[format] operator[SEP] identifier[value] operator[SEP] operator[SEP] }
public void addReading(AnalyzedToken token) { List<AnalyzedToken> l = new ArrayList<>(Arrays.asList(anTokReadings).subList(0, anTokReadings.length - 1)); if (anTokReadings[anTokReadings.length - 1].getPOSTag() != null) { l.add(anTokReadings[anTokReadings.length - 1]); } token.setWhitespaceBefore(isWhitespaceBefore); l.add(token); anTokReadings = l.toArray(new AnalyzedToken[0]); if (token.getToken().length() > this.token.length()) { //in case a longer token is added this.token = token.getToken(); } anTokReadings[anTokReadings.length - 1].setWhitespaceBefore(isWhitespaceBefore); isParaEnd = hasPosTag(PARAGRAPH_END_TAGNAME); isSentEnd = hasPosTag(SENTENCE_END_TAGNAME); setNoRealPOStag(); hasSameLemmas = areLemmasSame(); }
class class_name[name] begin[{] method[addReading, return_type[void], modifier[public], parameter[token]] begin[{] local_variable[type[List], l] if[binary_operation[member[.anTokReadings], !=, literal[null]]] begin[{] call[l.add, parameter[member[.anTokReadings]]] else begin[{] None end[}] call[token.setWhitespaceBefore, parameter[member[.isWhitespaceBefore]]] call[l.add, parameter[member[.token]]] assign[member[.anTokReadings], call[l.toArray, parameter[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnalyzedToken, sub_type=None))]]] if[binary_operation[call[token.getToken, parameter[]], >, THIS[member[None.token]call[None.length, parameter[]]]]] begin[{] assign[THIS[member[None.token]], call[token.getToken, parameter[]]] else begin[{] None end[}] member[.anTokReadings] assign[member[.isParaEnd], call[.hasPosTag, parameter[member[.PARAGRAPH_END_TAGNAME]]]] assign[member[.isSentEnd], call[.hasPosTag, parameter[member[.SENTENCE_END_TAGNAME]]]] call[.setNoRealPOStag, parameter[]] assign[member[.hasSameLemmas], call[.areLemmasSame, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addReading] operator[SEP] identifier[AnalyzedToken] identifier[token] operator[SEP] { identifier[List] operator[<] identifier[AnalyzedToken] operator[>] identifier[l] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[anTokReadings] operator[SEP] operator[SEP] identifier[subList] operator[SEP] Other[0] , identifier[anTokReadings] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[anTokReadings] operator[SEP] identifier[anTokReadings] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[getPOSTag] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[l] operator[SEP] identifier[add] operator[SEP] identifier[anTokReadings] operator[SEP] identifier[anTokReadings] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } identifier[token] operator[SEP] identifier[setWhitespaceBefore] operator[SEP] identifier[isWhitespaceBefore] operator[SEP] operator[SEP] identifier[l] operator[SEP] identifier[add] operator[SEP] identifier[token] operator[SEP] operator[SEP] identifier[anTokReadings] operator[=] identifier[l] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[AnalyzedToken] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Keyword[this] operator[SEP] identifier[token] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[token] operator[=] identifier[token] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] } identifier[anTokReadings] operator[SEP] identifier[anTokReadings] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[setWhitespaceBefore] operator[SEP] identifier[isWhitespaceBefore] operator[SEP] operator[SEP] identifier[isParaEnd] operator[=] identifier[hasPosTag] operator[SEP] identifier[PARAGRAPH_END_TAGNAME] operator[SEP] operator[SEP] identifier[isSentEnd] operator[=] identifier[hasPosTag] operator[SEP] identifier[SENTENCE_END_TAGNAME] operator[SEP] operator[SEP] identifier[setNoRealPOStag] operator[SEP] operator[SEP] operator[SEP] identifier[hasSameLemmas] operator[=] identifier[areLemmasSame] operator[SEP] operator[SEP] operator[SEP] }
public static Image newImage (AbstractImagePrototype image, String... styles) { return setStyleNames(image.createImage(), styles); }
class class_name[name] begin[{] method[newImage, return_type[type[Image]], modifier[public static], parameter[image, styles]] begin[{] return[call[.setStyleNames, parameter[call[image.createImage, parameter[]], member[.styles]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Image] identifier[newImage] operator[SEP] identifier[AbstractImagePrototype] identifier[image] , identifier[String] operator[...] identifier[styles] operator[SEP] { Keyword[return] identifier[setStyleNames] operator[SEP] identifier[image] operator[SEP] identifier[createImage] operator[SEP] operator[SEP] , identifier[styles] operator[SEP] operator[SEP] }
@BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty, DiagnoseClusterResults> diagnoseClusterAsync( String projectId, String region, String clusterName) { DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder() .setProjectId(projectId) .setRegion(region) .setClusterName(clusterName) .build(); return diagnoseClusterAsync(request); }
class class_name[name] begin[{] method[diagnoseClusterAsync, return_type[type[OperationFuture]], modifier[final public], parameter[projectId, region, clusterName]] begin[{] local_variable[type[DiagnoseClusterRequest], request] return[call[.diagnoseClusterAsync, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[final] identifier[OperationFuture] operator[<] identifier[Empty] , identifier[DiagnoseClusterResults] operator[>] identifier[diagnoseClusterAsync] operator[SEP] identifier[String] identifier[projectId] , identifier[String] identifier[region] , identifier[String] identifier[clusterName] operator[SEP] { identifier[DiagnoseClusterRequest] identifier[request] operator[=] identifier[DiagnoseClusterRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setProjectId] operator[SEP] identifier[projectId] operator[SEP] operator[SEP] identifier[setRegion] operator[SEP] identifier[region] operator[SEP] operator[SEP] identifier[setClusterName] operator[SEP] identifier[clusterName] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[diagnoseClusterAsync] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public final static ExtendedBoolean getExtendedBooleanByName(String name) throws NullPointerException, IllegalArgumentException { if (tc.isDebugEnabled()) SibTr.info(tc, "Name = " + name); if (name == null) { throw new NullPointerException(); } /* Look for the name in the nameSet, and return the corresponding */ /* Reliability from the indexSet. */ for (int i = 0; i <= MAX_INDEX + 1; i++) { if (name.equals(nameSet[i])) { return indexSet[i]; } } /* If the name didn't match, throw IllegalArgumentException */ throw new IllegalArgumentException(); }
class class_name[name] begin[{] method[getExtendedBooleanByName, return_type[type[ExtendedBoolean]], modifier[final public static], parameter[name]] begin[{] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[SibTr.info, parameter[member[.tc], binary_operation[literal["Name = "], +, member[.name]]]] else begin[{] None end[}] if[binary_operation[member[.name], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=nameSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=indexSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=MAX_INDEX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), 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) ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[static] identifier[ExtendedBoolean] identifier[getExtendedBooleanByName] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[NullPointerException] , identifier[IllegalArgumentException] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[info] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<=] identifier[MAX_INDEX] operator[+] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[nameSet] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[indexSet] operator[SEP] identifier[i] operator[SEP] operator[SEP] } } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] }
public static String getName(GuacamoleConfiguration config) throws GuacamoleException { if (config == null) return null; String protocol = config.getProtocol(); String host = config.getParameter("hostname"); String port = config.getParameter("port"); String user = config.getParameter("username"); StringBuilder name = new StringBuilder(); if (protocol != null && !protocol.isEmpty()) name.append(protocol).append("://"); if (user != null && !user.isEmpty()) name.append(user).append("@"); if (host != null && !host.isEmpty()) name.append(host); if (port != null && !port.isEmpty()) name.append(":").append(port); name.append("/"); return name.toString(); }
class class_name[name] begin[{] method[getName, return_type[type[String]], modifier[public static], parameter[config]] begin[{] if[binary_operation[member[.config], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], protocol] local_variable[type[String], host] local_variable[type[String], port] local_variable[type[String], user] local_variable[type[StringBuilder], name] if[binary_operation[binary_operation[member[.protocol], !=, literal[null]], &&, call[protocol.isEmpty, parameter[]]]] begin[{] call[name.append, parameter[member[.protocol]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.user], !=, literal[null]], &&, call[user.isEmpty, parameter[]]]] begin[{] call[name.append, parameter[member[.user]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.host], !=, literal[null]], &&, call[host.isEmpty, parameter[]]]] begin[{] call[name.append, parameter[member[.host]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.port], !=, literal[null]], &&, call[port.isEmpty, parameter[]]]] begin[{] call[name.append, parameter[literal[":"]]] else begin[{] None end[}] call[name.append, parameter[literal["/"]]] return[call[name.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getName] operator[SEP] identifier[GuacamoleConfiguration] identifier[config] operator[SEP] Keyword[throws] identifier[GuacamoleException] { Keyword[if] operator[SEP] identifier[config] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[String] identifier[protocol] operator[=] identifier[config] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[host] operator[=] identifier[config] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[port] operator[=] identifier[config] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[user] operator[=] identifier[config] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[name] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[protocol] operator[!=] Other[null] operator[&&] operator[!] identifier[protocol] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[append] operator[SEP] identifier[protocol] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[!=] Other[null] operator[&&] operator[!] identifier[user] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[append] operator[SEP] identifier[user] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[host] operator[!=] Other[null] operator[&&] operator[!] identifier[host] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[append] operator[SEP] identifier[host] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[port] operator[!=] Other[null] operator[&&] operator[!] identifier[port] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[port] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[name] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public Observable<Page<JobInner>> listByResourceGroupAsync(final String resourceGroupName, final JobsListByResourceGroupOptions jobsListByResourceGroupOptions) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName, jobsListByResourceGroupOptions) .map(new Func1<ServiceResponse<Page<JobInner>>, Page<JobInner>>() { @Override public Page<JobInner> call(ServiceResponse<Page<JobInner>> response) { return response.body(); } }); }
class class_name[name] begin[{] method[listByResourceGroupAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, jobsListByResourceGroupOptions]] begin[{] return[call[.listByResourceGroupWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.jobsListByResourceGroupOptions]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[JobInner] operator[>] operator[>] identifier[listByResourceGroupAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[JobsListByResourceGroupOptions] identifier[jobsListByResourceGroupOptions] operator[SEP] { Keyword[return] identifier[listByResourceGroupWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[jobsListByResourceGroupOptions] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[JobInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[JobInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[JobInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[JobInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
private boolean validateAtlasRelationshipType(AtlasRelationshipType type) { boolean isValid = false; try { validateAtlasRelationshipDef(type.getRelationshipDef()); isValid = true; } catch (AtlasBaseException abe) { LOG.error("Validation error for AtlasRelationshipType", abe); } return isValid; }
class class_name[name] begin[{] method[validateAtlasRelationshipType, return_type[type[boolean]], modifier[private], parameter[type]] begin[{] local_variable[type[boolean], isValid] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRelationshipDef, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None)], member=validateAtlasRelationshipDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isValid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Validation error for AtlasRelationshipType"), MemberReference(member=abe, 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=abe, types=['AtlasBaseException']))], finally_block=None, label=None, resources=None) return[member[.isValid]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[validateAtlasRelationshipType] operator[SEP] identifier[AtlasRelationshipType] identifier[type] operator[SEP] { Keyword[boolean] identifier[isValid] operator[=] literal[boolean] operator[SEP] Keyword[try] { identifier[validateAtlasRelationshipDef] operator[SEP] identifier[type] operator[SEP] identifier[getRelationshipDef] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isValid] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[AtlasBaseException] identifier[abe] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[abe] operator[SEP] operator[SEP] } Keyword[return] identifier[isValid] operator[SEP] }
public char[] retrieveSecuredAttribute(String vaultBlock, String attributeName) throws Exception { return vault.retrieve(vaultBlock, attributeName, null); }
class class_name[name] begin[{] method[retrieveSecuredAttribute, return_type[type[char]], modifier[public], parameter[vaultBlock, attributeName]] begin[{] return[call[vault.retrieve, parameter[member[.vaultBlock], member[.attributeName], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[char] operator[SEP] operator[SEP] identifier[retrieveSecuredAttribute] operator[SEP] identifier[String] identifier[vaultBlock] , identifier[String] identifier[attributeName] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[return] identifier[vault] operator[SEP] identifier[retrieve] operator[SEP] identifier[vaultBlock] , identifier[attributeName] , Other[null] operator[SEP] operator[SEP] }
public JsonObject getJsonObject() { JsonObject obj = new JsonObject(); obj.add("field", this.field); obj.add("value", this.value); return obj; }
class class_name[name] begin[{] method[getJsonObject, return_type[type[JsonObject]], modifier[public], parameter[]] begin[{] local_variable[type[JsonObject], obj] call[obj.add, parameter[literal["field"], THIS[member[None.field]]]] call[obj.add, parameter[literal["value"], THIS[member[None.value]]]] return[member[.obj]] end[}] END[}]
Keyword[public] identifier[JsonObject] identifier[getJsonObject] operator[SEP] operator[SEP] { identifier[JsonObject] identifier[obj] operator[=] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[add] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[field] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[add] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[obj] operator[SEP] }
public void runPipelineWithHashtag() throws Exception { DynoJedisPipeline pipeline = client.pipelined(); try { pipeline.set("pipeline-hashtag1-{bar}", "value-1"); pipeline.set("pipeline-hashtag2-{bar}", "value-2"); pipeline.set("pipeline-hashtag3-{bar}", "value-3"); pipeline.set("pipeline-hashtag4-{bar}", "value-4"); pipeline.set("pipeline-hashtag5-{bar}", "value-5"); pipeline.set("pipeline-hashtag6-{bar}", "value-6"); pipeline.set("pipeline-hashtag7-{bar}", "value-7"); pipeline.set("pipeline-hashtag8-{bar}", "value-8"); pipeline.set("pipeline-hashtag9-{bar}", "value-9"); pipeline.set("pipeline-hashtag10-{bar}", "value-10"); Response<String> value1 = pipeline.get("pipeline-hashtag1-{bar}"); Response<String> value2 = pipeline.get("pipeline-hashtag2-{bar}"); Response<String> value3 = pipeline.get("pipeline-hashtag3-{bar}"); Response<String> value4 = pipeline.get("pipeline-hashtag4-{bar}"); Response<String> value5 = pipeline.get("pipeline-hashtag5-{bar}"); Response<String> value6 = pipeline.get("pipeline-hashtag6-{bar}"); pipeline.sync(); System.out.println(value1.get()); System.out.println(value2.get()); System.out.println(value3.get()); System.out.println(value4.get()); System.out.println(value5.get()); System.out.println(value6.get()); } catch (Exception e) { pipeline.discardPipelineAndReleaseConnection(); throw e; } }
class class_name[name] begin[{] method[runPipelineWithHashtag, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[DynoJedisPipeline], pipeline] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag1-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-1")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag2-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-2")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag3-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-3")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag4-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-4")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag5-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-5")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag6-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-6")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag7-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-7")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag8-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-8")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag9-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-9")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag10-{bar}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value-10")], member=set, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag1-{bar}")], member=get, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), name=value1)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Response, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag2-{bar}")], member=get, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), name=value2)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Response, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag3-{bar}")], member=get, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), name=value3)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Response, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag4-{bar}")], member=get, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), name=value4)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Response, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag5-{bar}")], member=get, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), name=value5)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Response, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pipeline-hashtag6-{bar}")], member=get, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), name=value6)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Response, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=sync, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=value1, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=value2, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=value3, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=value4, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=value5, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=value6, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=discardPipelineAndReleaseConnection, postfix_operators=[], prefix_operators=[], qualifier=pipeline, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[runPipelineWithHashtag] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[DynoJedisPipeline] identifier[pipeline] operator[=] identifier[client] operator[SEP] identifier[pipelined] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Response] operator[<] identifier[String] operator[>] identifier[value1] operator[=] identifier[pipeline] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Response] operator[<] identifier[String] operator[>] identifier[value2] operator[=] identifier[pipeline] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Response] operator[<] identifier[String] operator[>] identifier[value3] operator[=] identifier[pipeline] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Response] operator[<] identifier[String] operator[>] identifier[value4] operator[=] identifier[pipeline] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Response] operator[<] identifier[String] operator[>] identifier[value5] operator[=] identifier[pipeline] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Response] operator[<] identifier[String] operator[>] identifier[value6] operator[=] identifier[pipeline] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[pipeline] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[value1] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[value2] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[value3] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[value4] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[value5] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[value6] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[pipeline] operator[SEP] identifier[discardPipelineAndReleaseConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } }
public static EObject findActualSemanticObjectFor(/* @Nullable */ INode node) { if (node == null) return null; if (node.hasDirectSemanticElement()) return node.getSemanticElement(); EObject grammarElement = node.getGrammarElement(); ICompositeNode parent = node.getParent(); if (grammarElement == null) return findActualSemanticObjectFor(parent); Assignment assignment = GrammarUtil.containingAssignment(grammarElement); if (assignment != null) { if (GrammarUtil.isEObjectFragmentRule(GrammarUtil.containingRule(assignment))) { EObject result = findActualSemanticObjectInChildren(node, grammarElement); if (result != null) return result; } if (parent.hasDirectSemanticElement()) return findActualSemanticObjectFor(parent); INode sibling = parent.getFirstChild(); while(!sibling.equals(node)) { EObject siblingGrammarElement = sibling.getGrammarElement(); if (siblingGrammarElement != null && GrammarUtil.containingAssignment(siblingGrammarElement) == null) { if (GrammarUtil.isEObjectRuleCall(siblingGrammarElement)) { return findActualSemanticObjectFor(sibling); } if (siblingGrammarElement.eClass() == XtextPackage.Literals.ACTION) { return findActualSemanticObjectFor(sibling); } } sibling = sibling.getNextSibling(); } } else if (!GrammarUtil.isEObjectFragmentRuleCall(grammarElement)) { EObject result = findActualSemanticObjectInChildren(node, grammarElement); if (result != null) return result; } return findActualSemanticObjectFor(parent); }
class class_name[name] begin[{] method[findActualSemanticObjectFor, return_type[type[EObject]], modifier[public static], parameter[node]] begin[{] if[binary_operation[member[.node], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[call[node.hasDirectSemanticElement, parameter[]]] begin[{] return[call[node.getSemanticElement, parameter[]]] else begin[{] None end[}] local_variable[type[EObject], grammarElement] local_variable[type[ICompositeNode], parent] if[binary_operation[member[.grammarElement], ==, literal[null]]] begin[{] return[call[.findActualSemanticObjectFor, parameter[member[.parent]]]] else begin[{] None end[}] local_variable[type[Assignment], assignment] if[binary_operation[member[.assignment], !=, literal[null]]] begin[{] if[call[GrammarUtil.isEObjectFragmentRule, parameter[call[GrammarUtil.containingRule, parameter[member[.assignment]]]]]] begin[{] local_variable[type[EObject], result] if[binary_operation[member[.result], !=, literal[null]]] begin[{] return[member[.result]] else begin[{] None end[}] else begin[{] None end[}] if[call[parent.hasDirectSemanticElement, parameter[]]] begin[{] return[call[.findActualSemanticObjectFor, parameter[member[.parent]]]] else begin[{] None end[}] local_variable[type[INode], sibling] while[call[sibling.equals, parameter[member[.node]]]] begin[{] local_variable[type[EObject], siblingGrammarElement] if[binary_operation[binary_operation[member[.siblingGrammarElement], !=, literal[null]], &&, binary_operation[call[GrammarUtil.containingAssignment, parameter[member[.siblingGrammarElement]]], ==, literal[null]]]] begin[{] if[call[GrammarUtil.isEObjectRuleCall, parameter[member[.siblingGrammarElement]]]] begin[{] return[call[.findActualSemanticObjectFor, parameter[member[.sibling]]]] else begin[{] None end[}] if[binary_operation[call[siblingGrammarElement.eClass, parameter[]], ==, member[XtextPackage.Literals.ACTION]]] begin[{] return[call[.findActualSemanticObjectFor, parameter[member[.sibling]]]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.sibling], call[sibling.getNextSibling, parameter[]]] end[}] else begin[{] if[call[GrammarUtil.isEObjectFragmentRuleCall, parameter[member[.grammarElement]]]] begin[{] local_variable[type[EObject], result] if[binary_operation[member[.result], !=, literal[null]]] begin[{] return[member[.result]] else begin[{] None end[}] else begin[{] None end[}] end[}] return[call[.findActualSemanticObjectFor, parameter[member[.parent]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[EObject] identifier[findActualSemanticObjectFor] operator[SEP] identifier[INode] identifier[node] operator[SEP] { Keyword[if] operator[SEP] identifier[node] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[hasDirectSemanticElement] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[node] operator[SEP] identifier[getSemanticElement] operator[SEP] operator[SEP] operator[SEP] identifier[EObject] identifier[grammarElement] operator[=] identifier[node] operator[SEP] identifier[getGrammarElement] operator[SEP] operator[SEP] operator[SEP] identifier[ICompositeNode] identifier[parent] operator[=] identifier[node] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[grammarElement] operator[==] Other[null] operator[SEP] Keyword[return] identifier[findActualSemanticObjectFor] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[Assignment] identifier[assignment] operator[=] identifier[GrammarUtil] operator[SEP] identifier[containingAssignment] operator[SEP] identifier[grammarElement] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[assignment] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[GrammarUtil] operator[SEP] identifier[isEObjectFragmentRule] operator[SEP] identifier[GrammarUtil] operator[SEP] identifier[containingRule] operator[SEP] identifier[assignment] operator[SEP] operator[SEP] operator[SEP] { identifier[EObject] identifier[result] operator[=] identifier[findActualSemanticObjectInChildren] operator[SEP] identifier[node] , identifier[grammarElement] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[result] operator[SEP] } Keyword[if] operator[SEP] identifier[parent] operator[SEP] identifier[hasDirectSemanticElement] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[findActualSemanticObjectFor] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[INode] identifier[sibling] operator[=] identifier[parent] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[sibling] operator[SEP] identifier[equals] operator[SEP] identifier[node] operator[SEP] operator[SEP] { identifier[EObject] identifier[siblingGrammarElement] operator[=] identifier[sibling] operator[SEP] identifier[getGrammarElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[siblingGrammarElement] operator[!=] Other[null] operator[&&] identifier[GrammarUtil] operator[SEP] identifier[containingAssignment] operator[SEP] identifier[siblingGrammarElement] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[GrammarUtil] operator[SEP] identifier[isEObjectRuleCall] operator[SEP] identifier[siblingGrammarElement] operator[SEP] operator[SEP] { Keyword[return] identifier[findActualSemanticObjectFor] operator[SEP] identifier[sibling] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[siblingGrammarElement] operator[SEP] identifier[eClass] operator[SEP] operator[SEP] operator[==] identifier[XtextPackage] operator[SEP] identifier[Literals] operator[SEP] identifier[ACTION] operator[SEP] { Keyword[return] identifier[findActualSemanticObjectFor] operator[SEP] identifier[sibling] operator[SEP] operator[SEP] } } identifier[sibling] operator[=] identifier[sibling] operator[SEP] identifier[getNextSibling] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[GrammarUtil] operator[SEP] identifier[isEObjectFragmentRuleCall] operator[SEP] identifier[grammarElement] operator[SEP] operator[SEP] { identifier[EObject] identifier[result] operator[=] identifier[findActualSemanticObjectInChildren] operator[SEP] identifier[node] , identifier[grammarElement] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[result] operator[SEP] } Keyword[return] identifier[findActualSemanticObjectFor] operator[SEP] identifier[parent] operator[SEP] operator[SEP] }
public void marshall(DescribeContainerRequest describeContainerRequest, ProtocolMarshaller protocolMarshaller) { if (describeContainerRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeContainerRequest.getContainerName(), CONTAINERNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[describeContainerRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeContainerRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getContainerName, postfix_operators=[], prefix_operators=[], qualifier=describeContainerRequest, selectors=[], type_arguments=None), MemberReference(member=CONTAINERNAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DescribeContainerRequest] identifier[describeContainerRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeContainerRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeContainerRequest] operator[SEP] identifier[getContainerName] operator[SEP] operator[SEP] , identifier[CONTAINERNAME_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private static SecretKeySpec keySpecFromSecretKey(String secretKey) { if (!keySpecs.containsKey(secretKey)) { byte[] ivraw = secretKey.getBytes(); SecretKeySpec skeySpec = new SecretKeySpec(ivraw, "AES"); //$NON-NLS-1$ keySpecs.put(secretKey, skeySpec); } return keySpecs.get(secretKey); }
class class_name[name] begin[{] method[keySpecFromSecretKey, return_type[type[SecretKeySpec]], modifier[private static], parameter[secretKey]] begin[{] if[call[keySpecs.containsKey, parameter[member[.secretKey]]]] begin[{] local_variable[type[byte], ivraw] local_variable[type[SecretKeySpec], skeySpec] call[keySpecs.put, parameter[member[.secretKey], member[.skeySpec]]] else begin[{] None end[}] return[call[keySpecs.get, parameter[member[.secretKey]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[SecretKeySpec] identifier[keySpecFromSecretKey] operator[SEP] identifier[String] identifier[secretKey] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[keySpecs] operator[SEP] identifier[containsKey] operator[SEP] identifier[secretKey] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[ivraw] operator[=] identifier[secretKey] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] identifier[SecretKeySpec] identifier[skeySpec] operator[=] Keyword[new] identifier[SecretKeySpec] operator[SEP] identifier[ivraw] , literal[String] operator[SEP] operator[SEP] identifier[keySpecs] operator[SEP] identifier[put] operator[SEP] identifier[secretKey] , identifier[skeySpec] operator[SEP] operator[SEP] } Keyword[return] identifier[keySpecs] operator[SEP] identifier[get] operator[SEP] identifier[secretKey] operator[SEP] operator[SEP] }
private Parser getSyntaxParser(Syntax syntax) throws MacroExecutionException { try { return this.componentManager.getInstance(Parser.class, syntax.toIdString()); } catch (ComponentLookupException e) { throw new MacroExecutionException("Failed to find source parser for syntax [" + syntax + "]", e); } }
class class_name[name] begin[{] method[getSyntaxParser, return_type[type[Parser]], modifier[private], parameter[syntax]] begin[{] TryStatement(block=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=componentManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Parser, sub_type=None)), MethodInvocation(arguments=[], member=toIdString, postfix_operators=[], prefix_operators=[], qualifier=syntax, selectors=[], type_arguments=None)], member=getInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to find source parser for syntax ["), operandr=MemberReference(member=syntax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MacroExecutionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ComponentLookupException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] identifier[Parser] identifier[getSyntaxParser] operator[SEP] identifier[Syntax] identifier[syntax] operator[SEP] Keyword[throws] identifier[MacroExecutionException] { Keyword[try] { Keyword[return] Keyword[this] operator[SEP] identifier[componentManager] operator[SEP] identifier[getInstance] operator[SEP] identifier[Parser] operator[SEP] Keyword[class] , identifier[syntax] operator[SEP] identifier[toIdString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ComponentLookupException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[MacroExecutionException] operator[SEP] literal[String] operator[+] identifier[syntax] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
@Override protected void unserializeFrom(RawDataBuffer in) { super.unserializeFrom(in); byte[] data = in.readByteArray(); error = (JMSException)SerializationTools.fromByteArray(data); }
class class_name[name] begin[{] method[unserializeFrom, return_type[void], modifier[protected], parameter[in]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unserializeFrom, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) local_variable[type[byte], data] assign[member[.error], Cast(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromByteArray, postfix_operators=[], prefix_operators=[], qualifier=SerializationTools, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JMSException, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[unserializeFrom] operator[SEP] identifier[RawDataBuffer] identifier[in] operator[SEP] { Keyword[super] operator[SEP] identifier[unserializeFrom] operator[SEP] identifier[in] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[in] operator[SEP] identifier[readByteArray] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[=] operator[SEP] identifier[JMSException] operator[SEP] identifier[SerializationTools] operator[SEP] identifier[fromByteArray] operator[SEP] identifier[data] operator[SEP] operator[SEP] }
public void billingAccount_rsva_serviceName_PUT(String billingAccount, String serviceName, OvhRsva body) throws IOException { String qPath = "/telephony/{billingAccount}/rsva/{serviceName}"; StringBuilder sb = path(qPath, billingAccount, serviceName); exec(qPath, "PUT", sb.toString(), body); }
class class_name[name] begin[{] method[billingAccount_rsva_serviceName_PUT, return_type[void], modifier[public], parameter[billingAccount, serviceName, body]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.exec, parameter[member[.qPath], literal["PUT"], call[sb.toString, parameter[]], member[.body]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[billingAccount_rsva_serviceName_PUT] operator[SEP] identifier[String] identifier[billingAccount] , identifier[String] identifier[serviceName] , identifier[OvhRsva] identifier[body] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[billingAccount] , identifier[serviceName] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[body] operator[SEP] operator[SEP] }
@Override public GetMergeConflictsResult getMergeConflicts(GetMergeConflictsRequest request) { request = beforeClientExecution(request); return executeGetMergeConflicts(request); }
class class_name[name] begin[{] method[getMergeConflicts, return_type[type[GetMergeConflictsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetMergeConflicts, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetMergeConflictsResult] identifier[getMergeConflicts] operator[SEP] identifier[GetMergeConflictsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetMergeConflicts] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static <K, V, M extends Map<K, V>> void ifExist(M map, Consumer<M> consumer) { getOptional(map).ifPresent(consumer); }
class class_name[name] begin[{] method[ifExist, return_type[void], modifier[public static], parameter[map, consumer]] begin[{] call[.getOptional, parameter[member[.map]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] , identifier[M] Keyword[extends] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] operator[>] Keyword[void] identifier[ifExist] operator[SEP] identifier[M] identifier[map] , identifier[Consumer] operator[<] identifier[M] operator[>] identifier[consumer] operator[SEP] { identifier[getOptional] operator[SEP] identifier[map] operator[SEP] operator[SEP] identifier[ifPresent] operator[SEP] identifier[consumer] operator[SEP] operator[SEP] }
protected ListCellRenderer<? super EnumerationValue> getComboBoxRenderer(final InputColumn<?> inputColumn, final Map<InputColumn<?>, DCComboBox<EnumerationValue>> mappedEnumComboBoxes, final EnumerationValue[] enumConstants) { return new EnumComboBoxListRenderer(); }
class class_name[name] begin[{] method[getComboBoxRenderer, return_type[type[ListCellRenderer]], modifier[protected], parameter[inputColumn, mappedEnumComboBoxes, enumConstants]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EnumComboBoxListRenderer, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[ListCellRenderer] operator[<] operator[?] Keyword[super] identifier[EnumerationValue] operator[>] identifier[getComboBoxRenderer] operator[SEP] Keyword[final] identifier[InputColumn] operator[<] operator[?] operator[>] identifier[inputColumn] , Keyword[final] identifier[Map] operator[<] identifier[InputColumn] operator[<] operator[?] operator[>] , identifier[DCComboBox] operator[<] identifier[EnumerationValue] operator[>] operator[>] identifier[mappedEnumComboBoxes] , Keyword[final] identifier[EnumerationValue] operator[SEP] operator[SEP] identifier[enumConstants] operator[SEP] { Keyword[return] Keyword[new] identifier[EnumComboBoxListRenderer] operator[SEP] operator[SEP] operator[SEP] }
public static AjaxOperation registerComponent(final String targetId, final String triggerId) { AjaxOperation operation = new AjaxOperation(triggerId, targetId); registerAjaxOperation(operation); return operation; }
class class_name[name] begin[{] method[registerComponent, return_type[type[AjaxOperation]], modifier[public static], parameter[targetId, triggerId]] begin[{] local_variable[type[AjaxOperation], operation] call[.registerAjaxOperation, parameter[member[.operation]]] return[member[.operation]] end[}] END[}]
Keyword[public] Keyword[static] identifier[AjaxOperation] identifier[registerComponent] operator[SEP] Keyword[final] identifier[String] identifier[targetId] , Keyword[final] identifier[String] identifier[triggerId] operator[SEP] { identifier[AjaxOperation] identifier[operation] operator[=] Keyword[new] identifier[AjaxOperation] operator[SEP] identifier[triggerId] , identifier[targetId] operator[SEP] operator[SEP] identifier[registerAjaxOperation] operator[SEP] identifier[operation] operator[SEP] operator[SEP] Keyword[return] identifier[operation] operator[SEP] }
public java.util.List<String> getPreferredCacheClusterAZs() { if (preferredCacheClusterAZs == null) { preferredCacheClusterAZs = new com.amazonaws.internal.SdkInternalList<String>(); } return preferredCacheClusterAZs; }
class class_name[name] begin[{] method[getPreferredCacheClusterAZs, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.preferredCacheClusterAZs], ==, literal[null]]] begin[{] assign[member[.preferredCacheClusterAZs], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.preferredCacheClusterAZs]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[getPreferredCacheClusterAZs] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[preferredCacheClusterAZs] operator[==] Other[null] operator[SEP] { identifier[preferredCacheClusterAZs] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[preferredCacheClusterAZs] operator[SEP] }
public static Tag uri(HttpRequest request) { return Tag.of("uri", ensureLeadingSlash(stripUri(request.getURI().toString()))); }
class class_name[name] begin[{] method[uri, return_type[type[Tag]], modifier[public static], parameter[request]] begin[{] return[call[Tag.of, parameter[literal["uri"], call[.ensureLeadingSlash, parameter[call[.stripUri, parameter[call[request.getURI, parameter[]]]]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Tag] identifier[uri] operator[SEP] identifier[HttpRequest] identifier[request] operator[SEP] { Keyword[return] identifier[Tag] operator[SEP] identifier[of] operator[SEP] literal[String] , identifier[ensureLeadingSlash] operator[SEP] identifier[stripUri] operator[SEP] identifier[request] operator[SEP] identifier[getURI] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Variation attemptToGetAsVariant(String part, ItemStack is) { if (is.getItem() instanceof ItemBlock) { // Unlocalised name doesn't always match the names we use in types.xsd // (which are the names displayed by Minecraft when using the F3 debug etc.) ItemBlock ib = (ItemBlock)(is.getItem()); IBlockState bs = ib.block.getStateFromMeta(is.getMetadata()); for (IProperty prop : bs.getProperties().keySet()) { Comparable<?> comp = bs.getValue(prop); Variation var = attemptToGetAsVariant(comp.toString()); if (var != null) return var; } return null; } else return attemptToGetAsVariant(part); }
class class_name[name] begin[{] method[attemptToGetAsVariant, return_type[type[Variation]], modifier[public static], parameter[part, is]] begin[{] if[binary_operation[call[is.getItem, parameter[]], instanceof, type[ItemBlock]]] begin[{] local_variable[type[ItemBlock], ib] local_variable[type[IBlockState], bs] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=bs, selectors=[], type_arguments=None), name=comp)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Comparable, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=comp, selectors=[], type_arguments=None)], member=attemptToGetAsVariant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=var)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Variation, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=var, 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=ReturnStatement(expression=MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=bs, selectors=[MethodInvocation(arguments=[], member=keySet, 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=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IProperty, sub_type=None))), label=None) return[literal[null]] else begin[{] return[call[.attemptToGetAsVariant, parameter[member[.part]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Variation] identifier[attemptToGetAsVariant] operator[SEP] identifier[String] identifier[part] , identifier[ItemStack] identifier[is] operator[SEP] { Keyword[if] operator[SEP] identifier[is] operator[SEP] identifier[getItem] operator[SEP] operator[SEP] Keyword[instanceof] identifier[ItemBlock] operator[SEP] { identifier[ItemBlock] identifier[ib] operator[=] operator[SEP] identifier[ItemBlock] operator[SEP] operator[SEP] identifier[is] operator[SEP] identifier[getItem] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[IBlockState] identifier[bs] operator[=] identifier[ib] operator[SEP] identifier[block] operator[SEP] identifier[getStateFromMeta] operator[SEP] identifier[is] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[IProperty] identifier[prop] operator[:] identifier[bs] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Comparable] operator[<] operator[?] operator[>] identifier[comp] operator[=] identifier[bs] operator[SEP] identifier[getValue] operator[SEP] identifier[prop] operator[SEP] operator[SEP] identifier[Variation] identifier[var] operator[=] identifier[attemptToGetAsVariant] operator[SEP] identifier[comp] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[var] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[var] operator[SEP] } Keyword[return] Other[null] operator[SEP] } Keyword[else] Keyword[return] identifier[attemptToGetAsVariant] operator[SEP] identifier[part] operator[SEP] operator[SEP] }
public static String[] getBeanInfoSearchPath() { String[] path = new String[searchPath.length]; System.arraycopy(searchPath, 0, path, 0, searchPath.length); return path; }
class class_name[name] begin[{] method[getBeanInfoSearchPath, return_type[type[String]], modifier[public static], parameter[]] begin[{] local_variable[type[String], path] call[System.arraycopy, parameter[member[.searchPath], literal[0], member[.path], literal[0], member[searchPath.length]]] return[member[.path]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[getBeanInfoSearchPath] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[path] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[searchPath] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[searchPath] , Other[0] , identifier[path] , Other[0] , identifier[searchPath] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[path] operator[SEP] }
public void setHeight(int height) { if (m_isFrame) { setParentHeight(height); } else { m_popup.setHeight(height); if (m_popup.isShowing()) { m_popup.center(); } } }
class class_name[name] begin[{] method[setHeight, return_type[void], modifier[public], parameter[height]] begin[{] if[member[.m_isFrame]] begin[{] call[.setParentHeight, parameter[member[.height]]] else begin[{] call[m_popup.setHeight, parameter[member[.height]]] if[call[m_popup.isShowing, parameter[]]] begin[{] call[m_popup.center, parameter[]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setHeight] operator[SEP] Keyword[int] identifier[height] operator[SEP] { Keyword[if] operator[SEP] identifier[m_isFrame] operator[SEP] { identifier[setParentHeight] operator[SEP] identifier[height] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_popup] operator[SEP] identifier[setHeight] operator[SEP] identifier[height] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_popup] operator[SEP] identifier[isShowing] operator[SEP] operator[SEP] operator[SEP] { identifier[m_popup] operator[SEP] identifier[center] operator[SEP] operator[SEP] operator[SEP] } } }
synchronized void removeServerProcess() { this.requiredState = InternalState.STOPPED; internalSetState(new ProcessRemoveTask(), InternalState.STOPPED, InternalState.PROCESS_REMOVING); }
class class_name[name] begin[{] method[removeServerProcess, return_type[void], modifier[synchronized], parameter[]] begin[{] assign[THIS[member[None.requiredState]], member[InternalState.STOPPED]] call[.internalSetState, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProcessRemoveTask, sub_type=None)), member[InternalState.STOPPED], member[InternalState.PROCESS_REMOVING]]] end[}] END[}]
Keyword[synchronized] Keyword[void] identifier[removeServerProcess] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[requiredState] operator[=] identifier[InternalState] operator[SEP] identifier[STOPPED] operator[SEP] identifier[internalSetState] operator[SEP] Keyword[new] identifier[ProcessRemoveTask] operator[SEP] operator[SEP] , identifier[InternalState] operator[SEP] identifier[STOPPED] , identifier[InternalState] operator[SEP] identifier[PROCESS_REMOVING] operator[SEP] operator[SEP] }
public static SetAttributeHandler setAttribute(final HttpHandler next, final String attribute, final String value, final ClassLoader classLoader) { return new SetAttributeHandler(next, attribute, value, classLoader); }
class class_name[name] begin[{] method[setAttribute, return_type[type[SetAttributeHandler]], modifier[public static], parameter[next, attribute, value, classLoader]] begin[{] return[ClassCreator(arguments=[MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classLoader, 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=SetAttributeHandler, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[SetAttributeHandler] identifier[setAttribute] operator[SEP] Keyword[final] identifier[HttpHandler] identifier[next] , Keyword[final] identifier[String] identifier[attribute] , Keyword[final] identifier[String] identifier[value] , Keyword[final] identifier[ClassLoader] identifier[classLoader] operator[SEP] { Keyword[return] Keyword[new] identifier[SetAttributeHandler] operator[SEP] identifier[next] , identifier[attribute] , identifier[value] , identifier[classLoader] operator[SEP] operator[SEP] }
public final void mSTRING() throws RecognitionException { try { int _type = STRING; int _channel = DEFAULT_TOKEN_CHANNEL; // /home/victor/srec/core/src/main/antlr/srec.g:142:2: ( '\"' ( . )* '\"' | '\\'' ( . )* '\\'' ) int alt6=2; int LA6_0 = input.LA(1); if ( (LA6_0=='\"') ) { alt6=1; } else if ( (LA6_0=='\'') ) { alt6=2; } else { NoViableAltException nvae = new NoViableAltException("", 6, 0, input); throw nvae; } switch (alt6) { case 1 : // /home/victor/srec/core/src/main/antlr/srec.g:142:4: '\"' ( . )* '\"' { match('\"'); // /home/victor/srec/core/src/main/antlr/srec.g:142:8: ( . )* loop4: do { int alt4=2; int LA4_0 = input.LA(1); if ( (LA4_0=='\"') ) { alt4=2; } else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='\uFFFF')) ) { alt4=1; } switch (alt4) { case 1 : // /home/victor/srec/core/src/main/antlr/srec.g:142:8: . { matchAny(); } break; default : break loop4; } } while (true); match('\"'); setText(getText().substring(1, getText().length()-1)); } break; case 2 : // /home/victor/srec/core/src/main/antlr/srec.g:143:4: '\\'' ( . )* '\\'' { match('\''); // /home/victor/srec/core/src/main/antlr/srec.g:143:9: ( . )* loop5: do { int alt5=2; int LA5_0 = input.LA(1); if ( (LA5_0=='\'') ) { alt5=2; } else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='\uFFFF')) ) { alt5=1; } switch (alt5) { case 1 : // /home/victor/srec/core/src/main/antlr/srec.g:143:9: . { matchAny(); } break; default : break loop5; } } while (true); match('\''); setText(getText().substring(1, getText().length()-1)); } break; } state.type = _type; state.channel = _channel; } finally { } }
class class_name[name] begin[{] method[mSTRING, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=STRING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt6)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA6_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA6_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA6_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\''), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=input, 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=NoViableAltException, sub_type=None)), name=nvae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NoViableAltException, sub_type=None)), ThrowStatement(expression=MemberReference(member=nvae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt6, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt6, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"')], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), DoStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt4)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA4_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA4_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA4_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=''), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA4_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='!'), operator=<=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA4_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='#'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA4_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='￿'), operator=<=), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=matchAny, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=loop4, label=None)])], expression=MemberReference(member=alt4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=loop4), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\"')], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), DoStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt5)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA5_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA5_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\''), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA5_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=''), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA5_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='&'), operator=<=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA5_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='('), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA5_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='￿'), operator=<=), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=matchAny, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=loop5, label=None)])], expression=MemberReference(member=alt5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=loop5), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt6, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[mSTRING] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { Keyword[int] identifier[_type] operator[=] identifier[STRING] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] Keyword[int] identifier[alt6] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA6_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA6_0] operator[==] literal[String] operator[SEP] operator[SEP] { identifier[alt6] operator[=] Other[1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[LA6_0] operator[==] literal[String] operator[SEP] operator[SEP] { identifier[alt6] operator[=] Other[2] operator[SEP] } Keyword[else] { identifier[NoViableAltException] identifier[nvae] operator[=] Keyword[new] identifier[NoViableAltException] operator[SEP] literal[String] , Other[6] , Other[0] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[nvae] operator[SEP] } Keyword[switch] operator[SEP] identifier[alt6] operator[SEP] { Keyword[case] Other[1] operator[:] { identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[loop4] operator[:] Keyword[do] { Keyword[int] identifier[alt4] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA4_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA4_0] operator[==] literal[String] operator[SEP] operator[SEP] { identifier[alt4] operator[=] Other[2] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[LA4_0] operator[>=] literal[String] operator[&&] identifier[LA4_0] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[LA4_0] operator[>=] literal[String] operator[&&] identifier[LA4_0] operator[<=] literal[String] operator[SEP] operator[SEP] operator[SEP] { identifier[alt4] operator[=] Other[1] operator[SEP] } Keyword[switch] operator[SEP] identifier[alt4] operator[SEP] { Keyword[case] Other[1] operator[:] { identifier[matchAny] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] identifier[loop4] operator[SEP] } } Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] { identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[loop5] operator[:] Keyword[do] { Keyword[int] identifier[alt5] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA5_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA5_0] operator[==] literal[String] operator[SEP] operator[SEP] { identifier[alt5] operator[=] Other[2] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[LA5_0] operator[>=] literal[String] operator[&&] identifier[LA5_0] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[LA5_0] operator[>=] literal[String] operator[&&] identifier[LA5_0] operator[<=] literal[String] operator[SEP] operator[SEP] operator[SEP] { identifier[alt5] operator[=] Other[1] operator[SEP] } Keyword[switch] operator[SEP] identifier[alt5] operator[SEP] { Keyword[case] Other[1] operator[:] { identifier[matchAny] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] identifier[loop5] operator[SEP] } } Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP] } Keyword[finally] { } }
public void registerProfileReportObserver(IProfileReportObserver observer) { KernelProfile profile = KernelManager.instance().getProfile(getClass()); synchronized (profile) { profile.setReportObserver(observer); } }
class class_name[name] begin[{] method[registerProfileReportObserver, return_type[void], modifier[public], parameter[observer]] begin[{] local_variable[type[KernelProfile], profile] SYNCHRONIZED[member[.profile]] BEGIN[{] call[profile.setReportObserver, parameter[member[.observer]]] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerProfileReportObserver] operator[SEP] identifier[IProfileReportObserver] identifier[observer] operator[SEP] { identifier[KernelProfile] identifier[profile] operator[=] identifier[KernelManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[getProfile] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[profile] operator[SEP] { identifier[profile] operator[SEP] identifier[setReportObserver] operator[SEP] identifier[observer] operator[SEP] operator[SEP] } }
public <T extends WeChatBot> void call(T bot, WeChatMessage message) { if (INVOKED_MSG.contains(message.getId())) { return; } try { // 自动同意添加好友 if (message.getMsgType() == MsgType.ADD_FRIEND && bot.config().autoAddFriend()) { bot.api().verify(message.getRecommend()); return; } Account account = bot.api().getAccountById(message.getFromUserName()); if (null == account) { INVOKED_MSG.add(message.getId()); method.invoke(bot, message); return; } if (msgType == MsgType.ALL || msgType == message.getMsgType()) { if (message.getMsgType() == MsgType.ADD_FRIEND) { INVOKED_MSG.add(message.getId()); method.invoke(bot, message); } else { if (accountTypes.contains(account.getAccountType())) { INVOKED_MSG.add(message.getId()); method.invoke(bot, message); } } } } catch (Exception e) { log.warn("回调给客户端出错: {}\r\n", message, e); } }
class class_name[name] begin[{] method[call, return_type[void], modifier[public], parameter[bot, message]] begin[{] if[call[INVOKED_MSG.contains, parameter[call[message.getId, parameter[]]]]] begin[{] return[None] else begin[{] None end[}] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMsgType, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), operandr=MemberReference(member=ADD_FRIEND, postfix_operators=[], prefix_operators=[], qualifier=MsgType, selectors=[]), operator===), operandr=MethodInvocation(arguments=[], member=config, postfix_operators=[], prefix_operators=[], qualifier=bot, selectors=[MethodInvocation(arguments=[], member=autoAddFriend, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=api, postfix_operators=[], prefix_operators=[], qualifier=bot, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRecommend, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None)], member=verify, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=api, postfix_operators=[], prefix_operators=[], qualifier=bot, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFromUserName, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None)], member=getAccountById, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=account)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Account, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=account, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=INVOKED_MSG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=msgType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ALL, postfix_operators=[], prefix_operators=[], qualifier=MsgType, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=msgType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMsgType, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMsgType, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), operandr=MemberReference(member=ADD_FRIEND, postfix_operators=[], prefix_operators=[], qualifier=MsgType, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAccountType, postfix_operators=[], prefix_operators=[], qualifier=account, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=accountTypes, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=INVOKED_MSG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=INVOKED_MSG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="回调给客户端出错: {}\r\n"), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[WeChatBot] operator[>] Keyword[void] identifier[call] operator[SEP] identifier[T] identifier[bot] , identifier[WeChatMessage] identifier[message] operator[SEP] { Keyword[if] operator[SEP] identifier[INVOKED_MSG] operator[SEP] identifier[contains] operator[SEP] identifier[message] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[try] { Keyword[if] operator[SEP] identifier[message] operator[SEP] identifier[getMsgType] operator[SEP] operator[SEP] operator[==] identifier[MsgType] operator[SEP] identifier[ADD_FRIEND] operator[&&] identifier[bot] operator[SEP] identifier[config] operator[SEP] operator[SEP] operator[SEP] identifier[autoAddFriend] operator[SEP] operator[SEP] operator[SEP] { identifier[bot] operator[SEP] identifier[api] operator[SEP] operator[SEP] operator[SEP] identifier[verify] operator[SEP] identifier[message] operator[SEP] identifier[getRecommend] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[Account] identifier[account] operator[=] identifier[bot] operator[SEP] identifier[api] operator[SEP] operator[SEP] operator[SEP] identifier[getAccountById] operator[SEP] identifier[message] operator[SEP] identifier[getFromUserName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[account] operator[SEP] { identifier[INVOKED_MSG] operator[SEP] identifier[add] operator[SEP] identifier[message] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[bot] , identifier[message] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[msgType] operator[==] identifier[MsgType] operator[SEP] identifier[ALL] operator[||] identifier[msgType] operator[==] identifier[message] operator[SEP] identifier[getMsgType] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[message] operator[SEP] identifier[getMsgType] operator[SEP] operator[SEP] operator[==] identifier[MsgType] operator[SEP] identifier[ADD_FRIEND] operator[SEP] { identifier[INVOKED_MSG] operator[SEP] identifier[add] operator[SEP] identifier[message] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[bot] , identifier[message] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[accountTypes] operator[SEP] identifier[contains] operator[SEP] identifier[account] operator[SEP] identifier[getAccountType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[INVOKED_MSG] operator[SEP] identifier[add] operator[SEP] identifier[message] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[bot] , identifier[message] operator[SEP] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[message] , identifier[e] operator[SEP] operator[SEP] } }
public static ClassificationDataSet readC(int classification_target, Path path, int lines_to_skip, Set<Integer> cat_cols) throws IOException { return readC(classification_target, path, DEFAULT_DELIMITER, lines_to_skip, DEFAULT_COMMENT, cat_cols); }
class class_name[name] begin[{] method[readC, return_type[type[ClassificationDataSet]], modifier[public static], parameter[classification_target, path, lines_to_skip, cat_cols]] begin[{] return[call[.readC, parameter[member[.classification_target], member[.path], member[.DEFAULT_DELIMITER], member[.lines_to_skip], member[.DEFAULT_COMMENT], member[.cat_cols]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ClassificationDataSet] identifier[readC] operator[SEP] Keyword[int] identifier[classification_target] , identifier[Path] identifier[path] , Keyword[int] identifier[lines_to_skip] , identifier[Set] operator[<] identifier[Integer] operator[>] identifier[cat_cols] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[readC] operator[SEP] identifier[classification_target] , identifier[path] , identifier[DEFAULT_DELIMITER] , identifier[lines_to_skip] , identifier[DEFAULT_COMMENT] , identifier[cat_cols] operator[SEP] operator[SEP] }
public BufferedImage getImage (String rset, String path, Colorization[] zations) { if (StringUtil.isBlank(path)) { String errmsg = "Invalid image path [rset=" + rset + ", path=" + path + "]"; throw new IllegalArgumentException(errmsg); } return getImage(getImageKey(rset, path), zations); }
class class_name[name] begin[{] method[getImage, return_type[type[BufferedImage]], modifier[public], parameter[rset, path, zations]] begin[{] if[call[StringUtil.isBlank, parameter[member[.path]]]] begin[{] local_variable[type[String], 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=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.getImage, parameter[call[.getImageKey, parameter[member[.rset], member[.path]]], member[.zations]]]] end[}] END[}]
Keyword[public] identifier[BufferedImage] identifier[getImage] operator[SEP] identifier[String] identifier[rset] , identifier[String] identifier[path] , identifier[Colorization] operator[SEP] operator[SEP] identifier[zations] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtil] operator[SEP] identifier[isBlank] operator[SEP] identifier[path] operator[SEP] operator[SEP] { identifier[String] identifier[errmsg] operator[=] literal[String] operator[+] identifier[rset] operator[+] literal[String] operator[+] identifier[path] operator[+] literal[String] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[errmsg] operator[SEP] operator[SEP] } Keyword[return] identifier[getImage] operator[SEP] identifier[getImageKey] operator[SEP] identifier[rset] , identifier[path] operator[SEP] , identifier[zations] operator[SEP] operator[SEP] }
@Override public void removeByGroupId(long groupId) { for (CPDefinitionOptionRel cpDefinitionOptionRel : findByGroupId( groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { remove(cpDefinitionOptionRel); } }
class class_name[name] begin[{] method[removeByGroupId, return_type[void], modifier[public], parameter[groupId]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cpDefinitionOptionRel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=findByGroupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cpDefinitionOptionRel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CPDefinitionOptionRel, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeByGroupId] operator[SEP] Keyword[long] identifier[groupId] operator[SEP] { Keyword[for] operator[SEP] identifier[CPDefinitionOptionRel] identifier[cpDefinitionOptionRel] operator[:] identifier[findByGroupId] operator[SEP] identifier[groupId] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP] { identifier[remove] operator[SEP] identifier[cpDefinitionOptionRel] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") public static void validate_ids(StormTopology topology, String topologyId) throws InvalidTopologyException { String topologyName = topologyIdToName(topologyId); if (!charValidate(topologyName)) { throw new InvalidTopologyException(topologyName + " is not a valid topology name. " + nameErrorInfo); } List<String> list = new ArrayList<>(); for (StormTopology._Fields field : Thrift.STORM_TOPOLOGY_FIELDS) { Object value = topology.getFieldValue(field); if (value != null) { Map<String, Object> obj_map = (Map<String, Object>) value; Set<String> commids = obj_map.keySet(); for (String id : commids) { if (system_id(id) || !charComponentValidate(id)) { throw new InvalidTopologyException(id + " is not a valid component id. " + compErrorInfo); } } for (Object obj : obj_map.values()) { validate_component(obj); } list.addAll(commids); } } List<String> offending = JStormUtils.getRepeat(list); if (!offending.isEmpty()) { throw new InvalidTopologyException("Duplicate component ids: " + offending); } }
class class_name[name] begin[{] method[validate_ids, return_type[void], modifier[public static], parameter[topology, topologyId]] begin[{] local_variable[type[String], topologyName] if[call[.charValidate, parameter[member[.topologyName]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topologyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not a valid topology name. "), operator=+), operandr=MemberReference(member=nameErrorInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidTopologyException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[List], list] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFieldValue, postfix_operators=[], prefix_operators=[], qualifier=topology, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, 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=Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, 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=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), name=obj_map)], 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)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=obj_map, selectors=[], type_arguments=None), name=commids)], 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=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=system_id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charComponentValidate, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not a valid component id. "), operator=+), operandr=MemberReference(member=compErrorInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidTopologyException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=commids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validate_component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=obj_map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=commids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=STORM_TOPOLOGY_FIELDS, postfix_operators=[], prefix_operators=[], qualifier=Thrift, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StormTopology, sub_type=ReferenceType(arguments=None, dimensions=None, name=_Fields, sub_type=None)))), label=None) local_variable[type[List], offending] if[call[offending.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Duplicate component ids: "), operandr=MemberReference(member=offending, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidTopologyException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[void] identifier[validate_ids] operator[SEP] identifier[StormTopology] identifier[topology] , identifier[String] identifier[topologyId] operator[SEP] Keyword[throws] identifier[InvalidTopologyException] { identifier[String] identifier[topologyName] operator[=] identifier[topologyIdToName] operator[SEP] identifier[topologyId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[charValidate] operator[SEP] identifier[topologyName] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidTopologyException] operator[SEP] identifier[topologyName] operator[+] literal[String] operator[+] identifier[nameErrorInfo] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[StormTopology] operator[SEP] identifier[_Fields] identifier[field] operator[:] identifier[Thrift] operator[SEP] identifier[STORM_TOPOLOGY_FIELDS] operator[SEP] { identifier[Object] identifier[value] operator[=] identifier[topology] operator[SEP] identifier[getFieldValue] operator[SEP] identifier[field] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[obj_map] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[value] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[commids] operator[=] identifier[obj_map] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[id] operator[:] identifier[commids] operator[SEP] { Keyword[if] operator[SEP] identifier[system_id] operator[SEP] identifier[id] operator[SEP] operator[||] operator[!] identifier[charComponentValidate] operator[SEP] identifier[id] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidTopologyException] operator[SEP] identifier[id] operator[+] literal[String] operator[+] identifier[compErrorInfo] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[Object] identifier[obj] operator[:] identifier[obj_map] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[validate_component] operator[SEP] identifier[obj] operator[SEP] operator[SEP] } identifier[list] operator[SEP] identifier[addAll] operator[SEP] identifier[commids] operator[SEP] operator[SEP] } } identifier[List] operator[<] identifier[String] operator[>] identifier[offending] operator[=] identifier[JStormUtils] operator[SEP] identifier[getRepeat] operator[SEP] identifier[list] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[offending] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidTopologyException] operator[SEP] literal[String] operator[+] identifier[offending] operator[SEP] operator[SEP] } }
public void registerAppRoot(String configureFileName) throws Exception { try { AppConfigureCollection existedAppConfigureFiles = (AppConfigureCollection) containerWrapper.lookup(AppConfigureCollection.NAME); if (existedAppConfigureFiles == null) { xmlcontainerRegistry.registerAppRoot(); existedAppConfigureFiles = (AppConfigureCollection) containerWrapper.lookup(AppConfigureCollection.NAME); } if (!existedAppConfigureFiles.getConfigList().contains(configureFileName)) { Debug.logInfo("[JdonFramework]found jdonframework configuration:" + configureFileName, module); existedAppConfigureFiles.addConfigList(configureFileName); } } catch (Exception ex) { Debug.logError("[JdonFramework] found jdonframework configuration error:" + ex, module); throw new Exception(ex); } }
class class_name[name] begin[{] method[registerAppRoot, return_type[void], modifier[public], parameter[configureFileName]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=AppConfigureCollection, selectors=[])], member=lookup, postfix_operators=[], prefix_operators=[], qualifier=containerWrapper, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AppConfigureCollection, sub_type=None)), name=existedAppConfigureFiles)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AppConfigureCollection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=existedAppConfigureFiles, 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=registerAppRoot, postfix_operators=[], prefix_operators=[], qualifier=xmlcontainerRegistry, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=existedAppConfigureFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=AppConfigureCollection, selectors=[])], member=lookup, postfix_operators=[], prefix_operators=[], qualifier=containerWrapper, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AppConfigureCollection, sub_type=None))), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getConfigList, postfix_operators=[], prefix_operators=['!'], qualifier=existedAppConfigureFiles, selectors=[MethodInvocation(arguments=[MemberReference(member=configureFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[JdonFramework]found jdonframework configuration:"), operandr=MemberReference(member=configureFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logInfo, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=configureFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addConfigList, postfix_operators=[], prefix_operators=[], qualifier=existedAppConfigureFiles, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[JdonFramework] found jdonframework configuration error:"), operandr=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logError, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[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=Exception, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[registerAppRoot] operator[SEP] identifier[String] identifier[configureFileName] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[try] { identifier[AppConfigureCollection] identifier[existedAppConfigureFiles] operator[=] operator[SEP] identifier[AppConfigureCollection] operator[SEP] identifier[containerWrapper] operator[SEP] identifier[lookup] operator[SEP] identifier[AppConfigureCollection] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existedAppConfigureFiles] operator[==] Other[null] operator[SEP] { identifier[xmlcontainerRegistry] operator[SEP] identifier[registerAppRoot] operator[SEP] operator[SEP] operator[SEP] identifier[existedAppConfigureFiles] operator[=] operator[SEP] identifier[AppConfigureCollection] operator[SEP] identifier[containerWrapper] operator[SEP] identifier[lookup] operator[SEP] identifier[AppConfigureCollection] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[existedAppConfigureFiles] operator[SEP] identifier[getConfigList] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[configureFileName] operator[SEP] operator[SEP] { identifier[Debug] operator[SEP] identifier[logInfo] operator[SEP] literal[String] operator[+] identifier[configureFileName] , identifier[module] operator[SEP] operator[SEP] identifier[existedAppConfigureFiles] operator[SEP] identifier[addConfigList] operator[SEP] identifier[configureFileName] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[Debug] operator[SEP] identifier[logError] operator[SEP] literal[String] operator[+] identifier[ex] , identifier[module] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
public void saveAs(final File file) throws IOException { try { final FileOutputStream out = new FileOutputStream(file); try { this.save(out); } finally { out.flush(); out.close(); } } catch (final FileNotFoundException e) { this.logger.log(Level.SEVERE, "Can't open " + file, e); throw new IOException(e); } catch (final NullPointerException e) { this.logger.log(Level.SEVERE, "No file", e); throw new IOException(e); } }
class class_name[name] begin[{] method[saveAs, return_type[void], modifier[public], parameter[file]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None)), name=out)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None)), TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=save, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=[CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't open "), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException'])), CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No file"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NullPointerException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[saveAs] operator[SEP] Keyword[final] identifier[File] identifier[file] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { Keyword[final] identifier[FileOutputStream] identifier[out] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[save] operator[SEP] identifier[out] operator[SEP] operator[SEP] } Keyword[finally] { identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[FileNotFoundException] identifier[e] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[+] identifier[file] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[NullPointerException] identifier[e] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public OvhMailDomain2Service fax_customDomains_POST(String domain) throws IOException { String qPath = "/me/fax/customDomains"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "domain", domain); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhMailDomain2Service.class); }
class class_name[name] begin[{] method[fax_customDomains_POST, return_type[type[OvhMailDomain2Service]], modifier[public], parameter[domain]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["domain"], member[.domain]]] 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=OvhMailDomain2Service, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhMailDomain2Service] identifier[fax_customDomains_POST] operator[SEP] identifier[String] identifier[domain] 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] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[domain] 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] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhMailDomain2Service] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }