auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void openBackgroundPlayer(final boolean append) { if (MobileDataHelper.shouldDisplayWarningForMobileData(currentInfo, getContext())) { displayWarningForMobileData((dialog, which) -> { if (which == DialogInterface.BUTTON_POSITIVE) { playInBackground(append); <START> PreferenceManager.getDefaultSharedPreferences(getContext()).edit() <END> .putBoolean(getResources().getString(R.string.show_warning_live_stream_on_mobile), false) .apply(); } }); } else { playInBackground(append); } }</code><technical_language>Emtpy line</technical_language>

Target:
private void openBackgroundPlayer(final boolean append) { NavigationHelper.playInBackground(activity, new SinglePlayQueue(currentInfo), append, msg -> true); }
Source:
<code>public void saveObs_shouldReturnPopulatedModelAndViewIfBindingErrorsOccurForComplexConcept() { MockHttpSession mockSession = new MockHttpSession(); MockMultipartHttpServletRequest mockRequest = new MockMultipartHttpServletRequest(); mockRequest.addParameter("saveObs", "saveObs"); mockRequest.setSession(mockSession); <START> final String fileName = "test.txt"; <END> final byte[] content = "Hello World".getBytes(); MockMultipartFile mockMultipartFile = new MockMultipartFile("complexDataFile", fileName, "text/plain", content); mockRequest.addFile(mockMultipartFile); when(obsErrors.hasErrors()).thenReturn(true); when(obsService.getComplexObs(Integer.valueOf(mockObsWithComplexConcept.getId()), WebConstants.HTML_VIEW)) .thenReturn(RadiologyTestData.getMockComplexObsForMockObs3()); when(obsService.getComplexObs(Integer.valueOf(mockObsWithComplexConcept.getId()), WebConstants.HYPERLINK_VIEW)) .thenReturn(RadiologyTestData.getMockComplexObs2ForMockObs3()); ModelAndView modelAndView = radiologyObsFormController.saveObs(mockRequest, null, "Test Edit Reason", mockRadiologyOrder, mockObsWithComplexConcept, obsErrors); assertThat(modelAndView.getViewName(), is("module/radiology/radiologyObsForm")); assertThat(modelAndView.getModelMap(), hasKey("obs")); Obs obs = (Obs) modelAndView.getModelMap().get("obs"); assertThat(obs, is(mockObsWithComplexConcept)); }</code><technical_language>add newline</technical_language>

Target:
public void saveObs_shouldReturnPopulatedModelAndViewIfBindingErrorsOccurForComplexConcept() { MockHttpSession mockSession = new MockHttpSession(); MockMultipartHttpServletRequest mockRequest = new MockMultipartHttpServletRequest(); mockRequest.addParameter("saveObs", "saveObs"); mockRequest.setSession(mockSession); final String fileName = "test.txt"; final byte[] content = "Hello World".getBytes(); MockMultipartFile mockMultipartFile = new MockMultipartFile("complexDataFile", fileName, "text/plain", content); mockRequest.addFile(mockMultipartFile); when(obsErrors.hasErrors()).thenReturn(true); when(obsService.getComplexObs(Integer.valueOf(mockObsWithComplexConcept.getId()), WebConstants.HTML_VIEW)) .thenReturn(RadiologyTestData.getMockComplexObsAsHtmlViewForMockObs3()); when(obsService.getComplexObs(Integer.valueOf(mockObsWithComplexConcept.getId()), WebConstants.HYPERLINK_VIEW)) .thenReturn(RadiologyTestData.getMockComplexObsAsHyperlinkViewForMockObs3()); ModelAndView modelAndView = radiologyObsFormController.saveObs(mockRequest, null, "Test Edit Reason", mockRadiologyOrder, mockObsWithComplexConcept, obsErrors); assertThat(modelAndView.getViewName(), is("module/radiology/radiologyObsForm")); assertThat(modelAndView.getModelMap(), hasKey("obs")); Obs obs = (Obs) modelAndView.getModelMap().get("obs"); assertThat(obs, is(mockObsWithComplexConcept)); }
Source:
<code>public void startFailedAutoStartVms() { LinkedList<RecordOfAutoStartVmToRestart> recordsToRemove = new LinkedList<>(); final DateTime now = DateTime.getNow(); final Date nextTimeOfRetryToRun = now.addSeconds(RETRY_TO_RUN_HA_VM_INTERVAL); for(RecordOfAutoStartVmToRestart recordOfAutoStartVmToRestart: recordsOfAutoStartVmsToRestart) { if (!recordOfAutoStartVmToRestart.isTimeToRun(now)) { continue; } Guid vmId = recordOfAutoStartVmToRestart.getVmId(); EngineLock runVmLock = createEngineLockForRunVm(vmId); if (!acquireLock(runVmLock)) { log.debugFormat("Could not acquire lock for running HA VM {0}", vmId); continue; } if (!isVmNeedsToBeAutoStarted(vmId)) { releaseLock(runVmLock); recordsToRemove.add(recordOfAutoStartVmToRestart); continue; } if (runVm(vmId, runVmLock)) { recordsToRemove.add(recordOfAutoStartVmToRestart); } <START> else { <END> logFailedAttemptToRestartHighlyAvailableVm(vmId); if (!recordOfAutoStartVmToRestart.scheduleNextTimeToRun(nextTimeOfRetryToRun)) { recordsToRemove.add(recordOfAutoStartVmToRestart); logFailureToRestartHighlyAvailableVm(vmId); } } } recordsOfAutoStartVmsToRestart.removeAll(recordsToRemove); }</code><technical_language>need release lock here</technical_language>

