auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void setConnected(boolean cancelFuture) { if (state == State.CLOSED) { return; } final boolean notifyAvailability; final Future<?> futureToCancel; synchronized (lock) { if (state == State.CLOSED) { return; } futureToCancel = cancelFuture ? future : null; notifyAvailability = (state != State.CONNECTED); if (LOGGER.isDebugEnabled()) { LOGGER.debug( "Solr({}): available", core, (notifyAvailability ? SolrClientAdapter.GOING : SolrClientAdapter.REMAINING)); } this.apiClient = realClient; this.unavailableClient = null; this.state = State.CONNECTED; this.future = null; lock.notifyAll(); } try { finalizeStateChange(notifyAvailability, futureToCancel, null, true); } catch (IOException e) { } }

Target:
void setConnected(boolean cancelFuture) { if (state == State.CLOSED) { return; } final boolean notifyAvailability; final Future<?> futureToCancel; synchronized (lock) { if (state == State.CLOSED) { return; } futureToCancel = cancelFuture ? future : null; notifyAvailability = shouldNotifyOfAvailability(); this.apiClient = realClient; this.unavailableClient = null; this.state = State.CONNECTED; this.future = null; lock.notifyAll(); } finalizeStateChangeWhileSwallowingIOExceptions(notifyAvailability, futureToCancel, null); }
Source:
public Number getPid() { return this.pid; }

Target:
public Long getPid() { return this.pid; }
Source:
public String toString() { ToStringBuilder builder = new ToStringBuilder(this); builder.append("details", details); builder.append("errors", errors); builder.append("failures", failures); builder.append("file", file); builder.append("skipped", skipped); builder.append("tests", tests); builder.append("time", time); return builder.toString(); }

Target:
public String toString() { ToStringBuilder builder = new ToStringBuilder(this); builder.append("errors", errors); builder.append("failures", failures); builder.append("file", file); builder.append("skipped", skipped); builder.append("tests", tests); builder.append("testDuration", testDuration); return builder.toString(); }
Source:
private ITreeContentProvider getTypesContentProvider(TypedElement typedElement, IStaticContentProvider contentProvider) { return new UMLSwitch<ITreeContentProvider>() { @Override public ITreeContentProvider defaultCase(EObject object) { return new EncapsulatedContentProvider(EmptyContentProvider.instance); } @Override public ITreeContentProvider caseTypedElement(TypedElement object) { if (object instanceof Port) { return new PortTypeContentProvider(contentProvider); } return new EncapsulatedContentProvider(contentProvider); } @Override public ITreeContentProvider caseParameter(Parameter object) { return new ParameterTypeContentProvider(contentProvider); } }.doSwitch(typedElement); }

Target:
private ITreeContentProvider getTypesContentProvider(TypedElement typedElement, IStaticContentProvider contentProvider) { return new UMLSwitch<ITreeContentProvider>() { @Override public ITreeContentProvider defaultCase(EObject object) { return new EncapsulatedContentProvider(EmptyContentProvider.instance); } @Override public ITreeContentProvider caseTypedElement(TypedElement object) { return new EncapsulatedContentProvider(contentProvider); } @Override public ITreeContentProvider casePort(Port object) { return new PortTypeContentProvider(contentProvider); } @Override public ITreeContentProvider caseParameter(Parameter object) { return new ParameterTypeContentProvider(contentProvider); } }.doSwitch(typedElement); }
Source:
protected void createTableWidget(final EObject sourceElement, final EStructuralFeature feature, final Collection<?> rows) { final Table table = createTable(sourceElement, feature, rows); if (table == null) { displayError("Cannot initialize the table"); return; } nattableManager = NattableModelManagerFactory.INSTANCE.createNatTableModelManager(table, new EObjectSelectionExtractor()); natTableWidget = nattableManager.createNattable(self, SWT.NONE, null); if (nattableManager instanceof TreeNattableModelManager) { if (null != rows && !rows.isEmpty()) { final RowHideShowLayer layer = nattableManager.getBodyLayerStack().getRowHideShowLayer(); for (int cpt = 0; cpt < rows.size(); cpt++) { natTableWidget.doCommand(new RowHideCommand(layer, 0)); } } ((TreeNattableModelManager) nattableManager).doCollapseExpandAction(CollapseAndExpandActionsEnum.EXPAND_ALL, null); } self.addDisposeListener(getDisposeListener()); natTableWidget.setBackground(self.getBackground()); GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); data.minimumHeight = natTableWidget.getPreferredHeight()-(rows.size()*70); self.setLayoutData(data); natTableWidget.layout(); self.layout(); }

Target:
protected void createTableWidget(final EObject sourceElement, final EStructuralFeature feature, final Collection<?> rows) { final Table table = createTable(sourceElement, feature, rows); if (null == table) { displayError("Cannot initialize the table"); return; } nattableManager = NattableModelManagerFactory.INSTANCE.createNatTableModelManager(table, new EObjectSelectionExtractor()); natTableWidget = nattableManager.createNattable(self, SWT.NONE, null); if (nattableManager instanceof TreeNattableModelManager) { if (null != rows && !rows.isEmpty()) { final RowHideShowLayer layer = nattableManager.getBodyLayerStack().getRowHideShowLayer(); for (int cpt = 0; cpt < rows.size(); cpt++) { natTableWidget.doCommand(new RowHideCommand(layer, 0)); } } ((TreeNattableModelManager) nattableManager).doCollapseExpandAction(CollapseAndExpandActionsEnum.EXPAND_ALL, null); } self.addDisposeListener(getDisposeListener()); natTableWidget.setBackground(self.getBackground()); GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); data.minimumHeight = natTableWidget.getPreferredHeight()-(rows.size()*70); self.setLayoutData(data); natTableWidget.layout(); self.layout(); }
Source:
public Map<SystemRole, String> getChangedRestrictedRoles(AuthorizationConfigDto configuration) throws IOException { Map<SystemRole, String> changed = new HashMap<>(); Map<String, SystemRole> restricted = SystemRole.getRestricted(); for (RoleDto role : configuration.getRoles()) { if (restricted.containsKey(role.getName())) { SystemRole systemRole = restricted.get(role.getName()); String hash = ""; try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos)) { oos.writeObject(role); MultipleDigestOutputStream mdos = new MultipleDigestOutputStream(baos); mdos.write(baos.toByteArray()); hash = mdos.getMessageDigestAsHexadecimalString(EncryptionAlgorithmsEnum.MD5.getAlgorithm()); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } if (!hash.equalsIgnoreCase(systemRole.getHash())) { changed.put(systemRole, String.format("Restricted system role %s has been removed", systemRole)); } restricted.remove(role.getName()); } } for (SystemRole systemRole : restricted.values()) { changed.put(systemRole, String.format("Restricted system role%s %s has been removed" , restricted.size() > 1 ? "s" : "" , String.join(", ", restricted.keySet()))); } return changed; }

