Skip to content

Commit 92213d7

Browse files
radekdoulikjonpryor
authored andcommitted
[Java.Interop] Ignore ListsAreStronglyTypedRule (#234)
Ignore ListsAreStronglyTypedRule for array marshaling types, which do not support `Add()`, `Insert()`, and `Remove()` methods (they throw unsupported exception in the abstract base class `JavaArray<T>`). Thus there's not much sense in adding strongly typed versions just to throw unsupported exception there as well.
1 parent 5e77d91 commit 92213d7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

gendarme-ignore.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,18 @@ R: Gendarme.Rules.Design.Generic.DoNotExposeGenericListsRule
614614
# We don't care here as we don't hold the list and create it on request. So to avoid performace penalty, we keep the list as return type
615615
M: System.Collections.Generic.List`1<Java.Interop.JniSurfacedPeerInfo> Java.Interop.JniRuntime/JniValueManager::GetSurfacedPeers()
616616

617+
R: Gendarme.Rules.Design.ListsAreStronglyTypedRule
618+
# Add, Insert and Remove methods are not supported by design and thus lack strongly typed versions of these methods
619+
T: Java.Interop.JavaBooleanArray
620+
T: Java.Interop.JavaCharArray
621+
T: Java.Interop.JavaDoubleArray
622+
T: Java.Interop.JavaInt16Array
623+
T: Java.Interop.JavaInt32Array
624+
T: Java.Interop.JavaInt64Array
625+
T: Java.Interop.JavaObjectArray`1
626+
T: Java.Interop.JavaSByteArray
627+
T: Java.Interop.JavaSingleArray
628+
617629
R: Gendarme.Rules.Concurrency.DoNotUseLockedRegionOutsideMethodRule
618630
# Looks like Gendarme issue, as there are both Monitor.TryEnter and Monitor.Exit used in this method
619631
M: System.Boolean Java.Interop.JniRuntime/JniTypeManager::TryRegisterNativeMembers(Java.Interop.JniType,System.Type,System.String)

0 commit comments

Comments
 (0)