auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void deployTopology(Topology topology) throws Exception { TopologyDag dag = topologyDagBuilder.getDag(topology); topology.setTopologyDag(dag); LOG.debug("Deploying topology {}", topology); setUpClusterArtifacts(topology); setUpExtraJars(topology); setUpResources(topology); topologyActions.deploy(getTopologyLayout(topology)); }

Target:
public void deployTopology(Topology topology) throws Exception { TopologyDag dag = topologyDagBuilder.getDag(topology); topology.setTopologyDag(dag); ensureValid(dag); LOG.info("Deploying topology {}", topology); setUpClusterArtifacts(topology); StormTopologyExtraJarsHandler extraJarsHandler = new StormTopologyExtraJarsHandler(this); topology.getTopologyDag().traverse(extraJarsHandler); setUpExtraJars(topology, extraJarsHandler.getExtraJars()); setUpResources(topology, extraJarsHandler.getExtraResources()); topologyActions.deploy(getTopologyLayout(topology)); }
Source:
public MatchImplementor get(final SqlMatchFunction function) { final Supplier<? extends MatchImplementor> supplier = mrMap.get(function); if (supplier != null) { return supplier.get(); } else { return null; } }

Target:
public MatchImplementor get(final SqlMatchFunction function) { final Supplier<? extends MatchImplementor> supplier = mrMap.get(function); if (supplier != null) { return supplier.get(); } else { throw new IllegalStateException("Supplier should not be null"); } }
Source:
private static void validateSql(String sqlDefinition) { if (!DynamicConfigHelpers.isNullOrEmpty(sqlDefinition) && (sqlDefinition.contains(SEMI_COLON) || containsDisallowedWords(sqlDefinition, SQL_SPLIT_REGEX, SQL_DISALLOWED_WORDS))) { throw new IllegalStateException( "sql/definition provided in table config contain either ';' or one of these words: " + Arrays.toString(SQL_DISALLOWED_WORDS.toArray())); } }

Target:
private static void validateSql(String sqlDefinition) { if (!DynamicConfigHelpers.isNullOrEmpty(sqlDefinition) && (sqlDefinition.contains(SEMI_COLON) || containsDisallowedWords(sqlDefinition, SQL_SPLIT_REGEX, SQL_DISALLOWED_WORDS))) { throw new IllegalStateException("sql/definition provided in table config contain either '" + SEMI_COLON + "' or one of these words: " + Arrays.toString(SQL_DISALLOWED_WORDS.toArray())); } }
Source:
public double simpleCapletPrice(CapFloorIbor caplet) { CapFloorIbor capStandard = new CapFloorIbor(caplet.getCurrency(), caplet.getFixingPeriodEndTime(), caplet.getPaymentYearFraction(), caplet.getNotional(), caplet.getFixingTime(), caplet.getIndex(), caplet.getFixingPeriodStartTime(), caplet.getFixingPeriodEndTime(), caplet.getFixingAccrualFactor(), caplet.getStrike(), caplet.isCap()); SimpleOptionData option = CapFloorDecomposer.toOption(capStandard, _curves); return simpleOptionPrice(option); }

Target:
public double simpleCapletPrice(CapFloorIbor caplet) { ArgumentChecker.notNull(caplet, "caplet"); CapFloorIbor capStandard = new CapFloorIbor(caplet.getCurrency(), caplet.getFixingPeriodEndTime(), caplet.getPaymentYearFraction(), caplet.getNotional(), caplet.getFixingTime(), caplet.getIndex(), caplet.getFixingPeriodStartTime(), caplet.getFixingPeriodEndTime(), caplet.getFixingAccrualFactor(), caplet.getStrike(), caplet.isCap()); SimpleOptionData option = CapFloorDecomposer.toOption(capStandard, _curves); return simpleOptionPrice(option); }
Source:
private ColumnStatisticsAggregation createAggregation(String functionName, SymbolReference input, Type inputType, Type outputType) { FunctionManager functionManager = metadata.getFunctionManager(); FunctionHandle functionHandle = functionManager.lookupFunction(functionName, TypeSignatureProvider.fromTypes(ImmutableList.of(inputType))); Type resolvedType = metadata.getType(getOnlyElement(functionManager.getFunctionMetadata(functionHandle).getArgumentTypes())); verify(resolvedType.equals(inputType), "resolved function input type does not match the input type: %s != %s", resolvedType, inputType); return new ColumnStatisticsAggregation( new AggregationNode.Aggregation( functionHandle, ImmutableList.of(input), Optional.empty(), Optional.empty(), false, Optional.empty()), outputType); }

Target:
private ColumnStatisticsAggregation createAggregation(String functionName, SymbolReference input, Type inputType, Type outputType) { FunctionManager functionManager = metadata.getFunctionManager(); FunctionHandle functionHandle = functionManager.lookupFunction(functionName, TypeSignatureProvider.fromTypes(ImmutableList.of(inputType))); Type resolvedType = metadata.getType(getOnlyElement(functionManager.getFunctionMetadata(functionHandle).getArgumentTypes())); verify(resolvedType.equals(inputType), "resolved function input type does not match the input type: %s != %s", resolvedType, inputType); return new ColumnStatisticsAggregation( new AggregationNode.Aggregation( new CallExpression( functionName, functionHandle, outputType, ImmutableList.of(castToRowExpression(input))), Optional.empty(), Optional.empty(), false, Optional.empty()), outputType); }
Source:
public static ParseTree getRightSibling(ParseTree ctx) { if (ctx == null || ctx.getParent() == null) { return null; } ParseTree parent = ctx.getParent(); for (int i = 0; i < parent.getChildCount(); i++) { if (parent.getChild(i) == ctx) { if (i >= parent.getChildCount() - 1) { return null; } else { return parent.getChild(i + 1); } } } return null; }