Target:
public Set<SystemRole> getChangedRestrictedRoles(AuthorizationConfigDto configuration) throws IOException { Set<SystemRole> changed = new HashSet<>(); Map<String, SystemRole> restricted = SystemRole.getRestricted(); for (RoleDto role : configuration.getRoles()) { if (!restricted.containsKey(role.getName())) { continue; } SystemRole systemRole = restricted.get(role.getName()); String hash = null; try { hash = MessageDigestUtils.calculateChecksum(role); } catch (NoSuchAlgorithmException e) { throw new IOException(e); } if (!hash.equalsIgnoreCase(systemRole.getHash())) { changed.add(systemRole); } restricted.remove(role.getName()); } changed.addAll(restricted.values()); return changed; }
Source:
public static BlobUrlParts parse(String url) { try { return parse(new URL(url)); } catch (MalformedURLException e) { throw new IllegalArgumentException("Please double check the URL format. URL: " + url); } }

Target:
public static BlobUrlParts parse(String url) { try { return parse(new URL(url)); } catch (MalformedURLException e) { throw new IllegalArgumentException("Invalid URL format. URL: " + url); } }
Source:
public Collection<Container> getContainersByServerInstance(final String serverTemplateId, final String serverInstanceId) { final ServerTemplate serverTemplate = loadServerTemplate(serverTemplateId); for (final ServerInstanceKey serverInstance : serverTemplate.getServerInstanceKeys()) { if (serverInstance.getServerInstanceId().equals(serverInstanceId)) { return getContainers(serverInstance); } } return Collections.emptyList(); }

Target:
public Collection<Container> getContainersByServerInstance(final String serverTemplateId, final String serverInstanceId) { final ServerTemplate serverTemplate = loadServerTemplate(serverTemplateId); return serverTemplate.getServerInstanceKeys().stream() .filter(serverInstanceKey -> serverInstanceKey.getServerInstanceId().equalsIgnoreCase(serverInstanceId)) .findFirst() .map(this::getContainers) .orElse(Collections.emptyList()); }
Source:
private void removeImages() { List<CinderDisk> cinderDisks = new ArrayList<>(); for (final DiskImage source : getSourceImages()) { if (source.getDiskStorageType() == DiskStorageType.MANAGED_BLOCK_STORAGE) { removeManagedBlockDiskSnapshot(source); continue; } if (source.getDiskStorageType() == DiskStorageType.CINDER) { cinderDisks.add((CinderDisk) source); continue; } List<DiskImage> images = diskImageDao.getAllSnapshotsForParent(source.getImageId()); DiskImage dest = null; if (!images.isEmpty()) { dest = images.get(0); } if (getSnapshotActionType() == ActionType.RemoveSnapshotSingleDiskLive) { commandCoordinatorUtil.executeAsyncCommand( getSnapshotActionType(), buildRemoveSnapshotSingleDiskParameters(source, dest, getSnapshotActionType()), cloneContextAndDetachFromParent()); } else { RemoveSnapshotSingleDiskParameters parameters = buildRemoveSnapshotSingleDiskParameters( source, dest, getSnapshotActionType()); ActionReturnValue actionReturnValueturnValue = runInternalActionWithTasksContext( getSnapshotActionType(), parameters); getTaskIdList().addAll(actionReturnValueturnValue.getInternalVdsmTaskIdList()); } List<Guid> quotasToRemoveFromCache = new ArrayList<>(); quotasToRemoveFromCache.add(source.getQuotaId()); if (dest != null) { quotasToRemoveFromCache.add(dest.getQuotaId()); } getQuotaManager().removeQuotaFromCache(getStoragePoolId(), quotasToRemoveFromCache); } if (!cinderDisks.isEmpty()) { handleCinderSnapshotDisks(cinderDisks); } }

Target:
private void removeImages() { List<CinderDisk> cinderDisks = new ArrayList<>(); List <ManagedBlockStorageDisk> managedBlockDisks = new ArrayList<>(); for (final DiskImage source : getSourceImages()) { if (source.getDiskStorageType() == DiskStorageType.MANAGED_BLOCK_STORAGE) { managedBlockDisks.add((ManagedBlockStorageDisk) source); continue; } if (source.getDiskStorageType() == DiskStorageType.CINDER) { cinderDisks.add((CinderDisk) source); continue; } List<DiskImage> images = diskImageDao.getAllSnapshotsForParent(source.getImageId()); DiskImage dest = null; if (!images.isEmpty()) { dest = images.get(0); } if (getSnapshotActionType() == ActionType.RemoveSnapshotSingleDiskLive) { commandCoordinatorUtil.executeAsyncCommand( getSnapshotActionType(), buildRemoveSnapshotSingleDiskParameters(source, dest, getSnapshotActionType()), cloneContextAndDetachFromParent()); } else { RemoveSnapshotSingleDiskParameters parameters = buildRemoveSnapshotSingleDiskParameters( source, dest, getSnapshotActionType()); ActionReturnValue actionReturnValueturnValue = runInternalActionWithTasksContext( getSnapshotActionType(), parameters); getTaskIdList().addAll(actionReturnValueturnValue.getInternalVdsmTaskIdList()); } List<Guid> quotasToRemoveFromCache = new ArrayList<>(); quotasToRemoveFromCache.add(source.getQuotaId()); if (dest != null) { quotasToRemoveFromCache.add(dest.getQuotaId()); } getQuotaManager().removeQuotaFromCache(getStoragePoolId(), quotasToRemoveFromCache); } if (!cinderDisks.isEmpty()) { handleCinderSnapshotDisks(cinderDisks); } managedBlockDisks.forEach(disk -> removeManagedBlockSnapshot(disk)); }
Source:
public static void putDefaultsIfAbsent(Properties conf) { { putIfAbsent(conf, "LdapServers", ""); putIfAbsent(conf, "LDAPServerPort", "389"); putIfAbsent(conf, "AdUserName", ""); putIfAbsent(conf, "AdUserPassword", ""); putIfAbsent(conf, "LDAPSecurityAuthentication", "GSSAPI"); putIfAbsent(conf, "AuthenticationMethod" , "LDAP"); putIfAbsent(conf, "LDAPProviderTypes" , ""); putIfAbsent(conf, "LDAPQueryTimeout", "30"); putIfAbsent(conf, "DomainName", ""); putIfAbsent(conf, "SASL_QOP", "auth-conf"); putIfAbsent(conf, "LDAPConnectTimeout", "30"); putIfAbsent(conf, "MaxLDAPQueryPartsNumber", "100"); putIfAbsent(conf, "LDAPOperationTimeout", "30"); putIfAbsent(conf, "LdapQueryPageSize", "1000"); } }

