auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public SWTBotMenu contextMenu(String text) { SWTBotTree swtBotTree = new SWTBotTree(tree); swtBotTree.waitForEnabled(); select(); notifyTree(SWT.MouseDown, createMouseEvent(0, 0, 3, 0, 1)); notifyTree(SWT.MouseUp, createMouseEvent(0, 0, 3, 0, 1)); <START> return super.contextMenu(tree, text); <END> }</code><technical_language>I changing behavior is behavior in SWTBotTableItem. I ContextMenuHelper.contextMenu() a single string will: 1. level deep 2. send a SWT.Hide event for item's parent menus. changing super.contextMenu() I search recursively, hide menus returning item. verify breaking recursive dynamic context menus tree items. :(</technical_language>

Target:
public SWTBotMenu contextMenu(String text) { SWTBotTree swtBotTree = new SWTBotTree(tree); swtBotTree.waitForEnabled(); select(); notifyTree(SWT.MouseDown, createMouseEvent(0, 0, 3, 0, 1)); notifyTree(SWT.MouseUp, createMouseEvent(0, 0, 3, 0, 1)); return new SWTBotMenu(ContextMenuHelper.contextMenu(swtBotTree, widget, text)); }
Source:
<code>static HttpData convertRequest(ServiceRequestContext ctx, AggregatedHttpMessage request) { ZipkinHttpCollector.metrics.incrementMessages(); String encoding = request.headers().get(HttpHeaderNames.CONTENT_ENCODING); HttpData content = request.content(); if (!content.isEmpty() && encoding != null && encoding.contains("gzip")) { <START> content = GZIP_DECODER_FACTORY.newDecoder(ByteBufAllocator.DEFAULT).decode(content); <END> if (content.isEmpty()) { ZipkinHttpCollector.maybeLog("Malformed gzip body", ctx, request); throw new IllegalArgumentException("Cannot gunzip spans"); } } if (content.isEmpty()) ZipkinHttpCollector.maybeLog("Empty POST body", ctx, request); if (content.length() == 2 && "[]".equals(content.toStringAscii())) { ZipkinHttpCollector.maybeLog("Empty JSON list POST body", ctx, request); ReferenceCountUtil.release(content); content = HttpData.EMPTY_DATA; } ZipkinHttpCollector.metrics.incrementBytes(content.length()); return content; }</code><technical_language>ctx.alloc()</technical_language>

Target:
static HttpData convertRequest(ServiceRequestContext ctx, AggregatedHttpMessage request) { ZipkinHttpCollector.metrics.incrementMessages(); String encoding = request.headers().get(HttpHeaderNames.CONTENT_ENCODING); HttpData content = request.content(); if (!content.isEmpty() && encoding != null && encoding.contains("gzip")) { content = GZIP_DECODER_FACTORY.newDecoder(ctx.alloc()).decode(content); if (content.isEmpty()) { ZipkinHttpCollector.maybeLog("Malformed gzip body", ctx, request); throw new IllegalArgumentException("Cannot gunzip spans"); } } if (content.isEmpty()) ZipkinHttpCollector.maybeLog("Empty POST body", ctx, request); if (content.length() == 2 && "[]".equals(content.toStringAscii())) { ZipkinHttpCollector.maybeLog("Empty JSON list POST body", ctx, request); ReferenceCountUtil.release(content); content = HttpData.EMPTY_DATA; } ZipkinHttpCollector.metrics.incrementBytes(content.length()); return content; }
Source:
<code>private Collection<? extends Role> createRoles(final AccessToken accessToken) { <START> Set<String roleNames = new HashSet<>(); <END> AccessToken.Access access = accessToken.getResourceAccess(accessToken.getIssuedFor()); if(access!=null && access.getRoles()!=null){ roleNames.addAll(access.getRoles()); } AccessToken.Access realmAccess = accessToken.getRealmAccess(); if(realmAccess!=null && realmAccess.getRoles()!=null){ roleNames.addAll(realmAccess.getRoles()); } final List<Role> roles = new ArrayList<Role>(roleNames.size()); for (final String roleName : roleNames) { roles.add(new RoleImpl(roleName)); } return roles; }</code><technical_language>a issues this line: - Set<String is missing a closing angle bracket. - Errai 3.x targets Java 1.6 <> operator. <String> instead. - This is usage of HashSet in this file, a missing import for java.util.HashSet</technical_language>

Target:
private Collection<? extends Role> createRoles(final AccessToken accessToken) { Set<String> roleNames = new HashSet<String>(); AccessToken.Access access = accessToken.getResourceAccess(accessToken.getIssuedFor()); if(access != null && access.getRoles() != null){ roleNames.addAll(access.getRoles()); } AccessToken.Access realmAccess = accessToken.getRealmAccess(); if(realmAccess != null && realmAccess.getRoles() !=null ){ roleNames.addAll(realmAccess.getRoles()); } final List<Role> roles = new ArrayList<Role>(roleNames.size()); for (final String roleName : roleNames) { roles.add(new RoleImpl(roleName)); } return roles; }
Source:
<code><START> public static <I,O> IfFunctionBuilderApplyingFirst<I> ifNotEquals(I test) { <END> return ifPredicate(Predicates.not(Predicates.equalTo(test))); }</code><technical_language>Remove O type parameter, unused (all methods)</technical_language>

Target:
public static <I> IfFunctionBuilderApplyingFirst<I> ifNotEquals(I test) { return ifPredicate(Predicates.not(Predicates.equalTo(test))); }
Source:
<code>public Node getNode(NodeId nodeId) { Node node = nodes.get(nodeId); <START> if (node != null && node.type() == Node.Type.CLIENT && node.getState() == State.INACTIVE) { <END> return null; } return node; }</code><technical_language>data type here</technical_language>