Target:
public static ParseTree getRightSibling(ParseTree ctx) { int index = ParseTreeUtil.getNodeIndex(ctx); ParseTree parent = ctx.getParent(); if (index < 0 || index >= parent.getChildCount() - 1) { return null; } return parent.getChild(index + 1); }
Source:
private static InputStream fakeBody(final Request... dispositions) throws IOException { final StringBuilder builder = new StringBuilder(); for (final Request each : dispositions) { builder.append(String.format("--%s%s", BOUNDARY, CRLF)) .append("Content-Disposition: ") .append( new RqHeaders.Smart( new RqHeaders.Base(each) ).single("Content-Disposition") ).append(CRLF); final String body = new RqPrint(each).printBody(); if (!(CRLF.equals(body) || "".equals(body))) { builder.append(String.format("\r\n%s\r\n", body)); } } builder.append("Content-Transfer-Encoding: utf-8\r\n") .append(String.format("--%s--", BOUNDARY)); return new ByteArrayInputStream( builder.toString().getBytes() ); }

Target:
private static InputStream fakeBody(final Request... dispositions) throws IOException { final StringBuilder builder = new StringBuilder(); for (final Request each : dispositions) { builder.append(String.format("--%s", BOUNDARY)) .append(CRLF) .append("Content-Disposition: ") .append( new RqHeaders.Smart( new RqHeaders.Base(each) ).single("Content-Disposition") ).append(CRLF); final String body = new RqPrint(each).printBody(); if (!(CRLF.equals(body) || "".equals(body))) { builder.append(CRLF).append(body).append(CRLF); } } builder.append("Content-Transfer-Encoding: utf-8").append(CRLF) .append(String.format("--%s--", BOUNDARY)); return new ByteArrayInputStream( builder.toString().getBytes() ); }
Source:
public void testConnectAlreadyConnected() throws Exception { PowerMockito.when(connectionInterface, "isOpen").thenReturn(true); try { xbeeDevice.open(); fail("Device shouldn't have connected"); } catch (InterfaceAlreadyOpenException e) { } catch (XBeeDeviceException e) { fail("This exception shouldn't be thrown now."); } }

Target:
public void testConnectAlreadyConnected() throws Exception { PowerMockito.when(connectionInterface, "isOpen").thenReturn(true); try { xbeeDevice.open(); fail("Device shouldn't have connected"); } catch (Exception e) { assertEquals(InterfaceAlreadyOpenException.class, e.getClass()); } }
Source:
public <T> Future<T> submit(SQLQueueCallable<T> callable){ callable.setDb(db); callable.setInTransaction(false); return queue.submit(callable); }

Target:
public <T> Future<T> submit(SQLQueueCallable<T> callable){ callable.setDb(db); callable.setRunInTransaction(false); return queue.submit(callable); }
Source:
public void testFailureCauseDisplayData() throws Exception { Assume.assumeThat(Functions.isWindows(), not(true)); FailureCauseDisplayData failureCauseDisplayData = getDisplayData(executeBuild()); assertNotNull(failureCauseDisplayData.getDownstreamFailureCauses()); assertNotNull(failureCauseDisplayData.getFoundFailureCauses()); FailureCauseDisplayData.Links links = failureCauseDisplayData.getLinks(); assertNotNull(links); assertEquals("WEST,SOUTH", links.getProjectDisplayName()); assertNotNull(links.getProjectUrl()); assertEquals("#1", links.getBuildDisplayName()); assertNotNull(links.getBuildUrl()); }

Target:
public void testFailureCauseDisplayData() throws Exception { assumeFalse(Functions.isWindows()); FailureCauseDisplayData failureCauseDisplayData = getDisplayData(executeBuild()); assertNotNull(failureCauseDisplayData.getDownstreamFailureCauses()); assertNotNull(failureCauseDisplayData.getFoundFailureCauses()); FailureCauseDisplayData.Links links = failureCauseDisplayData.getLinks(); assertNotNull(links); assertEquals("WEST,SOUTH", links.getProjectDisplayName()); assertNotNull(links.getProjectUrl()); assertEquals("#1", links.getBuildDisplayName()); assertNotNull(links.getBuildUrl()); }
Source:
public void saveContent(final String pageId, final List<PageContainerForm.ContainerEntry> containerEntries) throws DotDataException { MultiTreeFactory.deleteMultiTreeByParent(pageId); final List<MultiTree> multiTres = new ArrayList<>(); for (final PageContainerForm.ContainerEntry containerEntry : containerEntries) { int i = 0; final List<String> contentIds = containerEntry.getContentIds(); for (final String contentletId : contentIds) { final MultiTree multiTree = new MultiTree().setContainer(containerEntry.getContainerId()) .setContentlet(contentletId) .setRelationType(containerEntry.getContainerUUID()) .setTreeOrder(i++) .setHtmlPage(pageId); multiTres.add(multiTree); } } if (!multiTres.isEmpty()) { multiTreeAPI.saveMultiTrees(pageId, multiTres); } }

Target:
public void saveContent(final String pageId, final List<PageContainerForm.ContainerEntry> containerEntries) throws DotDataException { MultiTreeFactory.deleteMultiTreeByParent(pageId); final List<MultiTree> multiTrees = new ArrayList<>(); for (final PageContainerForm.ContainerEntry containerEntry : containerEntries) { int i = 0; final List<String> contentIds = containerEntry.getContentIds(); for (final String contentletId : contentIds) { final MultiTree multiTree = new MultiTree().setContainer(containerEntry.getContainerId()) .setContentlet(contentletId) .setRelationType(containerEntry.getContainerUUID()) .setTreeOrder(i++) .setHtmlPage(pageId); multiTrees.add(multiTree); } } if (!multiTrees.isEmpty()) { multiTreeAPI.saveMultiTrees(pageId, multiTrees); } }
Source:
public IVersionedApiResource getEndpointFor(String apiVersion, String kind) { IVersionedApiResource apiresource = endpointFor(apiVersion, kind); if(apiresource == null) { throw new OpenShiftException("No endpoint found for kind %s", kind); } return apiresource; }