Target:
public static void putDefaultsIfAbsent(Properties conf) { { Properties defaults = new Properties(); try { defaults.load(Utils.class.getResourceAsStream("/builtin/defaults.properties")); for (Map.Entry<Object, Object> entry : defaults.entrySet()) { putIfAbsent(conf, (String) entry.getKey(), (String) entry.getValue()); } } catch (IOException e) { throw new RuntimeException(e); } } }
Source:
public void onPreReceive(final ReceivePack arg0, final Collection<ReceiveCommand> commands) { parseCommands(commands); if (newChange != null && newChange.getResult() == ReceiveCommand.Result.NOT_ATTEMPTED) { createNewChanges(); } doReplaces(); if(!errors.isEmpty()) { for (Map.Entry<Error, List<String>> error : errors.entrySet()) { rp.sendMessage(buildError(error.getKey(), error.getValue())); } rp.sendMessage(COMMAND_REJECTION_MESSAGE_FOOTER); } }

Target:
public void onPreReceive(final ReceivePack arg0, final Collection<ReceiveCommand> commands) { parseCommands(commands); if (newChange != null && newChange.getResult() == ReceiveCommand.Result.NOT_ATTEMPTED) { createNewChanges(); } doReplaces(); if (!errors.isEmpty()) { for (Map.Entry<Error, List<String>> error : errors.entrySet()) { rp.sendMessage(buildError(error.getKey(), error.getValue())); } rp.sendMessage(String.format("User: %s", displayName(currentUser))); rp.sendMessage(COMMAND_REJECTION_MESSAGE_FOOTER); } }
Source:
private static String createPortsToPayloadString(Cartridge cartridge) { StringBuilder portMapBuilder = new StringBuilder(); PortMapping[] portMappings = cartridge.getPortMappings(); if (cartridge.getPortMappings()[0] == null) { return null; } for (PortMapping portMapping : portMappings) { portMapBuilder.append(portMapping.getPort()).append("|"); } String portMappingString = portMapBuilder.toString().replaceAll("\\|$", ""); return portMappingString; }

Target:
private static String createPortsToPayloadString(Cartridge cartridge) { StringBuilder portMapBuilder = new StringBuilder(); PortMapping[] portMappings = cartridge.getPortMappings(); if (cartridge.getPortMappings()[0] == null) { return null; } for (PortMapping portMapping : portMappings) { portMapBuilder.append(portMapping.getPort()).append(PORT_SEPARATOR); } String portMappingString = portMapBuilder.toString().replaceAll("\\|$", ""); return portMappingString; }
Source:
public void smokeTestWith4Servers() { getAuthenticationContext("wildfly-config-dynamic-ssl-test.xml").run(() -> { try { SSLContext dynamicSSLContext = new DynamicSSLContext(); SSLSocketFactory dynamicSSLContextSocketFactory = dynamicSSLContext.getSocketFactory(); SSLSocket clientSslSocket1 = (SSLSocket) dynamicSSLContextSocketFactory.createSocket("localhost", 10001); clientSslSocket1.setUseClientMode(true); clientSslSocket1.setReuseAddress(true); checkOutputIsOK(clientSslSocket1); clientSslSocket1.close(); SSLSocket clientSslSocket2 = (SSLSocket) dynamicSSLContextSocketFactory.createSocket("localhost", 10002); clientSslSocket2.setReuseAddress(true); checkOutputIsOK(clientSslSocket2); clientSslSocket2.close(); SSLSocket clientSslSocket3 = (SSLSocket) dynamicSSLContextSocketFactory.createSocket("127.0.0.1", 10003); clientSslSocket3.setReuseAddress(true); checkOutputIsOK(clientSslSocket3); clientSslSocket3.close(); SSLSocket clientSslSocket4 = (SSLSocket) dynamicSSLContextSocketFactory.createSocket("localhost", 10000); clientSslSocket4.setReuseAddress(true); checkOutputIsOK(clientSslSocket4); clientSslSocket4.close(); } catch (Exception e) { e.printStackTrace(); Assert.fail(); } }); }

Target:
public void smokeTestWith4Servers() throws NoSuchAlgorithmException { SSLContext dynamicSSLContext = new DynamicSSLContext(); SSLSocketFactory dynamicSSLContextSocketFactory = dynamicSSLContext.getSocketFactory(); getAuthenticationContext("wildfly-config-dynamic-ssl-test.xml").run(() -> { try { SSLSocket clientSslSocket1 = (SSLSocket) dynamicSSLContextSocketFactory.createSocket("localhost", 10001); clientSslSocket1.setUseClientMode(true); clientSslSocket1.setReuseAddress(true); checkOutputIsOK(clientSslSocket1); clientSslSocket1.close(); SSLSocket clientSslSocket2 = (SSLSocket) dynamicSSLContextSocketFactory.createSocket("localhost", 10002); clientSslSocket2.setReuseAddress(true); checkOutputIsOK(clientSslSocket2); clientSslSocket2.close(); SSLSocket clientSslSocket3 = (SSLSocket) dynamicSSLContextSocketFactory.createSocket("127.0.0.1", 10003); clientSslSocket3.setReuseAddress(true); checkOutputIsOK(clientSslSocket3); clientSslSocket3.close(); SSLSocket clientSslSocket4 = (SSLSocket) dynamicSSLContextSocketFactory.createSocket("localhost", 10000); clientSslSocket4.setReuseAddress(true); checkOutputIsOK(clientSslSocket4); clientSslSocket4.close(); } catch (Exception e) { Assert.fail(); } }); }
Source:
private ParentWrapper getParentWrapper(ParentObject parentObject) { ParentWrapper parentWrapper = null; int numHelperItems = mHelperItemList.size(); for (int i = 0; i < numHelperItems; i++) { Object helperItem = mHelperItemList.get(i); if (helperItem instanceof ParentWrapper) { if (((ParentWrapper) helperItem).getParentObject().equals(parentObject)) { parentWrapper = (ParentWrapper) helperItem; } } } return parentWrapper; }

