auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private <T> BinaryContent transformSourceResponse( SourceResponse response, Map<String, Serializable> transformerArguments, String identString, Function<T, List<QueryResponseTransformer>> func, T id) throws CatalogTransformerException { if (response == null) { throw new IllegalArgumentException("SourceResponse is null."); } List<QueryResponseTransformer> transformers = func.apply(id); if (CollectionUtils.isEmpty(transformers)) { throw new IllegalArgumentException( "Transformers mathcing " + identString + " " + id + " not found"); } List<String> stackTraceList = new LinkedList<>(); BinaryContent binaryContent = transformSourceResponse(response, transformerArguments, transformers, stackTraceList::add); if (binaryContent == null) { throw new CatalogTransformerException( String.format( "Could not transform source response: " + identString + "=%s : %s", id, StringUtils.join(stackTraceList, "\n"))); } return binaryContent; }

Target:
private <T> BinaryContent transformSourceResponse( SourceResponse response, Map<String, Serializable> transformerArguments, String identString, Function<T, List<QueryResponseTransformer>> func, T id) throws CatalogTransformerException { if (response == null) { throw new IllegalArgumentException("SourceResponse is null."); } List<QueryResponseTransformer> transformers = func.apply(id); if (CollectionUtils.isEmpty(transformers)) { throw new IllegalArgumentException( "Transformers matching " + identString + " " + id + " not found"); } List<String> stackTraceList = new LinkedList<>(); BinaryContent binaryContent = transformSourceResponse(response, transformerArguments, transformers, stackTraceList::add); if (binaryContent == null) { throw new CatalogTransformerException( String.format( "Could not transform source response: %s=%s : %s", identString, id, StringUtils.join(stackTraceList, "\n"))); } return binaryContent; }
Source:
public Scope getScopeForService(final Integer nodeId, final InetAddress ipAddress, final String serviceName) { if (nodeId == null || ipAddress == null || Strings.isNullOrEmpty(serviceName)) { return EmptyScope.EMPTY; } final Scope metaDataScope = this.transactions.execute((tx) -> { final OnmsMonitoredService monitoredService = this.monitoredServiceDao.get(nodeId, ipAddress, serviceName); if (monitoredService == null) { return EmptyScope.EMPTY; } return new FallbackScope(transform(monitoredService.getMetaData()), new ObjectScope<>(monitoredService) .map("service", "name", (s) -> Optional.of(s.getServiceName())) .map("service", "type", (s) -> Optional.of(s.getServiceType().getName())) ); }); return metaDataScope; }

Target:
public Scope getScopeForService(final Integer nodeId, final InetAddress ipAddress, final String serviceName) { if (nodeId == null || ipAddress == null || Strings.isNullOrEmpty(serviceName)) { return EmptyScope.EMPTY; } final Scope metaDataScope = this.transactions.execute((tx) -> { final OnmsMonitoredService monitoredService = this.monitoredServiceDao.get(nodeId, ipAddress, serviceName); if (monitoredService == null) { return EmptyScope.EMPTY; } return new FallbackScope(transform(monitoredService.getMetaData()), new ObjectScope<>(monitoredService) .map("service", "name", (s) -> Optional.of(s.getServiceName())) ); }); return metaDataScope; }
Source:
public abstract FetchConnection openFetch() throws NotSupportedException, TransportException; public abstract PushConnection openPush() throws NotSupportedException, TransportException; public SubscribeConnection openSubscribe() throws NotSupportedException, TransportException { throw new NotSupportedException("Subscribe not supported"); }

Target:
public abstract FetchConnection openFetch() throws NotSupportedException, TransportException; public abstract PushConnection openPush() throws NotSupportedException, TransportException; public SubscribeConnection openSubscribe() throws NotSupportedException, TransportException { throw new NotSupportedException(JGitText.get().subscribeNotSupported); }
Source:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException { String role = (String)attribute.getValue(); if (role == null) { throw new WrongAttributeValueException(attribute, resource, "Attribute value is null."); } else if ((!role.equals("Manager") || !role.equals("Reporter") || !role.equals("Developer")) { throw new WrongAttributeValueException(attribute, resource, "Attribute value is invalid."); } }

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException { String role = (String)attribute.getValue(); if (role == null) { throw new WrongAttributeValueException(attribute, resource, "Attribute value is null."); } else if (!role.equals("Manager") && !role.equals("Reporter") && !role.equals("Developer")) { throw new WrongAttributeValueException(attribute, resource, "Attribute value is invalid.The role can be either Manager, Reporter or Developer"); } }
Source:
public String toString() { this.format.setTimeZone(TimeZone.getTimeZone("GMT")); return this.format.format(this.expires); }

Target:
public String toString() { final SimpleDateFormat fmt = this.format.get(); fmt.setTimeZone(TimeZone.getTimeZone("GMT")); return fmt.format(this.expires); }
Source:
private String invalidCursorMessage(final CursorError error, final Cursor cursor) { switch (error) { case PARTITION_NOT_FOUND: return "non existing partition " + cursor.getPartition(); case EMPTY_PARTITION: return "partition " + cursor.getPartition() + " is empty"; case UNAVAILABLE: return "offset " + cursor.getOffset() + " for partition " + cursor.getPartition() + " unavailable"; default: return "invalid offset " + cursor.getOffset() + " for partition " + cursor.getPartition(); } }

Target:
private String invalidCursorMessage(final CursorError error, final Cursor cursor) { switch (error) { case PARTITION_NOT_FOUND: return "non existing partition " + cursor.getPartition(); case EMPTY_PARTITION: return "partition " + cursor.getPartition() + " is empty"; case UNAVAILABLE: return "offset " + cursor.getOffset() + " for partition " + cursor.getPartition() + " is unavailable"; default: return "invalid offset " + cursor.getOffset() + " for partition " + cursor.getPartition(); } }
Source:
public StorageQuotaConfig(VerifiableProperties verifiableProperties) { helixPropertyRootPath = verifiableProperties.getString(HELIX_PROPERTY_ROOT_PATH); zkClientConnectAddress = verifiableProperties.getString(ZK_CLIENT_CONNECT_ADDRESS); refresherPollingIntervalMs = verifiableProperties.getIntInRange(REFRESHER_POLLING_INTERVAL_MS, 30 * 60 * 1000, 0, Integer.MAX_VALUE); containerStorageQuotaInJson = verifiableProperties.getString(CONTAINER_STORAGE_QUOTA_IN_JSON, ""); sourcePollingIntervalMs = verifiableProperties.getInt(SOURCE_POLLING_INTERVAL_MS, 30 * 60 * 1000); }

Target:
public StorageQuotaConfig(VerifiableProperties verifiableProperties) { helixPropertyRootPath = verifiableProperties.getString(HELIX_PROPERTY_ROOT_PATH); zkClientConnectAddress = verifiableProperties.getString(ZK_CLIENT_CONNECT_ADDRESS); refresherPollingIntervalMs = verifiableProperties.getIntInRange(REFRESHER_POLLING_INTERVAL_MS, 30 * 60 * 1000, 0, Integer.MAX_VALUE); containerStorageQuotaInJson = verifiableProperties.getString(CONTAINER_STORAGE_QUOTA_IN_JSON, ""); sourcePollingIntervalMs = verifiableProperties.getIntInRange(SOURCE_POLLING_INTERVAL_MS, 30 * 60 * 1000, 0, Integer.MAX_VALUE); }
Source:
public static void showActivityResultError(Activity activity, int requestCode, int actResp, int errorCode, int errorDescription) { if (activity == null) { Log.e("BaseGameUtils", "*** No Activity. Can't show failure dialog!"); return; } Dialog errorDialog = null; switch (actResp) { case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED: errorDialog = makeSimpleDialog(activity, GameHelperUtils_old.getString( activity, GameHelperUtils_old.R_APP_MISCONFIGURED)); break; case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED: errorDialog = makeSimpleDialog(activity, GameHelperUtils_old.getString( activity, GameHelperUtils_old.R_SIGN_IN_FAILED)); break; case GamesActivityResultCodes.RESULT_LICENSE_FAILED: errorDialog = makeSimpleDialog(activity, GameHelperUtils_old.getString( activity, GameHelperUtils_old.R_LICENSE_FAILED)); break; default: errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode, activity, requestCode, null); if (errorDialog == null) { Log.e("GameHelper", "No standard error dialog available. Making fallback dialog."); errorDialog = makeSimpleDialog( activity, activity.getString(errorCode) + " " + activity.getString(errorDescription)); } } errorDialog.show(); }

