auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void onReloadConfigComplete(String result) { Log.v(TAG, "onReloadConfigComplete: " + result); mConfig = new Gson().fromJson(result, Config.class); if (mConfig == null) { throw new RuntimeException("config is null: " + result); } mCompletion.updateDevices(getDevices(true)); <START> mCompletion.updateFolders(getFolders()); <END> }</code><technical_language>config saved affect completion</technical_language>

Target:
private void onReloadConfigComplete(String result) { Log.v(TAG, "onReloadConfigComplete: " + result); mConfig = new Gson().fromJson(result, Config.class); if (mConfig == null) { throw new RuntimeException("config is null: " + result); } mCompletion.updateFromConfig(getDevices(true), getFolders()); }
Source:
<code>public void setup() { super.setup(); zone = Iterables.getLast(api.getConfiguredZones(), "nova"); volumeOption = api.getVolumeExtensionForZone(zone); Optional<? extends AvailabilityZoneAPI> availabilityZoneApi = api.getAvailabilityZoneApi(zone); <START> availabilityZone = availabilityZoneApi.isPresent() ? Iterables.getLast(availabilityZoneApi.get().list()).getName() : zone; <END> }</code><technical_language>curious getLast...is reason for picking _last_ one? If expecting answer, getOnlyElement instead</technical_language>

Target:
public void setup() { super.setup(); zone = Iterables.getLast(api.getConfiguredZones(), "nova"); volumeOption = api.getVolumeExtensionForZone(zone); Optional<? extends AvailabilityZoneApi> availabilityZoneApi = api.getAvailabilityZoneApi(zone); availabilityZone = availabilityZoneApi.isPresent() ? Iterables.getLast(availabilityZoneApi.get().list()).getName() : zone; }
Source:
<code>public void testFour() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlFour.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); moduleConfig.addAttribute("file", getPath("SuppressionXpathRegressionImportControlFour.xml")); final String[] expectedViolation = { "4:1: " + getCheckMessage(ImportControlCheck.class, ImportControlCheck.MSG_DISALLOWED, "java.util.Scanner"), }; final List<String> expectedXpathQueries = Collections.singletonList( <START> "/IMPORT[2]" <END> ); runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); }</code><technical_language>@timurt , please explain this update. Original version more strict. updated version match everything</technical_language>

Target:
public void testFour() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlFour.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); moduleConfig.addAttribute("file", getPath("SuppressionXpathRegressionImportControlFour.xml")); final String[] expectedViolation = { "4:1: " + getCheckMessage(ImportControlCheck.class, ImportControlCheck.MSG_DISALLOWED, "java.util.Scanner"), }; final List<String> expectedXpathQueries = Collections.singletonList( "/IMPORT[./DOT/IDENT[@text='Scanner']]" ); runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); }
Source:
<code>public Mono<Response<StorageServiceStats>> getStatistics() { return client.services().getStatisticsWithRestResponseAsync(Context.NONE) <START> .map(response -> new SimpleResponse<>(response.request(), response.statusCode(), response.headers(), response.value())); <END> }</code><technical_language>I hate this line - I everywhere</technical_language>

Target:
public Mono<Response<StorageServiceStats>> getStatistics() { return client.services().getStatisticsWithRestResponseAsync(Context.NONE) .map(response -> new SimpleResponse<>(response, response.value())); }
Source:
<code>public void start() throws Exception { String statemgrClass = Context.stateManagerClass(config); LOG.info("Context.stateManagerClass " + statemgrClass); IStateManager statemgr; try { statemgr = ReflectionUtils.newInstance(statemgrClass); } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) { throw new Exception(String.format( "Failed to instantiate state manager class '%s'", statemgrClass), e); } try { statemgr.initialize(config); Boolean b = statemgr.setMetricsCacheLocation(metricsCacheLocation, topologyName) .get(5000, TimeUnit.MILLISECONDS); <START> if (b != null && b == Boolean.TRUE) { <END> LOG.info("metricsCacheLocation " + metricsCacheLocation.toString()); LOG.info("topologyName " + topologyName.toString()); LOG.info("Starting Metrics Cache HTTP Server"); metricsCacheManagerHttpServer.start(); LOG.info("Starting Metrics Cache Server"); metricsCacheManagerServer.start(); metricsCacheManagerServerLoop.loop(); } else { LOG.severe("statemgr metricscahe node failure, fail fast"); } } finally { SysUtils.closeIgnoringExceptions(statemgr); } }</code><technical_language>if (b != null && b) is good enough, if (b != null && b.booleanValue())</technical_language>

Target:
public void start() throws Exception { String statemgrClass = Context.stateManagerClass(config); LOG.info("Context.stateManagerClass " + statemgrClass); IStateManager statemgr; try { statemgr = ReflectionUtils.newInstance(statemgrClass); } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) { throw new Exception(String.format( "Failed to instantiate state manager class '%s'", statemgrClass), e); } try { statemgr.initialize(config); Boolean b = statemgr.setMetricsCacheLocation(metricsCacheLocation, topologyName) .get(5000, TimeUnit.MILLISECONDS); if (b != null && b) { LOG.info("metricsCacheLocation " + metricsCacheLocation.toString()); LOG.info("topologyName " + topologyName.toString()); LOG.info("Starting Metrics Cache HTTP Server"); metricsCacheManagerHttpServer.start(); LOG.info("Starting Metrics Cache Server"); metricsCacheManagerServer.start(); metricsCacheManagerServerLoop.loop(); } else { throw new RuntimeException("Failed to set metricscahe location."); } } finally { SysUtils.closeIgnoringExceptions(statemgr); } }
Source:
<code>public static List<String> getDestinationFromTenantDomain(String tenantDomain) throws IdentityException { List<String> destinationURLs = new ArrayList<String>(); IdentityProvider identityProvider; int tenantId; if (StringUtils.isBlank(tenantDomain) || "null".equals(tenantDomain)) { tenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME; tenantId = MultitenantConstants.SUPER_TENANT_ID; } else { try { tenantId = SAMLSSOUtil.getRealmService().getTenantManager().getTenantId(tenantDomain); } catch (UserStoreException e) { throw new IdentityException("Error occurred while retrieving tenant id from tenant domain", e); } if (MultitenantConstants.INVALID_TENANT_ID == tenantId) { throw new IdentityException("Invalid tenant domain - '" + tenantDomain + "'"); } } IdentityTenantUtil.initializeRegistry(tenantId, tenantDomain); try { identityProvider = IdentityProviderManager.getInstance().getResidentIdP(tenantDomain); } catch (IdentityProviderManagementException e) { throw new IdentityException( "Error occurred while retrieving Resident Identity Provider information for tenant " + tenantDomain, e); } FederatedAuthenticatorConfig[] authnConfigs = identityProvider.getFederatedAuthenticatorConfigs(); for (FederatedAuthenticatorConfig config : authnConfigs) { if (IdentityApplicationConstants.Authenticator.SAML2SSO.NAME.equals(config.getName())) { for (Property prop : config.getProperties()) { if (prop.getName().startsWith(IdentityApplicationConstants.Authenticator.SAML2SSO .DESTINATION_URL_PREFIX)) { destinationURLs.add(prop.getValue()); } } } <START> } <END> if (destinationURLs.size() == 0) { String configDestination = IdentityUtil.getProperty(IdentityConstants.ServerConfig.SSO_IDP_URL); if (StringUtils.isBlank(configDestination)) { configDestination = IdentityUtil.getServerURL(SAMLSSOConstants.SAMLSSO_URL); } destinationURLs.add(configDestination); } return destinationURLs; }</code><technical_language>Move this looping IdentityApplicationManagementUtil</technical_language>