Target:
public void startFailedAutoStartVms() { LinkedList<AutoStartVmToRestart> vmsToRemove = new LinkedList<>(); final DateTime iterationStartTime = DateTime.getNow(); final Date nextTimeOfRetryToRun = iterationStartTime.addSeconds(RETRY_TO_RUN_HA_VM_INTERVAL); for(AutoStartVmToRestart autoStartVmToRestart: autoStartVmsToRestart) { if (!autoStartVmToRestart.isTimeToRun(iterationStartTime)) { continue; } Guid vmId = autoStartVmToRestart.getVmId(); EngineLock runVmLock = createEngineLockForRunVm(vmId); if (!acquireLock(runVmLock)) { log.debugFormat("Could not acquire lock for running HA VM {0}", vmId); continue; } if (!isVmNeedsToBeAutoStarted(vmId)) { releaseLock(runVmLock); vmsToRemove.add(autoStartVmToRestart); continue; } if (runVm(vmId, runVmLock)) { vmsToRemove.add(autoStartVmToRestart); } else { logFailedAttemptToRestartHighlyAvailableVm(vmId); if (!autoStartVmToRestart.scheduleNextTimeToRun(nextTimeOfRetryToRun)) { vmsToRemove.add(autoStartVmToRestart); logFailureToRestartHighlyAvailableVm(vmId); } } } autoStartVmsToRestart.removeAll(vmsToRemove); }
Source:
<code>public Network getNetwork(@Nonnull UUID id) throws <START> ConflictHttpException, NotFoundHttpException { <END> try { return networkZkManager.getNetwork(id); } catch (Exception e) { throw handle(e); } }</code><technical_language>WebApplicationException for consistency</technical_language>