Target:
public static void showActivityResultError(Activity activity, int requestCode, int actResp, int errorCode, int errorDescription) { if (activity == null) { Log.e("BaseGameUtils", "*** No Activity. Can't show failure dialog!"); return; } Dialog errorDialog; switch (actResp) { case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED: errorDialog = makeSimpleDialog(activity, activity.getString(R.string.gamehelper_app_misconfigured)); break; case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED: errorDialog = makeSimpleDialog(activity, activity.getString(R.string.gamehelper_sign_in_failed)); break; case GamesActivityResultCodes.RESULT_LICENSE_FAILED: errorDialog = makeSimpleDialog(activity, activity.getString(R.string.gamehelper_license_failed)); break; default: errorDialog = GooglePlayServicesUtil.getErrorDialog(errorCode, activity, requestCode, null); if (errorDialog == null) { Log.e("BaseGamesUtils", "No standard error dialog available. Making fallback dialog."); errorDialog = makeSimpleDialog( activity, activity.getString(errorCode) + " " + activity.getString(errorDescription)); } } errorDialog.show(); }
Source:
protected List<EventRecord> dispatchCommand(Message command, CommandContext context) throws InvocationTargetException { checkNotNull(command, "command is null"); checkNotNull(context, "command context is null"); init(); final Class<? extends Message> commandClass = command.getClass(); final Method method = commandHandlers.get(commandClass); if (method == null) { throw missingCommandHandler(commandClass); } final CommandHandlerMethod commandHandler = new CommandHandlerMethod(this, method); final List<? extends Message> events = commandHandler.invoke(command, context); final List<EventRecord> eventRecords = toEventRecords(events, context.getCommandId()); return eventRecords; }

