From a24609f534ec7523b285f8175bb4d177dac0296b Mon Sep 17 00:00:00 2001 From: Alper Ozturk Date: Fri, 6 Oct 2023 10:07:30 +0200 Subject: [PATCH] Fix code analysis Signed-off-by: Alper Ozturk Signed-off-by: alperozturk --- .../android/datamodel/OCFileIconTests.kt | 28 +++++++++-------- .../android/utils/DrawableUtilTests.kt | 31 ++++++++++--------- .../owncloud/android/utils/DrawableUtil.kt | 28 +++++++++-------- 3 files changed, 46 insertions(+), 41 deletions(-) diff --git a/app/src/androidTest/java/com/owncloud/android/datamodel/OCFileIconTests.kt b/app/src/androidTest/java/com/owncloud/android/datamodel/OCFileIconTests.kt index cd4685cc3a..d7beb37369 100644 --- a/app/src/androidTest/java/com/owncloud/android/datamodel/OCFileIconTests.kt +++ b/app/src/androidTest/java/com/owncloud/android/datamodel/OCFileIconTests.kt @@ -1,21 +1,22 @@ /* - * Nextcloud Android Library is available under MIT license - * @author Alper Öztürk - * Copyright (C) 2023 Alper Öztürk + * Nextcloud Android client application + * + * @author Alper Ozturk + * Copyright (C) 2023 Alper Ozturk * Copyright (C) 2023 Nextcloud GmbH * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ package com.owncloud.android.datamodel @@ -101,4 +102,5 @@ class OCFileIconTests { fun destroy() { sut = null } + } diff --git a/app/src/androidTest/java/com/owncloud/android/utils/DrawableUtilTests.kt b/app/src/androidTest/java/com/owncloud/android/utils/DrawableUtilTests.kt index b152a5bec4..83eb5e774b 100644 --- a/app/src/androidTest/java/com/owncloud/android/utils/DrawableUtilTests.kt +++ b/app/src/androidTest/java/com/owncloud/android/utils/DrawableUtilTests.kt @@ -1,21 +1,22 @@ /* - * Nextcloud Android Library is available under MIT license - * @author Alper Öztürk - * Copyright (C) 2023 Alper Öztürk + * Nextcloud Android client application + * + * @author Alper Ozturk + * Copyright (C) 2023 Alper Ozturk * Copyright (C) 2023 Nextcloud GmbH * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ package com.owncloud.android.utils @@ -42,8 +43,7 @@ class DrawableUtilTests { @Test fun testAddDrawableAsOverlayWhenGivenValidDrawablesShouldContainTwoDrawable() { - val bitmapSize = 10 - val bitmap: Bitmap = Bitmap.createBitmap(bitmapSize, bitmapSize, Bitmap.Config.ARGB_8888) + val bitmap: Bitmap = Bitmap.createBitmap(2, 2, Bitmap.Config.ARGB_8888) val drawable = BitmapDrawable(context?.resources, bitmap) val layerDrawable = sut?.addDrawableAsOverlay(drawable, drawable) @@ -60,4 +60,5 @@ class DrawableUtilTests { sut = null context = null } + } diff --git a/app/src/main/java/com/owncloud/android/utils/DrawableUtil.kt b/app/src/main/java/com/owncloud/android/utils/DrawableUtil.kt index eae3353cec..0f1bb7f47d 100644 --- a/app/src/main/java/com/owncloud/android/utils/DrawableUtil.kt +++ b/app/src/main/java/com/owncloud/android/utils/DrawableUtil.kt @@ -1,21 +1,22 @@ /* - * Nextcloud Android Library is available under MIT license - * @author Alper Öztürk - * Copyright (C) 2023 Alper Öztürk + * Nextcloud Android client application + * + * @author Alper Ozturk + * Copyright (C) 2023 Alper Ozturk * Copyright (C) 2023 Nextcloud GmbH * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ package com.owncloud.android.utils @@ -43,4 +44,5 @@ class DrawableUtil { layerDrawable.setLayerInset(1, overlayBounds.left, overlayBounds.top, overlayBounds.right, overlayBounds.bottom) return layerDrawable } + }