Target:
public static List<String> getDestinationFromTenantDomain(String tenantDomain) throws IdentityException { List<String> destinationURLs = new ArrayList<String>(); IdentityProvider identityProvider; try { identityProvider = IdentityProviderManager.getInstance().getResidentIdP(tenantDomain); } catch (IdentityProviderManagementException e) { throw new IdentityException( "Error occurred while retrieving Resident Identity Provider information for tenant " + tenantDomain, e); } FederatedAuthenticatorConfig[] authnConfigs = identityProvider.getFederatedAuthenticatorConfigs(); destinationURLs.addAll(IdentityApplicationManagementUtil.getPropertyValuesForNameStartsWith(authnConfigs, IdentityApplicationConstants.Authenticator.SAML2SSO.NAME, IdentityApplicationConstants.Authenticator .SAML2SSO.DESTINATION_URL_PREFIX)); if (destinationURLs.size() == 0) { String configDestination = IdentityUtil.getProperty(IdentityConstants.ServerConfig.SSO_IDP_URL); if (StringUtils.isBlank(configDestination)) { configDestination = IdentityUtil.getServerURL(SAMLSSOConstants.SAMLSSO_URL,true); } destinationURLs.add(configDestination); } return destinationURLs; }
Source:
<code>public Set<ConfigOption<?>> optionalOptions() { final Set<ConfigOption<?>> options = new HashSet<>(); options.add(FactoryUtil.KEY_FIELDS_PREFIX); options.add(KafkaOptions.TOPIC); <START> options.add(KafkaOptions.TOPIC_PATTERN); <END> options.add(FactoryUtil.VALUE_FIELDS_INCLUDE); return options; }</code><technical_language>If introducing a new connector, I prefer support this option in version. is useful error-prone in upsert mode</technical_language>

Target:
public Set<ConfigOption<?>> optionalOptions() { final Set<ConfigOption<?>> options = new HashSet<>(); options.add(KEY_FIELDS_PREFIX); options.add(VALUE_FIELDS_INCLUDE); options.add(FactoryUtil.SINK_PARALLELISM); return options; }
Source:
<code>private static void generateConstructor( ClassDefinition classDefinition, CachedInstanceBinder cachedInstanceBinder, PreGeneratedExpressions preGeneratedExpressions, Consumer<MethodDefinition> additionalStatements) { MethodDefinition constructorDefinition = classDefinition.declareConstructor(a(PUBLIC)); BytecodeBlock body = constructorDefinition.getBody(); Variable thisVariable = constructorDefinition.getThis(); body.comment("super();") .append(thisVariable) .invokeConstructor(Object.class); additionalStatements.accept(constructorDefinition); cachedInstanceBinder.generateInitializations(thisVariable, body); preGeneratedExpressions.getLambdaFieldMap().values().forEach( lambdaExpressionField -> lambdaExpressionField.generateInitialization(thisVariable, body) <START> ); <END> body.ret(); }</code><technical_language>for-loop</technical_language>

Target:
private static void generateConstructor( ClassDefinition classDefinition, CachedInstanceBinder cachedInstanceBinder, PreGeneratedExpressions preGeneratedExpressions, Consumer<MethodDefinition> additionalStatements) { MethodDefinition constructorDefinition = classDefinition.declareConstructor(a(PUBLIC)); BytecodeBlock body = constructorDefinition.getBody(); Variable thisVariable = constructorDefinition.getThis(); body.comment("super();") .append(thisVariable) .invokeConstructor(Object.class); additionalStatements.accept(constructorDefinition); cachedInstanceBinder.generateInitializations(thisVariable, body); for (LambdaExpressionField field : preGeneratedExpressions.getLambdaFieldMap().values()) { field.generateInitialization(thisVariable, body); } body.ret(); }
Source:
<code>public static void serverShutdown(int portOffset, AutomationContext automationContext) throws Exception { long time = System.currentTimeMillis() + DEFAULT_START_STOP_WAIT_MS; log.info("Shutting down server.."); <START> boolean logOutSuccess = false; <END> if (ClientConnectionUtil.isPortOpen( Integer.parseInt(ExtensionConstants.SERVER_DEFAULT_HTTPS_PORT))) { int httpsPort = Integer.parseInt(FrameworkConstants.SERVER_DEFAULT_HTTPS_PORT) + portOffset; String url = automationContext.getContextUrls().getBackEndUrl(); String backendURL = url.replaceAll("(:\\d+)", ":" + httpsPort); ServerAdminClient serverAdminServiceClient = new ServerAdminClient(backendURL, automationContext.getContextTenant().getTenantAdmin().getUserName(), automationContext.getContextTenant().getTenantAdmin().getPassword()); serverAdminServiceClient.shutdown(); while (System.currentTimeMillis() < time && !logOutSuccess) { logOutSuccess = isServerDown(automationContext, portOffset); } log.info("Server stopped successfully..."); } }</code><technical_language>isLogoutSuccess</technical_language>

