X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=Mate%2FClassPool.hs;h=d9e965c3cacc7085d9ec44d47404f0ecb49def86;hb=496288a6ff9de79049f177ed8ab5fc1c77e8bac3;hp=0844ea5efa3e96f7655517a20ac59ad4ead29241;hpb=55dbc4836a164757f92c97f98623cb203ffbed4e;p=mate.git diff --git a/Mate/ClassPool.hs b/Mate/ClassPool.hs index 0844ea5..d9e965c 100644 --- a/Mate/ClassPool.hs +++ b/Mate/ClassPool.hs @@ -21,6 +21,7 @@ import Data.Binary import qualified Data.Map as M import qualified Data.Set as S import qualified Data.ByteString.Lazy as B +import Data.String.Utils import Control.Monad #ifdef DEBUG @@ -267,17 +268,20 @@ loadAndInitClass path = do readClassFile :: String -> IO (Class Direct) -readClassFile path = readIORef classPaths >>= rcf +readClassFile path' = readIORef classPaths >>= rcf where + path = replace "." "/" path' rcf :: [MClassPath] -> IO (Class Direct) rcf [] = error $ "readClassFile: Class \"" ++ (show path) ++ "\" not found." rcf ((Directory pre):xs) = do let cf = pre ++ path ++ ".class" + printfCp "rcf: searching @ %s for %s\n" (show pre) (show path) b <- doesFileExist cf if b then parseClassFile cf else rcf xs rcf ((JAR p):xs) = do + printfCp "rcf: searching %s in JAR\n" (show path) entry <- getEntry p path case entry of Just (LoadedJAR _ cls) -> return cls