Target:
public Network getNetwork(@Nonnull UUID id) throws WebApplicationException { try { return networkZkManager.getNetwork(id); } catch (Exception e) { throw handle(e); } }
Source:
<code>public void load() { getViewModel().showStartOperation(DEFAULT_ACTION); if (portletConfiguration != null) { String finalUrl = buildPortletUrl(portletConfiguration.getPortletUrl()); String body = buildBody(); String screensJs = new AssetReader(getContext()).read(R.raw.screens); getViewModel().addScript(new JsScript("Screens.js", screensJs)); if (portletConfiguration.isThemeEnabled() && !portletConfiguration.getWebType() <START> .equals(PortletConfiguration.WebType.CUSTOM)) { <END> getViewModel().setTheme(true); } for (InjectableScript script : portletConfiguration.getScripts()) { getViewModel().addScript(script); } if (portletConfiguration.getWebType() .equals(PortletConfiguration.WebType.LIFERAY_AUTHENTICATED)) { if (SessionContext.isLoggedIn()) { getViewModel().postUrl(finalUrl, body); } else { Exception exception = new Exception( "You have to be logged to use the LIFERAY_AUTHENTICATED web type"); getViewModel().showFailedOperation(DEFAULT_ACTION, exception); error(exception, DEFAULT_ACTION); } } else { getViewModel().loadUrl(finalUrl); } } else { getViewModel().showFailedOperation(DEFAULT_ACTION, new MalformedURLException()); } }</code><technical_language>invert comparison: PortletConfiguration.WebType.CUSTOM.equals... (can't null)</technical_language>

Target:
public void load() { getViewModel().showStartOperation(DEFAULT_ACTION); if (portletConfiguration != null) { String finalUrl = buildPortletUrl(portletConfiguration.getPortletUrl()); String body = buildBody(); String screensJs = new AssetReader(getContext()).read(R.raw.screens); getViewModel().addScript(new JsScript("Screens.js", screensJs)); if (portletConfiguration.isThemeEnabled() && !PortletConfiguration.WebType.OTHER.equals(portletConfiguration.getWebType())) { getViewModel().setTheme(true); } for (InjectableScript script : portletConfiguration.getScripts()) { getViewModel().addScript(script); } if (PortletConfiguration.WebType.LIFERAY_AUTHENTICATED.equals( portletConfiguration.getWebType())) { if (SessionContext.isLoggedIn()) { getViewModel().postUrl(finalUrl, body); } else { Exception exception = new Exception( "You have to be logged to use the LIFERAY_AUTHENTICATED web type"); getViewModel().showFailedOperation(DEFAULT_ACTION, exception); error(exception, DEFAULT_ACTION); } } else { getViewModel().loadUrl(finalUrl); } } else { getViewModel().showFailedOperation(DEFAULT_ACTION, new MalformedURLException()); } }
Source:
<code>public boolean doesFileExist(String apiUri) throws ApiException { String lfcPath = getLFCPathFromApiUri(apiUri); <START> checkReadPermission(lfcPath); <END> return lfcPath.equals(ROOT) || baseDoesFileExist(lfcPath); }</code><technical_language>nitpick: if find a factorize lines, I useful</technical_language>

Target:
public boolean doesFileExist(String apiUri) throws ApiException { String lfcPath = checkReadPermission(apiUri); return lfcPath.equals(ROOT) || baseDoesFileExist(lfcPath); }
Source:
<code>private void writeNamedCurve(DatagramWriter writer) { <START> writer.write(hintEncoded.length, IDENTITY_HINT_LENGTH_BITS); <END> writer.writeBytes(hintEncoded); writer.write(NAMED_CURVE, CURVE_TYPE_BITS); writer.write(curveId, NAMED_CURVE_BITS); writer.write(pointEncoded.length, PUBLIC_LENGTH_BITS); writer.writeBytes(pointEncoded); }</code><technical_language>writing identity hint in this method is confusing (and potentially wrong) done of type of curve, it? IMHO moved *fragmentToByteArray* method ..</technical_language>

Target:
private void writeNamedCurve(DatagramWriter writer) { writer.write(NAMED_CURVE, CURVE_TYPE_BITS); writer.write(curveId, NAMED_CURVE_BITS); writer.write(pointEncoded.length, PUBLIC_LENGTH_BITS); writer.writeBytes(pointEncoded); }
Source:
<code>private void setTimeZone(final ZoneId timeZone) { if (timeZone != null) { try { this.timeZone = TimeZone.getTimeZone(timeZone).toZoneId(); } catch (IllegalArgumentException e) { this.timeZone = TimeZone.getDefault().toZoneId(); <START> logger.warn("Could not set a new time zone, the system's default time zone will be used ", e); <END> } } }</code><technical_language>wrt logging</technical_language>

Target:
private void setTimeZone(final ZoneId timeZone) { if (timeZone != null) { try { this.timeZone = TimeZone.getTimeZone(timeZone).toZoneId(); } catch (IllegalArgumentException e) { this.timeZone = TimeZone.getDefault().toZoneId(); logger.warn("Could not set a new time zone, the system's default time zone will be used ", timeZone, e.getMessage()); } } }
Source:
<code>private File createTempFile(String prefix, String suffix) { File tempFile; try { <START> tempFile = File.createTempFile(prefix, suffix); <END> } catch (IOException e) { throw new GoodDataException("Unable to create temporary file", e); } return tempFile; }</code><technical_language>delete exit</technical_language>

Target:
private File createTempFile(String prefix, String suffix) { File tempFile; try { tempFile = File.createTempFile(prefix, suffix); tempFile.deleteOnExit(); } catch (IOException e) { throw new GoodDataException("Unable to create temporary file", e); } return tempFile; }
Source:
<code>public void writeItems(java.util.List<Object> items) throws Exception { for(Object o : items){ <START> LOG.info(o.toString()); <END> } }</code><technical_language>I avoid logging log debug. CI servers a lot of disk space logging unneeded data increase usage of disk space</technical_language>

Target:
public void writeItems(java.util.List<Object> items) throws Exception { }
Source:
<code>private String uncompressLogoutMessage(final String originalMessage) { final byte[] binaryMessage = Base64.decodeBase64(originalMessage); try { final Inflater decompresser = new Inflater(); decompresser.setInput(binaryMessage); byte[] result = new byte[binaryMessage.length * 10]; int resultLength = decompresser.inflate(result); <START> decompresser.end(); <END> return new String(result, 0, resultLength, "UTF-8"); } catch (DataFormatException e) { logger.error("Unable to decompress logout message", e); throw new RuntimeException(e); } catch (UnsupportedEncodingException e) { logger.error("Unable to decompress logout message", e); throw new RuntimeException(e); } }</code><technical_language>this a finally clause</technical_language>

Target:
private String uncompressLogoutMessage(final String originalMessage) { final byte[] binaryMessage = Base64.decodeBase64(originalMessage); Inflater decompresser = null; try { decompresser = new Inflater(); decompresser.setInput(binaryMessage); final byte[] result = new byte[binaryMessage.length * DECOMPRESSION_FACTOR]; final int resultLength = decompresser.inflate(result); return new String(result, 0, resultLength, "UTF-8"); } catch (final Exception e) { logger.error("Unable to decompress logout message", e); throw new RuntimeException(e); } finally { if (decompresser != null) { decompresser.end(); } } }
Source:
<code>private static AnalyzerMessage.TextSpan textSpanBetween(SyntaxToken firstSyntaxToken, SyntaxToken lastSyntaxToken) { AnalyzerMessage.TextSpan location = new AnalyzerMessage.TextSpan( firstSyntaxToken.line(), firstSyntaxToken.column(), lastSyntaxToken.line(), lastSyntaxToken.column() + lastSyntaxToken.text().length() ); <START> Preconditions.checkState(!location.isEmpty(), "Issue location should not be empty"); <END> return location; }</code><technical_language>I tend message a bit more helpful that... if blows, message is helpful</technical_language>

Target:
private static AnalyzerMessage.TextSpan textSpanBetween(SyntaxToken firstSyntaxToken, SyntaxToken lastSyntaxToken) { AnalyzerMessage.TextSpan location = new AnalyzerMessage.TextSpan( firstSyntaxToken.line(), firstSyntaxToken.column(), lastSyntaxToken.line(), lastSyntaxToken.column() + lastSyntaxToken.text().length() ); Preconditions.checkState(!location.isEmpty(), "Invalid issue location: Text span is empty when trying reporting on (l:%s, c:%s).", firstSyntaxToken.line(), firstSyntaxToken.column()); return location; }
Source:
<code>public T fromJson(JsonReader reader) throws IOException { String name = reader.nextString(); try { <START> T[] values = (T[]) clazz.getMethod("values").invoke(null); <END> for (T value : values) { if (value.toString().equals(name)) { return value; } } return null; } catch (Exception e) { return null; } }</code><technical_language>need reflection for this. class.getEnumConstants() give a T[]. This done once, expensive</technical_language>

Target:
public T fromJson(JsonReader reader) throws IOException { String name = reader.nextString(); for (T value : values) { if (value.name().equals(name)) { return value; } } return null; }
Source:
<code>public static String quotePattern(String pattern) { final String START = "\\Q"; final String STOP = "\\E"; final int STOP_LENGTH = 2; int stopIndex = pattern.indexOf(STOP); if (stopIndex < 0) { return START + pattern + STOP; } StringBuilder result = new StringBuilder(START); for (int position=0; ;) { stopIndex = pattern.indexOf(STOP, position); if (stopIndex >= 0) { <START> result.append(pattern.substring(position, stopIndex + 2) + "\\" + STOP + START); END> position = stopIndex + STOP_LENGTH; } else { result.append(pattern.substring(position) + STOP); break; } } return result.toString(); }</code><technical_language>append instead of +</technical_language>

Target:
public static String quotePattern(String pattern) { final String START = "\\Q"; final String STOP = "\\E"; final int STOP_LENGTH = 2; StringBuilder result = new StringBuilder(START); int stopIndex = pattern.indexOf(STOP); if (stopIndex < 0) { return result.append(pattern).append(STOP).toString(); } for (int position=0; ;) { stopIndex = pattern.indexOf(STOP, position); if (stopIndex >= 0) { result.append(pattern.substring(position, stopIndex + 2)).append("\\").append(STOP).append(START); position = stopIndex + STOP_LENGTH; } else { result.append(pattern.substring(position)).append(STOP); break; } } return result.toString(); }
Source:
<code>private void intiChangeListener() { final EditText phone = (EditText) findViewById(R.id.phone); findViewById(R.id.confirm).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { User user = new User(); user.mobile = phone.getText().toString(); <START> TaskQueue.loadQueueDefault(v.getContext()).execute(new UpdateUserTask(user)); <END> Toast.makeText(v.getContext(), "TODO", Toast.LENGTH_SHORT).show(); } }); }</code><technical_language>FIXME: user number changed successfully</technical_language>