Target:
public IVersionedApiResource getEndpointFor(String apiVersion, String kind) { init(); IVersionedApiResource apiresource = endpointFor(apiVersion, kind); if(apiresource == null) { throw new OpenShiftException("No endpoint found for %s, version %s", kind, apiVersion); } return apiresource; }
Source:
public final Transaction fence(byte[] tableName) throws TransactionException { long fenceTimestamp; long tableID = Hashing.murmur3_128().newHasher().putBytes(tableName).hash().asLong(); try { fenceTimer.start(); try { fenceTimestamp = tsoClient.getFence(tableID).get(); } finally { fenceTimer.stop(); } AbstractTransaction<? extends CellId> tx = transactionFactory.createTransaction(fenceTimestamp, fenceTimestamp, this); return tx; } catch (ExecutionException e) { throw new TransactionException("Could not get fence", e); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new TransactionException("Interrupted creating a fence", ie); } }

Target:
public final Transaction fence(byte[] tableName) throws TransactionException { long fenceTimestamp; long tableID = getHashForTable(tableName); Hashing.murmur3_128().newHasher().putBytes(tableName).hash().asLong(); try { fenceTimer.start(); try { fenceTimestamp = tsoClient.getFence(tableID).get(); } finally { fenceTimer.stop(); } AbstractTransaction<? extends CellId> tx = transactionFactory.createTransaction(fenceTimestamp, fenceTimestamp, this); return tx; } catch (ExecutionException e) { throw new TransactionException("Could not get fence", e); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new TransactionException("Interrupted creating a fence", ie); } }
Source:
public FileStatus getReferencedFileStatus(final FileSystem fs) throws IOException { if(null == this.localStatus){ throw new IOException("localStatus is not initialize on construct"); } return this.localStatus; }

Target:
public FileStatus getReferencedFileStatus(final FileSystem fs) throws IOException { if(null == this.localStatus) { return loadAndCacheFileStatus(fs); } return this.localStatus; }
Source:
public static void clear() { synchronized (ReportManager.class){ File root = Q7ReportingPlugin.getConfigStateLocation(); if (root.exists()) { FileUtil.deleteFiles(root.listFiles()); } } if (builder != null) { builder.unregisterProviders(); } builder = null; }

Target:
public static void clear() { if(hasRun){ synchronized (ReportManager.class){ File root = Q7ReportingPlugin.getConfigStateLocation(); if (root.exists()) { FileUtil.deleteFiles(root.listFiles()); } hasRun = false; } } if (builder != null) { builder.unregisterProviders(); } builder = null; }
Source:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand({},{}) is called!", itemName, command); if(harmonyHubGateway == null){ logger.warn("A command was receieved, but could not be executed as no Harmony Hub has been configured"); return; } for (HarmonyHubBindingProvider provider : providers) { HarmonyHubBindingConfig config = provider.getHarmonyHubBindingConfig(itemName); if(config.getBindingType().getDirection() == HarmonyHubBindingDirection.IN){ logger.warn("item is not configured to send outbound commands! Please change to > or * in the binding"); continue; } switch(config.getBindingType()) { case PressButton: logger.debug("PressButton command:{} q:{} p1:{} p2:{}", command.toString(), config.getQualifier(), config.getParam1(), config.getParam2()); String cmd = config.getParam2(); if(cmd == null){ cmd = command.toString(); } try { harmonyHubGateway.pressButton(config.getQualifier(), Integer.parseInt(config.getParam1()), cmd); } catch (NumberFormatException ignored) { harmonyHubGateway.pressButton(config.getQualifier(), config.getParam1(), cmd); } break; case StartActivity: try { harmonyHubGateway.startActivity(config.getQualifier(), Integer.parseInt(config.getParam1())); } catch (NumberFormatException ignored) { harmonyHubGateway.startActivity(config.getQualifier(), config.getParam1()); } break; case CurrentActivity: harmonyHubGateway.startActivity(config.getQualifier(),command.toString()); break; default : break; } } }

Target:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand({},{}) is called!", itemName, command); if(harmonyHubGateway == null){ logger.warn("A command was received, but could not be executed as no Harmony Hub has been configured"); return; } for (HarmonyHubBindingProvider provider : providers) { HarmonyHubBindingConfig config = provider.getHarmonyHubBindingConfig(itemName); if(config.getBindingType().getDirection() == HarmonyHubBindingDirection.IN){ logger.warn("item is not configured to send outbound commands! Please change to > or * in the binding"); continue; } switch(config.getBindingType()) { case PressButton: logger.debug("PressButton command:{} q:{} p1:{} p2:{}", command.toString(), config.getQualifier(), config.getParam1(), config.getParam2()); String cmd = config.getParam2(); if(cmd == null){ cmd = command.toString(); } try { harmonyHubGateway.pressButton(config.getQualifier(), Integer.parseInt(config.getParam1()), cmd); } catch (NumberFormatException ignored) { harmonyHubGateway.pressButton(config.getQualifier(), config.getParam1(), cmd); } break; case StartActivity: try { harmonyHubGateway.startActivity(config.getQualifier(), Integer.parseInt(config.getParam1())); } catch (NumberFormatException ignored) { harmonyHubGateway.startActivity(config.getQualifier(), config.getParam1()); } break; case CurrentActivity: harmonyHubGateway.startActivity(config.getQualifier(),command.toString()); break; default : break; } } }
Source:
private MwPageService.MwPageEndpoints createMwService(Site site) { MwPageService.MwPageEndpoints webService; webService = RestAdapterFactory.newInstance(site) .create(MwPageService.MwPageEndpoints.class); return webService; }