Target:
protected List<EventRecord> dispatchCommand(Message command, CommandContext context) throws InvocationTargetException { checkNotNull(command, "command"); checkNotNull(context, "context"); init(); final Class<? extends Message> commandClass = command.getClass(); final Method method = commandHandlers.get(commandClass); if (method == null) { throw missingCommandHandler(commandClass); } final CommandHandlerMethod commandHandler = new ProcessManagerCommandHandler(this, method); final List<? extends Message> events = commandHandler.invoke(command, context); final List<EventRecord> eventRecords = toEventRecords(events, context.getCommandId()); return eventRecords; }
Source:
public AppiumDriver createInstance(WebDriverConfiguration configuration) { Capabilities capabilities = getCapabilities(configuration); String platform = (String)capabilities.getCapability(MobileCapabilityType.PLATFORM_NAME); if (StringUtils.isBlank(platform)) { throw new IllegalArgumentException("You have to specify " + MobileCapabilityType.PLATFORM_NAME); } platform = platform.toLowerCase(); Class<? extends AppiumDriver> driverClass; if (MobilePlatform.ANDROID.toLowerCase().equals(platform)) driverClass = AndroidDriver.class; else if (MobilePlatform.IOS.toLowerCase().equals(platform)) driverClass = IOSDriver.class; else if (MobilePlatform.WINDOWS.toLowerCase().equals(platform)) driverClass = WindowsDriver.class; else driverClass = AppiumDriver.class; URL remoteAddress = configuration.getRemoteAddress(); try { if (remoteAddress == null) return driverClass.getConstructor(Capabilities.class).newInstance(capabilities); else return driverClass.getConstructor(URL.class, Capabilities.class).newInstance(remoteAddress, capabilities); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public AppiumDriver createInstance(WebDriverConfiguration configuration) { Capabilities capabilities = getCapabilities(configuration); String platform = (String)capabilities.getCapability(MobileCapabilityType.PLATFORM_NAME); if (Validate.empty(platform)) { throw new IllegalArgumentException("You have to specify " + MobileCapabilityType.PLATFORM_NAME); } platform = platform.toLowerCase(); Class<? extends AppiumDriver> driverClass; if (MobilePlatform.ANDROID.toLowerCase().equals(platform)) { driverClass = AndroidDriver.class; } else if (MobilePlatform.IOS.toLowerCase().equals(platform)) { driverClass = IOSDriver.class; } else if (MobilePlatform.WINDOWS.toLowerCase().equals(platform)) { driverClass = WindowsDriver.class; } else { driverClass = AppiumDriver.class; } URL remoteAddress = configuration.getRemoteAddress(); try { if (remoteAddress == null) { return driverClass.getConstructor(Capabilities.class).newInstance(capabilities); } else { return driverClass.getConstructor(URL.class, Capabilities.class).newInstance(remoteAddress, capabilities); } } catch (Exception e) { throw new RuntimeException(e); } }
Source:
private String toDoc(ChangeData cd) throws IOException { XContentBuilder builder = jsonBuilder().startObject(); for (Values<ChangeData> values : schema.buildFields(cd, fillArgs)) { String name = values.getField().getName(); if (values.getField().isRepeatable()) { builder.array(name, values.getValues()); } else { for (Object value : values.getValues()) { if (value.equals("")) { continue; } builder.field(name, value); } } } return builder.endObject().string(); }

Target:
private String toDoc(ChangeData cd) throws IOException { XContentBuilder builder = jsonBuilder().startObject(); for (Values<ChangeData> values : schema.buildFields(cd, fillArgs)) { String name = values.getField().getName(); if (values.getField().isRepeatable()) { builder.array(name, values.getValues()); } else { for (Object value : values.getValues()) { if (value == null || ((String)value).isEmpty()) { continue; } builder.field(name, value); } } } return builder.endObject().string(); }
Source:
public void onNewUser(User user) { boolean createAccount = mActivityHelper.getFlowParams().createAccountIfEmailNotExists; if (createAccount) { RegisterEmailFragment fragment = RegisterEmailFragment.getInstance( mActivityHelper.getFlowParams(), user); FragmentTransaction ft = getSupportFragmentManager().beginTransaction() .replace(R.id.fragment_register_email, fragment, RegisterEmailFragment.TAG); View v = findViewById(R.id.email_layout); if (v != null) ft.addSharedElement(v, "email_field"); ft.disallowAddToBackStack().commit(); } else { finish(ResultCodes.NO_EMAIL_ACCOUNT, IdpResponse.getErrorCodeIntent(ErrorCodes.UNKNOWN_ERROR)); } }

Target:
public void onNewUser(User user) { boolean createAccount = mActivityHelper.getFlowParams().allowNewEmailAccounts; TextInputLayout mEmailLayout = (TextInputLayout) findViewById(R.id.email_layout); if (createAccount) { RegisterEmailFragment fragment = RegisterEmailFragment.getInstance( mActivityHelper.getFlowParams(), user); FragmentTransaction ft = getSupportFragmentManager().beginTransaction() .replace(R.id.fragment_register_email, fragment, RegisterEmailFragment.TAG); if (mEmailLayout != null) ft.addSharedElement(mEmailLayout, "email_field"); ft.disallowAddToBackStack().commit(); } else { mEmailLayout.setError(getString(R.string.error_email_does_not_exist)); } }
Source:
protected FixedBlock getOrCreateCurrentBlock() { FixedBlock block = blocks.get(currentBlockIndex); if (block == null) { block = new FixedBlock(blockCapacity); blocks.put(currentBlockIndex, block); if (blocks.size() % 50 == 0) { logger.info("blocks: {}, size of each block: {}", blocks.size(), blockCapacity); } } return block; }

Target:
protected FixedBlock getOrCreateCurrentBlock() { FixedBlock block = blocks.get(currentBlockIndex); if (block == null) { block = new FixedBlock(blockCapacity); blocks.put(currentBlockIndex, block); if (blocks.size() % 50 == 0) { logger.info("Assigned blocks: {}, size of each block: {}", blocks.size(), blockCapacity); } } return block; }
Source:
public void extendTicket(Guid ticketUUID, long timeout) { BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest( "PATCH", TICKETS_URI + ticketUUID, HttpVersion.HTTP_1_1); Map<String, Object> timeoutDict = new HashMap<>(); timeoutDict.put("timeout", timeout); StringEntity entity = new StringEntity(new Gson().toJson(timeoutDict), StandardCharsets.UTF_8); request.setEntity(entity); request.setHeader("content-length", String.valueOf(entity.getContentLength())); DefaultBHttpClientConnection conn = getConnection(); HttpEntity response = executeRequest(request, conn); finalize(response, conn); }

Target:
public void extendTicket(Guid ticketUUID, long timeout) { BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest( "PATCH", TICKETS_URI + ticketUUID, HttpVersion.HTTP_1_1); try (DefaultBHttpClientConnection conn = getConnection()) { Map<String, Object> timeoutDict = new HashMap<>(); timeoutDict.put("timeout", timeout); StringEntity entity = new StringEntity( new ObjectMapper().writeValueAsString(timeoutDict), StandardCharsets.UTF_8); request.setEntity(entity); request.setHeader("content-length", String.valueOf(entity.getContentLength())); consumeResponse(executeRequest(request, conn)); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e); } }
Source:
public int getCodeReviewScore() { String reviewScore = review.getAttribute(Messages.TaskEditorReviewsPart_CodeReviewAttribute); if (reviewScore.equals("")) { return 0; } else { return Integer.parseInt(reviewScore); } }

Target:
public int getCodeReviewScore() { String reviewScore = review.getAttribute(Messages.TaskEditorReviewsPart_CodeReviewAttribute); try { return Integer.parseInt(reviewScore); } catch (NumberFormatException e) { return 0; } }
Source:
public boolean isHostExists(List<GlusterServerInfo> glusterServers, VDS server) { if (GlusterFeatureSupported.glusterHostUuidSupported(server.getVdsGroupCompatibilityVersion())) { GlusterServer glusterServer = DbFacade.getInstance().getGlusterServerDao().getByServerId(server.getId()); if (glusterServer != null) { for (GlusterServerInfo glusterServerInfo : glusterServers) { if (glusterServerInfo.getUuid().equals(glusterServer.getGlusterServerUuid())) { return true; } } } } else { for (GlusterServerInfo glusterServer : glusterServers) { if (glusterServer.getHostnameOrIp().equals(server.getHostName())) { return true; } try { String glusterHostAddr = InetAddress.getByName(glusterServer.getHostnameOrIp()).getHostAddress(); for (VdsNetworkInterface vdsNwInterface : getVdsInterfaces(server.getId())) { if (glusterHostAddr.equals(vdsNwInterface.getAddress())) { return true; } } } catch (UnknownHostException e) { log.errorFormat("Could not resole IP address of the host {0}. Error: {1}", glusterServer.getHostnameOrIp(), e.getMessage()); } } } return false; }

Target:
public boolean isHostExists(List<GlusterServerInfo> glusterServers, VDS server) { if (GlusterFeatureSupported.glusterHostUuidSupported(server.getVdsGroupCompatibilityVersion())) { GlusterServer glusterServer = DbFacade.getInstance().getGlusterServerDao().getByServerId(server.getId()); if (glusterServer != null) { for (GlusterServerInfo glusterServerInfo : glusterServers) { if (glusterServerInfo.getUuid().equals(glusterServer.getGlusterServerUuid())) { return true; } } } } else { for (GlusterServerInfo glusterServer : glusterServers) { if (glusterServer.getHostnameOrIp().equals(server.getHostName())) { return true; } try { String glusterHostAddr = InetAddress.getByName(glusterServer.getHostnameOrIp()).getHostAddress(); for (VdsNetworkInterface vdsNwInterface : getVdsInterfaces(server.getId())) { if (glusterHostAddr.equals(vdsNwInterface.getAddress())) { return true; } } } catch (UnknownHostException e) { log.errorFormat("Could not resolve IP address of the host {0}. Error: {1}", glusterServer.getHostnameOrIp(), e.getMessage()); } } } return false; }
Source:
private @Nullable Product parseLineProductFromMode(final String modeId) { final String modeType = modeId.replace("physical_mode:", ""); final PhysicalMode physicalMode = PhysicalMode.valueOf(modeType.toUpperCase()); switch (physicalMode) { case BUS: case NA: return Product.SUBWAY; case BUSRAPIDTRANSIT: case COACH: case SHUTTLE: return Product.BUS; case RAPIDTRANSIT: case TRAIN: case LOCALTRAIN: case LONGDISTANCETRAIN: case VAL: return Product.SUBURBAN_TRAIN; case TRAMWAY: case TRAM: return Product.TRAM; case METRO: return Product.SUBWAY; case FERRY: return Product.FERRY; case FUNICULAR: return Product.CABLECAR; case TAXI: return Product.ON_DEMAND; case OTHER: return null; default: throw new IllegalArgumentException("Unhandled physical mode: " + modeId); } }

Target:
private @Nullable Product parseLineProductFromMode(final String modeId) { final String modeType = modeId.replace("physical_mode:", ""); final PhysicalMode physicalMode = PhysicalMode.valueOf(modeType.toUpperCase()); switch (physicalMode) { case BUS: case BUSRAPIDTRANSIT: case COACH: case SHUTTLE: return Product.BUS; case RAPIDTRANSIT: case TRAIN: case LOCALTRAIN: case LONGDISTANCETRAIN: case VAL: return Product.SUBURBAN_TRAIN; case TRAMWAY: case TRAM: return Product.TRAM; case METRO: return Product.SUBWAY; case FERRY: return Product.FERRY; case FUNICULAR: return Product.CABLECAR; case TAXI: return Product.ON_DEMAND; case OTHER: return null; case NA: return null; default: throw new IllegalArgumentException("Unhandled physical mode: " + modeId); } }
Source:
private static void addBundleToMap(Map<IPluginModelBase, String> map, IPluginModelBase bundle, String sl) { BundleDescription desc = bundle.getBundleDescription(); boolean defaultsl = (sl == null || sl.equals("default:default")); if (cfgIniBundleStartInfo.isEmpty()) { if (desc != null && defaultsl) { String runLevelText = resolveSystemRunLevelText(bundle); String autoText = resolveSystemAutoText(bundle); if (runLevelText != null && autoText != null) { map.put(bundle, runLevelText + ":" + autoText); } else { map.put(bundle, sl); } } else { map.put(bundle, sl); } } else { sl = resolveConfigIni(bundle); map.put(bundle, sl); } }

Target:
private static void addBundleToMap(Map<IPluginModelBase, String> map, IPluginModelBase bundle, String sl) { BundleDescription desc = bundle.getBundleDescription(); boolean defaultsl = (sl == null || sl.equals("default:default")); if (cfgIniBundleStartInfo != null && cfgIniBundleStartInfo.isEmpty()) { if (desc != null && defaultsl) { String runLevelText = resolveSystemRunLevelText(bundle); String autoText = resolveSystemAutoText(bundle); if (runLevelText != null && autoText != null) { map.put(bundle, runLevelText + ":" + autoText); } else { map.put(bundle, sl); } } else { map.put(bundle, sl); } } else { sl = resolveConfigIni(bundle); map.put(bundle, sl); } }
Source:
protected String createPayload(FirewallRule.Request.UpdatePayload payload) { checkNotNull(payload, "payload"); checkNotNull(payload.dataCenterId(), "dataCenterId"); checkNotNull(payload.serverId(), "serverId"); checkNotNull(payload.nicId(), "nicId"); checkNotNull(payload.id(), "id"); dataCenterId = payload.dataCenterId(); serverId = payload.serverId(); nicId = payload.nicId(); id = payload.id(); if (payload.name() != null) requestBuilder.put("name", payload.name()); if (payload.sourceMac() != null) requestBuilder.put("sourceMac", payload.sourceMac()); if (payload.sourceIp() != null) requestBuilder.put("sourceIp", payload.sourceIp()); if (payload.targetIp() != null) requestBuilder.put("targetIp", payload.targetIp()); if (payload.icmpCode() != null) requestBuilder.put("icmpCode", payload.icmpCode()); if (payload.icmpType() != null) requestBuilder.put("icmpType", payload.icmpType()); if (payload.portRangeStart() != null) requestBuilder.put("portRangeStart", payload.portRangeStart()); if (payload.portRangeEnd() != null) requestBuilder.put("portRangeEnd", payload.portRangeEnd()); return jsonBinder.toJson(requestBuilder); }

Target:
protected String createPayload(FirewallRule.Request.UpdatePayload payload) { checkNotNull(payload, "payload"); checkNotNull(payload.dataCenterId(), "dataCenterId"); checkNotNull(payload.serverId(), "serverId"); checkNotNull(payload.nicId(), "nicId"); checkNotNull(payload.id(), "id"); dataCenterId = payload.dataCenterId(); serverId = payload.serverId(); nicId = payload.nicId(); id = payload.id(); putIfPresent(requestBuilder, "name", payload.name()); putIfPresent(requestBuilder, "sourceMac", payload.sourceMac()); putIfPresent(requestBuilder, "sourceIp", payload.sourceIp()); putIfPresent(requestBuilder, "targetIp", payload.targetIp()); putIfPresent(requestBuilder, "icmpCode", payload.icmpCode()); putIfPresent(requestBuilder, "icmpType", payload.icmpType()); putIfPresent(requestBuilder, "portRangeStart", payload.portRangeStart()); putIfPresent(requestBuilder, "portRangeEnd", payload.portRangeEnd()); return jsonBinder.toJson(requestBuilder); }
Source:
protected void thisApplyNext(final IConfig config, final IConfig prevFull) { final String systemName = _sysConfig.getSystemName(); final Collection<IParameter> sysConfig = _sysConfig.getParameters(); for (final IParameter param : sysConfig) { config.putParameter(systemName, DefaultParameter.getInstance(param.getName(), param.getValue())); } config.putParameter(systemName, StringParameter.getInstance(InstConstants.INSTRUMENT_NAME_PROP, Gpi.INSTRUMENT_NAME_PROP)); final ISPObsComponent targetcomp = SPTreeUtil.findTargetEnvNode(getObsComponent().getContextObservation()); if (targetcomp != null) { final TargetObsComp toc = (TargetObsComp) targetcomp.getDataObject(); if (toc != null) { toc.getAsterism().allSpTargetsJava().headOption().foreach(base -> { final ImList<Magnitude> magnitudes = base.getMagnitudesJava(); MAG_PROPERTIES.forEach((band, propName) -> magnitudes.find(m -> m.band().equals(band)). foreach(mag -> config.putParameter(systemName, DefaultParameter.getInstance(propName, mag)))); }); } } }

Target:
protected void thisApplyNext(final IConfig config, final IConfig prevFull) { final String systemName = _sysConfig.getSystemName(); final Collection<IParameter> sysConfig = _sysConfig.getParameters(); for (final IParameter param : sysConfig) { config.putParameter(systemName, DefaultParameter.getInstance(param.getName(), param.getValue())); } config.putParameter(systemName, StringParameter.getInstance(InstConstants.INSTRUMENT_NAME_PROP, Gpi.INSTRUMENT_NAME_PROP)); final ISPObsComponent targetcomp = SPTreeUtil.findTargetEnvNode(getObsComponent().getContextObservation()); if (targetcomp != null) { final TargetObsComp toc = (TargetObsComp) targetcomp.getDataObject(); if (toc != null) { toc.getAsterism().allSpTargetsJava().headOption().foreach(base -> { final ImList<Magnitude> magnitudes = base.getMagnitudesJava(); MAG_PROPERTIES.forEach((band, propName) -> magnitudes.find(m -> m.band().equals(band)). foreach(mag -> config.putParameter(systemName, DefaultParameter.getInstance(propName, mag.value())))); }); } } }
Source:
protected boolean validate() { oldHost = vdsDao.get(getVdsId()); boolean validateAgents=true; if (getParameters().getFenceAgents() == null || getParameters().getFenceAgents().isEmpty()) { getParameters().setFenceAgents(fenceAgentDao.getFenceAgentsForHost(getVdsId())); validateAgents = false; } UpdateHostValidator validator = getUpdateHostValidator(oldHost, getParameters().getvds(), getParameters().isInstallHost()); return validate(validator.hostExists()) && validate(validator.hostStatusValid()) && validate(validator.nameNotEmpty()) && validate(validator.nameLengthIsLegal()) && validate(validator.updateHostAddressAllowed()) && validate(validator.nameNotUsed()) && validate(validator.hostNameNotUsed()) && validate(validator.statusSupportedForHostInstallation()) && validate(validator.passwordProvidedForHostInstallation(getParameters().getAuthMethod(), getParameters().getPassword())) && validate(validator.updatePortAllowed()) && validate(validator.clusterNotChanged()) && validate(validator.hostProviderExists()) && validate(validator.hostProviderTypeMatches()) && validateNetworkProviderConfiguration() && isPowerManagementLegal(getParameters().getVdsStaticData().isPmEnabled(), getParameters().getFenceAgents(), oldHost.getClusterCompatibilityVersion().toString(), validateAgents) && validate(validator.supportsDeployingHostedEngine( getParameters().getHostedEngineDeployConfiguration())); }

Target:
protected boolean validate() { oldHost = vdsDao.get(getVdsId()); boolean validateAgents=true; if (getParameters().getFenceAgents() == null) { getParameters().setFenceAgents(fenceAgentDao.getFenceAgentsForHost(getVdsId())); validateAgents = false; } UpdateHostValidator validator = getUpdateHostValidator(oldHost, getParameters().getvds(), getParameters().isInstallHost()); return validate(validator.hostExists()) && validate(validator.hostStatusValid()) && validate(validator.nameNotEmpty()) && validate(validator.nameLengthIsLegal()) && validate(validator.updateHostAddressAllowed()) && validate(validator.nameNotUsed()) && validate(validator.hostNameNotUsed()) && validate(validator.statusSupportedForHostInstallation()) && validate(validator.passwordProvidedForHostInstallation(getParameters().getAuthMethod(), getParameters().getPassword())) && validate(validator.updatePortAllowed()) && validate(validator.clusterNotChanged()) && validate(validator.hostProviderExists()) && validate(validator.hostProviderTypeMatches()) && validateNetworkProviderConfiguration() && isPowerManagementLegal(getParameters().getVdsStaticData().isPmEnabled(), getParameters().getFenceAgents(), oldHost.getClusterCompatibilityVersion().toString(), validateAgents) && validate(validator.supportsDeployingHostedEngine( getParameters().getHostedEngineDeployConfiguration())); }
Source:
public DbMetaData() { HikariDataSource h = Yank.getDefaultConnectionPool(); DatabaseMetaData meta; try { meta = h.getConnection().getMetaData(); try { dbMajorVersion = meta.getDatabaseMajorVersion(); logger.debug("dbMajorVersion = '{}'", dbMajorVersion); } catch (Exception e) { logger.error("Asking for 'dbMajorVersion' is a unsupported: '{}'", e); } try { dbMinorVersion = meta.getDatabaseMinorVersion(); logger.debug("dbMinorVersion = '{}'", dbMinorVersion); } catch (Exception e) { logger.error("Asking for 'dbMajorVersion' is a unsupported: '{}'", e); } driverMajorVersion = meta.getDriverMajorVersion(); logger.debug("driverMajorVersion = '{}'", driverMajorVersion); driverMinorVersion = meta.getDriverMinorVersion(); logger.debug("driverMinorVersion = '{}'", driverMinorVersion); dbProductName = meta.getDatabaseProductName(); logger.debug("dbProductName = '{}'", dbProductName); dbProductVersion = meta.getDatabaseProductVersion(); logger.debug("dbProductVersion = '{}'", dbProductVersion); } catch (SQLException e1) { logger.error("Asking for 'dbMajorVersion' seams to be unsupported: '{}'", e1); } }

Target:
public DbMetaData() { HikariDataSource h = Yank.getDefaultConnectionPool(); DatabaseMetaData meta; try { meta = h.getConnection().getMetaData(); try { dbMajorVersion = meta.getDatabaseMajorVersion(); logger.debug("dbMajorVersion = '{}'", dbMajorVersion); } catch (Exception e) { logger.error("Asking for 'dbMajorVersion' is a unsupported: '{}'", e.getMessage()); } try { dbMinorVersion = meta.getDatabaseMinorVersion(); logger.debug("dbMinorVersion = '{}'", dbMinorVersion); } catch (Exception e) { logger.error("Asking for 'dbMajorVersion' is a unsupported: '{}'", e.getMessage()); } driverMajorVersion = meta.getDriverMajorVersion(); logger.debug("driverMajorVersion = '{}'", driverMajorVersion); driverMinorVersion = meta.getDriverMinorVersion(); logger.debug("driverMinorVersion = '{}'", driverMinorVersion); dbProductName = meta.getDatabaseProductName(); logger.debug("dbProductName = '{}'", dbProductName); dbProductVersion = meta.getDatabaseProductVersion(); logger.debug("dbProductVersion = '{}'", dbProductVersion); } catch (SQLException e1) { logger.error("Asking for 'dbMajorVersion' seems to be unsupported: '{}'", e1.getMessage()); } }
Source:
private ConfigurationServiceImplService getConfigService() throws ConnectionManagerException, MalformedURLException{ String url = oProxyHelper.getAdapterEndPointFromConnectionManager(DirectConfigConstants.DIRECT_CONFIG_SERVICE_NAME); if(cfService == null) { cfService = new ConfigurationServiceImplService(new URL(url+"?wsdl")); } return cfService; }

Target:
protected ConfigurationServiceImplService getConfigService() throws ConnectionManagerException, MalformedURLException{ return cfService; }
Source:
public void andThenError() { TestSubscriber<String> ts = new TestSubscriber<>(0); AtomicBoolean hasRun = new AtomicBoolean(false); Exception e = new Exception(); Completable.create(cs -> cs.onError(e)) .andThen(Observable.<String>create(s-> { hasRun.set(true); s.onNext("foo"); s.onCompleted(); })) .subscribe(ts); ts.assertNoValues(); ts.assertError(e); Assert.assertFalse("Should not have subscribed to observable when completable errors", hasRun.get()); }

Target:
public void andThenError() { TestSubscriber<String> ts = new TestSubscriber<String>(0); final AtomicBoolean hasRun = new AtomicBoolean(false); final Exception e = new Exception(); Completable.create(new CompletableOnSubscribe() { @Override public void call(CompletableSubscriber cs) { cs.onError(e); } }) .andThen(Observable.<String>create(new OnSubscribe<String>() { @Override public void call(Subscriber<? super String> s) { hasRun.set(true); s.onNext("foo"); s.onCompleted(); } })) .subscribe(ts); ts.assertNoValues(); ts.assertError(e); Assert.assertFalse("Should not have subscribed to observable when completable errors", hasRun.get()); }
Source:
public <T> QueryRunner<T> getQueryRunnerForSegments(final Query<T> query, final Iterable<SegmentDescriptor> specs) { final QueryRunnerFactory<T, Query<T>> factory = conglomerate.findFactory(query); final List<QueryRunner<T>> runners = new ArrayList<>(); for (String dataSource : query.getDataSource().getNames()) { final Map<Integer, FireChief> partitionChiefs = chiefs.get(dataSource); if (partitionChiefs == null) { continue; } final QueryToolChest<T, Query<T>> toolchest = factory.getToolchest(); final Iterable<QueryRunner<T>> subRunners = Iterables.transform( specs, new Function<SegmentDescriptor, QueryRunner<T>>() { @Nullable @Override public QueryRunner<T> apply(SegmentDescriptor spec) { FireChief retVal = partitionChiefs.get(spec.getPartitionNumber()); return retVal == null ? new NoopQueryRunner<T>() : retVal.getQueryRunner(query); } } ); runners.add( toolchest.mergeResults(factory.mergeRunners(MoreExecutors.sameThreadExecutor(), subRunners)) ); } return new UnionQueryRunner<>(factory.mergeRunners(MoreExecutors.sameThreadExecutor(), runners)); }

Target:
public <T> QueryRunner<T> getQueryRunnerForSegments(final Query<T> query, final Iterable<SegmentDescriptor> specs) { final QueryRunnerFactory<T, Query<T>> factory = conglomerate.findFactory(query); final Map<Integer, FireChief> partitionChiefs = chiefs.get(Iterables.getOnlyElement(query.getDataSource() .getNames())); return partitionChiefs == null ? new NoopQueryRunner<T>() : factory.getToolchest().mergeResults( factory.mergeRunners( MoreExecutors.sameThreadExecutor(), Iterables.transform( specs, new Function<SegmentDescriptor, QueryRunner<T>>() { @Override public QueryRunner<T> apply(SegmentDescriptor spec) { final FireChief retVal = partitionChiefs.get(spec.getPartitionNumber()); return retVal == null ? new NoopQueryRunner<T>() : retVal.getQueryRunner(query); } } ) ) ); }
Source:
public String toString() { return "TaskInstance{" + "id=" + id + ", name='" + name + '\'' + ", description='" + description + '\'' + ", status='" + status + '\'' + ", actualOwner='" + actualOwner + '\'' + ", processInstanceId=" + processInstanceId + ", processId='" + processId + '\'' + ", containerId='" + containerId + '\'' + '}'; }

Target:
public String toString() { return "TaskWithProcessDescription{" + "id=" + id + ", name='" + name + '\'' + ", description='" + description + '\'' + ", status='" + status + '\'' + ", actualOwner='" + actualOwner + '\'' + ", processInstanceId=" + processInstanceId + ", processId='" + processId + '\'' + ", containerId='" + containerId + '\'' + ", lastModificationDate='" + lastModificationDate + '\'' + ", lastModificationUser='" + lastModificationUser + '\'' + ", processInstanceDescription='" + processInstanceDescription + '\'' + '}'; }
Source:
private Map<String, FetchInfo> makeFetchMap(ChangeData cd, PatchSet in) throws OrmException { Map<String, FetchInfo> r = Maps.newLinkedHashMap(); for (String pluginName : downloadSchemes.plugins()) { for (Entry<String, Provider<DownloadScheme>> e : downloadSchemes.byPlugin(pluginName).entrySet()) { DownloadScheme scheme = e.getValue().get(); if (!scheme.isEnabled() || (scheme.isAuthRequired() && !userProvider.get().isIdentifiedUser())) { continue; } ChangeControl ctl = control(cd); if (!scheme.isAuthRequired() && !ctl.forUser(anonymous).isPatchVisible(in, db.get())) { continue; } String projectName = ctl.getProject().getNameKey().get(); String url = scheme.getUrl(projectName); String refName = in.getRefName(); FetchInfo fetchInfo = new FetchInfo(url, refName); r.put(e.getKey(), fetchInfo); if (has(DOWNLOAD_COMMANDS)) { for (String pluginName2 : downloadCommands.plugins()) { for (Entry<String, Provider<DownloadCommand>> e2 : downloadCommands.byPlugin(pluginName2).entrySet()) { String c = e2.getValue().get().getCommand(scheme, projectName, refName); if (c != null) { fetchInfo.addCommand(e2.getKey(), c); } } } } } } return r; }

Target:
private Map<String, FetchInfo> makeFetchMap(ChangeData cd, PatchSet in) throws OrmException { Map<String, FetchInfo> r = Maps.newLinkedHashMap(); for (DynamicMap.Entry<DownloadScheme> e : downloadSchemes) { String schemeName = e.getExportName(); DownloadScheme scheme = e.getProvider().get(); if (!scheme.isEnabled() || (scheme.isAuthRequired() && !userProvider.get().isIdentifiedUser())) { continue; } ChangeControl ctl = control(cd); if (!scheme.isAuthRequired() && !ctl.forUser(anonymous).isPatchVisible(in, db.get())) { continue; } String projectName = ctl.getProject().getNameKey().get(); String url = scheme.getUrl(projectName); String refName = in.getRefName(); FetchInfo fetchInfo = new FetchInfo(url, refName); r.put(schemeName, fetchInfo); if (has(DOWNLOAD_COMMANDS)) { for (DynamicMap.Entry<DownloadCommand> e2 : downloadCommands) { String commandName = e2.getExportName(); DownloadCommand command = e2.getProvider().get(); String c = command.getCommand(scheme, projectName, refName); if (c != null) { fetchInfo.addCommand(commandName, c); } } } } return r; }
Source:
public KafkaConsumerMetrics(Metrics metrics, String metricGrpPrefix) { this.metrics = metrics; String metricGroupName = metricGrpPrefix + "-metrics"; Measurable lastPoll = (mConfig, now) -> { if (lastPollMs == 0L) return -1d; else return TimeUnit.SECONDS.convert(now - lastPollMs, TimeUnit.MILLISECONDS); }; metrics.addMetric(metrics.metricName("last-poll-seconds-ago", metricGroupName, "The number of seconds since the last poll() invocation."), lastPoll); this.timeBetweenPollSensor = metrics.sensor("time-between-poll"); this.timeBetweenPollSensor.add(metrics.metricName("time-between-poll-avg", metricGroupName, "The average delay between invocations of poll()."), new Avg()); this.timeBetweenPollSensor.add(metrics.metricName("time-between-poll-max", metricGroupName, "The max delay between invocations of poll()."), new Max()); this.pollIdleSensor = metrics.sensor("poll-idle-ratio"); this.pollIdleSensor.add(metrics.metricName("poll-idle-ratio", metricGroupName, "The average fraction of time the consumer's poll() is idle as opposed to waiting for the user code to process records."), new Avg()); }

Target:
public KafkaConsumerMetrics(Metrics metrics, String metricGrpPrefix) { this.metrics = metrics; String metricGroupName = metricGrpPrefix + "-metrics"; Measurable lastPoll = (mConfig, now) -> { if (lastPollMs == 0L) return -1d; else return TimeUnit.SECONDS.convert(now - lastPollMs, TimeUnit.MILLISECONDS); }; metrics.addMetric(metrics.metricName("last-poll-seconds-ago", metricGroupName, "The number of seconds since the last poll() invocation."), lastPoll); this.timeBetweenPollSensor = metrics.sensor("time-between-poll"); this.timeBetweenPollSensor.add(metrics.metricName("time-between-poll-avg", metricGroupName, "The average delay between invocations of poll()."), new Avg()); this.timeBetweenPollSensor.add(metrics.metricName("time-between-poll-max", metricGroupName, "The max delay between invocations of poll()."), new Max()); this.pollIdleSensor = metrics.sensor("poll-idle-ratio-avg"); this.pollIdleSensor.add(metrics.metricName("poll-idle-ratio-avg", metricGroupName, "The average fraction of time the consumer's poll() is idle as opposed to waiting for the user code to process records."), new Avg()); }
Source:
protected void doSetUserAttributes(String userName, Map<String, List<String>> claimAttributesToAdd, Map<String, List<String>> claimAttributesToDelete, Map<String, List<String>> claimAttributesToReplace, String profileName) throws UserStoreException, NotImplementedException { if (log.isDebugEnabled()) { log.debug("doSetUserAttributes operation is not implemented in: " + this.getClass()); } throw new NotImplementedException("doSetUserAttributes operation is not implemented in: " + this.getClass()); }

Target:
protected void doSetUserAttributes(String userName, Map<String, List<String>> claimAttributesToAdd, Map<String, List<String>> claimAttributesToDelete, Map<String, List<String>> claimAttributesToReplace, String profileName) throws UserStoreException, NotImplementedException { throw new NotImplementedException("doSetUserAttributes operation is not implemented in: " + this.getClass()); }
Source:
public ConfigManager() { launcherDir = resolveLauncherDir(); configPath = launcherDir.resolve(CONFIG_FILE); gson = new GsonBuilder() .registerTypeAdapter(Path.class, new PathAdapter()) .registerTypeAdapter(Package.class, new PackageAdapter()) .disableHtmlEscaping() .setPrettyPrinting() .create(); loadService = new ConfigLoadService(this); saveService = new ConfigSaveService(this); }

Target:
private ConfigManager() { if (instance != null) { throw new RuntimeException("Cannot create second instance of a singleton class"); } launcherDir = resolveLauncherDir(); configPath = launcherDir.resolve(CONFIG_FILE); config = createDefaultConfig(); gson = new GsonBuilder() .registerTypeAdapter(Path.class, new PathAdapter()) .registerTypeAdapter(Package.class, new PackageAdapter()) .disableHtmlEscaping() .setPrettyPrinting() .create(); reader = new ConfigReader(this); writer = new ConfigWriter(this); }
Source:
private Response<ShareStatistics> mapGetStatisticsResponse(SharesGetStatisticsResponse response) { ShareStatistics shareStatistics = new ShareStatistics((int) (response.getValue().getShareUsageBytes() / (Constants.GB)), response.getValue().getShareUsageBytes()); return new SimpleResponse<>(response, shareStatistics); }

Target:
private Response<ShareStatistics> mapGetStatisticsResponse(SharesGetStatisticsResponse response) { ShareStatistics shareStatistics = new ShareStatistics(response.getValue().getShareUsageBytes()); return new SimpleResponse<>(response, shareStatistics); }
Source:
public void testUpdateAnnotation() throws IOException { DocumentModel file = session.createDocumentModel("/", "testDoc", "File"); file = session.createDocument(file); fetchInvalidations(); String xpath = "file:content"; Annotation annotation = new AnnotationImpl(); annotation.setOpacity(0.5); annotation.setName("testAnnotation"); annotation = annotationService.createAnnotation(session, file.getId(), xpath, annotation); fetchInvalidations(); annotation.setName("testUpdatedAnnotation"); annotation.setSecurity("Private"); String jsonAnnotation = MarshallerHelper.objectToJson(annotation, CtxBuilder.get()); try (CloseableClientResponse response = getResponse(RequestType.PUT, "id/" + file.getId() + "/@annotation/" + xpath + "/" + annotation.getId(), jsonAnnotation)) { assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); fetchInvalidations(); Annotation updatedAnnotation = annotationService.getAnnotation(session, file.getId(), xpath, annotation.getId()); assertEquals(0.5, updatedAnnotation.getOpacity(), 0.0); assertEquals("testUpdatedAnnotation", updatedAnnotation.getName()); assertEquals("Private", updatedAnnotation.getSecurity()); } }

