-
-
Notifications
You must be signed in to change notification settings - Fork 459
Avoid StrictMode warnings #4724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
95282db
683bb3b
3f3eb00
ad0dd38
a7e737e
c1b6bc6
b2e03d4
57f6ea3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,34 +40,22 @@ public void processDirectory(final @NotNull File directory) { | |
try { | ||
logger.log(SentryLevel.DEBUG, "Processing dir. %s", directory.getAbsolutePath()); | ||
|
||
if (!directory.exists()) { | ||
final File[] filteredListFiles = directory.listFiles((d, name) -> isRelevantFileName(name)); | ||
if (filteredListFiles == null) { | ||
logger.log( | ||
SentryLevel.WARNING, | ||
"Directory '%s' doesn't exist. No cached events to send.", | ||
SentryLevel.ERROR, | ||
"Cache dir %s is null or is not a directory.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep. From the javadoc |
||
directory.getAbsolutePath()); | ||
return; | ||
} | ||
if (!directory.isDirectory()) { | ||
logger.log( | ||
SentryLevel.ERROR, "Cache dir %s is not a directory.", directory.getAbsolutePath()); | ||
return; | ||
} | ||
|
||
final File[] listFiles = directory.listFiles(); | ||
if (listFiles == null) { | ||
logger.log(SentryLevel.ERROR, "Cache dir %s is null.", directory.getAbsolutePath()); | ||
return; | ||
} | ||
|
||
final File[] filteredListFiles = directory.listFiles((d, name) -> isRelevantFileName(name)); | ||
|
||
logger.log( | ||
SentryLevel.DEBUG, | ||
"Processing %d items from cache dir %s", | ||
filteredListFiles != null ? filteredListFiles.length : 0, | ||
filteredListFiles.length, | ||
directory.getAbsolutePath()); | ||
|
||
for (File file : listFiles) { | ||
for (File file : filteredListFiles) { | ||
stefanosiano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// it ignores .sentry-native database folder and new ones that might come up | ||
if (!file.isFile()) { | ||
logger.log(SentryLevel.DEBUG, "File %s is not a File.", file.getAbsolutePath()); | ||
|
Uh oh!
There was an error while loading. Please reload this page.