Target:
private MwPageService.MwPageEndpoints createMwService(Site site) { MwPageService.MwPageEndpoints webService = RestAdapterFactory.newInstance(site) .create(MwPageService.MwPageEndpoints.class); return webService; }
Source:
public Attribute getAttributeValue(PerunSessionImpl sess, Resource resource, AttributeDefinition attributeDefinition) throws InternalErrorException { Attribute attribute = new Attribute(attributeDefinition); Set<String> allUniqueGroupNames = new HashSet<>(); Vo vo = sess.getPerunBl().getResourcesManagerBl().getVo(sess, resource); List<Group> assignedGroups = sess.getPerunBl().getResourcesManagerBl().getAssignedGroups(sess, resource); boolean isAssignedWithSubgroups; try { Attribute isAssignedWithSubgroupsAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, A_R_isAssignedWithSubgroups); if(isAssignedWithSubgroupsAttribute.getValue() == null) { isAssignedWithSubgroups = false; } else { isAssignedWithSubgroups = isAssignedWithSubgroupsAttribute.valueAsBoolean(); } } catch (AttributeNotExistsException ex) { log.debug("There is missing definition of attribute {}", A_R_isAssignedWithSubgroups); isAssignedWithSubgroups = false; } catch (WrongAttributeAssignmentException ex) { throw new InternalErrorException(ex); } for(Group assignedGroup: assignedGroups) { allUniqueGroupNames.add(computeGroupName(vo, assignedGroup)); if(isAssignedWithSubgroups) { for(Group subgroup: sess.getPerunBl().getGroupsManagerBl().getAllSubGroups(sess, assignedGroup)) { allUniqueGroupNames.add(computeGroupName(vo, subgroup)); } } } attribute.setValue(new ArrayList(allUniqueGroupNames)); return attribute; }

Target:
public Attribute getAttributeValue(PerunSessionImpl sess, Resource resource, AttributeDefinition attributeDefinition) throws InternalErrorException { Attribute attribute = new Attribute(attributeDefinition); Set<String> allUniqueGroupNames = new HashSet<>(); Vo vo = sess.getPerunBl().getResourcesManagerBl().getVo(sess, resource); List<Group> assignedGroups = sess.getPerunBl().getResourcesManagerBl().getAssignedGroups(sess, resource); boolean isAssignedWithSubgroups; try { Attribute isAssignedWithSubgroupsAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, A_R_isAssignedWithSubgroups); if(isAssignedWithSubgroupsAttribute.getValue() == null) { isAssignedWithSubgroups = false; } else { isAssignedWithSubgroups = isAssignedWithSubgroupsAttribute.valueAsBoolean(); } } catch (AttributeNotExistsException ex) { log.debug("There is missing definition of attribute {}", A_R_isAssignedWithSubgroups); isAssignedWithSubgroups = false; } catch (WrongAttributeAssignmentException ex) { throw new InternalErrorException(ex); } for(Group assignedGroup: assignedGroups) { allUniqueGroupNames.add(computeGroupName(vo, assignedGroup)); if(isAssignedWithSubgroups) { for(Group subgroup: sess.getPerunBl().getGroupsManagerBl().getAllSubGroups(sess, assignedGroup)) { allUniqueGroupNames.add(computeGroupName(vo, subgroup)); } } } List<String> allGroupNames = new ArrayList<>(allUniqueGroupNames); Collections.sort(allGroupNames); attribute.setValue(allGroupNames); return attribute; }
Source:
public int compare(StreamInputReader a, StreamInputReader b) { EventDefinition event_a = a.getCurrentEvent(); EventDefinition event_b = b.getCurrentEvent(); if (event_a == null || event_b == null) { throw new IllegalArgumentException(); } long ta = event_a.getTimestamp(); long tb = event_b.getTimestamp(); return Utils.unsignedCompare(ta, tb); }

Target:
public int compare(StreamInputReader a, StreamInputReader b) { EventDefinition event_a = a.getCurrentEvent(); EventDefinition event_b = b.getCurrentEvent(); long ta = event_a.getTimestamp(); long tb = event_b.getTimestamp(); return Utils.unsignedCompare(ta, tb); }
Source:
public void draw(GLAutoDrawable drawable, boolean idle, Point3d machineCoord, Point3d workCoord, Point3d focusMin, Point3d focusMax, double scaleFactor, Point3d mouseCoordinates, Point3d rotation) { if (!isDrawable) return; GL2 gl = drawable.getGL().getGL2(); boolean forceOldStyle = false; if(!forceOldStyle && gl.isFunctionAvailable( "glGenBuffers" ) && gl.isFunctionAvailable( "glBindBuffer" ) && gl.isFunctionAvailable( "glBufferData" ) && gl.isFunctionAvailable( "glDeleteBuffers" ) ) { if (this.vertexBufferDirty) { updateVertexBuffers(); this.vertexBufferDirty = false; } if (this.colorArrayDirty) { this.updateGLColorArray(drawable); this.colorArrayDirty = false; } if (this.vertexArrayDirty) { this.updateGLGeometryArray(drawable); this.vertexArrayDirty = false; } gl.glLineWidth(1.0f); gl.glEnableClientState(GL_VERTEX_ARRAY); gl.glEnableClientState(GL_COLOR_ARRAY); gl.glDrawArrays( GL.GL_LINES, 0, numberOfVertices); gl.glDisableClientState(GL_COLOR_ARRAY); gl.glDisableClientState(GL_VERTEX_ARRAY); } else { gl.glBegin(GL_LINES); gl.glLineWidth(1.0f); int verts = 0; int colors = 0; for(LineSegment ls : gcodeLineList) { gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); } gl.glEnd(); } }

Target:
public void draw(GLAutoDrawable drawable, boolean idle, Point3d machineCoord, Point3d workCoord, Point3d focusMin, Point3d focusMax, double scaleFactor, Point3d mouseCoordinates, Point3d rotation) { if (!isDrawable) return; GL2 gl = drawable.getGL().getGL2(); boolean forceOldStyle = false; if(!forceOldStyle && gl.isFunctionAvailable( "glGenBuffers" ) && gl.isFunctionAvailable( "glBindBuffer" ) && gl.isFunctionAvailable( "glBufferData" ) && gl.isFunctionAvailable( "glDeleteBuffers" ) ) { if (this.vertexBufferDirty && !vertexArrayDirty && !colorArrayDirty) { updateVertexBuffers(); this.vertexBufferDirty = false; } if (this.colorArrayDirty) { this.updateGLColorArray(drawable); this.colorArrayDirty = false; } if (this.vertexArrayDirty) { this.updateGLGeometryArray(drawable); this.vertexArrayDirty = false; } gl.glLineWidth(1.0f); gl.glEnableClientState(GL_VERTEX_ARRAY); gl.glEnableClientState(GL_COLOR_ARRAY); gl.glDrawArrays( GL.GL_LINES, 0, numberOfVertices); gl.glDisableClientState(GL_COLOR_ARRAY); gl.glDisableClientState(GL_VERTEX_ARRAY); } else { gl.glBegin(GL_LINES); gl.glLineWidth(1.0f); int verts = 0; int colors = 0; for(LineSegment ls : gcodeLineList) { gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); } gl.glEnd(); } }
Source:
public DefaultIterationManager(TimeService timeService) { Caffeine<Object, Object> builder = Caffeine.newBuilder(); builder.expireAfterAccess(1, TimeUnit.MINUTES).removalListener(new RemovalListener<Object, Object>() { @Override public void onRemoval(Object key, Object value, RemovalCause cause) { ((IterationState)value).close(); } }).ticker(new TimeServiceTicker(timeService)).executor(new WithinThreadExecutor()); iterationStateMap = builder.build(); }