Target:
public Node getNode(NodeId nodeId) { Node node = nodes.get(nodeId); return node != null ? node.type() == Node.Type.DATA || node.getState() == State.ACTIVE ? node : null : null; }
Source:
<code>public void visitMethodInvocation(MethodInvocationTree syntaxNode) { if (syntaxNode.methodSelect().is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree memberSelect = (MemberSelectExpressionTree) syntaxNode.methodSelect(); final ExpressionTree expression = memberSelect.expression(); <START> if (expression.is(Tree.Kind.IDENTIFIER) && expression.symbolType().isSubtypeOf("java.util.concurrent.locks.Lock")) { <END> final String methodName = memberSelect.identifier().name(); IdentifierTree target = (IdentifierTree) expression; if (!isMemberSelectActingOnField(target) && TRY_LOCK_METHOD_NAME.equals(methodName)) { final SymbolicValue symbolicValue = programState.getValue(target.symbol()); constraintManager.setValueFactory(new TryLockSymbolicValueFactory(symbolicValue)); } } } }</code><technical_language>LOCK constant instead</technical_language>

Target:
public void visitMethodInvocation(MethodInvocationTree syntaxNode) { if (syntaxNode.methodSelect().is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree memberSelect = (MemberSelectExpressionTree) syntaxNode.methodSelect(); final ExpressionTree expression = memberSelect.expression(); if (expression.is(Tree.Kind.IDENTIFIER) && expression.symbolType().isSubtypeOf(LOCK)) { final String methodName = memberSelect.identifier().name(); IdentifierTree target = (IdentifierTree) expression; if (!isMemberSelectActingOnField(target) && TRY_LOCK_METHOD_NAME.equals(methodName)) { final SymbolicValue symbolicValue = programState.getValue(target.symbol()); constraintManager.setValueFactory(new TryLockSymbolicValueFactory(symbolicValue)); } } } }
Source:
<code>private void initializeFromBundle(Context context, Bundle bundle) { <START> if (mInitializedCalled == false) { <END> List<MediationConfiguration> configs = new ArrayList<>(); configs.add(new MediationConfiguration(AdFormat.BANNER, bundle)); initialize(context, null, configs); } }</code><technical_language>!InneractiveAdManager.wasInitialized() here? remove need for mInitializedCalled</technical_language>

Target:
private void initializeFromBundle(Context context, Bundle bundle) { List<MediationConfiguration> configs = new ArrayList<>(); configs.add(new MediationConfiguration(null, bundle)); initialize(context, null, configs); }
Source:
<code><START> public static boolean isPgpMimeEncrypted(Message message) { <END> String[] contentHeaders = null; try { contentHeaders = message.getHeader("Content-Type"); } catch (MessagingException e) { } if (contentHeaders == null) { return false; } for (String contentHeader : contentHeaders) { if (contentHeader.equalsIgnoreCase(MULTIPART_ENCRYPTED)) { return true; } } return false; }</code><technical_language>This is isSMimeEncrypted for checking for a of Content-Type, create a common method takes APPLICATION_PKCS7_MIME MULTIPART_ENCRYPTED a parameter</technical_language>

