auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void flow(GlowBlock source, BlockFace direction) { BlockFromToEvent fromToEvent = new BlockFromToEvent(source, direction); if (fromToEvent.isCancelled()) { return; } byte strength = fromToEvent.getBlock().getState().getRawData(); if (DOWN != fromToEvent.getFace()) { if (Byte.compare(strength, isWater(fromToEvent.getBlock().getType()) || fromToEvent.getBlock().getBiome() == Biome.HELL ? STRENGTH_MIN_WATER : STRENGTH_MIN_LAVA) < 0) { strength += 1; } else { return; } } else { strength = STRENGTH_MAX; } GlowBlock toBlock = (GlowBlock) fromToEvent.getToBlock(); toBlock.setType(fromToEvent.getBlock().getType(), strength, true); toBlock.getWorld().requestPulse(toBlock); }

Target:
private void flow(GlowBlock source, BlockFace direction) { BlockFromToEvent fromToEvent = new BlockFromToEvent(source, direction); if (fromToEvent.isCancelled()) { return; } byte strength = fromToEvent.getBlock().getState().getRawData(); if (DOWN != fromToEvent.getFace()) { if (Byte.compare(strength, isWater(fromToEvent.getBlock().getType()) || fromToEvent.getBlock().getBiome() == Biome.HELL ? STRENGTH_MIN_WATER : STRENGTH_MIN_LAVA) < 0) { strength += 1; } else { return; } } else { strength = STRENGTH_MAX; } GlowBlock toBlock = (GlowBlock) fromToEvent.getToBlock(); toBlock.setType(fromToEvent.getBlock().getType(), strength, false); toBlock.getWorld().requestPulse(toBlock); }
Source:
private void induceDeleteFailure(int count, ServerErrorCode errorCode) { List<Integer> hostPorts = (ArrayList<Integer>) exceptionHostPorts.clone(); Random random = new Random(); for (int i = 0; i < count; i++) { int nextRandom = random.nextInt(hostPorts.size()); MockDataNode mockDataNode = MockConnectionPool.mockCluster.getMockDataNode(host, hostPorts.get(nextRandom)); mockDataNode.setDeleteException(errorCode); hostPorts.remove(nextRandom); } }

Target:
private void induceDeleteFailure(int count, ServerErrorCode errorCode) { List<Integer> hostPorts = (ArrayList<Integer>) exceptionHostPorts.clone(); for (int i = 0; i < count; i++) { int nextRandom = random.nextInt(hostPorts.size()); MockDataNode mockDataNode = MockConnectionPool.mockCluster.getMockDataNode(host, hostPorts.get(nextRandom)); mockDataNode.setDeleteException(errorCode); hostPorts.remove(nextRandom); } }
Source:
public static FileLock tryLockFor(File fileToLock) throws IOException { if (!fileToLock.exists()) { throw new FileNotFoundException("Unable to get lock for non-existent file: " + fileToLock.getAbsolutePath()); } FileChannel channel = channelCache.get(fileToLock); if (channel == null) { @SuppressWarnings("resource") FileChannel newChannel = new RandomAccessFile(fileToLock, "rw").getChannel(); FileChannel original = channelCache.putIfAbsent(fileToLock, newChannel); if (original != null) { channel = original; try { newChannel.close(); } catch (IOException e) { } } else { channel = newChannel; } } FileLock lock = null; if (channel != null) { try { lock = channel.tryLock(); } catch (OverlappingFileLockException e) { } } return lock; }

Target:
public static FileLock tryLockFor(File fileToLock) throws IOException { FileChannel channel = channelCache.get(fileToLock); if (channel == null && fileToLock.exists()) { @SuppressWarnings("resource") FileChannel newChannel = new RandomAccessFile(fileToLock, "rw").getChannel(); FileChannel original = channelCache.putIfAbsent(fileToLock, newChannel); if (original != null) { channel = original; try { newChannel.close(); } catch (IOException e) { } } else { channel = newChannel; } } FileLock lock = null; if (channel != null) { try { lock = channel.tryLock(); } catch (OverlappingFileLockException e) { } } return lock; }
Source:
public static JobContextImpl fromConfigWithDefaults(Config config) { JobConfig jobConfig = new JobConfig(config); String jobName = jobConfig.getName().isDefined() ? jobConfig.getName().get() : null; String jobId = jobConfig.getJobId(); return new JobContextImpl(config, jobName, jobId); }

Target:
public static JobContextImpl fromConfigWithDefaults(Config config) { JobConfig jobConfig = new JobConfig(config); Option<String> jobName = jobConfig.getName(); if (jobName.isEmpty()) { throw new IllegalArgumentException("Job name is not defined in configuration"); } String jobId = jobConfig.getJobId(); return new JobContextImpl(config, jobName.get(), jobId); }
Source:
protected ISourceCodeParser createParser(IScanner scanner, IParserLogService log, IIndex index, boolean forCompletion, int options) { ParserMode mode; if (forCompletion) { mode= ParserMode.COMPLETION_PARSE; } else if ((options & OPTION_SKIP_FUNCTION_BODIES) != 0) { mode= ParserMode.STRUCTURAL_PARSE; } else { mode= ParserMode.COMPLETE_PARSE; } ISourceCodeParser parser = createParser(scanner, mode, log, index); boolean allowSkipping = CCorePreferenceConstants.getPreference( CCorePreferenceConstants.SCALABILITY_SKIP_TRIVIAL_EXPRESSIONS, null, true); if (allowSkipping && (options & OPTION_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS) != 0) { if (parser instanceof AbstractGNUSourceCodeParser) { int maximumTrivialExpressions = CCorePreferenceConstants.getPreference( CCorePreferenceConstants.SCALABILITY_MAXIMUM_TRIVIAL_EXPRESSIONS, null, DEFAULT_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS); ((AbstractGNUSourceCodeParser) parser) .setMaximumTrivialExpressionsInAggregateInitializers(maximumTrivialExpressions); } } return parser; }

