auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream inputStream) throws IOException { Object object; try { JsonParser jsonParser = objectMapper.getJsonFactory().createJsonParser(inputStream); jsonParser.disable(JsonParser.Feature.AUTO_CLOSE_SOURCE); object = objectMapper.readValue(jsonParser, TypeFactory.type(genericType)); } catch (Exception e) { <START> if (e instanceof EOFException) { <END> return null; } else if (e instanceof IOException && !(e instanceof JsonProcessingException)) { throw (IOException) e; } log.debug(e, "Invalid json for Java type %s", type); throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity("Invalid json for Java type " + type) .build()); } Set<ConstraintViolation<Object>> violations = VALIDATOR.validate(object); if (!violations.isEmpty()) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity(messagesFor(violations)) .build()); } return object; }</code><technical_language>if JSON input ends prematurely? throw EOFException</technical_language>

Target:
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream inputStream) throws IOException { Object object; try { JsonParser jsonParser = objectMapper.getJsonFactory().createJsonParser(inputStream); jsonParser.disable(JsonParser.Feature.AUTO_CLOSE_SOURCE); object = objectMapper.readValue(jsonParser, TypeFactory.type(genericType)); } catch (Exception e) { if (e instanceof IOException && !(e instanceof JsonProcessingException) && !(e instanceof EOFException)) { throw (IOException) e; } log.debug(e, "Invalid json for Java type %s", type); throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity("Invalid json for Java type " + type) .build()); } Set<ConstraintViolation<Object>> violations = VALIDATOR.validate(object); if (!violations.isEmpty()) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity(messagesFor(violations)) .build()); } return object; }
Source:
<code>private VdsNetworkInterface findPreviousDefaultRouteNic() { List<VdsNetworkInterface> existingNics = getExistingNics(); return existingNics.stream() <START> .filter(nic -> DEFAULT_ROUTE_ON_IFACE_PREDICATE.test(nic)) <END> .findFirst() .orElse(null); }</code><technical_language>filter(new IsDefaultRouteOnInterfacePredicate()) this more local</technical_language>

Target:
private VdsNetworkInterface findPreviousDefaultRouteNic() { List<VdsNetworkInterface> existingNics = getExistingNics(); return existingNics.stream() .filter(IsDefaultRouteOnInterfacePredicate.INSTANCE) .findFirst() .orElse(null); }
Source:
<code>public static void main(final String[] args) { String serviceAccountEmailAddress = args[0]; String serviceAccountKey = null; try { serviceAccountKey = Files.toString(new File(args[1]), Charset.defaultCharset()); } catch (IOException e) { System.err.println("Cannot open service account private key PEM file: " + args[1] + "\n" + e.getMessage()); System.exit(1); } String command = args[2]; String projectName = null; String bucketName = null; if (command.equals("create")) { projectName = args[3]; bucketName = args[4]; } else if (command.equals("delete")) { bucketName = args[3]; if (args.length >= 5) { <START> System.err.println("Command 'delete' require only one additional parameter (bucketName)."); <END> System.exit(1); } } else if (command.equals("list")) { projectName = args[3]; if (args.length >= 5) { System.err.println("Command 'list' require only one additional parameters (projectName)."); System.exit(1); } } else { System.err.println("Unknown command: " + command); System.exit(1); } ManageBuckets manageBuckets = new ManageBuckets(serviceAccountEmailAddress, serviceAccountKey); if (command.equals("create")) { manageBuckets.createBucket(projectName, bucketName); } else if (command.equals("delete")) { manageBuckets.deleteBucket(bucketName); } else if (command.equals("list")) { manageBuckets.listBuckets(projectName); } else { try { manageBuckets.close(); } catch (IOException e) { e.printStackTrace(); } throw new RuntimeException("Should never happen."); } try { manageBuckets.close(); } catch (IOException e) { e.printStackTrace(); System.exit(1); } }</code><technical_language>Is this worth error? warn continue</technical_language>

Target:
public static void main(final String[] args) { String serviceAccountEmailAddress = args[0]; String serviceAccountKey = null; try { serviceAccountKey = Files.toString(new File(args[1]), Charset.defaultCharset()); } catch (IOException e) { System.err.println("Cannot open service account private key PEM file: " + args[1] + "\n" + e.getMessage()); System.exit(1); } ManageBuckets manageBuckets = new ManageBuckets(serviceAccountEmailAddress, serviceAccountKey); String command = args[2]; String projectName = null; String bucketName = null; try { if (command.equals("create")) { projectName = args[3]; bucketName = args[4]; manageBuckets.createBucket(projectName, bucketName); } else if (command.equals("delete")) { bucketName = args[3]; if (args.length >= 5) { System.err.println("Warning: Command 'delete' require only one additional parameter (bucketName)."); } manageBuckets.deleteBucket(bucketName); } else if (command.equals("list")) { projectName = args[3]; if (args.length >= 5) { System.err.println("Warning: Command 'list' require only one additional parameters (projectName)."); } manageBuckets.listBuckets(projectName); } else { System.err.println("Unknown command: " + command); System.exit(1); } } catch (RuntimeException e) { System.err.format("Command %s failed: %s%n", command, e.getMessage()); System.exit(1); } try { manageBuckets.close(); } catch (IOException e) { e.printStackTrace(); System.exit(1); } }
Source:
<code>protected synchronized void updateNameList() { if (sysNameList != null) { for (int i = 0; i < sysNameList.size(); i++) { NamedBean b = getBySystemName(sysNameList.get(i)); if (b != null) { b.removePropertyChangeListener(this); } } } <START> sysNameList = null; <END> sysNameList = new ArrayList<>(); getManager().getNamedBeanSet().forEach(b -> { if (b.getSystemName().startsWith(getLogixSystemPrefix())) { sysNameList.add(b.getSystemName()); b.addPropertyChangeListener(this); } }); log.debug("updateNameList: sysNameList size= {}", sysNameList.size()); }</code><technical_language>Another example of setting null loading..</technical_language>