Target:
public DefaultIterationManager(TimeService timeService) { Caffeine<Object, Object> builder = Caffeine.newBuilder(); builder.expireAfterAccess(5, TimeUnit.MINUTES).removalListener(new RemovalListener<Object, Object>() { @Override public void onRemoval(Object key, Object value, RemovalCause cause) { ((IterationState)value).close(); log.removedUnclosedIterator(key.toString()); } }).ticker(new TimeServiceTicker(timeService)).executor(new WithinThreadExecutor()); iterationStateMap = builder.build(); }
Source:
public static void rebootWipeUserData(Context context, boolean shutdown, String reason, boolean force, boolean wipeEuicc) throws IOException { UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); if (!force && um.hasUserRestriction(UserManager.DISALLOW_FACTORY_RESET)) { throw new SecurityException("Wiping data is not allowed for this user."); } final ConditionVariable condition = new ConditionVariable(); Intent intent = new Intent("android.intent.action.MASTER_CLEAR_NOTIFICATION"); intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); context.sendOrderedBroadcastAsUser(intent, UserHandle.SYSTEM, android.Manifest.permission.MASTER_CLEAR, new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { condition.open(); } }, null, 0, null, null); condition.block(); if (wipeEuicc) { wipeEuiccData(context, PACKAGE_NAME_WIPING_EUICC_DATA_CALLBACK); } String shutdownArg = null; if (shutdown) { shutdownArg = "--shutdown_after"; } String reasonArg = null; if (!TextUtils.isEmpty(reason)) { Calendar calendar = Calendar.getInstance(); String timeStamp = DateFormat.format("yyyy-MM-dd HH:mm:ssZ", calendar).toString(); reasonArg = "--reason=" + sanitizeArg(reason + "," + timeStamp); } final String localeArg = "--locale=" + Locale.getDefault().toLanguageTag() ; bootCommand(context, shutdownArg, "--wipe_data", reasonArg, localeArg); }

Target:
public static void rebootWipeUserData(Context context, boolean shutdown, String reason, boolean force, boolean wipeEuicc) throws IOException { UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); if (!force && um.hasUserRestriction(UserManager.DISALLOW_FACTORY_RESET)) { throw new SecurityException("Wiping data is not allowed for this user."); } final ConditionVariable condition = new ConditionVariable(); Intent intent = new Intent("android.intent.action.MASTER_CLEAR_NOTIFICATION"); intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); context.sendOrderedBroadcastAsUser(intent, UserHandle.SYSTEM, android.Manifest.permission.MASTER_CLEAR, new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { condition.open(); } }, null, 0, null, null); condition.block(); if (wipeEuicc) { wipeEuiccData(context, PACKAGE_NAME_WIPING_EUICC_DATA_CALLBACK); } String shutdownArg = null; if (shutdown) { shutdownArg = "--shutdown_after"; } String reasonArg = null; if (!TextUtils.isEmpty(reason)) { String timeStamp = DateFormat.format("yyyy-MM-ddTHH:mm:ssZ", System.currentTimeMillis()).toString(); reasonArg = "--reason=" + sanitizeArg(reason + "," + timeStamp); } final String localeArg = "--locale=" + Locale.getDefault().toLanguageTag() ; bootCommand(context, shutdownArg, "--wipe_data", reasonArg, localeArg); }
Source:
protected void validateDomain(Set<ArtifactCoordinates> domains) throws ValidationException { checkArgument(domains != null, "Set of domains should not be null"); if (!domains.stream() .allMatch(artifactCoordinates -> StringUtils.equals(artifactCoordinates.getClassifier(), MULE_DOMAIN.toString()))) { String message = "Not all dependencies are mule domains"; throw new ValidationException(message); } if (domains.size() != DOMAIN_BUNDLE_VALID_NUMBER_OF_DOMAINS) { String message = "A mule domain bundle must contain exactly one mule domain. "; if (domains.size() == 0) { message += "However, the project has no reference to domains in its dependencies."; } else { message += "However, the project has reference to the following domains: " + domains.stream().collect(Collectors.toList()); } throw new ValidationException(message); } }

Target:
protected void validateDomain(Set<ArtifactCoordinates> domains) throws ValidationException { checkArgument(domains != null, "Set of domains should not be null"); if (!domains.stream() .allMatch(artifactCoordinates -> StringUtils.equals(artifactCoordinates.getClassifier(), MULE_DOMAIN.toString()))) { String message = "Not all dependencies are mule domains"; throw new ValidationException(message); } if (domains.size() != DOMAIN_BUNDLE_VALID_NUMBER_OF_DOMAINS) { String message = "A mule domain bundle must contain exactly one mule domain. "; if (domains.isEmpty()) { message += "However, the project has no reference to domains in its dependencies."; } else { message += "However, the project has reference to the following domains: " + domains.stream().collect(Collectors.toList()); } throw new ValidationException(message); } }
Source:
public RMStateDTO cloneAndFilter(long filter) { long actualFilter = computeActualFilter(filter); final List<RMEvent> responseEvents = events.getSortedItems() .tailSet(new RMEvent(actualFilter + 1)) .stream() .limit(PAResourceManagerProperties.RM_REST_MONITORING_MAXIMUM_CHUNK_SIZE.getValueAsInt()) .collect(Collectors.toList()); RMStateDTO response = new RMStateDTO(); response.setNodeSource(getNodeSource(responseEvents)); response.setNodesEvents(getNodesEvents(responseEvents)); response.setLatestCounter(Math.max(actualFilter, findLargestCounter(responseEvents))); return response; }