Target:
protected ISourceCodeParser createParser(IScanner scanner, IParserLogService log, IIndex index, boolean forCompletion, int options) { ParserMode mode; if (forCompletion) { mode= ParserMode.COMPLETION_PARSE; } else if ((options & OPTION_SKIP_FUNCTION_BODIES) != 0) { mode= ParserMode.STRUCTURAL_PARSE; } else { mode= ParserMode.COMPLETE_PARSE; } return createParser(scanner, mode, log, index); }
Source:
private boolean saveDataToModelSeries() { if(isSeriesUnique()) { model.setTitle(txtTitle.getText()); if(null != txtKey && txtKey.isEnabled()) model.setKey(txtKey.getText()); else model.setKey(null); model.setXSeries(cboXItem.getSelectionIndex()-1); int i, count; for(i=1, count=1; i<cboYItems.length && 0 != cboYItems[i].getSelectionIndex(); i++) count++; int[] ySeries = new int[count]; ySeries[0] = cboYItems[0].getSelectionIndex(); for(i=1; i<count; i++) ySeries[i] = cboYItems[i].getSelectionIndex()-1; model.setYSeries(ySeries); return true; } return false; }

Target:
private boolean saveDataToModelSeries() { if(isSeriesUnique()) { model.setTitle(txtTitle.getText()); if(null != txtKey && txtKey.isEnabled()) model.setKey(txtKey.getText()); else model.setKey(null); model.setXSeries(cboXItem.getSelectionIndex()-1); int i, count; for(i=1, count=1; i<cboYItems.length && 0 != cboYItems[i].getSelectionIndex(); i++) { count++; } int[] ySeries = new int[count]; ySeries[0] = cboYItems[0].getSelectionIndex(); for(i=1; i<count; i++) { ySeries[i] = cboYItems[i].getSelectionIndex()-1; } model.setYSeries(ySeries); return true; } return false; }
Source:
public void rabbitType(CommandContext args, CommandSender sender, NPC npc) throws CommandException { if (!(npc.getEntity().getType().name().equals("Rabbit"))) throw new RequirementMissingException(Messaging.tr(CommandMessages.REQUIREMENTS_INVALID_MOB_TYPE, npc.getEntity().getType().name().toLowerCase())); RabbitTypes type; try { type = RabbitTypes.valueOf(args.getString(1).toUpperCase()); } catch (IllegalArgumentException ex) { throw new CommandException(Messages.INVALID_RABBIT_TYPE); } npc.getTrait(RabbitType.class).setType(type); Messaging.sendTr(sender, Messages.RABBIT_TYPE_SET, npc.getName(), type); }

Target:
public void rabbitType(CommandContext args, CommandSender sender, NPC npc) throws CommandException { if (Bukkit.getPluginManager().getPlugin("Carbon") == null) throw new RequirementMissingException(Messaging.tr(CommandMessages.UNKNOWN_COMMAND)); if (!(npc.getEntity().getType().name().equals("Rabbit"))) throw new RequirementMissingException(Messaging.tr(CommandMessages.REQUIREMENTS_INVALID_MOB_TYPE, npc.getEntity().getType().name().toLowerCase())); RabbitTypes type; try { type = RabbitTypes.valueOf(args.getString(1).toUpperCase()); } catch (IllegalArgumentException ex) { throw new CommandException(Messages.INVALID_RABBIT_TYPE); } npc.getTrait(RabbitType.class).setType(type); Messaging.sendTr(sender, Messages.RABBIT_TYPE_SET, npc.getName(), type); }
Source:
public void testRegistryNamingExtended() throws Exception { assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:0.18", new ImageName("org/jolokia/jolokia_demo:0.18").getFullName("docker.jolokia.org")); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("org/jolokia/jolokia_demo").getFullName("docker.jolokia.org")); assertEquals("org/jolokia/jolokia_demo:latest", new ImageName("org/jolokia/jolokia_demo").getFullName(null)); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("docker.jolokia.org/org/jolokia/jolokia_demo").getFullName("another.registry.org")); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("docker.jolokia.org/org/jolokia/jolokia_demo").getFullName(null)); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo@sha256:2781907cc3ae9bb732076f14392128d4b84ff3ebb66379d268e563b10fbfb9da", new ImageName("docker.jolokia.org/org/jolokia/jolokia_demo@sha256:2781907cc3ae9bb732076f14392128d4b84ff3ebb66379d268e563b10fbfb9da").getFullName(null)); }

Target:
public void testRegistryNamingExtended() throws Exception { assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:0.18", new ImageName("org/jolokia/jolokia_demo:0.18").getFullName("docker.jolokia.org")); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("org/jolokia/jolokia_demo").getFullName("docker.jolokia.org")); assertEquals("org/jolokia/jolokia_demo:latest", new ImageName("org/jolokia/jolokia_demo").getFullName(null)); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("docker.jolokia.org/org/jolokia/jolokia_demo").getFullName("another.registry.org")); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo:latest", new ImageName("docker.jolokia.org/org/jolokia/jolokia_demo").getFullName(null)); assertEquals("docker.jolokia.org/org/jolokia/jolokia_demo@sha256:2781907cc3ae9bb732076f14392128d4b84ff3ebb66379d268e563b10fbfb9da", new ImageName("docker.jolokia.org/org/jolokia/jolokia_demo@sha256:2781907cc3ae9bb732076f14392128d4b84ff3ebb66379d268e563b10fbfb9da").getFullName(null)); assertEquals("docker.jolokia.org", new ImageName("docker.jolokia.org/org/jolokia/jolokia_demo@sha256:2781907cc3ae9bb732076f14392128d4b84ff3ebb66379d268e563b10fbfb9da").getRegistry()); }
Source:
protected void onResume() { super.onResume(); Subscription merlinSubscription = MerlinObservable.from(this).subscribe(new Action1<NetworkStatus.State>() { @Override public void call(NetworkStatus.State state) { if (NetworkStatus.State.AVAILABLE == state) { networkStatusDisplayer.displayConnected(); } else { networkStatusDisplayer.displayDisconnected(); } } }); subscriptions.add(merlinSubscription); }