Target:
private void intiChangeListener() { final EditText phone = (EditText) findViewById(R.id.phone); findViewById(R.id.confirm).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { User user = new User(); user.id = AppPrefs.getInstance(v.getContext()).getCurrentUserId(); user.mobile = phone.getText().toString(); TaskQueue.loadQueueDefault(v.getContext()).execute(new UpdateUserTask(user)); } }); }
Source:
<code>private WriteResult insertDoc(CRUDOperationContext ctx, DBCollection collection, EntityMetadata md, DBObject dbObject, DocCtx inputDoc) { LOGGER.debug("Inserting doc"); if (!md.getAccess().getInsert().hasAccess(ctx.getCallerRoles())) { inputDoc.addError(Error.get("insert", MongoCrudConstants.ERR_NO_ACCESS, "insert:" + md.getName())); } else { Set<Path> paths = roleEval.getInaccessibleFields_Insert(inputDoc); LOGGER.debug("Inaccessible fields:{}", paths); if (paths == null || paths.isEmpty()) { ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.PRE_CRUD_INSERT_DOC, ctx, inputDoc); WriteResult r = new InsertCommand(collection, dbObject).executeAndUnwrap(); inputDoc.setCRUDOperationPerformed(CRUDOperation.INSERT); ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.POST_CRUD_INSERT_DOC, ctx, inputDoc); <START> return r; <END> } else { for(Path path : paths){ inputDoc.addError(Error.get("insert", CrudConstants.ERR_NO_FIELD_INSERT_ACCESS, path.toString())); } } } return null; }</code><technical_language>remove duplicate key error here</technical_language>

Target:
private WriteResult insertDoc(CRUDOperationContext ctx, DBCollection collection, EntityMetadata md, DBObject dbObject, DocCtx inputDoc) { LOGGER.debug("Inserting doc"); if (!md.getAccess().getInsert().hasAccess(ctx.getCallerRoles())) { inputDoc.addError(Error.get("insert", MongoCrudConstants.ERR_NO_ACCESS, "insert:" + md.getName())); } else { Set<Path> paths = roleEval.getInaccessibleFields_Insert(inputDoc); LOGGER.debug("Inaccessible fields:{}", paths); if (paths == null || paths.isEmpty()) { try { ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.PRE_CRUD_INSERT_DOC, ctx, inputDoc); WriteResult r = new InsertCommand(collection, dbObject).executeAndUnwrap(); inputDoc.setCRUDOperationPerformed(CRUDOperation.INSERT); ctx.getFactory().getInterceptors().callInterceptors(InterceptPoint.POST_CRUD_INSERT_DOC, ctx, inputDoc); return r; } catch (DuplicateKeyException dke) { LOGGER.error("saveOrInsert failed: {}", dke); inputDoc.addError(Error.get("insert", MongoCrudConstants.ERR_DUPLICATE, dke)); } } else { for(Path path : paths){ inputDoc.addError(Error.get("insert", CrudConstants.ERR_NO_FIELD_INSERT_ACCESS, path.toString())); } } } return null; }
Source:
<code>Object getValue(Object obj, String attributePath) throws Exception { String[] paths = getPath(attributePath); JsonParser parser = createParser(obj); parser.nextToken(); for (int i = 0; i < paths.length; i++) { String path = paths[i]; String arrayIndexText = getIndexTextOrNull(path); if (arrayIndexText == null) { if (!findAttribute(parser, path)) { return null; } } else { if ("any".equals(arrayIndexText)) { String lastPath = i + 1 < paths.length ? paths[i + 1] : null; return getMultiValue(parser, lastPath); } else { JsonToken token = parser.getCurrentToken(); if (token != JsonToken.START_ARRAY) { return null; } token = parser.nextToken(); int arrayIndex = Integer.parseInt(arrayIndexText); for (int j = 0; j < arrayIndex; j++) { if (token == JsonToken.END_ARRAY) { return null; } parser.skipChildren(); token = parser.nextToken(); } } } } Object ret = convertJsonTokenToValue(parser); <START> parser.close(); <END> return ret; }</code><technical_language>Do need close in a finally block in case</technical_language>

Target:
Object getValue(Object obj, String attributePath) throws Exception { String[] paths = getPath(attributePath); JsonParser parser = createParser(obj); try { parser.nextToken(); for (int i = 0; i < paths.length; i++) { String path = paths[i]; String arrayIndexText = getIndexTextOrNull(path); if (arrayIndexText == null) { if (!findAttribute(parser, path)) { return null; } } else { if ("any".equals(arrayIndexText)) { String lastPath = i + 1 < paths.length ? paths[i + 1] : null; return getMultiValue(parser, lastPath); } else { JsonToken token = parser.currentToken(); if (token != JsonToken.START_ARRAY) { return null; } token = parser.nextToken(); int arrayIndex = Integer.parseInt(arrayIndexText); for (int j = 0; j < arrayIndex; j++) { if (token == JsonToken.END_ARRAY) { return null; } parser.skipChildren(); token = parser.nextToken(); } } } } return convertJsonTokenToValue(parser); } finally { parser.close(); } }
Source:
<code>private void parseKeyAndValue(String key, String value, int digits, int plane, int nPlanes) { for (int i=plane; i<plane+nPlanes; i++) { addSeriesMeta(String.format("Plane #%0" + digits + "d %s", i, key), value); if (key.equals("XPositionUm")) { try { Position p = positions.get(getCoreIndex()); p.positions[i][0] = DataTools.parseDouble(value); } catch (NumberFormatException e) { } } else if (key.equals("YPositionUm")) { try { Position p = positions.get(getCoreIndex()); p.positions[i][1] = DataTools.parseDouble(value); } <START> catch (NumberFormatException e) { } <END> } else if (key.equals("ZPositionUm")) { try { Position p = positions.get(getCoreIndex()); p.positions[i][2] = DataTools.parseDouble(value); } catch (NumberFormatException e) { } } } }</code><technical_language>usage of DataTools API, simplify this code remove NumberFormatException handling in reader</technical_language>

Target:
private void parseKeyAndValue(String key, String value, int digits, int plane, int nPlanes) { for (int i=plane; i<plane+nPlanes; i++) { addSeriesMeta(String.format("Plane #%0" + digits + "d %s", i, key), value); if (key.equals("XPositionUm")) { Position p = positions.get(getCoreIndex()); p.positions[i][0] = DataTools.parseDouble(value); } else if (key.equals("YPositionUm")) { Position p = positions.get(getCoreIndex()); p.positions[i][1] = DataTools.parseDouble(value); } else if (key.equals("ZPositionUm")) { Position p = positions.get(getCoreIndex()); p.positions[i][2] = DataTools.parseDouble(value); } } }
Source:
<code>public static GoCompositeLit createCompositeLit(@NotNull Project project, @NotNull GoType type) { String typeText = type.getText(); <START> GoFile file = createFileFromText(project, "package a; struct " + typeText + " {}; var _ = " + typeText + "{}"); <END> return PsiTreeUtil.findChildOfType(file, GoCompositeLit.class); }</code><technical_language>need this : struct " + typeText + " {};</technical_language>