Target:
protected synchronized void updateNameList() { if (sysNameList != null) { for (int i = 0; i < sysNameList.size(); i++) { NamedBean b = getBySystemName(sysNameList.get(i)); if (b != null) { b.removePropertyChangeListener(this); } } } sysNameList = new ArrayList<>(); getManager().getNamedBeanSet().forEach(b -> { if (b.getSystemName().startsWith(getLogixSystemPrefix())) { sysNameList.add(b.getSystemName()); b.addPropertyChangeListener(this); } }); log.debug("updateNameList: sysNameList size= {}", sysNameList.size()); }
Source:
<code>private DefaultHttpClient getHttpClient(MetricServiceAppConfiguration passedConfig) { PoolingClientConnectionManager cm = new PoolingClientConnectionManager(); int maxTotalPoolConnections = passedConfig.getMetricServiceConfig().getMaxTotalPoolConnections(); int maxPoolConnectionsPerRoute = passedConfig.getMetricServiceConfig().getMaxPoolConnectionsPerRoute(); <START> log.info("Setting up pool with total connections and max connections per route.", maxTotalPoolConnections, maxPoolConnectionsPerRoute); <END> cm.setMaxTotal(maxTotalPoolConnections); cm.setDefaultMaxPerRoute(maxPoolConnectionsPerRoute); return new DefaultHttpClient(cm); }</code><technical_language>debug</technical_language>

Target:
private DefaultHttpClient getHttpClient(MetricServiceAppConfiguration passedConfig) { PoolingClientConnectionManager cm = new PoolingClientConnectionManager(); int maxTotalPoolConnections = passedConfig.getMetricServiceConfig().getMaxTotalPoolConnections(); int maxPoolConnectionsPerRoute = passedConfig.getMetricServiceConfig().getMaxPoolConnectionsPerRoute(); log.debug("Setting up pool with total connections and max connections per route.", maxTotalPoolConnections, maxPoolConnectionsPerRoute); cm.setMaxTotal(maxTotalPoolConnections); cm.setDefaultMaxPerRoute(maxPoolConnectionsPerRoute); return new DefaultHttpClient(cm); }
Source:
<code>public long getVolume() { <START> return BigDecimal.valueOf((4.0 / 3.0) * Math.PI) <END> .multiply(BigDecimal.valueOf(radius.getX())) .multiply(BigDecimal.valueOf(radius.getY())) .multiply(BigDecimal.valueOf(radius.getZ())) .setScale(0, RoundingMode.FLOOR) .longValue(); }</code><technical_language>Curious PI a constant in other class, this computation</technical_language>

Target:
public long getVolume() { return ELLIPSOID_BASE_MULTIPLIER .multiply(BigDecimal.valueOf(radius.getX())) .multiply(BigDecimal.valueOf(radius.getY())) .multiply(BigDecimal.valueOf(radius.getZ())) .setScale(0, RoundingMode.FLOOR) .longValue(); }
Source:
<code>private void searchForAttributeOfGivenType_AndCheckIfTypeMatches(String attributeTypeUuid) throws Exception { SimpleObject response2 = deserialize(handle(newGetRequest(getURI(), new Parameter("attributeType", attributeTypeUuid)))); for(Object result : Util.getResultsList(response2)){ <START> Object resultAttributeTypeUuid = PropertyUtils.getProperty(PropertyUtils.getProperty(result, "attributeType"), "uuid"); <END> Assert.assertThat((String)resultAttributeTypeUuid, is(attributeTypeUuid)); } }</code><technical_language>Util class methods for fetching property values property name</technical_language>

Target:
private void searchForAttributeOfGivenType_AndCheckIfTypeMatches(String attributeTypeUuid) throws Exception { SimpleObject response2 = deserialize(handle(newGetRequest(getURI(), new Parameter("attributeType", attributeTypeUuid)))); assertThat(Util.getResultsList(response2), is(not(empty()))); for (Object result : Util.getResultsList(response2)) { Object resultAttributeTypeUuid = Util.getByPath(Util.getByPath(result, "attributeType"), "uuid"); Assert.assertThat((String) resultAttributeTypeUuid, is(attributeTypeUuid)); } }
Source:
<code>default double getDistanceL1(Point2D<?, ?> pt) { assert pt != null : "Point must not be null"; final int dx; if (pt.ix() < getMinX()) { dx = getMinX() - pt.ix(); } else if (pt.ix() > getMaxX()) { dx = pt.ix() - getMaxX(); } else { dx = 0; } final int dy; if (pt.iy() < getMinY()) { dy = getMinY() - pt.iy(); } else if (pt.iy() > getMaxY()) { dy = pt.iy() - getMaxY(); } else { dy = 0; } <START> return dx + (double) dy; <END> }</code><technical_language>good force usage of double addition instead of addition integers casting resulting integer a double</technical_language>

Target:
default double getDistanceL1(Point2D<?, ?> pt) { assert pt != null : "Point must not be null"; final int dx; if (pt.ix() < getMinX()) { dx = getMinX() - pt.ix(); } else if (pt.ix() > getMaxX()) { dx = pt.ix() - getMaxX(); } else { dx = 0; } final int dy; if (pt.iy() < getMinY()) { dy = getMinY() - pt.iy(); } else if (pt.iy() > getMaxY()) { dy = pt.iy() - getMaxY(); } else { dy = 0; } return (double) (dx + dy); }
Source:
<code>public void getRequiredMemberGroupAndUserAttributesFromOneService() throws Exception { System.out.println(CLASS_NAME + "getRequiredMemberGroupAndUserAttributesFromOneService"); vo = setUpVo(); member = setUpMember(); group = setUpGroup(); facility = setUpFacility(); resource = setUpResource(); this.setUpMemberToResource(); service = setUpService(); attributes = setUpRequiredAttributes(); perun.getResourcesManager().assignService(sess, resource, service); List<Attribute> reqAttr = attributesManager.getRequiredAttributes(sess, member, group, true); <START> assertNotNull("unable to get required member / member-group attributes for one service", reqAttr); <END> assertEquals("getRequiredAtributes(sess, member, group, true) returns wrong count of attributes", 3, reqAttr.size()); }</code><technical_language>user / member / member-group</technical_language>

