-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove reflections: Misc and Summary #1137
Changes from all commits
450904f
4553a9c
d2e2d01
830c57b
cf3cbed
88955fd
c6438a5
0763801
192d221
b934822
73d4ccf
734b5a4
35aeb92
07509fb
6123227
c8f45f9
0d36498
d482dc0
5cdebc2
3e7e32e
a462ee9
5a6c4ec
9c6ddb9
9ab9280
01652ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,8 @@ public OperandPtg Copy() | |
{ | ||
try | ||
{ | ||
return (OperandPtg)Clone(); | ||
// REMOVE-REFLECTION: After careful inspection, MemberwiseClone() should be enough for all built-in OpreandPtgs. | ||
return (OperandPtg)MemberwiseClone(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All derived classes of |
||
} | ||
catch (NotSupportedException e) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ namespace NPOI.SS.Formula.PTG | |
* @author Jason Height (jheight at chariot dot net dot au) | ||
*/ | ||
[Serializable] | ||
public abstract class Ptg : ICloneable | ||
public abstract class Ptg //: ICloneable | ||
{ | ||
public static Ptg[] EMPTY_PTG_ARRAY = { }; | ||
|
||
|
@@ -187,7 +187,7 @@ private static Ptg[] ToPtgArray(ArrayList l) | |
return EMPTY_PTG_ARRAY; | ||
} | ||
|
||
Ptg[] result = (Ptg[])l.ToArray(typeof(Ptg)); | ||
Ptg[] result = l.ToArray<Ptg>(); | ||
return result; | ||
} | ||
/** | ||
|
@@ -208,10 +208,10 @@ private static Ptg[] ToPtgArray(ArrayList l) | |
// } | ||
// return (Ptg)Clone(); | ||
//} | ||
public virtual object Clone() | ||
{ | ||
return this.Copy(); | ||
} | ||
// private virtual object Clone() | ||
//{ | ||
//return this.Copy(); | ||
//} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not used elsewhere. And |
||
|
||
/** | ||
* This method will return the same result as {@link #getEncodedSizeWithoutArrayData(Ptg[])} | ||
|
@@ -358,14 +358,14 @@ public char RVAType | |
} | ||
} | ||
|
||
#region ICloneable Members | ||
/*#region ICloneable Members | ||
|
||
object ICloneable.Clone() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
#endregion | ||
#endregion*/ | ||
|
||
public static bool DoesFormulaReferToDeletedCell(Ptg[] ptgs) | ||
{ | ||
|
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.
Although
new T()
usesActivator.CreateInstance
internally, this semantic is slightly different for AOT analyzers I believe.