Target:
public static GoCompositeLit createCompositeLit(@NotNull Project project, @NotNull GoType type) { GoFile file = createFileFromText(project, "package a; var _ = " + type.getText() + "{}"); return PsiTreeUtil.findChildOfType(file, GoCompositeLit.class); }
Source:
<code>private void setProxyServer(Request request, String proxyServerParameters) { if (!proxyServerParameters.contains("://")) { proxyServerParameters = "http://" + proxyServerParameters; } URI uriProxy = null; try { uriProxy = new URI(proxyServerParameters); request.setProxyServer("scheme", uriProxy.getScheme()); Optional<String> userInfoOptional = Optional.ofNullable(uriProxy.getUserInfo()); if (userInfoOptional.isPresent()) { String userinfo = userInfoOptional.get(); if (userinfo.contains(":")) { <START> String[] userInfo = userinfo.split(":"); <END> request.setProxyServer("username", userInfo[0]); request.setProxyServer("password", userInfo[1]); } } Optional<String> hostOptional = Optional.ofNullable(uriProxy.getHost()); if (hostOptional.isPresent()) { request.setProxyServer("servername", hostOptional.get()); } if (uriProxy.getPort() != -1) { request.setProxyServer("port", String.valueOf(uriProxy.getPort())); } else { request.setProxyServer("port", "1080"); } } catch (URISyntaxException e) { LOGGER.error("string '{}' cannot be converted to a URL", proxyServerParameters); throw new IllegalArgumentException(proxyServerParameters + " cannot be converted to a URL"); } }</code><technical_language>password a : inside? want limit spliiting userinfo.split(":", 1)? call variable userInfoString, distinguish user userInfo String array</technical_language>

Target:
private void setProxyServer(Request request, String proxyServerParameters) { if (!proxyServerParameters.contains("://")) { proxyServerParameters = "http://" + proxyServerParameters; } URI uriProxy = null; try { uriProxy = new URI(proxyServerParameters); request.setProxyServer("scheme", uriProxy.getScheme()); Optional<String> userInfoOptional = Optional.ofNullable(uriProxy.getUserInfo()); if (userInfoOptional.isPresent()) { setProxyServerUserInfo(request, userInfoOptional.get()); } Optional<String> hostOptional = Optional.ofNullable(uriProxy.getHost()); if (hostOptional.isPresent()) { request.setProxyServer("servername", hostOptional.get()); } if (uriProxy.getPort() != -1) { request.setProxyServer("port", String.valueOf(uriProxy.getPort())); } else { request.setProxyServer("port", "1080"); } } catch (URISyntaxException e) { LOGGER.error("string '{}' cannot be converted to a URL", proxyServerParameters); throw new IllegalArgumentException(proxyServerParameters + " cannot be converted to a URL"); } }
Source:
<code>protected Map<String, Pair<String, String>> getExclusiveLocks() { return Collections.singletonMap(getParameters().getVmPool().getName(), <START> LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM_POOL, getVmPoolIsBeingCreatedMessage())); <END> }</code><technical_language>meant VM_POOL_NAME right</technical_language>

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { return Collections.singletonMap(getParameters().getVmPool().getName(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM_POOL_NAME, getVmPoolIsBeingCreatedMessage())); }
Source:
<code>public String withParams(String url) throws URISyntaxException { return new URIBuilder(url) .addParameter(TmcConstants.API_VERSION_PARAM, settings.apiVersion()) .addParameter(TmcConstants.CLIENT_NAME_PARAM, settings.clientName()) <START> .addParameter(TmcConstants.CLIENT_VERSION_PARAM, settings.clientVersion()) <END> .build().toString(); }</code><technical_language>static import constants</technical_language>

Target:
public String withParams(String url) throws URISyntaxException { return new URIBuilder(url) .addParameter(API_VERSION_PARAM, settings.apiVersion()) .addParameter(CLIENT_NAME_PARAM, settings.clientName()) .addParameter(CLIENT_VERSION_PARAM, settings.clientVersion()) .build().toString(); }
Source:
<code>private Action onReleaseSession( final DirectBuffer buffer, final int offset, final int blockLength, final int version, final Header header) { releaseSession.wrap(buffer, offset, blockLength, version); final int libraryId = releaseSession.libraryId(); final Action action = handler.onApplicationHeartbeat(libraryId, header.sessionId()); if (action == ABORT) { <START> return CONTINUE; END> } return handler.onReleaseSession( libraryId, releaseSession.connection(), releaseSession.sessionId(), releaseSession.correlationId(), releaseSession.state(), releaseSession.heartbeatIntervalInMs(), releaseSession.lastSentSequenceNumber(), releaseSession.lastReceivedSequenceNumber(), releaseSession.username(), releaseSession.password(), header); }</code><technical_language>do ignore effectively ignore this message if pressured</technical_language>

Target:
private Action onReleaseSession( final DirectBuffer buffer, final int offset, final int blockLength, final int version, final Header header) { releaseSession.wrap(buffer, offset, blockLength, version); final int libraryId = releaseSession.libraryId(); final Action action = handler.onApplicationHeartbeat(libraryId, header.sessionId()); if (action != null) { return action; } return handler.onReleaseSession( libraryId, releaseSession.connection(), releaseSession.sessionId(), releaseSession.correlationId(), releaseSession.state(), releaseSession.heartbeatIntervalInMs(), releaseSession.lastSentSequenceNumber(), releaseSession.lastReceivedSequenceNumber(), releaseSession.username(), releaseSession.password(), header); }
Source:
<code><START> private void spongeImpl$onEntityCollideWithBlockState(BlockState blockState, net.minecraft.world.World worldIn, BlockPos pos, Entity entityIn) { <END> if (!((BlockBridge) blockState.getBlock()).bridge$hasCollideWithStateLogic()) { return; } if (world.isRemote) { blockState.onEntityCollision(world, pos, entityIn); return; } if (!SpongeCommonEventFactory.handleCollideBlockEvent(blockState.getBlock(), world, pos, blockState, entityIn, Direction.NONE)) { blockState.onEntityCollision(world, pos, entityIn); this.lastCollidedBlockPos = pos; } }</code><technical_language>s/spongeImpl/impl</technical_language>

