auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object deserializeWithType(JsonParser jp, DeserializationContext cxt, TypeDeserializer tDeserializer) throws IOException { JsonNode currentJsonNode = mapper.readTree(jp); final Class<?> tClass = this.defaultDeserializer.handledType(); for (Class<?> c : TypeUtil.getAllClasses(tClass)) { if (c.isAssignableFrom(Object.class)) { continue; } else { final JsonTypeInfo typeInfo = c.getAnnotation(com.fasterxml.jackson.annotation.JsonTypeInfo.class); <START> if (typeInfo != null) { <END> String typeId = typeInfo.property(); if (containsDot(typeId)) { final String typeIdOnWire = unescapeEscapedDots(typeId); JsonNode typeIdValue = ((ObjectNode) currentJsonNode).remove(typeIdOnWire); if (typeIdValue != null) { ((ObjectNode) currentJsonNode).put(typeId, typeIdValue); } } } } } return tDeserializer.deserializeTypedFromAny(newJsonParserForNode(currentJsonNode), cxt); }</code><technical_language>this is in a for loop failing if checks inverted continue? flatten indentation level this easier read</technical_language>

Target:
public Object deserializeWithType(JsonParser jp, DeserializationContext cxt, TypeDeserializer tDeserializer) throws IOException { JsonNode currentJsonNode = mapper.readTree(jp); final Class<?> tClass = this.defaultDeserializer.handledType(); for (Class<?> c : TypeUtil.getAllClasses(tClass)) { final JsonTypeInfo typeInfo = c.getAnnotation(com.fasterxml.jackson.annotation.JsonTypeInfo.class); if (typeInfo != null) { String typeId = typeInfo.property(); if (containsDot(typeId)) { final String typeIdOnWire = unescapeEscapedDots(typeId); JsonNode typeIdValue = ((ObjectNode) currentJsonNode).remove(typeIdOnWire); if (typeIdValue != null) { ((ObjectNode) currentJsonNode).put(typeId, typeIdValue); } } } } return tDeserializer.deserializeTypedFromAny(newJsonParserForNode(currentJsonNode), cxt); }
Source:
<code>public void add(Storable storable) throws AlreadyExistsException { log.debug("Adding storable [{}]", storable); try { queryExecutor.insert(storable); } catch (StorageException ex) { if (ex.getCause() instanceof SQLIntegrityConstraintViolationException) { <START> throw new AlreadyExistsException("Another instance with same id = " + storable.getPrimaryKey() <END> + " exists with different value in namespace " + storable.getNameSpace() + ". Consider using addOrUpdate method if you always want to overwrite."); } throw ex; } }</code><technical_language><LINK_0> This is true insert is failing due violation for PK uniqueness, foreign key unique key. need query for existence while defining foreign key</technical_language>

Target:
public void add(Storable storable) throws AlreadyExistsException { log.debug("Adding storable [{}]", storable); queryExecutor.insert(storable); }
Source:
<code>public void fromJSON_getProjectId() throws IOException { MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); transportFactory.transport.addServiceAccount(SA_CLIENT_EMAIL, ACCESS_TOKEN); GenericJson json = writeServiceAccountJson( <START> SA_CLIENT_ID, <END> SA_CLIENT_EMAIL, SA_PRIVATE_KEY_PKCS8, SA_PRIVATE_KEY_ID, PROJECT_ID, null); ServiceAccountCredentials credentials = ServiceAccountCredentials.fromJson(json, transportFactory); assertEquals(PROJECT_ID, credentials.getProjectId()); }</code><technical_language>SA == SERVICE_ACCOUNT? avoid abbreviations</technical_language>