Target:
public static void serverShutdown(int portOffset, AutomationContext automationContext) throws CarbonToolsIntegrationTestException { long time = System.currentTimeMillis() + DEFAULT_START_STOP_WAIT_MS; log.info("Shutting down server.."); boolean logOutSuccess = false; try { if (ClientConnectionUtil.isPortOpen( Integer.parseInt(ExtensionConstants.SERVER_DEFAULT_HTTPS_PORT))) { int httpsPort = Integer.parseInt(FrameworkConstants.SERVER_DEFAULT_HTTPS_PORT) + portOffset; String url = automationContext.getContextUrls().getBackEndUrl(); String backendURL = url.replaceAll("(:\\d+)", ":" + httpsPort); ServerAdminClient serverAdminServiceClient = new ServerAdminClient(backendURL, automationContext.getContextTenant(). getTenantAdmin().getUserName(), automationContext.getContextTenant(). getTenantAdmin().getPassword()); serverAdminServiceClient.shutdown(); while (System.currentTimeMillis() < time && !logOutSuccess) { logOutSuccess = isServerDown(automationContext, portOffset); } log.info("Server stopped successfully..."); } } catch (Exception ex) { log.error("Error while shutting down the server using default credentials", ex); throw new CarbonToolsIntegrationTestException("Error while shutting down the server using " + "default credentials ", ex); } }
Source:
<code>private GeneralCommandLine getPantsExportCommand(final File outputFile, @NotNull Consumer<String> statusConsumer) throws IOException, ExecutionException { final GeneralCommandLine commandLine = PantsUtil.defaultCommandLine(getProjectPath()); Optional<String> rcArg = IJRC.getImportPantsRc(commandLine.getWorkDirectory().getPath()); rcArg.ifPresent(commandLine::addParameter); final File targetSpecsFile = FileUtil.createTempFile("pants_target_specs", ".in"); try (FileWriter targetSpecsFileWriter = new FileWriter(targetSpecsFile)) { for (String targetSpec : getTargetSpecs()) { targetSpecsFileWriter.write(targetSpec); targetSpecsFileWriter.write('\n'); } } commandLine.addParameter("--target-spec-file=" + targetSpecsFile.getPath()); commandLine.addParameter("--no-quiet"); <START> boolean exportAvailableTypes = isAtLeastPantsVersion(1, 23); <END> if (exportAvailableTypes) { commandLine.addParameter("--export-available-target-types"); } if (getOptions().isImportSourceDepsAsJars()) { commandLine.addParameter("export-dep-as-jar"); } else { commandLine.addParameter("export"); } commandLine.addParameter("--output-file=" + outputFile.getPath()); commandLine.addParameter("--formatted"); if (myResolveSourcesAndDocsForJars) { commandLine.addParameter("--export-libraries-sources"); commandLine.addParameter("--export-libraries-javadocs"); } return commandLine; }</code><technical_language>= 1.24</technical_language>

Target:
private GeneralCommandLine getPantsExportCommand(final File outputFile, @NotNull Consumer<String> statusConsumer) throws IOException { final GeneralCommandLine commandLine = PantsUtil.defaultCommandLine(getProjectPath()); Optional<String> rcArg = IJRC.getImportPantsRc(commandLine.getWorkDirectory().getPath()); rcArg.ifPresent(commandLine::addParameter); final File targetSpecsFile = FileUtil.createTempFile("pants_target_specs", ".in"); try (FileWriter targetSpecsFileWriter = new FileWriter(targetSpecsFile)) { for (String targetSpec : getTargetSpecs()) { targetSpecsFileWriter.write(targetSpec); targetSpecsFileWriter.write('\n'); } } commandLine.addParameter("--target-spec-file=" + targetSpecsFile.getPath()); commandLine.addParameter("--no-quiet"); if (PantsUtil.isCompatiblePantsVersion(getProjectPath(), "1.24.0")) { commandLine.addParameter("--export-available-target-types"); } if (getOptions().isImportSourceDepsAsJars()) { commandLine.addParameter("export-dep-as-jar"); } else { commandLine.addParameter("export"); } commandLine.addParameter("--output-file=" + outputFile.getPath()); commandLine.addParameter("--formatted"); if (myResolveSourcesAndDocsForJars) { commandLine.addParameter("--export-libraries-sources"); commandLine.addParameter("--export-libraries-javadocs"); } return commandLine; }
Source:
<code>public Object handle(Request request, Response response) throws Exception { String transformerId = request.params(":transformerId"); String body = util.safeGetBody(request); CqlRequest cqlRequest = mapper.readValue(body, CqlRequest.class); CqlQueryResponse cqlQueryResponse = executeCqlQuery(cqlRequest); LOGGER.trace("Finding transformer to transform query response."); ServiceReference<QueryResponseTransformer> queryResponseTransformer = queryResponseTransformers .stream() .filter(transformer -> transformer.getProperty("id").equals(transformerId)) .findFirst() .orElse(null); if (queryResponseTransformer == null) { LOGGER.debug("Could not find transformer with id: {}", transformerId); <START> response.status(404); <END> return mapper.toJson(ImmutableMap.of("message", "Service not found")); } attachFileWithTransformer(queryResponseTransformer, cqlQueryResponse, request, response); return ""; }</code><technical_language>constant for status code</technical_language>