Target:
public RMStateDelta cloneAndFilter(long filter) { long actualFilter = computeActualFilter(filter); final List<RMEvent> responseEvents = events.getSortedItems() .tailSet(new RMEvent(actualFilter + 1)) .stream() .limit(PAResourceManagerProperties.RM_REST_MONITORING_MAXIMUM_CHUNK_SIZE.getValueAsInt()) .collect(Collectors.toList()); RMStateDelta response = new RMStateDelta(); response.setNodeSource(getNodeSourceEvents(responseEvents)); response.setNodesEvents(getNodeEvents(responseEvents)); response.setLatestCounter(Math.max(actualFilter, findLargestCounter(responseEvents))); return response; }
Source:
private OverlayKey findOverlayKey(String key) { for (OverlayKey fOverlayKey : fOverlayKeys) { if (fOverlayKey.fKey.equals(key)) return fOverlayKey; } return null; }

Target:
private OverlayKey findOverlayKey(String key) { for (OverlayKey overlayKey : fOverlayKeys) { if (overlayKey.fKey.equals(key)) return overlayKey; } return null; }
Source:
protected Control createPageControls(final Composite parent) { setTitle(Messages.CherryPickDialog_Cherry_Pick); setMessage(NLS.bind(Messages.CherryPickDialog_Change_X_Set_Y, task.getTaskId(), patchSet.getPatchSetId())); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); Label branchlabel = new Label(composite, SWT.NONE); branchlabel.setText(NLS.bind(Messages.CherryPickDialog_Cherry_Pick_to_Branch, patchSet.getRefName())); destination = new Text(composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER); GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).applyTo(destination); Label commitLabel = new Label(composite, SWT.NONE); commitLabel.setText(NLS.bind(Messages.CherryPickDialog_Cherry_Pick_Commit_Message, patchSet.getRefName())); commitMessage = createRichTextEditor(composite, ""); GridDataFactory.fillDefaults().grab(true, true).hint(400, 100).applyTo(commitMessage.getControl()); commitMessage.setText(NLS.bind(Messages.CherryPickDialog_Cherry_Pick_Commit_Message_Template, getCleanTitle(), getChangeId())); destination.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { dialogUpdated(); } }); commitMessage.getViewer().addTextListener(new ITextListener() { @Override public void textChanged(TextEvent event) { dialogUpdated(); } }); destination.setFocus(); return composite; }

Target:
protected Control createPageControls(final Composite parent) { setTitle(Messages.CherryPickDialog_Cherry_Pick); setMessage(NLS.bind(Messages.CherryPickDialog_Change_X_Set_Y, task.getTaskId(), patchSet.getPatchSetId())); Composite composite = new Composite(parent, SWT.NONE); GridLayoutFactory.swtDefaults().applyTo(composite); Label branchlabel = new Label(composite, SWT.NONE); branchlabel.setText(NLS.bind(Messages.CherryPickDialog_Cherry_Pick_to_Branch, patchSet.getRefName())); destination = new Text(composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER); GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).applyTo(destination); Label commitLabel = new Label(composite, SWT.NONE); commitLabel.setText(NLS.bind(Messages.CherryPickDialog_Cherry_Pick_Commit_Message, patchSet.getRefName())); commitMessage = createRichTextEditor(composite, ""); GridDataFactory.fillDefaults().grab(true, true).hint(400, 100).applyTo(commitMessage.getControl()); commitMessage.setText(change.getPatchSetDetails().get(0).getInfo().getMessage()); destination.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { dialogUpdated(); } }); commitMessage.getViewer().addTextListener(new ITextListener() { @Override public void textChanged(TextEvent event) { dialogUpdated(); } }); destination.setFocus(); return composite; }
Source:
protected void refreshDisplayLabels() { IAxis xAxis = getChart().getAxisSet().getXAxis(0); if (!xAxis.getTick().isVisible()) { return; } Rectangle rect = getChart().getClientArea(); int lengthLimit = (int) (rect.height * 0.40); GC gc = new GC(getParent()); gc.setFont(xAxis.getTick().getFont()); if (fXStringMap.size() > 0) { String longestString = fXStringMap.keySet().stream() .max(Comparator.comparingInt(String::length)) .orElse(fXStringMap.keySet().iterator().next()); Point pixels = gc.stringExtent(longestString); int cutLen = 5; if (pixels.x > lengthLimit) { for (Entry<String, Integer> entry : fXStringMap.entrySet()) { String reference = checkNotNull(entry.getKey()); if (reference.length() > cutLen) { String key = reference.substring(0, cutLen) + ELLIPSIS; fVisibleXMap.remove(reference); fVisibleXMap.put(key, entry.getValue()); } else { fVisibleXMap.inverse().remove(entry.getValue()); fVisibleXMap.put(reference, entry.getValue()); } } } else { resetBiMap(fXStringMap, fVisibleXMap); } for (IAxis axis : getChart().getAxisSet().getXAxes()) { IAxisTick tick = axis.getTick(); tick.setFormat(new LabelFormat(fVisibleXMap)); } } gc.dispose(); }