Target:
public void fromJSON_getProjectId() throws IOException { MockTokenServerTransportFactory transportFactory = new MockTokenServerTransportFactory(); transportFactory.transport.addServiceAccount(CLIENT_EMAIL, ACCESS_TOKEN); GenericJson json = writeServiceAccountJson( CLIENT_ID, CLIENT_EMAIL, PRIVATE_KEY_PKCS8, PRIVATE_KEY_ID, PROJECT_ID, null); ServiceAccountCredentials credentials = ServiceAccountCredentials.fromJson(json, transportFactory); assertEquals(PROJECT_ID, credentials.getProjectId()); }
Source:
<code>private void checkExecutableElement(ExecutableElement e, List<ExecutableElement> modelMethods, List<ExecutableElement> staticModelMethods) { Set<Modifier> modifiers = e.getModifiers(); if (e.getKind() == ElementKind.CONSTRUCTOR) { return; } if (!modifiers.contains(Modifier.STATIC)) { pluginEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Model spec objects should never be instantiated, so non-static methods are meaningless. " + "Did you mean to make this a static method?", e); return; } ModelMethod methodAnnotation = e.getAnnotation(ModelMethod.class); if (methodAnnotation == null) { if (modifiers.contains(Modifier.PUBLIC)) { staticModelMethods.add(e); } else if (!modifiers.contains(Modifier.PRIVATE)) { pluginEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "This method will not be added to the model definition. " + "Did you mean to annotate this method with @ModelMethod?", e); } } else { List<? extends VariableElement> params = e.getParameters(); if (params.size() == 0) { <START> modelSpec.logError("@ModelMethod methods must have an abstract model as their first argument", e); <END> } else { VariableElement firstParam = params.get(0); TypeMirror paramType = firstParam.asType(); if (!checkFirstArgType(paramType)) { modelSpec.logError("@ModelMethod methods must have either this model class or an appropriate model " + "superclass as their first argument", e); } else { modelMethods.add(e); } } } }</code><technical_language>I feel this message</technical_language>

Target:
private void checkExecutableElement(ExecutableElement e, List<ExecutableElement> modelMethods, List<ExecutableElement> staticModelMethods) { Set<Modifier> modifiers = e.getModifiers(); if (e.getKind() == ElementKind.CONSTRUCTOR) { return; } if (!modifiers.contains(Modifier.STATIC)) { pluginEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Model spec objects should never be instantiated, so non-static methods are meaningless. " + "Did you mean to make this a static method?", e); return; } ModelMethod methodAnnotation = e.getAnnotation(ModelMethod.class); if (methodAnnotation == null) { if (modifiers.contains(Modifier.PUBLIC)) { staticModelMethods.add(e); } else if (!modifiers.contains(Modifier.PRIVATE)) { pluginEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "This method will not be added to the model definition. " + "Did you mean to annotate this method with @ModelMethod?", e); } } else { List<? extends VariableElement> params = e.getParameters(); String firstArgError = "@ModelMethod methods must have either this model class or an appropriate model " + "superclass as their first argument"; if (params.size() == 0) { modelSpec.logError(firstArgError, e); } else { VariableElement firstParam = params.get(0); TypeMirror paramType = firstParam.asType(); if (!checkFirstArgType(paramType)) { modelSpec.logError(firstArgError, e); } else { modelMethods.add(e); } } } }
Source:
<code>public ValueMatcher makeMatcher(ValueMatcherFactory factory) { return factory.makeValueMatcher(dimension, new Predicate<String>() { <START> @Override public boolean apply(String input) <END> { return value.equals(fn.apply(Strings.emptyToNull(input))); } }); }</code><technical_language>u move @Override line</technical_language>

Target:
public ValueMatcher makeMatcher(ValueMatcherFactory factory) { return factory.makeValueMatcher( dimension, new Predicate<String>() { @Override public boolean apply(String input) { return value.equals(Strings.nullToEmpty(fn.apply(Strings.emptyToNull(input)))); } } ); }
Source:
<code>public ItemWire(String id) { <START> super(id); <END> }</code><technical_language>If add setHasSubtypes(true) types of wires stack</technical_language>

Target:
public ItemWire(String id) { super(id); setHasSubtypes(true); }
Source:
<code>public void clearOnNonRedundantPartitionRegionWithConcurrentPutGetRemoveShouldFailWhenNonCoordinatorMembersAreBounced( TestVM coordinatorVM) throws InterruptedException { final int entries = 7500; final int workSeconds = 45; parametrizedSetup(RegionShortcut.PARTITION); registerVMKillerAsCacheWriter(Collections.singletonList(server2)); populateRegion(accessor, entries, asList(accessor, server1, server2)); <START> List<AsyncInvocation<Void>> asyncInvocationList = Arrays.asList( <END> server1.invokeAsync(() -> executeGets(entries, workSeconds)), server1.invokeAsync(() -> executePuts(entries, workSeconds)), accessor.invokeAsync(() -> executeGets(entries, workSeconds)), accessor.invokeAsync(() -> executeRemoves(entries, workSeconds))); getVM(coordinatorVM.vmNumber).invoke(() -> { assertThatThrownBy(() -> cacheRule.getCache().getRegion(REGION_NAME).clear()) .isInstanceOf(PartitionedRegionPartialClearException.class) .hasMessage("Unable to clear all the buckets from the partitioned region " + REGION_NAME + ", either data (buckets) moved or member departed."); }); for (AsyncInvocation<Void> asyncInvocation : asyncInvocationList) { asyncInvocation.await(); } }</code><technical_language>PartialClearException happen 100% happen. assertion fail here</technical_language>

Target:
public void clearOnNonRedundantPartitionRegionWithConcurrentPutGetRemoveShouldFailWhenNonCoordinatorMembersAreBounced( TestVM coordinatorVM) throws InterruptedException { final int entries = 7500; final int workMillis = 30000; parametrizedSetup(RegionShortcut.PARTITION); populateRegion(accessor, entries, asList(accessor, server1, server2)); server2.invoke(() -> DistributionMessageObserver.setInstance(new MemberKiller(false))); List<AsyncInvocation<Void>> asyncInvocationList = Arrays.asList( server1.invokeAsync(() -> executeGets(entries, workMillis)), server1.invokeAsync(() -> executePuts(entries, workMillis)), accessor.invokeAsync(() -> executeGets(entries, workMillis)), accessor.invokeAsync(() -> executeRemoves(entries, workMillis))); getVM(coordinatorVM.vmNumber).invoke(() -> { assertThatThrownBy(() -> cacheRule.getCache().getRegion(REGION_NAME).clear()) .isInstanceOf(PartitionedRegionPartialClearException.class); }); for (AsyncInvocation<Void> asyncInvocation : asyncInvocationList) { asyncInvocation.await(); } }
Source:
<code>public void enableRecovery(@Observes @Initialized(ApplicationScoped.class) <START> Object init ) { <END> if (lraRecoveryModule == null) { lraRecoveryModule = new LRARecoveryModule(); lraRecoveryModule.getRecoveringLRAs(recoveringLRAs); RecoveryManager.manager().addModule(lraRecoveryModule); Implementations.install(); } RecoveryManager.manager().scan(); }</code><technical_language>do need call RecoveryManager.manager().scan()</technical_language>

Target:
void enableRecovery(@Observes @Initialized(ApplicationScoped.class) Object init) { assert lraRecoveryModule == null; System.out.printf("LRA recovery is enabled%n"); lraRecoveryModule = new LRARecoveryModule(this); RecoveryManager.manager().addModule(lraRecoveryModule); Implementations.install(); lraRecoveryModule.getRecoveringLRAs(recoveringLRAs); for (Transaction transaction : recoveringLRAs.values()) transaction.getRecoveryCoordinatorUrls(participants); }
Source:
<code>public void emptyLine() { String html = parseToHtml(" "); <START> assertEquals(html, ""); <END> }</code><technical_language>reverse order follows: assertEquals("",html)</technical_language>

Target:
public void emptyLine() { String html = parseToHtml(" "); assertEquals("", html); }
Source:
<code>protected void generateNode(BaseNodeMetaModel nodeMetaModel, CompilationUnit nodeCu, ClassOrInterfaceDeclaration nodeCoid) { nodeCu.addImport(CloneVisitor.class); MethodDeclaration cloneMethod = (MethodDeclaration) parseBodyDeclaration(f( "@Override public %s clone() { return (%s) this.accept(new CloneVisitor(), null); }", nodeMetaModel.getTypeNameGenerified(), nodeMetaModel.getTypeNameGenerified() )); <START> this.addOrReplaceWhenSameSignature(nodeCoid, cloneMethod); <END> }</code><technical_language>Whyyyy explicit this's? :-(</technical_language>

Target:
protected void generateNode(BaseNodeMetaModel nodeMetaModel, CompilationUnit nodeCu, ClassOrInterfaceDeclaration nodeCoid) { nodeCu.addImport(CloneVisitor.class); MethodDeclaration cloneMethod = (MethodDeclaration) parseBodyDeclaration(f( "@Override public %s clone() { return (%s) accept(new CloneVisitor(), null); }", nodeMetaModel.getTypeNameGenerified(), nodeMetaModel.getTypeNameGenerified() )); addOrReplaceWhenSameSignature(nodeCoid, cloneMethod); }
Source:
<code>public void initGui() { this.maxRows = this.getMaxRows(); final int magicNumber = ITEMSTACK_TOP_OFFSET + CPU_TOP_OFFSET; final int extraSpace = this.height - magicNumber; this.rows = (int) Math.floor( extraSpace / SECTION_HEIGHT ); if( this.rows > this.maxRows ) { this.rows = this.maxRows; } if( this.rows < 5 ) { this.rows = 5; } super.initGui(); this.setScrollBar(); this.ySize = magicNumber + this.rows * SECTION_HEIGHT; final int unusedSpace = this.height - this.ySize; this.guiTop = (int) Math.floor( unusedSpace / ( unusedSpace < 0 ? 3.8f : 2.0f ) ); int offset = this.guiTop + 8; <START> this.setScrollBar(); <END> this.start = new GuiButton( 0, this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20, GuiText.Start.getLocal() ); this.start.enabled = false; this.buttonList.add( this.start ); this.selectCPU = new GuiButton( 0, this.guiLeft + ( 219 - 180 ) / 2, this.guiTop + this.ySize - CPU_TOP_OFFSET, 180, 20, GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic ); this.selectCPU.enabled = false; this.buttonList.add( this.selectCPU ); if( this.OriginalGui != null ) { this.cancel = new GuiButton( 0, this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() ); } this.buttonList.add( this.cancel ); this.terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) ); this.buttonList.add( this.terminalStyleBox ); }</code><technical_language>call setScrollBar() twice? (L157)</technical_language>

Target:
public void initGui() { final int staticSpace = ITEMSTACK_TOP_OFFSET + CPU_TOP_OFFSET; calculateRows( staticSpace ); super.initGui(); this.ySize = staticSpace + this.rows * SECTION_HEIGHT; final int unusedSpace = this.height - this.ySize; this.guiTop = (int) Math.floor( unusedSpace / ( unusedSpace < 0 ? 3.8f : 2.0f ) ); int offset = this.guiTop + 8; this.setScrollBar(); this.start = new GuiButton( 0, this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20, GuiText.Start.getLocal() ); this.start.enabled = false; this.buttonList.add( this.start ); this.selectCPU = new GuiButton( 0, this.guiLeft + ( 219 - 180 ) / 2, this.guiTop + this.ySize - CPU_TOP_OFFSET, 180, 20, GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic ); this.selectCPU.enabled = false; this.buttonList.add( this.selectCPU ); if( this.OriginalGui != null ) { this.cancel = new GuiButton( 0, this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() ); } this.buttonList.add( this.cancel ); this.terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance().getConfigManager().getSetting( Settings.TERMINAL_STYLE ) ); this.buttonList.add( this.terminalStyleBox ); }
Source:
<code><START> public Constant(Sort sort, String value) { <END> super(sort, null); this.value = value; }</code><technical_language>comfortable this constructor. absolute ProductionReferences a non-null production</technical_language>

Target:
public Constant(Sort sort, String value) { super(sort, null); assert value != null; this.value = value; }
Source:
<code>public Map<String, String> getSettings() { <START> if (pluginRegistryUrl == null) { <END> return ImmutableMap.of( Constants.SUPPORTED_RECIPE_TYPES, Joiner.on(",").join(workspaceManager.getSupportedRecipes()), CHE_WORKSPACE_AUTO_START, Boolean.toString(cheWorkspaceAutoStart)); } else { return ImmutableMap.of( Constants.SUPPORTED_RECIPE_TYPES, Joiner.on(",").join(workspaceManager.getSupportedRecipes()), CHE_WORKSPACE_AUTO_START, Boolean.toString(cheWorkspaceAutoStart), CHE_WORKSPACE_PLUGIN_REGISTRY_ULR, pluginRegistryUrl); } }</code><technical_language>I rewrite this method Map builder. java Builder<String, String> settings = ImmutableMap.builder(); settings.put(Constants.SUPPORTED_RECIPE_TYPES, Joiner.on(",").join(workspaceManager.getSupportedRecipes())); settings.put(CHE_WORKSPACE_AUTO_START, Boolean.toString(cheWorkspaceAutoStart)); if (pluginRegistryUrl != null) { settings.put(CHE_WORKSPACE_PLUGIN_REGISTRY_ULR, pluginRegistryUrl); } return settings.build();</technical_language>

Target:
public Map<String, String> getSettings() { Builder<String, String> settings = ImmutableMap.builder(); settings.put( Constants.SUPPORTED_RECIPE_TYPES, Joiner.on(",").join(workspaceManager.getSupportedRecipes())); settings.put(CHE_WORKSPACE_AUTO_START, Boolean.toString(cheWorkspaceAutoStart)); if (pluginRegistryUrl != null) { settings.put(CHE_WORKSPACE_PLUGIN_REGISTRY_ULR, pluginRegistryUrl); } return settings.build(); }
Source:
<code>protected void processFiltered(File file, FileText fileText) { <START> final File dir = fileText.getFile().getParentFile(); <END> final boolean isDirChecked = !directoriesChecked.add(dir); if (!isDirChecked) { final File packageInfo = new File(dir, "package-info.java"); final File packageHtml = new File(dir, "package.html"); if (packageInfo.exists()) { if (packageHtml.exists()) { log(0, MSG_LEGACY_PACKAGE_HTML); } } else if (!allowLegacy || !packageHtml.exists()) { log(0, MSG_PACKAGE_INFO); } } }</code><technical_language>"protected void processFiltered(File file, FileText fileText)" is a signature Checks have. is call file.getParentFile(); NPE. this is a fix for a problem in general, is custom fix for custom Check. If is a fix , change api ? is a problem of collection + nuance file.getParentFile. Check need handle 8.2</technical_language>

Target:
protected void processFiltered(File file, FileText fileText) throws CheckstyleException { final File dir; try { dir = file.getCanonicalFile().getParentFile(); } catch (IOException ex) { throw new CheckstyleException( "Exception while getting canonical path to file " + file.getPath(), ex); } final boolean isDirChecked = !directoriesChecked.add(dir); if (!isDirChecked) { final File packageInfo = new File(dir, "package-info.java"); final File packageHtml = new File(dir, "package.html"); if (packageInfo.exists()) { if (packageHtml.exists()) { log(0, MSG_LEGACY_PACKAGE_HTML); } } else if (!allowLegacy || !packageHtml.exists()) { log(0, MSG_PACKAGE_INFO); } } }
Source:
<code><START> public static synchronized NotebookAuthorization init(ZeppelinConfiguration config) { <END> if (instance == null) { instance = new NotebookAuthorization(); conf = config; filePath = conf.getNotebookAuthorizationPath(); GsonBuilder builder = new GsonBuilder(); builder.setPrettyPrinting(); gson = builder.create(); try { loadFromFile(); } catch (IOException e) { LOG.error("Error loading NotebookAuthorization", e); } } return instance; }</code><technical_language>for a change this a JIRA track change</technical_language>

Target:
public static NotebookAuthorization init(ZeppelinConfiguration config) { if (instance == null) { instance = new NotebookAuthorization(); conf = config; filePath = conf.getNotebookAuthorizationPath(); GsonBuilder builder = new GsonBuilder(); builder.setPrettyPrinting(); gson = builder.create(); try { loadFromFile(); } catch (IOException e) { LOG.error("Error loading NotebookAuthorization", e); } } return instance; }
Source:
<code>public IBuildServer getServer() { <START> if (parent != null) { <END> return parent.getServer(); } if (server != null && ((EObject) server).eIsProxy()) { InternalEObject oldServer = (InternalEObject) server; server = (IBuildServer) eResolveProxy(oldServer); if (server != oldServer) { if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.RESOLVE, BuildPackage.BUILD_PLAN__SERVER, oldServer, server)); } } } return server; }</code><technical_language>modify @generated methods. I need this based in merge()</technical_language>

