Fix minor typos and potential errors

This commit is contained in:
agnostic-apollo
2021-06-26 08:51:30 +05:00
parent 4494bc66e4
commit 28f81f2cc7
2 changed files with 6 additions and 4 deletions

View File

@@ -90,10 +90,12 @@ public class MarkdownUtils {
int maxCount = 0; int maxCount = 0;
int matchCount; int matchCount;
String match;
Matcher matcher = backticksPattern.matcher(string); Matcher matcher = backticksPattern.matcher(string);
while(matcher.find()) { while(matcher.find()) {
matchCount = matcher.group(1).length(); match = matcher.group(1);
matchCount = match != null ? match.length() : 0;
if (matchCount > maxCount) if (matchCount > maxCount)
maxCount = matchCount; maxCount = matchCount;
} }

View File

@@ -83,7 +83,7 @@ public class NotificationUtils {
* *
* @param context The {@link Context} for operations. * @param context The {@link Context} for operations.
* @param title The title for the notification. * @param title The title for the notification.
* @param notifiationText The second line text of the notification. * @param notificationText The second line text of the notification.
* @param notificationBigText The full text of the notification that may optionally be styled. * @param notificationBigText The full text of the notification that may optionally be styled.
* @param pendingIntent The {@link PendingIntent} which should be sent when notification is clicked. * @param pendingIntent The {@link PendingIntent} which should be sent when notification is clicked.
* @param notificationMode The notification mode. It must be one of {@code NotificationUtils.NOTIFICATION_MODE_*}. * @param notificationMode The notification mode. It must be one of {@code NotificationUtils.NOTIFICATION_MODE_*}.
@@ -92,11 +92,11 @@ public class NotificationUtils {
* @return Returns the {@link Notification.Builder}. * @return Returns the {@link Notification.Builder}.
*/ */
@Nullable @Nullable
public static Notification.Builder geNotificationBuilder(final Context context, final String channelId, final int priority, final CharSequence title, final CharSequence notifiationText, final CharSequence notificationBigText, final PendingIntent pendingIntent, final int notificationMode) { public static Notification.Builder geNotificationBuilder(final Context context, final String channelId, final int priority, final CharSequence title, final CharSequence notificationText, final CharSequence notificationBigText, final PendingIntent pendingIntent, final int notificationMode) {
if (context == null) return null; if (context == null) return null;
Notification.Builder builder = new Notification.Builder(context); Notification.Builder builder = new Notification.Builder(context);
builder.setContentTitle(title); builder.setContentTitle(title);
builder.setContentText(notifiationText); builder.setContentText(notificationText);
builder.setStyle(new Notification.BigTextStyle().bigText(notificationBigText)); builder.setStyle(new Notification.BigTextStyle().bigText(notificationBigText));
builder.setContentIntent(pendingIntent); builder.setContentIntent(pendingIntent);