Target:
public Object handle(Request request, Response response) throws Exception { String transformerId = request.params(":transformerId"); String body = util.safeGetBody(request); CqlRequest cqlRequest; try { cqlRequest = mapper.readValue(body, CqlRequest.class); } catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) { LOGGER.debug("Error fetching cql request"); response.status(HttpStatus.BAD_REQUEST_400); return ImmutableMap.of("message", "Error retrieving cql request"); } if (cqlRequest.getCql() == null) { LOGGER.debug("Cql not found in request"); return ImmutableMap.of("message", "Cql not found in request"); } Map<String, Serializable> arguments = mapper.readValue(body, Arguments.class).getSerializableArguments(); LOGGER.trace("Finding transformer to transform query response."); ServiceReference<QueryResponseTransformer> queryResponseTransformer = queryResponseTransformers .stream() .filter(transformer -> transformerId.equals(transformer.getProperty("id"))) .findFirst() .orElse(null); if (queryResponseTransformer == null) { LOGGER.debug("Could not find transformer with id: {}", transformerId); response.status(HttpStatus.NOT_FOUND_404); return ImmutableMap.of("message", "Service not found"); } CqlQueryResponse cqlQueryResponse = util.executeCqlQuery(cqlRequest); attachFileToResponse(request, response, queryResponseTransformer, cqlQueryResponse, arguments); return ""; }
Source:
<code>public void testSendSerialDataOtherProtocolsIOError() throws XBeeException, IOException { Mockito.when(xbeeDevice.getXBeeProtocol()).thenReturn(XBeeProtocol.ZIGBEE); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(transmitPacket); try { xbeeDevice.sendSerialData(XBEE_16BIT_ADDRESS, SEND_DATA_BYTES); fail("TransmitRequest frame shouldn't have been sent successfully."); } catch (Exception e) { <START> assertEquals(XBeeException.class, e.getClass()); <END> } try { xbeeDevice.sendSerialData(XBEE_64BIT_ADDRESS, SEND_DATA_BYTES); fail("TransmitRequest frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); } try { xbeeDevice.sendSerialData(mockedDevice, SEND_DATA_BYTES); fail("TransmitRequest frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); } }</code><technical_language>Check in more detail of error. java e.getCause() Apply rest</technical_language>

Target:
public void testSendSerialDataOtherProtocolsIOError() throws XBeeException, IOException { Mockito.when(xbeeDevice.getXBeeProtocol()).thenReturn(XBeeProtocol.ZIGBEE); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(transmitPacket); try { xbeeDevice.sendSerialData(XBEE_16BIT_ADDRESS, SEND_DATA_BYTES); fail("TransmitRequest frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); assertEquals(IOException.class, e.getCause().getClass()); } try { xbeeDevice.sendSerialData(XBEE_64BIT_ADDRESS, SEND_DATA_BYTES); fail("TransmitRequest frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); assertEquals(IOException.class, e.getCause().getClass()); } try { xbeeDevice.sendSerialData(mockedDevice, SEND_DATA_BYTES); fail("TransmitRequest frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); assertEquals(IOException.class, e.getCause().getClass()); } }
Source:
<code>private INewAsyncCallback createGetVmsFromExportDomainCallback() { return new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { List<VM> vmsInExportDomain; VdcQueryReturnValue retVal = (VdcQueryReturnValue) returnValue; <START> if (retVal != null && retVal.getReturnValue() != null && retVal.getSucceeded()) { <END> vmsInExportDomain = retVal.getReturnValue(); if ((vmsInExportDomain.size() > 0)) { TemplateBackupModel templateBackupModel = (TemplateBackupModel) model; HashMap<String, List<String>> problematicVmNames = getDependentVMsForTemplate(vmsInExportDomain, templateBackupModel); if (!problematicVmNames.isEmpty()) { showRemoveTemplateWithDependentVMConfirmationWindow(problematicVmNames); } else { removeTemplateBackup(); } } else { removeTemplateBackup(); } } stopProgress(); } }; }</code><technical_language>is early return problematic here</technical_language>

Target:
private INewAsyncCallback createGetVmsFromExportDomainCallback() { return new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { List<VM> vmsInExportDomain; VdcQueryReturnValue retVal = (VdcQueryReturnValue) returnValue; if (retVal == null || retVal.getReturnValue() == null || !retVal.getSucceeded()) { return; } vmsInExportDomain = retVal.getReturnValue(); if ((vmsInExportDomain.size() > 0)) { TemplateBackupModel templateBackupModel = (TemplateBackupModel) model; HashMap<String, List<String>> problematicVmNames = getDependentVMsForTemplate(vmsInExportDomain, templateBackupModel); if (!problematicVmNames.isEmpty()) { showRemoveTemplateWithDependentVMConfirmationWindow(problematicVmNames); } else { removeTemplateBackup(); } } else { removeTemplateBackup(); } } }; }
Source:
<code>private UfsStatusCache populateStatusCache(AlluxioURI path, DescendantType syncDescendantType) { Map<AlluxioURI, UfsStatus> statusCache = new HashMap<>(); try { MountTable.Resolution resolution = mMountTable.resolve(path); AlluxioURI ufsUri = resolution.getUri(); try (CloseableResource<UnderFileSystem> ufsResource = resolution.acquireUfsResource()) { UnderFileSystem ufs = ufsResource.get(); ListOptions listOptions = ListOptions.defaults(); listOptions.setRecursive(syncDescendantType == DescendantType.ALL); try { UfsStatus[] children = ufs.listStatus(ufsUri.toString(), listOptions); if (children != null) { <START> statusCache = new HashMap<>(Math.round(children.length * 1.34f), 0.75f); <END> for (UfsStatus childStatus : children) { statusCache.put(path.joinUnsafe(childStatus.getName()), childStatus); } } } catch (Exception e) { LOG.debug("ListStatus failed as an preparation step for syncMetadata {}", path, e); } return new UfsStatusCache(ufsUri, statusCache); } } catch (InvalidPathException e) { return new UfsStatusCache(new AlluxioURI(""), statusCache); } }</code><technical_language>do need .75 load factor? a larger load factor</technical_language>

Target:
private UfsStatusCache populateStatusCache(AlluxioURI path, DescendantType syncDescendantType) { Map<AlluxioURI, UfsStatus> statusCache = new HashMap<>(); try { MountTable.Resolution resolution = mMountTable.resolve(path); AlluxioURI ufsUri = resolution.getUri(); try (CloseableResource<UnderFileSystem> ufsResource = resolution.acquireUfsResource()) { UnderFileSystem ufs = ufsResource.get(); ListOptions listOptions = ListOptions.defaults(); listOptions.setRecursive(syncDescendantType == DescendantType.ALL); try { UfsStatus[] children = ufs.listStatus(ufsUri.toString(), listOptions); if (children != null) { statusCache = new HashMap<>(Math.round(children.length * 1.34f), 0.75f); for (UfsStatus childStatus : children) { statusCache.put(path.joinUnsafe(childStatus.getName()), childStatus); } } } catch (Exception e) { LOG.debug("ListStatus failed as an preparation step for syncMetadata {}", path, e); } return new UfsStatusCache(new AlluxioURI(ufsUri.getPath()), statusCache, listOptions.isRecursive()); } } catch (InvalidPathException e) { return new UfsStatusCache(new AlluxioURI(""), statusCache, false); } }
Source:
<code>public void testCreateCollectionWithoutPath() throws Exception { <START> Map<String, Object> params = new HashMap<String, Object>(); <END> params.put("name", COLLECTION_NAME); params.put("description", COLLECTION_DESCRIPTION); chain = new OperationChain("test-chain"); chain.add(CreateCollectionOperation.ID).from(params); OperationContext ctx = new OperationContext(session); DocumentModel doc = (DocumentModel) service.run(ctx, chain); assertNotNull(doc); Assert.assertEquals(COLLECTION_NAME, doc.getTitle()); Assert.assertEquals(COLLECTION_DESCRIPTION, doc.getPropertyValue("dc:description")); }</code><technical_language>Unneeded change</technical_language>

Target:
public void testCreateCollectionWithoutPath() throws Exception { Map<String, Object> params = new HashMap<>(); params.put("name", COLLECTION_NAME); params.put("description", COLLECTION_DESCRIPTION); chain = new OperationChain("test-chain"); chain.add(CreateCollectionOperation.ID).from(params); DocumentModel doc = (DocumentModel) service.run(ctx, chain); assertNotNull(doc); Assert.assertEquals(COLLECTION_NAME, doc.getTitle()); Assert.assertEquals(COLLECTION_DESCRIPTION, doc.getPropertyValue("dc:description")); }
Source:
<code>public boolean equals(Object obj) { if (obj instanceof Identity) { Identity<T> identity = (Identity<T>) obj; if (getGuid() == identity.getGuid()) { return true; } return getGuid().equals(identity.getGuid()); } <START> return false; <END> }</code><technical_language>Suggest return statement</technical_language>

Target:
public boolean equals(Object obj) { boolean equal = false; if (obj instanceof Identity) { Identity<T> identity = (Identity<T>) obj; if (getGuid() == identity.getGuid()) { equal = true; } else if (getGuid() != null) { equal = getGuid().equals(identity.getGuid()); } } return equal; }
Source:
<code>void checkValid() { if (iteratorCollection == null) { throw new ConcurrentModificationException( <START> "No outside changes to a Realm is allowed while iterating a RealmResults." + <END> " Don't call Realm.refresh() while iterating or use iterators across event loops."); } }</code><technical_language>RealmList? Realm.refresh()</technical_language>

Target:
void checkValid() { if (iteratorCollection == null) { throw new ConcurrentModificationException( "No outside changes to a Realm is allowed while iterating a living Realm collection."); } }
Source:
<code>private void initArticleHeaderView() { pageHeaderView.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { LeadImagesHandler.this.setWebViewPaddingTop(); <START> parentFragment.getWebView().setVisibility(VISIBLE); <END> }); pageHeaderView.setCallback(new PageHeaderView.Callback() { @Override public void onImageClicked() { openImageInGallery(null); } @Override public void onCallToActionClicked() { if (callToActionIsTranslation ? (callToActionTargetSummary != null && callToActionSourceSummary != null) : callToActionSourceSummary != null) { getActivity().startActivityForResult(DescriptionEditActivity.newIntent(getActivity(), callToActionIsTranslation ? callToActionTargetSummary.getPageTitle() : callToActionSourceSummary.getPageTitle(), null, callToActionSourceSummary, callToActionTargetSummary, callToActionIsTranslation ? SUGGESTED_EDITS_TRANSLATE_CAPTION : SUGGESTED_EDITS_ADD_CAPTION), ACTIVITY_REQUEST_IMAGE_CAPTION_EDIT); } } }); }</code><technical_language>more logical put this in onPageFinished() in PageFragment</technical_language>