Target:
public IBuildServer getServer() { if (server != null && ((EObject) server).eIsProxy()) { InternalEObject oldServer = (InternalEObject) server; server = (IBuildServer) eResolveProxy(oldServer); if (server != oldServer) { if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.RESOLVE, BuildPackage.BUILD_PLAN__SERVER, oldServer, server)); } } } return server; }
Source:
<code>public ElasticTimeOutStrategy(String timeoutPercentage, String timeoutMinutesElasticDefault, String numberOfBuilds) { this.timeoutPercentage = timeoutPercentage; this.timeoutMinutesElasticDefault = timeoutMinutesElasticDefault; <START> this.numberOfBuilds = numberOfBuilds; <END> }</code><technical_language>Please call new constructor passing dafault failSafeTimeoutDuration. want do clear</technical_language>

Target:
public ElasticTimeOutStrategy(String timeoutPercentage, String timeoutMinutesElasticDefault, String numberOfBuilds) { this(timeoutPercentage, timeoutMinutesElasticDefault, numberOfBuilds, false); }
Source:
<code>public void test_execute_and_closeListener () { AtomicBoolean hasClosed = new AtomicBoolean(false); browser.setText("You should not see this page, it should have been closed by javascript"); browser.addCloseWindowListener(e -> { hasClosed.set(true); }); browser.execute("window.close()"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (hasClosed.get()) { disposedIntentionally = true; return; } } <START> System.out.println("not passed."); <END> fail("Either browser.execute() did not work (if you still see the html page) or closeListener Was not triggered if " + "browser looks disposed, but test still fails."); }</code><technical_language>Please do sysout in a test</technical_language>