Target:
protected void onResume() { super.onResume(); Subscription merlinSubscription = MerlinObservable.from(this) .distinctUntilChanged() .subscribe(new NetworkAction(networkStatusDisplayer)); subscriptions.add(merlinSubscription); }
Source:
public Map getService(String name) { return sections.get(name); }

Target:
public Map<String, String> getService(String name) throws SQLException { if (sections.containsKey(name)) { return sections.get(name); } else { throw new SQLException(MessageFormat.format("Unknown service {0}.", name)); } }
Source:
public SecurityGroup addIpPermission(IpPermission ipPermission, SecurityGroup group) { String zone = group.getLocation().getId(); String id = group.getId(); Optional<? extends SecurityGroupApi> sgApi = client.getSecurityGroupExtensionForZone(zone); if (!sgApi.isPresent()) { return null; } if (ipPermission.getCidrBlocks().size() > 0) { for (String cidr : ipPermission.getCidrBlocks()) { sgApi.get().createRuleAllowingCidrBlock(id, Ingress.builder() .ipProtocol(ipPermission.getIpProtocol()) .fromPort(ipPermission.getFromPort()) .toPort(ipPermission.getToPort()) .build(), cidr); } } if (ipPermission.getGroupIds().size() > 0) { for (String zoneAndGroupRaw : ipPermission.getGroupIds()) { ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(zoneAndGroupRaw); String groupId = zoneAndId.getId(); sgApi.get().createRuleAllowingSecurityGroupId(id, Ingress.builder() .ipProtocol(ipPermission.getIpProtocol()) .fromPort(ipPermission.getFromPort()) .toPort(ipPermission.getToPort()) .build(), groupId); } } return getSecurityGroupById(ZoneAndId.fromZoneAndId(zone, id).slashEncode()); }

Target:
public SecurityGroup addIpPermission(IpPermission ipPermission, SecurityGroup group) { String zone = group.getLocation().getId(); String id = group.getId(); Optional<? extends SecurityGroupApi> sgApi = api.getSecurityGroupExtensionForZone(zone); if (!sgApi.isPresent()) { return null; } if (ipPermission.getCidrBlocks().size() > 0) { for (String cidr : ipPermission.getCidrBlocks()) { sgApi.get().createRuleAllowingCidrBlock(id, Ingress.builder() .ipProtocol(ipPermission.getIpProtocol()) .fromPort(ipPermission.getFromPort()) .toPort(ipPermission.getToPort()) .build(), cidr); } } if (ipPermission.getGroupIds().size() > 0) { for (String zoneAndGroupRaw : ipPermission.getGroupIds()) { ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(zoneAndGroupRaw); String groupId = zoneAndId.getId(); sgApi.get().createRuleAllowingSecurityGroupId(id, Ingress.builder() .ipProtocol(ipPermission.getIpProtocol()) .fromPort(ipPermission.getFromPort()) .toPort(ipPermission.getToPort()) .build(), groupId); } } return getSecurityGroupById(ZoneAndId.fromZoneAndId(zone, id).slashEncode()); }
Source:
public void testUnhandledExceptionStoredOnCrashReportEnabled() { CrashReporter.storeUnhandledException(exception); assertTrue(!sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").isEmpty()); }

Target:
public void testUnhandledExceptionStoredOnCrashReportEnabled() { CrashReporter.storeUnhandledException(exception); assertFalse(sharedPreferences.getString(CrashReporter.EXCEPTION_FOR_REPORT, "").isEmpty()); }
Source:
public SpotConfiguration(boolean useBidPrice) { this.useBidPrice = useBidPrice; this.spotMaxBidPrice = ""; this.fallbackToOndemand = false; this.spotBlockReservationDuration = 0; }

Target:
public SpotConfiguration(boolean useBidPrice) { this.useBidPrice = useBidPrice; this.spotMaxBidPrice = ""; }
Source:
public void onShutdownRequest() { log.info("Stopping the AM client on shutdown request."); lifecycle.onShutdown(SamzaApplicationState.SamzaAppStatus.FAILED); amClient.stop(); log.info("Stopping the NM client on shutdown request."); nmClientAsync.stop(); log.info("Stopping the SamzaYarnAppMasterService service on shutdown request."); service.onShutdown(); log.info("Stopping SamzaAppMasterMetrics on shutdown request."); metrics.stop(); }

Target:
public void onShutdownRequest() { stop(SamzaApplicationState.SamzaAppStatus.FAILED); }
Source:
public void run() { if(isTriggerExpired()) { return ; } boolean isTriggerConditionMet = triggerCondition.isMet(); if (isTriggerConditionMet) { logger.info("Condition " + triggerCondition.getExpression() + " met"); for (TriggerAction action : actions) { try { action.doAction(); } catch (Exception e) { logger.error("Failed to do action " + action.getDescription() + " for execution " + azkaban.execapp.Trigger.this.execId, e); } } this.isExpired = true; } else { updateNextCheckTime(); } }

Target:
public void run() { if(isTriggerExpired()) { logger.info(this + " expired"); return ; } boolean isTriggerConditionMet = triggerCondition.isMet(); if (isTriggerConditionMet) { logger.info("Condition " + triggerCondition.getExpression() + " met"); for (TriggerAction action : actions) { try { action.doAction(); } catch (Exception e) { logger.error("Failed to do action " + action.getDescription() + " for execution " + azkaban.execapp.Trigger.this.execId, e); } } } }
Source:
public void set( String value ) { prefs.put( UserIdStorageFactory.key, value ); }

Target:
public void set( String value ) { prefs.put( UserIdStorageFactory.key, value ); try { prefs.flush(); } catch( BackingStoreException e ) { throw new RuntimeException( e ); } }
Source:
public void writeObject(ObjectOutput output, IndexWorker worker) throws IOException { output.writeObject(worker.cacheName); if (worker.indexedTypes == null) { output.writeInt(0); } else { Set<? extends Class<?>> types = worker.indexedTypes.stream().map(PojoIndexedTypeIdentifier::convertToLegacy).collect(Collectors.toSet()); output.writeInt(types.size()); for (IndexedTypeIdentifier type : worker.indexedTypes) { output.writeObject(PojoIndexedTypeIdentifier.convertToLegacy(type)); } } output.writeBoolean(worker.flush); output.writeBoolean(worker.clean); output.writeBoolean(worker.primaryOwner); output.writeBoolean(worker.skipIndex); output.writeObject(worker.keys); }

Target:
public void writeObject(ObjectOutput output, IndexWorker worker) throws IOException { output.writeObject(worker.cacheName); if (worker.indexedTypes == null) { output.writeInt(0); } else { output.writeInt(worker.indexedTypes.size()); for (IndexedTypeIdentifier indexedTypeIdentifier : worker.indexedTypes) output.writeObject(PojoIndexedTypeIdentifier.convertToLegacy(indexedTypeIdentifier)); } output.writeBoolean(worker.flush); output.writeBoolean(worker.clean); output.writeBoolean(worker.primaryOwner); output.writeBoolean(worker.skipIndex); output.writeObject(worker.keys); }
Source:
private boolean installationStartedCheck() { try { new WaitUntil(new ShellIsActive("Progress Information"), TimePeriod.LONG); new WaitUntil(new ShellIsActive("Install New Software"), TimePeriod.LONG); } catch (RedDeerException e) { return false; } new NoButton().click(); return true; }

Target:
private boolean installationStartedCheck() { try { new WaitUntil(new ShellIsAvailable("Progress Information"), TimePeriod.LONG); new WaitUntil(new ShellIsAvailable("Install New Software"), TimePeriod.LONG); } catch (RedDeerException e) { return false; } new NoButton().click(); return true; }
Source:
private boolean checkBaseDBExist() { File baseFile = mContext.getDatabasePath("base.sqlite3"); return baseFile.isFile(); }

Target:
private boolean checkBaseDBExist() { return mContext.getDatabasePath("base.sqlite3").isFile(); }
Source:
private void setSecurityContext(UserDTO user) { JWTAuthenticatedUser splitUser = new JWTAuthenticatedUser(); splitUser.setFullName(user.getFullName()); splitUser.setId(user.getId()); splitUser.setFriendlyName(user.getFriendlyName()); splitUser.setSubjectName(user.getUsername()); splitUser.getPermissions().add(user.getPermission().getGrantedPermission()); SecurityContextHolder.getContext().setAuthentication(splitUser); SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL); }

Target:
private void setSecurityContext(UserDTO user) { JWTAuthenticatedUser rwtUploadUser = new JWTAuthenticatedUser(); rwtUploadUser.setFullName(user.getFullName()); rwtUploadUser.setId(user.getId()); rwtUploadUser.setFriendlyName(user.getFriendlyName()); rwtUploadUser.setSubjectName(user.getUsername()); rwtUploadUser.getPermissions().add(user.getPermission().getGrantedPermission()); SecurityContextHolder.getContext().setAuthentication(rwtUploadUser); SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL); }
Source:
public synchronized boolean deleteMetadataStoreRealm(String realm) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } return _zkClient.delete(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm); } String leaderHostName = _leaderElection.getCurrentLeaderInfo().getId(); String url = leaderHostName + "/admin/v2/namespaces/" + _namespace + "/metadata-store-realms/" + realm; HttpDelete deleteRequest = new HttpDelete(url); try { HttpResponse response = _forwardHttpClient.execute(deleteRequest); if (response.getStatusLine().getStatusCode() != 200) { HttpEntity respEntity = response.getEntity(); LOG.error("the forwarded request to leader has failed for deleteMetadataStoreRealm: {}", respEntity != null ? EntityUtils.toString(respEntity) : ""); return false; } } catch (IOException e) { LOG.error("the forwarded request to leader raised an exception for deleteMetadataStoreRealm", e); return false; } return true; }

