Browse Source

sonar报错修改

zhanglong7 5 years ago
parent
commit
0724ea77bd

+ 9 - 1
ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/plugin/MobileCamera.java

460
	   }
460
	   }
461
	   String res = f.getAbsolutePath();
461
	   String res = f.getAbsolutePath();
462
	   BufferedOutputStream bos = null;
462
	   BufferedOutputStream bos = null;
463
		FileOutputStream outputStream = null;
463
	   try {
464
	   try {
464
		   FileOutputStream outputStream = new FileOutputStream(f);
465
		   outputStream = new FileOutputStream(f);
465
		   bos = new BufferedOutputStream(outputStream);
466
		   bos = new BufferedOutputStream(outputStream);
466
		   bitmap.compress(Bitmap.CompressFormat.PNG, 100, bos);
467
		   bitmap.compress(Bitmap.CompressFormat.PNG, 100, bos);
467
	   } catch (FileNotFoundException e) {
468
	   } catch (FileNotFoundException e) {
475
				   Log.e(TAG, "addWaterMark: ", e);
476
				   Log.e(TAG, "addWaterMark: ", e);
476
			   }
477
			   }
477
		   }
478
		   }
479
		   if (outputStream != null) {
480
			   try {
481
				   outputStream.close();
482
			   } catch (IOException e) {
483
				   Log.e(TAG, "addWaterMark: ", e);
484
			   }
485
		   }
478
	   }
486
	   }
479
487
480
	   return res;
488
	   return res;