Target:
public void getRequiredMemberGroupAndUserAttributesFromOneService() throws Exception { System.out.println(CLASS_NAME + "getRequiredMemberGroupAndUserAttributesFromOneService"); vo = setUpVo(); member = setUpMember(); group = setUpGroup(); facility = setUpFacility(); resource = setUpResource(); this.setUpMemberToResource(); service = setUpService(); attributes = setUpRequiredAttributes(); perun.getResourcesManager().assignService(sess, resource, service); List<Attribute> reqAttr = attributesManager.getRequiredAttributes(sess, member, group, true); assertNotNull("unable to get required user / member / member-group attributes for one service", reqAttr); assertEquals("getRequiredAttributes(sess, member, group, true) returns wrong count of attributes", 3, reqAttr.size()); }
Source:
<code>private boolean sendRequest(final URL queryUrl) throws IOException, JSONException { Logger.v(TAG, "Sending discovery request to:" + queryUrl); Map<String, String> headers = new HashMap<>(); headers.put(WebRequestHandler.HEADER_ACCEPT, WebRequestHandler.HEADER_ACCEPT_JSON); if (mCorrelationId != null) { headers.put(AuthenticationConstants.AAD.CLIENT_REQUEST_ID, mCorrelationId.toString()); headers.put(AuthenticationConstants.AAD.RETURN_CLIENT_REQUEST_ID, "true"); } HttpWebResponse webResponse = null; try { ClientMetrics.INSTANCE.beginClientMetricsRecord(queryUrl, mCorrelationId, headers); try { webResponse = mWebrequestHandler.sendGet(queryUrl, headers); ClientMetrics.INSTANCE.setLastError(null); } catch (IOException e) { if (webResponse != null) { ClientMetrics.INSTANCE.setLastError(String.valueOf(webResponse.getStatusCode())); } throw e; } final Map<String, String> discoveryResponse = parseResponse(webResponse); if(discoveryResponse.containsKey(AuthenticationConstants.OAuth2.ERROR_CODES)) { <START> String errorCodes = discoveryResponse.get(AuthenticationConstants.OAuth2.ERROR_CODES); <END> ClientMetrics.INSTANCE.setLastError(errorCodes); } return (discoveryResponse.containsKey(TENANT_DISCOVERY_ENDPOINT)); } finally { ClientMetrics.INSTANCE.endClientMetricsRecord(ClientMetricsEndpointType.INSTANCE_DISCOVERY, mCorrelationId); } }</code><technical_language>final</technical_language>

Target:
private boolean sendRequest(final URL queryUrl) throws IOException, JSONException { Logger.v(TAG, "Sending discovery request to:" + queryUrl); final Map<String, String> headers = new HashMap<>(); headers.put(WebRequestHandler.HEADER_ACCEPT, WebRequestHandler.HEADER_ACCEPT_JSON); if (mCorrelationId != null) { headers.put(AuthenticationConstants.AAD.CLIENT_REQUEST_ID, mCorrelationId.toString()); headers.put(AuthenticationConstants.AAD.RETURN_CLIENT_REQUEST_ID, "true"); } final HttpWebResponse webResponse; try { ClientMetrics.INSTANCE.beginClientMetricsRecord(queryUrl, mCorrelationId, headers); webResponse = mWebrequestHandler.sendGet(queryUrl, headers); ClientMetrics.INSTANCE.setLastError(null); final Map<String, String> discoveryResponse = parseResponse(webResponse); if(discoveryResponse.containsKey(AuthenticationConstants.OAuth2.ERROR_CODES)) { final String errorCodes = discoveryResponse.get(AuthenticationConstants.OAuth2.ERROR_CODES); ClientMetrics.INSTANCE.setLastError(errorCodes); } return (discoveryResponse.containsKey(TENANT_DISCOVERY_ENDPOINT)); } finally { ClientMetrics.INSTANCE.endClientMetricsRecord(ClientMetricsEndpointType.INSTANCE_DISCOVERY, mCorrelationId); } }
Source:
<code>MapColor getColor(int x, int y) throws IllegalArgumentException; Image toImage(); Image toImage(java.awt.Color color); Builder toBuilder(MapCanvas canvas); <START> interface Builder extends DataBuilder<MapCanvas> { <END> Builder paintAll(MapColor color); Builder paint(int startX, int startY, int endX, int endY, MapColor mapColor); default Builder paint(final Vector2i start, final Vector2i end, final MapColor mapColor) { return this.paint( Math.min(start.getX(), end.getX()), Math.max(start.getX(), end.getX()), Math.min(start.getY(), end.getY()), Math.min(start.getY(), end.getY()), mapColor); } Builder from(MapCanvas canvas); Builder fromImage(Image image) throws IllegalArgumentException; @Override Optional<MapCanvas> build(DataView container) throws InvalidDataException; MapCanvas build(); }</code><technical_language>Builder extend DataBuilder</technical_language>

Target:
MapColor getColor(int x, int y) throws IllegalArgumentException; Image toImage(); Image toImage(java.awt.Color color); Builder toBuilder(); interface Builder extends ResettableBuilder<MapCanvas, Builder> { Builder paintAll(MapColor color); Builder paint(int startX, int startY, int endX, int endY, MapColor mapColor); default Builder paint(final Vector2i start, final Vector2i end, final MapColor mapColor) { return this.paint( Math.min(start.getX(), end.getX()), Math.max(start.getX(), end.getX()), Math.min(start.getY(), end.getY()), Math.min(start.getY(), end.getY()), mapColor); } Builder from(MapCanvas canvas); Builder fromImage(Image image) throws IllegalArgumentException; Builder fromContainer(DataView container); MapCanvas build(); }
Source:
<code>public void testParseIntEmpty() throws EvaluationException { try { PARSE_INTEGER.evaluate(s("")); fail("parse_Integer(\"\") did not throw"); } catch (EvaluationException e){ <START> assertThat("parse_Integer(\"\") throws", true, instanceOf(Boolean.class)); <END> } }</code><technical_language>I recommend @Test(expected = EvaluationException.class) for tests</technical_language>

Target:
public void testParseIntEmpty() throws EvaluationException { PARSE_INTEGER.evaluate(s("")); }
Source:
<code>public void cleanup(MessageContext messageContext) { <START> LOG.debug("cleanup"); <END> }</code><technical_language>Add a proper log message</technical_language>

