-
Notifications
You must be signed in to change notification settings - Fork 133
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
3.2.2 fix OPENJPA-2814 #111
base: master
Are you sure you want to change the base?
Conversation
@@ -14,7 +14,7 @@ | |||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |||
* KIND, either express or implied. See the License for the | |||
* specific language governing permissions and limitations | |||
* under the License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe all trailing spaces should be removed
@@ -27,8 +27,10 @@ | |||
* | |||
* @author Abe White | |||
*/ | |||
public abstract class Constraint extends ReferenceCounter { | |||
private static final long serialVersionUID = 1L; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this code
public abstract class Constraint extends ReferenceCounter {
private static final long serialVersionUID = 1L;
should be restored
@@ -250,31 +241,48 @@ public String toString() { | |||
return "<" + name.toLowerCase() + ">"; | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO previous version of hashcode+equals was more readable
also it not clear why to change the order :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used an auto generated eclipse equals and hashcode. I could mimic the style of the original one indeed. The important thing for me is the fields that are included in the equality and hashcode testing to avoid the mem leak !
@@ -40,8 +40,9 @@ | |||
* | |||
* @author Abe White | |||
*/ | |||
public class ForeignKey extends Constraint { | |||
private static final long serialVersionUID = 1L; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMo this code:
public class ForeignKey extends Constraint {
private static final long serialVersionUID = 1L;
need to be restored
|
||
Column[] cols = getPrimaryKeyColumns(); | ||
if (cols.length == 0) { | ||
_autoAssign = Boolean.FALSE; | ||
return false; | ||
} | ||
|
||
for (Column column : cols) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please clarify why for-in
loops were replaced with plain-for
loops in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes see my general comment, will update
@@ -187,7 +181,6 @@ public DBIdentifier getIdentifier() { | |||
* constraint already belongs to a table. | |||
* @deprecated | |||
*/ | |||
@Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why @Deprecated
were removed in this PR?
localtable.getColumn(locCols[j].getIdentifier()))) { | ||
fkTemp.join(localtable.getColumn(locCols[j].getIdentifier()), | ||
pkTable.getColumn(pkCols[j].getIdentifier())); | ||
if( ! fkTemp.containsColumn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (...)
is used in the code
not if( ...)
could you please revert this change?
@@ -920,72 +905,60 @@ private static Column[] createKeyColumns(ForeignKey fk) { | |||
return new Column[] { fkCol, pkCol }; | |||
} | |||
|
|||
@Override | |||
public boolean equals(Object o) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment to hashcode/equals
@solomax Ok as a general remark, indeed I think I took the patch from a local version dating back from openjpa 3.0.0, that would explain strange for loops changes :) |
I reopened OPENJPA-2814 because the proposed fix was causing some exceptions.
My initial fix is fixing properly the memory leak and is in production since few years already so I propose to use this one.