Target:
private ParentWrapper getParentWrapper(ParentObject parentObject) { int numHelperItems = mHelperItemList.size(); for (int i = 0; i < numHelperItems; i++) { Object helperItem = mHelperItemList.get(i); if (helperItem instanceof ParentWrapper) { if (((ParentWrapper) helperItem).getParentObject().equals(parentObject)) { return (ParentWrapper) helperItem; } } } return null; }
Source:
private void checkErrorListener(ObservableValue<? extends Boolean> value, Boolean oldValue, Boolean newValue) { ObservableList<String> styleClass = this.getStyleClass(); if (newValue) { styleClass.removeAll("error"); styleClass.add("error"); } else { styleClass.removeAll("error"); } }

Target:
private void checkErrorListener(ObservableValue<? extends Boolean> value, Boolean oldValue, Boolean newValue) { ObservableList<String> styleClass = this.getStyleClass(); styleClass.removeAll("error"); if (newValue) { styleClass.add("error"); } }
Source:
protected boolean shouldAddToNotFoundCache( final ResourceStoreRequest request ) { boolean shouldAddToNFC = super.shouldAddToNotFoundCache( request ); if ( shouldAddToNFC ) { shouldAddToNFC = getProxyMode() == null || getProxyMode().shouldProxy(); if ( !shouldAddToNFC && getLogger().isDebugEnabled() ) { getLogger().debug( String.format( "Repository '%s' is in proxy mode '%s', not adding path '%s' to NFC", getId(), getProxyMode(), request.getRequestPath() ) ); } } return shouldAddToNFC; }

Target:
protected boolean shouldAddToNotFoundCache( final ResourceStoreRequest request ) { boolean shouldAddToNFC = super.shouldAddToNotFoundCache( request ); if ( shouldAddToNFC ) { shouldAddToNFC = getProxyMode() == null || getProxyMode().shouldProxy(); if ( !shouldAddToNFC && getLogger().isDebugEnabled() ) { getLogger().debug( String.format( "Proxy repository '%s' is is not allowed to issue remote requests (%s), not adding path '%s' to NFC", getId(), getProxyMode(), request.getRequestPath() ) ); } } return shouldAddToNFC; }
Source:
protected ParametersAction createParameters(GerritTriggeredEvent event, Job project) { List<ParameterValue> parameters = getDefaultParametersValues(project); setOrCreateParameters(event, project, parameters); try { Constructor<ParametersAction> constructor = ParametersAction.class.getConstructor(List.class, Collection.class); return constructor.newInstance(parameters, GerritTriggerParameters.getNamesSet()); } catch (NoSuchMethodException e) { logger.debug("Running on an old core before safe parameters, we are safe.", e); } catch (IllegalAccessException e) { logger.warn("Running on a core with safe parameters fix available, but not allowed to specify them", e); } catch (Exception e) { logger.warn("Running on a core with safe parameters fix available, but failed to provide them", e); } return new ParametersAction(parameters); }

Target:
protected ParametersAction createParameters(GerritTriggeredEvent event, Job project) { List<ParameterValue> parameters = getDefaultParametersValues(project); setOrCreateParameters(event, project, parameters); try { Constructor<ParametersAction> constructor = ParametersAction.class.getConstructor(List.class, Collection.class); return constructor.newInstance(parameters, GerritTriggerParameters.getNamesSet()); } catch (NoSuchMethodException e) { ParametersActionInspection inspection = getParametersInspection(); if (inspection.isInspectionFailure()) { logger.warn("Failed to inspect ParametersAction to determine " + "if we can behave normally around SECURITY-170.\nSee " + "<LINK_0>" + " for information."); } else if (inspection.isHasSafeParameterConfig()) { StringBuilder txt = new StringBuilder( "Running on a core with SECURITY-170 fixed but no direct way for Gerrit Trigger" + " to self-specify safe parameters."); txt.append(" You should consider upgrading to a new Jenkins core version.\n"); if (inspection.isKeepUndefinedParameters()) { txt.append(".keepUndefinedParameters is set so the trigger should behave normally."); } else if (inspection.isSafeParametersSet()) { txt.append("All Gerrit related parameters are set in .safeParameters"); txt.append(" so the trigger should behave normally."); } else { txt.append("No overriding system properties appears to be set,"); txt.append(" your builds might not work as expected.\n"); txt.append("See <LINK_0>"); txt.append(" for information."); } logger.warn(txt.toString()); } else { logger.debug("Running on an old core before safe parameters, we should be safe.", e); } } catch (IllegalAccessException e) { logger.warn("Running on a core with safe parameters fix available, but not allowed to specify them", e); } catch (Exception e) { logger.warn("Running on a core with safe parameters fix available, but failed to provide them", e); } return new ParametersAction(parameters); }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { if (!config.containsMacro("port")) { config.validate(); } }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { config.validate(); }
Source:
public CompletableFuture<Void> joinGame(Game game, String password) { if (isRunning()) { log.debug("Game is running, ignoring join request"); return completedFuture(null); } if (!preferencesService.isGamePathValid()) { CompletableFuture<Path> gameDirectoryFuture = new CompletableFuture<>(); eventBus.post(new GameDirectoryChooseEvent(gameDirectoryFuture)); return gameDirectoryFuture.thenCompose(path -> joinGame(game, password)); } log.info("Joining game: '{}' ({})", game.getTitle(), game.getId()); stopSearchLadder1v1(); Map<String, Integer> featuredModVersions = game.getFeaturedModVersions(); Set<String> simModUIds = game.getSimMods().keySet(); return modService.getFeaturedMod(game.getFeaturedMod()) .thenCompose(featuredModBean -> updateGameIfNecessary(featuredModBean, null, featuredModVersions, simModUIds)) .thenAccept(aVoid -> { try { modService.enableSimMods(simModUIds); } catch (IOException e) { log.warn("SimMods could not be enabled", e); } }) .thenCompose(aVoid -> downloadMapIfNecessary(game.getMapFolderName())) .thenCompose(aVoid -> fafService.requestJoinGame(game.getId(), password)) .thenAccept(gameLaunchMessage -> { synchronized (currentGame) { game.setPassword(password); currentGame.set(game); } startGame(gameLaunchMessage, null, RatingMode.GLOBAL); }) .exceptionally(throwable -> { log.warn("Game could not be joined", throwable); notificationService.addImmediateErrorNotification(throwable, "games.couldNotJoin"); return null; }); }

