kwin commented on code in PR #124:
URL: https://github.com/apache/sling-whiteboard/pull/124#discussion_r3217767765


##########
skills/osgi-scr-migrator/scripts/migrate_annotations.py:
##########
@@ -122,6 +122,27 @@ def to_metatype_attribute(self, indent: str = '    ') -> 
str:
 
         return f'{indent}{attr_annotation}\n{indent}{java_type} 
{method_name}(){default_value};'
 
+    @staticmethod
+    def _property_id_to_method_name(property_id: str) -> str:
+        """Map an OSGi property id to a method name using metatype escape 
rules.
+
+        This is the inverse of the id generation rules from
+        org.osgi.service.metatype.annotations.AttributeDefinition.
+        """
+        escaped = []
+        for ch in property_id:
+            if ch == '.':
+                escaped.append('_')
+            elif ch == '_':
+                escaped.append('__')
+            elif ch == '-':
+                escaped.append('$_$')

Review Comment:
   Only supported since Metatype 1.4/R7 
(https://github.com/apache/sling-whiteboard/blob/2e287ed315a11776f8e85c2421a9805a6022288a/skills/osgi-scr-migrator/scripts/migrate_pom.py#L175),
 but the pom is always migrated to the latest version anyhow.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to