Target:
private void impl$onEntityCollideWithBlockState(BlockState blockState, net.minecraft.world.World worldIn, BlockPos pos, Entity entityIn) { if (!((BlockBridge) blockState.getBlock()).bridge$hasCollideWithStateLogic()) { return; } if (world.isRemote) { blockState.onEntityCollision(world, pos, entityIn); return; } if (!SpongeCommonEventFactory.handleCollideBlockEvent(blockState.getBlock(), world, pos, blockState, entityIn, Direction.NONE)) { blockState.onEntityCollision(world, pos, entityIn); this.impl$lastCollidedBlockPos = pos; } }
Source:
<code>private static Stream<Arguments> escapeSupplier() { PercentEscaper defaultEscaper = new PercentEscaper(null, false); return Stream.of( Arguments.arguments(defaultEscaper, "$", "%24"), Arguments.arguments(defaultEscaper, "¢", "%C2%A2"), Arguments.arguments(defaultEscaper, "ह", "%E0%A4%B9"), Arguments.arguments(defaultEscaper, "€", "%E2%82%AC"), Arguments.arguments(defaultEscaper, "한", "%ED%95%9C"), Arguments.arguments(defaultEscaper, "円", "%E5%86%86"), Arguments.arguments(defaultEscaper, "\uD800\uDF48", "%F0%90%8D%88"), Arguments.arguments(defaultEscaper, "日本語", "%E6%97%A5%E6%9C%AC%E8%AA%9E"), Arguments.arguments(defaultEscaper, " ", "%20"), Arguments.arguments(new PercentEscaper(null, true), " ", "+"), <START> Arguments.arguments(new PercentEscaper("$", false), "$", "$") <END> ); }</code><technical_language>a good test cases include well. Arguments.arguments(new PercentEscaper( "", false), "", "") new PercentEscaper(" ", true); // this throw exception</technical_language>

Target:
private static Stream<Arguments> escapeSupplier() { PercentEscaper defaultEscaper = new PercentEscaper(null, false); return Stream.of( Arguments.arguments(defaultEscaper, null, null), Arguments.arguments(defaultEscaper, "", ""), Arguments.arguments(defaultEscaper, "$", "%24"), Arguments.arguments(defaultEscaper, "¢", "%C2%A2"), Arguments.arguments(defaultEscaper, "ह", "%E0%A4%B9"), Arguments.arguments(defaultEscaper, "€", "%E2%82%AC"), Arguments.arguments(defaultEscaper, "한", "%ED%95%9C"), Arguments.arguments(defaultEscaper, "円", "%E5%86%86"), Arguments.arguments(defaultEscaper, "\uD800\uDF48", "%F0%90%8D%88"), Arguments.arguments(defaultEscaper, "日本語", "%E6%97%A5%E6%9C%AC%E8%AA%9E"), Arguments.arguments(defaultEscaper, " ", "%20"), Arguments.arguments(new PercentEscaper(null, true), " ", "+"), Arguments.arguments(new PercentEscaper("$", false), "$", "$"), Arguments.arguments(new PercentEscaper("ह", false), "ह", "ह") ); }
Source:
<code>private String createReplacementClassModifiers( VisitorState state, JCModifiers enclosingClassModifiers) { <START> ImmutableList.Builder<String> classModifierStringsBuilder = new ImmutableList.Builder<>(); <END> for (JCAnnotation annotation : enclosingClassModifiers.annotations) { classModifierStringsBuilder.add(state.getSourceForNode(annotation)); } EnumSet<Flag> classFlags = Flags.asFlagSet(enclosingClassModifiers.flags); classFlags.remove(Flags.Flag.FINAL); classFlags.add(Flags.Flag.ABSTRACT); for (Flag flag : classFlags) { classModifierStringsBuilder.add(flag.toString()); } return Joiner.on(' ').join(classModifierStringsBuilder.build()); }</code><technical_language>ImmutableList.builder()</technical_language>

Target:
private String createReplacementClassModifiers( VisitorState state, JCModifiers enclosingClassModifiers) { ImmutableList.Builder<String> classModifierStringsBuilder = ImmutableList.builder(); for (JCAnnotation annotation : enclosingClassModifiers.annotations) { classModifierStringsBuilder.add(state.getSourceForNode(annotation)); } EnumSet<Flag> classFlags = Flags.asFlagSet(enclosingClassModifiers.flags); classFlags.remove(Flags.Flag.FINAL); classFlags.add(Flags.Flag.ABSTRACT); for (Flag flag : classFlags) { classModifierStringsBuilder.add(flag.toString()); } return Joiner.on(' ').join(classModifierStringsBuilder.build()); }
Source:
<code>private void resetSchemaProperties(DocumentModel target) throws OperationException { if (xpath != null) { target.setPropertyValue(xpath, null); } else if (schema != null) { <START> for (Map.Entry<String, Object> entry : target.getProperties(schema).entrySet()) { <END> target.setProperty(schema, entry.getKey(), null); } } else { throw new OperationException("No schema or xpath was provided"); } }</code><technical_language>keySet() key</technical_language>

Target:
private void resetSchemaProperties(DocumentModel target) throws OperationException { if (xpath != null) { target.setPropertyValue(xpath, null); } else if (schema != null) { for (String key : target.getProperties(schema).keySet()) { target.setProperty(schema, key, null); } } else { throw new OperationException("No schema or xpath was provided"); } }
Source:
<code>public List<FilterNode> getChildren() { return Stream.of(json.get(CHILDREN)) .map(List.class::cast) .flatMap(List::stream) .map(Map.class::cast) .map( new Function<Map, FilterNodeMapImpl>() { @Override public FilterNodeMapImpl apply(Map json1) { return new FilterNodeMapImpl(json1); } <START> }) <END> .collect(Collectors.toList()); }</code><technical_language>this collapsed down? .map(json -> new FilterNodeMapImpl(json)) Actually, syntax work? .map(FilterNodeMapImpl::new)</technical_language>