Target:
private void initArticleHeaderView() { pageHeaderView.setCallback(new PageHeaderView.Callback() { @Override public void onImageClicked() { openImageInGallery(null); } @Override public void onCallToActionClicked() { if (callToActionIsTranslation ? (callToActionTargetSummary != null && callToActionSourceSummary != null) : callToActionSourceSummary != null) { getActivity().startActivityForResult(DescriptionEditActivity.newIntent(getActivity(), callToActionIsTranslation ? callToActionTargetSummary.getPageTitle() : callToActionSourceSummary.getPageTitle(), null, callToActionSourceSummary, callToActionTargetSummary, callToActionIsTranslation ? SUGGESTED_EDITS_TRANSLATE_CAPTION : SUGGESTED_EDITS_ADD_CAPTION), ACTIVITY_REQUEST_IMAGE_CAPTION_EDIT); } } }); }
Source:
<code>public void release() throws EEException { LOG.trace("Releasing Execution Engine... " + pointer); if (pointer != 0L) { final int errorCode = nativeDestroy(pointer); pointer = 0L; checkErrorCode(errorCode); } deserializer = null; deserializerBufferOrigin.discard(); exceptionBuffer = null; exceptionBufferOrigin.discard(); psetBufferC.discard(); psetBuffer = null; <START> granularStatsBufferC.discard(); <END> granularStatsBuffer = null; LOG.trace("Released Execution Engine."); }</code><technical_language>figure out do this valgrind a leak</technical_language>