Target:
public void test_execute_and_closeListener () { AtomicBoolean hasClosed = new AtomicBoolean(false); browser.setText("You should not see this page, it should have been closed by javascript"); browser.addCloseWindowListener(e -> { hasClosed.set(true); }); browser.execute("window.close()"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (hasClosed.get()) { disposedIntentionally = true; return; } } fail("Either browser.execute() did not work (if you still see the html page) or closeListener Was not triggered if " + "browser looks disposed, but test still fails."); }
Source:
<code>public String getIpv4DefaultGateway() { <START> String dest = "0.0.0.0/0"; <END> return getNextHop(dest); }</code><technical_language>Put this (and other similar PR) string a constant top of file</technical_language>

Target:
public String getIpv4DefaultGateway() { return getNextHop(IPV4_DEFAULT_DEST); }
Source:
<code>private void parse8(int nameStart, int valueStart, int valueEnd) { if (header.regionMatches(true, nameStart, CookieHeaderNames.HTTPONLY, 0, 8)) { httpOnly = true; } else if (header.regionMatches(true, nameStart, CookieHeaderNames.SAMESITE, 0, 8)) { String sameSiteValue = computeValue(valueStart, valueEnd); try { sameSite = SameSite.of(sameSiteValue); } catch (IllegalArgumentException e) { <START> if (logger.isDebugEnabled()) { <END> logger.debug("Skipping SameSite attribute because value '{}' is invalid", sameSiteValue); } } } }</code><technical_language>Useless. purpose of test avoid message resolution (eg String concatenation) logging level is disabled. resolution interpolation. Please remove</technical_language>

Target:
private void parse8(int nameStart, int valueStart, int valueEnd) { if (header.regionMatches(true, nameStart, CookieHeaderNames.HTTPONLY, 0, 8)) { httpOnly = true; } else if (header.regionMatches(true, nameStart, CookieHeaderNames.SAMESITE, 0, 8)) { sameSite = SameSite.of(computeValue(valueStart, valueEnd)); } }
Source:
<code>public CommandResult<V> allow(final C context, final Command<C, V> command) { if (null != getDelegate()) { final CommandResult<V> r = getDelegate().allow(context, command); postAllow(context, command, r); <START> return r; <END> } return null; }</code><technical_language>Minor thing, please result instead of r</technical_language>

Target:
public CommandResult<V> allow(final C context, final Command<C, V> command) { if (null != getDelegate()) { preAllow(context, command); final CommandResult<V> result = getDelegate().allow(context, command); postAllow(context, command, result); return result; } return null; }
Source:
<code>ElasticsearchTableDescriptionSupplier(ElasticsearchConnectorConfig config, JsonCodec<ElasticsearchTableDescription> codec) { <START> this.codec = requireNonNull(codec, "codec is null"); <END> this.config = requireNonNull(config, "config is null"); }</code><technical_language>nit: move config constructor parameter</technical_language>