Target:
public void cleanup(MessageContext messageContext) { LOG.debug("cleaning up AxisToClientConnectorBridge"); }
Source:
<code>private void evaluateExpression(final JexlVCMatchExp exp) { if (this.jContext == null){ createContext(); } try { final Boolean value = (Boolean) exp.exp.evaluate(jContext); jexl.put(exp, value == null ? false : value); <START> } catch (final JexlException e) { <END> jexl.put(exp,false); throw new IllegalArgumentException(String.format("Invalid JEXL expression detected for %s with message %s", exp.name, "no message" )); } }</code><technical_language>In previous version this handled exceptions "undefined variable" differently other exceptions. I a separate catch block for JexlException.Variable jexl.put(exp,false) catch for generic JexlException get translated IllegalArgumentException</technical_language>

Target:
private void evaluateExpression(final JexlVCMatchExp exp) { if (this.jContext == null) { createContext(); } try { final Boolean value = (Boolean) exp.exp.evaluate(jContext); jexl.put(exp, value == null ? false : value); } catch (final JexlException.Variable e) { jexl.put(exp,false); } catch (final JexlException e) { throw new IllegalArgumentException(String.format("Invalid JEXL expression detected for %s", exp.name), e); } }
Source:
<code>public void stop() throws InterruptedException { synchronized (lifecycleLock) { Preconditions.checkState(started, "not started"); try { log.info("Stopping WorkerTaskMonitor."); started = false; exec.shutdownNow(); pathChildrenCache.close(); taskRunner.stop(); <START> doneStopping.await(); <END> } catch (InterruptedException e) { throw e; } catch (Exception e) { log.makeAlert(e, "Exception stopping WorkerTaskMonitor") .emit(); } } }</code><technical_language>this timeout</technical_language>

Target:
public void stop() throws InterruptedException { synchronized (lifecycleLock) { Preconditions.checkState(started, "not started"); try { started = false; exec.shutdownNow(); pathChildrenCache.close(); taskRunner.stop(); if (!doneStopping.await(STOP_WARNING_SECONDS, TimeUnit.SECONDS)) { log.warn("WorkerTaskMonitor taking longer than %s seconds to exit. Still waiting...", STOP_WARNING_SECONDS); doneStopping.await(); } log.info("Stopped WorkerTaskMonitor."); } catch (InterruptedException e) { throw e; } catch (Exception e) { log.makeAlert(e, "Exception stopping WorkerTaskMonitor") .emit(); } } }
Source:
<code>public static ColumnIO getArrayElementColumn(ColumnIO columnIO) { <START> while ((columnIO instanceof GroupColumnIO) && !columnIO.getType().isRepetition(REPEATED)) { <END> columnIO = ((GroupColumnIO) columnIO).getChild(0); } if (columnIO instanceof GroupColumnIO && columnIO.getType().getOriginalType() == null && ((GroupColumnIO) columnIO).getChildrenCount() == 1) { return ((GroupColumnIO) columnIO).getChild(0); } return columnIO; }</code><technical_language>parentheses instanceof check is necessary</technical_language>

Target:
public static ColumnIO getArrayElementColumn(ColumnIO columnIO) { while (columnIO instanceof GroupColumnIO && !columnIO.getType().isRepetition(REPEATED)) { columnIO = ((GroupColumnIO) columnIO).getChild(0); } if (columnIO instanceof GroupColumnIO && columnIO.getType().getOriginalType() == null && ((GroupColumnIO) columnIO).getChildrenCount() == 1) { return ((GroupColumnIO) columnIO).getChild(0); } return columnIO; }
Source:
<code>public void packRefs() throws IOException { Collection<Ref> refs = repo.getAllRefs().values(); ArrayList<String> refsToBePacked = new ArrayList<String>(refs.size()); int packRefsCnt = 0; pm.beginTask(JGitText.get().packRefs, refs.size()); try { for (Ref ref : refs) { if (!ref.isSymbolic() && ref.getStorage().isLoose()) { refsToBePacked.add(ref.getName()); packRefsCnt++; } pm.update(1); } ((RefDirectory) repo.getRefDatabase()).pack(refsToBePacked <START> .toArray(new String[packRefsCnt])); <END> } finally { pm.endTask(); } }</code><technical_language>This is I suggest passing in List<String> RefDirectory</technical_language>

Target:
public void packRefs() throws IOException { Collection<Ref> refs = repo.getAllRefs().values(); List<String> refsToBePacked = new ArrayList<String>(refs.size()); pm.beginTask(JGitText.get().packRefs, refs.size()); try { for (Ref ref : refs) { if (!ref.isSymbolic() && ref.getStorage().isLoose()) refsToBePacked.add(ref.getName()); pm.update(1); } ((RefDirectory) repo.getRefDatabase()).pack(refsToBePacked); } finally { pm.endTask(); } }
Source:
<code>protected Void doInBackground(File... params) { synchronized (mDiskCacheLock) { <START> mDiskLruCache = new DiskLruImageCache(mContext, "thumbnailCache", DISK_CACHE_SIZE, mCompressFormat,mCompressQuality); <END> try { OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext); mClient = OwnCloudClientManagerFactory.getDefaultSingleton(). getClientFor(ocAccount, mContext); } catch (AccountNotFoundException e) { e.printStackTrace(); } catch (AuthenticatorException e) { e.printStackTrace(); } catch (OperationCanceledException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } mDiskCacheStarting = false; mDiskCacheLock.notifyAll(); } return null; }</code><technical_language>Please, try lines 100 characters. Longer lines harder handle in Github reviews</technical_language>

Target:
protected Void doInBackground(File... params) { synchronized (thumbnailDiskCacheLock) { mThumbnailCache = new DiskLruImageCache(mContext, "thumbnailCache", DISK_CACHE_SIZE, mCompressFormat, mCompressQuality); try { OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext); mClient = OwnCloudClientManagerFactory.getDefaultSingleton(). getClientFor(ocAccount, mContext); } catch (AccountNotFoundException e) { e.printStackTrace(); } catch (AuthenticatorException e) { e.printStackTrace(); } catch (OperationCanceledException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } mThumbnailCacheStarting = false; thumbnailDiskCacheLock.notifyAll(); } return null; }
Source:
<code>protected DimensionHandler[] makeDimensionHandlers(final List<String> mergedDimensions, final List<ColumnCapabilitiesImpl> dimCapabilities) { final DimensionHandler[] handlers = new DimensionHandler[mergedDimensions.size()]; for (int i = 0; i < mergedDimensions.size(); i++) { ColumnCapabilities capabilities = dimCapabilities.get(i); String dimName = mergedDimensions.get(i); if (capabilities.getType() == ValueType.STRING && capabilities.isDictionaryEncoded()) { handlers[i] = new StringDimensionHandler(dimName); } if (capabilities.getType() == ValueType.LONG && !capabilities.isDictionaryEncoded()) { handlers[i] = new LongDimensionHandler(dimName); } if (capabilities.getType() == ValueType.FLOAT && !capabilities.isDictionaryEncoded()) { handlers[i] = new FloatDimensionHandler(dimName); } <START> } <END> return handlers; }</code><technical_language>if cases met? errors</technical_language>