Target:
public synchronized boolean deleteMetadataStoreRealm(String realm) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } return deleteZkRealm(realm); } String urlSuffix = constructUrlSuffix(MetadataStoreRoutingConstants.MSDS_GET_ALL_REALMS_ENDPOINT, realm); return forwardRequestToLeader(urlSuffix, HttpConstants.RestVerbs.DELETE, Response.Status.OK.getStatusCode()); }
Source:
public void testChunkedLengthSet() throws Exception { MockHttpURLConnection connection = new MockHttpURLConnection(new URL(HttpTesting.SIMPLE_URL)); connection.setRequestMethod("POST"); NetHttpRequest request = new NetHttpRequest(connection); InputStream is = NetHttpRequestTest.class.getClassLoader().getResourceAsStream("file.txt"); HttpContent content = new InputStreamContent("text/plain", is); request.setStreamingContent(content); request.setContentEncoding("gzip"); request.execute(); assertEquals(connection.getChunkLength(), 4096); assertNull(request.getRequestProperty("Content-Length")); }

Target:
public void testChunkedLengthSet() throws Exception { MockHttpURLConnection connection = new MockHttpURLConnection(new URL(HttpTesting.SIMPLE_URL)); connection.setRequestMethod("POST"); NetHttpRequest request = new NetHttpRequest(connection); InputStream is = NetHttpRequestTest.class.getClassLoader().getResourceAsStream("file.txt"); HttpContent content = new InputStreamContent("text/plain", is); request.setStreamingContent(content); request.setContentEncoding("gzip"); request.execute(); assertEquals(4096, connection.getChunkLength()); assertNull(request.getRequestProperty("Content-Length")); }
Source:
private void showErrorIfEmailInvalid() { if (!mIsValidEmail && mEmailInput.getEditText().getText().length() > 0) { showEmailError(R.string.email_invalid); } }

Target:
private void showErrorIfEmailInvalid() { if (mIsValidEmail != null && !mIsValidEmail) { showEmailError(R.string.email_invalid); } }
Source:
public void addNewAuthorization() { if (groups.get(0).getRule() != null) { groups.add(0, new AuthorizationGroupBean()); } }

Target:
public void addNewAuthorization() { if ((!groups.isEmpty() && groups.get(0).getRule() != null) || groups.isEmpty()) { groups.add(0, new AuthorizationGroupBean()); } }
Source:
public void setLevel(LogLevel level) throws IllegalStateException { if(_config == null) { throw new IllegalStateException("Cannot set logging level without a configuration"); } if(level == null) { level = LogLevel.NONE; } if(_level.equals(level)) { return; } _level = level; C4Log.setBinaryFileLevel(level.getValue()); }