Target:
ElasticsearchTableDescriptionSupplier(ElasticsearchConnectorConfig config, JsonCodec<ElasticsearchTableDescription> codec) { this.config = requireNonNull(config, "config is null"); this.codec = requireNonNull(codec, "codec is null"); }
Source:
<code>public void createReportDirectory() { File dir = new File(directory); if (dir.exists() && !dir.isDirectory()) { throw new IllegalArgumentException(dir.getAbsolutePath() + " is not a directory"); <START> } else if (!dir.exists()) { <END> dir.mkdirs(); } }</code><technical_language>check is necessary, File.mkdirs attempt create directory exists</technical_language>

Target:
public void createReportDirectory() { File dir = new File(directory); dir.mkdirs(); }
Source:
<code>public void updateTiles(IAECluster cl, World w, WorldCoord min, WorldCoord max) { byte num = 0; byte ringNum = 0; QuantumCluster c = (QuantumCluster) cl; for (int x = min.x; x <= max.x; x++) { for (int y = min.y; y <= max.y; y++) { for (int z = min.z; z <= max.z; z++) { TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z ); byte flags = 0; num++; if ( num == 5 ) { <START> flags = (num); <END> c.setCenter( te ); } else { if ( num == 1 || num == 3 || num == 7 || num == 9 ) flags = (byte) (tqb.corner | num); else flags = (num); c.Ring[ringNum++] = te; } te.updateStatus( c, flags, true ); } } } }</code><technical_language>Remove parentheses here</technical_language>

Target:
public void updateTiles(IAECluster cl, World w, WorldCoord min, WorldCoord max) { byte num = 0; byte ringNum = 0; QuantumCluster c = (QuantumCluster) cl; for (int x = min.x; x <= max.x; x++) { for (int y = min.y; y <= max.y; y++) { for (int z = min.z; z <= max.z; z++) { TileQuantumBridge te = (TileQuantumBridge) w.getTileEntity( x, y, z ); byte flags = 0; num++; if ( num == 5 ) { flags = num; c.setCenter( te ); } else { if ( num == 1 || num == 3 || num == 7 || num == 9 ) flags = (byte) (tqb.corner | num); else flags = num; c.Ring[ringNum++] = te; } te.updateStatus( c, flags, true ); } } } }
Source:
<code>public boolean isWakeupEvent(ITmfEvent event) { String eventName = event.getName(); ITmfTrace trace = event.getTrace(); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(event.getTrace()); String wakeupEventName = NonNullUtils.nullToEmptyString(fWakeupEventMap.get(trace)); if (eventLayout instanceof LttngEventLayout) { LttngEventLayout layoutDefault = (LttngEventLayout) eventLayout; if (wakeupEventName.equals(layoutDefault.eventSchedProcessTTWU())) { return eventName.equals(layoutDefault.eventSchedProcessTTWU()); } } if (eventLayout instanceof Lttng28EventLayout) { Lttng28EventLayout layout28 = (Lttng28EventLayout) eventLayout; if (wakeupEventName.equals(layout28.eventSchedProcessWaking())) { return (eventName.equals(layout28.eventSchedProcessWaking()) || <START> eventName.equals(layout28.eventSchedProcessWakeupNew())); <END> } } return false; }</code><technical_language>sure, ||'ing eventSchedProcessWak*ing*() eventSchedProcessWake*up*New(). Is this correct? need eventSchedProcessWakeup() all</technical_language>

Target:
public boolean isWakeupEvent(ITmfEvent event) { String eventName = event.getName(); ITmfTrace trace = event.getTrace(); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(event.getTrace()); String wakeupEventName = NonNullUtils.nullToEmptyString(fWakeupEventMap.get(trace)); if (eventLayout instanceof LttngEventLayout) { LttngEventLayout layoutDefault = (LttngEventLayout) eventLayout; if (wakeupEventName.equals(layoutDefault.eventSchedProcessTTWU())) { return eventName.equals(layoutDefault.eventSchedProcessTTWU()); } } if (eventLayout instanceof Lttng28EventLayout) { Lttng28EventLayout layout28 = (Lttng28EventLayout) eventLayout; if (wakeupEventName.equals(layout28.eventSchedProcessWaking())) { return (eventName.equals(layout28.eventSchedProcessWaking()) || eventName.equals(layout28.eventSchedProcessWakeupNew())); } } if (eventLayout instanceof LttngEventLayout) { LttngEventLayout layoutDefault = (LttngEventLayout) eventLayout; if (wakeupEventName.equals(layoutDefault.eventSchedProcessWakeup())) { return (eventName.equals(layoutDefault.eventSchedProcessWakeup()) || eventName.equals(layoutDefault.eventSchedProcessWakeupNew())); } } return false; }
Source:
<code>public static Double digestToTruncatedMean(QuantileDigest digest, List<Long> bounds, QuantileDigest.MiddleFunction middleFunction) { if (bounds.get(0).equals(bounds.get(1))) { return null; } <START> else { <END> return digest.getHistogram(bounds, middleFunction).get(1).getMean(); } }</code><technical_language>I remove else return</technical_language>