Target:
protected DimensionHandler[] makeDimensionHandlers(final List<String> mergedDimensions, final List<ColumnCapabilitiesImpl> dimCapabilities) { final DimensionHandler[] handlers = new DimensionHandler[mergedDimensions.size()]; for (int i = 0; i < mergedDimensions.size(); i++) { ColumnCapabilities capabilities = dimCapabilities.get(i); String dimName = mergedDimensions.get(i); handlers[i] = DimensionHandlerUtil.getHandlerFromCapabilities(dimName, capabilities); } return handlers; }
Source:
<code>private boolean defer(ReplicaPushRequest req) { if (waitingForRetry()) { return true; } for (ReceiveCommand <START> n : <END> req.getCommands()) { ReceiveCommand o = waiting.get(n.getRefName()); if (o == null) { o = running.get(n.getRefName()); } if (o != null) { return true; } } return false; }</code><technical_language>s/n/cmd/</technical_language>

Target:
private boolean defer(ReplicaPushRequest req) { if (waitingForRetry()) { return true; } for (ReceiveCommand nextCmd : req.getCommands()) { ReceiveCommand priorCmd = waiting.get(nextCmd.getRefName()); if (priorCmd == null) { priorCmd = running.get(nextCmd.getRefName()); } if (priorCmd != null) { return true; } } return false; }
Source:
<code>public void unlocksImmutableTimestampLockIfGettingMinLockedInVersionThrows() throws InterruptedException { Exception illegalStateException = new IllegalStateException(); when(timestampService.getFreshTimestamp()).thenReturn(5L); when(lockService.lock(eq(LOCK_CLIENT.getClientId()), any())).thenReturn(LOCK_REFRESH_TOKEN); when(lockService.getMinLockedInVersionId(any(LockClient.class))).thenThrow(illegalStateException); try { <START> timelock.lockImmutableTimestamp(); <END> fail(); } catch (Exception e) { assertEquals(e, illegalStateException); } verify(lockService).unlock(LOCK_REFRESH_TOKEN); }</code><technical_language>Nit: assertThatThrownBy</technical_language>

Target:
public void unlocksImmutableTimestampLockIfGettingMinLockedInVersionThrows() throws InterruptedException { Exception illegalStateException = new IllegalStateException(); when(timestampService.getFreshTimestamp()).thenReturn(5L); when(lockService.lock(eq(LOCK_CLIENT.getClientId()), any())).thenReturn(LOCK_REFRESH_TOKEN); when(lockService.getMinLockedInVersionId(any(String.class))).thenThrow(illegalStateException); assertThatThrownBy(timelock::lockImmutableTimestamp).hasCause(illegalStateException); verify(lockService).unlock(LOCK_REFRESH_TOKEN); }
Source:
<code>public void showProgressDialog(Context context) { if (!mShowDialog) { return; } if (mProgressDialog == null) { if (TextUtils.isEmpty(mDialogMsg)) { mDialogMsg = "Loading. Please wait..."; } mProgressDialog = ProgressDialog.show(context, "", mDialogMsg, true); return; } if (mProgressDialog.isShowing()) { return; } <START> <END> mProgressDialog.show(); }</code><technical_language>Problem je context koji se menja, zato treba izbeci ovaj if. public void showProgressDialog(Context context) { if (!mShowDialog) { return; } if (TextUtils.isEmpty(mDialogMsg)) { mDialogMsg = "Loading. Please wait..."; } if (mProgressDialog != null && mProgressDialog.isShowing()) { return; } mProgressDialog = ProgressDialog.show(context, "", mDialogMsg, true); }</technical_language>

Target:
public void showProgressDialog(Context context) { if (!mShowDialog) { return; } if (mProgressDialog != null && mProgressDialog.isShowing()) { return; } if (TextUtils.isEmpty(mDialogMsg)) { mDialogMsg = "Loading. Please wait..."; } mProgressDialog = ProgressDialog.show(context, "", mDialogMsg, true); }
Source:
<code>public static boolean openMoveWizard( IStructuredSelection structuredSelection) { <START> return runCommand(LTK_MOVE_ID, structuredSelection, new HashMap<>()); <END> }</code><technical_language>Collections.emptyMap() save a bytes of RAM a new empty map</technical_language>

Target:
public static boolean openMoveWizard( IStructuredSelection structuredSelection) { return runCommand(LTK_MOVE_ID, structuredSelection, Collections.emptyMap()); }
Source:
<code><START> public Client(URL url, String username, String password, SSLConnectionSocketFactory sslConnectionSocketFactory, SSLContext sslContext) throws MalformedURLException, URISyntaxException { <END> this.rootUri = url.toURI(); this.rt = new RestTemplate(getRequestFactory(url, username, password, sslConnectionSocketFactory, sslContext)); this.rt.setMessageConverters(getMessageConverters()); }</code><technical_language>instead constructors, SSLConnectionSocketFactory SSLContext? I find a more common of expressing effectively mutually exclusive arguments</technical_language>

Target:
private Client(URL url, String username, String password, SSLConnectionSocketFactory sslConnectionSocketFactory, SSLContext sslContext) throws MalformedURLException, URISyntaxException { this.rootUri = url.toURI(); this.rt = new RestTemplate(getRequestFactory(url, username, password, sslConnectionSocketFactory, sslContext)); this.rt.setMessageConverters(getMessageConverters()); }
Source:
<code>private Image getStereotypeIcon(final Stereotype stereotype) { org.eclipse.uml2.uml.Image expectedImageUML = stereotype.getIcons().get(0); assertNotNull("The Stereotype must contains an icon.", expectedImageUML); String expectedImageId = ImageUtil.getImageId(expectedImageUML); <START> assertFalse(expectedImageId.isEmpty()); <END> return imageRegistry.get(expectedImageId); }</code><technical_language>Please add error message</technical_language>