Target:
public void testUpdateAnnotation() throws IOException { DocumentModel file = session.createDocumentModel("/", "testDoc", "File"); file = session.createDocument(file); fetchInvalidations(); String xpath = "file:content"; Annotation annotation = new AnnotationImpl(); annotation.setOpacity(0.5); annotation.setName("testAnnotation"); annotation.setDocumentId(file.getId()); annotation.setXpath(xpath); annotation = annotationService.createAnnotation(session, annotation); fetchInvalidations(); annotation.setName("testUpdatedAnnotation"); annotation.setSecurity("Private"); String jsonAnnotation = MarshallerHelper.objectToJson(annotation, CtxBuilder.get()); try (CloseableClientResponse response = getResponse(RequestType.PUT, "id/" + file.getId() + "/@annotation", jsonAnnotation)) { assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); fetchInvalidations(); Annotation updatedAnnotation = annotationService.getAnnotation(session, annotation.getId()); assertEquals(0.5, updatedAnnotation.getOpacity(), 0.0); assertEquals("testUpdatedAnnotation", updatedAnnotation.getName()); assertEquals("Private", updatedAnnotation.getSecurity()); } }
Source:
protected TmfTimeRange getSignalTimeRange(ITmfTimestamp startTime) { if (startTime == null) { return TmfTimeRange.NULL_RANGE; } fLock.lock(); try { ITmfTrace trace = fTrace; long offset = 0; if (trace != null) { TmfTimeRange currentRange = TmfTraceManager.getInstance().getTraceContext(trace).getWindowRange(); offset = currentRange.getEndTime().getDelta(currentRange.getStartTime()).toNanos(); } ITmfTimestamp initialEndOfWindow = offset == 0 ? startTime : TmfTimestamp.create(startTime.getValue() + offset, startTime.getScale()); return new TmfTimeRange(startTime, initialEndOfWindow); } finally { fLock.unlock(); } }