Target:
public void setLevel(LogLevel level) { if(_config == null) { throw new IllegalStateException("Cannot set logging level without a configuration"); } if(level == null) { level = LogLevel.NONE; } if(_level.equals(level)) { return; } _level = level; C4Log.setBinaryFileLevel(level.getValue()); }
Source:
public Optional<Color> getUnitColor(final String playerName) { if (unitColors.containsKey(playerName)) { return Optional.ofNullable(unitColors.get(playerName)); } final Color color; try { color = getColorProperty(PROPERTY_UNITS_COLOR_PREFIX + playerName); } catch (final Exception e) { throw new IllegalStateException( "Unit colors must be a 6 digit hex number, eg FF0011: " + playerName); } unitColors.put(playerName, color); return Optional.ofNullable(color); }

Target:
public Optional<Color> getUnitColor(final String playerName) { if (unitColors.containsKey(playerName)) { return Optional.ofNullable(unitColors.get(playerName)); } final Color color = getColorProperty(PROPERTY_UNITS_TRANSFORM_COLOR_PREFIX + playerName); unitColors.put(playerName, color); return Optional.ofNullable(color); }
Source:
private void forceUnlockForLeavingMembers(Set<Object> possibleOwners) { clusteredLockManager.execute(() -> { log.tracef("LOCK[%s] Call force unlock for %s from %s ", getName(), possibleOwners, originator); viewChangeUnlockHappening.set(true); unlock(null, possibleOwners) .whenComplete((unlockResult, ex) -> { log.tracef("LOCK[%s] Force unlock call completed for %s from %s ", getName(), possibleOwners, originator); viewChangeUnlockHappening.set(false); if (ex == null) { log.tracef("LOCK[%s] Force unlock result %b for %s from %s ", getName(), unlockResult, possibleOwners, originator); } else { log.errorf(ex, "LOCK[%s] Unlock failed from node %s", getName(), originator); } retryPendingUnlocks(); retryPendingRequests(); }); } ); }

Target:
private void forceUnlockForLeavingMembers(Set<Object> possibleOwners) { clusteredLockManager.execute(() -> { log.tracef("LOCK[%s] Call force unlock for %s from %s ", getName(), possibleOwners, originator); int viewChangeUnlockValue = viewChangeUnlockHappening.incrementAndGet(); log.tracef("LOCK[%s] viewChangeUnlockHappening value in %s ", getName(), viewChangeUnlockValue, originator); unlock(null, possibleOwners) .whenComplete((unlockResult, ex) -> { log.tracef("LOCK[%s] Force unlock call completed for %s from %s ", getName(), possibleOwners, originator); int viewChangeUnlockValueAfterUnlock = viewChangeUnlockHappening.decrementAndGet(); log.tracef("LOCK[%s] viewChangeUnlockHappening value in %s ", getName(), viewChangeUnlockValueAfterUnlock, originator); if (ex == null) { log.tracef("LOCK[%s] Force unlock result %b for %s from %s ", getName(), unlockResult, possibleOwners, originator); } else { log.error(ex, log.unlockFailed(getName(), getOriginator())); } retryPendingRequests(); }); } ); }
Source:
public boolean equals(final Object that) { return this == that || RequestOf.class.equals(that.getClass()); }

Target:
public boolean equals(final Object that) { return new Unchecked<>( new Or( () -> this == that, new And( () -> that != null, () -> RequestOf.class.equals(that.getClass()), () -> { final RequestOf other = (RequestOf) that; return new And( () -> { final Iterator<String> iter = other.head() .iterator(); return new And( (String hdr) -> hdr.equals(iter.next()), this.head() ).value(); }, () -> new Equality<>( new BytesOf(this.body()), new BytesOf(other.body()) ).value() == 0 ).value(); } ) ) ).value(); }
Source:
public String propertyForUserName(Criteria item, boolean creator) { item.createAlias("creator", "creator"); item.createAlias("lastModifier", "lastModifier"); return creator ? "creator.loginName" : "lastModifier.loginName"; }

Target:
public String propertyForUserName(Criteria item, boolean creator) { return creator ? "creator.loginName" : "lastModifier.loginName"; }
Source:
public Operation operationDispatched(Request request, Operation operation) { Name type = getFeatureTypeName(request); FeatureTypeInfo typeInfo = catalog.getFeatureTypeByName(type); if (typeInfo != null) { try { RootBuilder root = JsonLdConfiguration.get() .getTemplate(typeInfo, typeInfo.getName() + ".json"); Map rawKvp = request.getRawKvp(); if (rawKvp.get("CQL_FILTER") != null && rawKvp.get("CQL_FILTER").toString().contains(".") && root != null) { GetFeatureRequest getFeature = GetFeatureRequest.adapt(operation.getParameters()[0]); if (getFeature != null && root != null) { getFeature.getTypeName(); List<Query> queries = getFeature.getQueries(); if (queries != null && queries.size() > 0) { JsonLdPathVisitor visitor = new JsonLdPathVisitor(); for (Query q : queries) { if (q.getFilter() != null) { Filter newFilter = (Filter) q.getFilter().accept(visitor, root); q.setFilter(newFilter); } } } } } } catch (Exception e) { throw new RuntimeException(e); } } return operation; }

