diff --git a/interfaces/kits/js/src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp b/interfaces/kits/js/src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp index 79d6fb1dcec57fd9324c82ccf1a20d4c88309431..f5c744b5fe241f1c12037bddfcf351ee6df2c19e 100644 --- a/interfaces/kits/js/src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp +++ b/interfaces/kits/js/src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp @@ -45,12 +45,14 @@ ani_object FsWatcherWrapper::Wrap(ani_env *env, const FsWatcher *watcher) HILOGE("FsWatcher pointer is null!"); return nullptr; } + auto classDesc = FS::WatcherInner::classDesc.c_str(); ani_class cls; if (ANI_OK != env->FindClass(classDesc, &cls)) { HILOGE("Cannot find class %s", classDesc); return nullptr; } + auto ctorDesc = FS::WatcherInner::ctorDesc.c_str(); auto ctorSig = FS::WatcherInner::ctorSig.c_str(); ani_method ctor; @@ -58,7 +60,8 @@ ani_object FsWatcherWrapper::Wrap(ani_env *env, const FsWatcher *watcher) HILOGE("Cannot find constructor method for class %s", classDesc); return nullptr; } - ani_long ptr = static_cast(reinterpret_cast(watcher)); + + ani_long ptr = static_cast(reinterpret_cast(watcher)); ani_object obj; if (ANI_OK != env->Object_New(cls, ctor, &obj, ptr)) { HILOGE("New %s obj Failed!", classDesc);