Target:
public static Double digestToTruncatedMean(QuantileDigest digest, List<Long> bounds, QuantileDigest.MiddleFunction middleFunction) { if (bounds.get(0).equals(bounds.get(1))) { return null; } return digest.getHistogram(bounds, middleFunction).get(1).getMean(); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log_OC.d(TAG, "onCreateView"); View rootView = inflater.inflate(R.layout.sso_dialog, container, false); <START> WebView ssoWebView = (WebView) rootView.findViewById(R.id.sso_webview); <END> mWebViewClient.setTargetUrl(mTargetUrl); ssoWebView.setWebViewClient(mWebViewClient); if (savedInstanceState == null) { Log_OC.d(TAG, " initWebView start"); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setAcceptCookie(true); cookieManager.removeAllCookie(); ssoWebView.loadUrl(mInitialUrl); } else { Log_OC.d(TAG, " restoreWebView start"); WebBackForwardList history = ssoWebView.restoreState(savedInstanceState.getBundle(KEY_WEBVIEW_STATE)); if (history == null) { Log_OC.e(TAG, "Error restoring WebView state ; back to starting URL"); ssoWebView.loadUrl(mInitialUrl); } } WebSettings webSettings = ssoWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setBuiltInZoomControls(true); webSettings.setLoadWithOverviewMode(false); webSettings.setSavePassword(false); webSettings.setUserAgentString(WebdavClient.USER_AGENT); webSettings.setSaveFormData(false); return rootView; }</code><technical_language>I is define ssoWebView member of class mSsoWebView, read easier code</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log_OC.d(TAG, "onCreateView"); View rootView = inflater.inflate(R.layout.sso_dialog, container, false); mSsoWebView = (WebView) rootView.findViewById(R.id.sso_webview); mWebViewClient.setTargetUrl(mTargetUrl); mSsoWebView.setWebViewClient(mWebViewClient); if (savedInstanceState == null) { Log_OC.d(TAG, " initWebView start"); CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setAcceptCookie(true); cookieManager.removeAllCookie(); mSsoWebView.loadUrl(mInitialUrl); } else { Log_OC.d(TAG, " restoreWebView start"); WebBackForwardList history = mSsoWebView.restoreState(savedInstanceState.getBundle(KEY_WEBVIEW_STATE)); if (history == null) { Log_OC.e(TAG, "Error restoring WebView state ; back to starting URL"); mSsoWebView.loadUrl(mInitialUrl); } } WebSettings webSettings = mSsoWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setBuiltInZoomControls(true); webSettings.setLoadWithOverviewMode(false); webSettings.setSavePassword(false); webSettings.setUserAgentString(WebdavClient.USER_AGENT); webSettings.setSaveFormData(false); return rootView; }
Source:
<code>public void deleteEntry(Name dn) throws InternalErrorException { <START> List<Name> subentries = ldapTemplate.search(query() <END> .base(dn) .where("objectclass").like("*"), getNameMapper()); for(Name entrydn : subentries) { ldapTemplate.unbind(entrydn); } super.deleteEntry(dn); }</code><technical_language>This search returns base itself, deleted. search() method SearchScope simply check returned Name orignal dn param skip in cycle below</technical_language>

Target:
public void deleteEntry(Name dn) throws InternalErrorException { List<Name> subentries = ldapTemplate.search(query() .base(dn) .where("objectclass").not().is(PerunAttribute.PerunAttributeNames.objectClassPerunVO), getNameMapper()); for(Name entrydn : subentries) { ldapTemplate.unbind(entrydn); } super.deleteEntry(dn); }
Source:
<code>private void checkRegistryIsAvailable() throws IOException { <START> if (!probeUrl("http://" + registry) && !probeUrl("https://" + registry)) { <END> LOG.warn("Docker registry " + registry + " is not available, " + "which means that you won't be able to save snapshots of your workspaces." + "\nHow to configure registry?" + "\n\tLocal registry -> <LINK_0>" + "\n\tRemote registry -> set up 'docker.registry.auth.*' properties"); } }</code><technical_language>ad protocol url</technical_language>

Target:
private void checkRegistryIsAvailable() throws IOException { LOG.info("Probing registry '{}'", registryUrl); final HttpURLConnection conn = (HttpURLConnection) new URL(registryUrl).openConnection(); conn.setConnectTimeout(30 * 1000); try { final int responseCode = conn.getResponseCode(); LOG.info("Probe of registry '{}' succeed with HTTP response code '{}'", registryUrl, responseCode); } catch (IOException ioEx) { LOG.warn("Docker registry " + registryUrl + " is not available, " + "which means that you won't be able to save snapshots of your workspaces." + "\nHow to configure registry?" + "\n\tLocal registry -> <LINK_0>" + "\n\tRemote registry -> set up 'docker.registry.auth.*' properties"); } finally { conn.disconnect(); } }
Source:
<code>public void test1DelayedAction() { ArbritaryDelayActionComponent a1 = new ArbritaryDelayActionComponent(); a1.value = 3; vals = new ArrayList<Integer>(Arrays.asList(3)); long currentTime = time.getGameTimeInMs(); <START> delayedActionSystem.addDelayedAction(createFakeEntityWith(a1), <END> "Blah Blah", ((currentTime + 1000) - currentTime)); nextFakeEntityId++; }</code><technical_language>I need a line break here. 120ish chars is OK</technical_language>

Target:
public void test1DelayedAction() { ArbritaryDelayActionComponent a1 = new ArbritaryDelayActionComponent(); a1.value = 3; vals = new ArrayList<Integer>(Arrays.asList(3)); delayedActionSystem.addDelayedAction(createFakeEntityWith(a1), "Blah Blah", ((time.getGameTimeInMs() + 1000) - time.getGameTimeInMs())); nextFakeEntityId++; }
Source:
<code>public void bindStatement() throws StandardException { int columnCount; td = getTableDescriptor(tableName); verifyAndGetUniqueNames(); columnCount = involvedColumnNames.length; boundColumnIDs = new int[ columnCount ]; for (int i = 0; i < columnCount; i++) { ColumnDescriptor columnDescriptor; columnDescriptor = td.getColumnDescriptor(involvedColumnNames[i]); if (columnDescriptor == null) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, involvedColumnNames[i], tableName); } boundColumnIDs[ i ] = columnDescriptor.getPosition(); uniqueWithDuplicateNulls = (! uniqueWithDuplicateNulls && (unique && ! columnDescriptor.hasNonNullDefault())); if ( ! columnDescriptor.getType().getTypeId().orderable(getClassFactory())) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_ORDERABLE_DURING_EXECUTION, columnDescriptor.getType().getTypeId().getSQLTypeName()); } } if (onExpression) { bindIndexExpressions(); <START> generateExecutableIndexExpression(); <END> } getCompilerContext().createDependency(td); }</code><technical_language>more put generateExecutableIndexExpression() in makeConstantAction() code generation phase</technical_language>

Target:
public void bindStatement() throws StandardException { int columnCount; td = getTableDescriptor(tableName); verifyAndGetUniqueNames(); columnCount = involvedColumnNames.length; boundColumnIDs = new int[ columnCount ]; for (int i = 0; i < columnCount; i++) { ColumnDescriptor columnDescriptor; columnDescriptor = td.getColumnDescriptor(involvedColumnNames[i]); if (columnDescriptor == null) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, involvedColumnNames[i], tableName); } boundColumnIDs[ i ] = columnDescriptor.getPosition(); uniqueWithDuplicateNulls = (! uniqueWithDuplicateNulls && (unique && ! columnDescriptor.hasNonNullDefault())); if ( ! columnDescriptor.getType().getTypeId().orderable(getClassFactory())) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_ORDERABLE_DURING_EXECUTION, columnDescriptor.getType().getTypeId().getSQLTypeName()); } } if (onExpression) { bindIndexExpressions(); } getCompilerContext().createDependency(td); }
Source:
<code>protected AbstractTreeIterator mergeBase() throws IOException { if (baseTree != null) return openTree(baseTree); <START> RevCommit baseCommit = getBaseCommit(sourceCommits[0], sourceCommits[1]); <END> if (baseCommit == null) { baseCommitId = null; return new EmptyTreeIterator(); } else { baseCommitId = baseCommit.toObjectId(); return openTree(baseCommit.getTree()); } }</code><technical_language>I of cached baseCommitID. replacing previous line by: RevCommit baseCommit = (baseCommitId != null) ? walk.parseCommit(baseCommitId) : getBaseCommit(sourceCommits[0],sourceCommits[1]);</technical_language>