Target:
public void release() throws EEException { LOG.trace("Releasing Execution Engine... " + pointer); if (pointer != 0L) { final int errorCode = nativeDestroy(pointer); pointer = 0L; checkErrorCode(errorCode); } deserializer = null; deserializerBufferOrigin.discard(); exceptionBuffer = null; exceptionBufferOrigin.discard(); psetBufferC.discard(); psetBuffer = null; perFragmentStatsBufferC.discard(); perFragmentStatsBuffer = null; LOG.trace("Released Execution Engine."); }
Source:
<code><START> private long getSleepTime(int tries) { <END> if (INCREMENTAL_BACKOFF_MS == null) { return 0; } else { if (tries > INCREMENTAL_BACKOFF_MS.length) { return INCREMENTAL_BACKOFF_MS[INCREMENTAL_BACKOFF_MS.length - 1]; } else { return INCREMENTAL_BACKOFF_MS[tries - 1]; } } }</code><technical_language>this static</technical_language>

Target:
private static long getSleepTime(int tries) { if (INCREMENTAL_BACKOFF_MS == null) { return 0; } else { if (tries > INCREMENTAL_BACKOFF_MS.length) { return INCREMENTAL_BACKOFF_MS[INCREMENTAL_BACKOFF_MS.length - 1]; } else { return INCREMENTAL_BACKOFF_MS[tries - 1]; } } }
Source:
<code>private String detectContentType(FilePath file) throws InterruptedException, IOException { Tika tika = new Tika(); try (InputStream stream = file.read()) { <START> if (file.getName().endsWith(".js")) { <END> return "application/javascript"; } else { return tika.detect(stream, file.getName()); } } }</code><technical_language>Need consider file extension in upper case "JS"</technical_language>

Target:
private String detectContentType(FilePath file) throws InterruptedException, IOException { Tika tika = new Tika(); try (InputStream stream = file.read()) { if (file.getName().toLowerCase().endsWith(".js")) { return "application/javascript"; } else { return tika.detect(stream, file.getName()); } } }
Source:
<code>private void init() { inflate(getContext(), R.layout.view_description_edit_help, this); ButterKnife.bind(this); String helpStr = <START> ResourceUtil.readAssetFile(getContext(), <END> "description_edit_help.html"); helpText.setText(StringUtil.fromHtml(helpStr)); }</code><technical_language>Is a good idea do file I/O UI thread? I love componetized this HTML blob I in strings_no_translate.xml strings_view_description_edit_help.xml if want translated. said, I want translate strings a template string in strings_no_translate placeholders in strings.xml</technical_language>

Target:
private void init() { inflate(getContext(), R.layout.view_description_edit_help, this); ButterKnife.bind(this); helpText.setText(StringUtil.fromHtml(getContext().getString(R.string.description_edit_help_body))); }
Source:
<code>public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { String url = in.readUTF(); <START> System.out.println("Reading " + url); <END> ConnectionFactoryParser parser = new ConnectionFactoryParser(); ServerLocatorParser locatorParser = new ServerLocatorParser(); try { URI uri = new URI(url); serverLocator = locatorParser.newObject(uri, null); parser.populateObject(uri, this); } catch (Exception e) { e.printStackTrace(); throw new InvalidObjectException(e.getMessage()); } }</code><technical_language>removed</technical_language>

Target:
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { String url = in.readUTF(); ConnectionFactoryParser parser = new ConnectionFactoryParser(); ServerLocatorParser locatorParser = new ServerLocatorParser(); try { URI uri = new URI(url); serverLocator = locatorParser.newObject(uri, null); parser.populateObject(uri, this); } catch (Exception e) { InvalidObjectException ex = new InvalidObjectException(e.getMessage()); ex.initCause(e); throw ex; } }
Source:
<code>public ByteBufferSharing getUnwrappedBuffer() { <START> return shareBuffer(null); <END> }</code><technical_language>This method throw exception, return a ByteBufferSharing a null buffer</technical_language>

Target:
public ByteBufferSharing getUnwrappedBuffer() { return shareBuffer(EMPTY_BUFFER); }
Source:
<code>private static AccessToken makeToken(final Long accountId) { return new AccessToken.Builder() .withAccountId(accountId) .withCreatedAt(DateTime.now()) .withExpiresIn(DateTime.now().plusHours(1).getMillis()) .withRefreshToken(UUID.randomUUID()) .withToken(UUID.randomUUID()) <START> .withScopes(new OAuthScope[]{ OAuthScope.USER_BASIC, OAuthScope.USER_BASIC }) <END> .withAppId(1L) .build(); }</code><technical_language>identical scopes</technical_language>

Target:
private static AccessToken makeToken(final Long accountId) { return new AccessToken.Builder() .withAccountId(accountId) .withCreatedAt(DateTime.now()) .withExpiresIn(DateTime.now().plusHours(1).getMillis()) .withRefreshToken(UUID.randomUUID()) .withToken(UUID.randomUUID()) .withScopes(new OAuthScope[]{ OAuthScope.USER_BASIC }) .withAppId(1L) .build(); }
Source:
<code>public void testGetAdapter() throws PartInitException { outline.partClosed(outline); TestUtils.openEditor(testFile); MockLanguageServer.INSTANCE.setTimeToProceedQueries(500); <START> outline.partOpened(outline); <END> }</code><technical_language>This is time is spent. a system.currentTimeMillis() check long took</technical_language>