Target:
public CompletableFuture<Void> joinGame(Game game, String password) { if (isRunning()) { log.debug("Game is running, ignoring join request"); return completedFuture(null); } if (!preferencesService.isGamePathValid()) { CompletableFuture<Path> gameDirectoryFuture = postGameDirectoryChooseEvent(); return gameDirectoryFuture.thenCompose(path -> joinGame(game, password)); } log.info("Joining game: '{}' ({})", game.getTitle(), game.getId()); stopSearchLadder1v1(); Map<String, Integer> featuredModVersions = game.getFeaturedModVersions(); Set<String> simModUIds = game.getSimMods().keySet(); return modService.getFeaturedMod(game.getFeaturedMod()) .thenCompose(featuredModBean -> updateGameIfNecessary(featuredModBean, null, featuredModVersions, simModUIds)) .thenAccept(aVoid -> { try { modService.enableSimMods(simModUIds); } catch (IOException e) { log.warn("SimMods could not be enabled", e); } }) .thenCompose(aVoid -> downloadMapIfNecessary(game.getMapFolderName())) .thenCompose(aVoid -> fafService.requestJoinGame(game.getId(), password)) .thenAccept(gameLaunchMessage -> { synchronized (currentGame) { game.setPassword(password); currentGame.set(game); } startGame(gameLaunchMessage, null, RatingMode.GLOBAL); }) .exceptionally(throwable -> { log.warn("Game could not be joined", throwable); notificationService.addImmediateErrorNotification(throwable, "games.couldNotJoin"); return null; }); }
Source:
public static List<VmDeviceUpdate> getVmDevicesFieldsToUpdateOnNextRun( Guid vmId, VMStatus vmStatus, Object objectWithEditableDeviceFields) { List<VmDeviceUpdate> fieldList = new ArrayList<>(); if (objectWithEditableDeviceFields == null) { return fieldList; } List<Pair<EditableDeviceOnVmStatusField , Field>> pairList = BaseHandler.extractAnnotatedFields( EditableDeviceOnVmStatusField.class, objectWithEditableDeviceFields.getClass()); for (Pair<EditableDeviceOnVmStatusField, Field> pair : pairList) { EditableDeviceOnVmStatusField annotation = pair.getFirst(); Field field = pair.getSecond(); field.setAccessible(true); if (VmHandler.isUpdateValidForVmDevice(field.getName(), vmStatus)) { continue; } try { Object value = field.get(objectWithEditableDeviceFields); if (value instanceof Boolean) { addDeviceUpdateOnNextRun(vmId, annotation, null, value, fieldList); } else if (value instanceof Map) { Map<?, ?> map = (Map<?, ?>) value; for (Map.Entry<?, ?> entry : map.entrySet()) { boolean success = addDeviceUpdateOnNextRun(vmId, annotation, entry.getKey(), entry.getValue(), fieldList); if (!success) break; } } else { log.warn("VmHandler::getVmDevicesFieldsToUpdateOnNextRun: Unsupported field type: " + value.getClass().getName()); } } catch (IllegalAccessException | ClassCastException e) { log.warn("VmHandler::getVmDevicesFieldsToUpdateOnNextRun: Reflection error"); log.debug("Original exception was:", e); } } return fieldList; }

