Fix code analysis

Signed-off-by: Alper Ozturk <alperozturk@lions-macbook.local>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
Alper Ozturk 2023-10-06 10:07:30 +02:00 committed by alperozturk
parent 3ab49e4acc
commit a24609f534
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF
3 changed files with 46 additions and 41 deletions

View file

@ -1,21 +1,22 @@
/* /*
* Nextcloud Android Library is available under MIT license * Nextcloud Android client application
* @author Alper Öztürk *
* Copyright (C) 2023 Alper Öztürk * @author Alper Ozturk
* Copyright (C) 2023 Alper Ozturk
* Copyright (C) 2023 Nextcloud GmbH * 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, * You should have received a copy of the GNU Affero General Public License
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * along with this program. If not, see <https://www.gnu.org/licenses/>.
* 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.
*/ */
package com.owncloud.android.datamodel package com.owncloud.android.datamodel
@ -101,4 +102,5 @@ class OCFileIconTests {
fun destroy() { fun destroy() {
sut = null sut = null
} }
} }

View file

@ -1,21 +1,22 @@
/* /*
* Nextcloud Android Library is available under MIT license * Nextcloud Android client application
* @author Alper Öztürk *
* Copyright (C) 2023 Alper Öztürk * @author Alper Ozturk
* Copyright (C) 2023 Alper Ozturk
* Copyright (C) 2023 Nextcloud GmbH * 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, * You should have received a copy of the GNU Affero General Public License
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * along with this program. If not, see <https://www.gnu.org/licenses/>.
* 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.
*/ */
package com.owncloud.android.utils package com.owncloud.android.utils
@ -42,8 +43,7 @@ class DrawableUtilTests {
@Test @Test
fun testAddDrawableAsOverlayWhenGivenValidDrawablesShouldContainTwoDrawable() { fun testAddDrawableAsOverlayWhenGivenValidDrawablesShouldContainTwoDrawable() {
val bitmapSize = 10 val bitmap: Bitmap = Bitmap.createBitmap(2, 2, Bitmap.Config.ARGB_8888)
val bitmap: Bitmap = Bitmap.createBitmap(bitmapSize, bitmapSize, Bitmap.Config.ARGB_8888)
val drawable = BitmapDrawable(context?.resources, bitmap) val drawable = BitmapDrawable(context?.resources, bitmap)
val layerDrawable = sut?.addDrawableAsOverlay(drawable, drawable) val layerDrawable = sut?.addDrawableAsOverlay(drawable, drawable)
@ -60,4 +60,5 @@ class DrawableUtilTests {
sut = null sut = null
context = null context = null
} }
} }

View file

@ -1,21 +1,22 @@
/* /*
* Nextcloud Android Library is available under MIT license * Nextcloud Android client application
* @author Alper Öztürk *
* Copyright (C) 2023 Alper Öztürk * @author Alper Ozturk
* Copyright (C) 2023 Alper Ozturk
* Copyright (C) 2023 Nextcloud GmbH * 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, * You should have received a copy of the GNU Affero General Public License
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * along with this program. If not, see <https://www.gnu.org/licenses/>.
* 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.
*/ */
package com.owncloud.android.utils package com.owncloud.android.utils
@ -43,4 +44,5 @@ class DrawableUtil {
layerDrawable.setLayerInset(1, overlayBounds.left, overlayBounds.top, overlayBounds.right, overlayBounds.bottom) layerDrawable.setLayerInset(1, overlayBounds.left, overlayBounds.top, overlayBounds.right, overlayBounds.bottom)
return layerDrawable return layerDrawable
} }
} }