Target:
public Operation operationDispatched(Request request, Operation operation) { FeatureTypeInfo typeInfo = null; GetFeatureRequest getFeature = GetFeatureRequest.adapt(operation.getParameters()[0]); if (getFeature != null) { Map rawKvp = request.getRawKvp(); boolean jump = request.getHttpRequest().getMethod().equalsIgnoreCase("GET") && (rawKvp.get("CQL_FILTER") == null || !rawKvp.get("CQL_FILTER").toString().contains(".")); if (!jump) { for (int i = 0; i < getFeature.getQueries().size(); i++) { Query q = getFeature.getQueries().get(i); QName type = q.getTypeNames().get(0); typeInfo = catalog.getFeatureTypeByName( new NameImpl(type.getPrefix(), type.getLocalPart())); if (typeInfo != null) { try { RootBuilder root = configuration.getTemplate( typeInfo, typeInfo.getName() + ".json"); JsonLdPathVisitor visitor = new JsonLdPathVisitor(); if (q.getFilter() != null) { Filter newFilter = (Filter) q.getFilter().accept(visitor, root); q.setFilter(newFilter); getFeature.getQueries().set(i, q); } } catch (Exception e) { throw new RuntimeException(e); } } } } } return operation; }
Source:
private boolean isRemoveCommandAvailable(List<DiskImage> disks) { if (disks.stream().anyMatch(d -> d.getImageStatus() == ImageStatus.LOCKED)) { return false; } return true; }

Target:
private boolean isRemoveCommandAvailable(List<DiskImage> disks) { return disks.stream().noneMatch(d -> d.getImageStatus() == ImageStatus.LOCKED); }
Source:
public void testWithDefaultIndexCaches() throws Exception { withCacheManager(TestCacheManagerFactory::createClusteredCacheManager, cm -> { Configuration indexConfig = createAsyncIndexConfig(); cm.defineConfiguration(InfinispanIntegration.DEFAULT_INDEXESDATA_CACHENAME, indexConfig); cm.defineConfiguration(InfinispanIntegration.DEFAULT_LOCKING_CACHENAME, indexConfig); cm.defineConfiguration(InfinispanIntegration.DEFAULT_INDEXESMETADATA_CACHENAME, indexConfig); cm.defineConfiguration("userCache", createUserCacheConfig()); Cache<String, Person> userCache = cm.getCache("userCache"); assertValidationExceptionThrown(op -> userCache.put("1", new Person())); }); }

Target:
public void testWithDefaultIndexCaches() throws Exception { withCacheManager(TestCacheManagerFactory::createClusteredCacheManager, cm -> { Configuration indexConfig = createAsyncIndexConfig(); cm.defineConfiguration(InfinispanIntegration.DEFAULT_INDEXESDATA_CACHENAME, indexConfig); cm.defineConfiguration(InfinispanIntegration.DEFAULT_LOCKING_CACHENAME, indexConfig); cm.defineConfiguration(InfinispanIntegration.DEFAULT_INDEXESMETADATA_CACHENAME, indexConfig); cm.defineConfiguration("userCache", createUserCacheConfig()); Cache<String, Person> userCache = cm.getCache("userCache"); assertValidationExceptionThrown(() -> userCache.put("1", new Person())); }); }
Source:
void validate(final Id id) { if (id == null) { throw new IllegalArgumentException("id is null"); } try { FileValidator.validate(id, repo.src(id)); } catch (IOException e) { throw new OrchestrationException(e); } snooze(); }

Target:
void validate(final Id id) { if (id == null) { throw new IllegalArgumentException("id is null"); } try { DockerfileValidator.validate(id, repo.src(id)); } catch (IOException e) { throw new OrchestrationException(e); } }
Source:
private List<Person> makeActors(Element cast) { List<Person> people = new ArrayList<>(); Elements actors = cast.getChildElements("actor"); for (int i = 0; i < actors.size(); i++) { Element actor = actors.get(i); people.add(makeActor(actor)); } return people; }

Target:
private List<Person> makeActors(Element cast) { List<Person> people = Lists.newArrayList(); Elements actors = cast.getChildElements(ACTOR); for (int i = 0; i < actors.size(); i++) { Element actor = actors.get(i); people.add(makeActor(actor)); } return people; }
Source:
public Subject createSubject(String sd) { return delegator.createSubject(sd); }

Target:
public Subject createSubject(String sd) { Subject subject = delegator.createSubject(sd); if (trace) { log.trace("Subject=" + subject); log.trace("Subject identity=" + Integer.toHexString(System.identityHashCode(subject))); } return subject; }
Source:
private static void checkConfiguration() { if (repositories.size() > 0 && !cfg.isHistoryEnabled()) { System.out.println("Repositories were specified however history is off"); System.exit(1); } }

Target:
private static void checkConfiguration() { if (repositories.size() > 0 && !cfg.isHistoryEnabled()) { die("Repositories were specified however history is off"); } }
Source:
private static CommandStorageRecord toStorageRecord(Command command) { final CommandContext context = command.getContext(); final CommandId commandId = checkValid(context.getCommandId()); final String commandIdString = commandId.getUuid(); final Any messageAny = command.getMessage(); final Message commandMessage = Commands.getMessage(command); final String commandType = TypeName.of(commandMessage).nameOnly(); final Object targetId = tryToGetTargetId(commandMessage); final String targetIdString; final String targetIdType; if (targetId != null) { targetIdString = idToString(targetId); targetIdType = targetId.getClass().getName(); } else { targetIdString = ""; targetIdType = ""; } final CommandStorageRecord.Builder builder = CommandStorageRecord.newBuilder() .setMessage(messageAny) .setTimestamp(context.getTimestamp()) .setCommandType(commandType) .setCommandId(commandIdString) .setStatus(CommandStatus.RECEIVED) .setTargetIdType(targetIdType) .setTargetId(targetIdString) .setContext(context); return builder.build(); }

Target:
static CommandStorageRecord toStorageRecord(Command command) { final CommandContext context = command.getContext(); final CommandId commandId = context.getCommandId(); final String commandIdString = commandId.getUuid(); final Any messageAny = command.getMessage(); final Message commandMessage = Commands.getMessage(command); final String commandType = TypeName.of(commandMessage).nameOnly(); final Object targetId = tryToGetTargetId(commandMessage); final String targetIdString; final String targetIdType; if (targetId != null) { targetIdString = idToString(targetId); targetIdType = targetId.getClass().getName(); } else { targetIdString = ""; targetIdType = ""; } final CommandStorageRecord.Builder builder = CommandStorageRecord.newBuilder() .setMessage(messageAny) .setTimestamp(context.getTimestamp()) .setCommandType(commandType) .setCommandId(commandIdString) .setStatus(CommandStatus.RECEIVED) .setTargetIdType(targetIdType) .setTargetId(targetIdString) .setContext(context); return builder.build(); }
Source:
public void partActivated(IWorkbenchPartReference partRef) { if (isThisPart(partRef)) { fActive = true; } }