Target:
protected AbstractTreeIterator mergeBase() throws IOException { if (baseTree != null) return openTree(baseTree); RevCommit baseCommit = (baseCommitId != null) ? walk .parseCommit(baseCommitId) : getBaseCommit(sourceCommits[0], sourceCommits[1]); if (baseCommit == null) { baseCommitId = null; return new EmptyTreeIterator(); } else { baseCommitId = baseCommit.toObjectId(); return openTree(baseCommit.getTree()); } }
Source:
<code>public boolean onOptionsItemSelected(final MenuItem item) { <START> switch (item.getItemId()) { <END> case android.R.id.home: finish(); return true; } return false; }</code><technical_language>transformed if statement</technical_language>

Target:
public boolean onOptionsItemSelected(final MenuItem item) { if (item.getItemId() == android.R.id.home) { finish(); return true; } return false; }
Source:
<code>public void setMaxDuplicateSetSize(final long maxDuplicateSetSize) { <START> if (maxDuplicateSetSize < 1) <END> this.maxDuplicateSetSize = Long.MAX_VALUE; this.maxDuplicateSetSize = maxDuplicateSetSize; }</code><technical_language>Add { } if body, line 113 below</technical_language>

Target:
public void setMaxDuplicateSetSize(final long maxDuplicateSetSize) { if (maxDuplicateSetSize < 1) { this.maxDuplicateSetSize = Long.MAX_VALUE; } this.maxDuplicateSetSize = maxDuplicateSetSize; }
Source:
<code>public void testAllDomainsExistAndActiveOneInactive() { domain1.setStatus(StorageDomainStatus.Active); domain2.setStatus(StorageDomainStatus.InActive); ValidationResult result = validator.allDomainsExistAndActive(); <START> assertFalse("Both domains should not be active", result.isValid()); <END> assertEquals("Wrong validation error", VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL, result.getMessage()); }</code><technical_language>consider change message indicate, domain active (instead domains)</technical_language>

Target:
public void testAllDomainsExistAndActiveOneInactive() { domain1.setStatus(StorageDomainStatus.Active); domain2.setStatus(StorageDomainStatus.InActive); ValidationResult result = validator.allDomainsExistAndActive(); assertFalse("One domain should not be active", result.isValid()); assertEquals("Wrong validation error", VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL, result.getMessage()); }
Source:
<code>public void setPolicy(String path, AccessControlPolicy policy) throws PathNotFoundException, AccessControlException, AccessDeniedException, LockException, VersionException, RepositoryException { if (session.isReadOnly()) { throw new AccessDeniedException("Session is ready only"); } if (!hasPrivileges(path, new Privilege[]{privileges.forName(Privilege.JCR_MODIFY_ACCESS_CONTROL)})) { throw new AccessDeniedException(); } if (!(policy instanceof AccessControlList)) { throw new AccessControlException(""); } JcrAccessControlList acl = (JcrAccessControlList) policy; <START> AbstractJcrNode node = (AbstractJcrNode) session.getNode(path, true); <END> node.addMixin(NT_ACCESS_CONTROLLABLE, false); AbstractJcrNode aclNode = (AbstractJcrNode) (node.hasNode(ACCESS_LIST_NODE) ? node.getNode(ACCESS_LIST_NODE) : node.addAclNode(ACCESS_LIST_NODE, NT_ACCESS_LIST_NODE)); for (AccessControlEntry ace : acl.getAccessControlEntries()) { assert (ace.getPrincipal() != null); String name = ace.getPrincipal().getName(); AbstractJcrNode entryNode = aclNode.hasNode(name) ? aclNode.getNode(name) : aclNode.addAclNode(name, NT_ACCESS_LIST_ENTRY_NODE); entryNode.setPropertyInAccessControlScope(PRINCIPAL_NAME, ace.getPrincipal().getName()); entryNode.setPropertyInAccessControlScope(PRIVILEGES, privileges(ace.getPrivileges())); } NodeIterator it = aclNode.getNodes(); while (it.hasNext()) { Node entryNode = it.nextNode(); String name = entryNode.getProperty(PRINCIPAL_NAME).getString(); if (!acl.hasEntry(name)) { entryNode.remove(); } } }</code><technical_language>Cast is necessary</technical_language>

