@@ -104,18 +104,18 @@ genStruct :: [(T.Text, Type)] -> Config -> Decl -> IO()
104
104
genStruct alias Config {.. } MPMessage {.. } = do
105
105
let params = if null msgParam then " " else [lt |<#{T.intercalate ", " msgParam}>|]
106
106
resolvedMsgFields = map (resolveFieldAlias alias) msgFields
107
- hashMapImport | not $ null [() | TMap _ _ <- map fldType resolvedMsgFields] = [lt |import java.util.HashMap ;|]
108
- | otherwise = " "
109
- arrayListImport | not $ null [() | TList _ <- map fldType resolvedMsgFields] = [lt |import java.util.ArrayList ;|]
110
- | otherwise = " "
107
+ mapImport | not $ null [() | TMap _ _ <- map fldType resolvedMsgFields] = [lt |import java.util.Map ;|]
108
+ | otherwise = " "
109
+ listImport | not $ null [() | TList _ <- map fldType resolvedMsgFields] = [lt |import java.util.List ;|]
110
+ | otherwise = " "
111
111
dirName = joinPath $ map LT. unpack $ LT. split (== ' .' ) $ LT. pack configPackage
112
112
fileName = dirName ++ " /" ++ (T. unpack $ formatClassNameT msgName) ++ " .java"
113
113
114
114
LT. writeFile fileName $ templ configFilePath [lt |
115
115
package #{configPackage};
116
116
117
- #{hashMapImport }
118
- #{arrayListImport }
117
+ #{mapImport }
118
+ #{listImport }
119
119
import org.msgpack.MessagePack;
120
120
import org.msgpack.annotation.Message;
121
121
@@ -190,18 +190,18 @@ genException _ _ _ = return ()
190
190
genClient :: [(T. Text , Type )] -> Config -> Decl -> IO ()
191
191
genClient alias Config {.. } MPService {.. } = do
192
192
let resolvedServiceMethods = map (resolveMethodAlias alias) serviceMethods
193
- hashMapImport | not $ null [() | TMap _ _ <- map methodRetType resolvedServiceMethods ] = [lt |import java.util.HashMap ;|]
194
- | otherwise = " "
195
- arrayListImport | not $ null [() | TList _ <- map methodRetType resolvedServiceMethods] = [lt |import java.util.ArrayList ;|]
196
- | otherwise = " "
193
+ mapImport | not $ null [() | TMap _ _ <- map methodRetType resolvedServiceMethods ] = [lt |import java.util.Map ;|]
194
+ | otherwise = " "
195
+ listImport | not $ null [() | TList _ <- map methodRetType resolvedServiceMethods] = [lt |import java.util.List ;|]
196
+ | otherwise = " "
197
197
dirName = joinPath $ map LT. unpack $ LT. split (== ' .' ) $ LT. pack configPackage
198
198
fileName = dirName ++ " /" ++ (T. unpack className) ++ " .java"
199
199
200
200
LT. writeFile fileName $ templ configFilePath [lt |
201
201
package #{configPackage};
202
202
203
- #{hashMapImport }
204
- #{arrayListImport }
203
+ #{mapImport }
204
+ #{listImport }
205
205
import org.msgpack.rpc.Client;
206
206
import org.msgpack.rpc.loop.EventLoop;
207
207
@@ -312,9 +312,9 @@ genType TRaw =
312
312
genType TString =
313
313
[lt |String|]
314
314
genType (TList typ) =
315
- [lt |ArrayList <#{genWrapperType typ} >|]
315
+ [lt |List <#{genWrapperType typ} >|]
316
316
genType (TMap typ1 typ2) =
317
- [lt |HashMap <#{genType typ1}, #{genType typ2} >|]
317
+ [lt |Map <#{genType typ1}, #{genType typ2} >|]
318
318
genType (TUserDef className params) =
319
319
[lt |#{formatClassNameT className} #{associateBracket $ map genType params}|]
320
320
genType (TTuple ts) =
@@ -364,9 +364,9 @@ genWrapperType TRaw =
364
364
genWrapperType TString =
365
365
[lt |String|]
366
366
genWrapperType (TList typ) =
367
- [lt |ArrayList <#{genWrapperType typ} >|]
367
+ [lt |List <#{genWrapperType typ} >|]
368
368
genWrapperType (TMap typ1 typ2) =
369
- [lt |HashMap <#{genWrapperType typ1}, #{genWrapperType typ2} >|]
369
+ [lt |Map <#{genWrapperType typ1}, #{genWrapperType typ2} >|]
370
370
genWrapperType (TUserDef className params) =
371
371
[lt |#{formatClassNameT className} #{associateBracket $ map genWrapperType params}|]
372
372
genWrapperType (TTuple ts) =
0 commit comments