Target:
public void partActivated(IWorkbenchPartReference partRef) { if (isThisPart(partRef)) { fActive = true; activateParticipants(fActiveConsole); } }
Source:
public void setup() { event = GitHubEvent.builder() .repo(new GitHubEvent.RepoIdentifier() { @Nullable @Override public Long id() { return null; } @Nullable @Override public String url() { return null; } @Nullable @Override public String repoWithUserName() { return REPO_NAME; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel parcel, int i) { } }) .build(); }

Target:
public void setup() { repo = GitHubEvent.RepoIdentifier.builder() .repoWithUserName(REPO_NAME) .build(); event = GitHubEvent.builder() .repo(repo) .build(); }
Source:
public void createDiskWithTagsAndSku() throws InterruptedException { server.enqueue(jsonResponse("/creatediskwithtagsandskuresponse.json").setResponseCode(200)); final DiskApi diskApi = api.getDiskApi(resourcegroup); DiskProperties properties = DiskProperties.builder().diskSizeGB(2).creationData(CreationData.create(CreationData.CreateOptions.EMPTY)).build(); DiskSku sku = DiskSku.builder().name("Premium_LRS").build(); Disk dataDisk = diskApi.createOrUpdate(diskName, "westus", ImmutableMap.of("exampleTag", "jclouds-test-tag"), properties, sku); String path = String.format("/subscriptions/%s/resourcegroups/%s/providers/Microsoft.Compute/disks/%s?%s", subscriptionid, resourcegroup, diskName, apiVersion); String json = "{\"location\":\"westus\",\"tags\":{\"exampleTag\":\"jclouds-test-tag\"},\"properties\":{\"diskSizeGB\":2,\"creationData\":{\"createOption\":\"Empty\"}},\"sku\":{\"name\":\"Premium_LRS\"}}"; assertSent(server, "PUT", path, json); assertEquals(dataDisk.properties().provisioningState(), "Updating"); assertTrue(dataDisk.properties().diskSizeGB() == 2); assertTrue(dataDisk.tags().containsValue("jclouds-test-tag")); }

Target:
public void createDiskWithTagsAndSku() throws InterruptedException { server.enqueue(jsonResponse("/creatediskwithtagsandskuresponse.json").setResponseCode(200)); final DiskApi diskApi = api.getDiskApi(resourcegroup); DiskProperties properties = DiskProperties.builder().diskSizeGB(2).creationData(CreationData.create(CreationData.CreateOptions.EMPTY)).build(); DiskSku sku = DiskSku.builder().name(PREMIUM_LRS).build(); Disk dataDisk = diskApi.createOrUpdate(diskName, "westus", ImmutableMap.of("exampleTag", "jclouds-test-tag"), properties, sku); String path = String.format("/subscriptions/%s/resourcegroups/%s/providers/Microsoft.Compute/disks/%s?%s", subscriptionid, resourcegroup, diskName, apiVersion); String json = "{\"location\":\"westus\",\"tags\":{\"exampleTag\":\"jclouds-test-tag\"},\"properties\":{\"diskSizeGB\":2,\"creationData\":{\"createOption\":\"Empty\"}},\"sku\":{\"name\":\"Premium_LRS\"}}"; assertSent(server, "PUT", path, json); assertEquals(dataDisk.properties().provisioningState(), "Updating"); assertTrue(dataDisk.properties().diskSizeGB() == 2); assertTrue(dataDisk.tags().containsValue("jclouds-test-tag")); }
Source:
ImmutableMultimap<TypeName, TypeName> build() { for (Properties properties : propertiesSet) { put(properties); } final ImmutableMultimap<TypeName, TypeName> result = builder.build(); return result; }

Target:
ImmutableMultimap<TypeName, TypeName> build() { for (Properties props : this.properties) { put(props); } return builder.build(); }
Source:
public void test_getDisplayThreadNegated() { final Display display = new Display(); try { final AtomicBoolean threadFinished = new AtomicBoolean (false); final AtomicBoolean isDisplayThread = new AtomicBoolean (true); Thread nonDisplayThread = new Thread () { @Override public void run () { isDisplayThread.set (display.isCurrentThread ()); threadFinished.set (true); } }; nonDisplayThread.start (); synchronized (this) { while (!threadFinished.get ()) { try { wait (1); } catch (InterruptedException e) { e.printStackTrace (); } } } assertFalse (isDisplayThread.get ()); } finally { display.dispose (); } }

Target:
public void test_getDisplayThreadNegated() { final Display display = new Display(); try { final AtomicBoolean threadFinished = new AtomicBoolean (false); final AtomicBoolean isDisplayThread = new AtomicBoolean (true); Thread nonDisplayThread = new Thread () { @Override public void run () { isDisplayThread.set (display.isDisplayThread ()); threadFinished.set (true); } }; nonDisplayThread.start (); for (int i = 0; i < 1000 && !threadFinished.get (); i++) { try { Thread.sleep (1); } catch (InterruptedException e1) { e1.printStackTrace (); } } assertFalse (isDisplayThread.get ()); } finally { display.dispose (); } }
Source:
public static boolean isDummyList(RangesAtEndpoint ranges) { return all(ranges, Replica::isLocal) || all(ranges, range -> range.endpoint().getHostAddress(true).equals("0.0.0.0:0")); }

Target:
public static boolean isDummyList(RangesAtEndpoint ranges) { return all(ranges, range -> range.endpoint().getHostAddress(true).equals("0.0.0.0:0")); }
Source:
public boolean isLarge() { return this.getSize() > 65536; }