Target:
protected TmfTimeRange getSignalTimeRange(ITmfTimestamp startTime) { if (startTime == null) { return TmfTimeRange.NULL_RANGE; } fLock.lock(); try { ITmfTrace trace = fTrace; long offset = 0; if (trace != null) { TmfTimeRange currentRange = TmfTraceManager.getInstance().getTraceContext(trace).getWindowRange(); offset = currentRange.getEndTime().getDelta(currentRange.getStartTime()).toNanos(); } return new TmfTimeRange(startTime, TmfTimestamp.create(startTime.getValue() + offset, startTime.getScale())); } finally { fLock.unlock(); } }
Source:
public void onStart(ITestContext iTestContext) { getLifecycle().fire(new TestSuiteStartedEvent( getSuiteUid(iTestContext), getCurrentSuiteName(iTestContext) ).withLabels( AllureModelUtils.createTestFrameworkLabel("TestNG"), AllureModelUtils.createFeatureLabel(getCurrentSuiteName(iTestContext)) )); }

Target:
public void onStart(ITestContext iTestContext) { getLifecycle().fire(new TestSuiteStartedEvent( getSuiteUid(iTestContext), iTestContext.getSuite().getName() ).withTitle( getCurrentSuiteTitle(iTestContext) ).withLabels( AllureModelUtils.createTestFrameworkLabel("TestNG") )); }