Target:
public static boolean isPgpMimeEncrypted(Message message) throws MessagingException { return contentHeaderContains(message, MULTIPART_ENCRYPTED); }
Source:
<code>public void testSendSerialData802IOError() throws XBeeException, IOException { Mockito.when(xbeeDevice.getXBeeProtocol()).thenReturn(XBeeProtocol.RAW_802_15_4); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(tx16Packet); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(tx64Packet); try { xbeeDevice.sendSerialData(XBEE_16BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx16 frame shouldn't have been sent successfully."); } catch (Exception e) { <START> assertEquals(XBeeException.class, e.getClass()); <END> } try { xbeeDevice.sendSerialData(XBEE_64BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); } try { xbeeDevice.sendSerialData(mockedDevice, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); } }</code><technical_language>check in more detail I/O error XBeeException is generic. java e.getCause() Apply rest</technical_language>

Target:
public void testSendSerialData802IOError() throws XBeeException, IOException { Mockito.when(xbeeDevice.getXBeeProtocol()).thenReturn(XBeeProtocol.RAW_802_15_4); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(tx16Packet); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(tx64Packet); try { xbeeDevice.sendSerialData(XBEE_16BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx16 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); assertEquals(IOException.class, e.getCause().getClass()); } try { xbeeDevice.sendSerialData(XBEE_64BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); assertEquals(IOException.class, e.getCause().getClass()); } try { xbeeDevice.sendSerialData(mockedDevice, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); assertEquals(IOException.class, e.getCause().getClass()); } }
Source:
<code>protected void handleUserInput() { Thread thread = new Thread(new Runnable() { @Override public void run() { Context ctx = mCtx.getActivity().getApplicationContext(); <START> ProjectDatabaseHelper db = ((TranslationRecorderApp)mCtx.getActivity().getApplication()).getDatabase(); <END> uploadBinary(ctx, db, outputFile()); } }); thread.start(); }</code><technical_language>do this; provide a dependency</technical_language>

Target:
protected void handleUserInput() { Thread thread = new Thread(new Runnable() { @Override public void run() { Context ctx = mCtx.getActivity().getApplicationContext(); uploadBinary(ctx, outputFile()); } }); thread.start(); }
Source:
<code>private List<Map<String, Object>> setBaseVanityURLFields() { List fields = new ArrayList(); fields.add(setFieldElements("Order", "com.dotcms.contenttype.model.field.TextField","", "integer2", true, true, false, "order", 5, "", "", "", "", true, false, true)); fields.add(setFieldElements("Action", "com.dotcms.contenttype.model.field.SelectField","", "integer1", true, true, false, "action", 4, "200 - Forward|200\r\n301 - Permanent Redirect|301\r\n302 - Temporary Redirect|302\r\n401 - Auth Required|401\r\n403 - Auth Failed|403\r\n404 - Missing|404\r\n500 - Error|500", "", "", "", true, false, true)); fields.add(setFieldElements("Forward To", "com.dotcms.contenttype.model.field.CustomField","", "text4", true, true, true, "forwardTo", 3, "$velutil.mergeTemplate('/static/content/file_browser_field_render.vtl')", "", "", "", true, false, false)); fields.add(setFieldElements("Uri", "com.dotcms.contenttype.model.field.TextField","", "text3", true, true, true, "uri", 2, "", "", "", "", true, false, true)); <START> fields.add(setFieldElements("Site","com.dotcms.contenttype.model.field.CustomField","","text2", true, true, true,"site",1,"$velutil.mergeTemplate('/static/content/site_selector_field_render.vtl')","","","",true,false,false)); <END> fields.add(setFieldElements("Title", "com.dotcms.contenttype.model.field.TextField","", "text1", true, true, true, "title", 1, "", "", "", "", true, false, true)); return fields; }</code><technical_language>![MINOR](<LINK_1> 'Severity: MINOR') Split this 227 characters long line (which is greater 150 authorized). [![rule](<LINK_0>](<LINK_2></technical_language>

Target:
private List<Map<String, Object>> setBaseVanityURLFields() { List fields = new ArrayList(); fields.add(setFieldElements("Title", TEXT_FIELD, "", "text1", true, true, true, "title", INT_1, "", "", "", "", true, false, true)); fields.add(setFieldElements("Site", CUSTOM_FIELD, "", "text2", true, false, true, "site", INT_2, "$velutil.mergeTemplate('/static/content/site_selector_field_render.vtl')", "", "", "", true, false, false)); fields.add( setFieldElements("Uri", TEXT_FIELD, "", "text3", true, true, true, "uri", INT_3, "", "", "", "", true, false, true)); fields.add(setFieldElements("Action", SELECT_FIELD, "", "integer1", true, true, false, "action", INT_4, "200 - Forward|200\r\n301 - Permanent Redirect|301\r\n302 - Temporary Redirect|302\r\n401 - Auth Required|401\r\n403 - Auth Failed|403\r\n404 - Missing|404\r\n500 - Error|500", "", "", "", true, false, true)); fields.add( setFieldElements("Forward To", CUSTOM_FIELD, "", "text4", true, true, true, "forwardTo", INT_5, "$velutil.mergeTemplate('/static/content/file_browser_field_render.vtl')", "", "", "", true, false, false)); fields.add(setFieldElements("Order", TEXT_FIELD, "", "integer2", true, true, false, "order", INT_6, "", "", "", "0", true, false, true)); return fields; }
Source:
<code>public void goToMeasurements(MenuItem menuItem) { <START> if(mAssignment != null && mAssignment.getRole() == Assignment.Role.BLOCKED) <END> { AlertDialog alertDialog = new AlertDialog.Builder(this) .setTitle(getString(R.string.title_dialog_blocked)) .setMessage(getString(R.string.disallowed_measurements)) .setNeutralButton(getString(R.string.ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }) .create(); alertDialog.show(); } else { startActivity(new Intent(getApplicationContext(), MeasurementsActivity.class)); } }</code><technical_language>for code readability beneficial provide some boolean accessors Assignment class for roles. if(mAssignment != null && mAssignment.isBlocked())</technical_language>

Target:
public void goToMeasurements(MenuItem menuItem) { if(mAssignment != null && mAssignment.isBlocked()) { AlertDialog alertDialog = new AlertDialog.Builder(this) .setTitle(getString(R.string.title_dialog_blocked)) .setMessage(getString(R.string.disallowed_measurements)) .setNeutralButton(getString(R.string.ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }) .create(); alertDialog.show(); } else { startActivity(new Intent(getApplicationContext(), MeasurementsActivity.class)); } }
Source:
<code>public void testGenerateAmazonS3GetBucketRequestPrototype() throws IOException, TemplateModelException { final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); <START> Map<String,Object> testMap = new HashMap<>(); <END> final String responseType = StructHelper.getResponseTypeName("ListBucketResult"); final Request requestEntry = new Request( "GetBucketRequest", Classification.amazons3, HttpVerb.GET, "\"/\", bucket_name, NULL", null, null, RequestConverter.getParamList(responseType), true, false, responseType ); testMap.put("requestEntry", requestEntry); final CCodeGenerator codeGenerator = new CCodeGenerator(); codeGenerator.processTemplate(testMap, "header-templates/RequestPrototype.ftl", fileUtils.getOutputStream()); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); final String expectedOutput = "ds3_error* get_bucket_request(const ds3_client* client, const ds3_request* request, const ds3_list_bucket_result_response** response);"; assertEquals(expectedOutput, output); }</code><technical_language>Missing final</technical_language>

Target:
public void testGenerateAmazonS3GetBucketRequestPrototype() throws IOException, TemplateModelException { final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); final Map<String,Object> testMap = new HashMap<>(); final String responseType = StructHelper.getResponseTypeName("ListBucketResult"); final Request requestEntry = new Request( "GetBucketRequest", Classification.amazons3, HttpVerb.GET, "\"/\", bucket_name, NULL", null, null, RequestConverter.getParamList(responseType), true, false, responseType ); testMap.put("requestEntry", requestEntry); final CCodeGenerator codeGenerator = new CCodeGenerator(); codeGenerator.processTemplate(testMap, "header-templates/RequestPrototype.ftl", fileUtils.getOutputStream()); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); final String expectedOutput = "ds3_error* get_bucket_request(const ds3_client* client, const ds3_request* request, const ds3_list_bucket_result_response** response);"; assertEquals(expectedOutput, output); }
Source:
<code>private RyaDetails initializeRyaDetails( final String instanceName, final InstallConfiguration installConfig) throws AlreadyInitializedException, RyaDetailsRepositoryException { final RyaDetailsRepository detailsRepo = new MongoRyaInstanceDetailsRepository(adminClient, instanceName); if(installConfig.getFluoPcjAppName().isPresent()) { log.warn("Mongo does not have fluo support, use ignoring the configured fluo application name: " + installConfig.getFluoPcjAppName().get()); } final PCJIndexDetails.Builder pcjDetailsBuilder = PCJIndexDetails.builder() .setEnabled(installConfig.isPcjIndexEnabled()); final RyaDetails details = RyaDetails.builder() .setRyaInstanceName(instanceName).setRyaVersion(getVersion()) .setTemporalIndexDetails(new TemporalIndexDetails(installConfig.isTemporalIndexEnabled())) .setFreeTextDetails(new FreeTextIndexDetails(installConfig.isFreeTextIndexEnabled())) <START> .setEntityCentricIndexDetails(new EntityCentricIndexDetails(installConfig.isEntityCentrixIndexEnabled())) <END> .setPCJIndexDetails(pcjDetailsBuilder) .setProspectorDetails(new ProspectorDetails(Optional.<Date> absent())) .setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date> absent())) .build(); detailsRepo.initialize(details); return details; }</code><technical_language>enable entity centric indexing in this ticket too? a separate ticket</technical_language>