Target:
public static List<VmDeviceUpdate> getVmDevicesFieldsToUpdateOnNextRun( Guid vmId, VMStatus vmStatus, Object objectWithEditableDeviceFields) { List<VmDeviceUpdate> fieldList = new ArrayList<>(); if (objectWithEditableDeviceFields == null) { return fieldList; } List<Pair<EditableDeviceOnVmStatusField , Field>> pairList = BaseHandler.extractAnnotatedFields( EditableDeviceOnVmStatusField.class, objectWithEditableDeviceFields.getClass()); for (Pair<EditableDeviceOnVmStatusField, Field> pair : pairList) { EditableDeviceOnVmStatusField annotation = pair.getFirst(); Field field = pair.getSecond(); field.setAccessible(true); if (VmHandler.isUpdateValidForVmDevice(field.getName(), vmStatus)) { continue; } try { Object value = field.get(objectWithEditableDeviceFields); if (value instanceof Boolean) { addDeviceUpdateOnNextRun(vmId, annotation, null, value, fieldList); } else if (value instanceof Map) { Map<?, ?> map = (Map<?, ?>) value; for (Map.Entry<?, ?> entry : map.entrySet()) { boolean success = addDeviceUpdateOnNextRun(vmId, annotation, entry.getKey(), entry.getValue(), fieldList); if (!success) break; } } else { log.warn("getVmDevicesFieldsToUpdateOnNextRun: Unsupported field type: " + value.getClass().getName()); } } catch (IllegalAccessException | ClassCastException e) { log.warn("getVmDevicesFieldsToUpdateOnNextRun: Reflection error"); log.debug("Original exception was:", e); } } return fieldList; }
Source:
public void onResult(Bundle result) { Bundle.setDefusable(result, true); if (result != null && result.containsKey(AccountManager.KEY_BOOLEAN_RESULT) && !result.containsKey(AccountManager.KEY_INTENT)) { final boolean removalAllowed = result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT); if (removalAllowed) { removeAccountInternal(mAccounts, mAccount, getCallingUid()); } IAccountManagerResponse response = getResponseAndClose(); if (response != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response " + response); } try { response.onResult(result); } catch (RemoteException e) { Log.w(TAG, e.getMessage()); } } } super.onResult(result); }

Target:
public void onResult(Bundle result) { Bundle.setDefusable(result, true); if (result != null && result.containsKey(AccountManager.KEY_BOOLEAN_RESULT) && !result.containsKey(AccountManager.KEY_INTENT)) { final boolean removalAllowed = result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT); if (removalAllowed) { removeAccountInternal(mAccounts, mAccount, getCallingUid()); } IAccountManagerResponse response = getResponseAndClose(); if (response != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response " + response); } try { response.onResult(result); } catch (RemoteException e) { Slog.e(TAG, "Error calling onResult()", e); } } } super.onResult(result); }
Source:
public void createContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters) { List<ContinuousPlanning> containerPlannings = loadPlannings(kieContainerInstance.getKieContainer().getClassLoader()); containerContinuousPlannings.put(id, containerPlannings); boolean found = solverServiceBase.boostrapContinuousPlanning(id, containerPlannings); if (!found) { solverServiceBase.boostrapContinuousPlanning(id, globalContinuousPlannings); } }

Target:
public void createContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters) { List<RealtimePlanning> containerPlannings = loadPlannings(kieContainerInstance.getKieContainer().getClassLoader()); containerContinuousPlannings.put(id, containerPlannings); solverServiceBase.boostrapContinuousPlanning(id, containerPlannings); }
Source:
public void testPostWithLessThanOnBoundedBy() throws Exception { GeoServer gs = getGeoServer(); WFSInfo wfs = gs.getService(WFSInfo.class); wfs.setCiteCompliant(true); gs.save(wfs); try { String xml = "<wfs:GetFeature service='WFS' version='2.0.0' " + "outputFormat='text/xml; subtype=gml/3.2' " + "xmlns:sf=\"<LINK_1>\" " + "xmlns:gml='" + GML.NAMESPACE + "' " + "xmlns:wfs='" + WFS.NAMESPACE + "' " + "xmlns:fes='" + FES.NAMESPACE + "'>" + "<wfs:Query typeNames='sf:PrimitiveGeoFeature'>" + "<fes:Filter>" + "<fes:PropertyIsLessThanOrEqualTo matchAction=\"Any\" matchCase=\"true\">\n" + " <fes:Literal>\n" + " <gml:Envelope xmlns:gml=\"<LINK_0>\"\n" + " srsName=\"urn:ogc:def:crs:EPSG::4326\">\n" + " <gml:lowerCorner>-90 -180</gml:lowerCorner>\n" + " <gml:upperCorner>90 180</gml:upperCorner>\n" + " </gml:Envelope>\n" + " </fes:Literal>\n" + " <fes:ValueReference>gml:boundedBy</fes:ValueReference>\n" + " </fes:PropertyIsLessThanOrEqualTo>" + "</fes:Filter>" + "</wfs:Query>" + "</wfs:GetFeature>"; MockHttpServletResponse response = postAsServletResponse("wfs", xml); System.out.println(response.getContentAsString()); assertEquals(500, response.getStatus()); Document doc = dom(new ByteArrayInputStream(response.getContentAsByteArray())); checkOws11Exception(doc, "2.0.0", WFSException.OPERATION_PROCESSING_FAILED, "GetFeature"); } finally { wfs.setCiteCompliant(false); gs.save(wfs); } }

Target:
public void testPostWithLessThanOnBoundedBy() throws Exception { GeoServer gs = getGeoServer(); WFSInfo wfs = gs.getService(WFSInfo.class); wfs.setCiteCompliant(true); gs.save(wfs); try { String xml = "<wfs:GetFeature service='WFS' version='2.0.0' " + "outputFormat='text/xml; subtype=gml/3.2' " + "xmlns:sf=\"<LINK_1>\" " + "xmlns:gml='" + GML.NAMESPACE + "' " + "xmlns:wfs='" + WFS.NAMESPACE + "' " + "xmlns:fes='" + FES.NAMESPACE + "'>" + "<wfs:Query typeNames='sf:PrimitiveGeoFeature'>" + "<fes:Filter>" + "<fes:PropertyIsLessThanOrEqualTo matchAction=\"Any\" matchCase=\"true\">\n" + " <fes:Literal>\n" + " <gml:Envelope xmlns:gml=\"<LINK_0>\"\n" + " srsName=\"urn:ogc:def:crs:EPSG::4326\">\n" + " <gml:lowerCorner>-90 -180</gml:lowerCorner>\n" + " <gml:upperCorner>90 180</gml:upperCorner>\n" + " </gml:Envelope>\n" + " </fes:Literal>\n" + " <fes:ValueReference>gml:boundedBy</fes:ValueReference>\n" + " </fes:PropertyIsLessThanOrEqualTo>" + "</fes:Filter>" + "</wfs:Query>" + "</wfs:GetFeature>"; MockHttpServletResponse response = postAsServletResponse("wfs", xml); assertEquals(500, response.getStatus()); Document doc = dom(new ByteArrayInputStream(response.getContentAsByteArray())); checkOws11Exception(doc, "2.0.0", WFSException.OPERATION_PROCESSING_FAILED, "GetFeature"); } finally { wfs.setCiteCompliant(false); gs.save(wfs); } }
Source:
public void debug(Object arg0, Throwable arg1) { log.debug(addCorrelationIdToMessage(arg0), arg1); }

Target:
public void debug(Object arg0, Throwable arg1) { log.debug(addPrefixToLogMessage(arg0), arg1); }
Source:
public ServiceCachingPolicyBuilder withBlockWhenExhausted(boolean blockWhenExhausted) { this._blockWhenExhausted = blockWhenExhausted; return this; }

Target:
public ServiceCachingPolicyBuilder withBlockWhenExhausted(boolean blockWhenExhausted) { _blockWhenExhausted = blockWhenExhausted; return this; }
Source:
public Map<Data, QueryableEntry> invoke(Map<Data, QueryableEntry> map) { if (isExpirable()) { long now = Clock.currentTimeMillis(); for (Map.Entry<Data, QueryableEntry> entry : map.entrySet()) { QueryableEntry queryableEntry = entry.getValue(); queryableEntry.getRecord().onAccessSafe(now); } } return map; }

Target:
public Map<Data, QueryableEntry> invoke(Map<Data, QueryableEntry> map) { if (isExpirable()) { return new ExpirationAwareHashMapDelegate(map); } return map; }
Source:
private synchronized void buildListener(AdvertisedDataSource ads) { if (m_shutdown) return; final ExportDecoderBase edb = m_client.constructExportDecoder(ads); detectDecoder(m_client, edb); Pair<ExportDecoderBase, AdvertisedDataSource> pair = Pair.of(edb, ads); m_decoders.add(pair); final ListenableFuture<BBContainer> fut = m_source.poll(); addBlockListener(m_source, fut, edb); }

Target:
private void buildListener(AdvertisedDataSource ads) { if (m_shutdown) return; final ExportDecoderBase edb = m_client.constructExportDecoder(ads); detectDecoder(m_client, edb); Pair<ExportDecoderBase, AdvertisedDataSource> pair = Pair.of(edb, ads); m_decoders.add(pair); final ListenableFuture<BBContainer> fut = m_source.poll(); addBlockListener(m_source, fut, edb); }
Source:
private EmbeddedCacheManager createCacheManager(String name1, JChannel ch1) { GlobalConfigurationBuilder gcb1 = new GlobalConfigurationBuilder(); gcb1.transport().defaultTransport().nodeName(ch1.getName()).distributedSyncTimeout(10, SECONDS); CustomChannelLookup.registerChannel(gcb1, ch1, name1, false); ConfigurationBuilder replCfg = new ConfigurationBuilder(); replCfg.clustering().cacheMode(CacheMode.REPL_SYNC); replCfg.clustering().stateTransfer().timeout(10, SECONDS); EmbeddedCacheManager cm1 = new DefaultCacheManager(gcb1.build(), replCfg.build(), false); registerCacheManager(cm1); cm1.defineConfiguration(CACHE_NAME, replCfg.build()); return cm1; }

Target:
private EmbeddedCacheManager createCacheManager(String name1, JChannel ch1) { GlobalConfigurationBuilder gcb1 = new GlobalConfigurationBuilder(); gcb1.transport().nodeName(ch1.getName()).distributedSyncTimeout(10, SECONDS); CustomChannelLookup.configureTransportWithChannel(gcb1, ch1, name1, false); ConfigurationBuilder replCfg = new ConfigurationBuilder(); replCfg.clustering().cacheMode(CacheMode.REPL_SYNC); replCfg.clustering().stateTransfer().timeout(10, SECONDS); EmbeddedCacheManager cm1 = new DefaultCacheManager(gcb1.build(), replCfg.build(), false); registerCacheManager(cm1); cm1.defineConfiguration(CACHE_NAME, replCfg.build()); return cm1; }
Source:
public static OSTime getTime() { return time; }

Target:
static OSTime getTime() { return time; }
Source:
protected Object getFieldValue(ITmfEvent event, String field) { Object value = null; if (ITmfEvent.EVENT_FIELD_CONTENT.equals(field)) { value = event.getContent().toString(); } else if (ITmfEvent.EVENT_FIELD_TYPE.equals(field)) { value = event.getType().getName(); } else if (ITmfEvent.EVENT_FIELD_TIMESTAMP.equals(field)) { value = event.getTimestamp().toString(); } else if (ITmfEvent.EVENT_FIELD_SOURCE.equals(field)) { value = event.getSource(); } else if (ITmfEvent.EVENT_FIELD_REFERENCE.equals(field)) { value = event.getReference(); } else { ITmfEventField eventField; if (!(field.startsWith("/"))) { eventField = event.getContent().getField(field); } else { String[] array = SUBFIELD_SPLIT_PATTERN.split(field.substring(1)); for (int i = 0; i < array.length; i++) { array[i] = SUBFIELD_SLASH_PATTERN.matcher(array[i]).replaceAll("/"); } eventField = event.getContent().getSubField(array); } if (eventField != null) { value = eventField.getValue(); } } return value; }

Target:
protected Object getFieldValue(ITmfEvent event, String field) { Object value = null; if (ITmfEvent.EVENT_FIELD_CONTENT.equals(field)) { value = event.getContent().toString(); } else if (ITmfEvent.EVENT_FIELD_TYPE.equals(field)) { value = event.getType().getName(); } else if (ITmfEvent.EVENT_FIELD_TIMESTAMP.equals(field)) { value = event.getTimestamp().toString(); } else if (ITmfEvent.EVENT_FIELD_SOURCE.equals(field)) { value = event.getSource(); } else if (ITmfEvent.EVENT_FIELD_REFERENCE.equals(field)) { value = event.getReference(); } else { ITmfEventField eventField; if (!(field.startsWith(SLASH_STRING))) { eventField = event.getContent().getField(field); } else { List<String> list = getPathList(field); eventField = event.getContent().getSubField(list.toArray(new String[list.size()])); } if (eventField != null) { value = eventField.getValue(); } } return value; }
Source:
private static byte[] encodeRowName(long startTimestamp) { long row = (startTimestamp / PARTITIONING_QUANTUM) * ROWS_PER_QUANTUM + (startTimestamp % PARTITIONING_QUANTUM) % ROWS_PER_QUANTUM; byte[] rowName = ValueType.VAR_LONG.convertFromJava(row); EncodingUtils.reverseBits(rowName); return rowName; }

Target:
private static byte[] encodeRowName(long startTimestamp) { long row = (startTimestamp / PARTITIONING_QUANTUM) * ROWS_PER_QUANTUM + (startTimestamp % PARTITIONING_QUANTUM) % ROWS_PER_QUANTUM; return PtBytes.toBytes(Long.reverse(row)); }
Source:
public static MerlinsBeard from(Context context) { return new MerlinsBeard(context); }

Target:
public static MerlinsBeard from(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE); return new MerlinsBeard(connectivityManager); }
Source:
void beforeCreate() { createdAt = Instant.now(); }

Target:
void beforeCreate() { this.setCreatedAt(Instant.now()); }
Source:
public ActionResult execute() throws EntityDoesNotExistException { new GateKeeper().verifyInstructorPrivileges(account); ArrayList<CourseDetailsBundle> allCourses = new ArrayList<CourseDetailsBundle>( logic.getCourseSummariesForInstructor(account.googleId).values()); InstructorCoursesPageData data = new InstructorCoursesPageData(account); data.init(allCourses, "", ""); if (allCourses.size() == 0 ){ statusToUser.add(Const.StatusMessages.COURSE_EMPTY); } statusToAdmin = "instructorCourse Page Load<br>" + "Total courses: " + allCourses.size(); ShowPageResult response = createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSES, data); return response; }