Target:
private Image getStereotypeIcon(final Stereotype stereotype) { org.eclipse.uml2.uml.Image expectedImageUML = stereotype.getIcons().get(0); assertNotNull("The Stereotype must contains an icon.", expectedImageUML); String expectedImageId = ImageUtil.getImageId(expectedImageUML); assertFalse("The String ID of the expected image must not be empty.", expectedImageId.isEmpty()); return imageRegistry.get(expectedImageId); }
Source:
<code>private AWSS3V4Signer buildSigV4Signer(final String region) { boolean isChunkedEncoding = true; <START> AWSS3V4Signer v4Signer = new AWSS3V4Signer(isChunkedEncoding); <END> v4Signer.setRegionName(region); v4Signer.setServiceName(AmazonS3Client.S3_SERVICE_NAME); return v4Signer; }</code><technical_language>For case this class this is fine confusing if another developer sets configuration option honored in retry policy</technical_language>

Target:
private AWSS3V4Signer buildSigV4Signer(final String region) { AWSS3V4Signer v4Signer = new AWSS3V4Signer(isChunkedEncodingDisabled); v4Signer.setRegionName(region); v4Signer.setServiceName(AmazonS3Client.S3_SERVICE_NAME); return v4Signer; }
Source:
<code>public void clickingButtonForLong_callsLongClickListener() { UrlWidget widget = createWidget(promptWithAnswer(new StringData("blah"))); Button urlButton = widget.findViewById(R.id.url_button); urlButton.performLongClick(); <START> assertThat(listener.onLongClick(urlButton), equalTo(true)); <END> }</code><technical_language>I a test this is pass a mock(Listener.class) Widget's OnLongClickListener check is called (using when) call urlButton.performLongClick(). sense? listener URL button listener widget</technical_language>

Target:
public void clickingButtonForLong_callsLongClickListener() { UrlWidget widget = createWidget(promptWithAnswer(null)); widget.setOnLongClickListener(listener); widget.getBinding().urlButton.performLongClick(); verify(listener).onLongClick(widget.getBinding().urlButton); }
Source:
<code>public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) { <START> if (extensionPoint.equals(SCHEMA_XP)) { <END> AvroSchemaDescriptor descriptor = (AvroSchemaDescriptor) contribution; try { URL url = contributor.getRuntimeContext().getResource(descriptor.file); InputStream stream = url == null ? null : url.openStream(); if (stream == null) { log.error(String.format("Could not load stream for file %s.", descriptor.file)); return; } schemaStoreService.addSchema(new Schema.Parser().parse(stream)); } catch (IOException e) { log.error(String.format("Could not load stream for file %s. Error message: %s", descriptor.file, e.getMessage())); } } else if (extensionPoint.equals(FACTORY_XP)) { try { AvroFactoryDescriptor descriptor = (AvroFactoryDescriptor) contribution; Class<Object> typeClass = (Class<Object>) Class.forName(descriptor.type); Class<AvroFactory<?>> factoryClass = (Class<AvroFactory<?>>) Class.forName(descriptor.clazz); Constructor<AvroFactory<?>> factoryConstructor = factoryClass.getConstructor(AvroFactoryContext.class); factoryConstructor.newInstance((AvroFactoryContext) null); factoryService.register(typeClass, factoryClass); } catch (Exception e) { log.error(e); } } else if (extensionPoint.equals(REPLACEMENT_XP)) { factoryService.register((AvroReplacementDescriptor) contribution); } else { throw new RuntimeServiceException("Unknown extension point: " + extensionPoint); } }</code><technical_language>reverse SCHEMA_XP extensionPoint, this prevent NPE if extensionPoint is null</technical_language>

Target:
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) { if (SCHEMA_XP.equals(extensionPoint)) { schemaDescriptors.addContribution((AvroSchemaDescriptor) contribution); } else if (FACTORY_XP.equals(extensionPoint)) { schemaFactoryDescriptors.addContribution((AvroSchemaFactoryDescriptor) contribution); } else if (REPLACEMENT_XP.equals(extensionPoint)) { replacementDescriptors.addContribution((AvroReplacementDescriptor) contribution); } else { throw new RuntimeServiceException("Unknown extension point: " + extensionPoint); } }
Source:
<code>public void invoke(IN value, SinkFunction.Context context) throws Exception { <START> buckets.onElement( <END> value, context.currentProcessingTime(), context.timestamp(), context.currentWatermark()); }</code><technical_language>do need this change</technical_language>

Target:
public void invoke(IN value, SinkFunction.Context context) throws Exception { this.helper.onElement( value, context.currentProcessingTime(), context.timestamp(), context.currentWatermark()); }
Source:
<code>private void onRemove() { ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } model.startProgress(); <START> AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery<>(storagePools -> { <END> if (storagePools != null && !storagePools.isEmpty()) { StoragePool storagePool = storagePools.get(0); List<ActionParametersBase> vmTemplateImportExportParams = getSelectedItems() .stream() .map(item -> new VmTemplateImportExportParameters(item.getId(), getEntity().getId(), storagePool.getId())) .collect(Collectors.toList()); Frontend.getInstance().runMultipleAction( ActionType.RemoveUnregisteredVmTemplate, vmTemplateImportExportParams, result -> { ConfirmationModel localModel = (ConfirmationModel) result.getState(); localModel.stopProgress(); cancel(); }, model); } }), getEntity().getId()); }</code><technical_language>able get storage pool entity. I.e. instead of this query, use: getEntity().getStoragePoolId()</technical_language>