Target:
private RyaDetails initializeRyaDetails( final String instanceName, final InstallConfiguration installConfig) throws AlreadyInitializedException, RyaDetailsRepositoryException { final RyaDetailsRepository detailsRepo = new MongoRyaInstanceDetailsRepository(adminClient, instanceName); if(installConfig.getFluoPcjAppName().isPresent()) { log.warn("Mongo does not have fluo support, use ignoring the configured fluo application name: " + installConfig.getFluoPcjAppName().get()); } final PCJIndexDetails.Builder pcjDetailsBuilder = PCJIndexDetails.builder() .setEnabled(installConfig.isPcjIndexEnabled()); final RyaDetails details = RyaDetails.builder() .setRyaInstanceName(instanceName).setRyaVersion(getVersion()) .setTemporalIndexDetails(new TemporalIndexDetails(installConfig.isTemporalIndexEnabled())) .setFreeTextDetails(new FreeTextIndexDetails(installConfig.isFreeTextIndexEnabled())) .setEntityCentricIndexDetails(new EntityCentricIndexDetails(false)) .setPCJIndexDetails(pcjDetailsBuilder) .setProspectorDetails(new ProspectorDetails(Optional.<Date> absent())) .setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date> absent())) .build(); detailsRepo.initialize(details); return details; }
Source:
<code>RunningJobs getRunningJobs() { if (runningJobs == null) { runningJobs = new RunningJobs(); <START> } <END> return runningJobs; }</code><technical_language>Removing synchronized means is risk of dirty write</technical_language>

Target:
synchronized RunningJobs getRunningJobs() { if (runningJobs == null) { runningJobs = new RunningJobs(); } return runningJobs; }
Source:
<code>public BooleanColumnBuilder() { data = new BitSet(); numBits = 0; Schema schema = new Schema(Arrays.asList(Type.BOOLEAN_TYPE)); <START> int batchSize = TupleUtils.getBatchSize(schema); <END> capacity = batchSize; }</code><technical_language>Call function a single Type input instead</technical_language>

Target:
public BooleanColumnBuilder() { data = new BitSet(); numBits = 0; int batchSize = TupleUtils.getBatchSize(Type.BOOLEAN_TYPE); capacity = batchSize; }
Source:
<code>public Response activate(Action action) { validateParameters(action, "bricks"); validateBrickNames(action); GlusterVolumeEntity volume = getEntity(GlusterVolumeEntity.class, VdcQueryType.GetGlusterVolumeById, new IdQueryParameters(asGuid(getVolumeId())), ""); <START> if (volume.getAsyncTask() != null && volume.getAsyncTask().getType() == GlusterTaskType.REMOVE_BRICK <END> && volume.getAsyncTask().getStatus() == JobExecutionStatus.FINISHED) { return stopMigrate(action); } else { Fault fault = new Fault(); fault.setReason(localize(Messages.CANNOT_ACTIVATE_UNLESS_MIGRATION_COMPLETED)); throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity(fault) .build()); } }</code><technical_language>Is this accurate check possible? check if some bricks removed in this volume. if ran 'activate' action brick A, in volume, brick B is deleted (and brick A)? this pass validation</technical_language>

Target:
public Response activate(Action action) { validateParameters(action, "bricks"); validateBrickNames(action); GlusterVolumeEntity volume = getEntity(GlusterVolumeEntity.class, VdcQueryType.GetGlusterVolumeById, new IdQueryParameters(asGuid(getVolumeId())), ""); if (volume.getAsyncTask() != null && volume.getAsyncTask().getType() == GlusterTaskType.REMOVE_BRICK && volume.getAsyncTask().getStatus() == JobExecutionStatus.FINISHED) { return stopMigrate(action); } else { Fault fault = new Fault(); fault.setReason(localize(Messages.CANNOT_ACTIVATE_UNLESS_MIGRATION_COMPLETED)); throw new WebApplicationException(Response.status(Response.Status.CONFLICT) .entity(fault) .build()); } }
Source:
<code>public void processRequest(final RequestContext context, final RequestSecurityProcessorChain processorChain) throws Exception { HttpServletRequest request = context.getRequest(); Authentication auth = SecurityUtils.getAuthentication(request); <START> logger.debug("Checking headers from Mellon"); <END> String username = request.getHeader(usernameHeaderName); String email = request.getHeader(emailHeaderName); HierarchicalConfiguration config = ConfigUtils.getCurrentConfig(); if (StringUtils.isNoneEmpty(username, email) && Objects.isNull(auth) && Objects.nonNull(config) && config.containsKey(SAML_TOKEN_CONFIG_KEY) && hasValidToken(request)) { logger.debug("Using standalone SAML authentication"); logger.debug("Creating authentication object for '{}'", username); Profile profile = new Profile(); profile.setUsername(username); profile.setEmail(email); addAttributes(profile, request, config); addRoles(profile, request, config); SecurityUtils.setAuthentication(request, new PreAuthenticatedProfile(profile)); processorChain.processRequest(context); } else { logger.debug("Using Crafter Profile SAML authentication"); super.processRequest(context, processorChain); } }</code><technical_language>call Mellon? cases else is instead of Mellon</technical_language>