Target:
public ActionResult execute() throws EntityDoesNotExistException { new GateKeeper().verifyInstructorPrivileges(account); List<CourseDetailsBundle> allCourses = new ArrayList<CourseDetailsBundle>( logic.getCourseSummariesForInstructor(account.googleId).values()); CourseDetailsBundle.sortDetailedCoursesByCourseId(allCourses); List<CourseDetailsBundle> activeCourses = logic.extractActiveCourses(allCourses, account.googleId); List<CourseDetailsBundle> archivedCourses = logic.extractArchivedCourses(allCourses, account.googleId); InstructorCoursesPageData data = new InstructorCoursesPageData(account); List<CourseAttributes> courseList = logic.getCoursesForInstructor(data.account.googleId); Map<String, InstructorAttributes> instructorsForCourses = new HashMap<String, InstructorAttributes>(); for (CourseAttributes course : courseList) { instructorsForCourses.put(course.id, logic.getInstructorForGoogleId(course.id, data.account.googleId)); } data.init(activeCourses, archivedCourses, instructorsForCourses); if (allCourses.size() == 0 ){ statusToUser.add(Const.StatusMessages.COURSE_EMPTY); } statusToAdmin = "instructorCourse Page Load<br>Total courses: " + allCourses.size(); ShowPageResult response = createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSES, data); return response; }
Source:
public boolean contains(T item) { final Object itemIdentifier = getDataProvider().getId(item); Objects.requireNonNull(itemIdentifier, "Identity Provider should not return null"); return getItems().anyMatch(i -> getDataProvider().getId(i) .equals(itemIdentifier)); }