Target:
private void onRemove() { ConfirmationModel model = (ConfirmationModel) getWindow(); if (model.getProgress() != null) { return; } model.startProgress(); List<ActionParametersBase> vmTemplateImportExportParams = getSelectedItems() .stream() .map(item -> new VmTemplateImportExportParameters(item.getId(), getEntity().getId(), getEntity().getStoragePoolId())) .collect(Collectors.toList()); Frontend.getInstance().runMultipleAction( ActionType.RemoveUnregisteredVmTemplate, vmTemplateImportExportParams, result -> { ConfirmationModel localModel = (ConfirmationModel) result.getState(); localModel.stopProgress(); cancel(); }, model); }
Source:
<code>private void showSignature(View dialogView) { byte[] cert = null; String newLine = System.getProperty("line.separator"); try { cert = mCertificate.getEncoded(); } catch (CertificateEncodingException e) { e.printStackTrace(); } TextView certFingerprintView = ((TextView)dialogView.findViewById(R.id.value_certificate_fingerprint)); TextView algorithmView = ((TextView)dialogView.findViewById(R.id.value_signature_algorithm)); <START> certFingerprintView.setText("SHA-256:" + newLine <END> + getDigestHexBytesWithColon(getDigest("SHA-256", cert)) + newLine + newLine + "SHA-1:" + newLine + getDigestHexBytesWithColon(getDigest("SHA-1", cert)) + newLine + newLine + "MD5:" + newLine + getDigestHexBytesWithColon(getDigest("MD5", cert))); algorithmView.setText(mCertificate.getSigAlgName()); }</code><technical_language>If of digest algorithms exist, this result in a text "SHA-1: NULL" in text view. check result of getDigest(...) and, if NULL, avoid line in message</technical_language>

Target:
private void showSignature(View dialogView) { byte[] cert = null; TextView certFingerprintView = ((TextView) dialogView.findViewById(R.id.value_certificate_fingerprint)); TextView algorithmView = ((TextView) dialogView.findViewById(R.id.value_signature_algorithm)); try { cert = mCertificate.getEncoded(); if (cert == null) { certFingerprintView.setText(R.string.certificate_load_problem); algorithmView.setText(R.string.certificate_load_problem); } else { certFingerprintView.setText( getDigestHexBytesWithColonsAndNewLines(dialogView, "SHA-256", cert) + getDigestHexBytesWithColonsAndNewLines(dialogView, "SHA-1", cert) + getDigestHexBytesWithColonsAndNewLines(dialogView, "MD5", cert)); algorithmView.setText(mCertificate.getSigAlgName()); } } catch (CertificateEncodingException e) { Log.e(TAG, "Problem while trying to decode the certificate."); } }
Source:
<code>private void updateText(Text text) { if (text == null || text.isDisposed()) <START> return; <END> text.setMessage(NLS.bind(QuickAccessMessages.QuickAccess_EnterSearch, getQuickAccessTriggerSequenceFormat())); GC gc = new GC(text); if (Util.isWin32() || Util.isGtk()) { FontMetrics fm = gc.getFontMetrics(); int wHint = QuickAccessMessages.QuickAccess_EnterSearch.length() * fm.getAverageCharWidth(); int hHint = fm.getHeight(); gc.dispose(); text.setSize(text.computeSize(wHint, hHint)); } else { Point p = gc.textExtent(QuickAccessMessages.QuickAccess_EnterSearch); Rectangle r = text.computeTrim(0, 0, p.x, p.y); gc.dispose(); GridDataFactory.fillDefaults().hint(r.width - r.x, SWT.DEFAULT).applyTo(text); } }</code><technical_language>{} single statements</technical_language>

Target:
private void updateText(Text text) { if (text == null || text.isDisposed()) { return; } text.setMessage(NLS.bind(QuickAccessMessages.QuickAccess_EnterSearch, getQuickAccessTriggerSequenceFormat())); GC gc = new GC(text); if (Util.isWin32() || Util.isGtk()) { FontMetrics fm = gc.getFontMetrics(); int wHint = QuickAccessMessages.QuickAccess_EnterSearch.length() * fm.getAverageCharWidth(); int hHint = fm.getHeight(); gc.dispose(); text.setSize(text.computeSize(wHint, hHint)); } else { Point p = gc.textExtent(QuickAccessMessages.QuickAccess_EnterSearch); Rectangle r = text.computeTrim(0, 0, p.x, p.y); gc.dispose(); GridDataFactory.fillDefaults().hint(r.width - r.x, SWT.DEFAULT).applyTo(text); } }
Source:
<code>public JSONObject getTopology(Map<Integer, String> hostGroups, Multimap<Integer, Long> partitionReplicas, Map<Integer, Long> partitionMasters) throws JSONException { int hostCount = getHostCount(); <START> int partitionCount = getPartitionCount(); <END> int sitesPerHost = getSitesPerHost(); if (hostCount != hostGroups.size() && partitionReplicas.isEmpty() && partitionMasters.isEmpty()) { throw new RuntimeException("Provided " + hostGroups.size() + " host ids when host count is " + hostCount); } JSONObject topo; if (Boolean.valueOf(System.getenv("VOLT_REPLICA_FALLBACK"))) { topo = fallbackPlacementStrategy(Lists.newArrayList(hostGroups.keySet()), hostCount, partitionCount, sitesPerHost); } else { try { topo = groupAwarePlacementStrategy(hostGroups, partitionReplicas, partitionMasters, partitionCount, sitesPerHost); } catch (Exception e) { e.printStackTrace(); hostLog.error("Unable to use optimal replica placement strategy. " + "Falling back to a less optimal strategy that may result in worse performance. " + "Original error was " + e.getMessage()); topo = fallbackPlacementStrategy(Lists.newArrayList(hostGroups.keySet()), hostCount, partitionCount, sitesPerHost); } } if (hostLog.isDebugEnabled()) { hostLog.debug("TOPO: " + topo.toString(2)); } return topo; }</code><technical_language>return of getPartitionCount() vary depends hosts in cluster. In rejoin case, if more nodes missing, call getPartitionCount() get wrong number of master partitions. partitionMasters.size() instead</technical_language>