Target:
protected void refreshDisplayLabels() { Chart chart = getChart(); IAxisSet axisSet = chart.getAxisSet(); IAxis xAxis = axisSet.getXAxis(0); if (!xAxis.getTick().isVisible()) { return; } Rectangle rect = chart.getClientArea(); int lengthLimit = (int) (rect.height * 0.40); GC gc = new GC(getParent()); gc.setFont(xAxis.getTick().getFont()); if (fXStringMap.size() > 0) { String longestString = fXStringMap.keySet().stream() .max(Comparator.comparingInt(String::length)) .orElse(fXStringMap.keySet().iterator().next()); Point pixels = gc.stringExtent(longestString); int cutLen = 5; if (pixels.x > lengthLimit) { for (Entry<String, Integer> entry : fXStringMap.entrySet()) { String reference = checkNotNull(entry.getKey()); if (reference.length() > cutLen) { String key = reference.substring(0, cutLen) + ELLIPSIS; fVisibleXMap.remove(reference); fVisibleXMap.put(key, entry.getValue()); } else { fVisibleXMap.inverse().remove(entry.getValue()); fVisibleXMap.put(reference, entry.getValue()); } } } else { resetBiMap(fXStringMap, fVisibleXMap); } for (IAxis axis : axisSet.getXAxes()) { IAxisTick tick = axis.getTick(); tick.setFormat(new LabelFormat(fVisibleXMap)); } } gc.dispose(); }
Source:
private static boolean monoNativeFailure(Either<Utils.CommandResult> result) { if (result == null || !result.isSuccess()) { return true; } else { Utils.CommandResult commandResult = result.get(); return monoNativeFailure(commandResult.output) || monoNativeFailure(commandResult.error); } }

Target:
static boolean monoNativeFailure(Either<Utils.CommandResult> result) { if (result == null || !result.isSuccess()) { return true; } else { Utils.CommandResult commandResult = result.get(); return monoNativeFailure(commandResult.output) || monoNativeFailure(commandResult.error); } }
Source:
protected boolean validateStorageDomains() { final List<DiskImage> disksList = getSourceImages(); MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator(getStoragePoolId(), getStorageDomainsIds()); return validate(storageDomainsValidator.allDomainsExistAndActive()) && validate(storageDomainsValidator.allDomainsWithinThresholds()) && validate(storageDomainsValidator.allDomainsHaveSpaceForMerge(getSnapshotsForFreeSpaceValidation(disksList))); }

Target:
protected boolean validateStorageDomains() { MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator(getStoragePoolId(), getStorageDomainsIds()); return validate(storageDomainsValidator.allDomainsExistAndActive()) && validate(storageDomainsValidator.allDomainsWithinThresholds()) && validate(storageDomainsValidator.allDomainsHaveSpaceForMerge(getAllDisksSnapshot(getSourceImages()))); }
Source:
public CachedSchemaRegistryClientBuilder endpoint(String schemaRegistryUrl) { Objects.requireNonNull(schemaRegistryUrl, "'endpoint' cannot be null."); try { new URL(schemaRegistryUrl); } catch (MalformedURLException ex) { throw logger.logExceptionAsWarning(new IllegalArgumentException("'endpoint' must be a valid URL.", ex)); } if (schemaRegistryUrl.endsWith("/")) { this.schemaRegistryUrl = schemaRegistryUrl.substring(0, schemaRegistryUrl.length() - 1); } else { this.schemaRegistryUrl = schemaRegistryUrl; } return this; }

Target:
public CachedSchemaRegistryClientBuilder endpoint(String schemaRegistryUrl) { Objects.requireNonNull(schemaRegistryUrl, "'schemaRegistryUrl' cannot be null."); try { new URL(schemaRegistryUrl); } catch (MalformedURLException ex) { throw logger.logExceptionAsWarning( new IllegalArgumentException("'schemaRegistryUrl' must be a valid URL.", ex)); } if (schemaRegistryUrl.endsWith("/")) { this.schemaRegistryUrl = schemaRegistryUrl.substring(0, schemaRegistryUrl.length() - 1); } else { this.schemaRegistryUrl = schemaRegistryUrl; } return this; }
Source:
public Map<String, String> getWorkflowVariablesFromPathSegment(PathSegment pathSegment) { Map<String, String> variables = null; MultivaluedMap<String, String> matrixParams = pathSegment.getMatrixParameters(); matrixParams.remove(""); if (matrixParams != null && !matrixParams.isEmpty()) { variables = Maps.newHashMap(); for (String key : matrixParams.keySet()) { String value = matrixParams.getFirst(key) == null ? "" : matrixParams.getFirst(key); variables.put(key, value); } } return variables; }

Target:
public Map<String, String> getWorkflowVariablesFromPathSegment(PathSegment pathSegment) { Map<String, String> variables = null; MultivaluedMap<String, String> matrixParams = pathSegment.getMatrixParameters(); if (matrixParams != null && !matrixParams.isEmpty()) { matrixParams.remove(""); variables = Maps.newHashMap(); for (String key : matrixParams.keySet()) { String value = matrixParams.getFirst(key) == null ? "" : matrixParams.getFirst(key); variables.put(key, value); } } return variables; }
Source:
private static View findBestView(Activity activity) { if (activity instanceof PageActivity) { return activity.findViewById(R.id.page_contents_container); } else { return activity.findViewById(android.R.id.content); } }

Target:
private static View findBestView(Activity activity) { if (activity instanceof PageActivity && ((PageActivity) activity).getCurPageFragment() != null) { return activity.findViewById(R.id.page_contents_container); } else { return activity.findViewById(android.R.id.content); } }
Source:
protected Mono<Void> handleMessageInternal(Message<?> message) { Assert.isTrue(this.initialized, "This class is not yet initialized. Invoke its afterPropertiesSet() method"); String collectionName = this.collectionNameExpression.getValue(this.evaluationContext, message, String.class); Assert.notNull(collectionName, "'collectionNameExpression' must not evaluate to null"); Object payload = message.getPayload(); return this.mongoTemplate.save(payload, collectionName).then(); }

Target:
protected Mono<Void> handleMessageInternal(Message<?> message) { Assert.isTrue(this.initialized, "This class is not yet initialized. Invoke its afterPropertiesSet() method"); return evaluateCollectionNameExpression(message) .flatMap(collection -> this.mongoTemplate.save(message.getPayload(), collection)) .then(); }
Source:
public static List<DataType> typeView(List<? extends Symbol> symbols) { return Lists2.map(symbols, Symbol::valueType); }

Target:
public static List<DataType> typeView(List<? extends Symbol> symbols) { return LazyMapList.of(symbols, Symbol::valueType); }
Source:
protected String doInBackground(ResponseBody... urls) { saveToDisk(urls[0], "fr.openfoodfacts.org.products.small.zip"); return null; }