Target:
public void processRequest(final RequestContext context, final RequestSecurityProcessorChain processorChain) throws Exception { HttpServletRequest request = context.getRequest(); Authentication auth = SecurityUtils.getAuthentication(request); logger.debug("Checking authentication headers"); String username = request.getHeader(usernameHeaderName); String email = request.getHeader(emailHeaderName); HierarchicalConfiguration config = ConfigUtils.getCurrentConfig(); if (StringUtils.isNoneEmpty(username, email) && Objects.isNull(auth) && Objects.nonNull(config) && config.containsKey(SAML_TOKEN_CONFIG_KEY) && hasValidToken(request)) { logger.debug("Using standalone SAML authentication"); logger.debug("Creating authentication object for '{}'", username); Profile profile = new Profile(); profile.setUsername(username); profile.setEmail(email); addAttributes(profile, request, config); addRoles(profile, request, config); SecurityUtils.setAuthentication(request, new PreAuthenticatedProfile(profile)); processorChain.processRequest(context); } else { logger.debug("Using Crafter Profile SAML authentication"); super.processRequest(context, processorChain); } }
Source:
<code>public void deserialize(Block block, int index, MultimapAggregationState state) { state.reset(); ColumnarRow columnarRow = toColumnarRow(arrayType.getObject(block, index)); <START> Block keys = columnarRow.getField(1); <END> Block values = columnarRow.getField(0); for (int i = 0; i < columnarRow.getPositionCount(); i++) { state.add(keys, values, i); } }</code><technical_language>VALUE_CHANNEL KEY_CHANNEL GroupedMultimapAggregationState</technical_language>

Target:
public void deserialize(Block block, int index, MultimapAggregationState state) { state.reset(); ColumnarRow columnarRow = toColumnarRow(arrayType.getObject(block, index)); Block keys = columnarRow.getField(KEY_CHANNEL); Block values = columnarRow.getField(VALUE_CHANNEL); for (int i = 0; i < columnarRow.getPositionCount(); i++) { state.add(keys, values, i); } }
Source:
<code>private Map<String, String> buildResultTagMap(Result result) throws Exception { Map<String, String> resultTagsToApply = new TreeMap<String, String>(); <START> for (ResultAttribute resultAttribute : resultAttributesToWriteAsTags) { <END> Method m = result.getClass().getMethod(resultAttribute.getAccessorMethod()); resultTagsToApply.put(resultAttribute.getTagName(), (String) m.invoke(result)); } return resultTagsToApply; }</code><technical_language>Nice usage of reflection! wondering if this smart... break automatic refactoring of Result class. externalize ResultAttribute class provide a unit test validates properties extracted. Also, extraction logic moved ResultAttribute class. This give actual responsibility act more a dumb data object</technical_language>

Target:
private Map<String, String> buildResultTagMap(Result result) throws Exception { Map<String, String> resultTagMap = new TreeMap<String, String>(); for (ResultAttribute resultAttribute : resultAttributesToWriteAsTags) { resultAttribute.addAttribute(resultTagMap, result); } return resultTagMap; }
Source:
<code>public CatalogStorage(Cluster cluster, CatalogTable table) throws URISyntaxException { this(ClusterHelper.getInterface(cluster, Interfacetype.REGISTRY).getEndpoint(), table); <START> verifyAndUpdateConfiguration(getConf()); <END> }</code><technical_language>need here. verifyAndUpdateConfiguration is called in CatalogStorage(String catalogUrl, CatalogTable table)</technical_language>

Target:
public CatalogStorage(Cluster cluster, CatalogTable table) throws URISyntaxException { this(ClusterHelper.getInterface(cluster, Interfacetype.REGISTRY).getEndpoint(), table); }
Source:
<code>public static void init() { SWTBotUtils.failIfUIThread(); URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(COLUMN_TRACE_PATH), null); URI uri; try { uri = FileLocator.toFileURL(location).toURI(); fTestFile = new File(uri); } catch (URISyntaxException | IOException e) { fail(e.getMessage()); } assumeTrue(fTestFile.exists()); <START> IEclipsePreferences defaultPreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); <END> defaultPreferences.put(ITmfTimePreferencesConstants.DATIME, "MMM d HH:mm:ss"); defaultPreferences.put(ITmfTimePreferencesConstants.SUBSEC, ITmfTimePreferencesConstants.SUBSEC_NO_FMT); TmfTimestampFormat.updateDefaultFormats(); SWTBotPreferences.TIMEOUT = 20000; fLogger.removeAllAppenders(); fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT)); fBot = new SWTWorkbenchBot(); SWTBotUtils.closeView("Welcome", fBot); SWTBotUtils.switchToTracingPerspective(); SWTBotUtils.waitForJobs(); }</code><technical_language>do test Timestamp text, need update time preferences</technical_language>

Target:
public static void init() { SWTBotUtils.failIfUIThread(); URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(COLUMN_TRACE_PATH), null); URI uri; try { uri = FileLocator.toFileURL(location).toURI(); fTestFile = new File(uri); } catch (URISyntaxException | IOException e) { fail(e.getMessage()); } assumeTrue(fTestFile.exists()); SWTBotPreferences.TIMEOUT = 20000; fLogger.removeAllAppenders(); fLogger.addAppender(new ConsoleAppender(new SimpleLayout(), ConsoleAppender.SYSTEM_OUT)); fBot = new SWTWorkbenchBot(); SWTBotUtils.closeView("Welcome", fBot); SWTBotUtils.switchToTracingPerspective(); SWTBotUtils.waitForJobs(); }
Source:
<code>public boolean write() throws IOException { Send send = networkSend.getPayload(); if (send == null) { throw new IllegalStateException("Registered for write interest but no response attached to key."); } long startTimeMs = SystemTime.getInstance().milliseconds(); long bytesWritten = send.writeTo(socketChannel); long writeTimeMs = SystemTime.getInstance().milliseconds() - startTimeMs; logger.trace("Bytes written to using key Time: {}", bytesWritten, socketChannel.socket().getRemoteSocketAddress(), getConnectionId(), writeTimeMs); if (bytesWritten > 0) { <START> metrics.plaintextSendTimePerKB.update(writeTimeMs * 1024 / bytesWritten); <END> metrics.plaintextSendTime.update(writeTimeMs); } return send.isSendComplete(); }</code><technical_language>change, I this wrong. of variables forced float; I suspect this resolves 0 of time - 300KB written (~ average size see), 60 ms send time, this resolve 60 * 1024 / (300 * 1024) == 0</technical_language>