Target:
public JSONObject getTopology(Map<Integer, String> hostGroups, Multimap<Integer, Long> partitionReplicas, Map<Integer, Long> partitionMasters) throws JSONException { int hostCount = getHostCount(); int partitionCount = partitionMasters.isEmpty() ? getPartitionCount() : partitionMasters.size(); int sitesPerHost = getSitesPerHost(); if (hostCount != hostGroups.size() && partitionReplicas.isEmpty() && partitionMasters.isEmpty()) { throw new RuntimeException("Provided " + hostGroups.size() + " host ids when host count is " + hostCount); } JSONObject topo; if (Boolean.valueOf(System.getenv("VOLT_REPLICA_FALLBACK"))) { topo = fallbackPlacementStrategy(Lists.newArrayList(hostGroups.keySet()), hostCount, partitionCount, sitesPerHost); } else { try { topo = groupAwarePlacementStrategy(hostGroups, partitionReplicas, partitionMasters, partitionCount, sitesPerHost); } catch (Exception e) { e.printStackTrace(); hostLog.error("Unable to use optimal replica placement strategy. " + "Falling back to a less optimal strategy that may result in worse performance. " + "Original error was " + e.getMessage()); topo = fallbackPlacementStrategy(Lists.newArrayList(hostGroups.keySet()), hostCount, partitionCount, sitesPerHost); } } if (hostLog.isDebugEnabled()) { hostLog.debug("TOPO: " + topo.toString(2)); } return topo; }
Source:
<code>public void writeLine(String line) { if (textSizeLimit < 0) { lines.add(line); return; } if (consumedTextSize >= textSizeLimit) { return; } <START> if (line != null && (line.length() + consumedTextSize > textSizeLimit)) { <END> long lineSizeLimit = textSizeLimit - consumedTextSize; lines.add(line.substring(0, (int) lineSizeLimit)); consumedTextSize += lineSizeLimit; return; } lines.add(line); consumedTextSize += line == null ? 0 : line.length(); }</code><technical_language>consume testSizeLimit characters? more relevant consume testSizeLimit characters? I personally introduce a new class for that</technical_language>

Target:
public void writeLine(String line) { lines.add(line); }
Source:
<code>private static <T> T convertZonedDateTime(ZonedDateTime zdt, Class<T> returnType) { if (returnType == ZonedDateTime.class) { return (T) zdt; } else if (returnType == Instant.class) { return (T) zdt.toInstant(); } else if (returnType.isAssignableFrom(java.util.Date.class)) { return (T) java.util.Date.from(zdt.toInstant()); } else if (returnType.isAssignableFrom(java.sql.Time.class)) { return (T) new java.sql.Time(zdt.toInstant().truncatedTo(ChronoUnit.SECONDS).toEpochMilli()); } else if (returnType.isAssignableFrom(Timestamp.class)) { return (T) Timestamp.from(zdt.toInstant()); } else if (returnType.isAssignableFrom(Long.class)) { return (T) Long.valueOf(zdt.toInstant().toEpochMilli()); } else if (returnType.isAssignableFrom(Calendar.class)) { return (T) GregorianCalendar.from(zdt); } else { <START> throw new ClassCastException("unsupported return type " + returnType.getSimpleName()); <END> } }</code><technical_language>if return type is java.sql.Date</technical_language>

Target:
private static <T> T convertZonedDateTime(ZonedDateTime zdt, Class<T> returnType) { if (returnType == ZonedDateTime.class) { return (T) zdt; } else if (returnType == Instant.class) { return (T) zdt.toInstant(); } else if (returnType.isAssignableFrom(Timestamp.class)) { return (T) Timestamp.from(zdt.toInstant()); } else if (returnType.isAssignableFrom(java.util.Date.class)) { return (T) java.util.Date.from(zdt.toInstant()); } else if (returnType.isAssignableFrom(java.sql.Time.class)) { return (T) new java.sql.Time(zdt.toInstant().truncatedTo(ChronoUnit.SECONDS).toEpochMilli()); } else if (returnType.isAssignableFrom(java.sql.Date.class)) { return (T) new java.sql.Date(zdt.toInstant().truncatedTo(ChronoUnit.SECONDS).toEpochMilli()); } else if (returnType.isAssignableFrom(Long.class)) { return (T) Long.valueOf(zdt.toInstant().toEpochMilli()); } else if (returnType.isAssignableFrom(Calendar.class)) { return (T) GregorianCalendar.from(zdt); } else { throw new ClassCastException("unsupported return type " + returnType.getSimpleName()); } }
Source:
<code>private void removeAccount(ClientManager clientMgr, final boolean showLoginPage, String refreshToken, String loginServer, Account account, Activity frontActivity) { cleanUp(frontActivity, account, showLoginPage); if (account == null) { final AccountManager accMgr = AccountManager.get(context); if (accMgr != null) { final Account[] accounts = accMgr.getAccountsByType(getAccountType()); if (accounts.length > 0) { for (int i = 0; i < accounts.length - 1; i++) { clientMgr.removeAccounts(accounts); } clientMgr.removeAccount(accounts[accounts.length - 1]); <START> notifyLogoutComplete(showLoginPage); <END> } else { notifyLogoutComplete(showLoginPage); } } else { notifyLogoutComplete(showLoginPage); } } else { clientMgr.removeAccount(account); notifyLogoutComplete(showLoginPage); } isLoggingOut = false; if (shouldLogoutWhenTokenRevoked() && refreshToken != null) { new RevokeTokenTask(refreshToken, loginServer).execute(); } }</code><technical_language>If call this in positive single negative (4 times total) put conditional line ~951</technical_language>

Target:
private void removeAccount(ClientManager clientMgr, final boolean showLoginPage, String refreshToken, String loginServer, Account account, Activity frontActivity) { cleanUp(frontActivity, account, showLoginPage); if (account == null) { final AccountManager accMgr = AccountManager.get(context); if (accMgr != null) { final Account[] accounts = accMgr.getAccountsByType(getAccountType()); if (accounts.length > 0) { for (int i = 0; i < accounts.length - 1; i++) { clientMgr.removeAccounts(accounts); } clientMgr.removeAccount(accounts[accounts.length - 1]); } } } else { clientMgr.removeAccount(account); } notifyLogoutComplete(showLoginPage); isLoggingOut = false; if (shouldLogoutWhenTokenRevoked() && refreshToken != null) { new RevokeTokenTask(refreshToken, loginServer).execute(); } }
Source:
<code>private void humanInterventionRequired(final int status, final String msg) { String err = Errors.getErrorMessage(status); <START> this.logger.error("Human Intervention Required: " + status + (err == null ? " " : err)); <END> if (msg != null) { this.logger.error(msg); } }</code><technical_language>Need parameterized logging instead of string concatenation. This a warning error</technical_language>

Target:
private void humanInterventionRequired(final int status, final String msg) { String err = Errors.getErrorMessage(status); this.logger.warn("Human Intervention Required: {}", status, (err == null ? " " : err), (msg == null ? " " : msg) ); }