Target:
public void testGetAdapter() throws PartInitException { outline.partClosed(outline); TestUtils.openEditor(testFile); MockLanguageServer.INSTANCE.setTimeToProceedQueries(500); long beginOpenOutline = System.currentTimeMillis(); outline.partOpened(outline); long endOpenOutline = System.currentTimeMillis(); long durationOpenOutline = endOpenOutline - beginOpenOutline; Assert.assertTrue(String.format("Open outline took longer than 50ms: %d", durationOpenOutline), durationOpenOutline <= 50); DisplayHelper.sleep(Display.getCurrent(), 500); String pageClassName = outline.getCurrentPage().getClass().getPackage().getName(); Assert.assertTrue(pageClassName.contains("lsp4e")); }
Source:
<code>public void run(final int iteration) { LOG.log(Level.INFO, "Iteration Started"); final Map<Long, Document> workloadMap = memoryStore.getAll(); final List<Document> workload = new ArrayList<>(workloadMap.values()); final int numDocuments = workload.size(); int numSampledDocuments = 0; <START> for (int batchIdx = 0; batchIdx < numMiniBatchPerIter; batchIdx++) { <END> final int batchSize = numDocuments / numMiniBatchPerIter + ((numDocuments % numMiniBatchPerIter > batchIdx) ? 1 : 0); sampler.sample(workload.subList(numSampledDocuments, numSampledDocuments + batchSize)); numSampledDocuments += batchSize; LOG.log(Level.INFO, "{0}/{1} documents are sampled", new Object[]{numSampledDocuments, numDocuments}); } LOG.log(Level.INFO, "Start computing log likelihood"); final List<int[]> wordTopicCounts = parameterWorker.pull(vocabList); final int[] wordTopicCountsSummary = wordTopicCounts.remove(numVocabs); LOG.log(Level.INFO, "App metric log: {0}", buildAppMetrics(statCalculator.computeDocLLH(workload), statCalculator.computeWordLLH(wordTopicCounts, wordTopicCountsSummary))); LOG.log(Level.INFO, "Iteration Ended"); }</code><technical_language>Reminder: change code fix number of instances mini-batch in #824, is simple here</technical_language>

Target:
public void run(final int iteration) { LOG.log(Level.INFO, "Iteration Started"); final Map<Long, Document> workloadMap = memoryStore.getAll(); final List<Document> workload = new ArrayList<>(workloadMap.values()); final int numDocuments = workload.size(); int numSampledDocuments = 0; for (int batchIdx = 0; batchIdx < numMiniBatchPerIter; batchIdx++) { final int batchSize = numDocuments / numMiniBatchPerIter + ((numDocuments % numMiniBatchPerIter > batchIdx) ? 1 : 0); sampler.sample(workload.subList(numSampledDocuments, numSampledDocuments + batchSize)); numSampledDocuments += batchSize; LOG.log(Level.INFO, "{0} documents out of {1} have been sampled", new Object[]{numSampledDocuments, numDocuments}); } LOG.log(Level.INFO, "Start computing log likelihood"); final List<int[]> wordTopicCounts = parameterWorker.pull(vocabList); final int[] wordTopicCountsSummary = wordTopicCounts.remove(numVocabs); LOG.log(Level.INFO, "App metric log: {0}", buildAppMetrics(statCalculator.computeDocLLH(workload), statCalculator.computeWordLLH(wordTopicCounts, wordTopicCountsSummary))); LOG.log(Level.INFO, "Iteration Ended"); }
Source:
<code>public void testCreateSchemaWithConstraints() throws Exception { SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName(tname("ft2")); builder.setNamespaceURI(dataStore.getNamespaceURI()); builder.setCRS(CRS.decode("EPSG:4326")); builder.add(aname("geometry"), Geometry.class); builder.nillable(false).add(aname("intProperty"), Integer.class); builder.length(5).add(aname("stringProperty"), String.class); SimpleFeatureType featureType = builder.buildFeatureType(); dataStore.createSchema(featureType); SimpleFeatureType ft2 = dataStore.getSchema(tname("ft2")); FeatureWriter<SimpleFeatureType, SimpleFeature> w = dataStore.getFeatureWriter( tname("ft2"),Transaction.AUTO_COMMIT); w.hasNext(); SimpleFeature f = w.next(); f.setAttribute( 1, new Integer(0)); f.setAttribute( 2, "hello"); w.write(); <START> w.close(); <END> w = dataStore.getFeatureWriter( tname("ft2"),Transaction.AUTO_COMMIT); w.hasNext(); f = w.next(); f.setAttribute( 1, null ); try { w.write(); fail( "null value for intProperty should have failed"); } catch( Exception e ) { } f.setAttribute( 1, new Integer(1) ); f.setAttribute( 2, "hello!"); try { w.write(); fail( "string greather than 5 chars should have failed"); } catch( Exception e ) { } w.close(); }</code><technical_language>Ok, this is type of compatibilty change scares me. Due batching, writers closed else in transaction modifications, for some applications a serious problem (since need write a little, read a little, write some more), especially hard locate for upgrading (and people notably do read upgrade notes figure problems). This require a discussion in a larger group, want batching activated some flag, default</technical_language>

Target:
public void testCreateSchemaWithConstraints() throws Exception { SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName(tname("ft2")); builder.setNamespaceURI(dataStore.getNamespaceURI()); builder.setCRS(CRS.decode("EPSG:4326")); builder.add(aname("geometry"), Geometry.class); builder.nillable(false).add(aname("intProperty"), Integer.class); builder.length(5).add(aname("stringProperty"), String.class); SimpleFeatureType featureType = builder.buildFeatureType(); dataStore.createSchema(featureType); SimpleFeatureType ft2 = dataStore.getSchema(tname("ft2")); FeatureWriter<SimpleFeatureType, SimpleFeature> w = dataStore.getFeatureWriter( tname("ft2"),Transaction.AUTO_COMMIT); w.hasNext(); SimpleFeature f = w.next(); f.setAttribute( 1, new Integer(0)); f.setAttribute( 2, "hello"); w.write(); w.hasNext(); f = w.next(); f.setAttribute( 1, null ); try { w.write(); fail( "null value for intProperty should have failed"); } catch( Exception e ) { } f.setAttribute( 1, new Integer(1) ); f.setAttribute( 2, "hello!"); try { w.write(); fail( "string greather than 5 chars should have failed"); } catch( Exception e ) { } w.close(); }
Source:
<code>public Optional<Container> openInventory(Inventory inventory) throws IllegalArgumentException { if (((IMixinContainer) this.openContainer).isInUse()) { SpongeImpl.getLogger().warn("This player is currently modifying an open container. This action will be delayed."); Sponge.getScheduler().createTaskBuilder().delayTicks(0).execute(() -> { <START> this.closeInventory(); END> this.openInventory(inventory); }).submit(SpongeImpl.getPlugin()); return this.getOpenInventory(); } return Optional.ofNullable((Container) SpongeCommonEventFactory.displayContainer((EntityPlayerMP) (Object) this, inventory)); }</code><technical_language>perform stack modifications this is performed a tick later, more task redirected sponge causing closure opening of inventory</technical_language>