Target:
protected String doInBackground(ResponseBody... urls) { saveToDisk(urls[0], url); return null; }
Source:
protected void drawBody(final BaseGridRendererHelper.RenderingInformation renderingInformation) { final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns(); final List<GridColumn<?>> floatingColumns = floatingBlockInformation.getColumns(); final double bodyX = bodyBlockInformation.getX(); final double bodyY = bodyBlockInformation.getBodyY(); final double floatingBodyX = floatingBlockInformation.getX(); final double floatingBodyY = floatingBlockInformation.getBodyY(); final int minVisibleRowIndex = renderingInformation.getMinVisibleRowIndex(); final int maxVisibleRowIndex = renderingInformation.getMaxVisibleRowIndex(); body = new Group(); body.setX(bodyX).setY(bodyY); bodySelections = new Group(); bodySelections.setX(bodyX).setY(bodyY); addCommandsToRenderQueue(body, renderGridBodyWidget(bodyColumns, bodyBlockInformation.getX(), minVisibleRowIndex, maxVisibleRowIndex, bodyTransformer, renderingInformation)); if (floatingColumns.size() > 0) { floatingBody = new Group(); floatingBody.setX(floatingBodyX).setY(floatingBodyY); floatingBodySelections = new Group(); floatingBodySelections.setX(floatingBodyX).setY(floatingBodyY); addCommandsToRenderQueue(floatingBody, renderGridBodyWidget(floatingColumns, floatingBlockInformation.getX(), minVisibleRowIndex, maxVisibleRowIndex, floatingColumnsTransformer, renderingInformation)); } }

Target:
protected void drawBody(final BaseGridRendererHelper.RenderingInformation renderingInformation) { final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation(); final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation(); final double bodyX = bodyBlockInformation.getX(); final double bodyY = bodyBlockInformation.getBodyY(); final double floatingBodyX = floatingBlockInformation.getX(); final double floatingBodyY = floatingBlockInformation.getBodyY(); final int minVisibleRowIndex = renderingInformation.getMinVisibleRowIndex(); final int maxVisibleRowIndex = renderingInformation.getMaxVisibleRowIndex(); if (bodyColumns.size() > 0) { body = new Group(); body.setX(bodyX).setY(bodyY); bodySelections = new Group(); bodySelections.setX(bodyX).setY(bodyY); addCommandsToRenderQueue(body, renderGridBodyWidget(bodyColumns, bodyBlockInformation.getX(), minVisibleRowIndex, maxVisibleRowIndex, bodyTransformer, renderingInformation)); } if (floatingColumns.size() > 0) { floatingBody = new Group(); floatingBody.setX(floatingBodyX).setY(floatingBodyY); floatingBodySelections = new Group(); floatingBodySelections.setX(floatingBodyX).setY(floatingBodyY); addCommandsToRenderQueue(floatingBody, renderGridBodyWidget(floatingColumns, floatingBlockInformation.getX(), minVisibleRowIndex, maxVisibleRowIndex, floatingColumnsTransformer, renderingInformation)); } }
Source:
private Map<Integer, Vector> copyMap(final Map<Integer, Vector> toCopy) { final Map<Integer, Vector> copied = new HashMap<>(toCopy.size()); toCopy.forEach((integer, vectorEntries) -> copied.put(integer, vectorEntries.copy())); return copied; }

Target:
private Map<Integer, Vector> copyMap(final Map<Integer, Vector> toCopy) { final Map<Integer, Vector> copied = new HashMap<>(toCopy.size()); toCopy.forEach((integer, vector) -> copied.put(integer, vector.copy())); return copied; }
Source:
public void addRecipients(ExtendedEmailPublisherContext context, EnvVars env, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc) { ExtendedEmailPublisherDescriptor descriptor = Jenkins.getInstance().getDescriptorByType(ExtendedEmailPublisherDescriptor.class); Set<User> users = new HashSet<User>(); if (context.getRun() instanceof AbstractBuild) { AbstractBuild<?, ?> build = (AbstractBuild) context.getRun(); for (ChangeLogSet.Entry change : build.getChangeSet()) { users.add(change.getAuthor()); } } for (User user : users) { if (!EmailRecipientUtils.isExcludedRecipient(user, context.getListener())) { String userAddress = EmailRecipientUtils.getUserConfiguredEmail(user); if (userAddress != null) { descriptor.debug(context.getListener().getLogger(), "Adding user address %s, they were not considered an excluded committer", userAddress); EmailRecipientUtils.addAddressesFromRecipientList(to, cc, bcc, userAddress, env, context.getListener()); } else { context.getListener().getLogger().println("Failed to send e-mail to " + user.getFullName() + " because no e-mail address is known, and no default e-mail domain is configured"); } } } }

Target:
public void addRecipients(ExtendedEmailPublisherContext context, EnvVars env, Set<InternetAddress> to, Set<InternetAddress> cc, Set<InternetAddress> bcc) { ExtendedEmailPublisherDescriptor descriptor = Jenkins.getActiveInstance().getDescriptorByType(ExtendedEmailPublisherDescriptor.class); Set<User> users = new HashSet<User>(); if (context.getRun() instanceof AbstractBuild) { AbstractBuild<?, ?> build = (AbstractBuild) context.getRun(); for (ChangeLogSet.Entry change : build.getChangeSet()) { users.add(change.getAuthor()); } } for (User user : users) { if (!EmailRecipientUtils.isExcludedRecipient(user, context.getListener())) { String userAddress = EmailRecipientUtils.getUserConfiguredEmail(user); if (userAddress != null) { descriptor.debug(context.getListener().getLogger(), "Adding user address %s, they were not considered an excluded committer", userAddress); EmailRecipientUtils.addAddressesFromRecipientList(to, cc, bcc, userAddress, env, context.getListener()); } else { context.getListener().getLogger().println("Failed to send e-mail to " + user.getFullName() + " because no e-mail address is known, and no default e-mail domain is configured"); } } } }