code stringlengths 130 281k | code_dependency stringlengths 182 306k |
|---|---|
public class class_name {
private void checkMeasure(TypeCheckInfo question, SFunctionDefinitionBase node, ILexNameToken iLexNameToken, PType result)
{
PTypeAssistantTC assistant = question.assistantFactory.createPTypeAssistant();
if (!assistant.isNumeric(result))
{
if (assistant.isProduct(result))
{
AProductType pt = assistant.getProduct(result);
for (PType t : pt.getTypes())
{
if (!assistant.isNumeric(t))
{
TypeCheckerErrors.report(3272, "Measure range is not a nat, or a nat tuple", node.getMeasure().getLocation(), node.getMeasure());
TypeCheckerErrors.detail("Actual", result);
break;
}
}
}
else
{
TypeCheckerErrors.report(3272, "Measure range is not a nat, or a nat tuple", node.getMeasure().getLocation(), node.getMeasure());
TypeCheckerErrors.detail("Actual", result);
}
}
} } | public class class_name {
private void checkMeasure(TypeCheckInfo question, SFunctionDefinitionBase node, ILexNameToken iLexNameToken, PType result)
{
PTypeAssistantTC assistant = question.assistantFactory.createPTypeAssistant();
if (!assistant.isNumeric(result))
{
if (assistant.isProduct(result))
{
AProductType pt = assistant.getProduct(result);
for (PType t : pt.getTypes())
{
if (!assistant.isNumeric(t))
{
TypeCheckerErrors.report(3272, "Measure range is not a nat, or a nat tuple", node.getMeasure().getLocation(), node.getMeasure()); // depends on control dependency: [if], data = [none]
TypeCheckerErrors.detail("Actual", result); // depends on control dependency: [if], data = [none]
break;
}
}
}
else
{
TypeCheckerErrors.report(3272, "Measure range is not a nat, or a nat tuple", node.getMeasure().getLocation(), node.getMeasure()); // depends on control dependency: [if], data = [none]
TypeCheckerErrors.detail("Actual", result); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
protected Socket getSocket(){
if (mSocketFactoryRef != null && mSocketFactoryRef.get() != null) {
return ((SSLSocketFactoryWrapper)mSocketFactoryRef.get()).getSocket();
}
return null;
} } | public class class_name {
protected Socket getSocket(){
if (mSocketFactoryRef != null && mSocketFactoryRef.get() != null) {
return ((SSLSocketFactoryWrapper)mSocketFactoryRef.get()).getSocket(); // depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
ImmutableList<SingleMemberInjector> getInjectors(
Set<InjectionPoint> injectionPoints, Errors errors) {
List<SingleMemberInjector> injectors = Lists.newArrayList();
for (InjectionPoint injectionPoint : injectionPoints) {
try {
Errors errorsForMember =
injectionPoint.isOptional()
? new Errors(injectionPoint)
: errors.withSource(injectionPoint);
SingleMemberInjector injector =
injectionPoint.getMember() instanceof Field
? new SingleFieldInjector(this.injector, injectionPoint, errorsForMember)
: new SingleMethodInjector(this.injector, injectionPoint, errorsForMember);
injectors.add(injector);
} catch (ErrorsException ignoredForNow) {
// ignored for now
}
}
return ImmutableList.copyOf(injectors);
} } | public class class_name {
ImmutableList<SingleMemberInjector> getInjectors(
Set<InjectionPoint> injectionPoints, Errors errors) {
List<SingleMemberInjector> injectors = Lists.newArrayList();
for (InjectionPoint injectionPoint : injectionPoints) {
try {
Errors errorsForMember =
injectionPoint.isOptional()
? new Errors(injectionPoint)
: errors.withSource(injectionPoint);
SingleMemberInjector injector =
injectionPoint.getMember() instanceof Field
? new SingleFieldInjector(this.injector, injectionPoint, errorsForMember)
: new SingleMethodInjector(this.injector, injectionPoint, errorsForMember);
injectors.add(injector); // depends on control dependency: [try], data = [none]
} catch (ErrorsException ignoredForNow) {
// ignored for now
} // depends on control dependency: [catch], data = [none]
}
return ImmutableList.copyOf(injectors);
} } |
public class class_name {
@Deprecated
public void pushGcmRegistrationId(String gcmId, boolean register) {
CleverTapAPI cleverTapAPI = weakReference.get();
if (cleverTapAPI == null) {
Logger.d("CleverTap Instance is null.");
} else {
cleverTapAPI.pushGcmRegistrationId(gcmId, register);
}
} } | public class class_name {
@Deprecated
public void pushGcmRegistrationId(String gcmId, boolean register) {
CleverTapAPI cleverTapAPI = weakReference.get();
if (cleverTapAPI == null) {
Logger.d("CleverTap Instance is null."); // depends on control dependency: [if], data = [none]
} else {
cleverTapAPI.pushGcmRegistrationId(gcmId, register); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Override
public String getWebInterfaceURL() {
try {
return getWebMonitorBaseUrl().get().toString();
} catch (InterruptedException | ExecutionException e) {
ExceptionUtils.checkInterrupted(e);
log.warn("Could not retrieve the web interface URL for the cluster.", e);
return "Unknown address.";
}
} } | public class class_name {
@Override
public String getWebInterfaceURL() {
try {
return getWebMonitorBaseUrl().get().toString(); // depends on control dependency: [try], data = [none]
} catch (InterruptedException | ExecutionException e) {
ExceptionUtils.checkInterrupted(e);
log.warn("Could not retrieve the web interface URL for the cluster.", e);
return "Unknown address.";
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public void marshall(CreateExclusionsPreviewRequest createExclusionsPreviewRequest, ProtocolMarshaller protocolMarshaller) {
if (createExclusionsPreviewRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createExclusionsPreviewRequest.getAssessmentTemplateArn(), ASSESSMENTTEMPLATEARN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(CreateExclusionsPreviewRequest createExclusionsPreviewRequest, ProtocolMarshaller protocolMarshaller) {
if (createExclusionsPreviewRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createExclusionsPreviewRequest.getAssessmentTemplateArn(), ASSESSMENTTEMPLATEARN_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public static Long parseLong(String param) {
try {
if (!StringUtils.isBlank(param)) {
return Long.valueOf(param);
}
} catch (Exception e) {
throw new IllegalArgumentException("Parameter " + param + " is not a number.");
}
return null;
} } | public class class_name {
public static Long parseLong(String param) {
try {
if (!StringUtils.isBlank(param)) {
return Long.valueOf(param); // depends on control dependency: [if], data = [none]
}
} catch (Exception e) {
throw new IllegalArgumentException("Parameter " + param + " is not a number.");
} // depends on control dependency: [catch], data = [none]
return null;
} } |
public class class_name {
public String convert(final String value) {
if(!value.matches(".*[0-9].*")) {
return value;
}
String str = value;
for(int i=0; i < numMap.length; i++) {
str = str.replaceAll(String.valueOf(i), numMap[i]);
}
return str;
} } | public class class_name {
public String convert(final String value) {
if(!value.matches(".*[0-9].*")) {
return value;
// depends on control dependency: [if], data = [none]
}
String str = value;
for(int i=0; i < numMap.length; i++) {
str = str.replaceAll(String.valueOf(i), numMap[i]);
// depends on control dependency: [for], data = [i]
}
return str;
} } |
public class class_name {
@FFDCIgnore(IllegalArgumentException.class)
private String evaluateGroupMemberAttribute(boolean immediateOnly) {
try {
return elHelper.processString("groupMemberAttribute", this.idStoreDefinition.groupMemberAttribute(), immediateOnly);
} catch (IllegalArgumentException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isWarningEnabled()) {
Tr.warning(tc, "JAVAEESEC_WARNING_IDSTORE_CONFIG", new Object[] { "groupMemberAttribute", "member" });
}
return "member"; /* Default value from spec. */
}
} } | public class class_name {
@FFDCIgnore(IllegalArgumentException.class)
private String evaluateGroupMemberAttribute(boolean immediateOnly) {
try {
return elHelper.processString("groupMemberAttribute", this.idStoreDefinition.groupMemberAttribute(), immediateOnly); // depends on control dependency: [try], data = [none]
} catch (IllegalArgumentException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isWarningEnabled()) {
Tr.warning(tc, "JAVAEESEC_WARNING_IDSTORE_CONFIG", new Object[] { "groupMemberAttribute", "member" }); // depends on control dependency: [if], data = [none]
}
return "member"; /* Default value from spec. */
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public void insertWorkItem(TimerWorkItem work, long curTime) {
// find the time slot, or create a new one
long insertTime = work.timeoutTime;
TimeSlot nextSlot = this.firstSlot;
while (nextSlot != null) {
if ((insertTime == nextSlot.timeoutTime) && (nextSlot.lastEntryIndex != TimeSlot.TIMESLOT_LAST_ENTRY)) {
nextSlot.addEntry(work, curTime);
break;
} else if (insertTime < nextSlot.timeoutTime) {
nextSlot = insertSlot(insertTime, nextSlot);
nextSlot.addEntry(work, curTime);
break;
} else {
nextSlot = nextSlot.nextEntry;
}
}
if (nextSlot == null) {
nextSlot = insertSlotAtEnd(insertTime);
nextSlot.addEntry(work, curTime);
}
} } | public class class_name {
public void insertWorkItem(TimerWorkItem work, long curTime) {
// find the time slot, or create a new one
long insertTime = work.timeoutTime;
TimeSlot nextSlot = this.firstSlot;
while (nextSlot != null) {
if ((insertTime == nextSlot.timeoutTime) && (nextSlot.lastEntryIndex != TimeSlot.TIMESLOT_LAST_ENTRY)) {
nextSlot.addEntry(work, curTime); // depends on control dependency: [if], data = [none]
break;
} else if (insertTime < nextSlot.timeoutTime) {
nextSlot = insertSlot(insertTime, nextSlot); // depends on control dependency: [if], data = [(insertTime]
nextSlot.addEntry(work, curTime); // depends on control dependency: [if], data = [none]
break;
} else {
nextSlot = nextSlot.nextEntry; // depends on control dependency: [if], data = [none]
}
}
if (nextSlot == null) {
nextSlot = insertSlotAtEnd(insertTime); // depends on control dependency: [if], data = [none]
nextSlot.addEntry(work, curTime); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private void updatePrintVisibility() {
PrintablePage printablePage = printView.getPreviewPane()
.getPrintablePage();
if (printablePage.getViewType() == ViewType.DAY_VIEW) {
printablePage.getDayView().refreshData();
} else if (printablePage.getViewType() == ViewType.WEEK_VIEW) {
printablePage.getWeekView().refreshData();
}
} } | public class class_name {
private void updatePrintVisibility() {
PrintablePage printablePage = printView.getPreviewPane()
.getPrintablePage();
if (printablePage.getViewType() == ViewType.DAY_VIEW) {
printablePage.getDayView().refreshData(); // depends on control dependency: [if], data = [none]
} else if (printablePage.getViewType() == ViewType.WEEK_VIEW) {
printablePage.getWeekView().refreshData(); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public void marshall(ListTranscriptionJobsRequest listTranscriptionJobsRequest, ProtocolMarshaller protocolMarshaller) {
if (listTranscriptionJobsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listTranscriptionJobsRequest.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(listTranscriptionJobsRequest.getJobNameContains(), JOBNAMECONTAINS_BINDING);
protocolMarshaller.marshall(listTranscriptionJobsRequest.getNextToken(), NEXTTOKEN_BINDING);
protocolMarshaller.marshall(listTranscriptionJobsRequest.getMaxResults(), MAXRESULTS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(ListTranscriptionJobsRequest listTranscriptionJobsRequest, ProtocolMarshaller protocolMarshaller) {
if (listTranscriptionJobsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listTranscriptionJobsRequest.getStatus(), STATUS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listTranscriptionJobsRequest.getJobNameContains(), JOBNAMECONTAINS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listTranscriptionJobsRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listTranscriptionJobsRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public static Torch torch() {
if (!isLoaded()) {
throw new IllegalStateException("Factory is not loaded!");
}
LinkedList<Torch> stack = STACK.get();
if (stack.isEmpty()) {
stack.add(factoryInstance.begin());
}
return stack.getLast();
} } | public class class_name {
public static Torch torch() {
if (!isLoaded()) {
throw new IllegalStateException("Factory is not loaded!");
}
LinkedList<Torch> stack = STACK.get();
if (stack.isEmpty()) {
stack.add(factoryInstance.begin()); // depends on control dependency: [if], data = [none]
}
return stack.getLast();
} } |
public class class_name {
@NullSafe
public static boolean createFile(File path) {
try {
return (path != null && !path.isDirectory() && (path.isFile() || path.createNewFile()));
}
catch (IOException ignore) {
return false;
}
} } | public class class_name {
@NullSafe
public static boolean createFile(File path) {
try {
return (path != null && !path.isDirectory() && (path.isFile() || path.createNewFile())); // depends on control dependency: [try], data = [none]
}
catch (IOException ignore) {
return false;
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public boolean isMatchedByPreviousException(AnalyzedTokenReadings prevToken) {
for (AnalyzedToken analyzedToken : prevToken) {
if (isMatchedByPreviousException(analyzedToken)) {
return true;
}
}
return false;
} } | public class class_name {
public boolean isMatchedByPreviousException(AnalyzedTokenReadings prevToken) {
for (AnalyzedToken analyzedToken : prevToken) {
if (isMatchedByPreviousException(analyzedToken)) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} } |
public class class_name {
public static String format(double amount, boolean isUseTraditional, boolean isMoneyMode) {
final String[] numArray = isUseTraditional ? traditionalDigits : simpleDigits;
if (amount > 99999999999999.99 || amount < -99999999999999.99) {
throw new IllegalArgumentException("Number support only: (-99999999999999.99 ~ 99999999999999.99)!");
}
boolean negative = false;
if (amount < 0) {
negative = true;
amount = - amount;
}
long temp = Math.round(amount * 100);
int numFen = (int) (temp % 10);
temp = temp / 10;
int numJiao = (int) (temp % 10);
temp = temp / 10;
//将数字以万为单位分为多份
int[] parts = new int[20];
int numParts = 0;
for (int i = 0; temp != 0; i++) {
int part = (int) (temp % 10000);
parts[i] = part;
numParts++;
temp = temp / 10000;
}
boolean beforeWanIsZero = true; // 标志“万”下面一级是不是 0
String chineseStr = StrUtil.EMPTY;
for (int i = 0; i < numParts; i++) {
String partChinese = toChinese(parts[i], isUseTraditional);
if (i % 2 == 0) {
beforeWanIsZero = StrUtil.isEmpty(partChinese);
}
if (i != 0) {
if (i % 2 == 0) {
chineseStr = "亿" + chineseStr;
} else {
if ("".equals(partChinese) && false == beforeWanIsZero) {
// 如果“万”对应的 part 为 0,而“万”下面一级不为 0,则不加“万”,而加“零”
chineseStr = "零" + chineseStr;
} else {
if (parts[i - 1] < 1000 && parts[i - 1] > 0) {
// 如果"万"的部分不为 0, 而"万"前面的部分小于 1000 大于 0, 则万后面应该跟“零”
chineseStr = "零" + chineseStr;
}
chineseStr = "万" + chineseStr;
}
}
}
chineseStr = partChinese + chineseStr;
}
// 整数部分为 0, 则表达为"零"
if (StrUtil.EMPTY.equals(chineseStr)) {
chineseStr = numArray[0];
}
//负数
if (negative) { // 整数部分不为 0
chineseStr = "负" + chineseStr;
}
// 小数部分
if (numFen != 0 || numJiao != 0) {
if (numFen == 0) {
chineseStr += (isMoneyMode ? "元" : "点") + numArray[numJiao] + (isMoneyMode ? "角" : "");
} else { // “分”数不为 0
if (numJiao == 0) {
chineseStr += (isMoneyMode ? "元零" : "点零") + numArray[numFen] + (isMoneyMode ? "分" : "");
} else {
chineseStr += (isMoneyMode ? "元" : "点") + numArray[numJiao] + (isMoneyMode ? "角" : "") + numArray[numFen] + (isMoneyMode ? "分" : "");
}
}
}else if(isMoneyMode) {
//无小数部分的金额结尾
chineseStr += "元整";
}
return chineseStr;
} } | public class class_name {
public static String format(double amount, boolean isUseTraditional, boolean isMoneyMode) {
final String[] numArray = isUseTraditional ? traditionalDigits : simpleDigits;
if (amount > 99999999999999.99 || amount < -99999999999999.99) {
throw new IllegalArgumentException("Number support only: (-99999999999999.99 ~ 99999999999999.99)!");
}
boolean negative = false;
if (amount < 0) {
negative = true; // depends on control dependency: [if], data = [none]
amount = - amount; // depends on control dependency: [if], data = [none]
}
long temp = Math.round(amount * 100);
int numFen = (int) (temp % 10);
temp = temp / 10;
int numJiao = (int) (temp % 10);
temp = temp / 10;
//将数字以万为单位分为多份
int[] parts = new int[20];
int numParts = 0;
for (int i = 0; temp != 0; i++) {
int part = (int) (temp % 10000);
parts[i] = part; // depends on control dependency: [for], data = [i]
numParts++; // depends on control dependency: [for], data = [none]
temp = temp / 10000; // depends on control dependency: [for], data = [none]
}
boolean beforeWanIsZero = true; // 标志“万”下面一级是不是 0
String chineseStr = StrUtil.EMPTY;
for (int i = 0; i < numParts; i++) {
String partChinese = toChinese(parts[i], isUseTraditional);
if (i % 2 == 0) {
beforeWanIsZero = StrUtil.isEmpty(partChinese); // depends on control dependency: [if], data = [none]
}
if (i != 0) {
if (i % 2 == 0) {
chineseStr = "亿" + chineseStr; // depends on control dependency: [if], data = [none]
} else {
if ("".equals(partChinese) && false == beforeWanIsZero) {
// 如果“万”对应的 part 为 0,而“万”下面一级不为 0,则不加“万”,而加“零”
chineseStr = "零" + chineseStr; // depends on control dependency: [if], data = [none]
} else {
if (parts[i - 1] < 1000 && parts[i - 1] > 0) {
// 如果"万"的部分不为 0, 而"万"前面的部分小于 1000 大于 0, 则万后面应该跟“零”
chineseStr = "零" + chineseStr; // depends on control dependency: [if], data = [none]
}
chineseStr = "万" + chineseStr; // depends on control dependency: [if], data = [none]
}
}
}
chineseStr = partChinese + chineseStr; // depends on control dependency: [for], data = [none]
}
// 整数部分为 0, 则表达为"零"
if (StrUtil.EMPTY.equals(chineseStr)) {
chineseStr = numArray[0]; // depends on control dependency: [if], data = [none]
}
//负数
if (negative) { // 整数部分不为 0
chineseStr = "负" + chineseStr; // depends on control dependency: [if], data = [none]
}
// 小数部分
if (numFen != 0 || numJiao != 0) {
if (numFen == 0) {
chineseStr += (isMoneyMode ? "元" : "点") + numArray[numJiao] + (isMoneyMode ? "角" : ""); // depends on control dependency: [if], data = [none]
} else { // “分”数不为 0
if (numJiao == 0) {
chineseStr += (isMoneyMode ? "元零" : "点零") + numArray[numFen] + (isMoneyMode ? "分" : ""); // depends on control dependency: [if], data = [none]
} else {
chineseStr += (isMoneyMode ? "元" : "点") + numArray[numJiao] + (isMoneyMode ? "角" : "") + numArray[numFen] + (isMoneyMode ? "分" : ""); // depends on control dependency: [if], data = [none]
}
}
}else if(isMoneyMode) {
//无小数部分的金额结尾
chineseStr += "元整"; // depends on control dependency: [if], data = [none]
}
return chineseStr;
} } |
public class class_name {
public boolean getIsEditMode() {
if (m_isEditMode == null) {
m_isEditMode = Boolean.valueOf(CmsJspTagEditable.isEditableRequest(m_request));
}
return m_isEditMode.booleanValue();
} } | public class class_name {
public boolean getIsEditMode() {
if (m_isEditMode == null) {
m_isEditMode = Boolean.valueOf(CmsJspTagEditable.isEditableRequest(m_request)); // depends on control dependency: [if], data = [none]
}
return m_isEditMode.booleanValue();
} } |
public class class_name {
@Override
public void removeByCommerceShipment(long commerceShipmentId) {
for (CommerceShipmentItem commerceShipmentItem : findByCommerceShipment(
commerceShipmentId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceShipmentItem);
}
} } | public class class_name {
@Override
public void removeByCommerceShipment(long commerceShipmentId) {
for (CommerceShipmentItem commerceShipmentItem : findByCommerceShipment(
commerceShipmentId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceShipmentItem); // depends on control dependency: [for], data = [commerceShipmentItem]
}
} } |
public class class_name {
@Override
protected List<ColumnDescription> getColumnDescriptions(
PortletLayoutAggregationDiscriminator reportColumnDiscriminator, F form) {
int groupSize = form.getGroups().size();
int portletSize = form.getPortlets().size();
String portletName = reportColumnDiscriminator.getPortletMapping().getFname();
String groupName = reportColumnDiscriminator.getAggregatedGroup().getGroupName();
String description = null;
if (showFullColumnHeaderDescriptions(form) || (groupSize > 1 && portletSize > 1)) {
description = String.format("%s - %s", portletName, groupName);
} else {
// Default to group name, else portlet name
description = groupSize == 1 && portletSize > 1 ? portletName : groupName;
}
final List<ColumnDescription> columnDescriptions = new ArrayList<ColumnDescription>();
columnDescriptions.add(new ColumnDescription(description, ValueType.NUMBER, description));
return columnDescriptions;
} } | public class class_name {
@Override
protected List<ColumnDescription> getColumnDescriptions(
PortletLayoutAggregationDiscriminator reportColumnDiscriminator, F form) {
int groupSize = form.getGroups().size();
int portletSize = form.getPortlets().size();
String portletName = reportColumnDiscriminator.getPortletMapping().getFname();
String groupName = reportColumnDiscriminator.getAggregatedGroup().getGroupName();
String description = null;
if (showFullColumnHeaderDescriptions(form) || (groupSize > 1 && portletSize > 1)) {
description = String.format("%s - %s", portletName, groupName); // depends on control dependency: [if], data = [none]
} else {
// Default to group name, else portlet name
description = groupSize == 1 && portletSize > 1 ? portletName : groupName; // depends on control dependency: [if], data = [none]
}
final List<ColumnDescription> columnDescriptions = new ArrayList<ColumnDescription>();
columnDescriptions.add(new ColumnDescription(description, ValueType.NUMBER, description));
return columnDescriptions;
} } |
public class class_name {
public EnvironmentResourceDescription withAutoScalingGroups(AutoScalingGroup... autoScalingGroups) {
if (this.autoScalingGroups == null) {
setAutoScalingGroups(new com.amazonaws.internal.SdkInternalList<AutoScalingGroup>(autoScalingGroups.length));
}
for (AutoScalingGroup ele : autoScalingGroups) {
this.autoScalingGroups.add(ele);
}
return this;
} } | public class class_name {
public EnvironmentResourceDescription withAutoScalingGroups(AutoScalingGroup... autoScalingGroups) {
if (this.autoScalingGroups == null) {
setAutoScalingGroups(new com.amazonaws.internal.SdkInternalList<AutoScalingGroup>(autoScalingGroups.length)); // depends on control dependency: [if], data = [none]
}
for (AutoScalingGroup ele : autoScalingGroups) {
this.autoScalingGroups.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
@Override
public void trimToSize(){
if ( atoms instanceof ArrayList<?>) {
ArrayList<Atom> myatoms = (ArrayList<Atom>) atoms;
myatoms.trimToSize();
}
if ( altLocs instanceof ArrayList<?>){
ArrayList<Group> myAltLocs = (ArrayList<Group>) altLocs;
myAltLocs.trimToSize();
}
if ( hasAltLoc()) {
for (Group alt : getAltLocs()){
alt.trimToSize();
}
}
// now let's fit the hashmaps to size
properties = new HashMap<String, Object>(properties);
if ( atomNameLookup != null)
atomNameLookup = new HashMap<String,Atom>(atomNameLookup);
} } | public class class_name {
@Override
public void trimToSize(){
if ( atoms instanceof ArrayList<?>) {
ArrayList<Atom> myatoms = (ArrayList<Atom>) atoms;
myatoms.trimToSize(); // depends on control dependency: [if], data = [)]
}
if ( altLocs instanceof ArrayList<?>){
ArrayList<Group> myAltLocs = (ArrayList<Group>) altLocs;
myAltLocs.trimToSize(); // depends on control dependency: [if], data = [)]
}
if ( hasAltLoc()) {
for (Group alt : getAltLocs()){
alt.trimToSize(); // depends on control dependency: [for], data = [alt]
}
}
// now let's fit the hashmaps to size
properties = new HashMap<String, Object>(properties);
if ( atomNameLookup != null)
atomNameLookup = new HashMap<String,Atom>(atomNameLookup);
} } |
public class class_name {
public static HierarchicalProperty getACL(NodeImpl node) throws RepositoryException
{
HierarchicalProperty property = new HierarchicalProperty(ACL);
AccessControlList acl = node.getACL();
HashMap<String, List<String>> principals = new HashMap<String, List<String>>();
List<AccessControlEntry> entryList = acl.getPermissionEntries();
for (AccessControlEntry entry : entryList)
{
String principal = entry.getIdentity();
String grant = entry.getPermission();
List<String> grantList = principals.get(principal);
if (grantList == null)
{
grantList = new ArrayList<String>();
principals.put(principal, grantList);
}
grantList.add(grant);
}
Iterator<String> principalIter = principals.keySet().iterator();
while (principalIter.hasNext())
{
HierarchicalProperty aceProperty = new HierarchicalProperty(ACE);
String curPrincipal = principalIter.next();
aceProperty.addChild(getPrincipalProperty(curPrincipal));
aceProperty.addChild(getGrantProperty(principals.get(curPrincipal)));
property.addChild(aceProperty);
}
return property;
} } | public class class_name {
public static HierarchicalProperty getACL(NodeImpl node) throws RepositoryException
{
HierarchicalProperty property = new HierarchicalProperty(ACL);
AccessControlList acl = node.getACL();
HashMap<String, List<String>> principals = new HashMap<String, List<String>>();
List<AccessControlEntry> entryList = acl.getPermissionEntries();
for (AccessControlEntry entry : entryList)
{
String principal = entry.getIdentity();
String grant = entry.getPermission();
List<String> grantList = principals.get(principal);
if (grantList == null)
{
grantList = new ArrayList<String>(); // depends on control dependency: [if], data = [none]
principals.put(principal, grantList); // depends on control dependency: [if], data = [none]
}
grantList.add(grant);
}
Iterator<String> principalIter = principals.keySet().iterator();
while (principalIter.hasNext())
{
HierarchicalProperty aceProperty = new HierarchicalProperty(ACE);
String curPrincipal = principalIter.next();
aceProperty.addChild(getPrincipalProperty(curPrincipal));
aceProperty.addChild(getGrantProperty(principals.get(curPrincipal)));
property.addChild(aceProperty);
}
return property;
} } |
public class class_name {
public static void runUninterruptibly(final Try.Runnable<InterruptedException> cmd) {
N.checkArgNotNull(cmd);
boolean interrupted = false;
try {
while (true) {
try {
cmd.run();
return;
} catch (InterruptedException e) {
interrupted = true;
}
}
} finally {
if (interrupted) {
Thread.currentThread().interrupt();
}
}
} } | public class class_name {
public static void runUninterruptibly(final Try.Runnable<InterruptedException> cmd) {
N.checkArgNotNull(cmd);
boolean interrupted = false;
try {
while (true) {
try {
cmd.run();
// depends on control dependency: [try], data = [none]
return;
// depends on control dependency: [try], data = [none]
} catch (InterruptedException e) {
interrupted = true;
}
// depends on control dependency: [catch], data = [none]
}
} finally {
if (interrupted) {
Thread.currentThread().interrupt();
// depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public static boolean hasDbBind(Annotation[] annotations) {
final String name = DB_BIND_CNAME;
for (Annotation a : annotations) {
if (a.annotationType().getName().equals(name)) {
return true;
}
}
return false;
} } | public class class_name {
public static boolean hasDbBind(Annotation[] annotations) {
final String name = DB_BIND_CNAME;
for (Annotation a : annotations) {
if (a.annotationType().getName().equals(name)) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} } |
public class class_name {
public void solve(double[] b, double[] x) {
if (!full) {
throw new IllegalStateException("This is not a FULL singular value decomposition.");
}
if (b.length != m || x.length != n) {
throw new IllegalArgumentException("Dimensions do not agree.");
}
double[] tmp = new double[n];
for (int j = 0; j < n; j++) {
double r = 0.0;
if (s[j] > tol) {
for (int i = 0; i < m; i++) {
r += U.get(i, j) * b[i];
}
r /= s[j];
}
tmp[j] = r;
}
for (int j = 0; j < n; j++) {
double r = 0.0;
for (int jj = 0; jj < n; jj++) {
r += V.get(j, jj) * tmp[jj];
}
x[j] = r;
}
} } | public class class_name {
public void solve(double[] b, double[] x) {
if (!full) {
throw new IllegalStateException("This is not a FULL singular value decomposition.");
}
if (b.length != m || x.length != n) {
throw new IllegalArgumentException("Dimensions do not agree.");
}
double[] tmp = new double[n];
for (int j = 0; j < n; j++) {
double r = 0.0;
if (s[j] > tol) {
for (int i = 0; i < m; i++) {
r += U.get(i, j) * b[i]; // depends on control dependency: [for], data = [i]
}
r /= s[j]; // depends on control dependency: [if], data = [none]
}
tmp[j] = r; // depends on control dependency: [for], data = [j]
}
for (int j = 0; j < n; j++) {
double r = 0.0;
for (int jj = 0; jj < n; jj++) {
r += V.get(j, jj) * tmp[jj]; // depends on control dependency: [for], data = [jj]
}
x[j] = r; // depends on control dependency: [for], data = [j]
}
} } |
public class class_name {
public String requestCommandMessage(CommandType type) {
VehicleMessage message = request(new Command(type));
String value = null;
if(message != null) {
// Because we use the same key and value for commands and command
// responses, if for some reason a Command is echoed back to the
// device instead of a CommandResponse, you could get a casting
// exception when trying to cast this message here. If we got a
// Command, just ignore it and assume no response - I wasn't able to
// reproduce it but we did have a few Bugsnag reports about it.
try {
CommandResponse response = message.asCommandResponse();
if(response.getStatus()) {
value = response.getMessage();
}
} catch(ClassCastException e) {
Log.w(TAG, "Expected a command response but got " + message +
" -- ignoring, assuming no response");
}
}
return value;
} } | public class class_name {
public String requestCommandMessage(CommandType type) {
VehicleMessage message = request(new Command(type));
String value = null;
if(message != null) {
// Because we use the same key and value for commands and command
// responses, if for some reason a Command is echoed back to the
// device instead of a CommandResponse, you could get a casting
// exception when trying to cast this message here. If we got a
// Command, just ignore it and assume no response - I wasn't able to
// reproduce it but we did have a few Bugsnag reports about it.
try {
CommandResponse response = message.asCommandResponse();
if(response.getStatus()) {
value = response.getMessage(); // depends on control dependency: [if], data = [none]
}
} catch(ClassCastException e) {
Log.w(TAG, "Expected a command response but got " + message +
" -- ignoring, assuming no response");
} // depends on control dependency: [catch], data = [none]
}
return value;
} } |
public class class_name {
int doOne(int bid, int tid, int aid, int delta) {
int aBalance = 0;
if (Conn == null) {
bench.incrementFailedTransactionCount();
return 0;
}
try {
if (Benchmark.prepared_stmt) {
pstmt1.setInt(1,delta);
pstmt1.setInt(2,aid);
pstmt1.executeUpdate();
pstmt1.clearWarnings();
pstmt2.setInt(1,aid);
ResultSet RS = pstmt2.executeQuery();
pstmt2.clearWarnings();
while (RS.next()) {
aBalance = RS.getInt(1);
}
pstmt3.setInt(1,delta);
pstmt3.setInt(2,tid);
pstmt3.executeUpdate();
pstmt3.clearWarnings();
pstmt4.setInt(1,delta);
pstmt4.setInt(2,bid);
pstmt4.executeUpdate();
pstmt4.clearWarnings();
pstmt5.setInt(1,tid);
pstmt5.setInt(2,bid);
pstmt5.setInt(3,aid);
pstmt5.setInt(4,delta);
pstmt5.executeUpdate();
pstmt5.clearWarnings();
} else {
Statement Stmt = Conn.createStatement();
String Query = "UPDATE accounts";
Query += " SET Abalance = Abalance + " + delta;
Query += " WHERE Aid = " + aid;
Stmt.executeUpdate(Query);
Stmt.clearWarnings();
Query = "SELECT Abalance";
Query += " FROM accounts";
Query += " WHERE Aid = " + aid;
ResultSet RS = Stmt.executeQuery(Query);
Stmt.clearWarnings();
while (RS.next()) {
aBalance = RS.getInt(1);
}
Query = "UPDATE tellers";
Query += " SET Tbalance = Tbalance + " + delta;
Query += " WHERE Tid = " + tid;
Stmt.executeUpdate(Query);
Stmt.clearWarnings();
Query = "UPDATE branches";
Query += " SET Bbalance = Bbalance + " + delta;
Query += " WHERE Bid = " + bid;
Stmt.executeUpdate(Query);
Stmt.clearWarnings();
Query = "INSERT INTO history(Tid, Bid, Aid, delta)";
Query += " VALUES (";
Query += tid + ",";
Query += bid + ",";
Query += aid + ",";
Query += delta + ")";
Stmt.executeUpdate(Query);
Stmt.clearWarnings();
Stmt.close();
}
if (Benchmark.transactions) {
Conn.commit();
}
return aBalance;
} catch (java.lang.Exception e) {
if (Benchmark.verbose) {
System.out.println("Transaction failed: "
+ e.getMessage());
e.printStackTrace();
}
bench.incrementFailedTransactionCount();
if (Benchmark.transactions) {
try {
Conn.rollback();
} catch (SQLException e1) {
}
}
}
return 0;
} } | public class class_name {
int doOne(int bid, int tid, int aid, int delta) {
int aBalance = 0;
if (Conn == null) {
bench.incrementFailedTransactionCount(); // depends on control dependency: [if], data = [none]
return 0; // depends on control dependency: [if], data = [none]
}
try {
if (Benchmark.prepared_stmt) {
pstmt1.setInt(1,delta); // depends on control dependency: [if], data = [none]
pstmt1.setInt(2,aid); // depends on control dependency: [if], data = [none]
pstmt1.executeUpdate(); // depends on control dependency: [if], data = [none]
pstmt1.clearWarnings(); // depends on control dependency: [if], data = [none]
pstmt2.setInt(1,aid); // depends on control dependency: [if], data = [none]
ResultSet RS = pstmt2.executeQuery();
pstmt2.clearWarnings(); // depends on control dependency: [if], data = [none]
while (RS.next()) {
aBalance = RS.getInt(1); // depends on control dependency: [while], data = [none]
}
pstmt3.setInt(1,delta); // depends on control dependency: [if], data = [none]
pstmt3.setInt(2,tid); // depends on control dependency: [if], data = [none]
pstmt3.executeUpdate(); // depends on control dependency: [if], data = [none]
pstmt3.clearWarnings(); // depends on control dependency: [if], data = [none]
pstmt4.setInt(1,delta); // depends on control dependency: [if], data = [none]
pstmt4.setInt(2,bid); // depends on control dependency: [if], data = [none]
pstmt4.executeUpdate(); // depends on control dependency: [if], data = [none]
pstmt4.clearWarnings(); // depends on control dependency: [if], data = [none]
pstmt5.setInt(1,tid); // depends on control dependency: [if], data = [none]
pstmt5.setInt(2,bid); // depends on control dependency: [if], data = [none]
pstmt5.setInt(3,aid); // depends on control dependency: [if], data = [none]
pstmt5.setInt(4,delta); // depends on control dependency: [if], data = [none]
pstmt5.executeUpdate(); // depends on control dependency: [if], data = [none]
pstmt5.clearWarnings(); // depends on control dependency: [if], data = [none]
} else {
Statement Stmt = Conn.createStatement();
String Query = "UPDATE accounts";
Query += " SET Abalance = Abalance + " + delta; // depends on control dependency: [if], data = [none]
Query += " WHERE Aid = " + aid; // depends on control dependency: [if], data = [none]
Stmt.executeUpdate(Query); // depends on control dependency: [if], data = [none]
Stmt.clearWarnings(); // depends on control dependency: [if], data = [none]
Query = "SELECT Abalance"; // depends on control dependency: [if], data = [none]
Query += " FROM accounts"; // depends on control dependency: [if], data = [none]
Query += " WHERE Aid = " + aid; // depends on control dependency: [if], data = [none]
ResultSet RS = Stmt.executeQuery(Query);
Stmt.clearWarnings(); // depends on control dependency: [if], data = [none]
while (RS.next()) {
aBalance = RS.getInt(1); // depends on control dependency: [while], data = [none]
}
Query = "UPDATE tellers"; // depends on control dependency: [if], data = [none]
Query += " SET Tbalance = Tbalance + " + delta; // depends on control dependency: [if], data = [none]
Query += " WHERE Tid = " + tid; // depends on control dependency: [if], data = [none]
Stmt.executeUpdate(Query); // depends on control dependency: [if], data = [none]
Stmt.clearWarnings(); // depends on control dependency: [if], data = [none]
Query = "UPDATE branches"; // depends on control dependency: [if], data = [none]
Query += " SET Bbalance = Bbalance + " + delta; // depends on control dependency: [if], data = [none]
Query += " WHERE Bid = " + bid; // depends on control dependency: [if], data = [none]
Stmt.executeUpdate(Query); // depends on control dependency: [if], data = [none]
Stmt.clearWarnings(); // depends on control dependency: [if], data = [none]
Query = "INSERT INTO history(Tid, Bid, Aid, delta)"; // depends on control dependency: [if], data = [none]
Query += " VALUES ("; // depends on control dependency: [if], data = [none]
Query += tid + ","; // depends on control dependency: [if], data = [none]
Query += bid + ","; // depends on control dependency: [if], data = [none]
Query += aid + ","; // depends on control dependency: [if], data = [none]
Query += delta + ")"; // depends on control dependency: [if], data = [none]
Stmt.executeUpdate(Query); // depends on control dependency: [if], data = [none]
Stmt.clearWarnings(); // depends on control dependency: [if], data = [none]
Stmt.close(); // depends on control dependency: [if], data = [none]
}
if (Benchmark.transactions) {
Conn.commit(); // depends on control dependency: [if], data = [none]
}
return aBalance; // depends on control dependency: [try], data = [none]
} catch (java.lang.Exception e) {
if (Benchmark.verbose) {
System.out.println("Transaction failed: "
+ e.getMessage()); // depends on control dependency: [if], data = [none]
e.printStackTrace(); // depends on control dependency: [if], data = [none]
}
bench.incrementFailedTransactionCount();
if (Benchmark.transactions) {
try {
Conn.rollback(); // depends on control dependency: [try], data = [none]
} catch (SQLException e1) {
} // depends on control dependency: [catch], data = [none]
}
} // depends on control dependency: [catch], data = [none]
return 0;
} } |
public class class_name {
static Set<String> getSubmounts(VirtualFile virtualFile) {
final ConcurrentMap<VirtualFile, Map<String, Mount>> mounts = VFS.mounts;
final Map<String, Mount> mountMap = mounts.get(virtualFile);
if (mountMap == null) {
return emptyRemovableSet();
}
return new HashSet<String>(mountMap.keySet());
} } | public class class_name {
static Set<String> getSubmounts(VirtualFile virtualFile) {
final ConcurrentMap<VirtualFile, Map<String, Mount>> mounts = VFS.mounts;
final Map<String, Mount> mountMap = mounts.get(virtualFile);
if (mountMap == null) {
return emptyRemovableSet(); // depends on control dependency: [if], data = [none]
}
return new HashSet<String>(mountMap.keySet());
} } |
public class class_name {
public boolean hasAnyScope(String... scopes) {
boolean result = OAuth2ExpressionUtils.hasAnyScope(authentication, scopes);
if (!result) {
missingScopes.addAll(Arrays.asList(scopes));
}
return result;
} } | public class class_name {
public boolean hasAnyScope(String... scopes) {
boolean result = OAuth2ExpressionUtils.hasAnyScope(authentication, scopes);
if (!result) {
missingScopes.addAll(Arrays.asList(scopes)); // depends on control dependency: [if], data = [none]
}
return result;
} } |
public class class_name {
public String toHexString() {
String res = Long.toHexString(_fp);
int len = res.length();
if (len < 16) {
res = LEADING_ZEROS.substring(len) + res;
assert res.length() == 16;
}
return res;
} } | public class class_name {
public String toHexString() {
String res = Long.toHexString(_fp);
int len = res.length();
if (len < 16) {
res = LEADING_ZEROS.substring(len) + res; // depends on control dependency: [if], data = [(len]
assert res.length() == 16;
}
return res;
} } |
public class class_name {
protected final void notifyOnAreaShown(@NonNull final Area area) {
for (AreaListener listener : areaListeners) {
listener.onAreaShown(area);
}
} } | public class class_name {
protected final void notifyOnAreaShown(@NonNull final Area area) {
for (AreaListener listener : areaListeners) {
listener.onAreaShown(area); // depends on control dependency: [for], data = [listener]
}
} } |
public class class_name {
public static void shutdown() {
ScheduledExecutorService exec = PURGE_THREAD.getAndSet(null);
if (exec != null) {
exec.shutdownNow();
}
POOLS.clear();
} } | public class class_name {
public static void shutdown() {
ScheduledExecutorService exec = PURGE_THREAD.getAndSet(null);
if (exec != null) {
exec.shutdownNow(); // depends on control dependency: [if], data = [none]
}
POOLS.clear();
} } |
public class class_name {
@SuppressWarnings("rawtypes")
public static void populateArgumentsForCriteria(AbstractHibernateDatastore datastore, Class<?> targetClass, Criteria c, Map argMap, ConversionService conversionService, boolean useDefaultMapping) {
Integer maxParam = null;
Integer offsetParam = null;
if (argMap.containsKey(ARGUMENT_MAX)) {
maxParam = conversionService.convert(argMap.get(ARGUMENT_MAX),Integer.class);
}
if (argMap.containsKey(ARGUMENT_OFFSET)) {
offsetParam = conversionService.convert(argMap.get(ARGUMENT_OFFSET),Integer.class);
}
if (argMap.containsKey(ARGUMENT_FETCH_SIZE)) {
c.setFetchSize(conversionService.convert(argMap.get(ARGUMENT_FETCH_SIZE),Integer.class));
}
if (argMap.containsKey(ARGUMENT_TIMEOUT)) {
c.setTimeout(conversionService.convert(argMap.get(ARGUMENT_TIMEOUT),Integer.class));
}
if (argMap.containsKey(ARGUMENT_FLUSH_MODE)) {
c.setFlushMode(convertFlushMode(argMap.get(ARGUMENT_FLUSH_MODE)));
}
if (argMap.containsKey(ARGUMENT_READ_ONLY)) {
c.setReadOnly(ClassUtils.getBooleanFromMap(ARGUMENT_READ_ONLY, argMap));
}
String orderParam = (String)argMap.get(ARGUMENT_ORDER);
Object fetchObj = argMap.get(ARGUMENT_FETCH);
if (fetchObj instanceof Map) {
Map fetch = (Map)fetchObj;
for (Object o : fetch.keySet()) {
String associationName = (String) o;
c.setFetchMode(associationName, getFetchMode(fetch.get(associationName)));
}
}
final int max = maxParam == null ? -1 : maxParam;
final int offset = offsetParam == null ? -1 : offsetParam;
if (max > -1) {
c.setMaxResults(max);
}
if (offset > -1) {
c.setFirstResult(offset);
}
if (ClassUtils.getBooleanFromMap(ARGUMENT_LOCK, argMap)) {
c.setLockMode(LockMode.PESSIMISTIC_WRITE);
c.setCacheable(false);
}
else {
if (argMap.containsKey(ARGUMENT_CACHE)) {
c.setCacheable(ClassUtils.getBooleanFromMap(ARGUMENT_CACHE, argMap));
} else {
cacheCriteriaByMapping(targetClass, c);
}
}
final Object sortObj = argMap.get(ARGUMENT_SORT);
if (sortObj != null) {
boolean ignoreCase = true;
Object caseArg = argMap.get(ARGUMENT_IGNORE_CASE);
if (caseArg instanceof Boolean) {
ignoreCase = (Boolean) caseArg;
}
if (sortObj instanceof Map) {
Map sortMap = (Map) sortObj;
for (Object sort : sortMap.keySet()) {
final String order = ORDER_DESC.equalsIgnoreCase((String) sortMap.get(sort)) ? ORDER_DESC : ORDER_ASC;
addOrderPossiblyNested(datastore, c, targetClass, (String) sort, order, ignoreCase);
}
} else {
final String sort = (String) sortObj;
final String order = ORDER_DESC.equalsIgnoreCase(orderParam) ? ORDER_DESC : ORDER_ASC;
addOrderPossiblyNested(datastore, c, targetClass, sort, order, ignoreCase);
}
}
else if (useDefaultMapping) {
Mapping m = GrailsDomainBinder.getMapping(targetClass);
if (m != null) {
Map sortMap = m.getSort().getNamesAndDirections();
for (Object sort : sortMap.keySet()) {
final String order = ORDER_DESC.equalsIgnoreCase((String) sortMap.get(sort)) ? ORDER_DESC : ORDER_ASC;
addOrderPossiblyNested(datastore, c, targetClass, (String) sort, order, true);
}
}
}
} } | public class class_name {
@SuppressWarnings("rawtypes")
public static void populateArgumentsForCriteria(AbstractHibernateDatastore datastore, Class<?> targetClass, Criteria c, Map argMap, ConversionService conversionService, boolean useDefaultMapping) {
Integer maxParam = null;
Integer offsetParam = null;
if (argMap.containsKey(ARGUMENT_MAX)) {
maxParam = conversionService.convert(argMap.get(ARGUMENT_MAX),Integer.class); // depends on control dependency: [if], data = [none]
}
if (argMap.containsKey(ARGUMENT_OFFSET)) {
offsetParam = conversionService.convert(argMap.get(ARGUMENT_OFFSET),Integer.class); // depends on control dependency: [if], data = [none]
}
if (argMap.containsKey(ARGUMENT_FETCH_SIZE)) {
c.setFetchSize(conversionService.convert(argMap.get(ARGUMENT_FETCH_SIZE),Integer.class)); // depends on control dependency: [if], data = [none]
}
if (argMap.containsKey(ARGUMENT_TIMEOUT)) {
c.setTimeout(conversionService.convert(argMap.get(ARGUMENT_TIMEOUT),Integer.class)); // depends on control dependency: [if], data = [none]
}
if (argMap.containsKey(ARGUMENT_FLUSH_MODE)) {
c.setFlushMode(convertFlushMode(argMap.get(ARGUMENT_FLUSH_MODE))); // depends on control dependency: [if], data = [none]
}
if (argMap.containsKey(ARGUMENT_READ_ONLY)) {
c.setReadOnly(ClassUtils.getBooleanFromMap(ARGUMENT_READ_ONLY, argMap)); // depends on control dependency: [if], data = [none]
}
String orderParam = (String)argMap.get(ARGUMENT_ORDER);
Object fetchObj = argMap.get(ARGUMENT_FETCH);
if (fetchObj instanceof Map) {
Map fetch = (Map)fetchObj;
for (Object o : fetch.keySet()) {
String associationName = (String) o;
c.setFetchMode(associationName, getFetchMode(fetch.get(associationName))); // depends on control dependency: [for], data = [o]
}
}
final int max = maxParam == null ? -1 : maxParam;
final int offset = offsetParam == null ? -1 : offsetParam;
if (max > -1) {
c.setMaxResults(max); // depends on control dependency: [if], data = [(max]
}
if (offset > -1) {
c.setFirstResult(offset); // depends on control dependency: [if], data = [(offset]
}
if (ClassUtils.getBooleanFromMap(ARGUMENT_LOCK, argMap)) {
c.setLockMode(LockMode.PESSIMISTIC_WRITE); // depends on control dependency: [if], data = [none]
c.setCacheable(false); // depends on control dependency: [if], data = [none]
}
else {
if (argMap.containsKey(ARGUMENT_CACHE)) {
c.setCacheable(ClassUtils.getBooleanFromMap(ARGUMENT_CACHE, argMap)); // depends on control dependency: [if], data = [none]
} else {
cacheCriteriaByMapping(targetClass, c); // depends on control dependency: [if], data = [none]
}
}
final Object sortObj = argMap.get(ARGUMENT_SORT);
if (sortObj != null) {
boolean ignoreCase = true;
Object caseArg = argMap.get(ARGUMENT_IGNORE_CASE);
if (caseArg instanceof Boolean) {
ignoreCase = (Boolean) caseArg; // depends on control dependency: [if], data = [none]
}
if (sortObj instanceof Map) {
Map sortMap = (Map) sortObj;
for (Object sort : sortMap.keySet()) {
final String order = ORDER_DESC.equalsIgnoreCase((String) sortMap.get(sort)) ? ORDER_DESC : ORDER_ASC;
addOrderPossiblyNested(datastore, c, targetClass, (String) sort, order, ignoreCase); // depends on control dependency: [for], data = [sort]
}
} else {
final String sort = (String) sortObj;
final String order = ORDER_DESC.equalsIgnoreCase(orderParam) ? ORDER_DESC : ORDER_ASC;
addOrderPossiblyNested(datastore, c, targetClass, sort, order, ignoreCase); // depends on control dependency: [if], data = [none]
}
}
else if (useDefaultMapping) {
Mapping m = GrailsDomainBinder.getMapping(targetClass);
if (m != null) {
Map sortMap = m.getSort().getNamesAndDirections();
for (Object sort : sortMap.keySet()) {
final String order = ORDER_DESC.equalsIgnoreCase((String) sortMap.get(sort)) ? ORDER_DESC : ORDER_ASC;
addOrderPossiblyNested(datastore, c, targetClass, (String) sort, order, true); // depends on control dependency: [for], data = [sort]
}
}
}
} } |
public class class_name {
public List<UnifiedDiffBlock<String, Character>> unified(String previous, String next)
{
setError(null);
try {
DiffResult<String> diffResult =
this.diffManager.diff(this.lineSplitter.split(previous), this.lineSplitter.split(next), null);
UnifiedDiffConfiguration<String, Character> config = this.unifiedDiffDisplayer.getDefaultConfiguration();
config.setSplitter(this.charSplitter);
return this.unifiedDiffDisplayer.display(diffResult, config);
} catch (DiffException e) {
setError(e);
return null;
}
} } | public class class_name {
public List<UnifiedDiffBlock<String, Character>> unified(String previous, String next)
{
setError(null);
try {
DiffResult<String> diffResult =
this.diffManager.diff(this.lineSplitter.split(previous), this.lineSplitter.split(next), null);
UnifiedDiffConfiguration<String, Character> config = this.unifiedDiffDisplayer.getDefaultConfiguration();
config.setSplitter(this.charSplitter); // depends on control dependency: [try], data = [none]
return this.unifiedDiffDisplayer.display(diffResult, config); // depends on control dependency: [try], data = [none]
} catch (DiffException e) {
setError(e);
return null;
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public ChangesHolder getChanges(final Set<String> removedNodes, final Set<String> addedNodes)
{
if (handler != null)
{
Iterator<NodeData> addedStates = new Iterator<NodeData>()
{
private final Iterator<String> iter = addedNodes.iterator();
public boolean hasNext()
{
return iter.hasNext();
}
public NodeData next()
{
// cycle till find a next or meet the end of set
do
{
String id = iter.next();
try
{
ItemData item = itemMgr.getItemData(id);
if (item != null)
{
if (item.isNode())
{
if (!indexingTree.isExcluded(item))
{
return (NodeData)item;
}
}
else
{
LOG.warn("Node not found, but property " + id + ", " + item.getQPath().getAsString()
+ " found. ");
}
}
else
{
LOG.warn("Unable to index node with id " + id + ", node does not exist.");
}
}
catch (RepositoryException e)
{
LOG.error("Can't read next node data " + id, e);
}
}
while (iter.hasNext()); // get next if error or node not found
return null; // we met the end of iterator set
}
public void remove()
{
throw new UnsupportedOperationException();
}
};
Iterator<String> removedIds = new Iterator<String>()
{
private final Iterator<String> iter = removedNodes.iterator();
public boolean hasNext()
{
return iter.hasNext();
}
public String next()
{
return nextNodeId();
}
public String nextNodeId() throws NoSuchElementException
{
return iter.next();
}
public void remove()
{
throw new UnsupportedOperationException();
}
};
if (removedNodes.size() > 0 || addedNodes.size() > 0)
{
return handler.getChanges(removedIds, addedStates);
}
}
return null;
} } | public class class_name {
public ChangesHolder getChanges(final Set<String> removedNodes, final Set<String> addedNodes)
{
if (handler != null)
{
Iterator<NodeData> addedStates = new Iterator<NodeData>()
{
private final Iterator<String> iter = addedNodes.iterator();
public boolean hasNext()
{
return iter.hasNext();
}
public NodeData next()
{
// cycle till find a next or meet the end of set
do
{
String id = iter.next();
try
{
ItemData item = itemMgr.getItemData(id);
if (item != null)
{
if (item.isNode())
{
if (!indexingTree.isExcluded(item))
{
return (NodeData)item;
// depends on control dependency: [if], data = [none]
}
}
else
{
LOG.warn("Node not found, but property " + id + ", " + item.getQPath().getAsString()
+ " found. ");
// depends on control dependency: [if], data = [none]
}
}
else
{
LOG.warn("Unable to index node with id " + id + ", node does not exist.");
// depends on control dependency: [if], data = [none]
}
}
catch (RepositoryException e)
{
LOG.error("Can't read next node data " + id, e);
}
// depends on control dependency: [catch], data = [none]
}
while (iter.hasNext()); // get next if error or node not found
return null; // we met the end of iterator set
}
public void remove()
{
throw new UnsupportedOperationException();
}
};
Iterator<String> removedIds = new Iterator<String>()
{
private final Iterator<String> iter = removedNodes.iterator();
public boolean hasNext()
{
return iter.hasNext();
}
public String next()
{
return nextNodeId();
}
public String nextNodeId() throws NoSuchElementException
{
return iter.next();
}
public void remove()
{
throw new UnsupportedOperationException();
}
};
if (removedNodes.size() > 0 || addedNodes.size() > 0)
{
return handler.getChanges(removedIds, addedStates);
}
}
return null;
} } |
public class class_name {
public void marshall(ConfigRule configRule, ProtocolMarshaller protocolMarshaller) {
if (configRule == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(configRule.getConfigRuleName(), CONFIGRULENAME_BINDING);
protocolMarshaller.marshall(configRule.getConfigRuleArn(), CONFIGRULEARN_BINDING);
protocolMarshaller.marshall(configRule.getConfigRuleId(), CONFIGRULEID_BINDING);
protocolMarshaller.marshall(configRule.getDescription(), DESCRIPTION_BINDING);
protocolMarshaller.marshall(configRule.getScope(), SCOPE_BINDING);
protocolMarshaller.marshall(configRule.getSource(), SOURCE_BINDING);
protocolMarshaller.marshall(configRule.getInputParameters(), INPUTPARAMETERS_BINDING);
protocolMarshaller.marshall(configRule.getMaximumExecutionFrequency(), MAXIMUMEXECUTIONFREQUENCY_BINDING);
protocolMarshaller.marshall(configRule.getConfigRuleState(), CONFIGRULESTATE_BINDING);
protocolMarshaller.marshall(configRule.getCreatedBy(), CREATEDBY_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(ConfigRule configRule, ProtocolMarshaller protocolMarshaller) {
if (configRule == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(configRule.getConfigRuleName(), CONFIGRULENAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(configRule.getConfigRuleArn(), CONFIGRULEARN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(configRule.getConfigRuleId(), CONFIGRULEID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(configRule.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(configRule.getScope(), SCOPE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(configRule.getSource(), SOURCE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(configRule.getInputParameters(), INPUTPARAMETERS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(configRule.getMaximumExecutionFrequency(), MAXIMUMEXECUTIONFREQUENCY_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(configRule.getConfigRuleState(), CONFIGRULESTATE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(configRule.getCreatedBy(), CREATEDBY_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public static void permute( int[] perm , double []input , double[]output , int N ) {
for (int k = 0; k < N; k++) {
output[k] = input[perm[k]];
}
} } | public class class_name {
public static void permute( int[] perm , double []input , double[]output , int N ) {
for (int k = 0; k < N; k++) {
output[k] = input[perm[k]]; // depends on control dependency: [for], data = [k]
}
} } |
public class class_name {
private static void replaceDestructuringAssignment(Node pattern, Node newLvalue, Node newRvalue) {
Node parent = pattern.getParent();
if (parent.isAssign()) {
Node newAssign = IR.assign(newLvalue, newRvalue).srcref(parent);
parent.replaceWith(newAssign);
} else if (newLvalue.isName()) {
checkState(parent.isDestructuringLhs());
parent.replaceWith(newLvalue);
newLvalue.addChildToBack(newRvalue);
} else {
pattern.getNext().detach();
pattern.detach();
parent.addChildToBack(newLvalue);
parent.addChildToBack(newRvalue);
}
} } | public class class_name {
private static void replaceDestructuringAssignment(Node pattern, Node newLvalue, Node newRvalue) {
Node parent = pattern.getParent();
if (parent.isAssign()) {
Node newAssign = IR.assign(newLvalue, newRvalue).srcref(parent);
parent.replaceWith(newAssign); // depends on control dependency: [if], data = [none]
} else if (newLvalue.isName()) {
checkState(parent.isDestructuringLhs()); // depends on control dependency: [if], data = [none]
parent.replaceWith(newLvalue); // depends on control dependency: [if], data = [none]
newLvalue.addChildToBack(newRvalue); // depends on control dependency: [if], data = [none]
} else {
pattern.getNext().detach(); // depends on control dependency: [if], data = [none]
pattern.detach(); // depends on control dependency: [if], data = [none]
parent.addChildToBack(newLvalue); // depends on control dependency: [if], data = [none]
parent.addChildToBack(newRvalue); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public Job extractList(String format, String gcsUrl1, String gcsUrl2) {
// [START ]
List<String> destinationUris = new ArrayList<>();
destinationUris.add(gcsUrl1);
destinationUris.add(gcsUrl2);
Job job = table.extract(format, destinationUris);
// Wait for the job to complete
try {
Job completedJob =
job.waitFor(
RetryOption.initialRetryDelay(Duration.ofSeconds(1)),
RetryOption.totalTimeout(Duration.ofMinutes(3)));
if (completedJob != null && completedJob.getStatus().getError() == null) {
// Job completed successfully
} else {
// Handle error case
}
} catch (InterruptedException e) {
// Handle interrupted wait
}
// [END ]
return job;
} } | public class class_name {
public Job extractList(String format, String gcsUrl1, String gcsUrl2) {
// [START ]
List<String> destinationUris = new ArrayList<>();
destinationUris.add(gcsUrl1);
destinationUris.add(gcsUrl2);
Job job = table.extract(format, destinationUris);
// Wait for the job to complete
try {
Job completedJob =
job.waitFor(
RetryOption.initialRetryDelay(Duration.ofSeconds(1)),
RetryOption.totalTimeout(Duration.ofMinutes(3)));
if (completedJob != null && completedJob.getStatus().getError() == null) {
// Job completed successfully
} else {
// Handle error case
}
} catch (InterruptedException e) {
// Handle interrupted wait
} // depends on control dependency: [catch], data = [none]
// [END ]
return job;
} } |
public class class_name {
private String createResourceIdentifier(final String localePrefix, final String resourceName, final String resourceVersion, final String libraryName, final String libraryVersion) {
final StringBuilder sb = new StringBuilder();
if (StringUtils.isNotBlank(localePrefix)) {
sb.append(localePrefix).append(PATH_SEPARATOR);
}
if (StringUtils.isNotBlank(libraryName)) {
sb.append(libraryName).append(PATH_SEPARATOR);
}
if (StringUtils.isNotBlank(libraryVersion)) {
sb.append(libraryVersion).append(PATH_SEPARATOR);
}
sb.append(resourceName).append(PATH_SEPARATOR);
if (StringUtils.isNotBlank(resourceVersion)) {
sb.append(resourceVersion).append(PATH_SEPARATOR);
}
return sb.toString();
} } | public class class_name {
private String createResourceIdentifier(final String localePrefix, final String resourceName, final String resourceVersion, final String libraryName, final String libraryVersion) {
final StringBuilder sb = new StringBuilder();
if (StringUtils.isNotBlank(localePrefix)) {
sb.append(localePrefix).append(PATH_SEPARATOR); // depends on control dependency: [if], data = [none]
}
if (StringUtils.isNotBlank(libraryName)) {
sb.append(libraryName).append(PATH_SEPARATOR); // depends on control dependency: [if], data = [none]
}
if (StringUtils.isNotBlank(libraryVersion)) {
sb.append(libraryVersion).append(PATH_SEPARATOR); // depends on control dependency: [if], data = [none]
}
sb.append(resourceName).append(PATH_SEPARATOR);
if (StringUtils.isNotBlank(resourceVersion)) {
sb.append(resourceVersion).append(PATH_SEPARATOR); // depends on control dependency: [if], data = [none]
}
return sb.toString();
} } |
public class class_name {
Span.Iterator spanIterator() {
if (!sorted) {
Collections.sort(rows, new RowSeq.RowSeqComparator());
sorted = true;
}
return new Span.Iterator();
} } | public class class_name {
Span.Iterator spanIterator() {
if (!sorted) {
Collections.sort(rows, new RowSeq.RowSeqComparator()); // depends on control dependency: [if], data = [none]
sorted = true; // depends on control dependency: [if], data = [none]
}
return new Span.Iterator();
} } |
public class class_name {
private static void addManagedBeanMethod(ClassWriter cw,
String className,
String implClassName,
Method method,
String implMethodName,
int methodId,
boolean aroundInvoke)
{
GeneratorAdapter mg;
String methodName = method.getName();
String methodSignature = MethodAttribUtils.jdiMethodSignature(method);
String EjbPreInvoke = "EjbPreInvokeForManagedBean";
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, INDENT + "adding method : " +
methodName + " " + methodSignature +
" : aroundInvoke = " + aroundInvoke);
// Determine the list of 'checked' exceptions, which will need to have
// catch blocks in the wrapper... and also perform validation.
// Note that RemoteException is never a 'checked' exception, and
// exceptions that are subclasses of other 'checked' exceptions
// will be eliminated, to avoid 'unreachable' code.
Class<?>[] methodExceptions = method.getExceptionTypes();
// Convert the return value, arguments, and exception classes to
// ASM Type objects, and create the ASM Method object which will
// be used to actually add the method and method code.
Type returnType = Type.getType(method.getReturnType());
Type[] argTypes = getTypes(method.getParameterTypes());
Type[] exceptionTypes = getTypes(methodExceptions);
org.objectweb.asm.commons.Method m =
new org.objectweb.asm.commons.Method(methodName,
returnType,
argTypes);
// Create an ASM GeneratorAdapter object for the ASM Method, which
// makes generating dynamic code much easier... as it keeps track
// of the position of the arguments and local variables, etc.
mg = new GeneratorAdapter(ACC_PUBLIC, m, null, exceptionTypes, cw);
// -----------------------------------------------------------------------
// Begin Method Code...
// -----------------------------------------------------------------------
mg.visitCode();
// -----------------------------------------------------------------------
// When no AroundInvoke interceptors... the code is very simple - the
// method call is just passed through to the actual instance, which may
// be found in the BeanO stored on the wrapper.
// -----------------------------------------------------------------------
if (!aroundInvoke)
{
// --------------------------------------------------------------------
// <bean impl> bean = (<bean impl>)ivBeanO.getBeanInstance();
// --------------------------------------------------------------------
Type implType = Type.getType("L" + implClassName + ";");
int bean = mg.newLocal(implType);
mg.loadThis();
mg.visitFieldInsn(GETFIELD, className, "ivBeanO",
"Lcom/ibm/ejs/container/BeanO;");
mg.visitMethodInsn(INVOKEVIRTUAL, "com/ibm/ejs/container/BeanO",
"getBeanInstance", "()Ljava/lang/Object;");
mg.checkCast(implType);
mg.storeLocal(bean);
// --------------------------------------------------------------------
// bean.<method>(<args...>);
// or
// rtnValue = bean.<method>(<args...>);
// --------------------------------------------------------------------
mg.loadLocal(bean);
mg.loadArgs(0, argTypes.length); // do not pass "this"
mg.visitMethodInsn(INVOKEVIRTUAL, implClassName, implMethodName,
m.getDescriptor());
mg.returnValue();
// -----------------------------------------------------------------------
// End Method Code...
// -----------------------------------------------------------------------
mg.endMethod(); // GeneratorAdapter accounts for visitMaxs(x,y)
mg.visitEnd();
return;
}
// -----------------------------------------------------------------------
// The rest of the code is for handling AroundInvoke interceptors.
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// EJSDeployedSupport s = new EJSDeployedSupport();
// -----------------------------------------------------------------------
int s = mg.newLocal(TYPE_EJSDeployedSupport);
mg.newInstance(TYPE_EJSDeployedSupport);
mg.dup();
mg.visitMethodInsn(INVOKESPECIAL, "com/ibm/ejs/container/EJSDeployedSupport", "<init>", "()V");
mg.storeLocal(s);
// -----------------------------------------------------------------------
// <return type> returnValue = false | 0 | null;
// -----------------------------------------------------------------------
int returnValue = -1;
if (returnType != Type.VOID_TYPE)
{
returnValue = mg.newLocal(returnType);
switch (returnType.getSort())
{
case Type.BOOLEAN:
mg.push(false);
break;
case Type.CHAR:
case Type.BYTE:
case Type.SHORT:
case Type.INT:
mg.push(0);
break;
case Type.FLOAT:
mg.push((float) 0);
break;
case Type.LONG:
mg.push((long) 0);
break;
case Type.DOUBLE:
mg.push((double) 0);
break;
// ARRAY & OBJECT - push a null on the stack
default:
mg.visitInsn(ACONST_NULL);
break;
}
mg.storeLocal(returnValue);
}
// -----------------------------------------------------------------------
// Object[] args;
// -----------------------------------------------------------------------
int args = mg.newLocal(TYPE_Object_ARRAY);
// -----------------------------------------------------------------------
// args = new Object[# of args];
// -----------------------------------------------------------------------
mg.push(argTypes.length);
mg.visitTypeInsn(ANEWARRAY, "java/lang/Object");
mg.storeLocal(args);
// -----------------------------------------------------------------------
// args[i] = "parameter"; -> for each parameter
// -----------------------------------------------------------------------
for (int i = 0; i < argTypes.length; i++)
{
mg.loadLocal(args);
mg.push(i);
// Convert primitives to objects to put in 'args' array.
switch (argTypes[i].getSort())
{
case Type.BOOLEAN:
mg.visitTypeInsn(NEW, "java/lang/Boolean");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Boolean", "<init>", "(Z)V");
break;
case Type.CHAR:
mg.visitTypeInsn(NEW, "java/lang/Character");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Character", "<init>", "(C)V");
break;
case Type.BYTE:
mg.visitTypeInsn(NEW, "java/lang/Byte");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Byte", "<init>", "(B)V");
break;
case Type.SHORT:
mg.visitTypeInsn(NEW, "java/lang/Short");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Short", "<init>", "(S)V");
break;
case Type.INT:
mg.visitTypeInsn(NEW, "java/lang/Integer");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Integer", "<init>", "(I)V");
break;
case Type.FLOAT:
mg.visitTypeInsn(NEW, "java/lang/Float");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Float", "<init>", "(F)V");
break;
case Type.LONG:
mg.visitTypeInsn(NEW, "java/lang/Long");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Long", "<init>", "(J)V");
break;
case Type.DOUBLE:
mg.visitTypeInsn(NEW, "java/lang/Double");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Double", "<init>", "(D)V");
break;
// ARRAY & OBJECT - no need to copy, just load the arg
default:
mg.loadArg(i); // for non-static, arg 0 = "this"
break;
}
mg.visitInsn(AASTORE);
}
// -----------------------------------------------------------------------
// <bean impl> bean = (bean impl)container.EjbPreInvokeForManagedBean
// ( this,
// methodId,
// s,
// ivBeanO,
// args );
// -----------------------------------------------------------------------
Type implType = Type.getType("L" + implClassName + ";");
int bean = mg.newLocal(implType);
loadContainer(mg, className, MANAGED_BEAN);
loadWrapperBase(mg, className, MANAGED_BEAN);
mg.push(methodId);
mg.loadLocal(s);
mg.loadThis();
mg.visitFieldInsn(GETFIELD, className, "ivBeanO", "Lcom/ibm/ejs/container/BeanO;");
mg.loadLocal(args);
mg.visitMethodInsn(INVOKEVIRTUAL, "com/ibm/ejs/container/EJSContainer",
EjbPreInvoke,
"(Lcom/ibm/ejs/container/EJSWrapperBase;ILcom/ibm/ejs/container/EJSDeployedSupport;Lcom/ibm/ejs/container/BeanO;[Ljava/lang/Object;)Ljava/lang/Object;");
mg.checkCast(implType);
mg.storeLocal(bean);
// -----------------------------------------------------------------------
// Now invoke the business method through the interceptors via
// EJSContainer.invoke();
// -----------------------------------------------------------------------
// --------------------------------------------------------------------
// container.invoke(s);
// or
// rtnValue = (type)container.invoke(s);
// or
// rtnValue = ((object type)container.invoke(s)).<type>Value(); // unbox
// --------------------------------------------------------------------
loadContainer(mg, className, MANAGED_BEAN);
mg.loadLocal(s);
mg.visitInsn(ACONST_NULL);
mg.visitMethodInsn(INVOKEVIRTUAL, "com/ibm/ejs/container/EJSContainer",
"invoke",
"(Lcom/ibm/ejs/container/EJSDeployedSupport;Ljavax/ejb/Timer;)Ljava/lang/Object;");
if (returnType == Type.VOID_TYPE)
{
// No return value, just pop the returned value (null) off the stack
mg.pop();
}
else
{
// Unbox any primitive values or add the appropriate cast
// for object/array values, and then store in local variable. d369262.7
unbox(mg, returnType);
mg.storeLocal(returnValue);
}
// -----------------------------------------------------------------------
// return
// -----------------------------------------------------------------------
if (returnType != Type.VOID_TYPE)
{
mg.loadLocal(returnValue);
}
mg.returnValue();
// -----------------------------------------------------------------------
// End Method Code...
// -----------------------------------------------------------------------
mg.endMethod(); // GeneratorAdapter accounts for visitMaxs(x,y)
mg.visitEnd();
} } | public class class_name {
private static void addManagedBeanMethod(ClassWriter cw,
String className,
String implClassName,
Method method,
String implMethodName,
int methodId,
boolean aroundInvoke)
{
GeneratorAdapter mg;
String methodName = method.getName();
String methodSignature = MethodAttribUtils.jdiMethodSignature(method);
String EjbPreInvoke = "EjbPreInvokeForManagedBean";
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, INDENT + "adding method : " +
methodName + " " + methodSignature +
" : aroundInvoke = " + aroundInvoke);
// Determine the list of 'checked' exceptions, which will need to have
// catch blocks in the wrapper... and also perform validation.
// Note that RemoteException is never a 'checked' exception, and
// exceptions that are subclasses of other 'checked' exceptions
// will be eliminated, to avoid 'unreachable' code.
Class<?>[] methodExceptions = method.getExceptionTypes();
// Convert the return value, arguments, and exception classes to
// ASM Type objects, and create the ASM Method object which will
// be used to actually add the method and method code.
Type returnType = Type.getType(method.getReturnType());
Type[] argTypes = getTypes(method.getParameterTypes());
Type[] exceptionTypes = getTypes(methodExceptions);
org.objectweb.asm.commons.Method m =
new org.objectweb.asm.commons.Method(methodName,
returnType,
argTypes);
// Create an ASM GeneratorAdapter object for the ASM Method, which
// makes generating dynamic code much easier... as it keeps track
// of the position of the arguments and local variables, etc.
mg = new GeneratorAdapter(ACC_PUBLIC, m, null, exceptionTypes, cw);
// -----------------------------------------------------------------------
// Begin Method Code...
// -----------------------------------------------------------------------
mg.visitCode();
// -----------------------------------------------------------------------
// When no AroundInvoke interceptors... the code is very simple - the
// method call is just passed through to the actual instance, which may
// be found in the BeanO stored on the wrapper.
// -----------------------------------------------------------------------
if (!aroundInvoke)
{
// --------------------------------------------------------------------
// <bean impl> bean = (<bean impl>)ivBeanO.getBeanInstance();
// --------------------------------------------------------------------
Type implType = Type.getType("L" + implClassName + ";");
int bean = mg.newLocal(implType);
mg.loadThis(); // depends on control dependency: [if], data = [none]
mg.visitFieldInsn(GETFIELD, className, "ivBeanO",
"Lcom/ibm/ejs/container/BeanO;"); // depends on control dependency: [if], data = [none]
mg.visitMethodInsn(INVOKEVIRTUAL, "com/ibm/ejs/container/BeanO",
"getBeanInstance", "()Ljava/lang/Object;");
mg.checkCast(implType);
mg.storeLocal(bean); // depends on control dependency: [if], data = [none]
// --------------------------------------------------------------------
// bean.<method>(<args...>);
// or
// rtnValue = bean.<method>(<args...>);
// --------------------------------------------------------------------
mg.loadLocal(bean); // depends on control dependency: [if], data = [none]
mg.loadArgs(0, argTypes.length); // do not pass "this" // depends on control dependency: [if], data = [none]
mg.visitMethodInsn(INVOKEVIRTUAL, implClassName, implMethodName,
m.getDescriptor()); // depends on control dependency: [if], data = [none]
mg.returnValue(); // depends on control dependency: [if], data = [none]
// -----------------------------------------------------------------------
// End Method Code...
// -----------------------------------------------------------------------
mg.endMethod(); // GeneratorAdapter accounts for visitMaxs(x,y) // depends on control dependency: [if], data = [none]
mg.visitEnd(); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
// -----------------------------------------------------------------------
// The rest of the code is for handling AroundInvoke interceptors.
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// EJSDeployedSupport s = new EJSDeployedSupport();
// -----------------------------------------------------------------------
int s = mg.newLocal(TYPE_EJSDeployedSupport);
mg.newInstance(TYPE_EJSDeployedSupport);
mg.dup();
mg.visitMethodInsn(INVOKESPECIAL, "com/ibm/ejs/container/EJSDeployedSupport", "<init>", "()V");
mg.storeLocal(s);
// -----------------------------------------------------------------------
// <return type> returnValue = false | 0 | null;
// -----------------------------------------------------------------------
int returnValue = -1;
if (returnType != Type.VOID_TYPE)
{
returnValue = mg.newLocal(returnType); // depends on control dependency: [if], data = [(returnType]
switch (returnType.getSort())
{
case Type.BOOLEAN:
mg.push(false); // depends on control dependency: [if], data = [none]
break;
case Type.CHAR:
case Type.BYTE:
case Type.SHORT:
case Type.INT:
mg.push(0); // depends on control dependency: [if], data = [none]
break;
case Type.FLOAT:
mg.push((float) 0); // depends on control dependency: [if], data = [none]
break;
case Type.LONG:
mg.push((long) 0); // depends on control dependency: [if], data = [none]
break;
case Type.DOUBLE:
mg.push((double) 0); // depends on control dependency: [if], data = [none]
break;
// ARRAY & OBJECT - push a null on the stack
default:
mg.visitInsn(ACONST_NULL);
break;
}
mg.storeLocal(returnValue);
}
// -----------------------------------------------------------------------
// Object[] args;
// -----------------------------------------------------------------------
int args = mg.newLocal(TYPE_Object_ARRAY);
// -----------------------------------------------------------------------
// args = new Object[# of args];
// -----------------------------------------------------------------------
mg.push(argTypes.length);
mg.visitTypeInsn(ANEWARRAY, "java/lang/Object");
mg.storeLocal(args);
// -----------------------------------------------------------------------
// args[i] = "parameter"; -> for each parameter
// -----------------------------------------------------------------------
for (int i = 0; i < argTypes.length; i++)
{
mg.loadLocal(args);
mg.push(i);
// Convert primitives to objects to put in 'args' array.
switch (argTypes[i].getSort())
{
case Type.BOOLEAN:
mg.visitTypeInsn(NEW, "java/lang/Boolean");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Boolean", "<init>", "(Z)V");
break;
case Type.CHAR:
mg.visitTypeInsn(NEW, "java/lang/Character");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Character", "<init>", "(C)V");
break;
case Type.BYTE:
mg.visitTypeInsn(NEW, "java/lang/Byte");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Byte", "<init>", "(B)V");
break;
case Type.SHORT:
mg.visitTypeInsn(NEW, "java/lang/Short");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Short", "<init>", "(S)V");
break;
case Type.INT:
mg.visitTypeInsn(NEW, "java/lang/Integer");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Integer", "<init>", "(I)V");
break;
case Type.FLOAT:
mg.visitTypeInsn(NEW, "java/lang/Float");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Float", "<init>", "(F)V");
break;
case Type.LONG:
mg.visitTypeInsn(NEW, "java/lang/Long");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Long", "<init>", "(J)V");
break;
case Type.DOUBLE:
mg.visitTypeInsn(NEW, "java/lang/Double");
mg.visitInsn(DUP);
mg.loadArg(i); // for non-static, arg 0 = "this"
mg.visitMethodInsn(INVOKESPECIAL, "java/lang/Double", "<init>", "(D)V");
break;
// ARRAY & OBJECT - no need to copy, just load the arg
default:
mg.loadArg(i); // for non-static, arg 0 = "this"
break;
}
mg.visitInsn(AASTORE);
}
// -----------------------------------------------------------------------
// <bean impl> bean = (bean impl)container.EjbPreInvokeForManagedBean
// ( this,
// methodId,
// s,
// ivBeanO,
// args );
// -----------------------------------------------------------------------
Type implType = Type.getType("L" + implClassName + ";");
int bean = mg.newLocal(implType);
loadContainer(mg, className, MANAGED_BEAN);
loadWrapperBase(mg, className, MANAGED_BEAN);
mg.push(methodId);
mg.loadLocal(s);
mg.loadThis();
mg.visitFieldInsn(GETFIELD, className, "ivBeanO", "Lcom/ibm/ejs/container/BeanO;");
mg.loadLocal(args);
mg.visitMethodInsn(INVOKEVIRTUAL, "com/ibm/ejs/container/EJSContainer",
EjbPreInvoke,
"(Lcom/ibm/ejs/container/EJSWrapperBase;ILcom/ibm/ejs/container/EJSDeployedSupport;Lcom/ibm/ejs/container/BeanO;[Ljava/lang/Object;)Ljava/lang/Object;");
mg.checkCast(implType);
mg.storeLocal(bean);
// -----------------------------------------------------------------------
// Now invoke the business method through the interceptors via
// EJSContainer.invoke();
// -----------------------------------------------------------------------
// --------------------------------------------------------------------
// container.invoke(s);
// or
// rtnValue = (type)container.invoke(s);
// or
// rtnValue = ((object type)container.invoke(s)).<type>Value(); // unbox
// --------------------------------------------------------------------
loadContainer(mg, className, MANAGED_BEAN);
mg.loadLocal(s);
mg.visitInsn(ACONST_NULL);
mg.visitMethodInsn(INVOKEVIRTUAL, "com/ibm/ejs/container/EJSContainer",
"invoke",
"(Lcom/ibm/ejs/container/EJSDeployedSupport;Ljavax/ejb/Timer;)Ljava/lang/Object;");
if (returnType == Type.VOID_TYPE)
{
// No return value, just pop the returned value (null) off the stack
mg.pop();
}
else
{
// Unbox any primitive values or add the appropriate cast
// for object/array values, and then store in local variable. d369262.7
unbox(mg, returnType);
mg.storeLocal(returnValue);
}
// -----------------------------------------------------------------------
// return
// -----------------------------------------------------------------------
if (returnType != Type.VOID_TYPE)
{
mg.loadLocal(returnValue);
}
mg.returnValue();
// -----------------------------------------------------------------------
// End Method Code...
// -----------------------------------------------------------------------
mg.endMethod(); // GeneratorAdapter accounts for visitMaxs(x,y)
mg.visitEnd();
} } |
public class class_name {
public ArrayList<PathImpl> getResources(String pathName)
{
ArrayList<PathImpl> list = new ArrayList<PathImpl>();
String pathname = _pathname;
// XXX: why was this here?
if (pathname.startsWith("/"))
pathname = "." + pathname;
ArrayList<PathImpl> pathList = ((MergePath) _root)._pathList;
for (int i = 0; i < pathList.size(); i++) {
PathImpl path = pathList.get(i);
path = path.lookup(pathname);
ArrayList<PathImpl> subResources = path.getResources(pathName);
for (int j = 0; j < subResources.size(); j++) {
PathImpl newPath = subResources.get(j);
if (! list.contains(newPath))
list.add(newPath);
}
}
return list;
} } | public class class_name {
public ArrayList<PathImpl> getResources(String pathName)
{
ArrayList<PathImpl> list = new ArrayList<PathImpl>();
String pathname = _pathname;
// XXX: why was this here?
if (pathname.startsWith("/"))
pathname = "." + pathname;
ArrayList<PathImpl> pathList = ((MergePath) _root)._pathList;
for (int i = 0; i < pathList.size(); i++) {
PathImpl path = pathList.get(i);
path = path.lookup(pathname); // depends on control dependency: [for], data = [none]
ArrayList<PathImpl> subResources = path.getResources(pathName);
for (int j = 0; j < subResources.size(); j++) {
PathImpl newPath = subResources.get(j);
if (! list.contains(newPath))
list.add(newPath);
}
}
return list;
} } |
public class class_name {
public Session currentSession() throws HibernateException {
Object value = TransactionSynchronizationManager.getResource(sessionFactory);
if (value instanceof Session) {
return (Session) value;
}
if (value instanceof SessionHolder) {
SessionHolder sessionHolder = (SessionHolder) value;
Session session = sessionHolder.getSession();
if (TransactionSynchronizationManager.isSynchronizationActive() && !sessionHolder.isSynchronizedWithTransaction()) {
TransactionSynchronizationManager.registerSynchronization(createSpringSessionSynchronization(sessionHolder));
sessionHolder.setSynchronizedWithTransaction(true);
// Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
// with FlushMode.MANUAL, which needs to allow flushing within the transaction.
FlushMode flushMode = session.getHibernateFlushMode();
if (flushMode.equals(FlushMode.MANUAL) && !TransactionSynchronizationManager.isCurrentTransactionReadOnly()) {
session.setHibernateFlushMode(FlushMode.AUTO);
sessionHolder.setPreviousFlushMode(flushMode);
}
}
return session;
}
if (jtaSessionContext != null) {
Session session = jtaSessionContext.currentSession();
if (TransactionSynchronizationManager.isSynchronizationActive()) {
TransactionSynchronizationManager.registerSynchronization(createSpringFlushSynchronization(session));
}
return session;
}
if (allowCreate) {
// be consistent with older HibernateTemplate behavior
return createSession(value);
}
throw new HibernateException("No Session found for current thread");
} } | public class class_name {
public Session currentSession() throws HibernateException {
Object value = TransactionSynchronizationManager.getResource(sessionFactory);
if (value instanceof Session) {
return (Session) value;
}
if (value instanceof SessionHolder) {
SessionHolder sessionHolder = (SessionHolder) value;
Session session = sessionHolder.getSession();
if (TransactionSynchronizationManager.isSynchronizationActive() && !sessionHolder.isSynchronizedWithTransaction()) {
TransactionSynchronizationManager.registerSynchronization(createSpringSessionSynchronization(sessionHolder)); // depends on control dependency: [if], data = [none]
sessionHolder.setSynchronizedWithTransaction(true); // depends on control dependency: [if], data = [none]
// Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
// with FlushMode.MANUAL, which needs to allow flushing within the transaction.
FlushMode flushMode = session.getHibernateFlushMode();
if (flushMode.equals(FlushMode.MANUAL) && !TransactionSynchronizationManager.isCurrentTransactionReadOnly()) {
session.setHibernateFlushMode(FlushMode.AUTO); // depends on control dependency: [if], data = [none]
sessionHolder.setPreviousFlushMode(flushMode); // depends on control dependency: [if], data = [none]
}
}
return session;
}
if (jtaSessionContext != null) {
Session session = jtaSessionContext.currentSession();
if (TransactionSynchronizationManager.isSynchronizationActive()) {
TransactionSynchronizationManager.registerSynchronization(createSpringFlushSynchronization(session));
}
return session;
}
if (allowCreate) {
// be consistent with older HibernateTemplate behavior
return createSession(value);
}
throw new HibernateException("No Session found for current thread");
} } |
public class class_name {
static String getConfigKey(InjectionPoint ip, ConfigProperty configProperty) {
String key = configProperty.name();
if (key.length() > 0) {
return key;
}
if (ip.getAnnotated() instanceof AnnotatedMember) {
AnnotatedMember member = (AnnotatedMember) ip.getAnnotated();
AnnotatedType declaringType = member.getDeclaringType();
if (declaringType != null) {
return declaringType.getJavaClass().getCanonicalName() + "." + member.getJavaMember().getName();
}
}
throw new IllegalStateException("Could not find default name for @ConfigProperty InjectionPoint " + ip);
} } | public class class_name {
static String getConfigKey(InjectionPoint ip, ConfigProperty configProperty) {
String key = configProperty.name();
if (key.length() > 0) {
return key; // depends on control dependency: [if], data = [none]
}
if (ip.getAnnotated() instanceof AnnotatedMember) {
AnnotatedMember member = (AnnotatedMember) ip.getAnnotated();
AnnotatedType declaringType = member.getDeclaringType();
if (declaringType != null) {
return declaringType.getJavaClass().getCanonicalName() + "." + member.getJavaMember().getName(); // depends on control dependency: [if], data = [none]
}
}
throw new IllegalStateException("Could not find default name for @ConfigProperty InjectionPoint " + ip);
} } |
public class class_name {
public boolean tableExists(String table)
throws SQLException
{
PreparedStatement statement = null;
ResultSet result = null;
try {
statement = this.connection.prepareStatement("SHOW TABLES;");
result = execute(statement);
if (result == null) {
return false;
}
boolean found = false;
while(result.next()){
if(table.equalsIgnoreCase(result.getString(1))){
found = true;
}
}
return found;
}
finally {
if (statement != null) {
statement.close();
}
if (result != null) {
result.close();
}
}
} } | public class class_name {
public boolean tableExists(String table)
throws SQLException
{
PreparedStatement statement = null;
ResultSet result = null;
try {
statement = this.connection.prepareStatement("SHOW TABLES;");
result = execute(statement);
if (result == null) {
return false;
}
boolean found = false;
while(result.next()){
if(table.equalsIgnoreCase(result.getString(1))){
found = true;
}
}
return found;
}
finally {
if (statement != null) {
statement.close(); // depends on control dependency: [if], data = [none]
}
if (result != null) {
result.close(); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
@Override
public void end(boolean completeScope) {
setCompleteScope(completeScope);
isActive = false;
isEnded = true;
if (hasReplacedParent()) {
getParent().replacedBy = null;
}
performOperation(PvmAtomicOperation.ACTIVITY_NOTIFY_LISTENER_END);
} } | public class class_name {
@Override
public void end(boolean completeScope) {
setCompleteScope(completeScope);
isActive = false;
isEnded = true;
if (hasReplacedParent()) {
getParent().replacedBy = null; // depends on control dependency: [if], data = [none]
}
performOperation(PvmAtomicOperation.ACTIVITY_NOTIFY_LISTENER_END);
} } |
public class class_name {
public java.util.List<ScheduledInstancesPrivateIpAddressConfig> getPrivateIpAddressConfigs() {
if (privateIpAddressConfigs == null) {
privateIpAddressConfigs = new com.amazonaws.internal.SdkInternalList<ScheduledInstancesPrivateIpAddressConfig>();
}
return privateIpAddressConfigs;
} } | public class class_name {
public java.util.List<ScheduledInstancesPrivateIpAddressConfig> getPrivateIpAddressConfigs() {
if (privateIpAddressConfigs == null) {
privateIpAddressConfigs = new com.amazonaws.internal.SdkInternalList<ScheduledInstancesPrivateIpAddressConfig>(); // depends on control dependency: [if], data = [none]
}
return privateIpAddressConfigs;
} } |
public class class_name {
List<SortProperty> convert2SortProperty(final List<SortMeta> sortMetas) {
List<SortProperty> sortProperties = new ArrayList<SortProperty>(
sortMetas.size());
for (SortMeta sortMeta : sortMetas) {
final SortOrder order = sortMeta.getSortOrder();
if (order == SortOrder.ASCENDING || order == SortOrder.DESCENDING) {
sortProperties.add(new SortProperty(sortMeta.getSortField(),
convert2SortPropertyOrder(order)));
}
}
return sortProperties;
} } | public class class_name {
List<SortProperty> convert2SortProperty(final List<SortMeta> sortMetas) {
List<SortProperty> sortProperties = new ArrayList<SortProperty>(
sortMetas.size());
for (SortMeta sortMeta : sortMetas) {
final SortOrder order = sortMeta.getSortOrder();
if (order == SortOrder.ASCENDING || order == SortOrder.DESCENDING) {
sortProperties.add(new SortProperty(sortMeta.getSortField(),
convert2SortPropertyOrder(order))); // depends on control dependency: [if], data = [none]
}
}
return sortProperties;
} } |
public class class_name {
public static URI createUri(final String url, final boolean strict) {
try {
return newUri(url, strict);
} catch (URISyntaxException e) {
throw new AssertionError("Error creating URI: " + e.getMessage());
}
} } | public class class_name {
public static URI createUri(final String url, final boolean strict) {
try {
return newUri(url, strict); // depends on control dependency: [try], data = [none]
} catch (URISyntaxException e) {
throw new AssertionError("Error creating URI: " + e.getMessage());
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
static public FileSystemManager getManager(){
StandardFileSystemManager fsManager = new StandardFileSystemManager();
try {
fsManager.init();
} catch (FileSystemException e) {
log.error("Cannot initialize StandardFileSystemManager.", e);
}
return fsManager;
} } | public class class_name {
static public FileSystemManager getManager(){
StandardFileSystemManager fsManager = new StandardFileSystemManager();
try {
fsManager.init();
// depends on control dependency: [try], data = [none]
} catch (FileSystemException e) {
log.error("Cannot initialize StandardFileSystemManager.", e);
}
// depends on control dependency: [catch], data = [none]
return fsManager;
} } |
public class class_name {
public CSLDate parse(String str) {
Map<String, Object> res;
try {
Map<String, Object> m = runner.callMethod(
parser, "parseDateToArray", Map.class, str);
res = m;
} catch (ScriptRunnerException e) {
throw new IllegalArgumentException("Could not update items", e);
}
CSLDate r = CSLDate.fromJson(res);
if (r.getDateParts().length == 2 && Arrays.equals(r.getDateParts()[0], r.getDateParts()[1])) {
r = new CSLDateBuilder(r).dateParts(r.getDateParts()[0]).build();
}
return r;
} } | public class class_name {
public CSLDate parse(String str) {
Map<String, Object> res;
try {
Map<String, Object> m = runner.callMethod(
parser, "parseDateToArray", Map.class, str);
res = m; // depends on control dependency: [try], data = [none]
} catch (ScriptRunnerException e) {
throw new IllegalArgumentException("Could not update items", e);
} // depends on control dependency: [catch], data = [none]
CSLDate r = CSLDate.fromJson(res);
if (r.getDateParts().length == 2 && Arrays.equals(r.getDateParts()[0], r.getDateParts()[1])) {
r = new CSLDateBuilder(r).dateParts(r.getDateParts()[0]).build(); // depends on control dependency: [if], data = [none]
}
return r;
} } |
public class class_name {
public DesignSpec setSpacingsColor(int color) {
if (mSpacingsPaint.getColor() == color) {
return this;
}
mSpacingsPaint.setColor(color);
invalidateSelf();
return this;
} } | public class class_name {
public DesignSpec setSpacingsColor(int color) {
if (mSpacingsPaint.getColor() == color) {
return this; // depends on control dependency: [if], data = [none]
}
mSpacingsPaint.setColor(color);
invalidateSelf();
return this;
} } |
public class class_name {
@GET
public Response getInstanceInfo() {
InstanceInfo appInfo = registry
.getInstanceByAppAndId(app.getName(), id);
if (appInfo != null) {
logger.debug("Found: {} - {}", app.getName(), id);
return Response.ok(appInfo).build();
} else {
logger.debug("Not Found: {} - {}", app.getName(), id);
return Response.status(Status.NOT_FOUND).build();
}
} } | public class class_name {
@GET
public Response getInstanceInfo() {
InstanceInfo appInfo = registry
.getInstanceByAppAndId(app.getName(), id);
if (appInfo != null) {
logger.debug("Found: {} - {}", app.getName(), id); // depends on control dependency: [if], data = [none]
return Response.ok(appInfo).build(); // depends on control dependency: [if], data = [(appInfo]
} else {
logger.debug("Not Found: {} - {}", app.getName(), id); // depends on control dependency: [if], data = [none]
return Response.status(Status.NOT_FOUND).build(); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public TreeMap<String, String> getStyleAsTreeMap() {
TreeMap<String, String> resultMap = new TreeMap<String, String>();
if (M2StringUtils.isBlank(this.getStyle())) {
return resultMap;
}
String st[] = this.getStyle().trim().split(";");
String st2[];
for (String s : st) {
st2 = s.split(":");
resultMap.put(st2[0].trim(), st2[1].trim());
}
return resultMap;
} } | public class class_name {
public TreeMap<String, String> getStyleAsTreeMap() {
TreeMap<String, String> resultMap = new TreeMap<String, String>();
if (M2StringUtils.isBlank(this.getStyle())) {
return resultMap; // depends on control dependency: [if], data = [none]
}
String st[] = this.getStyle().trim().split(";");
String st2[];
for (String s : st) {
st2 = s.split(":"); // depends on control dependency: [for], data = [s]
resultMap.put(st2[0].trim(), st2[1].trim()); // depends on control dependency: [for], data = [s]
}
return resultMap;
} } |
public class class_name {
public boolean checkConnection(String addr) {
Url url = this.addressParser.parse(addr);
Connection conn = this.connectionManager.get(url.getUniqueKey());
try {
this.connectionManager.check(conn);
} catch (Exception e) {
return false;
}
return true;
} } | public class class_name {
public boolean checkConnection(String addr) {
Url url = this.addressParser.parse(addr);
Connection conn = this.connectionManager.get(url.getUniqueKey());
try {
this.connectionManager.check(conn); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
return false;
} // depends on control dependency: [catch], data = [none]
return true;
} } |
public class class_name {
public boolean isClosed() {
if (isEmpty()) {
return false;
}
if (getNumPoints() == 1) {
return false;
}
Coordinate[] coordinates = getCoordinates();
return coordinates[0].equals(coordinates[coordinates.length - 1]);
} } | public class class_name {
public boolean isClosed() {
if (isEmpty()) {
return false; // depends on control dependency: [if], data = [none]
}
if (getNumPoints() == 1) {
return false; // depends on control dependency: [if], data = [none]
}
Coordinate[] coordinates = getCoordinates();
return coordinates[0].equals(coordinates[coordinates.length - 1]);
} } |
public class class_name {
public void marshall(UnpeerVpcRequest unpeerVpcRequest, ProtocolMarshaller protocolMarshaller) {
if (unpeerVpcRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(UnpeerVpcRequest unpeerVpcRequest, ProtocolMarshaller protocolMarshaller) {
if (unpeerVpcRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public void removeAllCssProperties() {
final long stamp = lock.writeLock();
try {
cssProperties.clear();
abstractCssPropertyClassObjects.clear();
super.removeAllFromAttributeValueMap();
} finally {
lock.unlockWrite(stamp);
}
} } | public class class_name {
public void removeAllCssProperties() {
final long stamp = lock.writeLock();
try {
cssProperties.clear(); // depends on control dependency: [try], data = [none]
abstractCssPropertyClassObjects.clear(); // depends on control dependency: [try], data = [none]
super.removeAllFromAttributeValueMap(); // depends on control dependency: [try], data = [none]
} finally {
lock.unlockWrite(stamp);
}
} } |
public class class_name {
public StrBuilder deleteAll(final String str) {
final int len = (str == null ? 0 : str.length());
if (len > 0) {
int index = indexOf(str, 0);
while (index >= 0) {
deleteImpl(index, index + len, len);
index = indexOf(str, index);
}
}
return this;
} } | public class class_name {
public StrBuilder deleteAll(final String str) {
final int len = (str == null ? 0 : str.length());
if (len > 0) {
int index = indexOf(str, 0);
while (index >= 0) {
deleteImpl(index, index + len, len); // depends on control dependency: [while], data = [(index]
index = indexOf(str, index); // depends on control dependency: [while], data = [none]
}
}
return this;
} } |
public class class_name {
private void init() throws IOException {
if (initialized.compareAndSet(false, true)) {
log.debug("Init: {}", mode);
// if the path is null, the consumer has been uninitialized
if (path != null) {
if (log.isDebugEnabled()) {
Path parent = path.getParent();
log.debug("Parent abs: {} dir: {}", parent.isAbsolute(), Files.isDirectory(parent));
}
if (IClientStream.MODE_APPEND.equals(mode)) {
if (Files.notExists(path)) {
throw new IOException("File to be appended doesnt exist, verify the record mode");
}
log.debug("Path: {}\nRead: {} write: {} size: {}", path, Files.isReadable(path), Files.isWritable(path), Files.size(path));
writer = new FLVWriter(path, true);
} else if (IClientStream.MODE_RECORD.equals(mode)) {
try {
// delete existing file
if (Files.deleteIfExists(path)) {
log.debug("File deleted");
}
// ensure parent dirs exist
Files.createDirectories(path.getParent());
// create the file
path = Files.createFile(path);
} catch (IOException ioe) {
log.error("File creation error: {}", ioe);
}
if (!Files.isWritable(path)) {
throw new IOException("File is not writable");
}
log.debug("Path: {}\nRead: {} write: {}", path, Files.isReadable(path), Files.isWritable(path));
writer = new FLVWriter(path, false);
} else {
try {
// delete existing file since we're not recording nor appending
if (Files.deleteIfExists(path)) {
log.debug("File deleted");
}
} catch (IOException ioe) {
log.error("File creation error: {}", ioe);
}
}
} else {
log.warn("Consumer is uninitialized");
}
log.debug("Init - complete");
}
} } | public class class_name {
private void init() throws IOException {
if (initialized.compareAndSet(false, true)) {
log.debug("Init: {}", mode);
// if the path is null, the consumer has been uninitialized
if (path != null) {
if (log.isDebugEnabled()) {
Path parent = path.getParent();
log.debug("Parent abs: {} dir: {}", parent.isAbsolute(), Files.isDirectory(parent));
}
if (IClientStream.MODE_APPEND.equals(mode)) {
if (Files.notExists(path)) {
throw new IOException("File to be appended doesnt exist, verify the record mode");
}
log.debug("Path: {}\nRead: {} write: {} size: {}", path, Files.isReadable(path), Files.isWritable(path), Files.size(path));
writer = new FLVWriter(path, true);
} else if (IClientStream.MODE_RECORD.equals(mode)) {
try {
// delete existing file
if (Files.deleteIfExists(path)) {
log.debug("File deleted");
// depends on control dependency: [if], data = [none]
}
// ensure parent dirs exist
Files.createDirectories(path.getParent());
// depends on control dependency: [try], data = [none]
// create the file
path = Files.createFile(path);
// depends on control dependency: [try], data = [none]
} catch (IOException ioe) {
log.error("File creation error: {}", ioe);
}
// depends on control dependency: [catch], data = [none]
if (!Files.isWritable(path)) {
throw new IOException("File is not writable");
}
log.debug("Path: {}\nRead: {} write: {}", path, Files.isReadable(path), Files.isWritable(path));
writer = new FLVWriter(path, false);
} else {
try {
// delete existing file since we're not recording nor appending
if (Files.deleteIfExists(path)) {
log.debug("File deleted");
// depends on control dependency: [if], data = [none]
}
} catch (IOException ioe) {
log.error("File creation error: {}", ioe);
}
// depends on control dependency: [catch], data = [none]
}
} else {
log.warn("Consumer is uninitialized");
}
log.debug("Init - complete");
}
} } |
public class class_name {
public static Iterable<Range> rangesForInterval(Granularity g, final long from, final long to) {
if (g == Granularity.FULL) {
return Arrays.asList(new Range(from, to));
}
final long snappedStartMillis = g.snapMillis(from);
final long snappedStopMillis = g.snapMillis(to + g.milliseconds());
return new IntervalRangeIterator(g, snappedStartMillis, snappedStopMillis);
} } | public class class_name {
public static Iterable<Range> rangesForInterval(Granularity g, final long from, final long to) {
if (g == Granularity.FULL) {
return Arrays.asList(new Range(from, to)); // depends on control dependency: [if], data = [none]
}
final long snappedStartMillis = g.snapMillis(from);
final long snappedStopMillis = g.snapMillis(to + g.milliseconds());
return new IntervalRangeIterator(g, snappedStartMillis, snappedStopMillis);
} } |
public class class_name {
public static boolean isGeneratedConstructor(MethodTree tree) {
if (!(tree instanceof JCMethodDecl)) {
return false;
}
return (((JCMethodDecl) tree).mods.flags & Flags.GENERATEDCONSTR) == Flags.GENERATEDCONSTR;
} } | public class class_name {
public static boolean isGeneratedConstructor(MethodTree tree) {
if (!(tree instanceof JCMethodDecl)) {
return false; // depends on control dependency: [if], data = [none]
}
return (((JCMethodDecl) tree).mods.flags & Flags.GENERATEDCONSTR) == Flags.GENERATEDCONSTR;
} } |
public class class_name {
private String getFromPIDataPseudoAttribute(String data, String name,
boolean unescapeValue) {
int pos = 0;
while (pos <= data.length() - 4) { // minimum length of x=""
int nextQuote = -1;
for (int q = pos; q < data.length(); q++) {
if (data.charAt(q) == '"' || data.charAt(q) == '\'') {
nextQuote = q;
break;
}
}
if (nextQuote < 0) {
return null;
// if (nextQuote+1 == name.length()) return null;
}
int closingQuote = data.indexOf(data.charAt(nextQuote), nextQuote + 1);
if (closingQuote < 0) {
return null;
}
int nextName = data.indexOf(name, pos);
if (nextName < 0) {
return null;
}
if (nextName < nextQuote) {
// check only spaces and equal signs between the name and the quote
boolean found = true;
for (int s = nextName + name.length(); s < nextQuote; s++) {
char c = data.charAt(s);
if (!Character.isWhitespace(c) && c != '=') {
found = false;
break;
}
}
if (found) {
String val = data.substring(nextQuote + 1, closingQuote);
return unescapeValue ? unescape(val) : val;
}
}
pos = closingQuote + 1;
}
return null;
} } | public class class_name {
private String getFromPIDataPseudoAttribute(String data, String name,
boolean unescapeValue) {
int pos = 0;
while (pos <= data.length() - 4) { // minimum length of x=""
int nextQuote = -1;
for (int q = pos; q < data.length(); q++) {
if (data.charAt(q) == '"' || data.charAt(q) == '\'') {
nextQuote = q; // depends on control dependency: [if], data = [none]
break;
}
}
if (nextQuote < 0) {
return null; // depends on control dependency: [if], data = [none]
// if (nextQuote+1 == name.length()) return null;
}
int closingQuote = data.indexOf(data.charAt(nextQuote), nextQuote + 1);
if (closingQuote < 0) {
return null; // depends on control dependency: [if], data = [none]
}
int nextName = data.indexOf(name, pos);
if (nextName < 0) {
return null; // depends on control dependency: [if], data = [none]
}
if (nextName < nextQuote) {
// check only spaces and equal signs between the name and the quote
boolean found = true;
for (int s = nextName + name.length(); s < nextQuote; s++) {
char c = data.charAt(s);
if (!Character.isWhitespace(c) && c != '=') {
found = false; // depends on control dependency: [if], data = [none]
break;
}
}
if (found) {
String val = data.substring(nextQuote + 1, closingQuote);
return unescapeValue ? unescape(val) : val; // depends on control dependency: [if], data = [none]
}
}
pos = closingQuote + 1; // depends on control dependency: [while], data = [none]
}
return null;
} } |
public class class_name {
public void setVelocity (float x, float y, float z)
{
if (_vx != x || _vy != y || _vz != z) {
AL10.alListener3f(AL10.AL_VELOCITY, _vx = x, _vy = y, _vz = z);
}
} } | public class class_name {
public void setVelocity (float x, float y, float z)
{
if (_vx != x || _vy != y || _vz != z) {
AL10.alListener3f(AL10.AL_VELOCITY, _vx = x, _vy = y, _vz = z); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private void trackNestedMapping(OngoingMappings ongoingMappings) {
for (ResourceModelMetaData metaData : ongoingMappings.getMetaData()) {
metaData.getStatistics().countSubsequentMapping();
}
} } | public class class_name {
private void trackNestedMapping(OngoingMappings ongoingMappings) {
for (ResourceModelMetaData metaData : ongoingMappings.getMetaData()) {
metaData.getStatistics().countSubsequentMapping(); // depends on control dependency: [for], data = [metaData]
}
} } |
public class class_name {
public static List<String> parse(Object target, String[] args) {
List<String> arguments = new ArrayList<String>();
arguments.addAll(Arrays.asList(args));
Class<?> clazz;
if (target instanceof Class) {
clazz = (Class) target;
} else {
clazz = target.getClass();
try {
BeanInfo info = Introspector.getBeanInfo(clazz);
for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
processProperty(target, pd, arguments);
}
} catch (IntrospectionException e) {
// If its not a JavaBean we ignore it
}
}
// Check fields of 'target' class and its superclasses
for (Class<?> currentClazz = clazz; currentClazz != null; currentClazz = currentClazz.getSuperclass()) {
for (Field field : currentClazz.getDeclaredFields()) {
processField(target, field, arguments);
}
}
for (String argument : arguments) {
if (argument.startsWith("-")) {
throw new IllegalArgumentException("Invalid argument: " + argument);
}
}
return arguments;
} } | public class class_name {
public static List<String> parse(Object target, String[] args) {
List<String> arguments = new ArrayList<String>();
arguments.addAll(Arrays.asList(args));
Class<?> clazz;
if (target instanceof Class) {
clazz = (Class) target; // depends on control dependency: [if], data = [none]
} else {
clazz = target.getClass(); // depends on control dependency: [if], data = [none]
try {
BeanInfo info = Introspector.getBeanInfo(clazz);
for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
processProperty(target, pd, arguments); // depends on control dependency: [for], data = [pd]
}
} catch (IntrospectionException e) {
// If its not a JavaBean we ignore it
} // depends on control dependency: [catch], data = [none]
}
// Check fields of 'target' class and its superclasses
for (Class<?> currentClazz = clazz; currentClazz != null; currentClazz = currentClazz.getSuperclass()) {
for (Field field : currentClazz.getDeclaredFields()) {
processField(target, field, arguments); // depends on control dependency: [for], data = [field]
}
}
for (String argument : arguments) {
if (argument.startsWith("-")) {
throw new IllegalArgumentException("Invalid argument: " + argument);
}
}
return arguments;
} } |
public class class_name {
public boolean resetIfNecessary(RateBucketPeriod period) {
long periodBoundary = getLastPeriodBoundary(period);
if (System.currentTimeMillis() >= periodBoundary) {
setCount(0);
return true;
}
return false;
} } | public class class_name {
public boolean resetIfNecessary(RateBucketPeriod period) {
long periodBoundary = getLastPeriodBoundary(period);
if (System.currentTimeMillis() >= periodBoundary) {
setCount(0); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
return false;
} } |
public class class_name {
public List<AssociationRule> learn(double confidence) {
List<AssociationRule> list = new ArrayList<>();
ttree = fim.buildTotalSupportTree();
for (int i = 0; i < ttree.root.children.length; i++) {
if (ttree.root.children[i] != null) {
int[] itemset = {ttree.root.children[i].id};
learn(null, list, itemset, i, ttree.root.children[i], confidence);
}
}
return list;
} } | public class class_name {
public List<AssociationRule> learn(double confidence) {
List<AssociationRule> list = new ArrayList<>();
ttree = fim.buildTotalSupportTree();
for (int i = 0; i < ttree.root.children.length; i++) {
if (ttree.root.children[i] != null) {
int[] itemset = {ttree.root.children[i].id};
learn(null, list, itemset, i, ttree.root.children[i], confidence); // depends on control dependency: [if], data = [none]
}
}
return list;
} } |
public class class_name {
protected ListedHashTree cloneTree(ListedHashTree tree) {
TreeCloner cloner = new TreeCloner(true);
tree.traverse(cloner);
ListedHashTree clonedTree = cloner.getClonedTree();
if (!clonedTree.isEmpty()) {
Object firstElement = clonedTree.getArray()[0];
Controller samplerController = ((AbstractDynamicThreadGroup) firstElement).getSamplerController();
if (samplerController instanceof VirtualUserController) {
assert owner != null;
((VirtualUserController) samplerController).setOwner(owner);
}
}
return clonedTree;
} } | public class class_name {
protected ListedHashTree cloneTree(ListedHashTree tree) {
TreeCloner cloner = new TreeCloner(true);
tree.traverse(cloner);
ListedHashTree clonedTree = cloner.getClonedTree();
if (!clonedTree.isEmpty()) {
Object firstElement = clonedTree.getArray()[0];
Controller samplerController = ((AbstractDynamicThreadGroup) firstElement).getSamplerController();
if (samplerController instanceof VirtualUserController) {
assert owner != null;
((VirtualUserController) samplerController).setOwner(owner); // depends on control dependency: [if], data = [none]
}
}
return clonedTree;
} } |
public class class_name {
private Coordinate[] reduce(Coordinate[] inputPts)
{
//Coordinate[] polyPts = computeQuad(inputPts);
Coordinate[] polyPts = computeOctRing(inputPts);
//Coordinate[] polyPts = null;
// unable to compute interior polygon for some reason
if (polyPts == null)
return inputPts;
// LinearRing ring = geomFactory.createLinearRing(polyPts);
// System.out.println(ring);
// add points defining polygon
TreeSet reducedSet = new TreeSet(Arrays.asList(polyPts));
/**
* Add all unique points not in the interior poly.
* CGAlgorithms.isPointInRing is not defined for points actually on the ring,
* but this doesn't matter since the points of the interior polygon
* are forced to be in the reduced set.
*/
for (Coordinate inputPt : inputPts) {
if (!CGAlgorithms.isPointInRing(inputPt, polyPts)) {
reducedSet.add(inputPt);
}
}
Coordinate[] reducedPts = CoordinateArrays.toCoordinateArray(reducedSet);
// ensure that computed array has at least 3 points (not necessarily unique)
if (reducedPts.length < 3)
return padArray3(reducedPts);
return reducedPts;
} } | public class class_name {
private Coordinate[] reduce(Coordinate[] inputPts)
{
//Coordinate[] polyPts = computeQuad(inputPts);
Coordinate[] polyPts = computeOctRing(inputPts);
//Coordinate[] polyPts = null;
// unable to compute interior polygon for some reason
if (polyPts == null)
return inputPts;
// LinearRing ring = geomFactory.createLinearRing(polyPts);
// System.out.println(ring);
// add points defining polygon
TreeSet reducedSet = new TreeSet(Arrays.asList(polyPts));
/**
* Add all unique points not in the interior poly.
* CGAlgorithms.isPointInRing is not defined for points actually on the ring,
* but this doesn't matter since the points of the interior polygon
* are forced to be in the reduced set.
*/
for (Coordinate inputPt : inputPts) {
if (!CGAlgorithms.isPointInRing(inputPt, polyPts)) {
reducedSet.add(inputPt); // depends on control dependency: [if], data = [none]
}
}
Coordinate[] reducedPts = CoordinateArrays.toCoordinateArray(reducedSet);
// ensure that computed array has at least 3 points (not necessarily unique)
if (reducedPts.length < 3)
return padArray3(reducedPts);
return reducedPts;
} } |
public class class_name {
public void afterACAttach(ActivityContextHandle ach) {
// add to cache
cacheData.attachActivityContext(ach);
// update event mask
Set<EventTypeID> maskedEvents = getSbbComponent().getDescriptor().getDefaultEventMask();
if (maskedEvents != null && !maskedEvents.isEmpty()) {
cacheData.updateEventMask(ach, new HashSet<EventTypeID>(maskedEvents));
}
if (log.isDebugEnabled()) {
log.debug("Sbb entity "+getSbbEntityId()+" attached to AC with handle " + ach
+ " , events added to current mask: " + maskedEvents);
}
} } | public class class_name {
public void afterACAttach(ActivityContextHandle ach) {
// add to cache
cacheData.attachActivityContext(ach);
// update event mask
Set<EventTypeID> maskedEvents = getSbbComponent().getDescriptor().getDefaultEventMask();
if (maskedEvents != null && !maskedEvents.isEmpty()) {
cacheData.updateEventMask(ach, new HashSet<EventTypeID>(maskedEvents)); // depends on control dependency: [if], data = [(maskedEvents]
}
if (log.isDebugEnabled()) {
log.debug("Sbb entity "+getSbbEntityId()+" attached to AC with handle " + ach
+ " , events added to current mask: " + maskedEvents); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public static String getType(Object obj) {
if (obj == null) {
return null;
}
String type = null;
if (obj instanceof String || obj instanceof Integer || obj instanceof Double
|| obj instanceof Boolean) {
type = obj.getClass().getName();
}
return type;
} } | public class class_name {
public static String getType(Object obj) {
if (obj == null) {
return null; // depends on control dependency: [if], data = [none]
}
String type = null;
if (obj instanceof String || obj instanceof Integer || obj instanceof Double
|| obj instanceof Boolean) {
type = obj.getClass().getName(); // depends on control dependency: [if], data = [o]
}
return type;
} } |
public class class_name {
DevAttrHistory[] get_attr_history(int nb, int type)
{
DevAttrHistory[] histo = new DevAttrHistory[nb];
int start = size() - nb;
for(int i=start ; i<size() ; i++)
{
RingElt record = (RingElt)elementAt(i);
boolean attr_failed;
AttributeValue value;
DevError[] errors;
value = record.attr_value;
if (record.except==null)
{
attr_failed = false;
errors = new DevError[0];
}
else
{
attr_failed = true;
errors = record.except.errors;
}
histo[i-start] = new DevAttrHistory(attr_failed, value, errors);
}
return histo;
} } | public class class_name {
DevAttrHistory[] get_attr_history(int nb, int type)
{
DevAttrHistory[] histo = new DevAttrHistory[nb];
int start = size() - nb;
for(int i=start ; i<size() ; i++)
{
RingElt record = (RingElt)elementAt(i);
boolean attr_failed;
AttributeValue value;
DevError[] errors;
value = record.attr_value; // depends on control dependency: [for], data = [none]
if (record.except==null)
{
attr_failed = false; // depends on control dependency: [if], data = [none]
errors = new DevError[0]; // depends on control dependency: [if], data = [none]
}
else
{
attr_failed = true; // depends on control dependency: [if], data = [none]
errors = record.except.errors; // depends on control dependency: [if], data = [none]
}
histo[i-start] = new DevAttrHistory(attr_failed, value, errors); // depends on control dependency: [for], data = [i]
}
return histo;
} } |
public class class_name {
public Integer getAssistedQueryColumnCount(final String logicTableName) {
for (ShardingEncryptorStrategy each : shardingEncryptorStrategies.values()) {
int result = each.getAssistedQueryColumnCount(logicTableName);
if (result > 0) {
return result;
}
}
return 0;
} } | public class class_name {
public Integer getAssistedQueryColumnCount(final String logicTableName) {
for (ShardingEncryptorStrategy each : shardingEncryptorStrategies.values()) {
int result = each.getAssistedQueryColumnCount(logicTableName);
if (result > 0) {
return result; // depends on control dependency: [if], data = [none]
}
}
return 0;
} } |
public class class_name {
public synchronized void updatePath(PropertyChangeListener listener, Object newObject, Set updateSet) {
if (currentObject != newObject) {
removeListeners();
}
if ((children != null) && (children.length > 0)) {
try {
Object newValue = null;
if (newObject != null) {
updateSet.add(newObject);
newValue = extractNewValue(newObject);
}
for (BindPath child : children) {
child.updatePath(listener, newValue, updateSet);
}
} catch (Exception e) {
//LOGME
// do we ignore it, or fail?
}
}
if (currentObject != newObject) {
addListeners(listener, newObject, updateSet);
}
} } | public class class_name {
public synchronized void updatePath(PropertyChangeListener listener, Object newObject, Set updateSet) {
if (currentObject != newObject) {
removeListeners(); // depends on control dependency: [if], data = [none]
}
if ((children != null) && (children.length > 0)) {
try {
Object newValue = null;
if (newObject != null) {
updateSet.add(newObject); // depends on control dependency: [if], data = [(newObject]
newValue = extractNewValue(newObject); // depends on control dependency: [if], data = [(newObject]
}
for (BindPath child : children) {
child.updatePath(listener, newValue, updateSet); // depends on control dependency: [for], data = [child]
}
} catch (Exception e) {
//LOGME
// do we ignore it, or fail?
} // depends on control dependency: [catch], data = [none]
}
if (currentObject != newObject) {
addListeners(listener, newObject, updateSet); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
protected void parse(String icalString, IcalSchema schema)
throws ParseException {
String paramText;
String content;
{
String unfolded = IcalParseUtil.unfoldIcal(icalString);
Matcher m = CONTENT_LINE_RE.matcher(unfolded);
if (!m.matches()) {
schema.badContent(icalString);
}
setName(m.group(1).toUpperCase());
paramText = m.group(2);
if (null == paramText) {
paramText = "";
}
content = m.group(3);
}
// parse parameters
Map<String, String> params = new HashMap<String, String>();
String rest = paramText;
while (!"".equals(rest)) {
Matcher m = PARAM_RE.matcher(rest);
if (!m.find()) {
schema.badPart(rest, null);
}
rest = rest.substring(m.end(0));
String k = m.group(1).toUpperCase();
String v = m.group(2);
if (null == v) {
v = m.group(3);
}
if (params.containsKey(k)) {
schema.dupePart(k);
}
params.put(k, v);
}
// parse the content and individual attribute values
schema.applyObjectSchema(this.name, params, content, this);
} } | public class class_name {
protected void parse(String icalString, IcalSchema schema)
throws ParseException {
String paramText;
String content;
{
String unfolded = IcalParseUtil.unfoldIcal(icalString);
Matcher m = CONTENT_LINE_RE.matcher(unfolded);
if (!m.matches()) {
schema.badContent(icalString); // depends on control dependency: [if], data = [none]
}
setName(m.group(1).toUpperCase());
paramText = m.group(2);
if (null == paramText) {
paramText = ""; // depends on control dependency: [if], data = [none]
}
content = m.group(3);
}
// parse parameters
Map<String, String> params = new HashMap<String, String>();
String rest = paramText;
while (!"".equals(rest)) {
Matcher m = PARAM_RE.matcher(rest);
if (!m.find()) {
schema.badPart(rest, null);
}
rest = rest.substring(m.end(0));
String k = m.group(1).toUpperCase();
String v = m.group(2);
if (null == v) {
v = m.group(3);
}
if (params.containsKey(k)) {
schema.dupePart(k);
}
params.put(k, v);
}
// parse the content and individual attribute values
schema.applyObjectSchema(this.name, params, content, this);
} } |
public class class_name {
public static base_responses add(nitro_service client, appfwxmlcontenttype resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwxmlcontenttype addresources[] = new appfwxmlcontenttype[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new appfwxmlcontenttype();
addresources[i].xmlcontenttypevalue = resources[i].xmlcontenttypevalue;
addresources[i].isregex = resources[i].isregex;
}
result = add_bulk_request(client, addresources);
}
return result;
} } | public class class_name {
public static base_responses add(nitro_service client, appfwxmlcontenttype resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwxmlcontenttype addresources[] = new appfwxmlcontenttype[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new appfwxmlcontenttype(); // depends on control dependency: [for], data = [i]
addresources[i].xmlcontenttypevalue = resources[i].xmlcontenttypevalue; // depends on control dependency: [for], data = [i]
addresources[i].isregex = resources[i].isregex; // depends on control dependency: [for], data = [i]
}
result = add_bulk_request(client, addresources);
}
return result;
} } |
public class class_name {
protected String getVisibilityFlag() {
CmsModule module = OpenCms.getModuleManager().getModule(this.getClass().getPackage().getName());
if (module == null) {
return VISIBILITY_ALL;
}
return module.getParameter(PARAM_VISIBILITY_FLAG, VISIBILITY_ALL);
} } | public class class_name {
protected String getVisibilityFlag() {
CmsModule module = OpenCms.getModuleManager().getModule(this.getClass().getPackage().getName());
if (module == null) {
return VISIBILITY_ALL; // depends on control dependency: [if], data = [none]
}
return module.getParameter(PARAM_VISIBILITY_FLAG, VISIBILITY_ALL);
} } |
public class class_name {
public static void main(String args[]) {
Statement stmts[] = null;
try {
stmts = getStatements(args[0]);
} catch (Throwable e) {
System.out.println(e.getMessage());
return;
}
for (Statement s : stmts) {
System.out.print(s.statement);
}
} } | public class class_name {
public static void main(String args[]) {
Statement stmts[] = null;
try {
stmts = getStatements(args[0]); // depends on control dependency: [try], data = [none]
} catch (Throwable e) {
System.out.println(e.getMessage());
return;
} // depends on control dependency: [catch], data = [none]
for (Statement s : stmts) {
System.out.print(s.statement); // depends on control dependency: [for], data = [s]
}
} } |
public class class_name {
public static <T extends Enum> T getExtension(SlingHttpServletRequest request, T defaultValue) {
String extension = request.getRequestPathInfo().getExtension();
if (extension != null) {
Class type = defaultValue.getClass();
try {
T value = (T) T.valueOf(type, extension.toLowerCase());
return value;
} catch (IllegalArgumentException iaex) {
// ok, use default
}
}
return defaultValue;
} } | public class class_name {
public static <T extends Enum> T getExtension(SlingHttpServletRequest request, T defaultValue) {
String extension = request.getRequestPathInfo().getExtension();
if (extension != null) {
Class type = defaultValue.getClass();
try {
T value = (T) T.valueOf(type, extension.toLowerCase());
return value; // depends on control dependency: [try], data = [none]
} catch (IllegalArgumentException iaex) {
// ok, use default
} // depends on control dependency: [catch], data = [none]
}
return defaultValue;
} } |
public class class_name {
@Trivial
private String validateNotification(Collection<?> added, Collection<?> removed, Collection<?> updated) {
boolean isAddition = !added.isEmpty();
boolean isRemoval = !removed.isEmpty();
boolean isUpdate = !updated.isEmpty();
if ( !isAddition && !isRemoval && !isUpdate ) {
// Should never occur:
// Completely null changes are detected and cause an early return
// before reaching the validation method.
return "null";
} else if ( isAddition ) {
return "Addition of [ " + added.toString() + " ]";
} else if ( isUpdate && isRemoval ) {
return "Update of [ " + updated.toString() + " ]" +
" with removal of [ " + removed.toString() + " ]";
} else {
return null;
}
} } | public class class_name {
@Trivial
private String validateNotification(Collection<?> added, Collection<?> removed, Collection<?> updated) {
boolean isAddition = !added.isEmpty();
boolean isRemoval = !removed.isEmpty();
boolean isUpdate = !updated.isEmpty();
if ( !isAddition && !isRemoval && !isUpdate ) {
// Should never occur:
// Completely null changes are detected and cause an early return
// before reaching the validation method.
return "null"; // depends on control dependency: [if], data = [none]
} else if ( isAddition ) {
return "Addition of [ " + added.toString() + " ]"; // depends on control dependency: [if], data = [none]
} else if ( isUpdate && isRemoval ) {
return "Update of [ " + updated.toString() + " ]" +
" with removal of [ " + removed.toString() + " ]"; // depends on control dependency: [if], data = [none]
} else {
return null; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public final EObject ruleJvmParameterizedTypeReference() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_3=null;
Token otherlv_5=null;
Token otherlv_7=null;
Token otherlv_9=null;
Token otherlv_11=null;
Token otherlv_13=null;
EObject lv_arguments_2_0 = null;
EObject lv_arguments_4_0 = null;
EObject lv_arguments_10_0 = null;
EObject lv_arguments_12_0 = null;
enterRule();
try {
// InternalXtype.g:270:2: ( ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? ) )
// InternalXtype.g:271:2: ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? )
{
// InternalXtype.g:271:2: ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? )
// InternalXtype.g:272:3: ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )?
{
// InternalXtype.g:272:3: ( ( ruleQualifiedName ) )
// InternalXtype.g:273:4: ( ruleQualifiedName )
{
// InternalXtype.g:273:4: ( ruleQualifiedName )
// InternalXtype.g:274:5: ruleQualifiedName
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getJvmParameterizedTypeReferenceRule());
}
}
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getTypeJvmTypeCrossReference_0_0());
}
pushFollow(FOLLOW_9);
ruleQualifiedName();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
afterParserOrEnumRuleCall();
}
}
}
// InternalXtype.g:288:3: ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )?
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==16) && (synpred2_InternalXtype())) {
alt10=1;
}
switch (alt10) {
case 1 :
// InternalXtype.g:289:4: ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )*
{
// InternalXtype.g:289:4: ( ( '<' )=>otherlv_1= '<' )
// InternalXtype.g:290:5: ( '<' )=>otherlv_1= '<'
{
otherlv_1=(Token)match(input,16,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getJvmParameterizedTypeReferenceAccess().getLessThanSignKeyword_1_0());
}
}
// InternalXtype.g:296:4: ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) )
// InternalXtype.g:297:5: (lv_arguments_2_0= ruleJvmArgumentTypeReference )
{
// InternalXtype.g:297:5: (lv_arguments_2_0= ruleJvmArgumentTypeReference )
// InternalXtype.g:298:6: lv_arguments_2_0= ruleJvmArgumentTypeReference
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_1_0());
}
pushFollow(FOLLOW_11);
lv_arguments_2_0=ruleJvmArgumentTypeReference();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule());
}
add(
current,
"arguments",
lv_arguments_2_0,
"org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference");
afterParserOrEnumRuleCall();
}
}
}
// InternalXtype.g:315:4: (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )*
loop6:
do {
int alt6=2;
int LA6_0 = input.LA(1);
if ( (LA6_0==13) ) {
alt6=1;
}
switch (alt6) {
case 1 :
// InternalXtype.g:316:5: otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) )
{
otherlv_3=(Token)match(input,13,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_2_0());
}
// InternalXtype.g:320:5: ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) )
// InternalXtype.g:321:6: (lv_arguments_4_0= ruleJvmArgumentTypeReference )
{
// InternalXtype.g:321:6: (lv_arguments_4_0= ruleJvmArgumentTypeReference )
// InternalXtype.g:322:7: lv_arguments_4_0= ruleJvmArgumentTypeReference
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_2_1_0());
}
pushFollow(FOLLOW_11);
lv_arguments_4_0=ruleJvmArgumentTypeReference();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule());
}
add(
current,
"arguments",
lv_arguments_4_0,
"org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop6;
}
} while (true);
otherlv_5=(Token)match(input,17,FOLLOW_12); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getJvmParameterizedTypeReferenceAccess().getGreaterThanSignKeyword_1_3());
}
// InternalXtype.g:344:4: ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )*
loop9:
do {
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0==18) && (synpred3_InternalXtype())) {
alt9=1;
}
switch (alt9) {
case 1 :
// InternalXtype.g:345:5: ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )?
{
// InternalXtype.g:345:5: ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) )
// InternalXtype.g:346:6: ( ( () '.' ) )=> ( () otherlv_7= '.' )
{
// InternalXtype.g:352:6: ( () otherlv_7= '.' )
// InternalXtype.g:353:7: () otherlv_7= '.'
{
// InternalXtype.g:353:7: ()
// InternalXtype.g:354:8:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getJvmParameterizedTypeReferenceAccess().getJvmInnerTypeReferenceOuterAction_1_4_0_0_0(),
current);
}
}
otherlv_7=(Token)match(input,18,FOLLOW_13); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_7, grammarAccess.getJvmParameterizedTypeReferenceAccess().getFullStopKeyword_1_4_0_0_1());
}
}
}
// InternalXtype.g:366:5: ( ( ruleValidID ) )
// InternalXtype.g:367:6: ( ruleValidID )
{
// InternalXtype.g:367:6: ( ruleValidID )
// InternalXtype.g:368:7: ruleValidID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getJvmParameterizedTypeReferenceRule());
}
}
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getTypeJvmTypeCrossReference_1_4_1_0());
}
pushFollow(FOLLOW_14);
ruleValidID();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
afterParserOrEnumRuleCall();
}
}
}
// InternalXtype.g:382:5: ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )?
int alt8=2;
int LA8_0 = input.LA(1);
if ( (LA8_0==16) && (synpred4_InternalXtype())) {
alt8=1;
}
switch (alt8) {
case 1 :
// InternalXtype.g:383:6: ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>'
{
// InternalXtype.g:383:6: ( ( '<' )=>otherlv_9= '<' )
// InternalXtype.g:384:7: ( '<' )=>otherlv_9= '<'
{
otherlv_9=(Token)match(input,16,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_9, grammarAccess.getJvmParameterizedTypeReferenceAccess().getLessThanSignKeyword_1_4_2_0());
}
}
// InternalXtype.g:390:6: ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) )
// InternalXtype.g:391:7: (lv_arguments_10_0= ruleJvmArgumentTypeReference )
{
// InternalXtype.g:391:7: (lv_arguments_10_0= ruleJvmArgumentTypeReference )
// InternalXtype.g:392:8: lv_arguments_10_0= ruleJvmArgumentTypeReference
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_1_0());
}
pushFollow(FOLLOW_11);
lv_arguments_10_0=ruleJvmArgumentTypeReference();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule());
}
add(
current,
"arguments",
lv_arguments_10_0,
"org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference");
afterParserOrEnumRuleCall();
}
}
}
// InternalXtype.g:409:6: (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )*
loop7:
do {
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==13) ) {
alt7=1;
}
switch (alt7) {
case 1 :
// InternalXtype.g:410:7: otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) )
{
otherlv_11=(Token)match(input,13,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_11, grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_4_2_2_0());
}
// InternalXtype.g:414:7: ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) )
// InternalXtype.g:415:8: (lv_arguments_12_0= ruleJvmArgumentTypeReference )
{
// InternalXtype.g:415:8: (lv_arguments_12_0= ruleJvmArgumentTypeReference )
// InternalXtype.g:416:9: lv_arguments_12_0= ruleJvmArgumentTypeReference
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_2_1_0());
}
pushFollow(FOLLOW_11);
lv_arguments_12_0=ruleJvmArgumentTypeReference();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule());
}
add(
current,
"arguments",
lv_arguments_12_0,
"org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference");
afterParserOrEnumRuleCall();
}
}
}
}
break;
default :
break loop7;
}
} while (true);
otherlv_13=(Token)match(input,17,FOLLOW_12); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_13, grammarAccess.getJvmParameterizedTypeReferenceAccess().getGreaterThanSignKeyword_1_4_2_3());
}
}
break;
}
}
break;
default :
break loop9;
}
} while (true);
}
break;
}
}
}
if ( state.backtracking==0 ) {
leaveRule();
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} } | public class class_name {
public final EObject ruleJvmParameterizedTypeReference() throws RecognitionException {
EObject current = null;
Token otherlv_1=null;
Token otherlv_3=null;
Token otherlv_5=null;
Token otherlv_7=null;
Token otherlv_9=null;
Token otherlv_11=null;
Token otherlv_13=null;
EObject lv_arguments_2_0 = null;
EObject lv_arguments_4_0 = null;
EObject lv_arguments_10_0 = null;
EObject lv_arguments_12_0 = null;
enterRule();
try {
// InternalXtype.g:270:2: ( ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? ) )
// InternalXtype.g:271:2: ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? )
{
// InternalXtype.g:271:2: ( ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )? )
// InternalXtype.g:272:3: ( ( ruleQualifiedName ) ) ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )?
{
// InternalXtype.g:272:3: ( ( ruleQualifiedName ) )
// InternalXtype.g:273:4: ( ruleQualifiedName )
{
// InternalXtype.g:273:4: ( ruleQualifiedName )
// InternalXtype.g:274:5: ruleQualifiedName
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getJvmParameterizedTypeReferenceRule()); // depends on control dependency: [if], data = [none]
}
}
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getTypeJvmTypeCrossReference_0_0()); // depends on control dependency: [if], data = [none]
}
pushFollow(FOLLOW_9);
ruleQualifiedName();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none]
}
}
}
// InternalXtype.g:288:3: ( ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )* )?
int alt10=2;
int LA10_0 = input.LA(1);
if ( (LA10_0==16) && (synpred2_InternalXtype())) {
alt10=1; // depends on control dependency: [if], data = [none]
}
switch (alt10) {
case 1 :
// InternalXtype.g:289:4: ( ( '<' )=>otherlv_1= '<' ) ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) ) (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )* otherlv_5= '>' ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )*
{
// InternalXtype.g:289:4: ( ( '<' )=>otherlv_1= '<' )
// InternalXtype.g:290:5: ( '<' )=>otherlv_1= '<'
{
otherlv_1=(Token)match(input,16,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_1, grammarAccess.getJvmParameterizedTypeReferenceAccess().getLessThanSignKeyword_1_0()); // depends on control dependency: [if], data = [none]
}
}
// InternalXtype.g:296:4: ( (lv_arguments_2_0= ruleJvmArgumentTypeReference ) )
// InternalXtype.g:297:5: (lv_arguments_2_0= ruleJvmArgumentTypeReference )
{
// InternalXtype.g:297:5: (lv_arguments_2_0= ruleJvmArgumentTypeReference )
// InternalXtype.g:298:6: lv_arguments_2_0= ruleJvmArgumentTypeReference
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_1_0()); // depends on control dependency: [if], data = [none]
}
pushFollow(FOLLOW_11);
lv_arguments_2_0=ruleJvmArgumentTypeReference();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); // depends on control dependency: [if], data = [none]
}
add(
current,
"arguments",
lv_arguments_2_0,
"org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); // depends on control dependency: [if], data = [none]
afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none]
}
}
}
// InternalXtype.g:315:4: (otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) ) )*
loop6:
do {
int alt6=2;
int LA6_0 = input.LA(1);
if ( (LA6_0==13) ) {
alt6=1; // depends on control dependency: [if], data = [none]
}
switch (alt6) {
case 1 :
// InternalXtype.g:316:5: otherlv_3= ',' ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) )
{
otherlv_3=(Token)match(input,13,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_3, grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_2_0()); // depends on control dependency: [if], data = [none]
}
// InternalXtype.g:320:5: ( (lv_arguments_4_0= ruleJvmArgumentTypeReference ) )
// InternalXtype.g:321:6: (lv_arguments_4_0= ruleJvmArgumentTypeReference )
{
// InternalXtype.g:321:6: (lv_arguments_4_0= ruleJvmArgumentTypeReference )
// InternalXtype.g:322:7: lv_arguments_4_0= ruleJvmArgumentTypeReference
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_2_1_0()); // depends on control dependency: [if], data = [none]
}
pushFollow(FOLLOW_11);
lv_arguments_4_0=ruleJvmArgumentTypeReference();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); // depends on control dependency: [if], data = [none]
}
add(
current,
"arguments",
lv_arguments_4_0,
"org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); // depends on control dependency: [if], data = [none]
afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none]
}
}
}
}
break;
default :
break loop6;
}
} while (true);
otherlv_5=(Token)match(input,17,FOLLOW_12); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_5, grammarAccess.getJvmParameterizedTypeReferenceAccess().getGreaterThanSignKeyword_1_3()); // depends on control dependency: [if], data = [none]
}
// InternalXtype.g:344:4: ( ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )? )*
loop9:
do {
int alt9=2;
int LA9_0 = input.LA(1);
if ( (LA9_0==18) && (synpred3_InternalXtype())) {
alt9=1; // depends on control dependency: [if], data = [none]
}
switch (alt9) {
case 1 :
// InternalXtype.g:345:5: ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) ) ( ( ruleValidID ) ) ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )?
{
// InternalXtype.g:345:5: ( ( ( () '.' ) )=> ( () otherlv_7= '.' ) )
// InternalXtype.g:346:6: ( ( () '.' ) )=> ( () otherlv_7= '.' )
{
// InternalXtype.g:352:6: ( () otherlv_7= '.' )
// InternalXtype.g:353:7: () otherlv_7= '.'
{
// InternalXtype.g:353:7: ()
// InternalXtype.g:354:8:
{
if ( state.backtracking==0 ) {
current = forceCreateModelElementAndSet(
grammarAccess.getJvmParameterizedTypeReferenceAccess().getJvmInnerTypeReferenceOuterAction_1_4_0_0_0(),
current); // depends on control dependency: [if], data = [none]
}
}
otherlv_7=(Token)match(input,18,FOLLOW_13); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_7, grammarAccess.getJvmParameterizedTypeReferenceAccess().getFullStopKeyword_1_4_0_0_1()); // depends on control dependency: [if], data = [none]
}
}
}
// InternalXtype.g:366:5: ( ( ruleValidID ) )
// InternalXtype.g:367:6: ( ruleValidID )
{
// InternalXtype.g:367:6: ( ruleValidID )
// InternalXtype.g:368:7: ruleValidID
{
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElement(grammarAccess.getJvmParameterizedTypeReferenceRule()); // depends on control dependency: [if], data = [none]
}
}
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getTypeJvmTypeCrossReference_1_4_1_0()); // depends on control dependency: [if], data = [none]
}
pushFollow(FOLLOW_14);
ruleValidID();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none]
}
}
}
// InternalXtype.g:382:5: ( ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>' )?
int alt8=2;
int LA8_0 = input.LA(1);
if ( (LA8_0==16) && (synpred4_InternalXtype())) {
alt8=1; // depends on control dependency: [if], data = [none]
}
switch (alt8) {
case 1 :
// InternalXtype.g:383:6: ( ( '<' )=>otherlv_9= '<' ) ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) ) (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )* otherlv_13= '>'
{
// InternalXtype.g:383:6: ( ( '<' )=>otherlv_9= '<' )
// InternalXtype.g:384:7: ( '<' )=>otherlv_9= '<'
{
otherlv_9=(Token)match(input,16,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_9, grammarAccess.getJvmParameterizedTypeReferenceAccess().getLessThanSignKeyword_1_4_2_0()); // depends on control dependency: [if], data = [none]
}
}
// InternalXtype.g:390:6: ( (lv_arguments_10_0= ruleJvmArgumentTypeReference ) )
// InternalXtype.g:391:7: (lv_arguments_10_0= ruleJvmArgumentTypeReference )
{
// InternalXtype.g:391:7: (lv_arguments_10_0= ruleJvmArgumentTypeReference )
// InternalXtype.g:392:8: lv_arguments_10_0= ruleJvmArgumentTypeReference
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_1_0()); // depends on control dependency: [if], data = [none]
}
pushFollow(FOLLOW_11);
lv_arguments_10_0=ruleJvmArgumentTypeReference();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); // depends on control dependency: [if], data = [none]
}
add(
current,
"arguments",
lv_arguments_10_0,
"org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); // depends on control dependency: [if], data = [none]
afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none]
}
}
}
// InternalXtype.g:409:6: (otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) ) )*
loop7:
do {
int alt7=2;
int LA7_0 = input.LA(1);
if ( (LA7_0==13) ) {
alt7=1; // depends on control dependency: [if], data = [none]
}
switch (alt7) {
case 1 :
// InternalXtype.g:410:7: otherlv_11= ',' ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) )
{
otherlv_11=(Token)match(input,13,FOLLOW_10); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_11, grammarAccess.getJvmParameterizedTypeReferenceAccess().getCommaKeyword_1_4_2_2_0()); // depends on control dependency: [if], data = [none]
}
// InternalXtype.g:414:7: ( (lv_arguments_12_0= ruleJvmArgumentTypeReference ) )
// InternalXtype.g:415:8: (lv_arguments_12_0= ruleJvmArgumentTypeReference )
{
// InternalXtype.g:415:8: (lv_arguments_12_0= ruleJvmArgumentTypeReference )
// InternalXtype.g:416:9: lv_arguments_12_0= ruleJvmArgumentTypeReference
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getJvmParameterizedTypeReferenceAccess().getArgumentsJvmArgumentTypeReferenceParserRuleCall_1_4_2_2_1_0()); // depends on control dependency: [if], data = [none]
}
pushFollow(FOLLOW_11);
lv_arguments_12_0=ruleJvmArgumentTypeReference();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
if (current==null) {
current = createModelElementForParent(grammarAccess.getJvmParameterizedTypeReferenceRule()); // depends on control dependency: [if], data = [none]
}
add(
current,
"arguments",
lv_arguments_12_0,
"org.eclipse.xtext.xbase.Xtype.JvmArgumentTypeReference"); // depends on control dependency: [if], data = [none]
afterParserOrEnumRuleCall(); // depends on control dependency: [if], data = [none]
}
}
}
}
break;
default :
break loop7;
}
} while (true);
otherlv_13=(Token)match(input,17,FOLLOW_12); if (state.failed) return current;
if ( state.backtracking==0 ) {
newLeafNode(otherlv_13, grammarAccess.getJvmParameterizedTypeReferenceAccess().getGreaterThanSignKeyword_1_4_2_3()); // depends on control dependency: [if], data = [none]
}
}
break;
}
}
break;
default :
break loop9;
}
} while (true);
}
break;
}
}
}
if ( state.backtracking==0 ) {
leaveRule(); // depends on control dependency: [if], data = [none]
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} } |
public class class_name {
private static DependencyHintsInfo getPortableExecutableHints(String filename) {
DependencyHintsInfo hints = null;
try {
// parse PE (Portable Executable) file
PE pe = PEParser.parse(filename);
ResourceDirectory rd = pe.getImageData().getResourceTable();
ResourceEntry[] entries = ResourceHelper.findResources(rd, ResourceType.VERSION_INFO);
byte[] data = entries[0].getData();
VersionInfo version = ResourceParser.readVersionInfo(data);
StringFileInfo stringFileInfo = version.getStringFileInfo();
StringTable table = stringFileInfo.getTable(0);
// collect general details
hints = new DependencyHintsInfo();
for (int i = 0; i < table.getCount(); i++) {
String value = table.getString(i).getValue();
if (StringUtils.isNotBlank(value) && !value.equals(MISSING_VALUE)) {
switch (table.getString(i).getKey()) {
case COMPANY_NAME:
hints.setCompanyName(value);
break;
case FILE_VERSION:
hints.setFileVersion(value);
break;
case COPYRIGHT:
hints.setCopyright(value);
break;
case ORIGINAL_FILE_NAME:
hints.setOriginalFilename(value);
break;
case PRODUCT_NAME:
hints.setProductName(value);
break;
case PRODUCT_VERSION:
hints.setProductVersion(value);
break;
default: break;
}
}
}
if (Platform.isWindows()) {
hints.setIssuerCommonName(executePowerShellCommand(MessageFormat.format(AUTH_CODE_SIGNATURE_ISSUER_PATTERN, filename)));
hints.setSubjectCommonName(executePowerShellCommand(MessageFormat.format(AUTH_CODE_SIGNATURE_SUBJECT_PATTERN, filename)));
}
// TODO handle msi
} catch (Exception e) {
// do nothing
}
return hints;
} } | public class class_name {
private static DependencyHintsInfo getPortableExecutableHints(String filename) {
DependencyHintsInfo hints = null;
try {
// parse PE (Portable Executable) file
PE pe = PEParser.parse(filename);
ResourceDirectory rd = pe.getImageData().getResourceTable();
ResourceEntry[] entries = ResourceHelper.findResources(rd, ResourceType.VERSION_INFO);
byte[] data = entries[0].getData();
VersionInfo version = ResourceParser.readVersionInfo(data);
StringFileInfo stringFileInfo = version.getStringFileInfo();
StringTable table = stringFileInfo.getTable(0);
// collect general details
hints = new DependencyHintsInfo(); // depends on control dependency: [try], data = [none]
for (int i = 0; i < table.getCount(); i++) {
String value = table.getString(i).getValue();
if (StringUtils.isNotBlank(value) && !value.equals(MISSING_VALUE)) {
switch (table.getString(i).getKey()) {
case COMPANY_NAME:
hints.setCompanyName(value);
break;
case FILE_VERSION:
hints.setFileVersion(value);
break;
case COPYRIGHT:
hints.setCopyright(value);
break;
case ORIGINAL_FILE_NAME:
hints.setOriginalFilename(value);
break;
case PRODUCT_NAME:
hints.setProductName(value);
break;
case PRODUCT_VERSION:
hints.setProductVersion(value);
break;
default: break;
}
}
}
if (Platform.isWindows()) {
hints.setIssuerCommonName(executePowerShellCommand(MessageFormat.format(AUTH_CODE_SIGNATURE_ISSUER_PATTERN, filename))); // depends on control dependency: [if], data = [none]
hints.setSubjectCommonName(executePowerShellCommand(MessageFormat.format(AUTH_CODE_SIGNATURE_SUBJECT_PATTERN, filename))); // depends on control dependency: [if], data = [none]
}
// TODO handle msi
} catch (Exception e) {
// do nothing
} // depends on control dependency: [catch], data = [none]
return hints;
} } |
public class class_name {
private static EigenPair[] processDecomposition(EigenvalueDecomposition evd) {
double[] eigenvalues = evd.getRealEigenvalues();
double[][] eigenvectors = evd.getV();
EigenPair[] eigenPairs = new EigenPair[eigenvalues.length];
for(int i = 0; i < eigenvalues.length; i++) {
double e = Math.abs(eigenvalues[i]);
double[] v = VMath.getCol(eigenvectors, i);
eigenPairs[i] = new EigenPair(v, e);
}
Arrays.sort(eigenPairs, Comparator.reverseOrder());
return eigenPairs;
} } | public class class_name {
private static EigenPair[] processDecomposition(EigenvalueDecomposition evd) {
double[] eigenvalues = evd.getRealEigenvalues();
double[][] eigenvectors = evd.getV();
EigenPair[] eigenPairs = new EigenPair[eigenvalues.length];
for(int i = 0; i < eigenvalues.length; i++) {
double e = Math.abs(eigenvalues[i]);
double[] v = VMath.getCol(eigenvectors, i);
eigenPairs[i] = new EigenPair(v, e); // depends on control dependency: [for], data = [i]
}
Arrays.sort(eigenPairs, Comparator.reverseOrder());
return eigenPairs;
} } |
public class class_name {
public Stack withStorageConnectors(StorageConnector... storageConnectors) {
if (this.storageConnectors == null) {
setStorageConnectors(new java.util.ArrayList<StorageConnector>(storageConnectors.length));
}
for (StorageConnector ele : storageConnectors) {
this.storageConnectors.add(ele);
}
return this;
} } | public class class_name {
public Stack withStorageConnectors(StorageConnector... storageConnectors) {
if (this.storageConnectors == null) {
setStorageConnectors(new java.util.ArrayList<StorageConnector>(storageConnectors.length)); // depends on control dependency: [if], data = [none]
}
for (StorageConnector ele : storageConnectors) {
this.storageConnectors.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
public Map<String, String> querycontractBuild() {
Map<String, String> map = new HashMap<String, String>();
map.put("appid", getAppId());
map.put("mch_id", getMchId());
if (StrKit.notBlank(getPlanId())) {
map.put("plan_id", getPlanId());
map.put("contract_code", getContractCode());
} else {
map.put("contract_id", getContractId());
}
map.put("version", getVersion());
map.put("sign", PaymentKit.createSign(map, getPaternerKey()));
return map;
} } | public class class_name {
public Map<String, String> querycontractBuild() {
Map<String, String> map = new HashMap<String, String>();
map.put("appid", getAppId());
map.put("mch_id", getMchId());
if (StrKit.notBlank(getPlanId())) {
map.put("plan_id", getPlanId()); // depends on control dependency: [if], data = [none]
map.put("contract_code", getContractCode()); // depends on control dependency: [if], data = [none]
} else {
map.put("contract_id", getContractId()); // depends on control dependency: [if], data = [none]
}
map.put("version", getVersion());
map.put("sign", PaymentKit.createSign(map, getPaternerKey()));
return map;
} } |
public class class_name {
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMultiRoleMetricDefinitionsNextWithServiceResponseAsync(final String nextPageLink) {
return listMultiRoleMetricDefinitionsNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<ResourceMetricDefinitionInner>>, Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> call(ServiceResponse<Page<ResourceMetricDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listMultiRoleMetricDefinitionsNextWithServiceResponseAsync(nextPageLink));
}
});
} } | public class class_name {
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMultiRoleMetricDefinitionsNextWithServiceResponseAsync(final String nextPageLink) {
return listMultiRoleMetricDefinitionsNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<ResourceMetricDefinitionInner>>, Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> call(ServiceResponse<Page<ResourceMetricDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page); // depends on control dependency: [if], data = [none]
}
return Observable.just(page).concatWith(listMultiRoleMetricDefinitionsNextWithServiceResponseAsync(nextPageLink));
}
});
} } |
public class class_name {
public void marshall(ListAppsRequest listAppsRequest, ProtocolMarshaller protocolMarshaller) {
if (listAppsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listAppsRequest.getAppIds(), APPIDS_BINDING);
protocolMarshaller.marshall(listAppsRequest.getNextToken(), NEXTTOKEN_BINDING);
protocolMarshaller.marshall(listAppsRequest.getMaxResults(), MAXRESULTS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(ListAppsRequest listAppsRequest, ProtocolMarshaller protocolMarshaller) {
if (listAppsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listAppsRequest.getAppIds(), APPIDS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listAppsRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listAppsRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
private void addPadding()
{
int len = BLOCK_LENGTH - bufferLen;
if (len < 9) {
len += BLOCK_LENGTH;
}
byte[] buf = new byte[len];
buf[0] = (byte) 0x80;
for (int i = 1; i < len - 8; i++) {
buf[i] = (byte) 0x00;
}
counter = (counter + (long) bufferLen) * 8L;
LittleEndian.encode(counter, buf, len - 8);
update(buf);
} } | public class class_name {
private void addPadding()
{
int len = BLOCK_LENGTH - bufferLen;
if (len < 9) {
len += BLOCK_LENGTH; // depends on control dependency: [if], data = [none]
}
byte[] buf = new byte[len];
buf[0] = (byte) 0x80;
for (int i = 1; i < len - 8; i++) {
buf[i] = (byte) 0x00; // depends on control dependency: [for], data = [i]
}
counter = (counter + (long) bufferLen) * 8L;
LittleEndian.encode(counter, buf, len - 8);
update(buf);
} } |
public class class_name {
public void error(VirtualConnection vc, TCPReadRequestContext rsc, IOException ioe) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "error() called: vc=" + vc + " ioe=" + ioe);
}
HttpOutboundServiceContextImpl osc = (HttpOutboundServiceContextImpl) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPOSC);
if (osc.markReadCancelSuccess()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Ignoring error callback on canceled read");
}
return;
}
int state;
// query/set the states in one block to avoid timing windows
synchronized (osc.stateSyncObject) {
state = osc.getReadState();
osc.setCallbackState(HttpOutboundServiceContextImpl.CALLBACK_STATE_ERROR, ioe);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Read-ahead state: " + state);
}
switch (state) {
case (HttpOutboundServiceContextImpl.READ_STATE_IDLE):
// new connection hasn't started yet, notify app channel now
osc.getAppReadCallback().error(vc, ioe);
break;
case (HttpOutboundServiceContextImpl.READ_STATE_TIME_RESET):
// new conn has been initialized but the read for response hasn't
// been started yet
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Received the read-ahead immed timeout.");
}
break;
case (HttpOutboundServiceContextImpl.READ_STATE_SYNC):
// d264854: no longer possible
// a synchronous read for the response has been started already
osc.wakeupReadAhead();
break;
case (HttpOutboundServiceContextImpl.READ_STATE_ASYNC):
// d264854: no longer possible
// an async read for the response has been started already
osc.setPersistent(false);
osc.reConnect(vc, ioe);
break;
default:
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Unexpected read-ahead state: " + state);
}
break;
}
} } | public class class_name {
public void error(VirtualConnection vc, TCPReadRequestContext rsc, IOException ioe) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "error() called: vc=" + vc + " ioe=" + ioe); // depends on control dependency: [if], data = [none]
}
HttpOutboundServiceContextImpl osc = (HttpOutboundServiceContextImpl) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPOSC);
if (osc.markReadCancelSuccess()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Ignoring error callback on canceled read"); // depends on control dependency: [if], data = [none]
}
return; // depends on control dependency: [if], data = [none]
}
int state;
// query/set the states in one block to avoid timing windows
synchronized (osc.stateSyncObject) {
state = osc.getReadState();
osc.setCallbackState(HttpOutboundServiceContextImpl.CALLBACK_STATE_ERROR, ioe);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Read-ahead state: " + state); // depends on control dependency: [if], data = [none]
}
switch (state) {
case (HttpOutboundServiceContextImpl.READ_STATE_IDLE):
// new connection hasn't started yet, notify app channel now
osc.getAppReadCallback().error(vc, ioe);
break;
case (HttpOutboundServiceContextImpl.READ_STATE_TIME_RESET):
// new conn has been initialized but the read for response hasn't
// been started yet
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Received the read-ahead immed timeout."); // depends on control dependency: [if], data = [none]
}
break;
case (HttpOutboundServiceContextImpl.READ_STATE_SYNC):
// d264854: no longer possible
// a synchronous read for the response has been started already
osc.wakeupReadAhead();
break;
case (HttpOutboundServiceContextImpl.READ_STATE_ASYNC):
// d264854: no longer possible
// an async read for the response has been started already
osc.setPersistent(false);
osc.reConnect(vc, ioe);
break;
default:
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Unexpected read-ahead state: " + state); // depends on control dependency: [if], data = [none]
}
break;
}
} } |
public class class_name {
private static String getOverlaySpan(String cssClass, String title) {
StringBuffer result = new StringBuffer();
result.append("<span class=\"").append(cssClass).append("\"");
if (title != null) {
result.append(" title=\"").append(title).append("\"");
}
result.append("></span>");
return result.toString();
} } | public class class_name {
private static String getOverlaySpan(String cssClass, String title) {
StringBuffer result = new StringBuffer();
result.append("<span class=\"").append(cssClass).append("\"");
if (title != null) {
result.append(" title=\"").append(title).append("\""); // depends on control dependency: [if], data = [(title]
}
result.append("></span>");
return result.toString();
} } |
public class class_name {
public ClassNode makeArray() {
if (redirect!=null) {
ClassNode res = redirect().makeArray();
res.componentType = this;
return res;
}
ClassNode cn;
if (clazz!=null) {
Class ret = Array.newInstance(clazz,0).getClass();
// don't use the ClassHelper here!
cn = new ClassNode(ret,this);
} else {
cn = new ClassNode(this);
}
return cn;
} } | public class class_name {
public ClassNode makeArray() {
if (redirect!=null) {
ClassNode res = redirect().makeArray();
res.componentType = this; // depends on control dependency: [if], data = [none]
return res; // depends on control dependency: [if], data = [none]
}
ClassNode cn;
if (clazz!=null) {
Class ret = Array.newInstance(clazz,0).getClass();
// don't use the ClassHelper here!
cn = new ClassNode(ret,this); // depends on control dependency: [if], data = [none]
} else {
cn = new ClassNode(this); // depends on control dependency: [if], data = [none]
}
return cn;
} } |
public class class_name {
public Event[] getEvents(boolean evalMode) {
ArrayList elist = new ArrayList();
//int numMatches;
//Set frequent;
/*
if(!evalMode) {
//System.out.println("Reading in all the data");
try {
StringBuffer sb = new StringBuffer();
for(String s = br.readLine(); s!=null; s=br.readLine())
sb.append(s+"\n");
//System.out.println("Getting most frequent words");
frequent =
getFrequent(new BufferedReader(
new StringReader(sb.toString())));
br = new BufferedReader(new StringReader(sb.toString()));
sb=null;
} catch (IOException e) { e.printStackTrace(); }
}
*/
//System.out.println("Collecting events");
try {
String s = br.readLine();
while (s != null) {
Pair p = convertAnnotatedString(s);
ArrayList tokens = (ArrayList)p.a;
ArrayList outcomes = (ArrayList)p.b;
ArrayList tags = new ArrayList();
for (int i=0; i<tokens.size(); i++) {
String[] context = cg.getContext(i,tokens.toArray(),(String[]) tags.toArray(new String[tags.size()]),null);
Event e = new Event((String)outcomes.get(i), context);
tags.add(outcomes.get(i));
elist.add(e);
}
s = br.readLine();
}
} catch (Exception e) { e.printStackTrace(); }
Event[] events = new Event[elist.size()];
for(int i=0; i<events.length; i++)
events[i] = (Event)elist.get(i);
return events;
} } | public class class_name {
public Event[] getEvents(boolean evalMode) {
ArrayList elist = new ArrayList();
//int numMatches;
//Set frequent;
/*
if(!evalMode) {
//System.out.println("Reading in all the data");
try {
StringBuffer sb = new StringBuffer();
for(String s = br.readLine(); s!=null; s=br.readLine())
sb.append(s+"\n");
//System.out.println("Getting most frequent words");
frequent =
getFrequent(new BufferedReader(
new StringReader(sb.toString())));
br = new BufferedReader(new StringReader(sb.toString()));
sb=null;
} catch (IOException e) { e.printStackTrace(); }
}
*/
//System.out.println("Collecting events");
try {
String s = br.readLine();
while (s != null) {
Pair p = convertAnnotatedString(s);
ArrayList tokens = (ArrayList)p.a;
ArrayList outcomes = (ArrayList)p.b;
ArrayList tags = new ArrayList();
for (int i=0; i<tokens.size(); i++) {
String[] context = cg.getContext(i,tokens.toArray(),(String[]) tags.toArray(new String[tags.size()]),null);
Event e = new Event((String)outcomes.get(i), context);
tags.add(outcomes.get(i)); // depends on control dependency: [for], data = [i]
elist.add(e); // depends on control dependency: [for], data = [none]
}
s = br.readLine(); // depends on control dependency: [while], data = [none]
}
} catch (Exception e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none]
Event[] events = new Event[elist.size()];
for(int i=0; i<events.length; i++)
events[i] = (Event)elist.get(i);
return events;
} } |
public class class_name {
public Observable<ServiceResponse<UpdateSummaryInner>> getUpdateSummaryWithServiceResponseAsync(String deviceName, String resourceGroupName) {
if (deviceName == null) {
throw new IllegalArgumentException("Parameter deviceName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.getUpdateSummary(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<UpdateSummaryInner>>>() {
@Override
public Observable<ServiceResponse<UpdateSummaryInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<UpdateSummaryInner> clientResponse = getUpdateSummaryDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} } | public class class_name {
public Observable<ServiceResponse<UpdateSummaryInner>> getUpdateSummaryWithServiceResponseAsync(String deviceName, String resourceGroupName) {
if (deviceName == null) {
throw new IllegalArgumentException("Parameter deviceName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.getUpdateSummary(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<UpdateSummaryInner>>>() {
@Override
public Observable<ServiceResponse<UpdateSummaryInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<UpdateSummaryInner> clientResponse = getUpdateSummaryDelegate(response);
return Observable.just(clientResponse); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
return Observable.error(t);
} // depends on control dependency: [catch], data = [none]
}
});
} } |
public class class_name {
@Nonnull
@ReturnsMutableCopy
public static byte [] encodeBytesToBytes (@Nonnull final byte [] source)
{
byte [] encoded;
try
{
encoded = encodeBytesToBytes (source, 0, source.length, NO_OPTIONS);
}
catch (final IOException ex)
{
throw new IllegalStateException ("IOExceptions only come from GZipping, which is turned off", ex);
}
return encoded;
} } | public class class_name {
@Nonnull
@ReturnsMutableCopy
public static byte [] encodeBytesToBytes (@Nonnull final byte [] source)
{
byte [] encoded;
try
{
encoded = encodeBytesToBytes (source, 0, source.length, NO_OPTIONS); // depends on control dependency: [try], data = [none]
}
catch (final IOException ex)
{
throw new IllegalStateException ("IOExceptions only come from GZipping, which is turned off", ex);
} // depends on control dependency: [catch], data = [none]
return encoded;
} } |
public class class_name {
public static List<TopLevelItemDescriptor> all(Authentication a, ItemGroup c) {
List<TopLevelItemDescriptor> result = new ArrayList<>();
ACL acl;
if (c instanceof AccessControlled) {
acl = ((AccessControlled) c).getACL();
} else {
// fall back to root
acl = Jenkins.getInstance().getACL();
}
for (TopLevelItemDescriptor d: all()) {
if (acl.hasCreatePermission(a, c, d) && d.isApplicableIn(c)) {
result.add(d);
}
}
return result;
} } | public class class_name {
public static List<TopLevelItemDescriptor> all(Authentication a, ItemGroup c) {
List<TopLevelItemDescriptor> result = new ArrayList<>();
ACL acl;
if (c instanceof AccessControlled) {
acl = ((AccessControlled) c).getACL(); // depends on control dependency: [if], data = [none]
} else {
// fall back to root
acl = Jenkins.getInstance().getACL(); // depends on control dependency: [if], data = [none]
}
for (TopLevelItemDescriptor d: all()) {
if (acl.hasCreatePermission(a, c, d) && d.isApplicableIn(c)) {
result.add(d); // depends on control dependency: [if], data = [none]
}
}
return result;
} } |
public class class_name {
public static <S extends HasAttachHandlers> boolean fire(S source, GroupRowData data) {
if (TYPE != null) {
JQMDataTableGroupRowEvent event = new JQMDataTableGroupRowEvent(data);
source.fireEvent(event);
return event.isStopDfltClick();
}
return false;
} } | public class class_name {
public static <S extends HasAttachHandlers> boolean fire(S source, GroupRowData data) {
if (TYPE != null) {
JQMDataTableGroupRowEvent event = new JQMDataTableGroupRowEvent(data);
source.fireEvent(event); // depends on control dependency: [if], data = [none]
return event.isStopDfltClick(); // depends on control dependency: [if], data = [none]
}
return false;
} } |
public class class_name {
protected Wave getLaunchFirstViewWave() {
Wave firstWave = null;
// Generates the command wave directly to win a Wave cycle
if (this.application != null && this.application.rootNode() != null && this.application.firstModelClass() != null) {
final UniqueKey<? extends Model> modelKey = Key.create(this.application.firstModelClass(), this.application.firstModelOptionalData(), this.application.firstModelKeyParts());
firstWave = WBuilder.callCommand(ShowModelCommand.class).waveBean(
DisplayModelWaveBean.create()
.childrenPlaceHolder(this.application.rootNode().getChildren())
.showModelKey(modelKey));
//
//
// ShowModelWaveBuilder.create()
// .childrenPlaceHolder(this.application.getRootNode().getChildren())
// .showModelKey(getFacade().getUiFacade().buildKey((Class<Model>) this.application.getFirstModelClass()))
// .build();
}
return firstWave;
} } | public class class_name {
protected Wave getLaunchFirstViewWave() {
Wave firstWave = null;
// Generates the command wave directly to win a Wave cycle
if (this.application != null && this.application.rootNode() != null && this.application.firstModelClass() != null) {
final UniqueKey<? extends Model> modelKey = Key.create(this.application.firstModelClass(), this.application.firstModelOptionalData(), this.application.firstModelKeyParts());
firstWave = WBuilder.callCommand(ShowModelCommand.class).waveBean(
DisplayModelWaveBean.create()
.childrenPlaceHolder(this.application.rootNode().getChildren())
.showModelKey(modelKey)); // depends on control dependency: [if], data = [none]
//
//
// ShowModelWaveBuilder.create()
// .childrenPlaceHolder(this.application.getRootNode().getChildren())
// .showModelKey(getFacade().getUiFacade().buildKey((Class<Model>) this.application.getFirstModelClass()))
// .build();
}
return firstWave;
} } |
public class class_name {
private static double[][] bcucof(double[] y, double[] y1, double[] y2, double[] y12, double d1, double d2) {
double d1d2 = d1 * d2;
double[] cl = new double[16];
double[] x = new double[16];
double[][] c = new double[4][4];
for (int i = 0; i < 4; i++) {
x[i] = y[i];
x[i + 4] = y1[i] * d1;
x[i + 8] = y2[i] * d2;
x[i + 12] = y12[i] * d1d2;
}
double xx;
for (int i = 0; i < 16; i++) {
xx = 0.0;
for (int k = 0; k < 16; k++) {
xx += wt[i][k] * x[k];
}
cl[i] = xx;
}
int l = 0;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
c[i][j] = cl[l++];
}
}
return c;
} } | public class class_name {
private static double[][] bcucof(double[] y, double[] y1, double[] y2, double[] y12, double d1, double d2) {
double d1d2 = d1 * d2;
double[] cl = new double[16];
double[] x = new double[16];
double[][] c = new double[4][4];
for (int i = 0; i < 4; i++) {
x[i] = y[i]; // depends on control dependency: [for], data = [i]
x[i + 4] = y1[i] * d1; // depends on control dependency: [for], data = [i]
x[i + 8] = y2[i] * d2; // depends on control dependency: [for], data = [i]
x[i + 12] = y12[i] * d1d2; // depends on control dependency: [for], data = [i]
}
double xx;
for (int i = 0; i < 16; i++) {
xx = 0.0; // depends on control dependency: [for], data = [none]
for (int k = 0; k < 16; k++) {
xx += wt[i][k] * x[k]; // depends on control dependency: [for], data = [k]
}
cl[i] = xx; // depends on control dependency: [for], data = [i]
}
int l = 0;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
c[i][j] = cl[l++]; // depends on control dependency: [for], data = [j]
}
}
return c;
} } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.