Target:
public Optional<Container> openInventory(Inventory inventory) throws IllegalArgumentException { if (((IMixinContainer) this.openContainer).isInUse()) { Cause cause = Sponge.getCauseStackManager().getCurrentCause(); SpongeImpl.getLogger().warn("This player is currently modifying an open container. This action will be delayed."); Sponge.getScheduler().createTaskBuilder().delayTicks(0).execute(() -> { try (StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) { cause.all().forEach(frame::pushCause); cause.getContext().asMap().forEach((key, value) -> frame.addContext(((EventContextKey) key), value)); this.closeInventory(); this.openInventory(inventory); } }).submit(SpongeImpl.getPlugin()); return this.getOpenInventory(); } return Optional.ofNullable((Container) SpongeCommonEventFactory.displayContainer((EntityPlayerMP) (Object) this, inventory)); }
Source:
<code>public void submoduleWithNoGitDirectory() throws Exception { Git git = new Git(db); writeTrashFile("file.txt", "content"); git.add().addFilepattern("file.txt").call(); final RevCommit id = git.commit().setMessage("create file").call(); final String path = "sub"; DirCache cache = db.lockDirCache(); DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); } }); editor.commit(); File submoduleRoot = new File(db.getWorkTree(), path); assertTrue(submoduleRoot.mkdir()); assertTrue(new File(submoduleRoot, Constants.DOT_GIT).mkdir()); TreeWalk walk = new TreeWalk(db); DirCacheIterator indexIter = new DirCacheIterator(db.readDirCache()); FileTreeIterator workTreeIter = new FileTreeIterator(db); walk.addTree(indexIter); walk.addTree(workTreeIter); walk.setFilter(PathFilter.create(path)); <START> FileUtils.delete(submoduleRoot, FileUtils.RECURSIVE); <END> assertTrue(walk.next()); assertFalse(indexIter.idEqual(workTreeIter)); }</code><technical_language>This delete necessary. created empty ".git" directory. is a valid Git repository. setMustExist(true) RepositoryBuilder, build() fail zeroid is returned, directory exists is empty</technical_language>

Target:
public void submoduleWithNoGitDirectory() throws Exception { Git git = new Git(db); writeTrashFile("file.txt", "content"); git.add().addFilepattern("file.txt").call(); final RevCommit id = git.commit().setMessage("create file").call(); final String path = "sub"; DirCache cache = db.lockDirCache(); DirCacheEditor editor = cache.editor(); editor.add(new PathEdit(path) { public void apply(DirCacheEntry ent) { ent.setFileMode(FileMode.GITLINK); ent.setObjectId(id); } }); editor.commit(); File submoduleRoot = new File(db.getWorkTree(), path); assertTrue(submoduleRoot.mkdir()); assertTrue(new File(submoduleRoot, Constants.DOT_GIT).mkdir()); TreeWalk walk = new TreeWalk(db); DirCacheIterator indexIter = new DirCacheIterator(db.readDirCache()); FileTreeIterator workTreeIter = new FileTreeIterator(db); walk.addTree(indexIter); walk.addTree(workTreeIter); walk.setFilter(PathFilter.create(path)); assertTrue(walk.next()); assertFalse(indexIter.idEqual(workTreeIter)); assertEquals(ObjectId.zeroId(), workTreeIter.getEntryObjectId()); }
Source:
<code><START> private boolean reportInternalServerErrorOverSideband() throws IOException { @SuppressWarnings("resource" ) SideBandOutputStream err = new SideBandOutputStream( SideBandOutputStream.CH_ERROR, SideBandOutputStream.SMALL_BUF, rawOut); err.write(Constants.encode(JGitText.get().internalServerError)); err.flush(); return true; } <END></code><technical_language>this method need return a boolean type, returns true</technical_language>

Target:
private void reportInternalServerErrorOverSideband() throws IOException { @SuppressWarnings("resource" ) SideBandOutputStream err = new SideBandOutputStream( SideBandOutputStream.CH_ERROR, SideBandOutputStream.SMALL_BUF, rawOut); err.write(Constants.encode(JGitText.get().internalServerError)); err.flush(); }
Source:
<code>protected void joinTestJobs() { try { progressService.busyCursorWhile( new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InterruptedException { Job.getJobManager().join(TestJob.FAMILY_TEST_JOB, monitor); } }); <START> } catch (InterruptedException | InvocationTargetException e) { <END> e.printStackTrace(); } }</code><technical_language>This example get more readable changing this one. format</technical_language>

Target:
protected void joinTestJobs() { try { progressService.busyCursorWhile( new IRunnableWithProgress() { @Override public void run(IProgressMonitor monitor) throws InterruptedException { Job.getJobManager().join(TestJob.FAMILY_TEST_JOB, monitor); } }); } catch (InterruptedException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } }
Source:
<code>public void onUserNotice(final UserNotice msg) { final String user = msg.getSource().getNick(); String[] ignoredUsers = configurationService.getString( IrcProperties.PROP_IRC_IGNORE,"") .split(","); for (String ignoredUser : ignoredUsers) { if (user.equalsIgnoreCase(ignoredUser.trim())) { LOGGER.info("Ignored incoming user notice from " + user); return; } <START> } <END> final Contact from = MessageManager.this.provider.getPersistentPresence() .findOrCreateContactByID(user); final MessageIrcImpl message = MessageIrcImpl.newNoticeFromIRC(from, msg.getText()); MessageManager.this.provider.getBasicInstantMessaging() .fireMessageReceived(message, from); }</code><technical_language>Please move equal code in onUserPrivMessage a separate method. Also, consider storing nicknames lowercase pre-trimmed, call ignoredUsers.contains(...)</technical_language>

Target:
public void onUserNotice(final UserNotice msg) { final String user = msg.getSource().getNick(); if(isUserIgnored(msg.getSource().getNick())) { return; } final Contact from = MessageManager.this.provider.getPersistentPresence() .findOrCreateContactByID(user); final MessageIrcImpl message = MessageIrcImpl.newNoticeFromIRC(from, msg.getText()); MessageManager.this.provider.getBasicInstantMessaging() .fireMessageReceived(message, from); }