Target:
public List<FilterNode> getChildren() { return Stream.of(json.get(CHILDREN)) .map(List.class::cast) .flatMap(List::stream) .map(Map.class::cast) .map(FilterNodeMapImpl::new) .collect(Collectors.toList()); }
Source:
<code>private void raiseReadyForPlaybackEvent() { TimerTask raiseReadyForPlaybackEvent = new TimerTask() { @Override public void run() { try { IMediaStream mediaStream = packetizerCupertino.getAndSetStartStream(null); <START> if (mediaStream == null) <END> return; WMSProperties clientProperties = mediaStream.getProperties(); KalturaMediaServerIndex serverIndex = KalturaMediaServerIndex.get(clientProperties.getPropertyInt(LiveStreamEntry.CLIENT_PROPERTY_SERVER_INDEX, LiveStreamEntry.INVALID_SERVER_INDEX)); String entryId = getEntryIdFromStreamName(mediaStream.getName()); KalturaMediaStreamEvent event = new KalturaMediaStreamEvent(KalturaEventType.STREAM_READY_FOR_PLAYBACK, liveStreamManager.get(entryId), serverIndex, applicationName, mediaStream); KalturaEventsManager.raiseEvent(event); logger.info("Stream [" + mediaStream + "] raised READY_FOR_PLAYBACK"); eventLunched = true; } catch (Exception err) { logger.error(err); } } }; Timer timer = new Timer("register- readyForPlaybackEvent" , true); timer.schedule(raiseReadyForPlaybackEvent, 0); logger.debug("Scheduled initial timer - READY_FOR_PLAYBACK"); }</code><technical_language>this file relevant for this specific pull request</technical_language>

Target:
private void raiseReadyForPlaybackEvent() { TimerTask raiseReadyForPlaybackEvent = new TimerTask() { @Override public void run() { try { IMediaStream mediaStream = packetizerCupertino.getAndSetStartStream(null); WMSProperties clientProperties = mediaStream.getProperties(); KalturaMediaServerIndex serverIndex = KalturaMediaServerIndex.get(clientProperties.getPropertyInt(LiveStreamEntry.CLIENT_PROPERTY_SERVER_INDEX, LiveStreamEntry.INVALID_SERVER_INDEX)); String entryId = getEntryIdFromStreamName(mediaStream.getName()); KalturaMediaStreamEvent event = new KalturaMediaStreamEvent(KalturaEventType.STREAM_READY_FOR_PLAYBACK, liveStreamManager.get(entryId), serverIndex, applicationName, mediaStream); KalturaEventsManager.raiseEvent(event); eventLunched = true; } catch (Exception err) { logger.error(err); } } }; Timer timer = new Timer("register- readyForPlaybackEvent" , true); timer.schedule(raiseReadyForPlaybackEvent, 0); logger.debug("Scheduled initial timer - READY_FOR_PLAYBACK"); }
Source:
<code>public static Archive<?> deploy() { JavaArchive jar = ShrinkWrap.create(JavaArchive.class, DEPLOYMENT + ".jar"); jar.addPackage(TestPassivationBean.class.getPackage()); jar.addClasses(DifferentCachePassivationBean.class, TwoPassivationStoresServerSetupTask.class); <START> jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, org.jboss.dmr \n"), "MANIFEST.MF"); <END> jar.addAsManifestResource(TestPassivationBean.class.getPackage(), "persistence.xml", "persistence.xml"); return jar; }</code><technical_language>dependencies necessary</technical_language>

Target:
public static Archive<?> deploy() { JavaArchive jar = ShrinkWrap.create(JavaArchive.class, DEPLOYMENT + ".jar"); jar.addClasses(DifferentCachePassivationBean.class, PassivationEnabledBean.class, Bean.class, CLIServerSetupTask.class); return jar; }
Source:
<code>public static void flashOn() { Log.d(TAG, "flashOn()"); <START> if (!isAvailable()) { <END> return; } if (!CameraManager.getInstance().hasCurrentCameraFlash()) { currentFlashValue = false; CameraManager.getInstance().destroyStage(); } else { CameraManager.getInstance().setFlashParams(paramsOn); currentFlashValue = true; } }</code><technical_language>if (!CameraManager.getInstance().hasCurrentCameraFlash()) enough</technical_language>

Target:
public static void flashOn() { if (!available) { destroy(); return; } CameraManager.getInstance().setFlashParams(paramsOn); currentFlashValue = true; }
Source:
<code>public void append(Number calculated) { <START> values.add(calculated); <END> }</code><technical_language>I need remove wrong example create right - @Override public void append(Number calculated) { max = Math.max(max, calculated); }</technical_language>

Target:
public void append(Number calculated) { if (value == null) { value = calculated.doubleValue(); } else { value = Math.max(value,calculated.doubleValue()); } }
Source:
<code>public void deploy(DeploymentPhaseContext deploymentPhaseContext) throws DeploymentUnitProcessingException { TracingExtensionLogger.ROOT_LOGGER.processingDeployment(); final DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit(); final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); final WeldCapability weldCapability; try { weldCapability = support.getCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class); } catch (CapabilityServiceSupport.NoSuchCapabilityException e) { String msg = String.format("Deployment %s requires use of the '%s' capability but it is not currently registered", deploymentPhaseContext.getDeploymentUnit().getName(), <START> WELD_CAPABILITY_NAME); <END> throw new DeploymentUnitProcessingException(msg); } if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } if (!weldCapability.isPartOfWeldDeployment(deploymentUnit)) { TracingExtensionLogger.ROOT_LOGGER.noCdiDeployment(); return; } setServiceName(deploymentUnit); addListeners(deploymentUnit); }</code><technical_language>i18n</technical_language>