Target:
public boolean isLarge() { return this.getSize() > largeSizeBytes; }
Source:
public Path getDMNModelPath(final Metadata metadata, final String modelNamespace, final String modelName) { final WorkspaceProject workspaceProject = getProject(metadata); for (final Path dmnModelPath : pathsHelper.getDMNModelsPaths(workspaceProject)) { final Optional<Definitions> definitions = getDefinitionsByPath(dmnModelPath); if (definitions.map(d -> Objects.equals(d.getNamespace(), modelNamespace) && Objects.equals(d.getName(), modelName)).orElse(false)) { return dmnModelPath; } } throw new UnsupportedOperationException("No DMN model could be found for the following namespace: " + modelNamespace); }

Target:
public Path getDMNModelPath(final Metadata metadata, final String modelNamespace, final String modelName) { final WorkspaceProject workspaceProject = getProject(metadata); for (final Path dmnModelPath : pathsHelper.getDMNModelsPaths(workspaceProject)) { final Optional<Definitions> definitions = getDefinitionsByPath(dmnModelPath); if (definitions.map(d -> Objects.equals(d.getNamespace(), modelNamespace) && Objects.equals(d.getName(), modelName)).orElse(false)) { return dmnModelPath; } } throw new IllegalStateException("A path for the DMN model with namespace [" + modelNamespace + "] could not be found."); }
Source:
public void literals() throws Exception { assertThat(symbolicValue("42").isAlwaysNullOrUndefined()).isFalse(); assertThat(symbolicValue("'str'").isAlwaysNullOrUndefined()).isFalse(); }

Target:
public void literals() throws Exception { assertThat(symbolicValue("42").isDefinitelyNullOrUndefined()).isFalse(); assertThat(symbolicValue("'str'").isDefinitelyNullOrUndefined()).isFalse(); assertThat(symbolicValue("0").isDefinitelyNullOrUndefined()).isFalse(); assertThat(symbolicValue("'ab'").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("true").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("42").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("42.").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("42e2").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("0b01").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("0x42").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("0o42").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("0O42").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("042").truthiness()).isEqualTo(TRUTHY); assertThat(symbolicValue("''").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("\"\"").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("false").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("0").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("0.0").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("0.e2").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("0b0").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("0x0").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("0o0").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("0O0").truthiness()).isEqualTo(FALSY); assertThat(symbolicValue("00").truthiness()).isEqualTo(FALSY); }
Source:
public String getIcon() { if(getChannel() == null) return "computer-x.png"; else if (isTemporarilyOffline()) return "computer-u.png"; else return "computer.png"; }

Target:
public String getIcon() { if (isTemporarilyOffline() && getOfflineCause() instanceof OfflineCause.UserCause) return "computer-user-offline.png"; if (isOffline() || !isAcceptingTasks()) return "computer-x.png"; return "computer.png"; }
Source:
private void queueData(MediaFeed userFeed, String userId) { if (userFeed == null) { LOGGER.error("User id, {}, returned a NULL media feed from instagram.", userId); } else { for (MediaFeedData data : userFeed.getData()) { this.dataQueue.offer(data); } } }

Target:
private void queueData(MediaFeed userFeed, String userId) { if (userFeed == null) { LOGGER.warn("User id, {}, returned a NULL media feed from instagram.", userId); } else { for (MediaFeedData data : userFeed.getData()) { ComponentUtils.offerUntilSuccess(data, this.dataQueue); } } }
Source:
protected ValidatorError processCommandSetters(PersistOperation operation, DynaActionForm form, HttpServletRequest request) { BaseTreeEditOperation bte = (BaseTreeEditOperation) operation; String label = form.getString(LABEL); if (!label.equals(bte.getTree().getLabel())) { KickstartableTree tree = KickstartFactory.lookupKickstartTreeByLabel( label, bte.getUser().getOrg()); if (tree != null) { return new ValidatorError("distribution.tree.exists", tree.getLabel()); } } bte.setBasePath(form.getString(BASE_PATH)); Long channelId = (Long) form.get(CHANNEL_ID); Channel c = ChannelFactory.lookupByIdAndUser(channelId, operation.getUser()); bte.setChannel(c); bte.setLabel(form.getString(LABEL)); KickstartInstallType type = KickstartFactory. lookupKickstartInstallTypeByLabel(form.getString(INSTALL_TYPE)); bte.setInstallType(type); if (type.isSUSE()) { String kopts = form.getString(POST_KERNEL_OPTS); if (kopts.contains("install=")) { kopts = kopts + " install=http://" + request.getLocalName() + "/ks/dist/" + form.getString(LABEL); } if (!kopts.contains("self_update=")) { kopts = kopts + " self_update=0 pt.options=self_update"; } bte.setKernelOptions(kopts); } else { bte.setKernelOptions(form.getString(KERNEL_OPTS)); } bte.setPostKernelOptions(form.getString(POST_KERNEL_OPTS)); return null; }

Target:
protected ValidatorError processCommandSetters(PersistOperation operation, DynaActionForm form, HttpServletRequest request) { BaseTreeEditOperation bte = (BaseTreeEditOperation) operation; String label = form.getString(LABEL); if (!label.equals(bte.getTree().getLabel())) { KickstartableTree tree = KickstartFactory.lookupKickstartTreeByLabel( label, bte.getUser().getOrg()); if (tree != null) { return new ValidatorError("distribution.tree.exists", tree.getLabel()); } } bte.setBasePath(form.getString(BASE_PATH)); Long channelId = (Long) form.get(CHANNEL_ID); Channel c = ChannelFactory.lookupByIdAndUser(channelId, operation.getUser()); bte.setChannel(c); bte.setLabel(form.getString(LABEL)); KickstartInstallType type = KickstartFactory. lookupKickstartInstallTypeByLabel(form.getString(INSTALL_TYPE)); bte.setInstallType(type); if (type.isSUSE()) { String kopts = form.getString(POST_KERNEL_OPTS); if (kopts.contains("install=")) { kopts = kopts + " install=http://" + request.getLocalName() + "/ks/dist/" + form.getString(LABEL); } if (!kopts.contains("self_update=")) { kopts = kopts + " self_update=0 pt.options=+self_update"; } bte.setKernelOptions(kopts); } else { bte.setKernelOptions(form.getString(KERNEL_OPTS)); } bte.setPostKernelOptions(form.getString(POST_KERNEL_OPTS)); return null; }