Target:
public boolean write() throws IOException { Send send = networkSend.getPayload(); if (send == null) { throw new IllegalStateException("Registered for write interest but no response attached to key."); } long startTimeMs = SystemTime.getInstance().milliseconds(); long bytesWritten = send.writeTo(socketChannel); long writeTimeMs = SystemTime.getInstance().milliseconds() - startTimeMs; logger.trace("Bytes written to using key Time: {}", bytesWritten, socketChannel.socket().getRemoteSocketAddress(), getConnectionId(), writeTimeMs); if (bytesWritten > 0) { metrics.plaintextSendTimeInUsPerKB.update(TimeUnit.MILLISECONDS.toMicros(writeTimeMs) * 1024 / bytesWritten); metrics.plaintextSendTime.update(writeTimeMs); } return send.isSendComplete(); }
Source:
<code>private static boolean skip(String name) { <START> return name.startsWith("refs/changes/") <END> || name.startsWith("refs/cache-automerge/"); }</code><technical_language>[optional] "refs/changes/" declared constant somewhere</technical_language>

Target:
private static boolean skip(String name) { return name.startsWith("refs/changes/") || name.startsWith(GitRepositoryManager.REFS_CACHE_AUTOMERGE); }
Source:
<code><START> public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { <END> argumentResolvers.add(repositoryInstanceMethodArgumentResolver()); }</code><technical_language>missed formatter</technical_language>

Target:
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { argumentResolvers.add(repositoryMethodArgumentResolver()); }
Source:
<code>public void loadApplicationsShouldRespondWithSingleElementArrayWhenThereIsOnlyOneApplication() throws Exception { given(statesHistoryService.getCandidateApplicationsByCandidateId(CANDIDATE_ID)) .willReturn(Collections.singletonList(developerApplicationDto)); mockMvc.perform( get(REQUEST_URL + CANDIDATE_ID.toString()).accept(MediaTypes.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaTypes.APPLICATION_JSON_UTF8)) .andExpect(jsonPath("$").isArray()) .andExpect(jsonPath("$[0]").exists()) <START> .andExpect(jsonPath("$[0].lastStateId", equalTo(LAST_STATE_ID.intValue()))) <END> .andExpect(jsonPath("$[0].applicationId", equalTo(APPLICATION_ID.intValue()))) .andExpect(jsonPath("$[0].positionName", equalTo(DEVELOPER_POSITION))) .andExpect(jsonPath("$[0].creationDate", equalTo(CREATION_DATE))) .andExpect(jsonPath("$[0].modificationDate", equalTo(MODIFICATION_DATE))) .andExpect(jsonPath("$[0].stateType", equalTo(LOCALIZED_STATE_TYPE))) .andExpect(jsonPath("$[1]").doesNotExist()); then(statesHistoryService).should().getCandidateApplicationsByCandidateId(CANDIDATE_ID); then(messageSource).should() .getMessage(eq(APPLICATION_STATE + RAW_STATE_TYPE), eq(new Object[]{RAW_STATE_TYPE}), any(Locale.class)); }</code><technical_language>$[0], lastStateId, positionName, etc. a lot of times. extracted concatenated places of usage</technical_language>

Target:
public void loadApplicationsShouldRespondWithSingleElementArrayWhenThereIsOnlyOneApplication() throws Exception { given(statesHistoryService.getCandidateApplicationsByCandidateId(CANDIDATE_ID)) .willReturn(Collections.singletonList(developerApplicationDto)); ResultActions resultActions = mockMvc.perform( get(REQUEST_URL + CANDIDATE_ID.toString()).accept(MediaTypes.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaTypes.APPLICATION_JSON_UTF8)) .andExpect(jsonPath("$").isArray()) .andExpect(jsonPath("$[0]").exists()) .andExpect(jsonPath("$[1]").doesNotExist()); assertApplicationResponse(resultActions, 0, developerApplicationDto); then(statesHistoryService).should().getCandidateApplicationsByCandidateId(CANDIDATE_ID); then(messageSource).should() .getMessage(eq(APPLICATION_STATE + RAW_STATE_TYPE), eq(new Object[]{RAW_STATE_TYPE}), any(Locale.class)); }
Source:
<code>private void checkForMerge(final Master master) throws Exception { VolumeManager fs = master.getFileSystem(); final Path bulkDir = new Path(bulkInfo.sourceDir); try (LoadMappingIterator lmi = BulkSerialize.readLoadMapping(bulkDir.toString(), bulkInfo.tableId, p -> fs.open(p))) { <START> Iterators.transform(lmi, entry -> entry.getKey()); <END> TabletIterFactory tabletIterFactory = startRow -> TabletsMetadata.builder() .forTable(bulkInfo.tableId).overlapping(startRow, null).checkConsistency().fetchPrev() .build(master.getContext()).stream().map(TabletMetadata::getExtent).iterator(); checkForMerge(bulkInfo.tableId.canonicalID(), Iterators.transform(lmi, entry -> entry.getKey()), tabletIterFactory); } }</code><technical_language>suggestion</technical_language>

Target:
private void checkForMerge(final Master master) throws Exception { VolumeManager fs = master.getFileSystem(); final Path bulkDir = new Path(bulkInfo.sourceDir); try (LoadMappingIterator lmi = BulkSerialize.readLoadMapping(bulkDir.toString(), bulkInfo.tableId, p -> fs.open(p))) { TabletIterFactory tabletIterFactory = startRow -> TabletsMetadata.builder() .forTable(bulkInfo.tableId).overlapping(startRow, null).checkConsistency().fetchPrev() .build(master.getContext()).stream().map(TabletMetadata::getExtent).iterator(); checkForMerge(bulkInfo.tableId.canonicalID(), Iterators.transform(lmi, entry -> entry.getKey()), tabletIterFactory); } }
Source:
<code>public void checkVolumeExists(String name, String path) { seleniumWebDriverHelper.waitVisibility(By.xpath(format(Locators.VOLUME_NAME_XPATH, name))); <START> seleniumWebDriverHelper.waitVisibility(By.xpath(format(Locators.VOLUME_PATH_XPATH, name))); <END> }</code><technical_language>'seleniumWebDriverHelper.waitVisibility(By.xpath(format(Locators.VOLUME_PATH_XPATH, **path**)));' in line</technical_language>

