-fieldInfo :: Pool Pointers -> Field Resolved -> Field Pointers
-fieldInfo pool (Field {..}) = Field {
- fieldAccessFlags = access2word16 fieldAccessFlags,
- fieldName = force "field name" $ poolIndex pool fieldName,
- fieldSignature = force "signature" $ poolIndex pool (encode fieldSignature),
- fieldAttributesCount = fromIntegral (M.size fieldAttributes),
- fieldAttributes = map (attrInfo pool) (M.assocs fieldAttributes) }
-
-methodInfo :: Pool Pointers -> Method Resolved -> Method Pointers
-methodInfo pool (Method {..}) = Method {
- methodAccessFlags = access2word16 methodAccessFlags,
- methodName = force "method name" $ poolIndex pool methodName,
- methodSignature = force "method sig" $ poolIndex pool (encode methodSignature),
- methodAttributesCount = fromIntegral (M.size methodAttributes),
- methodAttributes = map (attrInfo pool) (M.assocs methodAttributes) }
-
-attrInfo :: Pool Pointers -> (B.ByteString, B.ByteString) -> Attributes Pointers
+fieldDirect2File :: Pool File -> Field Direct -> Field File
+fieldDirect2File pool (Field {..}) = Field {
+ fieldAccessFlags = accessDirect2File fieldAccessFlags,
+ fieldName = force "field name" $ poolIndex pool fieldName,
+ fieldSignature = force "signature" $ poolIndex pool (encode fieldSignature),
+ fieldAttributesCount = fromIntegral (arsize fieldAttributes),
+ fieldAttributes = to (arlist fieldAttributes) }
+ where
+ to :: [(B.ByteString, B.ByteString)] -> Attributes File
+ to pairs = AP (map (attrInfo pool) pairs)
+
+methodDirect2File :: Pool File -> Method Direct -> Method File
+methodDirect2File pool (Method {..}) = Method {
+ methodAccessFlags = accessDirect2File methodAccessFlags,
+ methodName = force "method name" $ poolIndex pool methodName,
+ methodSignature = force "method sig" $ poolIndex pool (encode methodSignature),
+ methodAttributesCount = fromIntegral (arsize methodAttributes),
+ methodAttributes = to (arlist methodAttributes) }
+ where
+ to :: [(B.ByteString, B.ByteString)] -> Attributes File
+ to pairs = AP (map (attrInfo pool) pairs)
+
+attrInfo :: Pool File -> (B.ByteString, B.ByteString) -> Attribute