Mixing REL and RS Code in a Library
You should not mix code for REL and code with constructors in any one class, as this can have side-effects. You encounter the issue when constructors that take arguments are used.
Example
The following examples illustrate what should and should not be done:
The following class can be used with REL.
Copy
public class MyClass
{
public String myFunction(String argument)
{
// Code
}
}
The following class can be used with REL.
Copy
public class MyClass
{
private int someVariable;
public MyClass()
{
someVariable = 0; // Default value
}
public MyClass(int newValue)
{
someVariable = newValue;
}
public String myFunction(String argument)
{
// Code
}
}
The following example will have side-effects
Copy
public class MyClass
{
private int someVariable;
public MyClass(int newValue)
{
someVariable = newValue;
}
public String myFunction(String argument)
{
// Code
}
}