Target:
public Boolean checkVolumeExists(String name, String path) { return seleniumWebDriverHelper .waitVisibilityAndGetText(By.xpath(format(Locators.VOLUME_PATH_XPATH_PATTERN, name))) .equals(path); }
Source:
<code>protected void recordLineage(BatchSinkContext context, String outputName, Schema tableSchema, String operationName, String description) { LineageRecorder lineageRecorder = new LineageRecorder(context, outputName); lineageRecorder.createExternalDataset(tableSchema); List<String> fieldNames = tableSchema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList()); <START> if (!fieldNames.isEmpty()) { <END> lineageRecorder.recordWrite(operationName, description, fieldNames); } }</code><technical_language>schema null</technical_language>

Target:
protected void recordLineage(BatchSinkContext context, String outputName, Schema tableSchema, String operationName, String description) { if (tableSchema == null) { LOG.warn("Schema for output %s is null. Field-level lineage will not be recorded.", outputName); return; } if (tableSchema.getFields() == null) { LOG.warn("Schema fields for output %s is empty. Field-level lineage will not be recorded", outputName); return; } LineageRecorder lineageRecorder = new LineageRecorder(context, outputName); lineageRecorder.createExternalDataset(tableSchema); List<String> fieldNames = tableSchema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList()); if (!fieldNames.isEmpty()) { lineageRecorder.recordWrite(operationName, description, fieldNames); } }
Source:
<code>public void localhostTest() throws Exception { <START> LocalhostFilter filter = mockWithRemoteAddress("127.0.0.1"); <END> ContainerRequestContext context = mockContainerRequestContext("test"); ArgumentCaptor<Response> captor = ArgumentCaptor.forClass(Response.class); filter.filter(context); verify(context, never()).abortWith(captor.capture()); }</code><technical_language>If kill :-)</technical_language>

Target:
public void localhostTest() throws Exception { assertFilterDoesNotBlockAddress("127.0.0.1"); }
Source:
<code>private boolean isRemoteCache(RemoteOptions options) { <START> return options.diskCache != null && !options.diskCache.isEmpty(); <END> }</code><technical_language>I need flip logic line 118: return options.diskCache == null || options.diskCache.isEmpty(); && **!** isRemoteCache(options))</technical_language>

Target:
private boolean isRemoteCache(RemoteOptions options) { return !isNullOrEmpty(options.remoteCache); }
Source:
<code>private void registerGateway(Stack stack) { <START> String knoxUrl = stack.getTunnel().useCcm() && entitlementService.ccmV2Enabled(getAccountId(stack)) ? <END> knoxUrlForCcmV2(stack) : knoxUrl(stack); ConfigUpdateRequest request = new ConfigUpdateRequest(stack.getResourceCrn(), knoxUrl); clusterProxyRegistrationClient.updateConfig(request); }</code><technical_language>I tunnel a new value, CCMv2 if is chosen CCMv2. This ensure envs CCMv1 start datahubs it, if account v2 enabled. a bad idea mix CCM versions in environments run</technical_language>

Target:
private void registerGateway(Stack stack) { String knoxUrl = stack.getTunnel().useCcmV2() ? knoxUrlForCcmV2(stack) : knoxUrl(stack); ConfigUpdateRequest request = new ConfigUpdateRequest(stack.getResourceCrn(), knoxUrl); clusterProxyRegistrationClient.updateConfig(request); }
Source:
<code><START> public void onAuthenticationChanged(OnAuthenticationChanged event) { <END> if (event.isError()) { disconnectGoogleClient(); AppLog.e(T.API, "LoginEmailFragment.onAuthenticationChanged: " + event.error.type + " - " + event.error.message); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_FAILED, event.getClass().getSimpleName(), event.error.type.toString(), event.error.message); } else if (mAccountStore.hasAccessToken()) { mDispatcher.dispatch(AccountActionBuilder.newFetchAccountAction()); NotificationsUpdateService.startService(getActivity().getApplicationContext()); } }</code><technical_language>Is this callback hit in context of this PR? If not, remove this PR add PR for time? Thanks</technical_language>

Target:
public void onAuthenticationChanged(OnAuthenticationChanged event) { if (event.isError()) { disconnectGoogleClient(); AppLog.e(T.API, "LoginEmailFragment.onAuthenticationChanged: " + event.error.type + " - " + event.error.message); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_FAILED, event.getClass().getSimpleName(), event.error.type.toString(), event.error.message); } else { AppLog.i(T.NUX, "LoginEmailFragment.onAuthenticationChanged: " + event.toString()); doFinishLogin(); } }
Source:
<code>public void close() { <START> tx.commit(); <END> }</code><technical_language>call tx.close() tx.commit() I suppose this unit test w/ EasyMock good.. verify tx.close called a mock transaction</technical_language>

Target:
public void close() { tx.close(); }
Source:
<code>protected void setCPU( ICraftingCPU c ) { if( c == this.monitor ) { return; } if( this.monitor != null ) { this.monitor.removeListener( this ); } for( Object g : this.crafters ) { if( g instanceof EntityPlayer ) { try { NetworkHandler.instance.sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (EntityPlayerMP) g ); } catch( IOException e ) { AELog.error( e ); } } } if( c instanceof CraftingCPUCluster ) { this.cpuName = c.getName(); this.monitor = (CraftingCPUCluster) c; if( this.monitor != null ) { this.list.resetStatus(); this.monitor.getListOfItem( this.list, CraftingItemList.ALL ); this.monitor.addListener( this, null ); this.eta = 0; <START> } <END> } else { this.monitor = null; this.cpuName = ""; } }</code><technical_language>simplify this block due null check in instanceof. this.monitor is null</technical_language>