Target:
public void setPolicy(String path, AccessControlPolicy policy) throws PathNotFoundException, AccessControlException, AccessDeniedException, LockException, VersionException, RepositoryException { if (session.isReadOnly()) { throw new AccessDeniedException(JcrI18n.permissionDenied.text(path, "read AC content")); } if (!hasPrivileges(path, new Privilege[]{privileges.forName(Privilege.JCR_MODIFY_ACCESS_CONTROL)})) { throw new AccessDeniedException(); } if (!(policy instanceof AccessControlList)) { throw new AccessControlException(""); } JcrAccessControlList acl = (JcrAccessControlList) policy; AbstractJcrNode node = session.getNode(path, true); node.addMixin(NT_ACCESS_CONTROLLABLE, false); AbstractJcrNode aclNode = (AbstractJcrNode) (node.hasNode(ACCESS_LIST_NODE) ? node.getNode(ACCESS_LIST_NODE) : node.addAclNode(ACCESS_LIST_NODE, NT_ACCESS_LIST_NODE)); for (AccessControlEntry ace : acl.getAccessControlEntries()) { assert (ace.getPrincipal() != null); String name = ace.getPrincipal().getName(); AbstractJcrNode entryNode = aclNode.hasNode(name) ? aclNode.getNode(name) : aclNode.addAclNode(name, NT_ACCESS_LIST_ENTRY_NODE); entryNode.setPropertyInAccessControlScope(PRINCIPAL_NAME, ace.getPrincipal().getName()); entryNode.setPropertyInAccessControlScope(PRIVILEGES, privileges(ace.getPrivileges())); } NodeIterator it = aclNode.getNodes(); while (it.hasNext()) { Node entryNode = it.nextNode(); String name = entryNode.getProperty(PRINCIPAL_NAME).getString(); if (!acl.hasEntry(name)) { entryNode.remove(); } } }
Source:
<code>protected Configuration createConfiguration() { Configuration conf = super.createConfiguration(); boolean scaleCapacityLimitEnabled = conf.getBoolean("fs.s3a.s3guard.ddb.table.scale.capacity.limit", true); if(scaleCapacityLimitEnabled) { LOG.info("Enable the capacity limit : -> {}, -> {}", S3GUARD_DDB_TABLE_CAPACITY_READ_KEY, 1, S3GUARD_DDB_TABLE_CAPACITY_WRITE_KEY,1); conf.set(S3GUARD_DDB_TABLE_CAPACITY_READ_KEY, "1"); conf.set(S3GUARD_DDB_TABLE_CAPACITY_WRITE_KEY, "1"); } <START> if(scaleCapacityLimitEnabled) { <END> assertEquals("The Read Capacity limit should be 1",1,conf.getInt(S3GUARD_DDB_TABLE_CAPACITY_READ_KEY,0)); assertEquals("The Write Capacity limit should be 1",1,conf.getInt(S3GUARD_DDB_TABLE_CAPACITY_WRITE_KEY,0)); } return conf; }</code><technical_language>need -they show much. thread creates a table asking for bucket metadata working out capacity there. happy worry that...All prefer is run bills test tables deleted</technical_language>

Target:
protected Configuration createConfiguration() { Configuration conf = super.createConfiguration(); conf.setInt(S3GUARD_DDB_TABLE_CAPACITY_READ_KEY, 0); conf.setInt(S3GUARD_DDB_TABLE_CAPACITY_WRITE_KEY, 0); return conf; }
Source:
<code>public void testListFloatingIPPools() throws Exception { <START> for (String zoneId : api.getConfiguredRegions()) { <END> Optional<? extends FloatingIPPoolApi> apiOption = api.getFloatingIPPoolApi(zoneId); if (!apiOption.isPresent()) continue; FloatingIPPoolApi api = apiOption.get(); FluentIterable<? extends FloatingIPPool> response = api.list(); assertTrue(null != response); Set<? extends FloatingIPPool> set = response.toSet(); assertTrue(!set.isEmpty()); } }</code><technical_language>This simply a pattern other tests, in case fine this, sense test property [regions](<LINK_0> here? way, users limit live test a specific region if desired. /cc @zack-shoylev @jdaggett @everett-toews</technical_language>

Target:
public void testListFloatingIPPools() throws Exception { Optional<? extends FloatingIPPoolApi> apiOption = api.getFloatingIPPoolApi(Iterables.getFirst(regions, null)); if (!apiOption.isPresent()) { return; } FloatingIPPoolApi api = apiOption.get(); FluentIterable<? extends FloatingIPPool> response = api.list(); assertTrue(null != response); Set<? extends FloatingIPPool> set = response.toSet(); assertTrue(!set.isEmpty()); }
Source:
<code>private AddressProvider createAddressProvider(ClientConfig config) { boolean discoveryEnabled = new HazelcastProperties(config.getProperties()) .getBoolean(ClientProperty.DISCOVERY_SPI_ENABLED); <START> AwsConfig awsConfig = config.getNetworkConfig().getAwsConfig(); <END> List<String> userConfiguredAddresses = config.getNetworkConfig().getAddresses(); boolean isAtLeastAProviderConfigured = discoveryEnabled || (awsConfig != null && awsConfig.isEnabled()) || !userConfiguredAddresses.isEmpty(); if (isAtLeastAProviderConfigured) { return null; } return new AddressProvider() { @Override public Addresses loadAddresses() { Addresses possibleAddresses = new Addresses(); for (Address address : getKnownAddresses()) { Addresses addresses = AddressHelper.getPossibleSocketAddresses(address.getPort(), address.getHost(), 1); possibleAddresses.addAll(addresses); } return possibleAddresses; } @Override public Address translate(Address address) { return address; } }; }</code><technical_language>This is suspicious, I guess need now</technical_language>

Target:
private AddressProvider createAddressProvider(ClientConfig config) { boolean discoveryEnabled = new HazelcastProperties(config.getProperties()) .getBoolean(ClientProperty.DISCOVERY_SPI_ENABLED); List<DiscoveryStrategyConfig> aliasedDiscoveryConfigs = ClientAliasedDiscoveryConfigUtils.createDiscoveryStrategyConfigs(config); List<String> userConfiguredAddresses = config.getNetworkConfig().getAddresses(); boolean isAtLeastAProviderConfigured = discoveryEnabled || !aliasedDiscoveryConfigs.isEmpty() || !userConfiguredAddresses.isEmpty(); if (isAtLeastAProviderConfigured) { return null; } return new AddressProvider() { @Override public Addresses loadAddresses() { Addresses possibleAddresses = new Addresses(); for (Address address : getKnownAddresses()) { Addresses addresses = AddressHelper.getPossibleSocketAddresses(address.getPort(), address.getHost(), 1); possibleAddresses.addAll(addresses); } return possibleAddresses; } @Override public Address translate(Address address) { return address; } }; }
Source:
<code>public void email(final String email) throws IOException { <START> final String pattern = "[a-z_\\.@\\-A-Z0-9]"; <END> if (!email.matches(String.format("%s+", pattern)) && !email.matches(String.format("%s*!%s+", pattern, pattern))) { throw new Alias.InvalidEmailException(email); } this.item.put( new AttributeUpdates().with(DyAliases.ATTR_EMAIL, email) ); Logger.info(this, "@%s changed email to %s", this.name(), email); }</code><technical_language>@bdragan performance-wise I compile regex in a constant..</technical_language>

Target:
public void email(final String email) throws IOException { if (!MAIL.matcher(email).matches()) { throw new Alias.InvalidEmailException(email); } this.item.put( new AttributeUpdates().with(DyAliases.ATTR_EMAIL, email) ); Logger.info(this, "@%s changed email to %s", this.name(), email); }