Target:
public void deploy(DeploymentPhaseContext deploymentPhaseContext) throws DeploymentUnitProcessingException { TracingExtensionLogger.ROOT_LOGGER.processingDeployment(); final DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit(); final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); final WeldCapability weldCapability; try { weldCapability = support.getCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class); } catch (CapabilityServiceSupport.NoSuchCapabilityException e) { throw new DeploymentUnitProcessingException(TracingExtensionLogger.ROOT_LOGGER.deploymentRequiresCapability( deploymentPhaseContext.getDeploymentUnit().getName(), WELD_CAPABILITY_NAME )); } if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } if (!weldCapability.isPartOfWeldDeployment(deploymentUnit)) { TracingExtensionLogger.ROOT_LOGGER.noCdiDeployment(); return; } setServiceName(deploymentUnit); addListeners(deploymentUnit); }
Source:
<code>protected boolean userHasAddPermission(User user) { <START> return user.isAdmin() || permissionsService.findResource(ResourceType.functionality, "generic-functionality") <END> .filter(r -> r.hasPermission(user, PermissionType.ADD_MAPLAYER)).isPresent(); }</code><technical_language>Is "generic-functionality" stored a constant? If is re-use that</technical_language>

Target:
protected boolean userHasAddPermission(User user) { return user.isAdmin() || permissionsService.findResource(ResourceType.functionality, PermissionService.GENERIC_FUNCTIONALITY) .filter(r -> r.hasPermission(user, PermissionType.ADD_MAPLAYER)).isPresent(); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; <START> throw new RuntimeException("Only one PropertiesModule may be installed"); <END> }</code><technical_language>Log conflicting classes for easier tracking</technical_language>

Target:
public boolean equals(Object obj) { return this == obj; }
Source:
<code>public String[] getAllValues(Collection<String> value, Attribute attr) { String[] result = null; Collection<String> intermediate = value; for (AttributeValueTransformer transformer : transformerList) { if(intermediate == null) { <START> intermediate = Arrays.asList(result); <END> } if(transformer.isMassTransformationPreferred()) { result = transformer.getAllValues(intermediate, attr); } else { result = intermediate.stream() .map(one -> transformer.getValue(one, attr)) .toArray(String[]::new); } intermediate = null; } return result; }</code><technical_language>result null, if passed is null. happen API usage, throw NullPointerException. assign "empty list / null" "result list", based result state</technical_language>

Target:
public String[] getAllValues(Collection<String> value, Attribute attr) { String[] result = null; Collection<String> intermediate = value; for (AttributeValueTransformer transformer : transformerList) { if(intermediate == null) { intermediate = (result == null) ? new ArrayList<String>() : Arrays.asList(result); } if(transformer.isMassTransformationPreferred()) { result = transformer.getAllValues(intermediate, attr); } else { result = intermediate.stream() .map(one -> transformer.getValue(one, attr)) .toArray(String[]::new); } intermediate = null; } return result; }
Source:
<code>public DataSetGenerator lookupGenerator(DataSetDef def) { <START> BeanDataSetDef beanDef = (BeanDataSetDef) def; <END> String beanName = beanDef.getGeneratorClass(); DataSetGenerator generator = generatorMap.get(beanName); if (generator != null) { return generator; } else { throw new IllegalArgumentException("Data set generator class not found: " + beanName); } }</code><technical_language>Consider checking if def istanceof BeanDataSetDef casting</technical_language>

Target:
public DataSetGenerator lookupGenerator(DataSetDef def) { if (def instanceof BeanDataSetDef) { return loadDataSetGenerator((BeanDataSetDef) def); } throw new IllegalArgumentException("Not a BeanDataSetDef instance"); }
Source:
<code>private static void createOutputDirectory(String outputDirectory) { <START> File outputDir = new File(outputDirectory); <END> if (!outputDir.exists()) { outputDir.mkdirs(); } }</code><technical_language>I reuse this File object, returning it, for example, pass copy medhod, instead of string</technical_language>

Target:
private static File createOutputDirectory(String outputDirectory) { File outputDir = new File(outputDirectory); if (!outputDir.exists()) { outputDir.mkdirs(); } return outputDir; }
Source:
<code>public static String getTSVForBedSedimentDownload(List<BedSedimentDownload> data, List<COLUMNS> outputColumns) { List<List<Object> > columns = new ArrayList<>(); List<String> headers = new ArrayList<>(); String output; HashMap<String, List> result = getBedSedimentDownloadData(data, outputColumns); <START> columns.addAll(result.get("columns")); <END> headers.addAll(result.get("headers")); if(columns.size() > 0 && headers.size() > 0){ output = TSVUtil.createTSV(headers, columns, data.size(), false, true); } else { output = "NO BED SEDIMENT DATA RETURNED FOR SPECIFIED PARAMETERS"; } return output; }</code><technical_language>In this case needing loop get multiple sets of download data (which duration curve needed download logarithmic linear data once) assign columns headers values HashMap instead of addAll. I.E: columns = result.get("columns"); a big deal all, I a necessity fix merging - a note</technical_language>

Target:
public static String getTSVForBedSedimentDownload(List<BedSedimentDownload> data, List<COLUMNS> outputColumns) { List<List<Object> > columns = new ArrayList<>(); List<String> headers = new ArrayList<>(); String output; HashMap<String, List> result = getBedSedimentDownloadData(data, outputColumns); columns = result.get("columns"); headers = result.get("headers"); if(columns.size() > 0 && headers.size() > 0){ output = TSVUtil.createTSV(headers, columns, data.size(), false, true); } else { output = "NO BED SEDIMENT DATA RETURNED FOR SPECIFIED PARAMETERS"; } return output; }
Source:
<code>private void sendBypassEmail(final ReceiveCommand cmd) { final String destBranchName = cmd.getRefName().substring(Constants.R_HEADS.length()); BranchEmail bm = branchEmailFactory.create(project, destBranchName, cmd.getType()); bm.setFrom(currentUser.getAccountId()); try { bm.send(); } catch (EmailException e) { <START> String error_head = ""; <END> error_head = error_head + bm.getMessageClass() + " : "; log.error(error_head, e); } }</code><technical_language>Is missing here? reason 3 lines one</technical_language>

Target:
private void sendBypassEmail(final ReceiveCommand cmd) { final String destBranchName = cmd.getRefName(); BranchEmail bm = branchEmailFactory.create(project, destBranchName, cmd.getType()); bm.setFrom(currentUser.getAccountId()); try { bm.send(); } catch (EmailException e) { log.error(bm.getMessageClass() + " : ", e); } }