Target:
protected void setCPU( ICraftingCPU c ) { if( c == this.monitor ) { return; } if( this.monitor != null ) { this.monitor.removeListener( this ); } for( Object g : this.crafters ) { if( g instanceof EntityPlayer ) { try { NetworkHandler.instance.sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (EntityPlayerMP) g ); } catch( IOException e ) { AELog.error( e ); } } } if( c instanceof CraftingCPUCluster ) { this.cpuName = c.getName(); this.monitor = (CraftingCPUCluster) c; this.list.resetStatus(); this.monitor.getListOfItem( this.list, CraftingItemList.ALL ); this.monitor.addListener( this, null ); this.eta = 0; } else { this.monitor = null; this.cpuName = ""; } }
Source:
<code>private static Map<TopicPartition, Long> getTopicPartitionOffsetsMap(final List<String> changelogTopics, final List<Integer> topicsNumPartitions) { if (changelogTopics.size() != topicsNumPartitions.size()) { throw new IllegalStateException("Passed in " + changelogTopics.size() + " changelog topic names, but " + topicsNumPartitions.size() + " different numPartitions for the topics"); } final Map<TopicPartition, Long> changelogEndOffsets = new HashMap<>(); <START> for (int i = 0; i < changelogTopics.size(); ++i) { <END> final String topic = changelogTopics.get(i); final int numPartitions = topicsNumPartitions.get(i); for (int partition = 0; partition < numPartitions; ++partition) { changelogEndOffsets.put(new TopicPartition(topic, partition), 0L); } } return changelogEndOffsets; }</code><technical_language>this class parameterized run tests HA</technical_language>

Target:
private static Map<TopicPartition, Long> getTopicPartitionOffsetsMap(final List<String> changelogTopics, final List<Integer> topicsNumPartitions) { if (changelogTopics.size() != topicsNumPartitions.size()) { throw new IllegalStateException("Passed in " + changelogTopics.size() + " changelog topic names, but " + topicsNumPartitions.size() + " different numPartitions for the topics"); } final Map<TopicPartition, Long> changelogEndOffsets = new HashMap<>(); for (int i = 0; i < changelogTopics.size(); ++i) { final String topic = changelogTopics.get(i); final int numPartitions = topicsNumPartitions.get(i); for (int partition = 0; partition < numPartitions; ++partition) { changelogEndOffsets.put(new TopicPartition(topic, partition), Long.MAX_VALUE); } } return changelogEndOffsets; }
Source:
<code>private Observable<PersistentResource> getValueChecked(PersistentResource<?> resource, String fieldName, RequestScope requestScope) { EntityDictionary dictionary = resource.getDictionary(); requestScope.getPermissionExecutor().checkSpecificFieldPermissions(resource, null, ReadPermission.class, fieldName); Object entity = resource.getObject(); if (entity == null || resource.getDictionary() <START> .getRelationshipType(getType(entity.getClass()), fieldName) == RelationshipType.NONE) { <END> return Observable.empty(); } Relationship relationship = Relationship.builder() .name(fieldName) .alias(fieldName) .projection(EntityProjection.builder() .type(dictionary.getParameterizedType(resource.getResourceType(), fieldName)) .build()) .build(); return resource.getRelationChecked(relationship); }</code><technical_language>This work for dynamic types. get Type persistent resource here</technical_language>

Target:
private Observable<PersistentResource> getValueChecked(PersistentResource<?> resource, String fieldName, RequestScope requestScope) { EntityDictionary dictionary = resource.getDictionary(); requestScope.getPermissionExecutor().checkSpecificFieldPermissions(resource, null, ReadPermission.class, fieldName); Object entity = resource.getObject(); if (entity == null || resource.getDictionary() .getRelationshipType(resource.getResourceType(), fieldName) == RelationshipType.NONE) { return Observable.empty(); } Relationship relationship = Relationship.builder() .name(fieldName) .alias(fieldName) .projection(EntityProjection.builder() .type(dictionary.getParameterizedType(resource.getResourceType(), fieldName)) .build()) .build(); return resource.getRelationChecked(relationship); }
Source:
<code>public Filter drop() { <START> return new Filter(matchers).on(); <END> }</code><technical_language>so, pass in a list of filters, call add new Filter list, a circle graph? list -> new Filter -> list -> new Filter</technical_language>

Target:
public Filter drop() { return new Filter(from, to, verbs, matcher).on(); }
Source:
<code>public void sendMail(String host, String reply, String to, String subject, String messageText) { Properties props = System.getProperties(); props.put("mail.smtp.host", host); Session session = Session.getDefaultInstance(props, null); try { MimeMessage msg = new MimeMessage(session); String[] recipientStrings = to.split(","); InternetAddress[] recipients = new InternetAddress[recipientStrings.length]; try { InternetAddress fromAddress=getSystemAddress(); <START> fromAddress.setPersonal(fromAddress.getPersonal() + "on behalf of " + reply, charset); <END> msg.setFrom(fromAddress); msg.setReplyTo(new Address[] {new InternetAddress(reply, charset)}); for (int i = 0; i < recipients.length; i++) { recipients[i] = new InternetAddress(recipientStrings[i], "", charset); } } catch (UnsupportedEncodingException ex) { logger.severe(ex.getMessage()); } msg.setRecipients(Message.RecipientType.TO, recipients); msg.setSubject(subject, charset); msg.setText(messageText, charset); Transport.send(msg, recipients); } catch (AddressException ae) { ae.printStackTrace(System.out); } catch (MessagingException me) { me.printStackTrace(System.out); } }</code><technical_language>"on behalf of" put Bundle.properties translated languages</technical_language>

Target:
public void sendMail(String host, String reply, String to, String subject, String messageText) { Properties props = System.getProperties(); props.put("mail.smtp.host", host); Session session = Session.getDefaultInstance(props, null); try { MimeMessage msg = new MimeMessage(session); String[] recipientStrings = to.split(","); InternetAddress[] recipients = new InternetAddress[recipientStrings.length]; try { InternetAddress fromAddress=getSystemAddress(); fromAddress.setPersonal(BundleUtil.getStringFromBundle("contact.delegation", Arrays.asList( fromAddress.getPersonal(), reply)), charset); msg.setFrom(fromAddress); msg.setReplyTo(new Address[] {new InternetAddress(reply, charset)}); for (int i = 0; i < recipients.length; i++) { recipients[i] = new InternetAddress(recipientStrings[i], "", charset); } } catch (UnsupportedEncodingException ex) { logger.severe(ex.getMessage()); } msg.setRecipients(Message.RecipientType.TO, recipients); msg.setSubject(subject, charset); msg.setText(messageText, charset); Transport.send(msg, recipients); } catch (AddressException ae) { ae.printStackTrace(System.out); } catch (MessagingException me) { me.printStackTrace(System.out); } }