Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-3384-Possible-infinite-loop #3635

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
* holder.
*/
// Portions Copyright [2019] [Payara Foundation and/or its affiliates]

package com.sun.enterprise.deployment.runtime;

import org.glassfish.deployment.common.Descriptor;
Expand Down Expand Up @@ -159,13 +160,6 @@ protected void removeValue(String name, int index) {
list.remove(index);
}

protected void setValues(String name, Object[] values) {
List list = getIndexedProperty(name);
for (int i = 0; i < values.length;) {
list.add(values[i]);
}
}

protected Object[] getValues(String name) {
List list = (List) getValue(name);
if (list != null && list.size() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2019] [Payara Foundation and/or its affiliates]

/**
* This generated bean class ResourceAdapter matches the DTD element resource-adapter
Expand All @@ -58,67 +59,18 @@
*/
public class ResourceAdapter extends RuntimeDescriptor
{
static public final String DESCRIPTION = "Description"; // NOI18N
static public final String PROPERTY = "PropertyElement"; // NOI18N
public static final String DESCRIPTION = "Description"; // NOI18N
public static final String PROPERTY = "PropertyElement"; // NOI18N

static public final String JNDI_NAME = "JndiName";
static public final String MAX_POOL_SIZE = "MaxPoolSize";
static public final String STEADY_POOL_SIZE = "SteadyPoolSize";
static public final String MAX_WAIT_TIME_IN_MILLIS = "MaxWaitTimeInMillis";
static public final String IDLE_TIMEOUT_IN_SECONDS = "IdleTimeoutInSeconds";

// This attribute is an array, possibly empty
public void setPropertyElement(int index, NameValuePairDescriptor value)
{
this.setValue(PROPERTY, index, value);
}

//
public boolean isPropertyElement(int index)
{
NameValuePairDescriptor ret = (NameValuePairDescriptor)this.getValue(PROPERTY, index);
return ret != null;
}

// This attribute is an array, possibly empty
public void setPropertyElement(NameValuePairDescriptor[] values)
{
this.setValues(PROPERTY, values);
}
public static final String JNDI_NAME = "JndiName";
public static final String MAX_POOL_SIZE = "MaxPoolSize";
public static final String STEADY_POOL_SIZE = "SteadyPoolSize";
public static final String MAX_WAIT_TIME_IN_MILLIS = "MaxWaitTimeInMillis";
public static final String IDLE_TIMEOUT_IN_SECONDS = "IdleTimeoutInSeconds";

//
public NameValuePairDescriptor[] getPropertyElement()
{
return (NameValuePairDescriptor[])this.getValues(PROPERTY);
}

// Return the number of properties
public int sizePropertyElement()
{
return this.size(PROPERTY);
}

// Add a new element returning its index in the list
public int addPropertyElement(NameValuePairDescriptor value)
{
return this.addValue(PROPERTY, value);
}

//
// Remove an element using its reference
// Returns the index the element had in the list
//
public int removePropertyElement(NameValuePairDescriptor value)
{
return this.removeValue(PROPERTY, value);
}

//
// Remove an element using its index
//
public void removePropertyElement(int index)
{
this.removeValue(PROPERTY, index);
public NameValuePairDescriptor[] getPropertyElement() {
return (NameValuePairDescriptor[])this.getValues(PROPERTY);
}

// This method verifies that the mandatory properties are set
Expand Down