code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public void clickOnToggleButton(String text) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "clickOnToggleButton(\""+text+"\")");
}
clicker.clickOn(ToggleButton.class, text);
} | class class_name[name] begin[{]
method[clickOnToggleButton, return_type[void], modifier[public], parameter[text]] begin[{]
if[member[config.commandLogging]] begin[{]
call[Log.d, parameter[member[config.commandLoggingTag], binary_operation[binary_operation[literal["clickOnToggleButton(\""], +, member[.text]], +, literal["\")"]]]]
else begin[{]
None
end[}]
call[clicker.clickOn, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ToggleButton, sub_type=None)), member[.text]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[clickOnToggleButton] operator[SEP] identifier[String] identifier[text] operator[SEP] {
Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[commandLogging] operator[SEP] {
identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[config] operator[SEP] identifier[commandLoggingTag] , literal[String] operator[+] identifier[text] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[clicker] operator[SEP] identifier[clickOn] operator[SEP] identifier[ToggleButton] operator[SEP] Keyword[class] , identifier[text] operator[SEP] operator[SEP]
}
|
private List<Event> parseEvent(Elements trs, Organization organization) throws ParseException {
List<Event> events = new ArrayList<>();
if (trs.size() > 0) {
trs.remove(0);
SherdogBaseObject sOrg = new SherdogBaseObject();
sOrg.setName(organization.getName());
sOrg.setSherdogUrl(organization.getSherdogUrl());
trs.forEach(tr -> {
Event event = new Event();
boolean addEvent = true;
Elements tds = tr.select("td");
event.setOrganization(sOrg);
event.setName(getEventName(tds.get(NAME_COLUMN)));
event.setSherdogUrl(getEventUrl(tds.get(NAME_COLUMN)));
event.setLocation(getElementLocation(tds.get(LOCATION_COLUMN)));
try {
event.setDate(getEventDate(tds.get(DATE_COLUMN)));
} catch (DateTimeParseException e) {
logger.error("Couldn't fornat date, we shouldn't add the event", e);
addEvent = false;
}
if (addEvent) {
events.add(event);
}
});
}
return events;
} | class class_name[name] begin[{]
method[parseEvent, return_type[type[List]], modifier[private], parameter[trs, organization]] begin[{]
local_variable[type[List], events]
if[binary_operation[call[trs.size, parameter[]], >, literal[0]]] begin[{]
call[trs.remove, parameter[literal[0]]]
local_variable[type[SherdogBaseObject], sOrg]
call[sOrg.setName, parameter[call[organization.getName, parameter[]]]]
call[sOrg.setSherdogUrl, parameter[call[organization.getSherdogUrl, parameter[]]]]
call[trs.forEach, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Event, sub_type=None)), name=event)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Event, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=addEvent)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="td")], member=select, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[], type_arguments=None), name=tds)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Elements, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sOrg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOrganization, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=NAME_COLUMN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tds, selectors=[], type_arguments=None)], member=getEventName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=NAME_COLUMN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tds, selectors=[], type_arguments=None)], member=getEventUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setSherdogUrl, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=LOCATION_COLUMN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tds, selectors=[], type_arguments=None)], member=getElementLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setLocation, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=DATE_COLUMN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tds, selectors=[], type_arguments=None)], member=getEventDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setDate, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't fornat date, we shouldn't add the event"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=addEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DateTimeParseException']))], finally_block=None, label=None, resources=None), IfStatement(condition=MemberReference(member=addEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=events, selectors=[], type_arguments=None), label=None)]))], parameters=[MemberReference(member=tr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
else begin[{]
None
end[}]
return[member[.events]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[Event] operator[>] identifier[parseEvent] operator[SEP] identifier[Elements] identifier[trs] , identifier[Organization] identifier[organization] operator[SEP] Keyword[throws] identifier[ParseException] {
identifier[List] operator[<] identifier[Event] operator[>] identifier[events] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[trs] operator[SEP] identifier[remove] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[SherdogBaseObject] identifier[sOrg] operator[=] Keyword[new] identifier[SherdogBaseObject] operator[SEP] operator[SEP] operator[SEP] identifier[sOrg] operator[SEP] identifier[setName] operator[SEP] identifier[organization] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sOrg] operator[SEP] identifier[setSherdogUrl] operator[SEP] identifier[organization] operator[SEP] identifier[getSherdogUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[trs] operator[SEP] identifier[forEach] operator[SEP] identifier[tr] operator[->] {
identifier[Event] identifier[event] operator[=] Keyword[new] identifier[Event] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[addEvent] operator[=] literal[boolean] operator[SEP] identifier[Elements] identifier[tds] operator[=] identifier[tr] operator[SEP] identifier[select] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[event] operator[SEP] identifier[setOrganization] operator[SEP] identifier[sOrg] operator[SEP] operator[SEP] identifier[event] operator[SEP] identifier[setName] operator[SEP] identifier[getEventName] operator[SEP] identifier[tds] operator[SEP] identifier[get] operator[SEP] identifier[NAME_COLUMN] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[event] operator[SEP] identifier[setSherdogUrl] operator[SEP] identifier[getEventUrl] operator[SEP] identifier[tds] operator[SEP] identifier[get] operator[SEP] identifier[NAME_COLUMN] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[event] operator[SEP] identifier[setLocation] operator[SEP] identifier[getElementLocation] operator[SEP] identifier[tds] operator[SEP] identifier[get] operator[SEP] identifier[LOCATION_COLUMN] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[event] operator[SEP] identifier[setDate] operator[SEP] identifier[getEventDate] operator[SEP] identifier[tds] operator[SEP] identifier[get] operator[SEP] identifier[DATE_COLUMN] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DateTimeParseException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[addEvent] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[addEvent] operator[SEP] {
identifier[events] operator[SEP] identifier[add] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
Keyword[return] identifier[events] operator[SEP]
}
|
public Blade listen(int port) {
Assert.greaterThan(port, 0, "server port not is negative number.");
this.environment.set(ENV_KEY_SERVER_PORT, port);
return this;
} | class class_name[name] begin[{]
method[listen, return_type[type[Blade]], modifier[public], parameter[port]] begin[{]
call[Assert.greaterThan, parameter[member[.port], literal[0], literal["server port not is negative number."]]]
THIS[member[None.environment]call[None.set, parameter[member[.ENV_KEY_SERVER_PORT], member[.port]]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Blade] identifier[listen] operator[SEP] Keyword[int] identifier[port] operator[SEP] {
identifier[Assert] operator[SEP] identifier[greaterThan] operator[SEP] identifier[port] , Other[0] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[environment] operator[SEP] identifier[set] operator[SEP] identifier[ENV_KEY_SERVER_PORT] , identifier[port] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
protected synchronized MessageDigest getDigest() {
if (this.digest == null) {
try {
this.digest = MessageDigest.getInstance(algorithm);
} catch (NoSuchAlgorithmException e) {
try {
this.digest = MessageDigest.getInstance(DEFAULT_ALGORITHM);
} catch (NoSuchAlgorithmException f) {
this.digest = null;
}
}
}
return (this.digest);
} | class class_name[name] begin[{]
method[getDigest, return_type[type[MessageDigest]], modifier[synchronized protected], parameter[]] begin[{]
if[binary_operation[THIS[member[None.digest]], ==, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=digest, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[MemberReference(member=algorithm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=digest, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MethodInvocation(arguments=[MemberReference(member=DEFAULT_ALGORITHM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=digest, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=f, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[THIS[]]
end[}]
END[}] | Keyword[protected] Keyword[synchronized] identifier[MessageDigest] identifier[getDigest] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[digest] operator[==] Other[null] operator[SEP] {
Keyword[try] {
Keyword[this] operator[SEP] identifier[digest] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] identifier[algorithm] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] {
Keyword[try] {
Keyword[this] operator[SEP] identifier[digest] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] identifier[DEFAULT_ALGORITHM] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[f] operator[SEP] {
Keyword[this] operator[SEP] identifier[digest] operator[=] Other[null] operator[SEP]
}
}
}
Keyword[return] operator[SEP] Keyword[this] operator[SEP] identifier[digest] operator[SEP] operator[SEP]
}
|
public static ClickHandler createHider (final PopupPanel popup)
{
return new ClickHandler() {
public void onClick (ClickEvent event) {
popup.hide();
}
};
} | class class_name[name] begin[{]
method[createHider, return_type[type[ClickHandler]], modifier[public static], parameter[popup]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=hide, postfix_operators=[], prefix_operators=[], qualifier=popup, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=None, dimensions=[], name=ClickEvent, 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=ClickHandler, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ClickHandler] identifier[createHider] operator[SEP] Keyword[final] identifier[PopupPanel] identifier[popup] operator[SEP] {
Keyword[return] Keyword[new] identifier[ClickHandler] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[ClickEvent] identifier[event] operator[SEP] {
identifier[popup] operator[SEP] identifier[hide] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public static void runExample(
AdWordsServicesInterface adWordsServices, AdWordsSession session, String reportFile)
throws ReportDownloadResponseException, ReportException, IOException {
// Get the CampaignService.
CampaignServiceInterface campaignService =
adWordsServices.get(session, CampaignServiceInterface.class);
// Create selector to retrieve the first 100 campaigns.
Selector selector = new Selector();
selector.setFields(new String[] {"Id", "Name"});
Paging paging = new Paging();
paging.setStartIndex(0);
paging.setNumberResults(100);
// Get the first page of campaigns.
CampaignPage page = campaignService.get(selector);
System.out.printf("Found %d total campaigns.%n", page.getTotalNumEntries());
// Display campaigns.
if (page.getEntries() != null) {
for (Campaign campaign : page.getEntries()) {
System.out.printf("Campaign with name '%s' and ID %d was found.%n", campaign.getName(),
campaign.getId());
}
} else {
System.out.println("No campaigns were found.");
}
// Create selector.
com.google.api.ads.adwords.lib.jaxb.v201809.Selector reportSelector =
new com.google.api.ads.adwords.lib.jaxb.v201809.Selector();
reportSelector.getFields().addAll(Arrays.asList(
"CampaignId",
"AdGroupId",
"Id",
"CriteriaType",
"Criteria",
"Impressions",
"Clicks",
"Cost"));
// Create report definition.
ReportDefinition reportDefinition = new ReportDefinition();
reportDefinition.setReportName("Criteria performance report #" + System.currentTimeMillis());
reportDefinition.setDateRangeType(ReportDefinitionDateRangeType.YESTERDAY);
reportDefinition.setReportType(ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT);
reportDefinition.setDownloadFormat(DownloadFormat.CSV);
reportDefinition.setSelector(reportSelector);
ReportingConfiguration reportingConfig =
new ReportingConfiguration.Builder()
// Enable to allow rows with zero impressions to show.
.includeZeroImpressions(false)
.build();
session.setReportingConfiguration(reportingConfig);
ReportDownloadResponse response =
new ReportDownloader(session).downloadReport(reportDefinition);
FileOutputStream fos = new FileOutputStream(new File(reportFile));
Streams.copy(response.getInputStream(), fos);
fos.close();
System.out.printf("Report successfully downloaded: %s%n", reportFile);
} | class class_name[name] begin[{]
method[runExample, return_type[void], modifier[public static], parameter[adWordsServices, session, reportFile]] begin[{]
local_variable[type[CampaignServiceInterface], campaignService]
local_variable[type[Selector], selector]
call[selector.setFields, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Id"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Name")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]
local_variable[type[Paging], paging]
call[paging.setStartIndex, parameter[literal[0]]]
call[paging.setNumberResults, parameter[literal[100]]]
local_variable[type[CampaignPage], page]
call[System.out.printf, parameter[literal["Found %d total campaigns.%n"], call[page.getTotalNumEntries, parameter[]]]]
if[binary_operation[call[page.getEntries, parameter[]], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Campaign with name '%s' and ID %d was found.%n"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=campaign, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=campaign, selectors=[], type_arguments=None)], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getEntries, postfix_operators=[], prefix_operators=[], qualifier=page, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=campaign)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Campaign, sub_type=None))), label=None)
else begin[{]
call[System.out.println, parameter[literal["No campaigns were found."]]]
end[}]
local_variable[type[com], reportSelector]
call[reportSelector.getFields, parameter[]]
local_variable[type[ReportDefinition], reportDefinition]
call[reportDefinition.setReportName, parameter[binary_operation[literal["Criteria performance report #"], +, call[System.currentTimeMillis, parameter[]]]]]
call[reportDefinition.setDateRangeType, parameter[member[ReportDefinitionDateRangeType.YESTERDAY]]]
call[reportDefinition.setReportType, parameter[member[ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT]]]
call[reportDefinition.setDownloadFormat, parameter[member[DownloadFormat.CSV]]]
call[reportDefinition.setSelector, parameter[member[.reportSelector]]]
local_variable[type[ReportingConfiguration], reportingConfig]
call[session.setReportingConfiguration, parameter[member[.reportingConfig]]]
local_variable[type[ReportDownloadResponse], response]
local_variable[type[FileOutputStream], fos]
call[Streams.copy, parameter[call[response.getInputStream, parameter[]], member[.fos]]]
call[fos.close, parameter[]]
call[System.out.printf, parameter[literal["Report successfully downloaded: %s%n"], member[.reportFile]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[runExample] operator[SEP] identifier[AdWordsServicesInterface] identifier[adWordsServices] , identifier[AdWordsSession] identifier[session] , identifier[String] identifier[reportFile] operator[SEP] Keyword[throws] identifier[ReportDownloadResponseException] , identifier[ReportException] , identifier[IOException] {
identifier[CampaignServiceInterface] identifier[campaignService] operator[=] identifier[adWordsServices] operator[SEP] identifier[get] operator[SEP] identifier[session] , identifier[CampaignServiceInterface] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Selector] identifier[selector] operator[=] Keyword[new] identifier[Selector] operator[SEP] operator[SEP] operator[SEP] identifier[selector] operator[SEP] identifier[setFields] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] operator[SEP] identifier[Paging] identifier[paging] operator[=] Keyword[new] identifier[Paging] operator[SEP] operator[SEP] operator[SEP] identifier[paging] operator[SEP] identifier[setStartIndex] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[paging] operator[SEP] identifier[setNumberResults] operator[SEP] Other[100] operator[SEP] operator[SEP] identifier[CampaignPage] identifier[page] operator[=] identifier[campaignService] operator[SEP] identifier[get] operator[SEP] identifier[selector] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[page] operator[SEP] identifier[getTotalNumEntries] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[page] operator[SEP] identifier[getEntries] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Campaign] identifier[campaign] operator[:] identifier[page] operator[SEP] identifier[getEntries] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[campaign] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[campaign] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[lib] operator[SEP] identifier[jaxb] operator[SEP] identifier[v201809] operator[SEP] identifier[Selector] identifier[reportSelector] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[lib] operator[SEP] identifier[jaxb] operator[SEP] identifier[v201809] operator[SEP] identifier[Selector] operator[SEP] operator[SEP] operator[SEP] identifier[reportSelector] operator[SEP] identifier[getFields] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ReportDefinition] identifier[reportDefinition] operator[=] Keyword[new] identifier[ReportDefinition] operator[SEP] operator[SEP] operator[SEP] identifier[reportDefinition] operator[SEP] identifier[setReportName] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[reportDefinition] operator[SEP] identifier[setDateRangeType] operator[SEP] identifier[ReportDefinitionDateRangeType] operator[SEP] identifier[YESTERDAY] operator[SEP] operator[SEP] identifier[reportDefinition] operator[SEP] identifier[setReportType] operator[SEP] identifier[ReportDefinitionReportType] operator[SEP] identifier[CRITERIA_PERFORMANCE_REPORT] operator[SEP] operator[SEP] identifier[reportDefinition] operator[SEP] identifier[setDownloadFormat] operator[SEP] identifier[DownloadFormat] operator[SEP] identifier[CSV] operator[SEP] operator[SEP] identifier[reportDefinition] operator[SEP] identifier[setSelector] operator[SEP] identifier[reportSelector] operator[SEP] operator[SEP] identifier[ReportingConfiguration] identifier[reportingConfig] operator[=] Keyword[new] identifier[ReportingConfiguration] operator[SEP] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[includeZeroImpressions] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[setReportingConfiguration] operator[SEP] identifier[reportingConfig] operator[SEP] operator[SEP] identifier[ReportDownloadResponse] identifier[response] operator[=] Keyword[new] identifier[ReportDownloader] operator[SEP] identifier[session] operator[SEP] operator[SEP] identifier[downloadReport] operator[SEP] identifier[reportDefinition] operator[SEP] operator[SEP] identifier[FileOutputStream] identifier[fos] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[reportFile] operator[SEP] operator[SEP] operator[SEP] identifier[Streams] operator[SEP] identifier[copy] operator[SEP] identifier[response] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] , identifier[fos] operator[SEP] operator[SEP] identifier[fos] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[reportFile] operator[SEP] operator[SEP]
}
|
public Map<K, V> getAll(final Iterable<? extends K> _inputKeys) {
Map<K, ExaminationEntry<K, V>> map = new HashMap<K, ExaminationEntry<K, V>>();
for (K k : _inputKeys) {
Entry<K,V> e = getEntryInternal(k);
if (e != null) {
map.put(extractKeyObj(e), ReadOnlyCacheEntry.of(e));
}
}
return convertValueMap(map);
} | class class_name[name] begin[{]
method[getAll, return_type[type[Map]], modifier[public], parameter[_inputKeys]] begin[{]
local_variable[type[Map], map]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEntryInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=e)], modifiers=set(), 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)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, 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=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractKeyObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=ReadOnlyCacheEntry, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=_inputKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=k)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None))), label=None)
return[call[.convertValueMap, parameter[member[.map]]]]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[getAll] operator[SEP] Keyword[final] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[K] operator[>] identifier[_inputKeys] operator[SEP] {
identifier[Map] operator[<] identifier[K] , identifier[ExaminationEntry] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[K] , identifier[ExaminationEntry] operator[<] identifier[K] , identifier[V] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[K] identifier[k] operator[:] identifier[_inputKeys] operator[SEP] {
identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[e] operator[=] identifier[getEntryInternal] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[e] operator[!=] Other[null] operator[SEP] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[extractKeyObj] operator[SEP] identifier[e] operator[SEP] , identifier[ReadOnlyCacheEntry] operator[SEP] identifier[of] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[convertValueMap] operator[SEP] identifier[map] operator[SEP] operator[SEP]
}
|
public void serviceName_vpn_id_PUT(String serviceName, Long id, OvhVpn body) throws IOException {
String qPath = "/router/{serviceName}/vpn/{id}";
StringBuilder sb = path(qPath, serviceName, id);
exec(qPath, "PUT", sb.toString(), body);
} | class class_name[name] begin[{]
method[serviceName_vpn_id_PUT, return_type[void], modifier[public], parameter[serviceName, id, 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[serviceName_vpn_id_PUT] operator[SEP] identifier[String] identifier[serviceName] , identifier[Long] identifier[id] , identifier[OvhVpn] identifier[body] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[id] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[body] operator[SEP] operator[SEP]
}
|
public ContainerDefinition withUlimits(Ulimit... ulimits) {
if (this.ulimits == null) {
setUlimits(new com.amazonaws.internal.SdkInternalList<Ulimit>(ulimits.length));
}
for (Ulimit ele : ulimits) {
this.ulimits.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withUlimits, return_type[type[ContainerDefinition]], modifier[public], parameter[ulimits]] begin[{]
if[binary_operation[THIS[member[None.ulimits]], ==, literal[null]]] begin[{]
call[.setUlimits, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ulimits, 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=Ulimit, 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=ulimits, 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=ulimits, 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=Ulimit, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ContainerDefinition] identifier[withUlimits] operator[SEP] identifier[Ulimit] operator[...] identifier[ulimits] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[ulimits] operator[==] Other[null] operator[SEP] {
identifier[setUlimits] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[Ulimit] operator[>] operator[SEP] identifier[ulimits] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Ulimit] identifier[ele] operator[:] identifier[ulimits] operator[SEP] {
Keyword[this] operator[SEP] identifier[ulimits] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public void setBottomRightCorner(@CornerFamily int cornerFamily, @Dimension int cornerSize) {
setBottomRightCorner(MaterialShapeUtils.createCornerTreatment(cornerFamily, cornerSize));
} | class class_name[name] begin[{]
method[setBottomRightCorner, return_type[void], modifier[public], parameter[cornerFamily, cornerSize]] begin[{]
call[.setBottomRightCorner, parameter[call[MaterialShapeUtils.createCornerTreatment, parameter[member[.cornerFamily], member[.cornerSize]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setBottomRightCorner] operator[SEP] annotation[@] identifier[CornerFamily] Keyword[int] identifier[cornerFamily] , annotation[@] identifier[Dimension] Keyword[int] identifier[cornerSize] operator[SEP] {
identifier[setBottomRightCorner] operator[SEP] identifier[MaterialShapeUtils] operator[SEP] identifier[createCornerTreatment] operator[SEP] identifier[cornerFamily] , identifier[cornerSize] operator[SEP] operator[SEP] operator[SEP]
}
|
private static Object saveList(List<String> list) {
if ((list == null) || list.isEmpty()) {
return null;
}
int size = list.size();
if (size == 1) {
return list.get(0);
}
return list.toArray(new String[size]);
} | class class_name[name] begin[{]
method[saveList, return_type[type[Object]], modifier[private static], parameter[list]] begin[{]
if[binary_operation[binary_operation[member[.list], ==, literal[null]], ||, call[list.isEmpty, parameter[]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[int], size]
if[binary_operation[member[.size], ==, literal[1]]] begin[{]
return[call[list.get, parameter[literal[0]]]]
else begin[{]
None
end[}]
return[call[list.toArray, parameter[ArrayCreator(dimensions=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Object] identifier[saveList] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[list] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[list] operator[==] Other[null] operator[SEP] operator[||] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[int] identifier[size] operator[=] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[==] Other[1] operator[SEP] {
Keyword[return] identifier[list] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[return] identifier[list] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setVisibleSignature(String fieldName) {
AcroFields af = writer.getAcroFields();
AcroFields.Item item = af.getFieldItem(fieldName);
if (item == null)
throw new IllegalArgumentException("The field " + fieldName + " does not exist.");
PdfDictionary merged = item.getMerged(0);
if (!PdfName.SIG.equals(PdfReader.getPdfObject(merged.get(PdfName.FT))))
throw new IllegalArgumentException("The field " + fieldName + " is not a signature field.");
this.fieldName = fieldName;
PdfArray r = merged.getAsArray(PdfName.RECT);
float llx = r.getAsNumber(0).floatValue();
float lly = r.getAsNumber(1).floatValue();
float urx = r.getAsNumber(2).floatValue();
float ury = r.getAsNumber(3).floatValue();
pageRect = new Rectangle(llx, lly, urx, ury);
pageRect.normalize();
page = item.getPage(0).intValue();
int rotation = writer.reader.getPageRotation(page);
Rectangle pageSize = writer.reader.getPageSizeWithRotation(page);
switch (rotation) {
case 90:
pageRect = new Rectangle(
pageRect.getBottom(),
pageSize.getTop() - pageRect.getLeft(),
pageRect.getTop(),
pageSize.getTop() - pageRect.getRight());
break;
case 180:
pageRect = new Rectangle(
pageSize.getRight() - pageRect.getLeft(),
pageSize.getTop() - pageRect.getBottom(),
pageSize.getRight() - pageRect.getRight(),
pageSize.getTop() - pageRect.getTop());
break;
case 270:
pageRect = new Rectangle(
pageSize.getRight() - pageRect.getBottom(),
pageRect.getLeft(),
pageSize.getRight() - pageRect.getTop(),
pageRect.getRight());
break;
}
if (rotation != 0)
pageRect.normalize();
rect = new Rectangle(this.pageRect.getWidth(), this.pageRect.getHeight());
} | class class_name[name] begin[{]
method[setVisibleSignature, return_type[void], modifier[public], parameter[fieldName]] begin[{]
local_variable[type[AcroFields], af]
local_variable[type[AcroFields], item]
if[binary_operation[member[.item], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The field "), operandr=MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" does not exist."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[PdfDictionary], merged]
if[call[PdfName.SIG.equals, parameter[call[PdfReader.getPdfObject, parameter[call[merged.get, parameter[member[PdfName.FT]]]]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The field "), operandr=MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not a signature field."), 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[}]
assign[THIS[member[None.fieldName]], member[.fieldName]]
local_variable[type[PdfArray], r]
local_variable[type[float], llx]
local_variable[type[float], lly]
local_variable[type[float], urx]
local_variable[type[float], ury]
assign[member[.pageRect], ClassCreator(arguments=[MemberReference(member=llx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=urx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ury, 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=Rectangle, sub_type=None))]
call[pageRect.normalize, parameter[]]
assign[member[.page], call[item.getPage, parameter[literal[0]]]]
local_variable[type[int], rotation]
local_variable[type[Rectangle], pageSize]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=90)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pageRect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBottom, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTop, postfix_operators=[], prefix_operators=[], qualifier=pageSize, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getLeft, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), operator=-), MethodInvocation(arguments=[], member=getTop, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTop, postfix_operators=[], prefix_operators=[], qualifier=pageSize, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), operator=-)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=180)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pageRect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=pageSize, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getLeft, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), operator=-), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTop, postfix_operators=[], prefix_operators=[], qualifier=pageSize, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getBottom, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), operator=-), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=pageSize, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), operator=-), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTop, postfix_operators=[], prefix_operators=[], qualifier=pageSize, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTop, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), operator=-)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=270)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pageRect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=pageSize, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getBottom, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), operator=-), MethodInvocation(arguments=[], member=getLeft, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=pageSize, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTop, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None), operator=-), MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=pageRect, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=rotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
if[binary_operation[member[.rotation], !=, literal[0]]] begin[{]
call[pageRect.normalize, parameter[]]
else begin[{]
None
end[}]
assign[member[.rect], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=pageRect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getWidth, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=pageRect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getHeight, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setVisibleSignature] operator[SEP] identifier[String] identifier[fieldName] operator[SEP] {
identifier[AcroFields] identifier[af] operator[=] identifier[writer] operator[SEP] identifier[getAcroFields] operator[SEP] operator[SEP] operator[SEP] identifier[AcroFields] operator[SEP] identifier[Item] identifier[item] operator[=] identifier[af] operator[SEP] identifier[getFieldItem] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[item] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[fieldName] operator[+] literal[String] operator[SEP] operator[SEP] identifier[PdfDictionary] identifier[merged] operator[=] identifier[item] operator[SEP] identifier[getMerged] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[PdfName] operator[SEP] identifier[SIG] operator[SEP] identifier[equals] operator[SEP] identifier[PdfReader] operator[SEP] identifier[getPdfObject] operator[SEP] identifier[merged] operator[SEP] identifier[get] operator[SEP] identifier[PdfName] operator[SEP] identifier[FT] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[fieldName] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[fieldName] operator[=] identifier[fieldName] operator[SEP] identifier[PdfArray] identifier[r] operator[=] identifier[merged] operator[SEP] identifier[getAsArray] operator[SEP] identifier[PdfName] operator[SEP] identifier[RECT] operator[SEP] operator[SEP] Keyword[float] identifier[llx] operator[=] identifier[r] operator[SEP] identifier[getAsNumber] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[lly] operator[=] identifier[r] operator[SEP] identifier[getAsNumber] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[urx] operator[=] identifier[r] operator[SEP] identifier[getAsNumber] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[ury] operator[=] identifier[r] operator[SEP] identifier[getAsNumber] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP] identifier[pageRect] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] identifier[llx] , identifier[lly] , identifier[urx] , identifier[ury] operator[SEP] operator[SEP] identifier[pageRect] operator[SEP] identifier[normalize] operator[SEP] operator[SEP] operator[SEP] identifier[page] operator[=] identifier[item] operator[SEP] identifier[getPage] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[rotation] operator[=] identifier[writer] operator[SEP] identifier[reader] operator[SEP] identifier[getPageRotation] operator[SEP] identifier[page] operator[SEP] operator[SEP] identifier[Rectangle] identifier[pageSize] operator[=] identifier[writer] operator[SEP] identifier[reader] operator[SEP] identifier[getPageSizeWithRotation] operator[SEP] identifier[page] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[rotation] operator[SEP] {
Keyword[case] Other[90] operator[:] identifier[pageRect] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] identifier[pageRect] operator[SEP] identifier[getBottom] operator[SEP] operator[SEP] , identifier[pageSize] operator[SEP] identifier[getTop] operator[SEP] operator[SEP] operator[-] identifier[pageRect] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] , identifier[pageRect] operator[SEP] identifier[getTop] operator[SEP] operator[SEP] , identifier[pageSize] operator[SEP] identifier[getTop] operator[SEP] operator[SEP] operator[-] identifier[pageRect] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[180] operator[:] identifier[pageRect] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] identifier[pageSize] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[-] identifier[pageRect] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] , identifier[pageSize] operator[SEP] identifier[getTop] operator[SEP] operator[SEP] operator[-] identifier[pageRect] operator[SEP] identifier[getBottom] operator[SEP] operator[SEP] , identifier[pageSize] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[-] identifier[pageRect] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] , identifier[pageSize] operator[SEP] identifier[getTop] operator[SEP] operator[SEP] operator[-] identifier[pageRect] operator[SEP] identifier[getTop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[270] operator[:] identifier[pageRect] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] identifier[pageSize] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[-] identifier[pageRect] operator[SEP] identifier[getBottom] operator[SEP] operator[SEP] , identifier[pageRect] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] , identifier[pageSize] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[-] identifier[pageRect] operator[SEP] identifier[getTop] operator[SEP] operator[SEP] , identifier[pageRect] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[if] operator[SEP] identifier[rotation] operator[!=] Other[0] operator[SEP] identifier[pageRect] operator[SEP] identifier[normalize] operator[SEP] operator[SEP] operator[SEP] identifier[rect] operator[=] Keyword[new] identifier[Rectangle] operator[SEP] Keyword[this] operator[SEP] identifier[pageRect] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[pageRect] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void permute(final int[] arr) {
checkArgument(arr.length == sources.length);
final int[] tmp = new int[arr.length];
for (int i = 0; i < tmp.length; ++i) {
tmp[i] = arr[sources[i]];
}
System.arraycopy(tmp, 0, arr, 0, arr.length);
} | class class_name[name] begin[{]
method[permute, return_type[void], modifier[public], parameter[arr]] begin[{]
call[.checkArgument, parameter[binary_operation[member[arr.length], ==, member[sources.length]]]]
local_variable[type[int], tmp]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=arr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=sources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tmp, 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[System.arraycopy, parameter[member[.tmp], literal[0], member[.arr], literal[0], member[arr.length]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[permute] operator[SEP] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[arr] operator[SEP] {
identifier[checkArgument] operator[SEP] identifier[arr] operator[SEP] identifier[length] operator[==] identifier[sources] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[tmp] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[arr] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[tmp] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[tmp] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[arr] operator[SEP] identifier[sources] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[tmp] , Other[0] , identifier[arr] , Other[0] , identifier[arr] operator[SEP] identifier[length] operator[SEP] operator[SEP]
}
|
@Override
public Map<String, Object> unmarshall(JsonUnmarshallerContext context)
throws Exception {
Map<String, Object> map = new HashMap<>();
JsonToken token = context.getCurrentToken();
while (token != null && token != JsonToken.END_OBJECT) {
if (token == JsonToken.FIELD_NAME) {
String property = context.readText();
token = context.nextToken();
if (token == JsonToken.START_OBJECT) {
context.nextToken();
map.put(property, HalJsonMapUnmarshaller.getInstance().unmarshall(context));
} else if (token == JsonToken.START_ARRAY) {
context.nextToken();
map.put(property, HalJsonListUnmarshaller.getInstance().unmarshall(context));
} else {
map.put(property, JsonUnmarshallerUtil.getObjectForToken(token, context));
}
}
token = context.nextToken();
}
return map;
} | class class_name[name] begin[{]
method[unmarshall, return_type[type[Map]], modifier[public], parameter[context]] begin[{]
local_variable[type[Map], map]
local_variable[type[JsonToken], token]
while[binary_operation[binary_operation[member[.token], !=, literal[null]], &&, binary_operation[member[.token], !=, member[JsonToken.END_OBJECT]]]] begin[{]
if[binary_operation[member[.token], ==, member[JsonToken.FIELD_NAME]]] begin[{]
local_variable[type[String], property]
assign[member[.token], call[context.nextToken, parameter[]]]
if[binary_operation[member[.token], ==, member[JsonToken.START_OBJECT]]] begin[{]
call[context.nextToken, parameter[]]
call[map.put, parameter[member[.property], call[HalJsonMapUnmarshaller.getInstance, parameter[]]]]
else begin[{]
if[binary_operation[member[.token], ==, member[JsonToken.START_ARRAY]]] begin[{]
call[context.nextToken, parameter[]]
call[map.put, parameter[member[.property], call[HalJsonListUnmarshaller.getInstance, parameter[]]]]
else begin[{]
call[map.put, parameter[member[.property], call[JsonUnmarshallerUtil.getObjectForToken, parameter[member[.token], member[.context]]]]]
end[}]
end[}]
else begin[{]
None
end[}]
assign[member[.token], call[context.nextToken, parameter[]]]
end[}]
return[member[.map]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[unmarshall] operator[SEP] identifier[JsonUnmarshallerContext] identifier[context] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[JsonToken] identifier[token] operator[=] identifier[context] operator[SEP] identifier[getCurrentToken] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[token] operator[!=] Other[null] operator[&&] identifier[token] operator[!=] identifier[JsonToken] operator[SEP] identifier[END_OBJECT] operator[SEP] {
Keyword[if] operator[SEP] identifier[token] operator[==] identifier[JsonToken] operator[SEP] identifier[FIELD_NAME] operator[SEP] {
identifier[String] identifier[property] operator[=] identifier[context] operator[SEP] identifier[readText] operator[SEP] operator[SEP] operator[SEP] identifier[token] operator[=] identifier[context] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[==] identifier[JsonToken] operator[SEP] identifier[START_OBJECT] operator[SEP] {
identifier[context] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[property] , identifier[HalJsonMapUnmarshaller] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[unmarshall] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[token] operator[==] identifier[JsonToken] operator[SEP] identifier[START_ARRAY] operator[SEP] {
identifier[context] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[property] , identifier[HalJsonListUnmarshaller] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[unmarshall] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[property] , identifier[JsonUnmarshallerUtil] operator[SEP] identifier[getObjectForToken] operator[SEP] identifier[token] , identifier[context] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[token] operator[=] identifier[context] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[map] operator[SEP]
}
|
public TupleMRConfig buildConf() throws TupleMRException {
failIfEmpty(schemas, " Need to declare at least one intermediate schema");
failIfEmpty(groupByFields, " Need to declare group by fields");
TupleMRConfig conf = new TupleMRConfig();
conf.setIntermediateSchemas(schemas);
conf.setSchemaFieldAliases(fieldAliases);
conf.setGroupByFields(groupByFields);
conf.setRollupFrom(rollupFrom);
if (fieldsToPartition != null && fieldsToPartition.length != 0) {
conf.setCustomPartitionFields(Arrays.asList(fieldsToPartition));
}
Criteria convertedCommonOrder = convertCommonSortByToCriteria(commonOrderBy);
if (commonOrderBy != null && commonOrderBy.getSchemaOrder() != null) {
conf.setSourceOrder(commonOrderBy.getSchemaOrder());
} else {
conf.setSourceOrder(Order.ASC);// by default source order is ASC
}
conf.setCommonCriteria(convertedCommonOrder);
if (commonOrderBy != null) {
Map<String, Criteria> convertedParticularOrderings = getSecondarySortBys(
commonOrderBy, schemas, specificsOrderBy);
for (Map.Entry<String, Criteria> entry : convertedParticularOrderings.entrySet()) {
conf.setSecondarySortBy(entry.getKey(), entry.getValue());
}
}
return conf;
} | class class_name[name] begin[{]
method[buildConf, return_type[type[TupleMRConfig]], modifier[public], parameter[]] begin[{]
call[.failIfEmpty, parameter[member[.schemas], literal[" Need to declare at least one intermediate schema"]]]
call[.failIfEmpty, parameter[member[.groupByFields], literal[" Need to declare group by fields"]]]
local_variable[type[TupleMRConfig], conf]
call[conf.setIntermediateSchemas, parameter[member[.schemas]]]
call[conf.setSchemaFieldAliases, parameter[member[.fieldAliases]]]
call[conf.setGroupByFields, parameter[member[.groupByFields]]]
call[conf.setRollupFrom, parameter[member[.rollupFrom]]]
if[binary_operation[binary_operation[member[.fieldsToPartition], !=, literal[null]], &&, binary_operation[member[fieldsToPartition.length], !=, literal[0]]]] begin[{]
call[conf.setCustomPartitionFields, parameter[call[Arrays.asList, parameter[member[.fieldsToPartition]]]]]
else begin[{]
None
end[}]
local_variable[type[Criteria], convertedCommonOrder]
if[binary_operation[binary_operation[member[.commonOrderBy], !=, literal[null]], &&, binary_operation[call[commonOrderBy.getSchemaOrder, parameter[]], !=, literal[null]]]] begin[{]
call[conf.setSourceOrder, parameter[call[commonOrderBy.getSchemaOrder, parameter[]]]]
else begin[{]
call[conf.setSourceOrder, parameter[member[Order.ASC]]]
end[}]
call[conf.setCommonCriteria, parameter[member[.convertedCommonOrder]]]
if[binary_operation[member[.commonOrderBy], !=, literal[null]]] begin[{]
local_variable[type[Map], convertedParticularOrderings]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=setSecondarySortBy, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=convertedParticularOrderings, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Criteria, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
else begin[{]
None
end[}]
return[member[.conf]]
end[}]
END[}] | Keyword[public] identifier[TupleMRConfig] identifier[buildConf] operator[SEP] operator[SEP] Keyword[throws] identifier[TupleMRException] {
identifier[failIfEmpty] operator[SEP] identifier[schemas] , literal[String] operator[SEP] operator[SEP] identifier[failIfEmpty] operator[SEP] identifier[groupByFields] , literal[String] operator[SEP] operator[SEP] identifier[TupleMRConfig] identifier[conf] operator[=] Keyword[new] identifier[TupleMRConfig] operator[SEP] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[setIntermediateSchemas] operator[SEP] identifier[schemas] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[setSchemaFieldAliases] operator[SEP] identifier[fieldAliases] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[setGroupByFields] operator[SEP] identifier[groupByFields] operator[SEP] operator[SEP] identifier[conf] operator[SEP] identifier[setRollupFrom] operator[SEP] identifier[rollupFrom] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fieldsToPartition] operator[!=] Other[null] operator[&&] identifier[fieldsToPartition] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] {
identifier[conf] operator[SEP] identifier[setCustomPartitionFields] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[fieldsToPartition] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Criteria] identifier[convertedCommonOrder] operator[=] identifier[convertCommonSortByToCriteria] operator[SEP] identifier[commonOrderBy] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commonOrderBy] operator[!=] Other[null] operator[&&] identifier[commonOrderBy] operator[SEP] identifier[getSchemaOrder] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[conf] operator[SEP] identifier[setSourceOrder] operator[SEP] identifier[commonOrderBy] operator[SEP] identifier[getSchemaOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[conf] operator[SEP] identifier[setSourceOrder] operator[SEP] identifier[Order] operator[SEP] identifier[ASC] operator[SEP] operator[SEP]
}
identifier[conf] operator[SEP] identifier[setCommonCriteria] operator[SEP] identifier[convertedCommonOrder] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commonOrderBy] operator[!=] Other[null] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Criteria] operator[>] identifier[convertedParticularOrderings] operator[=] identifier[getSecondarySortBys] operator[SEP] identifier[commonOrderBy] , identifier[schemas] , identifier[specificsOrderBy] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Criteria] operator[>] identifier[entry] operator[:] identifier[convertedParticularOrderings] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[conf] operator[SEP] identifier[setSecondarySortBy] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[conf] operator[SEP]
}
|
public static SystemException newSystemException(Throwable cause, String message, Object... args) {
return new SystemException(format(message, args), cause);
} | class class_name[name] begin[{]
method[newSystemException, return_type[type[SystemException]], modifier[public static], parameter[cause, message, args]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SystemException, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[SystemException] identifier[newSystemException] operator[SEP] identifier[Throwable] identifier[cause] , identifier[String] identifier[message] , identifier[Object] operator[...] identifier[args] operator[SEP] {
Keyword[return] Keyword[new] identifier[SystemException] operator[SEP] identifier[format] operator[SEP] identifier[message] , identifier[args] operator[SEP] , identifier[cause] operator[SEP] operator[SEP]
}
|
public void expandToQueue( PriorityQueue priQ, double minDistance ) {
boolean isComp1 = isComposite(boundable1);
boolean isComp2 = isComposite(boundable2);
/**
* HEURISTIC: If both boundable are composite,
* choose the one with largest area to expand.
* Otherwise, simply expand whichever is composite.
*/
if (isComp1 && isComp2) {
if (area(boundable1) > area(boundable2)) {
expand(boundable1, boundable2, priQ, minDistance);
return;
} else {
expand(boundable2, boundable1, priQ, minDistance);
return;
}
} else if (isComp1) {
expand(boundable1, boundable2, priQ, minDistance);
return;
} else if (isComp2) {
expand(boundable2, boundable1, priQ, minDistance);
return;
}
throw new IllegalArgumentException("neither boundable is composite");
} | class class_name[name] begin[{]
method[expandToQueue, return_type[void], modifier[public], parameter[priQ, minDistance]] begin[{]
local_variable[type[boolean], isComp1]
local_variable[type[boolean], isComp2]
if[binary_operation[member[.isComp1], &&, member[.isComp2]]] begin[{]
if[binary_operation[call[.area, parameter[member[.boundable1]]], >, call[.area, parameter[member[.boundable2]]]]] begin[{]
call[.expand, parameter[member[.boundable1], member[.boundable2], member[.priQ], member[.minDistance]]]
return[None]
else begin[{]
call[.expand, parameter[member[.boundable2], member[.boundable1], member[.priQ], member[.minDistance]]]
return[None]
end[}]
else begin[{]
if[member[.isComp1]] begin[{]
call[.expand, parameter[member[.boundable1], member[.boundable2], member[.priQ], member[.minDistance]]]
return[None]
else begin[{]
if[member[.isComp2]] begin[{]
call[.expand, parameter[member[.boundable2], member[.boundable1], member[.priQ], member[.minDistance]]]
return[None]
else begin[{]
None
end[}]
end[}]
end[}]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="neither boundable is composite")], 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[void] identifier[expandToQueue] operator[SEP] identifier[PriorityQueue] identifier[priQ] , Keyword[double] identifier[minDistance] operator[SEP] {
Keyword[boolean] identifier[isComp1] operator[=] identifier[isComposite] operator[SEP] identifier[boundable1] operator[SEP] operator[SEP] Keyword[boolean] identifier[isComp2] operator[=] identifier[isComposite] operator[SEP] identifier[boundable2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isComp1] operator[&&] identifier[isComp2] operator[SEP] {
Keyword[if] operator[SEP] identifier[area] operator[SEP] identifier[boundable1] operator[SEP] operator[>] identifier[area] operator[SEP] identifier[boundable2] operator[SEP] operator[SEP] {
identifier[expand] operator[SEP] identifier[boundable1] , identifier[boundable2] , identifier[priQ] , identifier[minDistance] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[else] {
identifier[expand] operator[SEP] identifier[boundable2] , identifier[boundable1] , identifier[priQ] , identifier[minDistance] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[isComp1] operator[SEP] {
identifier[expand] operator[SEP] identifier[boundable1] , identifier[boundable2] , identifier[priQ] , identifier[minDistance] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[isComp2] operator[SEP] {
identifier[expand] operator[SEP] identifier[boundable2] , identifier[boundable1] , identifier[priQ] , identifier[minDistance] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public static <T extends TypeDefinition> ElementMatcher.Junction<T> ofSort(TypeDefinition.Sort sort) {
return ofSort(is(sort));
} | class class_name[name] begin[{]
method[ofSort, return_type[type[ElementMatcher]], modifier[public static], parameter[sort]] begin[{]
return[call[.ofSort, parameter[call[.is, parameter[member[.sort]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[TypeDefinition] operator[>] identifier[ElementMatcher] operator[SEP] identifier[Junction] operator[<] identifier[T] operator[>] identifier[ofSort] operator[SEP] identifier[TypeDefinition] operator[SEP] identifier[Sort] identifier[sort] operator[SEP] {
Keyword[return] identifier[ofSort] operator[SEP] identifier[is] operator[SEP] identifier[sort] operator[SEP] operator[SEP] operator[SEP]
}
|
public ThymeleafEngineConfigBuilder<P> setTemplateResolvers(final Set<? extends ITemplateResolver> templateResolvers) {
this.templateResolvers().clear();
this.templateResolvers().addAll(templateResolvers);
return this;
} | class class_name[name] begin[{]
method[setTemplateResolvers, return_type[type[ThymeleafEngineConfigBuilder]], modifier[public], parameter[templateResolvers]] begin[{]
THIS[call[None.templateResolvers, parameter[]]call[None.clear, parameter[]]]
THIS[call[None.templateResolvers, parameter[]]call[None.addAll, parameter[member[.templateResolvers]]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ThymeleafEngineConfigBuilder] operator[<] identifier[P] operator[>] identifier[setTemplateResolvers] operator[SEP] Keyword[final] identifier[Set] operator[<] operator[?] Keyword[extends] identifier[ITemplateResolver] operator[>] identifier[templateResolvers] operator[SEP] {
Keyword[this] operator[SEP] identifier[templateResolvers] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[templateResolvers] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[templateResolvers] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public R visitLink(LinkTree node, P p) {
R r = scan(node.getReference(), p);
r = scanAndReduce(node.getLabel(), p, r);
return r;
} | class class_name[name] begin[{]
method[visitLink, return_type[type[R]], modifier[public], parameter[node, p]] begin[{]
local_variable[type[R], r]
assign[member[.r], call[.scanAndReduce, parameter[call[node.getLabel, parameter[]], member[.p], member[.r]]]]
return[member[.r]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[R] identifier[visitLink] operator[SEP] identifier[LinkTree] identifier[node] , identifier[P] identifier[p] operator[SEP] {
identifier[R] identifier[r] operator[=] identifier[scan] operator[SEP] identifier[node] operator[SEP] identifier[getReference] operator[SEP] operator[SEP] , identifier[p] operator[SEP] operator[SEP] identifier[r] operator[=] identifier[scanAndReduce] operator[SEP] identifier[node] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] , identifier[p] , identifier[r] operator[SEP] operator[SEP] Keyword[return] identifier[r] operator[SEP]
}
|
@Override
public EClass getIfcTableRow() {
if (ifcTableRowEClass == null) {
ifcTableRowEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers()
.get(697);
}
return ifcTableRowEClass;
} | class class_name[name] begin[{]
method[getIfcTableRow, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.ifcTableRowEClass], ==, literal[null]]] begin[{]
assign[member[.ifcTableRowEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=697)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.ifcTableRowEClass]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcTableRow] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ifcTableRowEClass] operator[==] Other[null] operator[SEP] {
identifier[ifcTableRowEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[697] operator[SEP] operator[SEP]
}
Keyword[return] identifier[ifcTableRowEClass] operator[SEP]
}
|
public String pullDump2PC() {
String serial = device.getSerialNumber();
File dest = new File(FileUtils.getTempDirectory(), serial
+ ".xml");
String path = dest.getPath();
log.debug("pull dump file to pc's path {}", path);
CommandLine commandpull = adbCommand("pull", "/data/local/tmp/local/tmp/qian.xml", path);
String out = executeCommandQuietly(commandpull);
log.debug("pull dump file to pc's result {}", out);
return path;
} | class class_name[name] begin[{]
method[pullDump2PC, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[String], serial]
local_variable[type[File], dest]
local_variable[type[String], path]
call[log.debug, parameter[literal["pull dump file to pc's path {}"], member[.path]]]
local_variable[type[CommandLine], commandpull]
local_variable[type[String], out]
call[log.debug, parameter[literal["pull dump file to pc's result {}"], member[.out]]]
return[member[.path]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[pullDump2PC] operator[SEP] operator[SEP] {
identifier[String] identifier[serial] operator[=] identifier[device] operator[SEP] identifier[getSerialNumber] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[dest] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[FileUtils] operator[SEP] identifier[getTempDirectory] operator[SEP] operator[SEP] , identifier[serial] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[path] operator[=] identifier[dest] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[path] operator[SEP] operator[SEP] identifier[CommandLine] identifier[commandpull] operator[=] identifier[adbCommand] operator[SEP] literal[String] , literal[String] , identifier[path] operator[SEP] operator[SEP] identifier[String] identifier[out] operator[=] identifier[executeCommandQuietly] operator[SEP] identifier[commandpull] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[out] operator[SEP] operator[SEP] Keyword[return] identifier[path] operator[SEP]
}
|
public static String dateTime(GregorianCalendar gc) {
if(gc == null)return "";
TimeZone tz = gc.getTimeZone();
int tz1 = (tz.getRawOffset()+tz.getDSTSavings())/0x8CA0;
int tz1abs = Math.abs(tz1);
return String.format("%04d-%02d-%02dT%02d:%02d:%02d.%03d%c%02d:%02d",
gc.get(GregorianCalendar.YEAR),
gc.get(GregorianCalendar.MONTH)+1,
gc.get(GregorianCalendar.DAY_OF_MONTH),
gc.get(GregorianCalendar.HOUR),
gc.get(GregorianCalendar.MINUTE),
gc.get(GregorianCalendar.SECOND),
gc.get(GregorianCalendar.MILLISECOND),
tz1==tz1abs?'+':'-',
tz1abs/100,
((tz1abs-(tz1abs/100)*100)*6)/10 // Get the "10s", then convert to mins (without losing int place)
);
} | class class_name[name] begin[{]
method[dateTime, return_type[type[String]], modifier[public static], parameter[gc]] begin[{]
if[binary_operation[member[.gc], ==, literal[null]]] begin[{]
return[literal[""]]
else begin[{]
None
end[}]
local_variable[type[TimeZone], tz]
local_variable[type[int], tz1]
local_variable[type[int], tz1abs]
return[call[String.format, parameter[literal["%04d-%02d-%02dT%02d:%02d:%02d.%03d%c%02d:%02d"], call[gc.get, parameter[member[GregorianCalendar.YEAR]]], binary_operation[call[gc.get, parameter[member[GregorianCalendar.MONTH]]], +, literal[1]], call[gc.get, parameter[member[GregorianCalendar.DAY_OF_MONTH]]], call[gc.get, parameter[member[GregorianCalendar.HOUR]]], call[gc.get, parameter[member[GregorianCalendar.MINUTE]]], call[gc.get, parameter[member[GregorianCalendar.SECOND]]], call[gc.get, parameter[member[GregorianCalendar.MILLISECOND]]], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=tz1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=tz1abs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='+')), binary_operation[member[.tz1abs], /, literal[100]], binary_operation[binary_operation[binary_operation[member[.tz1abs], -, binary_operation[binary_operation[member[.tz1abs], /, literal[100]], *, literal[100]]], *, literal[6]], /, literal[10]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[dateTime] operator[SEP] identifier[GregorianCalendar] identifier[gc] operator[SEP] {
Keyword[if] operator[SEP] identifier[gc] operator[==] Other[null] operator[SEP] Keyword[return] literal[String] operator[SEP] identifier[TimeZone] identifier[tz] operator[=] identifier[gc] operator[SEP] identifier[getTimeZone] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[tz1] operator[=] operator[SEP] identifier[tz] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] operator[+] identifier[tz] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[SEP] operator[/] literal[Integer] operator[SEP] Keyword[int] identifier[tz1abs] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[tz1] operator[SEP] operator[SEP] Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[gc] operator[SEP] identifier[get] operator[SEP] identifier[GregorianCalendar] operator[SEP] identifier[YEAR] operator[SEP] , identifier[gc] operator[SEP] identifier[get] operator[SEP] identifier[GregorianCalendar] operator[SEP] identifier[MONTH] operator[SEP] operator[+] Other[1] , identifier[gc] operator[SEP] identifier[get] operator[SEP] identifier[GregorianCalendar] operator[SEP] identifier[DAY_OF_MONTH] operator[SEP] , identifier[gc] operator[SEP] identifier[get] operator[SEP] identifier[GregorianCalendar] operator[SEP] identifier[HOUR] operator[SEP] , identifier[gc] operator[SEP] identifier[get] operator[SEP] identifier[GregorianCalendar] operator[SEP] identifier[MINUTE] operator[SEP] , identifier[gc] operator[SEP] identifier[get] operator[SEP] identifier[GregorianCalendar] operator[SEP] identifier[SECOND] operator[SEP] , identifier[gc] operator[SEP] identifier[get] operator[SEP] identifier[GregorianCalendar] operator[SEP] identifier[MILLISECOND] operator[SEP] , identifier[tz1] operator[==] identifier[tz1abs] operator[?] literal[String] operator[:] literal[String] , identifier[tz1abs] operator[/] Other[100] , operator[SEP] operator[SEP] identifier[tz1abs] operator[-] operator[SEP] identifier[tz1abs] operator[/] Other[100] operator[SEP] operator[*] Other[100] operator[SEP] operator[*] Other[6] operator[SEP] operator[/] Other[10] operator[SEP] operator[SEP]
}
|
public void updateDataSerieOnScatterPlot(String scatterID, int index, double[][] dataSerie){
if (this.scatterPlots.containsKey(scatterID)){
if (this.scatterPlotsData.containsKey(scatterID)) {
double[][] current = this.scatterPlotsData.get(scatterID);
this.scatterPlotsData.put(scatterID, concatenateArrays(current, dataSerie));
} else{
// Create the data.
addDataSerieToScatterPlot(scatterID, dataSerie);
return;
}
this.scatterPlots.get(scatterID).updateSeries(index, this.scatterPlotsData.get(scatterID));
// this.scatterPlots.get(scatterID).addSeries(this.scatterPlotsData.get(scatterID), scatterID, null);
}
} | class class_name[name] begin[{]
method[updateDataSerieOnScatterPlot, return_type[void], modifier[public], parameter[scatterID, index, dataSerie]] begin[{]
if[THIS[member[None.scatterPlots]call[None.containsKey, parameter[member[.scatterID]]]]] begin[{]
if[THIS[member[None.scatterPlotsData]call[None.containsKey, parameter[member[.scatterID]]]]] begin[{]
local_variable[type[double], current]
THIS[member[None.scatterPlotsData]call[None.put, parameter[member[.scatterID], call[.concatenateArrays, parameter[member[.current], member[.dataSerie]]]]]]
else begin[{]
call[.addDataSerieToScatterPlot, parameter[member[.scatterID], member[.dataSerie]]]
return[None]
end[}]
THIS[member[None.scatterPlots]call[None.get, parameter[member[.scatterID]]]call[None.updateSeries, parameter[member[.index], THIS[member[None.scatterPlotsData]call[None.get, parameter[member[.scatterID]]]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[updateDataSerieOnScatterPlot] operator[SEP] identifier[String] identifier[scatterID] , Keyword[int] identifier[index] , Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dataSerie] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[scatterPlots] operator[SEP] identifier[containsKey] operator[SEP] identifier[scatterID] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[scatterPlotsData] operator[SEP] identifier[containsKey] operator[SEP] identifier[scatterID] operator[SEP] operator[SEP] {
Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[current] operator[=] Keyword[this] operator[SEP] identifier[scatterPlotsData] operator[SEP] identifier[get] operator[SEP] identifier[scatterID] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[scatterPlotsData] operator[SEP] identifier[put] operator[SEP] identifier[scatterID] , identifier[concatenateArrays] operator[SEP] identifier[current] , identifier[dataSerie] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[addDataSerieToScatterPlot] operator[SEP] identifier[scatterID] , identifier[dataSerie] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[scatterPlots] operator[SEP] identifier[get] operator[SEP] identifier[scatterID] operator[SEP] operator[SEP] identifier[updateSeries] operator[SEP] identifier[index] , Keyword[this] operator[SEP] identifier[scatterPlotsData] operator[SEP] identifier[get] operator[SEP] identifier[scatterID] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Deprecated
@Override
public StoryReporter defaultStoryReporter() {
StoryReporter storyReporter = super.defaultStoryReporter();
if (System.getProperty(SILENT_SUCCESS) == null) {
return storyReporter;
} else {
return new SilentSuccessFilter(storyReporter);
}
} | class class_name[name] begin[{]
method[defaultStoryReporter, return_type[type[StoryReporter]], modifier[public], parameter[]] begin[{]
local_variable[type[StoryReporter], storyReporter]
if[binary_operation[call[System.getProperty, parameter[member[.SILENT_SUCCESS]]], ==, literal[null]]] begin[{]
return[member[.storyReporter]]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=storyReporter, 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=SilentSuccessFilter, sub_type=None))]
end[}]
end[}]
END[}] | annotation[@] identifier[Deprecated] annotation[@] identifier[Override] Keyword[public] identifier[StoryReporter] identifier[defaultStoryReporter] operator[SEP] operator[SEP] {
identifier[StoryReporter] identifier[storyReporter] operator[=] Keyword[super] operator[SEP] identifier[defaultStoryReporter] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[SILENT_SUCCESS] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[storyReporter] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[SilentSuccessFilter] operator[SEP] identifier[storyReporter] operator[SEP] operator[SEP]
}
}
|
public static int computeMessageSetExtensionSize(
final int fieldNumber, final MessageLite value) {
return computeTagSize(WireFormat.MESSAGE_SET_ITEM) * 2 +
computeUInt32Size(WireFormat.MESSAGE_SET_TYPE_ID, fieldNumber) +
computeMessageSize(WireFormat.MESSAGE_SET_MESSAGE, value);
} | class class_name[name] begin[{]
method[computeMessageSetExtensionSize, return_type[type[int]], modifier[public static], parameter[fieldNumber, value]] begin[{]
return[binary_operation[binary_operation[binary_operation[call[.computeTagSize, parameter[member[WireFormat.MESSAGE_SET_ITEM]]], *, literal[2]], +, call[.computeUInt32Size, parameter[member[WireFormat.MESSAGE_SET_TYPE_ID], member[.fieldNumber]]]], +, call[.computeMessageSize, parameter[member[WireFormat.MESSAGE_SET_MESSAGE], member[.value]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[computeMessageSetExtensionSize] operator[SEP] Keyword[final] Keyword[int] identifier[fieldNumber] , Keyword[final] identifier[MessageLite] identifier[value] operator[SEP] {
Keyword[return] identifier[computeTagSize] operator[SEP] identifier[WireFormat] operator[SEP] identifier[MESSAGE_SET_ITEM] operator[SEP] operator[*] Other[2] operator[+] identifier[computeUInt32Size] operator[SEP] identifier[WireFormat] operator[SEP] identifier[MESSAGE_SET_TYPE_ID] , identifier[fieldNumber] operator[SEP] operator[+] identifier[computeMessageSize] operator[SEP] identifier[WireFormat] operator[SEP] identifier[MESSAGE_SET_MESSAGE] , identifier[value] operator[SEP] operator[SEP]
}
|
@Override
public void sendResponseHeaders() throws IOException, MessageSentException {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "sendResponseHeaders(sync)");
}
if (!headersParsed()) {
// request message must have the headers parsed prior to sending
// any data out (this is a completely invalid state in the channel
// above)
IOException ioe = new IOException("Request not read yet");
FFDCFilter.processException(ioe,
CLASS_NAME + ".sendResponseHeaders", "594");
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Attempt to send response without a request msg");
}
throw ioe;
}
if (headersSent()) {
throw new MessageSentException("Message already sent");
}
sendHeaders(getResponseImpl());
if (getResponseImpl().isTemporaryStatusCode()) {
// allow multiple temporary responses to be sent out
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Temp response sent, resetting send flags.");
}
resetWrite();
}
} | class class_name[name] begin[{]
method[sendResponseHeaders, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["sendResponseHeaders(sync)"]]]
else begin[{]
None
end[}]
if[call[.headersParsed, parameter[]]] begin[{]
local_variable[type[IOException], ioe]
call[FFDCFilter.processException, parameter[member[.ioe], binary_operation[member[.CLASS_NAME], +, literal[".sendResponseHeaders"]], literal["594"]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["Attempt to send response without a request msg"]]]
else begin[{]
None
end[}]
ThrowStatement(expression=MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
if[call[.headersSent, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Message already sent")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MessageSentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.sendHeaders, parameter[call[.getResponseImpl, parameter[]]]]
if[call[.getResponseImpl, parameter[]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], literal["Temp response sent, resetting send flags."]]]
else begin[{]
None
end[}]
call[.resetWrite, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[sendResponseHeaders] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] , identifier[MessageSentException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[headersParsed] operator[SEP] operator[SEP] operator[SEP] {
identifier[IOException] identifier[ioe] operator[=] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[ioe] , identifier[CLASS_NAME] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[ioe] operator[SEP]
}
Keyword[if] operator[SEP] identifier[headersSent] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MessageSentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[sendHeaders] operator[SEP] identifier[getResponseImpl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getResponseImpl] operator[SEP] operator[SEP] operator[SEP] identifier[isTemporaryStatusCode] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
identifier[resetWrite] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected void expandItems(MaterialTreeItem item) {
item.expand();
item.setHide(true);
item.getTreeItems().forEach(this::expandItems);
} | class class_name[name] begin[{]
method[expandItems, return_type[void], modifier[protected], parameter[item]] begin[{]
call[item.expand, parameter[]]
call[item.setHide, parameter[literal[true]]]
call[item.getTreeItems, parameter[]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[expandItems] operator[SEP] identifier[MaterialTreeItem] identifier[item] operator[SEP] {
identifier[item] operator[SEP] identifier[expand] operator[SEP] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[setHide] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[getTreeItems] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] Keyword[this] operator[::] identifier[expandItems] operator[SEP] operator[SEP]
}
|
@Override
protected int writeBytesWireFormat ( byte[] dst, int dstIndex ) {
int start = dstIndex;
SMBUtil.writeInt2(36, dst, dstIndex);
SMBUtil.writeInt2(this.dialects.length, dst, dstIndex + 2);
dstIndex += 4;
SMBUtil.writeInt2(this.securityMode, dst, dstIndex);
SMBUtil.writeInt2(0, dst, dstIndex + 2); // Reserved
dstIndex += 4;
SMBUtil.writeInt4(this.capabilities, dst, dstIndex);
dstIndex += 4;
System.arraycopy(this.clientGuid, 0, dst, dstIndex, 16);
dstIndex += 16;
// if SMB 3.11 support negotiateContextOffset/negotiateContextCount
int negotitateContextOffsetOffset = 0;
if ( this.negotiateContexts == null || this.negotiateContexts.length == 0 ) {
SMBUtil.writeInt8(0, dst, dstIndex);
}
else {
negotitateContextOffsetOffset = dstIndex;
SMBUtil.writeInt2(this.negotiateContexts.length, dst, dstIndex + 4);
SMBUtil.writeInt2(0, dst, dstIndex + 6);
}
dstIndex += 8;
for ( int dialect : this.dialects ) {
SMBUtil.writeInt2(dialect, dst, dstIndex);
dstIndex += 2;
}
dstIndex += pad8(dstIndex);
if ( this.negotiateContexts != null && this.negotiateContexts.length != 0 ) {
SMBUtil.writeInt4(dstIndex - getHeaderStart(), dst, negotitateContextOffsetOffset);
for ( NegotiateContextRequest nc : this.negotiateContexts ) {
SMBUtil.writeInt2(nc.getContextType(), dst, dstIndex);
int lenOffset = dstIndex + 2;
dstIndex += 4;
SMBUtil.writeInt4(0, dst, dstIndex);
dstIndex += 4; // Reserved
int dataLen = size8(nc.encode(dst, dstIndex));
SMBUtil.writeInt2(dataLen, dst, lenOffset);
dstIndex += dataLen;
}
}
return dstIndex - start;
} | class class_name[name] begin[{]
method[writeBytesWireFormat, return_type[type[int]], modifier[protected], parameter[dst, dstIndex]] begin[{]
local_variable[type[int], start]
call[SMBUtil.writeInt2, parameter[literal[36], member[.dst], member[.dstIndex]]]
call[SMBUtil.writeInt2, parameter[THIS[member[None.dialects]member[None.length]], member[.dst], binary_operation[member[.dstIndex], +, literal[2]]]]
assign[member[.dstIndex], literal[4]]
call[SMBUtil.writeInt2, parameter[THIS[member[None.securityMode]], member[.dst], member[.dstIndex]]]
call[SMBUtil.writeInt2, parameter[literal[0], member[.dst], binary_operation[member[.dstIndex], +, literal[2]]]]
assign[member[.dstIndex], literal[4]]
call[SMBUtil.writeInt4, parameter[THIS[member[None.capabilities]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[4]]
call[System.arraycopy, parameter[THIS[member[None.clientGuid]], literal[0], member[.dst], member[.dstIndex], literal[16]]]
assign[member[.dstIndex], literal[16]]
local_variable[type[int], negotitateContextOffsetOffset]
if[binary_operation[binary_operation[THIS[member[None.negotiateContexts]], ==, literal[null]], ||, binary_operation[THIS[member[None.negotiateContexts]member[None.length]], ==, literal[0]]]] begin[{]
call[SMBUtil.writeInt8, parameter[literal[0], member[.dst], member[.dstIndex]]]
else begin[{]
assign[member[.negotitateContextOffsetOffset], member[.dstIndex]]
call[SMBUtil.writeInt2, parameter[THIS[member[None.negotiateContexts]member[None.length]], member[.dst], binary_operation[member[.dstIndex], +, literal[4]]]]
call[SMBUtil.writeInt2, parameter[literal[0], member[.dst], binary_operation[member[.dstIndex], +, literal[6]]]]
end[}]
assign[member[.dstIndex], literal[8]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dialect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dstIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt2, postfix_operators=[], prefix_operators=[], qualifier=SMBUtil, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dstIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dialects, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dialect)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None)
assign[member[.dstIndex], call[.pad8, parameter[member[.dstIndex]]]]
if[binary_operation[binary_operation[THIS[member[None.negotiateContexts]], !=, literal[null]], &&, binary_operation[THIS[member[None.negotiateContexts]member[None.length]], !=, literal[0]]]] begin[{]
call[SMBUtil.writeInt4, parameter[binary_operation[member[.dstIndex], -, call[.getHeaderStart, parameter[]]], member[.dst], member[.negotitateContextOffsetOffset]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getContextType, postfix_operators=[], prefix_operators=[], qualifier=nc, selectors=[], type_arguments=None), MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dstIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt2, postfix_operators=[], prefix_operators=[], qualifier=SMBUtil, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=dstIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), name=lenOffset)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dstIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dstIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt4, postfix_operators=[], prefix_operators=[], qualifier=SMBUtil, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dstIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dstIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=nc, selectors=[], type_arguments=None)], member=size8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=dataLen)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dataLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lenOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt2, postfix_operators=[], prefix_operators=[], qualifier=SMBUtil, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dstIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=dataLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=negotiateContexts, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=nc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NegotiateContextRequest, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[binary_operation[member[.dstIndex], -, member[.start]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[int] identifier[writeBytesWireFormat] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[dst] , Keyword[int] identifier[dstIndex] operator[SEP] {
Keyword[int] identifier[start] operator[=] identifier[dstIndex] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] Other[36] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] Keyword[this] operator[SEP] identifier[dialects] operator[SEP] identifier[length] , identifier[dst] , identifier[dstIndex] operator[+] Other[2] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] Keyword[this] operator[SEP] identifier[securityMode] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] Other[0] , identifier[dst] , identifier[dstIndex] operator[+] Other[2] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Keyword[this] operator[SEP] identifier[capabilities] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] Keyword[this] operator[SEP] identifier[clientGuid] , Other[0] , identifier[dst] , identifier[dstIndex] , Other[16] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[16] operator[SEP] Keyword[int] identifier[negotitateContextOffsetOffset] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[negotiateContexts] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[negotiateContexts] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] {
identifier[SMBUtil] operator[SEP] identifier[writeInt8] operator[SEP] Other[0] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[negotitateContextOffsetOffset] operator[=] identifier[dstIndex] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] Keyword[this] operator[SEP] identifier[negotiateContexts] operator[SEP] identifier[length] , identifier[dst] , identifier[dstIndex] operator[+] Other[4] operator[SEP] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] Other[0] , identifier[dst] , identifier[dstIndex] operator[+] Other[6] operator[SEP] operator[SEP]
}
identifier[dstIndex] operator[+=] Other[8] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[dialect] operator[:] Keyword[this] operator[SEP] identifier[dialects] operator[SEP] {
identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] identifier[dialect] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[2] operator[SEP]
}
identifier[dstIndex] operator[+=] identifier[pad8] operator[SEP] identifier[dstIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[negotiateContexts] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[negotiateContexts] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] {
identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] identifier[dstIndex] operator[-] identifier[getHeaderStart] operator[SEP] operator[SEP] , identifier[dst] , identifier[negotitateContextOffsetOffset] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[NegotiateContextRequest] identifier[nc] operator[:] Keyword[this] operator[SEP] identifier[negotiateContexts] operator[SEP] {
identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] identifier[nc] operator[SEP] identifier[getContextType] operator[SEP] operator[SEP] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] Keyword[int] identifier[lenOffset] operator[=] identifier[dstIndex] operator[+] Other[2] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Other[0] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] Keyword[int] identifier[dataLen] operator[=] identifier[size8] operator[SEP] identifier[nc] operator[SEP] identifier[encode] operator[SEP] identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt2] operator[SEP] identifier[dataLen] , identifier[dst] , identifier[lenOffset] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] identifier[dataLen] operator[SEP]
}
}
Keyword[return] identifier[dstIndex] operator[-] identifier[start] operator[SEP]
}
|
static long[] bitMatrixOfSketch(final CpcSketch sketch) {
final int k = (1 << sketch.lgK);
final int offset = sketch.windowOffset;
assert (offset >= 0) && (offset <= 56);
final long[] matrix = new long[k];
if (sketch.numCoupons == 0) {
return matrix; // Returning a matrix of zeros rather than NULL.
}
//Fill the matrix with default rows in which the "early zone" is filled with ones.
//This is essential for the routine's O(k) time cost (as opposed to O(C)).
final long defaultRow = (1L << offset) - 1L;
Arrays.fill(matrix, defaultRow);
final byte[] window = sketch.slidingWindow;
if (window != null) { // In other words, we are in window mode, not sparse mode.
for (int i = 0; i < k; i++) { // set the window bits, trusting the sketch's current offset.
matrix[i] |= ((window[i] & 0XFFL) << offset);
}
}
final PairTable table = sketch.pairTable;
assert (table != null);
final int[] slots = table.getSlotsArr();
final int numSlots = 1 << table.getLgSizeInts();
for (int i = 0; i < numSlots; i++) {
final int rowCol = slots[i];
if (rowCol != -1) {
final int col = rowCol & 63;
final int row = rowCol >>> 6;
// Flip the specified matrix bit from its default value.
// In the "early" zone the bit changes from 1 to 0.
// In the "late" zone the bit changes from 0 to 1.
matrix[row] ^= (1L << col);
}
}
return matrix;
} | class class_name[name] begin[{]
method[bitMatrixOfSketch, return_type[type[long]], modifier[static], parameter[sketch]] begin[{]
local_variable[type[int], k]
local_variable[type[int], offset]
AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=56), operator=<=), operator=&&), label=None, value=None)
local_variable[type[long], matrix]
if[binary_operation[member[sketch.numCoupons], ==, literal[0]]] begin[{]
return[member[.matrix]]
else begin[{]
None
end[}]
local_variable[type[long], defaultRow]
call[Arrays.fill, parameter[member[.matrix], member[.defaultRow]]]
local_variable[type[byte], window]
if[binary_operation[member[.window], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=|=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=window, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0XFFL), operator=&), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
local_variable[type[PairTable], table]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
local_variable[type[int], slots]
local_variable[type[int], numSlots]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=slots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=rowCol)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rowCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=rowCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=63), operator=&), name=col)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=rowCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=>>>), name=row)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=^=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1L), operandr=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numSlots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.matrix]]
end[}]
END[}] | Keyword[static] Keyword[long] operator[SEP] operator[SEP] identifier[bitMatrixOfSketch] operator[SEP] Keyword[final] identifier[CpcSketch] identifier[sketch] operator[SEP] {
Keyword[final] Keyword[int] identifier[k] operator[=] operator[SEP] Other[1] operator[<<] identifier[sketch] operator[SEP] identifier[lgK] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[offset] operator[=] identifier[sketch] operator[SEP] identifier[windowOffset] operator[SEP] Keyword[assert] operator[SEP] identifier[offset] operator[>=] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[offset] operator[<=] Other[56] operator[SEP] operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[matrix] operator[=] Keyword[new] Keyword[long] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sketch] operator[SEP] identifier[numCoupons] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[matrix] operator[SEP]
}
Keyword[final] Keyword[long] identifier[defaultRow] operator[=] operator[SEP] Other[1L] operator[<<] identifier[offset] operator[SEP] operator[-] Other[1L] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[matrix] , identifier[defaultRow] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[window] operator[=] identifier[sketch] operator[SEP] identifier[slidingWindow] operator[SEP] Keyword[if] operator[SEP] identifier[window] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[k] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[|=] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[i] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] identifier[offset] operator[SEP] operator[SEP]
}
}
Keyword[final] identifier[PairTable] identifier[table] operator[=] identifier[sketch] operator[SEP] identifier[pairTable] operator[SEP] Keyword[assert] operator[SEP] identifier[table] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[slots] operator[=] identifier[table] operator[SEP] identifier[getSlotsArr] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[numSlots] operator[=] Other[1] operator[<<] identifier[table] operator[SEP] identifier[getLgSizeInts] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numSlots] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] Keyword[int] identifier[rowCol] operator[=] identifier[slots] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rowCol] operator[!=] operator[-] Other[1] operator[SEP] {
Keyword[final] Keyword[int] identifier[col] operator[=] identifier[rowCol] operator[&] Other[63] operator[SEP] Keyword[final] Keyword[int] identifier[row] operator[=] identifier[rowCol] operator[>] operator[>] operator[>] Other[6] operator[SEP] identifier[matrix] operator[SEP] identifier[row] operator[SEP] operator[^=] operator[SEP] Other[1L] operator[<<] identifier[col] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[matrix] operator[SEP]
}
|
public void modifyIdentityProvider(final Map<String, Object> changedValues) {
AddressTemplate template = IDENTITY_PROVIDER_TEMPLATE.replaceWildcards(federation, identityProvider);
modify(template, identityProvider, changedValues);
} | class class_name[name] begin[{]
method[modifyIdentityProvider, return_type[void], modifier[public], parameter[changedValues]] begin[{]
local_variable[type[AddressTemplate], template]
call[.modify, parameter[member[.template], member[.identityProvider], member[.changedValues]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[modifyIdentityProvider] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[changedValues] operator[SEP] {
identifier[AddressTemplate] identifier[template] operator[=] identifier[IDENTITY_PROVIDER_TEMPLATE] operator[SEP] identifier[replaceWildcards] operator[SEP] identifier[federation] , identifier[identityProvider] operator[SEP] operator[SEP] identifier[modify] operator[SEP] identifier[template] , identifier[identityProvider] , identifier[changedValues] operator[SEP] operator[SEP]
}
|
public void updateServiceInstanceInternalStatus(String serviceName, String instanceId, OperationalStatus status, final RegistrationCallback cb, Object context){
ProtocolHeader header = new ProtocolHeader();
header.setType(ProtocolType.UpdateServiceInstanceInternalStatus);
UpdateServiceInstanceInternalStatusProtocol protocol = new UpdateServiceInstanceInternalStatusProtocol(serviceName, instanceId, status);
ProtocolCallback pcb = new ProtocolCallback(){
@Override
public void call(boolean result, Response response,
ErrorCode error, Object ctx) {
cb.call(result, error, ctx);
}
};
connection.submitCallbackRequest(header, protocol, pcb, context);
} | class class_name[name] begin[{]
method[updateServiceInstanceInternalStatus, return_type[void], modifier[public], parameter[serviceName, instanceId, status, cb, context]] begin[{]
local_variable[type[ProtocolHeader], header]
call[header.setType, parameter[member[ProtocolType.UpdateServiceInstanceInternalStatus]]]
local_variable[type[UpdateServiceInstanceInternalStatusProtocol], protocol]
local_variable[type[ProtocolCallback], pcb]
call[connection.submitCallbackRequest, parameter[member[.header], member[.protocol], member[.pcb], member[.context]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[updateServiceInstanceInternalStatus] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[instanceId] , identifier[OperationalStatus] identifier[status] , Keyword[final] identifier[RegistrationCallback] identifier[cb] , identifier[Object] identifier[context] operator[SEP] {
identifier[ProtocolHeader] identifier[header] operator[=] Keyword[new] identifier[ProtocolHeader] operator[SEP] operator[SEP] operator[SEP] identifier[header] operator[SEP] identifier[setType] operator[SEP] identifier[ProtocolType] operator[SEP] identifier[UpdateServiceInstanceInternalStatus] operator[SEP] operator[SEP] identifier[UpdateServiceInstanceInternalStatusProtocol] identifier[protocol] operator[=] Keyword[new] identifier[UpdateServiceInstanceInternalStatusProtocol] operator[SEP] identifier[serviceName] , identifier[instanceId] , identifier[status] operator[SEP] operator[SEP] identifier[ProtocolCallback] identifier[pcb] operator[=] Keyword[new] identifier[ProtocolCallback] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[call] operator[SEP] Keyword[boolean] identifier[result] , identifier[Response] identifier[response] , identifier[ErrorCode] identifier[error] , identifier[Object] identifier[ctx] operator[SEP] {
identifier[cb] operator[SEP] identifier[call] operator[SEP] identifier[result] , identifier[error] , identifier[ctx] operator[SEP] operator[SEP]
}
} operator[SEP] identifier[connection] operator[SEP] identifier[submitCallbackRequest] operator[SEP] identifier[header] , identifier[protocol] , identifier[pcb] , identifier[context] operator[SEP] operator[SEP]
}
|
private static BatchExecutor getGetBatchExecutor(BeanMappingParam param, BeanMappingObject config) {
BatchExecutor executor = config.getGetBatchExecutor();
if (executor != null) { // 如果已经生成,则直接返回
return executor;
}
if (canBatch(config.getBehavior()) == false) {
config.setBatch(false);
return null;
}
List<String> srcFields = new ArrayList<String>();
List<Class> srcArgs = new ArrayList<Class>();
// 处理src操作数据搜集
Class locatorClass = param.getSrcRef().getClass();
for (BeanMappingField beanField : config.getBeanFields()) {
String srcField = beanField.getSrcField().getName();
Class srcArg = beanField.getSrcField().getClazz();
if (StringUtils.isEmpty(srcField) || srcArg == null) {
return null; // 直接不予处理
}
Class selfLocatorClass = beanField.getSrcField().getLocatorClass();
if (selfLocatorClass != null && selfLocatorClass != locatorClass) {
config.setBatch(false);// 直接改写为false,发现locatorClass存在于不同的class
}
if (canBatch(beanField.getBehavior()) == false) {
config.setBatch(false);
return null;
}
GetExecutor get = beanField.getGetExecutor();// 只针对property进行batch优化
if (get != null && (get instanceof FastPropertyGetExecutor || get instanceof PropertyGetExecutor) == false) {
config.setBatch(false);
return null;
}
// 搜集信息
srcFields.add(srcField);
srcArgs.add(srcArg);
}
// 生成下src批量处理器
executor = Uberspector.getInstance().getBatchExecutor(locatorClass,
srcFields.toArray(new String[srcFields.size()]),
srcArgs.toArray(new Class[srcArgs.size()]));
if (config.getBehavior().isDebug() && logger.isDebugEnabled()) {
logger.debug("SrcClass[" + param.getSrcRef().getClass() + "]GetBatchExecutor is init");
}
config.setGetBatchExecutor(executor);
return executor;
} | class class_name[name] begin[{]
method[getGetBatchExecutor, return_type[type[BatchExecutor]], modifier[private static], parameter[param, config]] begin[{]
local_variable[type[BatchExecutor], executor]
if[binary_operation[member[.executor], !=, literal[null]]] begin[{]
return[member[.executor]]
else begin[{]
None
end[}]
if[binary_operation[call[.canBatch, parameter[call[config.getBehavior, parameter[]]]], ==, literal[false]]] begin[{]
call[config.setBatch, parameter[literal[false]]]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[List], srcFields]
local_variable[type[List], srcArgs]
local_variable[type[Class], locatorClass]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSrcField, postfix_operators=[], prefix_operators=[], qualifier=beanField, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=srcField)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSrcField, postfix_operators=[], prefix_operators=[], qualifier=beanField, selectors=[MethodInvocation(arguments=[], member=getClazz, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=srcArg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=srcField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=srcArg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSrcField, postfix_operators=[], prefix_operators=[], qualifier=beanField, selectors=[MethodInvocation(arguments=[], member=getLocatorClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=selfLocatorClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=selfLocatorClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=selfLocatorClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=locatorClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), 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=false)], member=setBatch, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBehavior, postfix_operators=[], prefix_operators=[], qualifier=beanField, selectors=[], type_arguments=None)], member=canBatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), 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=false)], member=setBatch, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getGetExecutor, postfix_operators=[], prefix_operators=[], qualifier=beanField, selectors=[], type_arguments=None), name=get)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GetExecutor, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=FastPropertyGetExecutor, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=PropertyGetExecutor, sub_type=None), operator=instanceof), operator=||), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), 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=false)], member=setBatch, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=srcField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=srcFields, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=srcArg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=srcArgs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getBeanFields, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=beanField)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BeanMappingField, sub_type=None))), label=None)
assign[member[.executor], call[Uberspector.getInstance, parameter[]]]
if[binary_operation[call[config.getBehavior, parameter[]], &&, call[logger.isDebugEnabled, parameter[]]]] begin[{]
call[logger.debug, parameter[binary_operation[binary_operation[literal["SrcClass["], +, call[param.getSrcRef, parameter[]]], +, literal["]GetBatchExecutor is init"]]]]
else begin[{]
None
end[}]
call[config.setGetBatchExecutor, parameter[member[.executor]]]
return[member[.executor]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[BatchExecutor] identifier[getGetBatchExecutor] operator[SEP] identifier[BeanMappingParam] identifier[param] , identifier[BeanMappingObject] identifier[config] operator[SEP] {
identifier[BatchExecutor] identifier[executor] operator[=] identifier[config] operator[SEP] identifier[getGetBatchExecutor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[executor] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[executor] operator[SEP]
}
Keyword[if] operator[SEP] identifier[canBatch] operator[SEP] identifier[config] operator[SEP] identifier[getBehavior] operator[SEP] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
identifier[config] operator[SEP] identifier[setBatch] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[List] operator[<] identifier[String] operator[>] identifier[srcFields] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Class] operator[>] identifier[srcArgs] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Class] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Class] identifier[locatorClass] operator[=] identifier[param] operator[SEP] identifier[getSrcRef] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BeanMappingField] identifier[beanField] operator[:] identifier[config] operator[SEP] identifier[getBeanFields] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[srcField] operator[=] identifier[beanField] operator[SEP] identifier[getSrcField] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[Class] identifier[srcArg] operator[=] identifier[beanField] operator[SEP] identifier[getSrcField] operator[SEP] operator[SEP] operator[SEP] identifier[getClazz] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[srcField] operator[SEP] operator[||] identifier[srcArg] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[Class] identifier[selfLocatorClass] operator[=] identifier[beanField] operator[SEP] identifier[getSrcField] operator[SEP] operator[SEP] operator[SEP] identifier[getLocatorClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selfLocatorClass] operator[!=] Other[null] operator[&&] identifier[selfLocatorClass] operator[!=] identifier[locatorClass] operator[SEP] {
identifier[config] operator[SEP] identifier[setBatch] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[canBatch] operator[SEP] identifier[beanField] operator[SEP] identifier[getBehavior] operator[SEP] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
identifier[config] operator[SEP] identifier[setBatch] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[GetExecutor] identifier[get] operator[=] identifier[beanField] operator[SEP] identifier[getGetExecutor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[get] operator[!=] Other[null] operator[&&] operator[SEP] identifier[get] Keyword[instanceof] identifier[FastPropertyGetExecutor] operator[||] identifier[get] Keyword[instanceof] identifier[PropertyGetExecutor] operator[SEP] operator[==] literal[boolean] operator[SEP] {
identifier[config] operator[SEP] identifier[setBatch] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
identifier[srcFields] operator[SEP] identifier[add] operator[SEP] identifier[srcField] operator[SEP] operator[SEP] identifier[srcArgs] operator[SEP] identifier[add] operator[SEP] identifier[srcArg] operator[SEP] operator[SEP]
}
identifier[executor] operator[=] identifier[Uberspector] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getBatchExecutor] operator[SEP] identifier[locatorClass] , identifier[srcFields] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[srcFields] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[srcArgs] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Class] operator[SEP] identifier[srcArgs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[getBehavior] operator[SEP] operator[SEP] operator[SEP] identifier[isDebug] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[param] operator[SEP] identifier[getSrcRef] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[config] operator[SEP] identifier[setGetBatchExecutor] operator[SEP] identifier[executor] operator[SEP] operator[SEP] Keyword[return] identifier[executor] operator[SEP]
}
|
public void subscribeToEvent(
ResultPartitionID partitionId,
EventListener<TaskEvent> eventListener,
Class<? extends TaskEvent> eventType) {
checkNotNull(partitionId);
checkNotNull(eventListener);
checkNotNull(eventType);
TaskEventHandler taskEventHandler;
synchronized (registeredHandlers) {
taskEventHandler = registeredHandlers.get(partitionId);
}
if (taskEventHandler == null) {
throw new IllegalStateException(
"Partition " + partitionId + " not registered at task event dispatcher.");
}
taskEventHandler.subscribe(eventListener, eventType);
} | class class_name[name] begin[{]
method[subscribeToEvent, return_type[void], modifier[public], parameter[partitionId, eventListener, eventType]] begin[{]
call[.checkNotNull, parameter[member[.partitionId]]]
call[.checkNotNull, parameter[member[.eventListener]]]
call[.checkNotNull, parameter[member[.eventType]]]
local_variable[type[TaskEventHandler], taskEventHandler]
SYNCHRONIZED[member[.registeredHandlers]] BEGIN[{]
assign[member[.taskEventHandler], call[registeredHandlers.get, parameter[member[.partitionId]]]]
END[}]
if[binary_operation[member[.taskEventHandler], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Partition "), operandr=MemberReference(member=partitionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not registered at task event dispatcher."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[taskEventHandler.subscribe, parameter[member[.eventListener], member[.eventType]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[subscribeToEvent] operator[SEP] identifier[ResultPartitionID] identifier[partitionId] , identifier[EventListener] operator[<] identifier[TaskEvent] operator[>] identifier[eventListener] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[TaskEvent] operator[>] identifier[eventType] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[partitionId] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[eventListener] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[eventType] operator[SEP] operator[SEP] identifier[TaskEventHandler] identifier[taskEventHandler] operator[SEP] Keyword[synchronized] operator[SEP] identifier[registeredHandlers] operator[SEP] {
identifier[taskEventHandler] operator[=] identifier[registeredHandlers] operator[SEP] identifier[get] operator[SEP] identifier[partitionId] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[taskEventHandler] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[partitionId] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[taskEventHandler] operator[SEP] identifier[subscribe] operator[SEP] identifier[eventListener] , identifier[eventType] operator[SEP] operator[SEP]
}
|
public String showStatus() {
// Update the currently deployed components.
updateDeployedComponents();
String output = "";
output += "<p>Deployable Units Waiting For Install:</p>";
for (DeployableUnit waitingDU : waitingForInstallDUs) {
output += "+-- " + waitingDU.getDeploymentInfoShortName() + "<br>";
for (String dependency : waitingDU.getExternalDependencies()) {
if (!deployedComponents.contains(dependency))
dependency += " <strong>MISSING!</strong>";
output += " +-- depends on " + dependency + "<br>";
}
}
output += "<p>Deployable Units Waiting For Uninstall:</p>";
for (DeployableUnit waitingDU : waitingForUninstallDUs) {
output += "+-- " + waitingDU.getDeploymentInfoShortName() + "<br>";
}
return output;
} | class class_name[name] begin[{]
method[showStatus, return_type[type[String]], modifier[public], parameter[]] begin[{]
call[.updateDeployedComponents, parameter[]]
local_variable[type[String], output]
assign[member[.output], literal["<p>Deployable Units Waiting For Install:</p>"]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+-- "), operandr=MethodInvocation(arguments=[], member=getDeploymentInfoShortName, postfix_operators=[], prefix_operators=[], qualifier=waitingDU, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<br>"), operator=+)), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=dependency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=deployedComponents, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=dependency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" <strong>MISSING!</strong>")), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" +-- depends on "), operandr=MemberReference(member=dependency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<br>"), operator=+)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getExternalDependencies, postfix_operators=[], prefix_operators=[], qualifier=waitingDU, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dependency)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=waitingForInstallDUs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=waitingDU)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DeployableUnit, sub_type=None))), label=None)
assign[member[.output], literal["<p>Deployable Units Waiting For Uninstall:</p>"]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+-- "), operandr=MethodInvocation(arguments=[], member=getDeploymentInfoShortName, postfix_operators=[], prefix_operators=[], qualifier=waitingDU, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<br>"), operator=+)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=waitingForUninstallDUs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=waitingDU)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DeployableUnit, sub_type=None))), label=None)
return[member[.output]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[showStatus] operator[SEP] operator[SEP] {
identifier[updateDeployedComponents] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[output] operator[=] literal[String] operator[SEP] identifier[output] operator[+=] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[DeployableUnit] identifier[waitingDU] operator[:] identifier[waitingForInstallDUs] operator[SEP] {
identifier[output] operator[+=] literal[String] operator[+] identifier[waitingDU] operator[SEP] identifier[getDeploymentInfoShortName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[dependency] operator[:] identifier[waitingDU] operator[SEP] identifier[getExternalDependencies] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[deployedComponents] operator[SEP] identifier[contains] operator[SEP] identifier[dependency] operator[SEP] operator[SEP] identifier[dependency] operator[+=] literal[String] operator[SEP] identifier[output] operator[+=] literal[String] operator[+] identifier[dependency] operator[+] literal[String] operator[SEP]
}
}
identifier[output] operator[+=] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[DeployableUnit] identifier[waitingDU] operator[:] identifier[waitingForUninstallDUs] operator[SEP] {
identifier[output] operator[+=] literal[String] operator[+] identifier[waitingDU] operator[SEP] identifier[getDeploymentInfoShortName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP]
}
Keyword[return] identifier[output] operator[SEP]
}
|
public void marshall(Subscription subscription, ProtocolMarshaller protocolMarshaller) {
if (subscription == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(subscription.getSubscriptionId(), SUBSCRIPTIONID_BINDING);
protocolMarshaller.marshall(subscription.getEndPoint(), ENDPOINT_BINDING);
protocolMarshaller.marshall(subscription.getProtocol(), PROTOCOL_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[subscription, protocolMarshaller]] begin[{]
if[binary_operation[member[.subscription], ==, 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=getSubscriptionId, postfix_operators=[], prefix_operators=[], qualifier=subscription, selectors=[], type_arguments=None), MemberReference(member=SUBSCRIPTIONID_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=getEndPoint, postfix_operators=[], prefix_operators=[], qualifier=subscription, selectors=[], type_arguments=None), MemberReference(member=ENDPOINT_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=getProtocol, postfix_operators=[], prefix_operators=[], qualifier=subscription, selectors=[], type_arguments=None), MemberReference(member=PROTOCOL_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[Subscription] identifier[subscription] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[subscription] 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[subscription] operator[SEP] identifier[getSubscriptionId] operator[SEP] operator[SEP] , identifier[SUBSCRIPTIONID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[subscription] operator[SEP] identifier[getEndPoint] operator[SEP] operator[SEP] , identifier[ENDPOINT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[subscription] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] , identifier[PROTOCOL_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 List checkTransactionParticipationAndWaitForOtherTransactions(List list, MithraTransaction tx)
{
if (list == null) return null;
List result = list;
if (this.getTxParticipationMode(tx).mustParticipateInTxOnRead())
{
for(int i=0;i<list.size();i++)
{
MithraTransactionalObject mto = (MithraTransactionalObject) list.get(i);
if (!mto.zIsParticipatingInTransaction(tx))
{
result = null;
mto.zWaitForExclusiveWriteTx(tx);
}
}
}
return result;
} | class class_name[name] begin[{]
method[checkTransactionParticipationAndWaitForOtherTransactions, return_type[type[List]], modifier[private], parameter[list, tx]] begin[{]
if[binary_operation[member[.list], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[List], result]
if[THIS[call[None.getTxParticipationMode, parameter[member[.tx]]]call[None.mustParticipateInTxOnRead, parameter[]]]] begin[{]
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=list, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=MithraTransactionalObject, sub_type=None)), name=mto)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MithraTransactionalObject, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=zIsParticipatingInTransaction, postfix_operators=[], prefix_operators=['!'], qualifier=mto, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=zWaitForExclusiveWriteTx, postfix_operators=[], prefix_operators=[], qualifier=mto, 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=list, 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)
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[private] identifier[List] identifier[checkTransactionParticipationAndWaitForOtherTransactions] operator[SEP] identifier[List] identifier[list] , identifier[MithraTransaction] identifier[tx] operator[SEP] {
Keyword[if] operator[SEP] identifier[list] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[List] identifier[result] operator[=] identifier[list] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getTxParticipationMode] operator[SEP] identifier[tx] operator[SEP] operator[SEP] identifier[mustParticipateInTxOnRead] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[MithraTransactionalObject] identifier[mto] operator[=] operator[SEP] identifier[MithraTransactionalObject] operator[SEP] identifier[list] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mto] operator[SEP] identifier[zIsParticipatingInTransaction] operator[SEP] identifier[tx] operator[SEP] operator[SEP] {
identifier[result] operator[=] Other[null] operator[SEP] identifier[mto] operator[SEP] identifier[zWaitForExclusiveWriteTx] operator[SEP] identifier[tx] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void setValue(com.google.api.ads.admanager.axis.v201811.TrackingUrls value) {
this.value = value;
} | class class_name[name] begin[{]
method[setValue, return_type[void], modifier[public], parameter[value]] begin[{]
assign[THIS[member[None.value]], member[.value]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setValue] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201811] operator[SEP] identifier[TrackingUrls] identifier[value] operator[SEP] {
Keyword[this] operator[SEP] identifier[value] operator[=] identifier[value] operator[SEP]
}
|
public String consumeDigit() {
int start = pos;
if (queue.charAt(pos) == '-') {// 负数标记
pos++;
}
while (!isEmpty() && Character.isDigit(queue.charAt(pos))) {
pos++;
}
if (!isEmpty() && queue.charAt(pos) == '.' && remainingLength() >= 2
&& Character.isDigit(queue.charAt(pos + 1))) {// 小数点
pos++;
while (!isEmpty() && Character.isDigit(queue.charAt(pos))) {
pos++;
}
}
return queue.substring(start, pos);
} | class class_name[name] begin[{]
method[consumeDigit, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[int], start]
if[binary_operation[call[queue.charAt, parameter[member[.pos]]], ==, literal['-']]] begin[{]
member[.pos]
else begin[{]
None
end[}]
while[binary_operation[call[.isEmpty, parameter[]], &&, call[Character.isDigit, parameter[call[queue.charAt, parameter[member[.pos]]]]]]] begin[{]
member[.pos]
end[}]
if[binary_operation[binary_operation[binary_operation[call[.isEmpty, parameter[]], &&, binary_operation[call[queue.charAt, parameter[member[.pos]]], ==, literal['.']]], &&, binary_operation[call[.remainingLength, parameter[]], >=, literal[2]]], &&, call[Character.isDigit, parameter[call[queue.charAt, parameter[binary_operation[member[.pos], +, literal[1]]]]]]]] begin[{]
member[.pos]
while[binary_operation[call[.isEmpty, parameter[]], &&, call[Character.isDigit, parameter[call[queue.charAt, parameter[member[.pos]]]]]]] begin[{]
member[.pos]
end[}]
else begin[{]
None
end[}]
return[call[queue.substring, parameter[member[.start], member[.pos]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[consumeDigit] operator[SEP] operator[SEP] {
Keyword[int] identifier[start] operator[=] identifier[pos] operator[SEP] Keyword[if] operator[SEP] identifier[queue] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[pos] operator[++] operator[SEP]
}
Keyword[while] operator[SEP] operator[!] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[Character] operator[SEP] identifier[isDigit] operator[SEP] identifier[queue] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[SEP] operator[SEP] {
identifier[pos] operator[++] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[queue] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[==] literal[String] operator[&&] identifier[remainingLength] operator[SEP] operator[SEP] operator[>=] Other[2] operator[&&] identifier[Character] operator[SEP] identifier[isDigit] operator[SEP] identifier[queue] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] {
identifier[pos] operator[++] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[Character] operator[SEP] identifier[isDigit] operator[SEP] identifier[queue] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[SEP] operator[SEP] {
identifier[pos] operator[++] operator[SEP]
}
}
Keyword[return] identifier[queue] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[pos] operator[SEP] operator[SEP]
}
|
public Map<String,String> getDocRefs() {
return new HashMap<String,String>() {
@Override
public String get(Object varName) {
VariableInstance varInst = processInstance.getVariable((String)varName);
if (varInst != null && varInst.getData() instanceof DocumentReference)
return varInst.getData().toString();
return null;
}
};
} | class class_name[name] begin[{]
method[getDocRefs, return_type[type[Map]], modifier[public], parameter[]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=varName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=getVariable, postfix_operators=[], prefix_operators=[], qualifier=processInstance, selectors=[], type_arguments=None), name=varInst)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VariableInstance, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=varInst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=varInst, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=DocumentReference, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=ReturnStatement(expression=MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=varInst, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=get, parameters=[FormalParameter(annotations=[], modifiers=set(), name=varName, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getDocRefs] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[get] operator[SEP] identifier[Object] identifier[varName] operator[SEP] {
identifier[VariableInstance] identifier[varInst] operator[=] identifier[processInstance] operator[SEP] identifier[getVariable] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[varName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[varInst] operator[!=] Other[null] operator[&&] identifier[varInst] operator[SEP] identifier[getData] operator[SEP] operator[SEP] Keyword[instanceof] identifier[DocumentReference] operator[SEP] Keyword[return] identifier[varInst] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
} operator[SEP]
}
|
@Override
public void validate(IndexExpression indexExpression) throws InvalidRequestException {
try {
String json = UTF8Type.instance.compose(indexExpression.value);
Search.fromJson(json).validate(schema);
} catch (Exception e) {
throw new InvalidRequestException(e.getMessage());
}
} | class class_name[name] begin[{]
method[validate, return_type[void], modifier[public], parameter[indexExpression]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=indexExpression, selectors=[])], member=compose, postfix_operators=[], prefix_operators=[], qualifier=UTF8Type.instance, selectors=[], type_arguments=None), name=json)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=json, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromJson, postfix_operators=[], prefix_operators=[], qualifier=Search, selectors=[MethodInvocation(arguments=[MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidRequestException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[validate] operator[SEP] identifier[IndexExpression] identifier[indexExpression] operator[SEP] Keyword[throws] identifier[InvalidRequestException] {
Keyword[try] {
identifier[String] identifier[json] operator[=] identifier[UTF8Type] operator[SEP] identifier[instance] operator[SEP] identifier[compose] operator[SEP] identifier[indexExpression] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[Search] operator[SEP] identifier[fromJson] operator[SEP] identifier[json] operator[SEP] operator[SEP] identifier[validate] operator[SEP] identifier[schema] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidRequestException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static boolean isSorted(char[] charArray) {
for(int i = 0; i < charArray.length - 1 ; i++) {
if(charArray[i] > charArray [i + 1]) {
return false;
}
}
return true;
} | class class_name[name] begin[{]
method[isSorted, return_type[type[boolean]], modifier[public static], parameter[charArray]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=charArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=charArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=charArray, 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)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isSorted] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[charArray] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[charArray] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[charArray] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[charArray] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private void readResource(Project.Resources.Resource xml, HashMap<BigInteger, ProjectCalendar> calendarMap)
{
Resource mpx = m_projectFile.addResource();
mpx.setAccrueAt(xml.getAccrueAt());
mpx.setActveDirectoryGUID(xml.getActiveDirectoryGUID());
mpx.setActualCost(DatatypeConverter.parseCurrency(xml.getActualCost()));
mpx.setActualOvertimeCost(DatatypeConverter.parseCurrency(xml.getActualOvertimeCost()));
mpx.setActualOvertimeWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getActualOvertimeWork()));
mpx.setActualOvertimeWorkProtected(DatatypeConverter.parseDuration(m_projectFile, null, xml.getActualOvertimeWorkProtected()));
mpx.setActualWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getActualWork()));
mpx.setActualWorkProtected(DatatypeConverter.parseDuration(m_projectFile, null, xml.getActualWorkProtected()));
mpx.setACWP(DatatypeConverter.parseCurrency(xml.getACWP()));
mpx.setAvailableFrom(xml.getAvailableFrom());
mpx.setAvailableTo(xml.getAvailableTo());
mpx.setBCWS(DatatypeConverter.parseCurrency(xml.getBCWS()));
mpx.setBCWP(DatatypeConverter.parseCurrency(xml.getBCWP()));
mpx.setBookingType(xml.getBookingType());
//mpx.setBaseCalendar ();
//mpx.setBaselineCost();
//mpx.setBaselineWork();
mpx.setBudget(BooleanHelper.getBoolean(xml.isIsBudget()));
mpx.setCanLevel(BooleanHelper.getBoolean(xml.isCanLevel()));
mpx.setCode(xml.getCode());
mpx.setCost(DatatypeConverter.parseCurrency(xml.getCost()));
mpx.setCostPerUse(DatatypeConverter.parseCurrency(xml.getCostPerUse()));
mpx.setCostVariance(DatatypeConverter.parseCurrency(xml.getCostVariance()));
mpx.setCreationDate(xml.getCreationDate());
mpx.setCV(DatatypeConverter.parseCurrency(xml.getCV()));
mpx.setEmailAddress(xml.getEmailAddress());
mpx.setGroup(xml.getGroup());
mpx.setGUID(xml.getGUID());
mpx.setHyperlink(xml.getHyperlink());
mpx.setHyperlinkAddress(xml.getHyperlinkAddress());
mpx.setHyperlinkSubAddress(xml.getHyperlinkSubAddress());
mpx.setID(NumberHelper.getInteger(xml.getID()));
mpx.setInitials(xml.getInitials());
mpx.setEnterprise(BooleanHelper.getBoolean(xml.isIsEnterprise()));
mpx.setGeneric(BooleanHelper.getBoolean(xml.isIsGeneric()));
mpx.setActive(!BooleanHelper.getBoolean(xml.isIsInactive()));
mpx.setIsNull(BooleanHelper.getBoolean(xml.isIsNull()));
//mpx.setLinkedFields();
mpx.setMaterialLabel(xml.getMaterialLabel());
mpx.setMaxUnits(DatatypeConverter.parseUnits(xml.getMaxUnits()));
mpx.setName(xml.getName());
if (xml.getNotes() != null && xml.getNotes().length() != 0)
{
mpx.setNotes(xml.getNotes());
}
mpx.setNtAccount(xml.getNTAccount());
//mpx.setObjects();
mpx.setOvertimeCost(DatatypeConverter.parseCurrency(xml.getOvertimeCost()));
mpx.setOvertimeRate(DatatypeConverter.parseRate(xml.getOvertimeRate()));
mpx.setOvertimeRateUnits(DatatypeConverter.parseTimeUnit(xml.getOvertimeRateFormat()));
mpx.setOvertimeWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getOvertimeWork()));
mpx.setPeakUnits(DatatypeConverter.parseUnits(xml.getPeakUnits()));
mpx.setPercentWorkComplete(xml.getPercentWorkComplete());
mpx.setPhonetics(xml.getPhonetics());
mpx.setRegularWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getRegularWork()));
mpx.setRemainingCost(DatatypeConverter.parseCurrency(xml.getRemainingCost()));
mpx.setRemainingOvertimeCost(DatatypeConverter.parseCurrency(xml.getRemainingOvertimeCost()));
mpx.setRemainingWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getRemainingWork()));
mpx.setRemainingOvertimeWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getRemainingOvertimeWork()));
mpx.setStandardRate(DatatypeConverter.parseRate(xml.getStandardRate()));
mpx.setStandardRateUnits(DatatypeConverter.parseTimeUnit(xml.getStandardRateFormat()));
mpx.setSV(DatatypeConverter.parseCurrency(xml.getSV()));
mpx.setType(xml.getType());
mpx.setUniqueID(NumberHelper.getInteger(xml.getUID()));
mpx.setWork(DatatypeConverter.parseDuration(m_projectFile, null, xml.getWork()));
mpx.setWorkGroup(xml.getWorkGroup());
mpx.setWorkVariance(DatatypeConverter.parseDurationInThousanthsOfMinutes(xml.getWorkVariance()));
if (mpx.getType() == ResourceType.MATERIAL && BooleanHelper.getBoolean(xml.isIsCostResource()))
{
mpx.setType(ResourceType.COST);
}
readResourceExtendedAttributes(xml, mpx);
readResourceBaselines(xml, mpx);
mpx.setResourceCalendar(calendarMap.get(xml.getCalendarUID()));
// ensure that we cache this value
mpx.setOverAllocated(BooleanHelper.getBoolean(xml.isOverAllocated()));
readCostRateTables(mpx, xml.getRates());
readAvailabilityTable(mpx, xml.getAvailabilityPeriods());
m_eventManager.fireResourceReadEvent(mpx);
} | class class_name[name] begin[{]
method[readResource, return_type[void], modifier[private], parameter[xml, calendarMap]] begin[{]
local_variable[type[Resource], mpx]
call[mpx.setAccrueAt, parameter[call[xml.getAccrueAt, parameter[]]]]
call[mpx.setActveDirectoryGUID, parameter[call[xml.getActiveDirectoryGUID, parameter[]]]]
call[mpx.setActualCost, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getActualCost, parameter[]]]]]]
call[mpx.setActualOvertimeCost, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getActualOvertimeCost, parameter[]]]]]]
call[mpx.setActualOvertimeWork, parameter[call[DatatypeConverter.parseDuration, parameter[member[.m_projectFile], literal[null], call[xml.getActualOvertimeWork, parameter[]]]]]]
call[mpx.setActualOvertimeWorkProtected, parameter[call[DatatypeConverter.parseDuration, parameter[member[.m_projectFile], literal[null], call[xml.getActualOvertimeWorkProtected, parameter[]]]]]]
call[mpx.setActualWork, parameter[call[DatatypeConverter.parseDuration, parameter[member[.m_projectFile], literal[null], call[xml.getActualWork, parameter[]]]]]]
call[mpx.setActualWorkProtected, parameter[call[DatatypeConverter.parseDuration, parameter[member[.m_projectFile], literal[null], call[xml.getActualWorkProtected, parameter[]]]]]]
call[mpx.setACWP, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getACWP, parameter[]]]]]]
call[mpx.setAvailableFrom, parameter[call[xml.getAvailableFrom, parameter[]]]]
call[mpx.setAvailableTo, parameter[call[xml.getAvailableTo, parameter[]]]]
call[mpx.setBCWS, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getBCWS, parameter[]]]]]]
call[mpx.setBCWP, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getBCWP, parameter[]]]]]]
call[mpx.setBookingType, parameter[call[xml.getBookingType, parameter[]]]]
call[mpx.setBudget, parameter[call[BooleanHelper.getBoolean, parameter[call[xml.isIsBudget, parameter[]]]]]]
call[mpx.setCanLevel, parameter[call[BooleanHelper.getBoolean, parameter[call[xml.isCanLevel, parameter[]]]]]]
call[mpx.setCode, parameter[call[xml.getCode, parameter[]]]]
call[mpx.setCost, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getCost, parameter[]]]]]]
call[mpx.setCostPerUse, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getCostPerUse, parameter[]]]]]]
call[mpx.setCostVariance, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getCostVariance, parameter[]]]]]]
call[mpx.setCreationDate, parameter[call[xml.getCreationDate, parameter[]]]]
call[mpx.setCV, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getCV, parameter[]]]]]]
call[mpx.setEmailAddress, parameter[call[xml.getEmailAddress, parameter[]]]]
call[mpx.setGroup, parameter[call[xml.getGroup, parameter[]]]]
call[mpx.setGUID, parameter[call[xml.getGUID, parameter[]]]]
call[mpx.setHyperlink, parameter[call[xml.getHyperlink, parameter[]]]]
call[mpx.setHyperlinkAddress, parameter[call[xml.getHyperlinkAddress, parameter[]]]]
call[mpx.setHyperlinkSubAddress, parameter[call[xml.getHyperlinkSubAddress, parameter[]]]]
call[mpx.setID, parameter[call[NumberHelper.getInteger, parameter[call[xml.getID, parameter[]]]]]]
call[mpx.setInitials, parameter[call[xml.getInitials, parameter[]]]]
call[mpx.setEnterprise, parameter[call[BooleanHelper.getBoolean, parameter[call[xml.isIsEnterprise, parameter[]]]]]]
call[mpx.setGeneric, parameter[call[BooleanHelper.getBoolean, parameter[call[xml.isIsGeneric, parameter[]]]]]]
call[mpx.setActive, parameter[call[BooleanHelper.getBoolean, parameter[call[xml.isIsInactive, parameter[]]]]]]
call[mpx.setIsNull, parameter[call[BooleanHelper.getBoolean, parameter[call[xml.isIsNull, parameter[]]]]]]
call[mpx.setMaterialLabel, parameter[call[xml.getMaterialLabel, parameter[]]]]
call[mpx.setMaxUnits, parameter[call[DatatypeConverter.parseUnits, parameter[call[xml.getMaxUnits, parameter[]]]]]]
call[mpx.setName, parameter[call[xml.getName, parameter[]]]]
if[binary_operation[binary_operation[call[xml.getNotes, parameter[]], !=, literal[null]], &&, binary_operation[call[xml.getNotes, parameter[]], !=, literal[0]]]] begin[{]
call[mpx.setNotes, parameter[call[xml.getNotes, parameter[]]]]
else begin[{]
None
end[}]
call[mpx.setNtAccount, parameter[call[xml.getNTAccount, parameter[]]]]
call[mpx.setOvertimeCost, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getOvertimeCost, parameter[]]]]]]
call[mpx.setOvertimeRate, parameter[call[DatatypeConverter.parseRate, parameter[call[xml.getOvertimeRate, parameter[]]]]]]
call[mpx.setOvertimeRateUnits, parameter[call[DatatypeConverter.parseTimeUnit, parameter[call[xml.getOvertimeRateFormat, parameter[]]]]]]
call[mpx.setOvertimeWork, parameter[call[DatatypeConverter.parseDuration, parameter[member[.m_projectFile], literal[null], call[xml.getOvertimeWork, parameter[]]]]]]
call[mpx.setPeakUnits, parameter[call[DatatypeConverter.parseUnits, parameter[call[xml.getPeakUnits, parameter[]]]]]]
call[mpx.setPercentWorkComplete, parameter[call[xml.getPercentWorkComplete, parameter[]]]]
call[mpx.setPhonetics, parameter[call[xml.getPhonetics, parameter[]]]]
call[mpx.setRegularWork, parameter[call[DatatypeConverter.parseDuration, parameter[member[.m_projectFile], literal[null], call[xml.getRegularWork, parameter[]]]]]]
call[mpx.setRemainingCost, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getRemainingCost, parameter[]]]]]]
call[mpx.setRemainingOvertimeCost, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getRemainingOvertimeCost, parameter[]]]]]]
call[mpx.setRemainingWork, parameter[call[DatatypeConverter.parseDuration, parameter[member[.m_projectFile], literal[null], call[xml.getRemainingWork, parameter[]]]]]]
call[mpx.setRemainingOvertimeWork, parameter[call[DatatypeConverter.parseDuration, parameter[member[.m_projectFile], literal[null], call[xml.getRemainingOvertimeWork, parameter[]]]]]]
call[mpx.setStandardRate, parameter[call[DatatypeConverter.parseRate, parameter[call[xml.getStandardRate, parameter[]]]]]]
call[mpx.setStandardRateUnits, parameter[call[DatatypeConverter.parseTimeUnit, parameter[call[xml.getStandardRateFormat, parameter[]]]]]]
call[mpx.setSV, parameter[call[DatatypeConverter.parseCurrency, parameter[call[xml.getSV, parameter[]]]]]]
call[mpx.setType, parameter[call[xml.getType, parameter[]]]]
call[mpx.setUniqueID, parameter[call[NumberHelper.getInteger, parameter[call[xml.getUID, parameter[]]]]]]
call[mpx.setWork, parameter[call[DatatypeConverter.parseDuration, parameter[member[.m_projectFile], literal[null], call[xml.getWork, parameter[]]]]]]
call[mpx.setWorkGroup, parameter[call[xml.getWorkGroup, parameter[]]]]
call[mpx.setWorkVariance, parameter[call[DatatypeConverter.parseDurationInThousanthsOfMinutes, parameter[call[xml.getWorkVariance, parameter[]]]]]]
if[binary_operation[binary_operation[call[mpx.getType, parameter[]], ==, member[ResourceType.MATERIAL]], &&, call[BooleanHelper.getBoolean, parameter[call[xml.isIsCostResource, parameter[]]]]]] begin[{]
call[mpx.setType, parameter[member[ResourceType.COST]]]
else begin[{]
None
end[}]
call[.readResourceExtendedAttributes, parameter[member[.xml], member[.mpx]]]
call[.readResourceBaselines, parameter[member[.xml], member[.mpx]]]
call[mpx.setResourceCalendar, parameter[call[calendarMap.get, parameter[call[xml.getCalendarUID, parameter[]]]]]]
call[mpx.setOverAllocated, parameter[call[BooleanHelper.getBoolean, parameter[call[xml.isOverAllocated, parameter[]]]]]]
call[.readCostRateTables, parameter[member[.mpx], call[xml.getRates, parameter[]]]]
call[.readAvailabilityTable, parameter[member[.mpx], call[xml.getAvailabilityPeriods, parameter[]]]]
call[m_eventManager.fireResourceReadEvent, parameter[member[.mpx]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[readResource] operator[SEP] identifier[Project] operator[SEP] identifier[Resources] operator[SEP] identifier[Resource] identifier[xml] , identifier[HashMap] operator[<] identifier[BigInteger] , identifier[ProjectCalendar] operator[>] identifier[calendarMap] operator[SEP] {
identifier[Resource] identifier[mpx] operator[=] identifier[m_projectFile] operator[SEP] identifier[addResource] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setAccrueAt] operator[SEP] identifier[xml] operator[SEP] identifier[getAccrueAt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setActveDirectoryGUID] operator[SEP] identifier[xml] operator[SEP] identifier[getActiveDirectoryGUID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setActualCost] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getActualCost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setActualOvertimeCost] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getActualOvertimeCost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setActualOvertimeWork] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDuration] operator[SEP] identifier[m_projectFile] , Other[null] , identifier[xml] operator[SEP] identifier[getActualOvertimeWork] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setActualOvertimeWorkProtected] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDuration] operator[SEP] identifier[m_projectFile] , Other[null] , identifier[xml] operator[SEP] identifier[getActualOvertimeWorkProtected] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setActualWork] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDuration] operator[SEP] identifier[m_projectFile] , Other[null] , identifier[xml] operator[SEP] identifier[getActualWork] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setActualWorkProtected] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDuration] operator[SEP] identifier[m_projectFile] , Other[null] , identifier[xml] operator[SEP] identifier[getActualWorkProtected] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setACWP] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getACWP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setAvailableFrom] operator[SEP] identifier[xml] operator[SEP] identifier[getAvailableFrom] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setAvailableTo] operator[SEP] identifier[xml] operator[SEP] identifier[getAvailableTo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setBCWS] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getBCWS] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setBCWP] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getBCWP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setBookingType] operator[SEP] identifier[xml] operator[SEP] identifier[getBookingType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setBudget] operator[SEP] identifier[BooleanHelper] operator[SEP] identifier[getBoolean] operator[SEP] identifier[xml] operator[SEP] identifier[isIsBudget] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setCanLevel] operator[SEP] identifier[BooleanHelper] operator[SEP] identifier[getBoolean] operator[SEP] identifier[xml] operator[SEP] identifier[isCanLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setCode] operator[SEP] identifier[xml] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setCost] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getCost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setCostPerUse] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getCostPerUse] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setCostVariance] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getCostVariance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setCreationDate] operator[SEP] identifier[xml] operator[SEP] identifier[getCreationDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setCV] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getCV] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setEmailAddress] operator[SEP] identifier[xml] operator[SEP] identifier[getEmailAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setGroup] operator[SEP] identifier[xml] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setGUID] operator[SEP] identifier[xml] operator[SEP] identifier[getGUID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setHyperlink] operator[SEP] identifier[xml] operator[SEP] identifier[getHyperlink] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setHyperlinkAddress] operator[SEP] identifier[xml] operator[SEP] identifier[getHyperlinkAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setHyperlinkSubAddress] operator[SEP] identifier[xml] operator[SEP] identifier[getHyperlinkSubAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setID] operator[SEP] identifier[NumberHelper] operator[SEP] identifier[getInteger] operator[SEP] identifier[xml] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setInitials] operator[SEP] identifier[xml] operator[SEP] identifier[getInitials] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setEnterprise] operator[SEP] identifier[BooleanHelper] operator[SEP] identifier[getBoolean] operator[SEP] identifier[xml] operator[SEP] identifier[isIsEnterprise] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setGeneric] operator[SEP] identifier[BooleanHelper] operator[SEP] identifier[getBoolean] operator[SEP] identifier[xml] operator[SEP] identifier[isIsGeneric] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setActive] operator[SEP] operator[!] identifier[BooleanHelper] operator[SEP] identifier[getBoolean] operator[SEP] identifier[xml] operator[SEP] identifier[isIsInactive] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setIsNull] operator[SEP] identifier[BooleanHelper] operator[SEP] identifier[getBoolean] operator[SEP] identifier[xml] operator[SEP] identifier[isIsNull] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setMaterialLabel] operator[SEP] identifier[xml] operator[SEP] identifier[getMaterialLabel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setMaxUnits] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseUnits] operator[SEP] identifier[xml] operator[SEP] identifier[getMaxUnits] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setName] operator[SEP] identifier[xml] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xml] operator[SEP] identifier[getNotes] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[xml] operator[SEP] identifier[getNotes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[mpx] operator[SEP] identifier[setNotes] operator[SEP] identifier[xml] operator[SEP] identifier[getNotes] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[mpx] operator[SEP] identifier[setNtAccount] operator[SEP] identifier[xml] operator[SEP] identifier[getNTAccount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setOvertimeCost] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getOvertimeCost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setOvertimeRate] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseRate] operator[SEP] identifier[xml] operator[SEP] identifier[getOvertimeRate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setOvertimeRateUnits] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseTimeUnit] operator[SEP] identifier[xml] operator[SEP] identifier[getOvertimeRateFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setOvertimeWork] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDuration] operator[SEP] identifier[m_projectFile] , Other[null] , identifier[xml] operator[SEP] identifier[getOvertimeWork] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setPeakUnits] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseUnits] operator[SEP] identifier[xml] operator[SEP] identifier[getPeakUnits] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setPercentWorkComplete] operator[SEP] identifier[xml] operator[SEP] identifier[getPercentWorkComplete] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setPhonetics] operator[SEP] identifier[xml] operator[SEP] identifier[getPhonetics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setRegularWork] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDuration] operator[SEP] identifier[m_projectFile] , Other[null] , identifier[xml] operator[SEP] identifier[getRegularWork] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setRemainingCost] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getRemainingCost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setRemainingOvertimeCost] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getRemainingOvertimeCost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setRemainingWork] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDuration] operator[SEP] identifier[m_projectFile] , Other[null] , identifier[xml] operator[SEP] identifier[getRemainingWork] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setRemainingOvertimeWork] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDuration] operator[SEP] identifier[m_projectFile] , Other[null] , identifier[xml] operator[SEP] identifier[getRemainingOvertimeWork] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setStandardRate] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseRate] operator[SEP] identifier[xml] operator[SEP] identifier[getStandardRate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setStandardRateUnits] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseTimeUnit] operator[SEP] identifier[xml] operator[SEP] identifier[getStandardRateFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setSV] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseCurrency] operator[SEP] identifier[xml] operator[SEP] identifier[getSV] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setType] operator[SEP] identifier[xml] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setUniqueID] operator[SEP] identifier[NumberHelper] operator[SEP] identifier[getInteger] operator[SEP] identifier[xml] operator[SEP] identifier[getUID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setWork] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDuration] operator[SEP] identifier[m_projectFile] , Other[null] , identifier[xml] operator[SEP] identifier[getWork] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setWorkGroup] operator[SEP] identifier[xml] operator[SEP] identifier[getWorkGroup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setWorkVariance] operator[SEP] identifier[DatatypeConverter] operator[SEP] identifier[parseDurationInThousanthsOfMinutes] operator[SEP] identifier[xml] operator[SEP] identifier[getWorkVariance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mpx] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[ResourceType] operator[SEP] identifier[MATERIAL] operator[&&] identifier[BooleanHelper] operator[SEP] identifier[getBoolean] operator[SEP] identifier[xml] operator[SEP] identifier[isIsCostResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[mpx] operator[SEP] identifier[setType] operator[SEP] identifier[ResourceType] operator[SEP] identifier[COST] operator[SEP] operator[SEP]
}
identifier[readResourceExtendedAttributes] operator[SEP] identifier[xml] , identifier[mpx] operator[SEP] operator[SEP] identifier[readResourceBaselines] operator[SEP] identifier[xml] , identifier[mpx] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setResourceCalendar] operator[SEP] identifier[calendarMap] operator[SEP] identifier[get] operator[SEP] identifier[xml] operator[SEP] identifier[getCalendarUID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mpx] operator[SEP] identifier[setOverAllocated] operator[SEP] identifier[BooleanHelper] operator[SEP] identifier[getBoolean] operator[SEP] identifier[xml] operator[SEP] identifier[isOverAllocated] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[readCostRateTables] operator[SEP] identifier[mpx] , identifier[xml] operator[SEP] identifier[getRates] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[readAvailabilityTable] operator[SEP] identifier[mpx] , identifier[xml] operator[SEP] identifier[getAvailabilityPeriods] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_eventManager] operator[SEP] identifier[fireResourceReadEvent] operator[SEP] identifier[mpx] operator[SEP] operator[SEP]
}
|
private static void initializeDefaultModules(SecurityContext context)
{
if (context.isInitialized()) {
return;
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("SecurityContext default module initializer starting");
}
String moduleName;
// Loop through the module names
for (int i=0; i<DEFAULT_MODULES.length; i++) {
moduleName = DEFAULT_MODULES[i];
try {
LOGGER.debug(moduleName + MODULE_INITIALIZER_CLASS);
// Get a class instance for the module initializer
Class<?> clazz = Class.forName(moduleName + MODULE_INITIALIZER_CLASS);
// Get the method instance for the module initializer's initialization method
Method method = clazz.getMethod(MODULE_INITIALIZER_METHOD, (Class[])null);
// Invoke the initialization method
Object invokeResult = method.invoke(clazz.newInstance(), (Object[])null);
// Validate that the result of the initialization is a valid module context
if (invokeResult instanceof AbstractModuleContext) {
// Register the module context
context.registerModuleContext(moduleName, (AbstractModuleContext)invokeResult);
} else {
throw new IllegalArgumentException("Initializer method did not return correct type");
}
if (LOGGER.isInfoEnabled()) {
LOGGER.info("SecurityContext module "+ moduleName + " initialized");
}
} catch (ClassNotFoundException cnfe) {
LOGGER.warn("SecurityContext module "+ moduleName + " not found, skipping.");
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Stack trace: ", cnfe);
}
} catch (NoSuchMethodException nsme) {
LOGGER.warn("SecurityContext module "+ moduleName + " does not support default initialization, skipping.", nsme);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Stack trace: ", nsme);
}
} catch (Throwable t) {
LOGGER.error("Error initializing SecurityContext module "+ moduleName, t);
} finally {
}
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("SecurityContext default module initializer ending");
}
} | class class_name[name] begin[{]
method[initializeDefaultModules, return_type[void], modifier[private static], parameter[context]] begin[{]
if[call[context.isInitialized, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[call[LOGGER.isDebugEnabled, parameter[]]] begin[{]
call[LOGGER.debug, parameter[literal["SecurityContext default module initializer starting"]]]
else begin[{]
None
end[}]
local_variable[type[String], moduleName]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=DEFAULT_MODULES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MODULE_INITIALIZER_CLASS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MODULE_INITIALIZER_CLASS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=MODULE_INITIALIZER_METHOD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[None], name=Class, sub_type=None))], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None))], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), name=invokeResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=invokeResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=AbstractModuleContext, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Initializer method did not return correct type")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=invokeResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractModuleContext, sub_type=None))], member=registerModuleContext, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isInfoEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SecurityContext module "), operandr=MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" initialized"), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SecurityContext module "), operandr=MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" not found, skipping."), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Stack trace: "), MemberReference(member=cnfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnfe, types=['ClassNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SecurityContext module "), operandr=MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" does not support default initialization, skipping."), operator=+), MemberReference(member=nsme, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Stack trace: "), MemberReference(member=nsme, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nsme, types=['NoSuchMethodException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error initializing SecurityContext module "), operandr=MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=[], label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=DEFAULT_MODULES, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[call[LOGGER.isDebugEnabled, parameter[]]] begin[{]
call[LOGGER.debug, parameter[literal["SecurityContext default module initializer ending"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[initializeDefaultModules] operator[SEP] identifier[SecurityContext] identifier[context] operator[SEP] {
Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[isInitialized] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[moduleName] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[DEFAULT_MODULES] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[moduleName] operator[=] identifier[DEFAULT_MODULES] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[try] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] identifier[moduleName] operator[+] identifier[MODULE_INITIALIZER_CLASS] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[moduleName] operator[+] identifier[MODULE_INITIALIZER_CLASS] operator[SEP] operator[SEP] identifier[Method] identifier[method] operator[=] identifier[clazz] operator[SEP] identifier[getMethod] operator[SEP] identifier[MODULE_INITIALIZER_METHOD] , operator[SEP] identifier[Class] operator[SEP] operator[SEP] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[Object] identifier[invokeResult] operator[=] identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[clazz] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] , operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[invokeResult] Keyword[instanceof] identifier[AbstractModuleContext] operator[SEP] {
identifier[context] operator[SEP] identifier[registerModuleContext] operator[SEP] identifier[moduleName] , operator[SEP] identifier[AbstractModuleContext] operator[SEP] identifier[invokeResult] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[moduleName] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[cnfe] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[moduleName] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[cnfe] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[nsme] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[moduleName] operator[+] literal[String] , identifier[nsme] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[nsme] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[moduleName] , identifier[t] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
}
Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public ServletContext getServletContext() {
ServletConfig sc = getServletConfig();
if (sc == null) {
throw new IllegalStateException(
lStrings.getString("err.servlet_config_not_initialized"));
}
return sc.getServletContext();
} | class class_name[name] begin[{]
method[getServletContext, return_type[type[ServletContext]], modifier[public], parameter[]] begin[{]
local_variable[type[ServletConfig], sc]
if[binary_operation[member[.sc], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="err.servlet_config_not_initialized")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=lStrings, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[sc.getServletContext, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[ServletContext] identifier[getServletContext] operator[SEP] operator[SEP] {
identifier[ServletConfig] identifier[sc] operator[=] identifier[getServletConfig] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sc] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[lStrings] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sc] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setEscapedQuery(String escapedQuery) throws URIException {
if (escapedQuery == null) {
_query = null;
setURI();
return;
}
setRawQuery(escapedQuery.toCharArray());
} | class class_name[name] begin[{]
method[setEscapedQuery, return_type[void], modifier[public], parameter[escapedQuery]] begin[{]
if[binary_operation[member[.escapedQuery], ==, literal[null]]] begin[{]
assign[member[._query], literal[null]]
call[.setURI, parameter[]]
return[None]
else begin[{]
None
end[}]
call[.setRawQuery, parameter[call[escapedQuery.toCharArray, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setEscapedQuery] operator[SEP] identifier[String] identifier[escapedQuery] operator[SEP] Keyword[throws] identifier[URIException] {
Keyword[if] operator[SEP] identifier[escapedQuery] operator[==] Other[null] operator[SEP] {
identifier[_query] operator[=] Other[null] operator[SEP] identifier[setURI] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[setRawQuery] operator[SEP] identifier[escapedQuery] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void removeLastChild(Element tag) {
final Node last = tag.getLastChild();
if(last != null) {
tag.removeChild(last);
}
} | class class_name[name] begin[{]
method[removeLastChild, return_type[void], modifier[public static], parameter[tag]] begin[{]
local_variable[type[Node], last]
if[binary_operation[member[.last], !=, literal[null]]] begin[{]
call[tag.removeChild, parameter[member[.last]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[removeLastChild] operator[SEP] identifier[Element] identifier[tag] operator[SEP] {
Keyword[final] identifier[Node] identifier[last] operator[=] identifier[tag] operator[SEP] identifier[getLastChild] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[last] operator[!=] Other[null] operator[SEP] {
identifier[tag] operator[SEP] identifier[removeChild] operator[SEP] identifier[last] operator[SEP] operator[SEP]
}
}
|
public static Polygon polygon(final Point... points) {
LineString exteriorBoundary = lineString(points);
ensurePolygonIsClosed(exteriorBoundary);
return new Polygon(exteriorBoundary);
} | class class_name[name] begin[{]
method[polygon, return_type[type[Polygon]], modifier[public static], parameter[points]] begin[{]
local_variable[type[LineString], exteriorBoundary]
call[.ensurePolygonIsClosed, parameter[member[.exteriorBoundary]]]
return[ClassCreator(arguments=[MemberReference(member=exteriorBoundary, 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=Polygon, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Polygon] identifier[polygon] operator[SEP] Keyword[final] identifier[Point] operator[...] identifier[points] operator[SEP] {
identifier[LineString] identifier[exteriorBoundary] operator[=] identifier[lineString] operator[SEP] identifier[points] operator[SEP] operator[SEP] identifier[ensurePolygonIsClosed] operator[SEP] identifier[exteriorBoundary] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Polygon] operator[SEP] identifier[exteriorBoundary] operator[SEP] operator[SEP]
}
|
public static TypedProperties load(String file, FileLocation location)
{
// If file is null.
if (file == null)
{
// file must be specified.
throw new IllegalArgumentException("file is null.");
}
// If location is null.
if (location == null)
{
// location must be specified.
throw new IllegalArgumentException("location is null.");
}
InputStream in = null;
try
{
// Open the file.
in = open(file, location);
if (in == null)
{
// Failed to open the file.
return null;
}
// Build Properties from the input stream.
Properties properties = load(in);
// Wrap the properties.
return new PropertiesWrapper(properties);
}
catch (IOException e)
{
// Failed to open the file, or Properties.load() failed.
return null;
}
finally
{
// Close the input stream silently.
close(in);
}
} | class class_name[name] begin[{]
method[load, return_type[type[TypedProperties]], modifier[public static], parameter[file, location]] begin[{]
if[binary_operation[member[.file], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="file is null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.location], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="location is 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[InputStream], in]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=properties)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=properties, 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=PropertiesWrapper, sub_type=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[TypedProperties] identifier[load] operator[SEP] identifier[String] identifier[file] , identifier[FileLocation] identifier[location] operator[SEP] {
Keyword[if] operator[SEP] identifier[file] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[location] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[InputStream] identifier[in] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[in] operator[=] identifier[open] operator[SEP] identifier[file] , identifier[location] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[in] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[Properties] identifier[properties] operator[=] identifier[load] operator[SEP] identifier[in] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[PropertiesWrapper] operator[SEP] identifier[properties] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[finally] {
identifier[close] operator[SEP] identifier[in] operator[SEP] operator[SEP]
}
}
|
private <B extends Appendable> B applyRules(final Calendar calendar, final B buf) {
try {
for (final Rule rule : mRules) {
rule.appendTo(buf, calendar);
}
} catch (final IOException ioe) {
ExceptionUtils.rethrow(ioe);
}
return buf;
} | class class_name[name] begin[{]
method[applyRules, return_type[type[B]], modifier[private], parameter[calendar, buf]] begin[{]
TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=calendar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendTo, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=mRules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rule)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Rule, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rethrow, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None)
return[member[.buf]]
end[}]
END[}] | Keyword[private] operator[<] identifier[B] Keyword[extends] identifier[Appendable] operator[>] identifier[B] identifier[applyRules] operator[SEP] Keyword[final] identifier[Calendar] identifier[calendar] , Keyword[final] identifier[B] identifier[buf] operator[SEP] {
Keyword[try] {
Keyword[for] operator[SEP] Keyword[final] identifier[Rule] identifier[rule] operator[:] identifier[mRules] operator[SEP] {
identifier[rule] operator[SEP] identifier[appendTo] operator[SEP] identifier[buf] , identifier[calendar] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[ioe] operator[SEP] {
identifier[ExceptionUtils] operator[SEP] identifier[rethrow] operator[SEP] identifier[ioe] operator[SEP] operator[SEP]
}
Keyword[return] identifier[buf] operator[SEP]
}
|
public void assertNotEqual(Description description, Double actual, Double expected, Offset<Double> offset) {
checkOffsetIsNotNull(offset);
checkNumberIsNotNull(expected);
assertNotNull(description, actual);
if (isEqualTo(actual, expected, offset)) {
throw failures.failure(description, shouldNotBeEqual(actual, expected));
}
} | class class_name[name] begin[{]
method[assertNotEqual, 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=[])], member=shouldNotBeEqual, 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[assertNotEqual] operator[SEP] identifier[Description] identifier[description] , identifier[Double] identifier[actual] , identifier[Double] identifier[expected] , identifier[Offset] operator[<] identifier[Double] 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] 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[shouldNotBeEqual] operator[SEP] identifier[actual] , identifier[expected] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private static String filterValue(String value)
throws IOException {
InternalStringBuilder result = new InternalStringBuilder(value.length());
for (int i = 0; i < value.length(); ++i) {
char c = value.charAt(i);
switch (c) {
case '<':
result.append("<");
break;
case '>':
result.append(">");
break;
case '&':
result.append("&");
break;
default:
result.append(c);
}
}
return result.toString();
} | class class_name[name] begin[{]
method[filterValue, return_type[type[String]], modifier[private static], parameter[value]] begin[{]
local_variable[type[InternalStringBuilder], result]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='<')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<")], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='>')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=">")], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='&')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="&")], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
return[call[result.toString, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[filterValue] operator[SEP] identifier[String] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[InternalStringBuilder] identifier[result] operator[=] Keyword[new] identifier[InternalStringBuilder] operator[SEP] identifier[value] 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[value] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[value] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[c] operator[SEP] {
Keyword[case] literal[String] operator[:] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public Set<V> get(K key) {
checkNotNull(key, "Key cannot be null");
return backingMap.get(key);
} | class class_name[name] begin[{]
method[get, return_type[type[Set]], modifier[public], parameter[key]] begin[{]
call[.checkNotNull, parameter[member[.key], literal["Key cannot be null"]]]
return[call[backingMap.get, parameter[member[.key]]]]
end[}]
END[}] | Keyword[public] identifier[Set] operator[<] identifier[V] operator[>] identifier[get] operator[SEP] identifier[K] identifier[key] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[key] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[backingMap] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
|
public BatchGetCrawlersResult withCrawlersNotFound(String... crawlersNotFound) {
if (this.crawlersNotFound == null) {
setCrawlersNotFound(new java.util.ArrayList<String>(crawlersNotFound.length));
}
for (String ele : crawlersNotFound) {
this.crawlersNotFound.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withCrawlersNotFound, return_type[type[BatchGetCrawlersResult]], modifier[public], parameter[crawlersNotFound]] begin[{]
if[binary_operation[THIS[member[None.crawlersNotFound]], ==, literal[null]]] begin[{]
call[.setCrawlersNotFound, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=crawlersNotFound, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=crawlersNotFound, 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=crawlersNotFound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[BatchGetCrawlersResult] identifier[withCrawlersNotFound] operator[SEP] identifier[String] operator[...] identifier[crawlersNotFound] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[crawlersNotFound] operator[==] Other[null] operator[SEP] {
identifier[setCrawlersNotFound] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[crawlersNotFound] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[crawlersNotFound] operator[SEP] {
Keyword[this] operator[SEP] identifier[crawlersNotFound] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public void pin(Object key)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "pin", key);
Bucket bucket = getOrCreateBucketForKey(key); // d739870
int pinCount;
synchronized (bucket) {
Element element = bucket.findByKey(key);
if (element == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "pin - throw NoSuchObjectException"); // d173022.12
throw new NoSuchObjectException(key);
}
element.pinned++;
pinCount = element.pinned;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "pin:" + pinCount);
} | class class_name[name] begin[{]
method[pin, return_type[void], modifier[public], parameter[key]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.entry, parameter[member[.tc], literal["pin"], member[.key]]]
else begin[{]
None
end[}]
local_variable[type[Bucket], bucket]
local_variable[type[int], pinCount]
SYNCHRONIZED[member[.bucket]] BEGIN[{]
local_variable[type[Element], element]
if[binary_operation[member[.element], ==, literal[null]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["pin - throw NoSuchObjectException"]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchObjectException, sub_type=None)), label=None)
else begin[{]
None
end[}]
member[element.pinned]
assign[member[.pinCount], member[element.pinned]]
END[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[Tr.exit, parameter[member[.tc], binary_operation[literal["pin:"], +, member[.pinCount]]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[pin] operator[SEP] identifier[Object] identifier[key] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[key] operator[SEP] operator[SEP] identifier[Bucket] identifier[bucket] operator[=] identifier[getOrCreateBucketForKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[int] identifier[pinCount] operator[SEP] Keyword[synchronized] operator[SEP] identifier[bucket] operator[SEP] {
identifier[Element] identifier[element] operator[=] identifier[bucket] operator[SEP] identifier[findByKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[element] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NoSuchObjectException] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
identifier[element] operator[SEP] identifier[pinned] operator[++] operator[SEP] identifier[pinCount] operator[=] identifier[element] operator[SEP] identifier[pinned] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[pinCount] operator[SEP] operator[SEP]
}
|
public VNode el(String tag, VNodeData data, Object... children) {
return this.function.create(tag, data, children);
} | class class_name[name] begin[{]
method[el, return_type[type[VNode]], modifier[public], parameter[tag, data, children]] begin[{]
return[THIS[member[None.function]call[None.create, parameter[member[.tag], member[.data], member[.children]]]]]
end[}]
END[}] | Keyword[public] identifier[VNode] identifier[el] operator[SEP] identifier[String] identifier[tag] , identifier[VNodeData] identifier[data] , identifier[Object] operator[...] identifier[children] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[function] operator[SEP] identifier[create] operator[SEP] identifier[tag] , identifier[data] , identifier[children] operator[SEP] operator[SEP]
}
|
public void deleteEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) {
deleteEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name).toBlocking().single().body();
} | class class_name[name] begin[{]
method[deleteEventHubConsumerGroup, return_type[void], modifier[public], parameter[resourceGroupName, resourceName, eventHubEndpointName, name]] begin[{]
call[.deleteEventHubConsumerGroupWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.resourceName], member[.eventHubEndpointName], member[.name]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[deleteEventHubConsumerGroup] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[resourceName] , identifier[String] identifier[eventHubEndpointName] , identifier[String] identifier[name] operator[SEP] {
identifier[deleteEventHubConsumerGroupWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[resourceName] , identifier[eventHubEndpointName] , identifier[name] 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 NotificationChain basicSetSetUpTime(Parameter newSetUpTime, NotificationChain msgs) {
Parameter oldSetUpTime = setUpTime;
setUpTime = newSetUpTime;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.TIME_PARAMETERS__SET_UP_TIME, oldSetUpTime, newSetUpTime);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
} | class class_name[name] begin[{]
method[basicSetSetUpTime, return_type[type[NotificationChain]], modifier[public], parameter[newSetUpTime, msgs]] begin[{]
local_variable[type[Parameter], oldSetUpTime]
assign[member[.setUpTime], member[.newSetUpTime]]
if[call[.eNotificationRequired, parameter[]]] begin[{]
local_variable[type[ENotificationImpl], notification]
if[binary_operation[member[.msgs], ==, literal[null]]] begin[{]
assign[member[.msgs], member[.notification]]
else begin[{]
call[msgs.add, parameter[member[.notification]]]
end[}]
else begin[{]
None
end[}]
return[member[.msgs]]
end[}]
END[}] | Keyword[public] identifier[NotificationChain] identifier[basicSetSetUpTime] operator[SEP] identifier[Parameter] identifier[newSetUpTime] , identifier[NotificationChain] identifier[msgs] operator[SEP] {
identifier[Parameter] identifier[oldSetUpTime] operator[=] identifier[setUpTime] operator[SEP] identifier[setUpTime] operator[=] identifier[newSetUpTime] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] {
identifier[ENotificationImpl] identifier[notification] operator[=] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[BpsimPackage] operator[SEP] identifier[TIME_PARAMETERS__SET_UP_TIME] , identifier[oldSetUpTime] , identifier[newSetUpTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msgs] operator[==] Other[null] operator[SEP] identifier[msgs] operator[=] identifier[notification] operator[SEP] Keyword[else] identifier[msgs] operator[SEP] identifier[add] operator[SEP] identifier[notification] operator[SEP] operator[SEP]
}
Keyword[return] identifier[msgs] operator[SEP]
}
|
@SuppressWarnings("unchecked")
public <T> T getItem(String itemName, Class<T> clazz) throws ContextException {
String item = getItem(itemName);
if (item == null || item.isEmpty()) {
return null;
}
ISerializer<?> contextSerializer = ContextSerializerRegistry.getInstance().get(clazz);
if (contextSerializer == null) {
throw new ContextException("No serializer found for type " + clazz.getName());
}
return (T) contextSerializer.deserialize(item);
} | class class_name[name] begin[{]
method[getItem, return_type[type[T]], modifier[public], parameter[itemName, clazz]] begin[{]
local_variable[type[String], item]
if[binary_operation[binary_operation[member[.item], ==, literal[null]], ||, call[item.isEmpty, parameter[]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[ISerializer], contextSerializer]
if[binary_operation[member[.contextSerializer], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No serializer found for type "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ContextException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deserialize, postfix_operators=[], prefix_operators=[], qualifier=contextSerializer, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[getItem] operator[SEP] identifier[String] identifier[itemName] , identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] Keyword[throws] identifier[ContextException] {
identifier[String] identifier[item] operator[=] identifier[getItem] operator[SEP] identifier[itemName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[item] operator[==] Other[null] operator[||] identifier[item] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[ISerializer] operator[<] operator[?] operator[>] identifier[contextSerializer] operator[=] identifier[ContextSerializerRegistry] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[contextSerializer] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ContextException] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[contextSerializer] operator[SEP] identifier[deserialize] operator[SEP] identifier[item] operator[SEP] operator[SEP]
}
|
@Override
public int leftAdjustCharHead(byte[]bytes, int p, int s, int end) {
if (s <= p) return s;
int p_ = s;
while (!utf8IsLead(bytes[p_] & 0xff) && p_ > p) p_--;
return p_;
} | class class_name[name] begin[{]
method[leftAdjustCharHead, return_type[type[int]], modifier[public], parameter[bytes, p, s, end]] begin[{]
if[binary_operation[member[.s], <=, member[.p]]] begin[{]
return[member[.s]]
else begin[{]
None
end[}]
local_variable[type[int], p_]
while[binary_operation[call[.utf8IsLead, parameter[binary_operation[member[.bytes], &, literal[0xff]]]], &&, binary_operation[member[.p_], >, member[.p]]]] begin[{]
member[.p_]
end[}]
return[member[.p_]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[leftAdjustCharHead] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , Keyword[int] identifier[p] , Keyword[int] identifier[s] , Keyword[int] identifier[end] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[<=] identifier[p] operator[SEP] Keyword[return] identifier[s] operator[SEP] Keyword[int] identifier[p_] operator[=] identifier[s] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[utf8IsLead] operator[SEP] identifier[bytes] operator[SEP] identifier[p_] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[&&] identifier[p_] operator[>] identifier[p] operator[SEP] identifier[p_] operator[--] operator[SEP] Keyword[return] identifier[p_] operator[SEP]
}
|
protected void createGenerateServiceTicketAction(final Flow flow) {
val handler = createActionState(flow,
CasWebflowConstants.STATE_ID_GENERATE_SERVICE_TICKET,
createEvaluateAction(CasWebflowConstants.ACTION_ID_GENERATE_SERVICE_TICKET));
createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_SUCCESS, CasWebflowConstants.STATE_ID_REDIRECT);
createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_WARN, CasWebflowConstants.STATE_ID_WARN);
createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE, CasWebflowConstants.STATE_ID_HANDLE_AUTHN_FAILURE);
createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_ERROR, CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM);
createTransitionForState(handler, CasWebflowConstants.TRANSITION_ID_GATEWAY, CasWebflowConstants.STATE_ID_GATEWAY_SERVICES_MGMT_CHECK);
} | class class_name[name] begin[{]
method[createGenerateServiceTicketAction, return_type[void], modifier[protected], parameter[flow]] begin[{]
local_variable[type[val], handler]
call[.createTransitionForState, parameter[member[.handler], member[CasWebflowConstants.TRANSITION_ID_SUCCESS], member[CasWebflowConstants.STATE_ID_REDIRECT]]]
call[.createTransitionForState, parameter[member[.handler], member[CasWebflowConstants.TRANSITION_ID_WARN], member[CasWebflowConstants.STATE_ID_WARN]]]
call[.createTransitionForState, parameter[member[.handler], member[CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE], member[CasWebflowConstants.STATE_ID_HANDLE_AUTHN_FAILURE]]]
call[.createTransitionForState, parameter[member[.handler], member[CasWebflowConstants.TRANSITION_ID_ERROR], member[CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM]]]
call[.createTransitionForState, parameter[member[.handler], member[CasWebflowConstants.TRANSITION_ID_GATEWAY], member[CasWebflowConstants.STATE_ID_GATEWAY_SERVICES_MGMT_CHECK]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[createGenerateServiceTicketAction] operator[SEP] Keyword[final] identifier[Flow] identifier[flow] operator[SEP] {
identifier[val] identifier[handler] operator[=] identifier[createActionState] operator[SEP] identifier[flow] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_GENERATE_SERVICE_TICKET] , identifier[createEvaluateAction] operator[SEP] identifier[CasWebflowConstants] operator[SEP] identifier[ACTION_ID_GENERATE_SERVICE_TICKET] operator[SEP] operator[SEP] operator[SEP] identifier[createTransitionForState] operator[SEP] identifier[handler] , identifier[CasWebflowConstants] operator[SEP] identifier[TRANSITION_ID_SUCCESS] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_REDIRECT] operator[SEP] operator[SEP] identifier[createTransitionForState] operator[SEP] identifier[handler] , identifier[CasWebflowConstants] operator[SEP] identifier[TRANSITION_ID_WARN] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_WARN] operator[SEP] operator[SEP] identifier[createTransitionForState] operator[SEP] identifier[handler] , identifier[CasWebflowConstants] operator[SEP] identifier[TRANSITION_ID_AUTHENTICATION_FAILURE] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_HANDLE_AUTHN_FAILURE] operator[SEP] operator[SEP] identifier[createTransitionForState] operator[SEP] identifier[handler] , identifier[CasWebflowConstants] operator[SEP] identifier[TRANSITION_ID_ERROR] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_INIT_LOGIN_FORM] operator[SEP] operator[SEP] identifier[createTransitionForState] operator[SEP] identifier[handler] , identifier[CasWebflowConstants] operator[SEP] identifier[TRANSITION_ID_GATEWAY] , identifier[CasWebflowConstants] operator[SEP] identifier[STATE_ID_GATEWAY_SERVICES_MGMT_CHECK] operator[SEP] operator[SEP]
}
|
@Override
public SubmitJobResult submitJob(SubmitJobRequest request) {
request = beforeClientExecution(request);
return executeSubmitJob(request);
} | class class_name[name] begin[{]
method[submitJob, return_type[type[SubmitJobResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeSubmitJob, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[SubmitJobResult] identifier[submitJob] operator[SEP] identifier[SubmitJobRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeSubmitJob] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public String readText(String prompt) {
if (!isInputStreamAvailable()) {
return null;
}
try {
return console.readLine(prompt);
} catch (IOError e) {
stderr.println("Exception while reading stdin: " + e.getMessage());
e.printStackTrace(stderr);
}
return null;
} | class class_name[name] begin[{]
method[readText, return_type[type[String]], modifier[public], parameter[prompt]] begin[{]
if[call[.isInputStreamAvailable, parameter[]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=prompt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=console, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception while reading stdin: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=stderr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stderr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOError']))], finally_block=None, label=None, resources=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[readText] operator[SEP] identifier[String] identifier[prompt] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isInputStreamAvailable] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[try] {
Keyword[return] identifier[console] operator[SEP] identifier[readLine] operator[SEP] identifier[prompt] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOError] identifier[e] operator[SEP] {
identifier[stderr] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] identifier[stderr] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
@Override
public <T> T retrieveBean(String name, T bean) throws CpoException {
return getCurrentResource().retrieveBean(name, bean);
} | class class_name[name] begin[{]
method[retrieveBean, return_type[type[T]], modifier[public], parameter[name, bean]] begin[{]
return[call[.getCurrentResource, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[retrieveBean] operator[SEP] identifier[String] identifier[name] , identifier[T] identifier[bean] operator[SEP] Keyword[throws] identifier[CpoException] {
Keyword[return] identifier[getCurrentResource] operator[SEP] operator[SEP] operator[SEP] identifier[retrieveBean] operator[SEP] identifier[name] , identifier[bean] operator[SEP] operator[SEP]
}
|
public static void fixChartSheetNameRef(Sheet sheet, String oldSheetName, String newSheetName) {
val drawing = sheet.getDrawingPatriarch();
if (!(drawing instanceof XSSFDrawing)) return;
for (val chart : ((XSSFDrawing) drawing).getCharts()) {
for (val barChart : chart.getCTChart().getPlotArea().getBarChartList()) {
for (val ser : barChart.getSerList()) {
val val = ser.getVal();
if (val == null) continue;
val numRef = val.getNumRef();
if (numRef == null) continue;
val f = numRef.getF();
if (f == null) continue;
if (f.contains(oldSheetName)) {
numRef.setF(f.replace(oldSheetName, newSheetName));
}
}
}
}
} | class class_name[name] begin[{]
method[fixChartSheetNameRef, return_type[void], modifier[public static], parameter[sheet, oldSheetName, newSheetName]] begin[{]
local_variable[type[val], drawing]
if[binary_operation[member[.drawing], instanceof, type[XSSFDrawing]]] begin[{]
return[None]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getVal, postfix_operators=[], prefix_operators=[], qualifier=ser, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=val, 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=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNumRef, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[], type_arguments=None), name=numRef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=numRef, 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=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getF, postfix_operators=[], prefix_operators=[], qualifier=numRef, selectors=[], type_arguments=None), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=f, 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=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=oldSheetName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=oldSheetName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newSheetName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=replace, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)], member=setF, postfix_operators=[], prefix_operators=[], qualifier=numRef, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSerList, postfix_operators=[], prefix_operators=[], qualifier=barChart, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ser)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCTChart, postfix_operators=[], prefix_operators=[], qualifier=chart, selectors=[MethodInvocation(arguments=[], member=getPlotArea, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getBarChartList, 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=barChart)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=drawing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=XSSFDrawing, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=chart)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[fixChartSheetNameRef] operator[SEP] identifier[Sheet] identifier[sheet] , identifier[String] identifier[oldSheetName] , identifier[String] identifier[newSheetName] operator[SEP] {
identifier[val] identifier[drawing] operator[=] identifier[sheet] operator[SEP] identifier[getDrawingPatriarch] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[drawing] Keyword[instanceof] identifier[XSSFDrawing] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[for] operator[SEP] identifier[val] identifier[chart] operator[:] operator[SEP] operator[SEP] identifier[XSSFDrawing] operator[SEP] identifier[drawing] operator[SEP] operator[SEP] identifier[getCharts] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[val] identifier[barChart] operator[:] identifier[chart] operator[SEP] identifier[getCTChart] operator[SEP] operator[SEP] operator[SEP] identifier[getPlotArea] operator[SEP] operator[SEP] operator[SEP] identifier[getBarChartList] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[val] identifier[ser] operator[:] identifier[barChart] operator[SEP] identifier[getSerList] operator[SEP] operator[SEP] operator[SEP] {
identifier[val] identifier[val] operator[=] identifier[ser] operator[SEP] identifier[getVal] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] identifier[val] identifier[numRef] operator[=] identifier[val] operator[SEP] identifier[getNumRef] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numRef] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] identifier[val] identifier[f] operator[=] identifier[numRef] operator[SEP] identifier[getF] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[contains] operator[SEP] identifier[oldSheetName] operator[SEP] operator[SEP] {
identifier[numRef] operator[SEP] identifier[setF] operator[SEP] identifier[f] operator[SEP] identifier[replace] operator[SEP] identifier[oldSheetName] , identifier[newSheetName] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
}
|
@Override
public AtomicInteger convert(final String value) {
checkArgument(value != null, "Value to convert must not be null");
checkArgument(!value.isEmpty(), "Value to convert must not be empty");
return new AtomicInteger(Integer.parseInt(value));
} | class class_name[name] begin[{]
method[convert, return_type[type[AtomicInteger]], modifier[public], parameter[value]] begin[{]
call[.checkArgument, parameter[binary_operation[member[.value], !=, literal[null]], literal["Value to convert must not be null"]]]
call[.checkArgument, parameter[call[value.isEmpty, parameter[]], literal["Value to convert must not be empty"]]]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AtomicInteger, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[AtomicInteger] identifier[convert] operator[SEP] Keyword[final] identifier[String] identifier[value] operator[SEP] {
identifier[checkArgument] operator[SEP] identifier[value] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] operator[!] identifier[value] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AtomicInteger] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
|
public static int cuMemGetAddressRange(CUdeviceptr pbase, long psize[], CUdeviceptr dptr)
{
return checkResult(cuMemGetAddressRangeNative(pbase, psize, dptr));
} | class class_name[name] begin[{]
method[cuMemGetAddressRange, return_type[type[int]], modifier[public static], parameter[pbase, psize, dptr]] begin[{]
return[call[.checkResult, parameter[call[.cuMemGetAddressRangeNative, parameter[member[.pbase], member[.psize], member[.dptr]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[cuMemGetAddressRange] operator[SEP] identifier[CUdeviceptr] identifier[pbase] , Keyword[long] identifier[psize] operator[SEP] operator[SEP] , identifier[CUdeviceptr] identifier[dptr] operator[SEP] {
Keyword[return] identifier[checkResult] operator[SEP] identifier[cuMemGetAddressRangeNative] operator[SEP] identifier[pbase] , identifier[psize] , identifier[dptr] operator[SEP] operator[SEP] operator[SEP]
}
|
public static boolean isRetryableServiceException(SdkBaseException exception) {
return isAse(exception) && RETRYABLE_STATUS_CODES.contains(toAse(exception).getStatusCode());
} | class class_name[name] begin[{]
method[isRetryableServiceException, return_type[type[boolean]], modifier[public static], parameter[exception]] begin[{]
return[binary_operation[call[.isAse, parameter[member[.exception]]], &&, call[RETRYABLE_STATUS_CODES.contains, parameter[call[.toAse, parameter[member[.exception]]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isRetryableServiceException] operator[SEP] identifier[SdkBaseException] identifier[exception] operator[SEP] {
Keyword[return] identifier[isAse] operator[SEP] identifier[exception] operator[SEP] operator[&&] identifier[RETRYABLE_STATUS_CODES] operator[SEP] identifier[contains] operator[SEP] identifier[toAse] operator[SEP] identifier[exception] operator[SEP] operator[SEP] identifier[getStatusCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private static String syncRestNativeCall(final String purl) {
final XMLHttpRequest xmlHttp = Browser.getWindow().newXMLHttpRequest();
xmlHttp.open("GET", purl, false); // false for synchronous request
xmlHttp.send();
return xmlHttp.getResponseText();
} | class class_name[name] begin[{]
method[syncRestNativeCall, return_type[type[String]], modifier[private static], parameter[purl]] begin[{]
local_variable[type[XMLHttpRequest], xmlHttp]
call[xmlHttp.open, parameter[literal["GET"], member[.purl], literal[false]]]
call[xmlHttp.send, parameter[]]
return[call[xmlHttp.getResponseText, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[syncRestNativeCall] operator[SEP] Keyword[final] identifier[String] identifier[purl] operator[SEP] {
Keyword[final] identifier[XMLHttpRequest] identifier[xmlHttp] operator[=] identifier[Browser] operator[SEP] identifier[getWindow] operator[SEP] operator[SEP] operator[SEP] identifier[newXMLHttpRequest] operator[SEP] operator[SEP] operator[SEP] identifier[xmlHttp] operator[SEP] identifier[open] operator[SEP] literal[String] , identifier[purl] , literal[boolean] operator[SEP] operator[SEP] identifier[xmlHttp] operator[SEP] identifier[send] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[xmlHttp] operator[SEP] identifier[getResponseText] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.GCRLINE__RG:
return rg != null && !rg.isEmpty();
}
return super.eIsSet(featureID);
} | class class_name[name] begin[{]
method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=GCRLINE__RG, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=rg, selectors=[], type_arguments=None), operator=&&), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCRLINE__RG] operator[:] Keyword[return] identifier[rg] operator[!=] Other[null] operator[&&] operator[!] identifier[rg] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP]
}
|
public JavaDoubleRDD scoreExamples(JavaRDD<DataSet> data, boolean includeRegularizationTerms) {
return scoreExamples(data, includeRegularizationTerms, DEFAULT_EVAL_SCORE_BATCH_SIZE);
} | class class_name[name] begin[{]
method[scoreExamples, return_type[type[JavaDoubleRDD]], modifier[public], parameter[data, includeRegularizationTerms]] begin[{]
return[call[.scoreExamples, parameter[member[.data], member[.includeRegularizationTerms], member[.DEFAULT_EVAL_SCORE_BATCH_SIZE]]]]
end[}]
END[}] | Keyword[public] identifier[JavaDoubleRDD] identifier[scoreExamples] operator[SEP] identifier[JavaRDD] operator[<] identifier[DataSet] operator[>] identifier[data] , Keyword[boolean] identifier[includeRegularizationTerms] operator[SEP] {
Keyword[return] identifier[scoreExamples] operator[SEP] identifier[data] , identifier[includeRegularizationTerms] , identifier[DEFAULT_EVAL_SCORE_BATCH_SIZE] operator[SEP] operator[SEP]
}
|
public byte[] deliverSm(int sequenceNumber, String serviceType,
byte sourceAddrTon, byte sourceAddrNpi, String sourceAddr,
byte destAddrTon, byte destAddrNpi, String destinationAddr,
byte esmClass, byte protocolId, byte priorityFlag,
byte registeredDelivery, byte dataCoding, byte[] shortMessage,
OptionalParameter... optionalParameters) throws PDUStringException {
StringValidator.validateString(serviceType,
StringParameter.SERVICE_TYPE);
StringValidator.validateString(sourceAddr, StringParameter.SOURCE_ADDR);
StringValidator.validateString(destinationAddr,
StringParameter.DESTINATION_ADDR);
StringValidator.validateString(shortMessage,
StringParameter.SHORT_MESSAGE);
PDUByteBuffer buf = new PDUByteBuffer(SMPPConstant.CID_DELIVER_SM, 0,
sequenceNumber);
buf.append(serviceType);
buf.append(sourceAddrTon);
buf.append(sourceAddrNpi);
buf.append(sourceAddr);
buf.append(destAddrTon);
buf.append(destAddrNpi);
buf.append(destinationAddr);
buf.append(esmClass);
buf.append(protocolId);
buf.append(priorityFlag);
buf.append((String)null); // schedule delivery time
buf.append((String)null); // validity period
buf.append(registeredDelivery);
buf.append((byte)0); // replace if present flag
buf.append(dataCoding);
buf.append((byte)0); // sm default msg id
buf.append((byte)shortMessage.length);
buf.append(shortMessage);
buf.appendAll(optionalParameters);
;
return buf.toBytes();
} | class class_name[name] begin[{]
method[deliverSm, return_type[type[byte]], modifier[public], parameter[sequenceNumber, serviceType, sourceAddrTon, sourceAddrNpi, sourceAddr, destAddrTon, destAddrNpi, destinationAddr, esmClass, protocolId, priorityFlag, registeredDelivery, dataCoding, shortMessage, optionalParameters]] begin[{]
call[StringValidator.validateString, parameter[member[.serviceType], member[StringParameter.SERVICE_TYPE]]]
call[StringValidator.validateString, parameter[member[.sourceAddr], member[StringParameter.SOURCE_ADDR]]]
call[StringValidator.validateString, parameter[member[.destinationAddr], member[StringParameter.DESTINATION_ADDR]]]
call[StringValidator.validateString, parameter[member[.shortMessage], member[StringParameter.SHORT_MESSAGE]]]
local_variable[type[PDUByteBuffer], buf]
call[buf.append, parameter[member[.serviceType]]]
call[buf.append, parameter[member[.sourceAddrTon]]]
call[buf.append, parameter[member[.sourceAddrNpi]]]
call[buf.append, parameter[member[.sourceAddr]]]
call[buf.append, parameter[member[.destAddrTon]]]
call[buf.append, parameter[member[.destAddrNpi]]]
call[buf.append, parameter[member[.destinationAddr]]]
call[buf.append, parameter[member[.esmClass]]]
call[buf.append, parameter[member[.protocolId]]]
call[buf.append, parameter[member[.priorityFlag]]]
call[buf.append, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]
call[buf.append, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]
call[buf.append, parameter[member[.registeredDelivery]]]
call[buf.append, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), type=BasicType(dimensions=[], name=byte))]]
call[buf.append, parameter[member[.dataCoding]]]
call[buf.append, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), type=BasicType(dimensions=[], name=byte))]]
call[buf.append, parameter[Cast(expression=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=shortMessage, selectors=[]), type=BasicType(dimensions=[], name=byte))]]
call[buf.append, parameter[member[.shortMessage]]]
call[buf.appendAll, parameter[member[.optionalParameters]]]
Statement(label=None)
return[call[buf.toBytes, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[deliverSm] operator[SEP] Keyword[int] identifier[sequenceNumber] , identifier[String] identifier[serviceType] , Keyword[byte] identifier[sourceAddrTon] , Keyword[byte] identifier[sourceAddrNpi] , identifier[String] identifier[sourceAddr] , Keyword[byte] identifier[destAddrTon] , Keyword[byte] identifier[destAddrNpi] , identifier[String] identifier[destinationAddr] , Keyword[byte] identifier[esmClass] , Keyword[byte] identifier[protocolId] , Keyword[byte] identifier[priorityFlag] , Keyword[byte] identifier[registeredDelivery] , Keyword[byte] identifier[dataCoding] , Keyword[byte] operator[SEP] operator[SEP] identifier[shortMessage] , identifier[OptionalParameter] operator[...] identifier[optionalParameters] operator[SEP] Keyword[throws] identifier[PDUStringException] {
identifier[StringValidator] operator[SEP] identifier[validateString] operator[SEP] identifier[serviceType] , identifier[StringParameter] operator[SEP] identifier[SERVICE_TYPE] operator[SEP] operator[SEP] identifier[StringValidator] operator[SEP] identifier[validateString] operator[SEP] identifier[sourceAddr] , identifier[StringParameter] operator[SEP] identifier[SOURCE_ADDR] operator[SEP] operator[SEP] identifier[StringValidator] operator[SEP] identifier[validateString] operator[SEP] identifier[destinationAddr] , identifier[StringParameter] operator[SEP] identifier[DESTINATION_ADDR] operator[SEP] operator[SEP] identifier[StringValidator] operator[SEP] identifier[validateString] operator[SEP] identifier[shortMessage] , identifier[StringParameter] operator[SEP] identifier[SHORT_MESSAGE] operator[SEP] operator[SEP] identifier[PDUByteBuffer] identifier[buf] operator[=] Keyword[new] identifier[PDUByteBuffer] operator[SEP] identifier[SMPPConstant] operator[SEP] identifier[CID_DELIVER_SM] , Other[0] , identifier[sequenceNumber] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[serviceType] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[sourceAddrTon] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[sourceAddrNpi] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[sourceAddr] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[destAddrTon] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[destAddrNpi] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[destinationAddr] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[esmClass] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[protocolId] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[priorityFlag] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[String] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[String] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[registeredDelivery] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[dataCoding] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] identifier[shortMessage] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[shortMessage] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[appendAll] operator[SEP] identifier[optionalParameters] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[buf] operator[SEP] identifier[toBytes] operator[SEP] operator[SEP] operator[SEP]
}
|
public void decode(String string, OutputStream out) throws IOException {
decode(new ByteArrayInputStream(string.getBytes()),out);
} | class class_name[name] begin[{]
method[decode, return_type[void], modifier[public], parameter[string, out]] begin[{]
call[.decode, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=string, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None)), member[.out]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[decode] operator[SEP] identifier[String] identifier[string] , identifier[OutputStream] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[decode] operator[SEP] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[string] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] , identifier[out] operator[SEP] operator[SEP]
}
|
private static float[] calcExpTable() {
float[] expTable = new float[EXP_TABLE_SIZE];
for (int i = 0; i < EXP_TABLE_SIZE; i++) {
expTable[i] = (float) Math.exp((i / (float) EXP_TABLE_SIZE * 2 - 1) * MAX_EXP);
expTable[i] = expTable[i] / (expTable[i] + 1); // Precompute f(x) = x / (x + 1)
}
return expTable;
} | class class_name[name] begin[{]
method[calcExpTable, return_type[type[float]], modifier[private static], parameter[]] begin[{]
local_variable[type[float], expTable]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=expTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Cast(expression=MemberReference(member=EXP_TABLE_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=float)), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operandr=MemberReference(member=MAX_EXP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=exp, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=float))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=expTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=expTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=BinaryOperation(operandl=MemberReference(member=expTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=/)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=EXP_TABLE_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.expTable]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[float] operator[SEP] operator[SEP] identifier[calcExpTable] operator[SEP] operator[SEP] {
Keyword[float] operator[SEP] operator[SEP] identifier[expTable] operator[=] Keyword[new] Keyword[float] operator[SEP] identifier[EXP_TABLE_SIZE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[EXP_TABLE_SIZE] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[expTable] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[Math] operator[SEP] identifier[exp] operator[SEP] operator[SEP] identifier[i] operator[/] operator[SEP] Keyword[float] operator[SEP] identifier[EXP_TABLE_SIZE] operator[*] Other[2] operator[-] Other[1] operator[SEP] operator[*] identifier[MAX_EXP] operator[SEP] operator[SEP] identifier[expTable] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[expTable] operator[SEP] identifier[i] operator[SEP] operator[/] operator[SEP] identifier[expTable] operator[SEP] identifier[i] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
Keyword[return] identifier[expTable] operator[SEP]
}
|
public final void mLONG_SUM() throws RecognitionException {
try {
int _type = LONG_SUM;
int _channel = DEFAULT_TOKEN_CHANNEL;
// druidG.g:609:10: ( ( 'LONG_SUM' ) )
// druidG.g:609:12: ( 'LONG_SUM' )
{
// druidG.g:609:12: ( 'LONG_SUM' )
// druidG.g:609:13: 'LONG_SUM'
{
match("LONG_SUM");
}
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
} | class class_name[name] begin[{]
method[mLONG_SUM, return_type[void], modifier[final public], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=LONG_SUM, 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)), BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="LONG_SUM")], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), 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[mLONG_SUM] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
Keyword[try] {
Keyword[int] identifier[_type] operator[=] identifier[LONG_SUM] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] {
{
identifier[match] operator[SEP] literal[String] operator[SEP] 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 PrimitiveMatrix calculateAssetReturns(final PrimitiveMatrix assetWeights) {
final PrimitiveMatrix tmpAssetWeights = myRiskAversion.compareTo(DEFAULT_RISK_AVERSION) == 0 ? assetWeights : assetWeights.multiply(myRiskAversion);
return myCovariances.multiply(tmpAssetWeights);
} | class class_name[name] begin[{]
method[calculateAssetReturns, return_type[type[PrimitiveMatrix]], modifier[public], parameter[assetWeights]] begin[{]
local_variable[type[PrimitiveMatrix], tmpAssetWeights]
return[call[myCovariances.multiply, parameter[member[.tmpAssetWeights]]]]
end[}]
END[}] | Keyword[public] identifier[PrimitiveMatrix] identifier[calculateAssetReturns] operator[SEP] Keyword[final] identifier[PrimitiveMatrix] identifier[assetWeights] operator[SEP] {
Keyword[final] identifier[PrimitiveMatrix] identifier[tmpAssetWeights] operator[=] identifier[myRiskAversion] operator[SEP] identifier[compareTo] operator[SEP] identifier[DEFAULT_RISK_AVERSION] operator[SEP] operator[==] Other[0] operator[?] identifier[assetWeights] operator[:] identifier[assetWeights] operator[SEP] identifier[multiply] operator[SEP] identifier[myRiskAversion] operator[SEP] operator[SEP] Keyword[return] identifier[myCovariances] operator[SEP] identifier[multiply] operator[SEP] identifier[tmpAssetWeights] operator[SEP] operator[SEP]
}
|
public Response put(String path, Formattable data) throws AuthyException {
return request(Resource.METHOD_PUT, path, data, getDefaultOptions());
} | class class_name[name] begin[{]
method[put, return_type[type[Response]], modifier[public], parameter[path, data]] begin[{]
return[call[.request, parameter[member[Resource.METHOD_PUT], member[.path], member[.data], call[.getDefaultOptions, parameter[]]]]]
end[}]
END[}] | Keyword[public] identifier[Response] identifier[put] operator[SEP] identifier[String] identifier[path] , identifier[Formattable] identifier[data] operator[SEP] Keyword[throws] identifier[AuthyException] {
Keyword[return] identifier[request] operator[SEP] identifier[Resource] operator[SEP] identifier[METHOD_PUT] , identifier[path] , identifier[data] , identifier[getDefaultOptions] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public FileStatus getFileStatus (Path f) throws IOException {
try (Closeable context = new TimerContextWithLog(this.getFileStatusTimer.time(), "getFileStatus", f)) {
return super.getFileStatus(f);
}
} | class class_name[name] begin[{]
method[getFileStatus, return_type[type[FileStatus]], modifier[public], parameter[f]] begin[{]
TryStatement(block=[ReturnStatement(expression=SuperMethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFileStatus, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=context, type=ReferenceType(arguments=None, dimensions=[], name=Closeable, sub_type=None), value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=getFileStatusTimer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=time, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getFileStatus"), MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimerContextWithLog, sub_type=None)))])
end[}]
END[}] | Keyword[public] identifier[FileStatus] identifier[getFileStatus] operator[SEP] identifier[Path] identifier[f] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[try] operator[SEP] identifier[Closeable] identifier[context] operator[=] Keyword[new] identifier[TimerContextWithLog] operator[SEP] Keyword[this] operator[SEP] identifier[getFileStatusTimer] operator[SEP] identifier[time] operator[SEP] operator[SEP] , literal[String] , identifier[f] operator[SEP] operator[SEP] {
Keyword[return] Keyword[super] operator[SEP] identifier[getFileStatus] operator[SEP] identifier[f] operator[SEP] operator[SEP]
}
}
|
@Override
protected boolean isSelectedMessagesInSessionScope(HttpMessageContainer messageContainer) {
final Session session = Model.getSingleton().getSession();
for (HistoryReference historyReference : getSelectedHistoryReferences(messageContainer)) {
if (historyReference != null && !session.isInScope(historyReference)) {
return false;
}
}
return true;
} | class class_name[name] begin[{]
method[isSelectedMessagesInSessionScope, return_type[type[boolean]], modifier[protected], parameter[messageContainer]] begin[{]
local_variable[type[Session], session]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=historyReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=historyReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInScope, postfix_operators=[], prefix_operators=['!'], qualifier=session, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=messageContainer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSelectedHistoryReferences, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=historyReference)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HistoryReference, sub_type=None))), label=None)
return[literal[true]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[isSelectedMessagesInSessionScope] operator[SEP] identifier[HttpMessageContainer] identifier[messageContainer] operator[SEP] {
Keyword[final] identifier[Session] identifier[session] operator[=] identifier[Model] operator[SEP] identifier[getSingleton] operator[SEP] operator[SEP] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[HistoryReference] identifier[historyReference] operator[:] identifier[getSelectedHistoryReferences] operator[SEP] identifier[messageContainer] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[historyReference] operator[!=] Other[null] operator[&&] operator[!] identifier[session] operator[SEP] identifier[isInScope] operator[SEP] identifier[historyReference] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static SNodeOrRelation node(JcNode node) {
SNodeOrRelation ret = SFactory.node(node);
ASTNode an = APIObjectAccess.getAstNode(ret);
an.setClauseType(ClauseType.START);
return ret;
} | class class_name[name] begin[{]
method[node, return_type[type[SNodeOrRelation]], modifier[public static], parameter[node]] begin[{]
local_variable[type[SNodeOrRelation], ret]
local_variable[type[ASTNode], an]
call[an.setClauseType, parameter[member[ClauseType.START]]]
return[member[.ret]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[SNodeOrRelation] identifier[node] operator[SEP] identifier[JcNode] identifier[node] operator[SEP] {
identifier[SNodeOrRelation] identifier[ret] operator[=] identifier[SFactory] operator[SEP] identifier[node] operator[SEP] identifier[node] 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[START] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
|
public void debug(Object message, Throwable t)
{
if (IS12)
{
getLogger().log(FQCN, Level.DEBUG, message, t);
}
else
{
getLogger().log(FQCN, Level.DEBUG, message, t);
}
} | class class_name[name] begin[{]
method[debug, return_type[void], modifier[public], parameter[message, t]] begin[{]
if[member[.IS12]] begin[{]
call[.getLogger, parameter[]]
else begin[{]
call[.getLogger, parameter[]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[debug] operator[SEP] identifier[Object] identifier[message] , identifier[Throwable] identifier[t] operator[SEP] {
Keyword[if] operator[SEP] identifier[IS12] operator[SEP] {
identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[FQCN] , identifier[Level] operator[SEP] identifier[DEBUG] , identifier[message] , identifier[t] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[FQCN] , identifier[Level] operator[SEP] identifier[DEBUG] , identifier[message] , identifier[t] operator[SEP] operator[SEP]
}
}
|
public String getMergeSql(String schemaName, String tableName, String[] keyNames, String[] columnNames,
String[] viewColumnNames, boolean includePks, String shardColumn) {
final String aliasA = "a";
final String aliasB = "b";
StringBuilder sql = new StringBuilder();
sql.append("merge /*+ use_nl(a b)*/ into ")
.append(getFullName(schemaName, tableName))
.append(" ")
.append(aliasA);
sql.append(" using (select ");
int size = columnNames.length;
// 构建 (select ? as col1, ? as col2 from dual)
for (int i = 0; i < size; i++) {
sql.append("? as " + appendEscape(columnNames[i])).append(" , ");
}
size = keyNames.length;
for (int i = 0; i < size; i++) {
sql.append("? as " + appendEscape(keyNames[i])).append((i + 1 < size) ? " , " : "");
}
sql.append(" from dual) ").append(aliasB);
sql.append(" on (");
size = keyNames.length;
for (int i = 0; i < size; i++) {
sql.append(aliasA + "." + appendEscape(keyNames[i]))
.append("=")
.append(aliasB + "." + appendEscape(keyNames[i]));
sql.append((i + 1 < size) ? " and " : "");
}
sql.append(") when matched then update set ");
size = columnNames.length;
for (int i = 0; i < size; i++) {
sql.append(aliasA + "." + appendEscape(columnNames[i]))
.append("=")
.append(aliasB + "." + appendEscape(columnNames[i]));
sql.append((i + 1 < size) ? " , " : "");
}
sql.append(" when not matched then insert (");
size = columnNames.length;
for (int i = 0; i < size; i++) {
sql.append(aliasA + "." + appendEscape(columnNames[i])).append(" , ");
}
size = keyNames.length;
for (int i = 0; i < size; i++) {
sql.append(aliasA + "." + appendEscape(keyNames[i])).append((i + 1 < size) ? " , " : "");
}
sql.append(" ) values (");
size = columnNames.length;
for (int i = 0; i < size; i++) {
sql.append(aliasB + "." + appendEscape(columnNames[i])).append(" , ");
}
size = keyNames.length;
for (int i = 0; i < size; i++) {
sql.append(aliasB + "." + appendEscape(keyNames[i])).append((i + 1 < size) ? " , " : "");
}
sql.append(" )");
return sql.toString().intern(); // intern优化,避免出现大量相同的字符串
} | class class_name[name] begin[{]
method[getMergeSql, return_type[type[String]], modifier[public], parameter[schemaName, tableName, keyNames, columnNames, viewColumnNames, includePks, shardColumn]] begin[{]
local_variable[type[String], aliasA]
local_variable[type[String], aliasB]
local_variable[type[StringBuilder], sql]
call[sql.append, parameter[literal["merge /*+ use_nl(a b)*/ into "]]]
call[sql.append, parameter[literal[" using (select "]]]
local_variable[type[int], size]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="? as "), operandr=MethodInvocation(arguments=[MemberReference(member=columnNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" , ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.size], member[keyNames.length]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="? as "), operandr=MethodInvocation(arguments=[MemberReference(member=keyNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" , "))], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[sql.append, parameter[literal[" from dual) "]]]
call[sql.append, parameter[literal[" on ("]]]
assign[member[.size], member[keyNames.length]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aliasA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=keyNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aliasB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=keyNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" and "))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[sql.append, parameter[literal[") when matched then update set "]]]
assign[member[.size], member[columnNames.length]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aliasA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=columnNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aliasB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=columnNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" , "))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[sql.append, parameter[literal[" when not matched then insert ("]]]
assign[member[.size], member[columnNames.length]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aliasA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=columnNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" , ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.size], member[keyNames.length]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aliasA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=keyNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" , "))], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[sql.append, parameter[literal[" ) values ("]]]
assign[member[.size], member[columnNames.length]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aliasB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=columnNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" , ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.size], member[keyNames.length]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=aliasB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=keyNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=appendEscape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sql, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" , "))], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[sql.append, parameter[literal[" )"]]]
return[call[sql.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getMergeSql] operator[SEP] identifier[String] identifier[schemaName] , identifier[String] identifier[tableName] , identifier[String] operator[SEP] operator[SEP] identifier[keyNames] , identifier[String] operator[SEP] operator[SEP] identifier[columnNames] , identifier[String] operator[SEP] operator[SEP] identifier[viewColumnNames] , Keyword[boolean] identifier[includePks] , identifier[String] identifier[shardColumn] operator[SEP] {
Keyword[final] identifier[String] identifier[aliasA] operator[=] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[aliasB] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sql] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getFullName] operator[SEP] identifier[schemaName] , identifier[tableName] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[aliasA] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[columnNames] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[columnNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[size] operator[=] identifier[keyNames] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[keyNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[size] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP]
}
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[aliasB] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[size] operator[=] identifier[keyNames] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[aliasA] operator[+] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[keyNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[aliasB] operator[+] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[keyNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[size] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP]
}
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[size] operator[=] identifier[columnNames] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[aliasA] operator[+] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[columnNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[aliasB] operator[+] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[columnNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sql] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[size] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP]
}
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[size] operator[=] identifier[columnNames] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[aliasA] operator[+] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[columnNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[size] operator[=] identifier[keyNames] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[aliasA] operator[+] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[keyNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[size] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP]
}
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[size] operator[=] identifier[columnNames] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[aliasB] operator[+] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[columnNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[size] operator[=] identifier[keyNames] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sql] operator[SEP] identifier[append] operator[SEP] identifier[aliasB] operator[+] literal[String] operator[+] identifier[appendEscape] operator[SEP] identifier[keyNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[size] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP]
}
identifier[sql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sql] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[intern] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
Nullness visitArrayAccess(ArrayAccessNode node, SubNodeValues inputs, Updates updates) {
setNonnullIfTrackable(updates, node.getArray());
return hasPrimitiveType(node) ? NONNULL : defaultAssumption;
} | class class_name[name] begin[{]
method[visitArrayAccess, return_type[type[Nullness]], modifier[default], parameter[node, inputs, updates]] begin[{]
call[.setNonnullIfTrackable, parameter[member[.updates], call[node.getArray, parameter[]]]]
return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasPrimitiveType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=MemberReference(member=defaultAssumption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=NONNULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | annotation[@] identifier[Override] identifier[Nullness] identifier[visitArrayAccess] operator[SEP] identifier[ArrayAccessNode] identifier[node] , identifier[SubNodeValues] identifier[inputs] , identifier[Updates] identifier[updates] operator[SEP] {
identifier[setNonnullIfTrackable] operator[SEP] identifier[updates] , identifier[node] operator[SEP] identifier[getArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[hasPrimitiveType] operator[SEP] identifier[node] operator[SEP] operator[?] identifier[NONNULL] operator[:] identifier[defaultAssumption] operator[SEP]
}
|
public ListRoutesResult withRoutes(RouteRef... routes) {
if (this.routes == null) {
setRoutes(new java.util.ArrayList<RouteRef>(routes.length));
}
for (RouteRef ele : routes) {
this.routes.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withRoutes, return_type[type[ListRoutesResult]], modifier[public], parameter[routes]] begin[{]
if[binary_operation[THIS[member[None.routes]], ==, literal[null]]] begin[{]
call[.setRoutes, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=routes, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RouteRef, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=routes, 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=routes, 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=RouteRef, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ListRoutesResult] identifier[withRoutes] operator[SEP] identifier[RouteRef] operator[...] identifier[routes] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[routes] operator[==] Other[null] operator[SEP] {
identifier[setRoutes] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[RouteRef] operator[>] operator[SEP] identifier[routes] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[RouteRef] identifier[ele] operator[:] identifier[routes] operator[SEP] {
Keyword[this] operator[SEP] identifier[routes] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public List<CommerceWarehouse> findByG_A_P(long groupId, boolean active,
boolean primary, int start, int end,
OrderByComparator<CommerceWarehouse> orderByComparator) {
return findByG_A_P(groupId, active, primary, start, end,
orderByComparator, true);
} | class class_name[name] begin[{]
method[findByG_A_P, return_type[type[List]], modifier[public], parameter[groupId, active, primary, start, end, orderByComparator]] begin[{]
return[call[.findByG_A_P, parameter[member[.groupId], member[.active], member[.primary], member[.start], member[.end], member[.orderByComparator], literal[true]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CommerceWarehouse] operator[>] identifier[findByG_A_P] operator[SEP] Keyword[long] identifier[groupId] , Keyword[boolean] identifier[active] , Keyword[boolean] identifier[primary] , Keyword[int] identifier[start] , Keyword[int] identifier[end] , identifier[OrderByComparator] operator[<] identifier[CommerceWarehouse] operator[>] identifier[orderByComparator] operator[SEP] {
Keyword[return] identifier[findByG_A_P] operator[SEP] identifier[groupId] , identifier[active] , identifier[primary] , identifier[start] , identifier[end] , identifier[orderByComparator] , literal[boolean] operator[SEP] operator[SEP]
}
|
public boolean trimToSizeIfGreaterThanPercent(double loadFactor)
{
double excessCapacity = 1.0 - (double) this.size / (double) this.items.length;
if (excessCapacity > loadFactor)
{
this.trimToSize();
return true;
}
return false;
} | class class_name[name] begin[{]
method[trimToSizeIfGreaterThanPercent, return_type[type[boolean]], modifier[public], parameter[loadFactor]] begin[{]
local_variable[type[double], excessCapacity]
if[binary_operation[member[.excessCapacity], >, member[.loadFactor]]] begin[{]
THIS[call[None.trimToSize, parameter[]]]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[trimToSizeIfGreaterThanPercent] operator[SEP] Keyword[double] identifier[loadFactor] operator[SEP] {
Keyword[double] identifier[excessCapacity] operator[=] literal[Float] operator[-] operator[SEP] Keyword[double] operator[SEP] Keyword[this] operator[SEP] identifier[size] operator[/] operator[SEP] Keyword[double] operator[SEP] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[excessCapacity] operator[>] identifier[loadFactor] operator[SEP] {
Keyword[this] operator[SEP] identifier[trimToSize] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
@Override
public List<CommerceAccount> findByU_T(long userId, int type, int start,
int end, OrderByComparator<CommerceAccount> orderByComparator) {
return findByU_T(userId, type, start, end, orderByComparator, true);
} | class class_name[name] begin[{]
method[findByU_T, return_type[type[List]], modifier[public], parameter[userId, type, start, end, orderByComparator]] begin[{]
return[call[.findByU_T, parameter[member[.userId], member[.type], member[.start], member[.end], member[.orderByComparator], literal[true]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CommerceAccount] operator[>] identifier[findByU_T] operator[SEP] Keyword[long] identifier[userId] , Keyword[int] identifier[type] , Keyword[int] identifier[start] , Keyword[int] identifier[end] , identifier[OrderByComparator] operator[<] identifier[CommerceAccount] operator[>] identifier[orderByComparator] operator[SEP] {
Keyword[return] identifier[findByU_T] operator[SEP] identifier[userId] , identifier[type] , identifier[start] , identifier[end] , identifier[orderByComparator] , literal[boolean] operator[SEP] operator[SEP]
}
|
public void unknownEntry(Vector strings) {
if (strings != null && strings.size() > 0) {
String keyword = (String) strings.elementAt(0);
catalogManager.debug.message(2, "Unrecognized token parsing catalog", keyword);
}
} | class class_name[name] begin[{]
method[unknownEntry, return_type[void], modifier[public], parameter[strings]] begin[{]
if[binary_operation[binary_operation[member[.strings], !=, literal[null]], &&, binary_operation[call[strings.size, parameter[]], >, literal[0]]]] begin[{]
local_variable[type[String], keyword]
call[catalogManager.debug.message, parameter[literal[2], literal["Unrecognized token parsing catalog"], member[.keyword]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[unknownEntry] operator[SEP] identifier[Vector] identifier[strings] operator[SEP] {
Keyword[if] operator[SEP] identifier[strings] operator[!=] Other[null] operator[&&] identifier[strings] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[String] identifier[keyword] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[strings] operator[SEP] identifier[elementAt] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[catalogManager] operator[SEP] identifier[debug] operator[SEP] identifier[message] operator[SEP] Other[2] , literal[String] , identifier[keyword] operator[SEP] operator[SEP]
}
}
|
public static <T> List<T> iterableOf( Optional<T> value)
{
return value.map( Arrays::asList).orElse( Collections.emptyList());
} | class class_name[name] begin[{]
method[iterableOf, return_type[type[List]], modifier[public static], parameter[value]] begin[{]
return[call[value.map, parameter[MethodReference(expression=MemberReference(member=Arrays, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=asList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[iterableOf] operator[SEP] identifier[Optional] operator[<] identifier[T] operator[>] identifier[value] operator[SEP] {
Keyword[return] identifier[value] operator[SEP] identifier[map] operator[SEP] identifier[Arrays] operator[::] identifier[asList] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
ContentValues toContentValues() {
ContentValues contentValues = new ContentValues();
mBuilder.fillContentValues(contentValues);
contentValues.put(JobStorage.COLUMN_NUM_FAILURES, mFailureCount);
contentValues.put(JobStorage.COLUMN_SCHEDULED_AT, mScheduledAt);
contentValues.put(JobStorage.COLUMN_STARTED, mStarted);
contentValues.put(JobStorage.COLUMN_FLEX_SUPPORT, mFlexSupport);
contentValues.put(JobStorage.COLUMN_LAST_RUN, mLastRun);
return contentValues;
} | class class_name[name] begin[{]
method[toContentValues, return_type[type[ContentValues]], modifier[default], parameter[]] begin[{]
local_variable[type[ContentValues], contentValues]
call[mBuilder.fillContentValues, parameter[member[.contentValues]]]
call[contentValues.put, parameter[member[JobStorage.COLUMN_NUM_FAILURES], member[.mFailureCount]]]
call[contentValues.put, parameter[member[JobStorage.COLUMN_SCHEDULED_AT], member[.mScheduledAt]]]
call[contentValues.put, parameter[member[JobStorage.COLUMN_STARTED], member[.mStarted]]]
call[contentValues.put, parameter[member[JobStorage.COLUMN_FLEX_SUPPORT], member[.mFlexSupport]]]
call[contentValues.put, parameter[member[JobStorage.COLUMN_LAST_RUN], member[.mLastRun]]]
return[member[.contentValues]]
end[}]
END[}] | identifier[ContentValues] identifier[toContentValues] operator[SEP] operator[SEP] {
identifier[ContentValues] identifier[contentValues] operator[=] Keyword[new] identifier[ContentValues] operator[SEP] operator[SEP] operator[SEP] identifier[mBuilder] operator[SEP] identifier[fillContentValues] operator[SEP] identifier[contentValues] operator[SEP] operator[SEP] identifier[contentValues] operator[SEP] identifier[put] operator[SEP] identifier[JobStorage] operator[SEP] identifier[COLUMN_NUM_FAILURES] , identifier[mFailureCount] operator[SEP] operator[SEP] identifier[contentValues] operator[SEP] identifier[put] operator[SEP] identifier[JobStorage] operator[SEP] identifier[COLUMN_SCHEDULED_AT] , identifier[mScheduledAt] operator[SEP] operator[SEP] identifier[contentValues] operator[SEP] identifier[put] operator[SEP] identifier[JobStorage] operator[SEP] identifier[COLUMN_STARTED] , identifier[mStarted] operator[SEP] operator[SEP] identifier[contentValues] operator[SEP] identifier[put] operator[SEP] identifier[JobStorage] operator[SEP] identifier[COLUMN_FLEX_SUPPORT] , identifier[mFlexSupport] operator[SEP] operator[SEP] identifier[contentValues] operator[SEP] identifier[put] operator[SEP] identifier[JobStorage] operator[SEP] identifier[COLUMN_LAST_RUN] , identifier[mLastRun] operator[SEP] operator[SEP] Keyword[return] identifier[contentValues] operator[SEP]
}
|
@Override
public void parse(final String... parameters) {
// Manage gray scale
if (parameters.length >= 1) {
grayProperty().set(Double.parseDouble(parameters[0]));
}
// Opacity
if (parameters.length == 2) {
opacityProperty().set(Double.parseDouble(parameters[1]));
}
} | class class_name[name] begin[{]
method[parse, return_type[void], modifier[public], parameter[parameters]] begin[{]
if[binary_operation[member[parameters.length], >=, literal[1]]] begin[{]
call[.grayProperty, parameter[]]
else begin[{]
None
end[}]
if[binary_operation[member[parameters.length], ==, literal[2]]] begin[{]
call[.opacityProperty, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[parse] operator[SEP] Keyword[final] identifier[String] operator[...] identifier[parameters] operator[SEP] {
Keyword[if] operator[SEP] identifier[parameters] operator[SEP] identifier[length] operator[>=] Other[1] operator[SEP] {
identifier[grayProperty] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[parameters] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[parameters] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] {
identifier[opacityProperty] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[parameters] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void setTrajectoryInfo( Config trajConfig )
throws IOException
{
if ( timeDim != null )
throw new IllegalStateException( "The setTrajectoryInfo() method can only be called once.");
this.trajectoryId = trajConfig.getTrajectoryId();
this.timeDim = trajConfig.getTimeDim();
this.timeVar = trajConfig.getTimeVar();
this.latVar = trajConfig.getLatVar();
this.lonVar = trajConfig.getLonVar();
this.elevVar = trajConfig.getElevVar();
trajectoryNumPoint = this.timeDim.getLength();
timeVarUnitsString = this.timeVar.findAttribute( "units" ).getStringValue();
// Check that time, lat, lon, elev units are acceptable.
if ( DateUnit.getStandardDate( timeVarUnitsString ) == null )
{
throw new IllegalArgumentException( "Units of time variable <" + timeVarUnitsString + "> not a date unit." );
}
String latVarUnitsString = this.latVar.findAttribute( "units").getStringValue();
if ( ! SimpleUnit.isCompatible( latVarUnitsString, "degrees_north" ) )
{
throw new IllegalArgumentException( "Units of lat var <" + latVarUnitsString + "> not compatible with \"degrees_north\"." );
}
String lonVarUnitsString = this.lonVar.findAttribute( "units" ).getStringValue();
if ( !SimpleUnit.isCompatible( lonVarUnitsString, "degrees_east" ) )
{
throw new IllegalArgumentException( "Units of lon var <" + lonVarUnitsString + "> not compatible with \"degrees_east\"." );
}
String elevVarUnitsString = this.elevVar.findAttribute( "units" ).getStringValue();
if ( !SimpleUnit.isCompatible( elevVarUnitsString, "meters" ) )
{
throw new IllegalArgumentException( "Units of elev var <" + elevVarUnitsString + "> not compatible with \"meters\"." );
}
try
{
elevVarUnitsConversionFactor = getMetersConversionFactor( elevVarUnitsString);
}
catch ( Exception e )
{
throw new IllegalArgumentException( "Exception on getMetersConversionFactor() for the units of elev var <" + elevVarUnitsString + ">." );
}
if ( this.netcdfDataset.hasUnlimitedDimension() && this.netcdfDataset.getUnlimitedDimension().equals( timeDim ) )
{
Object result = this.netcdfDataset.sendIospMessage(NetcdfFile.IOSP_MESSAGE_ADD_RECORD_STRUCTURE);
if ((result != null) && (Boolean) result )
this.recordVar = (Structure) this.netcdfDataset.getRootGroup().findVariable( "record");
else
this.recordVar = new StructurePseudo( this.netcdfDataset, null, "record", timeDim );
} else {
this.recordVar = new StructurePseudo( this.netcdfDataset, null, "record", timeDim);
}
// @todo HACK, HACK, HACK - remove once addRecordStructure() deals with ncd attribute changes.
Variable elevVarInRecVar = this.recordVar.findVariable( this.elevVar.getFullNameEscaped());
if ( ! elevVarUnitsString.equals( elevVarInRecVar.findAttribute( "units").getStringValue()))
{
elevVarInRecVar.addAttribute( new Attribute( "units", elevVarUnitsString));
}
trajectoryVarsMap = new HashMap();
//for ( Iterator it = this.recordVar.getVariables().iterator(); it.hasNext(); )
for ( Iterator it = this.netcdfDataset.getRootGroup().getVariables().iterator(); it.hasNext(); )
{
Variable curVar = (Variable) it.next();
if ( curVar.getRank() > 0 &&
!curVar.equals( this.timeVar) &&
! curVar.equals( this.latVar) &&
! curVar.equals( this.lonVar) &&
! curVar.equals( this.elevVar) &&
( this.recordVar == null ? true : ! curVar.equals( this.recordVar)))
{
MyTypedDataVariable typedVar = new MyTypedDataVariable( new VariableDS( null, curVar, true ) );
dataVariables.add( typedVar);
trajectoryVarsMap.put( typedVar.getShortName(), typedVar);
}
}
trajectory = new SingleTrajectory( this.trajectoryId, trajectoryNumPoint,
this.timeVar, timeVarUnitsString,
this.latVar, this.lonVar, this.elevVar,
dataVariables, trajectoryVarsMap);
startDate = trajectory.getTime( 0);
endDate = trajectory.getTime( trajectoryNumPoint - 1);
( (SingleTrajectory) trajectory).setStartDate( startDate );
( (SingleTrajectory) trajectory).setEndDate( endDate );
} | class class_name[name] begin[{]
method[setTrajectoryInfo, return_type[void], modifier[public], parameter[trajConfig]] begin[{]
if[binary_operation[member[.timeDim], !=, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The setTrajectoryInfo() method can only be called once.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.trajectoryId]], call[trajConfig.getTrajectoryId, parameter[]]]
assign[THIS[member[None.timeDim]], call[trajConfig.getTimeDim, parameter[]]]
assign[THIS[member[None.timeVar]], call[trajConfig.getTimeVar, parameter[]]]
assign[THIS[member[None.latVar]], call[trajConfig.getLatVar, parameter[]]]
assign[THIS[member[None.lonVar]], call[trajConfig.getLonVar, parameter[]]]
assign[THIS[member[None.elevVar]], call[trajConfig.getElevVar, parameter[]]]
assign[member[.trajectoryNumPoint], THIS[member[None.timeDim]call[None.getLength, parameter[]]]]
assign[member[.timeVarUnitsString], THIS[member[None.timeVar]call[None.findAttribute, parameter[literal["units"]]]call[None.getStringValue, parameter[]]]]
if[binary_operation[call[DateUnit.getStandardDate, parameter[member[.timeVarUnitsString]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Units of time variable <"), operandr=MemberReference(member=timeVarUnitsString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> not a date unit."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], latVarUnitsString]
if[call[SimpleUnit.isCompatible, parameter[member[.latVarUnitsString], literal["degrees_north"]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Units of lat var <"), operandr=MemberReference(member=latVarUnitsString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> not compatible with \"degrees_north\"."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], lonVarUnitsString]
if[call[SimpleUnit.isCompatible, parameter[member[.lonVarUnitsString], literal["degrees_east"]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Units of lon var <"), operandr=MemberReference(member=lonVarUnitsString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> not compatible with \"degrees_east\"."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], elevVarUnitsString]
if[call[SimpleUnit.isCompatible, parameter[member[.elevVarUnitsString], literal["meters"]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Units of elev var <"), operandr=MemberReference(member=elevVarUnitsString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="> not compatible with \"meters\"."), 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[}]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=elevVarUnitsConversionFactor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=elevVarUnitsString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMetersConversionFactor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], 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="Exception on getMetersConversionFactor() for the units of elev var <"), operandr=MemberReference(member=elevVarUnitsString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=">."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
if[binary_operation[THIS[member[None.netcdfDataset]call[None.hasUnlimitedDimension, parameter[]]], &&, THIS[member[None.netcdfDataset]call[None.getUnlimitedDimension, parameter[]]call[None.equals, parameter[member[.timeDim]]]]]] begin[{]
local_variable[type[Object], result]
if[binary_operation[binary_operation[member[.result], !=, literal[null]], &&, Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))]] begin[{]
assign[THIS[member[None.recordVar]], Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=netcdfDataset, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getRootGroup, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="record")], member=findVariable, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=Structure, sub_type=None))]
else begin[{]
assign[THIS[member[None.recordVar]], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=netcdfDataset, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="record"), MemberReference(member=timeDim, 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=StructurePseudo, sub_type=None))]
end[}]
else begin[{]
assign[THIS[member[None.recordVar]], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=netcdfDataset, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="record"), MemberReference(member=timeDim, 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=StructurePseudo, sub_type=None))]
end[}]
local_variable[type[Variable], elevVarInRecVar]
if[call[elevVarUnitsString.equals, parameter[call[elevVarInRecVar.findAttribute, parameter[literal["units"]]]]]] begin[{]
call[elevVarInRecVar.addAttribute, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="units"), MemberReference(member=elevVarUnitsString, 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=Attribute, sub_type=None))]]
else begin[{]
None
end[}]
assign[member[.trajectoryVarsMap], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HashMap, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Variable, sub_type=None)), name=curVar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Variable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRank, postfix_operators=[], prefix_operators=[], qualifier=curVar, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=timeVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=curVar, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=latVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=curVar, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=lonVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=curVar, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=elevVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=curVar, selectors=[], type_arguments=None), operator=&&), operandr=TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=recordVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=recordVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=curVar, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=curVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VariableDS, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MyTypedDataVariable, sub_type=None)), name=typedVar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MyTypedDataVariable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=typedVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=dataVariables, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getShortName, postfix_operators=[], prefix_operators=[], qualifier=typedVar, selectors=[], type_arguments=None), MemberReference(member=typedVar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=trajectoryVarsMap, selectors=[], type_arguments=None), label=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=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=netcdfDataset, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getRootGroup, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getVariables, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
assign[member[.trajectory], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=trajectoryId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=trajectoryNumPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=timeVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=timeVarUnitsString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=latVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=lonVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=elevVar, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=dataVariables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=trajectoryVarsMap, 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=SingleTrajectory, sub_type=None))]
assign[member[.startDate], call[trajectory.getTime, parameter[literal[0]]]]
assign[member[.endDate], call[trajectory.getTime, parameter[binary_operation[member[.trajectoryNumPoint], -, literal[1]]]]]
Cast(expression=MemberReference(member=trajectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SingleTrajectory, sub_type=None))
Cast(expression=MemberReference(member=trajectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SingleTrajectory, sub_type=None))
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setTrajectoryInfo] operator[SEP] identifier[Config] identifier[trajConfig] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[timeDim] operator[!=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[trajectoryId] operator[=] identifier[trajConfig] operator[SEP] identifier[getTrajectoryId] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[timeDim] operator[=] identifier[trajConfig] operator[SEP] identifier[getTimeDim] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[timeVar] operator[=] identifier[trajConfig] operator[SEP] identifier[getTimeVar] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[latVar] operator[=] identifier[trajConfig] operator[SEP] identifier[getLatVar] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[lonVar] operator[=] identifier[trajConfig] operator[SEP] identifier[getLonVar] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[elevVar] operator[=] identifier[trajConfig] operator[SEP] identifier[getElevVar] operator[SEP] operator[SEP] operator[SEP] identifier[trajectoryNumPoint] operator[=] Keyword[this] operator[SEP] identifier[timeDim] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[timeVarUnitsString] operator[=] Keyword[this] operator[SEP] identifier[timeVar] operator[SEP] identifier[findAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DateUnit] operator[SEP] identifier[getStandardDate] operator[SEP] identifier[timeVarUnitsString] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[timeVarUnitsString] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[latVarUnitsString] operator[=] Keyword[this] operator[SEP] identifier[latVar] operator[SEP] identifier[findAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[SimpleUnit] operator[SEP] identifier[isCompatible] operator[SEP] identifier[latVarUnitsString] , literal[String] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[latVarUnitsString] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[lonVarUnitsString] operator[=] Keyword[this] operator[SEP] identifier[lonVar] operator[SEP] identifier[findAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[SimpleUnit] operator[SEP] identifier[isCompatible] operator[SEP] identifier[lonVarUnitsString] , literal[String] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[lonVarUnitsString] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[elevVarUnitsString] operator[=] Keyword[this] operator[SEP] identifier[elevVar] operator[SEP] identifier[findAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[SimpleUnit] operator[SEP] identifier[isCompatible] operator[SEP] identifier[elevVarUnitsString] , literal[String] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[elevVarUnitsString] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[elevVarUnitsConversionFactor] operator[=] identifier[getMetersConversionFactor] operator[SEP] identifier[elevVarUnitsString] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[elevVarUnitsString] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[netcdfDataset] operator[SEP] identifier[hasUnlimitedDimension] operator[SEP] operator[SEP] operator[&&] Keyword[this] operator[SEP] identifier[netcdfDataset] operator[SEP] identifier[getUnlimitedDimension] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[timeDim] operator[SEP] operator[SEP] {
identifier[Object] identifier[result] operator[=] Keyword[this] operator[SEP] identifier[netcdfDataset] operator[SEP] identifier[sendIospMessage] operator[SEP] identifier[NetcdfFile] operator[SEP] identifier[IOSP_MESSAGE_ADD_RECORD_STRUCTURE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[Boolean] operator[SEP] identifier[result] operator[SEP] Keyword[this] operator[SEP] identifier[recordVar] operator[=] operator[SEP] identifier[Structure] operator[SEP] Keyword[this] operator[SEP] identifier[netcdfDataset] operator[SEP] identifier[getRootGroup] operator[SEP] operator[SEP] operator[SEP] identifier[findVariable] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[else] Keyword[this] operator[SEP] identifier[recordVar] operator[=] Keyword[new] identifier[StructurePseudo] operator[SEP] Keyword[this] operator[SEP] identifier[netcdfDataset] , Other[null] , literal[String] , identifier[timeDim] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[recordVar] operator[=] Keyword[new] identifier[StructurePseudo] operator[SEP] Keyword[this] operator[SEP] identifier[netcdfDataset] , Other[null] , literal[String] , identifier[timeDim] operator[SEP] operator[SEP]
}
identifier[Variable] identifier[elevVarInRecVar] operator[=] Keyword[this] operator[SEP] identifier[recordVar] operator[SEP] identifier[findVariable] operator[SEP] Keyword[this] operator[SEP] identifier[elevVar] operator[SEP] identifier[getFullNameEscaped] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[elevVarUnitsString] operator[SEP] identifier[equals] operator[SEP] identifier[elevVarInRecVar] operator[SEP] identifier[findAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[elevVarInRecVar] operator[SEP] identifier[addAttribute] operator[SEP] Keyword[new] identifier[Attribute] operator[SEP] literal[String] , identifier[elevVarUnitsString] operator[SEP] operator[SEP] operator[SEP]
}
identifier[trajectoryVarsMap] operator[=] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] identifier[it] operator[=] Keyword[this] operator[SEP] identifier[netcdfDataset] operator[SEP] identifier[getRootGroup] operator[SEP] operator[SEP] operator[SEP] identifier[getVariables] 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[Variable] identifier[curVar] operator[=] operator[SEP] identifier[Variable] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[curVar] operator[SEP] identifier[getRank] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] operator[!] identifier[curVar] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[timeVar] operator[SEP] operator[&&] operator[!] identifier[curVar] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[latVar] operator[SEP] operator[&&] operator[!] identifier[curVar] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[lonVar] operator[SEP] operator[&&] operator[!] identifier[curVar] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[elevVar] operator[SEP] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[recordVar] operator[==] Other[null] operator[?] literal[boolean] operator[:] operator[!] identifier[curVar] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[recordVar] operator[SEP] operator[SEP] operator[SEP] {
identifier[MyTypedDataVariable] identifier[typedVar] operator[=] Keyword[new] identifier[MyTypedDataVariable] operator[SEP] Keyword[new] identifier[VariableDS] operator[SEP] Other[null] , identifier[curVar] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[dataVariables] operator[SEP] identifier[add] operator[SEP] identifier[typedVar] operator[SEP] operator[SEP] identifier[trajectoryVarsMap] operator[SEP] identifier[put] operator[SEP] identifier[typedVar] operator[SEP] identifier[getShortName] operator[SEP] operator[SEP] , identifier[typedVar] operator[SEP] operator[SEP]
}
}
identifier[trajectory] operator[=] Keyword[new] identifier[SingleTrajectory] operator[SEP] Keyword[this] operator[SEP] identifier[trajectoryId] , identifier[trajectoryNumPoint] , Keyword[this] operator[SEP] identifier[timeVar] , identifier[timeVarUnitsString] , Keyword[this] operator[SEP] identifier[latVar] , Keyword[this] operator[SEP] identifier[lonVar] , Keyword[this] operator[SEP] identifier[elevVar] , identifier[dataVariables] , identifier[trajectoryVarsMap] operator[SEP] operator[SEP] identifier[startDate] operator[=] identifier[trajectory] operator[SEP] identifier[getTime] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[endDate] operator[=] identifier[trajectory] operator[SEP] identifier[getTime] operator[SEP] identifier[trajectoryNumPoint] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SingleTrajectory] operator[SEP] identifier[trajectory] operator[SEP] operator[SEP] identifier[setStartDate] operator[SEP] identifier[startDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SingleTrajectory] operator[SEP] identifier[trajectory] operator[SEP] operator[SEP] identifier[setEndDate] operator[SEP] identifier[endDate] operator[SEP] operator[SEP]
}
|
public final String rewriteName(String name, Tag currentTag)
throws ExpressionEvaluationException
{
if (_logger.isDebugEnabled()) _logger.debug("rewrite expression \"" + name + "\"");
IDataAccessProvider dap = getCurrentProvider(currentTag);
// if the DAP is null, there is no rewriting to do
if (dap == null)
return name;
// given a hierarchy of "container.container.container.item.someProp", the correct parent needs
// to be found so that expression rewriting can happen correctly.
//
// ensure that this expression contains container.item
Expression parsed = getExpressionEvaluator().parseExpression(name);
assert parsed != null;
int containerCount = 0;
List tokens = parsed.getTokens();
for (int i = 0; i < tokens.size(); i++) {
String tok = tokens.get(i).toString();
if (i == 0) {
if (!tok.equals("container"))
break;
else
continue;
}
// this skips the "current" IDataAccessProvider
else if (tok.equals("container"))
containerCount++;
else if (tok.equals("item"))
break;
}
if (_logger.isDebugEnabled()) _logger.debug("container parent count: " + containerCount);
// now walk up the DataAccessProvier hierarchy until the top-most parent is found
// the top-most parent is the first one that does not reference "container.item" but
// is bound directly to a specific object such as "actionForm" or "pageFlow". This
// handles the case where a set of nested IDataAccessProvider tags are "skipped" by
// an expression like "container.container.container.item.foo". In order to find
// the correct root to start rewriting the names, one needs to walk up three
// DAPs in order to find the correct root from which to start.
//
// In general, containerCount is zero here for the "container.item.foo" case.
for (int i = 0; i < containerCount; i++) {
dap = dap.getProviderParent();
}
// now, the top-most DAP parent is known
assert dap != null;
// strip off the "container.item" from the expression that is being rewritten
// this should be two tokens into the expression.
if (containerCount > 0) {
name = parsed.getExpression(containerCount);
}
// now, change the binding context of the parent DAP hierarchy to create a
// String that looks like "actionForm.customers[42].order[12].lineItem[2].name"
// note, this is done without using the expression that was passed-in and
// is derived entirely from the IDataAccessProvider parent hierarchy.
String parentNames = rewriteNameInternal(dap);
if (_logger.isDebugEnabled()) _logger.debug("name hierarchy: " + parentNames + " name: " + name);
// with a newly re-written expression prefix, substitute this fully-qualified binding
// string into the given expression for "container.item".
String newName = changeContext(name, "container.item", parentNames, dap.getCurrentIndex());
if (_logger.isDebugEnabled()) _logger.debug("rewrittenName: " + newName);
return newName;
} | class class_name[name] begin[{]
method[rewriteName, return_type[type[String]], modifier[final public], parameter[name, currentTag]] begin[{]
if[call[_logger.isDebugEnabled, parameter[]]] begin[{]
call[_logger.debug, parameter[binary_operation[binary_operation[literal["rewrite expression \""], +, member[.name]], +, literal["\""]]]]
else begin[{]
None
end[}]
local_variable[type[IDataAccessProvider], dap]
if[binary_operation[member[.dap], ==, literal[null]]] begin[{]
return[member[.name]]
else begin[{]
None
end[}]
local_variable[type[Expression], parsed]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=parsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
local_variable[type[int], containerCount]
local_variable[type[List], tokens]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=tok)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="container")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=tok, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="item")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=tok, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), label=None, then_statement=StatementExpression(expression=MemberReference(member=containerCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="container")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=tok, selectors=[], type_arguments=None), else_statement=ContinueStatement(goto=None, label=None), label=None, then_statement=BreakStatement(goto=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=tokens, 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)
if[call[_logger.isDebugEnabled, parameter[]]] begin[{]
call[_logger.debug, parameter[binary_operation[literal["container parent count: "], +, member[.containerCount]]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getProviderParent, postfix_operators=[], prefix_operators=[], qualifier=dap, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=containerCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=dap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
if[binary_operation[member[.containerCount], >, literal[0]]] begin[{]
assign[member[.name], call[parsed.getExpression, parameter[member[.containerCount]]]]
else begin[{]
None
end[}]
local_variable[type[String], parentNames]
if[call[_logger.isDebugEnabled, parameter[]]] begin[{]
call[_logger.debug, parameter[binary_operation[binary_operation[binary_operation[literal["name hierarchy: "], +, member[.parentNames]], +, literal[" name: "]], +, member[.name]]]]
else begin[{]
None
end[}]
local_variable[type[String], newName]
if[call[_logger.isDebugEnabled, parameter[]]] begin[{]
call[_logger.debug, parameter[binary_operation[literal["rewrittenName: "], +, member[.newName]]]]
else begin[{]
None
end[}]
return[member[.newName]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[String] identifier[rewriteName] operator[SEP] identifier[String] identifier[name] , identifier[Tag] identifier[currentTag] operator[SEP] Keyword[throws] identifier[ExpressionEvaluationException] {
Keyword[if] operator[SEP] identifier[_logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[_logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] identifier[IDataAccessProvider] identifier[dap] operator[=] identifier[getCurrentProvider] operator[SEP] identifier[currentTag] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dap] operator[==] Other[null] operator[SEP] Keyword[return] identifier[name] operator[SEP] identifier[Expression] identifier[parsed] operator[=] identifier[getExpressionEvaluator] operator[SEP] operator[SEP] operator[SEP] identifier[parseExpression] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[assert] identifier[parsed] operator[!=] Other[null] operator[SEP] Keyword[int] identifier[containerCount] operator[=] Other[0] operator[SEP] identifier[List] identifier[tokens] operator[=] identifier[parsed] operator[SEP] identifier[getTokens] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[tokens] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[String] identifier[tok] operator[=] identifier[tokens] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] Other[0] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[tok] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[else] Keyword[continue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[tok] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[containerCount] operator[++] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[tok] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[if] operator[SEP] identifier[_logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[_logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[containerCount] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[containerCount] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[dap] operator[=] identifier[dap] operator[SEP] identifier[getProviderParent] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[assert] identifier[dap] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[containerCount] operator[>] Other[0] operator[SEP] {
identifier[name] operator[=] identifier[parsed] operator[SEP] identifier[getExpression] operator[SEP] identifier[containerCount] operator[SEP] operator[SEP]
}
identifier[String] identifier[parentNames] operator[=] identifier[rewriteNameInternal] operator[SEP] identifier[dap] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[_logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[parentNames] operator[+] literal[String] operator[+] identifier[name] operator[SEP] operator[SEP] identifier[String] identifier[newName] operator[=] identifier[changeContext] operator[SEP] identifier[name] , literal[String] , identifier[parentNames] , identifier[dap] operator[SEP] identifier[getCurrentIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[_logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[newName] operator[SEP] operator[SEP] Keyword[return] identifier[newName] operator[SEP]
}
|
private double[][] computeLookupADC(double[] qVector) {
double[][] distances = new double[numSubVectors][numProductCentroids];
for (int i = 0; i < numSubVectors; i++) {
int subVectorStart = i * subVectorLength;
for (int j = 0; j < numProductCentroids; j++) {
for (int k = 0; k < subVectorLength; k++) {
distances[i][j] += (qVector[subVectorStart + k] - productQuantizer[i][j][k])
* (qVector[subVectorStart + k] - productQuantizer[i][j][k]);
}
}
}
return distances;
} | class class_name[name] begin[{]
method[computeLookupADC, return_type[type[double]], modifier[private], parameter[qVector]] begin[{]
local_variable[type[double], distances]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=subVectorLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), name=subVectorStart)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=distances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=qVector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=subVectorStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), operandr=MemberReference(member=productQuantizer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-), operandr=BinaryOperation(operandl=MemberReference(member=qVector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=subVectorStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), operandr=MemberReference(member=productQuantizer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=-), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=subVectorLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numProductCentroids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numSubVectors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.distances]]
end[}]
END[}] | Keyword[private] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[computeLookupADC] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[qVector] operator[SEP] {
Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[distances] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numSubVectors] operator[SEP] operator[SEP] identifier[numProductCentroids] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numSubVectors] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[subVectorStart] operator[=] identifier[i] operator[*] identifier[subVectorLength] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[numProductCentroids] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[subVectorLength] operator[SEP] identifier[k] operator[++] operator[SEP] {
identifier[distances] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[+=] operator[SEP] identifier[qVector] operator[SEP] identifier[subVectorStart] operator[+] identifier[k] operator[SEP] operator[-] identifier[productQuantizer] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[*] operator[SEP] identifier[qVector] operator[SEP] identifier[subVectorStart] operator[+] identifier[k] operator[SEP] operator[-] identifier[productQuantizer] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[distances] operator[SEP]
}
|
private static HttpClientInputs setCommonHttpInputs(HttpClientInputs httpClientInputs, URL url, WSManRequestInputs wsManRequestInputs) throws MalformedURLException {
httpClientInputs.setUrl(url.toString());
httpClientInputs.setUsername(wsManRequestInputs.getUsername());
httpClientInputs.setPassword(wsManRequestInputs.getPassword());
httpClientInputs.setAuthType(wsManRequestInputs.getAuthType());
httpClientInputs.setKerberosConfFile(wsManRequestInputs.getKerberosConfFile());
httpClientInputs.setKerberosLoginConfFile(wsManRequestInputs.getKerberosLoginConfFile());
httpClientInputs.setKerberosSkipPortCheck(wsManRequestInputs.getKerberosSkipPortForLookup());
httpClientInputs.setTrustAllRoots(wsManRequestInputs.getTrustAllRoots());
httpClientInputs.setX509HostnameVerifier(wsManRequestInputs.getX509HostnameVerifier());
httpClientInputs.setProxyHost(wsManRequestInputs.getProxyHost());
httpClientInputs.setProxyPort(wsManRequestInputs.getProxyPort());
httpClientInputs.setProxyUsername(wsManRequestInputs.getProxyUsername());
httpClientInputs.setProxyPassword(wsManRequestInputs.getProxyPassword());
httpClientInputs.setKeystore(wsManRequestInputs.getKeystore());
httpClientInputs.setKeystorePassword(wsManRequestInputs.getKeystorePassword());
httpClientInputs.setTrustKeystore(wsManRequestInputs.getTrustKeystore());
httpClientInputs.setTrustPassword(wsManRequestInputs.getTrustPassword());
String headers = httpClientInputs.getHeaders();
if (StringUtils.isEmpty(headers)) {
httpClientInputs.setHeaders(CONTENT_TYPE_HEADER);
} else {
httpClientInputs.setHeaders(headers + NEW_LINE_SEPARATOR + CONTENT_TYPE_HEADER);
}
httpClientInputs.setMethod(HttpPost.METHOD_NAME);
return httpClientInputs;
} | class class_name[name] begin[{]
method[setCommonHttpInputs, return_type[type[HttpClientInputs]], modifier[private static], parameter[httpClientInputs, url, wsManRequestInputs]] begin[{]
call[httpClientInputs.setUrl, parameter[call[url.toString, parameter[]]]]
call[httpClientInputs.setUsername, parameter[call[wsManRequestInputs.getUsername, parameter[]]]]
call[httpClientInputs.setPassword, parameter[call[wsManRequestInputs.getPassword, parameter[]]]]
call[httpClientInputs.setAuthType, parameter[call[wsManRequestInputs.getAuthType, parameter[]]]]
call[httpClientInputs.setKerberosConfFile, parameter[call[wsManRequestInputs.getKerberosConfFile, parameter[]]]]
call[httpClientInputs.setKerberosLoginConfFile, parameter[call[wsManRequestInputs.getKerberosLoginConfFile, parameter[]]]]
call[httpClientInputs.setKerberosSkipPortCheck, parameter[call[wsManRequestInputs.getKerberosSkipPortForLookup, parameter[]]]]
call[httpClientInputs.setTrustAllRoots, parameter[call[wsManRequestInputs.getTrustAllRoots, parameter[]]]]
call[httpClientInputs.setX509HostnameVerifier, parameter[call[wsManRequestInputs.getX509HostnameVerifier, parameter[]]]]
call[httpClientInputs.setProxyHost, parameter[call[wsManRequestInputs.getProxyHost, parameter[]]]]
call[httpClientInputs.setProxyPort, parameter[call[wsManRequestInputs.getProxyPort, parameter[]]]]
call[httpClientInputs.setProxyUsername, parameter[call[wsManRequestInputs.getProxyUsername, parameter[]]]]
call[httpClientInputs.setProxyPassword, parameter[call[wsManRequestInputs.getProxyPassword, parameter[]]]]
call[httpClientInputs.setKeystore, parameter[call[wsManRequestInputs.getKeystore, parameter[]]]]
call[httpClientInputs.setKeystorePassword, parameter[call[wsManRequestInputs.getKeystorePassword, parameter[]]]]
call[httpClientInputs.setTrustKeystore, parameter[call[wsManRequestInputs.getTrustKeystore, parameter[]]]]
call[httpClientInputs.setTrustPassword, parameter[call[wsManRequestInputs.getTrustPassword, parameter[]]]]
local_variable[type[String], headers]
if[call[StringUtils.isEmpty, parameter[member[.headers]]]] begin[{]
call[httpClientInputs.setHeaders, parameter[member[.CONTENT_TYPE_HEADER]]]
else begin[{]
call[httpClientInputs.setHeaders, parameter[binary_operation[binary_operation[member[.headers], +, member[.NEW_LINE_SEPARATOR]], +, member[.CONTENT_TYPE_HEADER]]]]
end[}]
call[httpClientInputs.setMethod, parameter[member[HttpPost.METHOD_NAME]]]
return[member[.httpClientInputs]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[HttpClientInputs] identifier[setCommonHttpInputs] operator[SEP] identifier[HttpClientInputs] identifier[httpClientInputs] , identifier[URL] identifier[url] , identifier[WSManRequestInputs] identifier[wsManRequestInputs] operator[SEP] Keyword[throws] identifier[MalformedURLException] {
identifier[httpClientInputs] operator[SEP] identifier[setUrl] operator[SEP] identifier[url] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setUsername] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getUsername] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setPassword] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setAuthType] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getAuthType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setKerberosConfFile] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getKerberosConfFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setKerberosLoginConfFile] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getKerberosLoginConfFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setKerberosSkipPortCheck] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getKerberosSkipPortForLookup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setTrustAllRoots] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getTrustAllRoots] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setX509HostnameVerifier] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getX509HostnameVerifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setProxyHost] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getProxyHost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setProxyPort] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getProxyPort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setProxyUsername] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getProxyUsername] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setProxyPassword] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getProxyPassword] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setKeystore] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getKeystore] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setKeystorePassword] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getKeystorePassword] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setTrustKeystore] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getTrustKeystore] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpClientInputs] operator[SEP] identifier[setTrustPassword] operator[SEP] identifier[wsManRequestInputs] operator[SEP] identifier[getTrustPassword] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[headers] operator[=] identifier[httpClientInputs] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[headers] operator[SEP] operator[SEP] {
identifier[httpClientInputs] operator[SEP] identifier[setHeaders] operator[SEP] identifier[CONTENT_TYPE_HEADER] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[httpClientInputs] operator[SEP] identifier[setHeaders] operator[SEP] identifier[headers] operator[+] identifier[NEW_LINE_SEPARATOR] operator[+] identifier[CONTENT_TYPE_HEADER] operator[SEP] operator[SEP]
}
identifier[httpClientInputs] operator[SEP] identifier[setMethod] operator[SEP] identifier[HttpPost] operator[SEP] identifier[METHOD_NAME] operator[SEP] operator[SEP] Keyword[return] identifier[httpClientInputs] operator[SEP]
}
|
public void marshall(LabelingJobDataAttributes labelingJobDataAttributes, ProtocolMarshaller protocolMarshaller) {
if (labelingJobDataAttributes == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(labelingJobDataAttributes.getContentClassifiers(), CONTENTCLASSIFIERS_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[labelingJobDataAttributes, protocolMarshaller]] begin[{]
if[binary_operation[member[.labelingJobDataAttributes], ==, 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=getContentClassifiers, postfix_operators=[], prefix_operators=[], qualifier=labelingJobDataAttributes, selectors=[], type_arguments=None), MemberReference(member=CONTENTCLASSIFIERS_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[LabelingJobDataAttributes] identifier[labelingJobDataAttributes] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[labelingJobDataAttributes] 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[labelingJobDataAttributes] operator[SEP] identifier[getContentClassifiers] operator[SEP] operator[SEP] , identifier[CONTENTCLASSIFIERS_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public boolean clientUpsertSelectiveMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable) {
// @Param("record")
method.getParameters().get(0).addAnnotation("@Param(\"record\")");
// column枚举
// 找出全字段对应的Model
FullyQualifiedJavaType fullFieldModel = introspectedTable.getRules().calculateAllFieldsClass();
FullyQualifiedJavaType selectiveType = new FullyQualifiedJavaType(fullFieldModel.getShortName() + "." + ModelColumnPlugin.ENUM_NAME);
method.addParameter(new Parameter(selectiveType, "selective", "@Param(\"selective\")", true));
return true;
} | class class_name[name] begin[{]
method[clientUpsertSelectiveMethodGenerated, return_type[type[boolean]], modifier[public], parameter[method, interfaze, introspectedTable]] begin[{]
call[method.getParameters, parameter[]]
local_variable[type[FullyQualifiedJavaType], fullFieldModel]
local_variable[type[FullyQualifiedJavaType], selectiveType]
call[method.addParameter, parameter[ClassCreator(arguments=[MemberReference(member=selectiveType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="selective"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="@Param(\"selective\")"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Parameter, sub_type=None))]]
return[literal[true]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[clientUpsertSelectiveMethodGenerated] operator[SEP] identifier[Method] identifier[method] , identifier[Interface] identifier[interfaze] , identifier[IntrospectedTable] identifier[introspectedTable] operator[SEP] {
identifier[method] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[addAnnotation] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[FullyQualifiedJavaType] identifier[fullFieldModel] operator[=] identifier[introspectedTable] operator[SEP] identifier[getRules] operator[SEP] operator[SEP] operator[SEP] identifier[calculateAllFieldsClass] operator[SEP] operator[SEP] operator[SEP] identifier[FullyQualifiedJavaType] identifier[selectiveType] operator[=] Keyword[new] identifier[FullyQualifiedJavaType] operator[SEP] identifier[fullFieldModel] operator[SEP] identifier[getShortName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[ModelColumnPlugin] operator[SEP] identifier[ENUM_NAME] operator[SEP] operator[SEP] identifier[method] operator[SEP] identifier[addParameter] operator[SEP] Keyword[new] identifier[Parameter] operator[SEP] identifier[selectiveType] , literal[String] , literal[String] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
public static Map<String,byte[]> storeInstanceProbeResources( File applicationFilesDirectory, Instance instance ) throws IOException {
// Measure files (are not located with recipes, so no trouble with component inheritance).
// There can also be a properties file to inject values.
String[] exts = {
Constants.FILE_EXT_MEASURES,
Constants.FILE_EXT_MEASURES + ".properties"
};
Map<String,byte[]> result = new HashMap<> ();
for( String ext : exts ) {
String fileName = instance.getComponent().getName() + ext;
File autonomicMeasureFile = new File( applicationFilesDirectory, Constants.PROJECT_DIR_PROBES + "/" + fileName );
if( ! autonomicMeasureFile.exists())
break;
ByteArrayOutputStream os = new ByteArrayOutputStream();
Utils.copyStream( autonomicMeasureFile, os );
result.put( autonomicMeasureFile.getName(), os.toByteArray());
}
return result;
} | class class_name[name] begin[{]
method[storeInstanceProbeResources, return_type[type[Map]], modifier[public static], parameter[applicationFilesDirectory, instance]] begin[{]
local_variable[type[String], exts]
local_variable[type[Map], result]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getComponent, postfix_operators=[], prefix_operators=[], qualifier=instance, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=ext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=fileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=applicationFilesDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=PROJECT_DIR_PROBES, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=autonomicMeasureFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=['!'], qualifier=autonomicMeasureFile, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None)), name=os)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=autonomicMeasureFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=os, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyStream, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=autonomicMeasureFile, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=exts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ext)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[storeInstanceProbeResources] operator[SEP] identifier[File] identifier[applicationFilesDirectory] , identifier[Instance] identifier[instance] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] operator[SEP] operator[SEP] identifier[exts] operator[=] {
identifier[Constants] operator[SEP] identifier[FILE_EXT_MEASURES] , identifier[Constants] operator[SEP] identifier[FILE_EXT_MEASURES] operator[+] literal[String]
} operator[SEP] identifier[Map] operator[<] identifier[String] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[ext] operator[:] identifier[exts] operator[SEP] {
identifier[String] identifier[fileName] operator[=] identifier[instance] operator[SEP] identifier[getComponent] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] identifier[ext] operator[SEP] identifier[File] identifier[autonomicMeasureFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[applicationFilesDirectory] , identifier[Constants] operator[SEP] identifier[PROJECT_DIR_PROBES] operator[+] literal[String] operator[+] identifier[fileName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[autonomicMeasureFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] identifier[ByteArrayOutputStream] identifier[os] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[copyStream] operator[SEP] identifier[autonomicMeasureFile] , identifier[os] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[autonomicMeasureFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[os] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
private ArrayList<CmsResourceStatusRelationBean> getRelationBeans() {
switch (m_mode) {
case targets:
return m_statusBean.getRelationTargets();
case sources:
return m_statusBean.getRelationSources();
case siblings:
default:
return m_statusBean.getSiblings();
}
} | class class_name[name] begin[{]
method[getRelationBeans, return_type[type[ArrayList]], modifier[private], parameter[]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['targets'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getRelationTargets, postfix_operators=[], prefix_operators=[], qualifier=m_statusBean, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['sources'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getRelationSources, postfix_operators=[], prefix_operators=[], qualifier=m_statusBean, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['siblings'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getSiblings, postfix_operators=[], prefix_operators=[], qualifier=m_statusBean, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=m_mode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | Keyword[private] identifier[ArrayList] operator[<] identifier[CmsResourceStatusRelationBean] operator[>] identifier[getRelationBeans] operator[SEP] operator[SEP] {
Keyword[switch] operator[SEP] identifier[m_mode] operator[SEP] {
Keyword[case] identifier[targets] operator[:] Keyword[return] identifier[m_statusBean] operator[SEP] identifier[getRelationTargets] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[sources] operator[:] Keyword[return] identifier[m_statusBean] operator[SEP] identifier[getRelationSources] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[siblings] operator[:] Keyword[default] operator[:] Keyword[return] identifier[m_statusBean] operator[SEP] identifier[getSiblings] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static int sizeOf(Class<?> clz) throws IllegalArgumentException {
switch (clz.getName()) {
case "int":
return Integer.BYTES;
case "short":
return Short.BYTES;
case "long":
return Long.BYTES;
case "double":
return Double.BYTES;
case "float":
return Float.BYTES;
case "boolean":
return 1;
case "char":
return Character.BYTES;
case "byte":
return 1;
default:
throw new IllegalArgumentException("Not a primitive type.");
}
} | class class_name[name] begin[{]
method[sizeOf, return_type[type[int]], modifier[public static], parameter[clz]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="int")], statements=[ReturnStatement(expression=MemberReference(member=BYTES, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="short")], statements=[ReturnStatement(expression=MemberReference(member=BYTES, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="long")], statements=[ReturnStatement(expression=MemberReference(member=BYTES, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="double")], statements=[ReturnStatement(expression=MemberReference(member=BYTES, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="float")], statements=[ReturnStatement(expression=MemberReference(member=BYTES, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="boolean")], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="char")], statements=[ReturnStatement(expression=MemberReference(member=BYTES, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="byte")], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not a primitive type.")], 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)])], expression=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=clz, selectors=[], type_arguments=None), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[sizeOf] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clz] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[switch] operator[SEP] identifier[clz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] literal[String] operator[:] Keyword[return] identifier[Integer] operator[SEP] identifier[BYTES] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[Short] operator[SEP] identifier[BYTES] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[Long] operator[SEP] identifier[BYTES] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[Double] operator[SEP] identifier[BYTES] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[Float] operator[SEP] identifier[BYTES] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] Other[1] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[Character] operator[SEP] identifier[BYTES] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] Other[1] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.