Target:
public boolean contains(T item) { final ListDataProvider<T> dataProvider = getDataProvider(); final Object itemIdentifier = getIdentifier(item, dataProvider); return getItems().anyMatch(i -> itemIdentifier.equals( getIdentifier(i, dataProvider))); }
Source:
public boolean equals(Object obj) { if (obj == null || obj.getClass() != P12CredentialOptions.class) { return false; } P12CredentialOptions other = (P12CredentialOptions) obj; return Objects.equal(keyFile, other.keyFile); }

Target:
public boolean equals(Object obj) { if (obj == null || obj.getClass() != P12CredentialOptions.class) { return false; } P12CredentialOptions other = (P12CredentialOptions) obj; return Objects.equal(keyFile, other.keyFile) && Objects.equal(serviceAccount, other.serviceAccount); }
Source:
public void put(long address, ILogData entry) { log.info("LogUnitServerCache.put: Cache write[{} : {}]", address, entry); if (entry instanceof LogData) { ((LogData)entry).serializeMetadata(); log.info("Size Estimate - " + entry.getSizeEstimate() + "Deep Size - " + sizeOf.deepSizeOf(entry)); } dataCache.put(address, entry); log.info("Size Estimate After - " + entry.getSizeEstimate() + " Deep Size After - " + sizeOf.deepSizeOf(entry)); }

Target:
public void put(long address, ILogData entry) { log.info("LogUnitServerCache.put: Cache write[{} : {}]", address, entry); if (entry instanceof LogData && !(streamLog instanceof InMemoryStreamLog)) { ((LogData)entry).serializeMetadata(); } dataCache.put(address, entry); }
Source:
public Resource getResource(URI uri, boolean loadOnDemand) { checkNotDisposed(); final Resource cached = getURIResourceMap().get(uri); if (cached != null) { return cached; } final Resource resource; final IStorage storage = storageToURI.get(uri); if (loadOnDemand && storage != null) { resource = load(storage, uri, new NullProgressMonitor()); } else if (loadingResourceSet) { resource = super.getResource(uri, true); } else { ILoadOnDemandPolicy.Registry registry = EMFCompareRCPPlugin.getDefault() .getLoadOnDemandPolicyRegistry(); if (registry.hasAnyAuthorizingPolicy(uri)) { resource = super.getResource(uri, true); } else { resource = super.getResource(uri, false); } } return resource; }

Target:
public Resource getResource(URI uri, boolean loadOnDemand) { checkNotDisposed(); final Resource cached = getURIResourceMap().get(uri); if (cached != null) { return cached; } final Resource resource; final IStorage storage = storageToURI.get(uri); if (loadOnDemand && storage != null) { resource = load(storage, uri, new NullProgressMonitor()); } else if (allowResourceLoad) { resource = super.getResource(uri, true); } else { ILoadOnDemandPolicy.Registry registry = EMFCompareRCPPlugin.getDefault() .getLoadOnDemandPolicyRegistry(); if (registry.hasAnyAuthorizingPolicy(uri)) { resource = super.getResource(uri, true); } else { resource = super.getResource(uri, false); } } return resource; }
Source:
private DatabaseClient(final String url) { MongoClient mongoClient = null; try { mongoClient = new MongoClient(url); } catch (UnknownHostException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); } if (mongoClient == null) { return; } database = mongoClient.getDB("submissions"); if (database == null) { LOG.info("Db is null!"); } else { setUpIndexes(); } }

Target:
private DatabaseClient(final String url) { MongoClient mongoClient = null; try { mongoClient = new MongoClient(url); } catch (UnknownHostException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } if (mongoClient == null) { return; } database = mongoClient.getDB("submissions"); if (database == null) { LOG.error("Db is null!"); } else { setUpIndexes(); } }
Source:
private boolean hostHasPpcArchitecture() { Cluster cluster = getModel().getSelectedCluster(); if (cluster == null) { return false; } ArchitectureType archType = cluster.getArchitecture(); return ArchitectureType.ppc64.equals(archType) || ArchitectureType.ppc64le.equals(archType) || ArchitectureType.ppcle.equals(archType); }

Target:
private boolean hostHasPpcArchitecture() { Cluster cluster = getModel().getSelectedCluster(); return cluster != null && cluster.getArchitecture() != null && ArchitectureType.ppc.equals(cluster.getArchitecture().getFamily()); }
Source:
private boolean isMetaDataElement(WikiParameters parameters) { if (parameters.getParameter(CLASS_ATTRIBUTE) != null) { return METADATA_CONTAINER_CLASS.equals(parameters.getParameter(CLASS_ATTRIBUTE).getValue()); } return false; }

Target:
private boolean isMetaDataElement(WikiParameters parameters) { return parameters.getParameter(CLASS_ATTRIBUTE) != null && METADATA_CONTAINER_CLASS.equals(parameters.getParameter(CLASS_ATTRIBUTE).getValue()); }