auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public FracturedLoyalty(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}"); this.subtype.add(SubType.AURA); TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new FracturedLoyaltyTriggeredAbility(), AttachmentType.AURA, Duration.WhileOnBattlefield, "Whenever enchanted creature becomes the target of a spell or ability, that spell or ability's controller gains control of that creature."))); }

Target:
public FracturedLoyalty(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}"); this.subtype.add(SubType.AURA); TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); this.addAbility(new FracturedLoyaltyTriggeredAbility()); }
Source:
public void before() { Resource resource = mock(Resource.class); ModuleDefinition sinkDefinition = new ModuleDefinition(ModuleType.SINK.getTypeName(), ModuleType.SINK.getTypeName(), resource); ModuleDefinition sourceDefinition = new ModuleDefinition(ModuleType.SOURCE.getTypeName(), ModuleType.SOURCE.getTypeName(), resource); ArrayList<ModuleDefinition> definitions = new ArrayList<ModuleDefinition>(); definitions.add(new ModuleDefinition(ModuleType.SOURCE.getTypeName(), ModuleType.SOURCE.getTypeName(), resource)); when(moduleRegistry.findDefinitions(ModuleType.SOURCE.getTypeName())).thenReturn(definitions); when(moduleRegistry.findDefinitions("time")).thenReturn(definitions); when(moduleRegistry.lookup("time", "source")).thenReturn(sourceDefinition); definitions = new ArrayList<ModuleDefinition>(); definitions.add(new ModuleDefinition(ModuleType.SINK.getTypeName(), ModuleType.SINK.getTypeName(), resource)); when(moduleRegistry.findDefinitions(ModuleType.SINK.getTypeName())).thenReturn(definitions); when(moduleRegistry.findDefinitions("log")).thenReturn(definitions); when(moduleRegistry.lookup("log", "sink")).thenReturn(sourceDefinition); definitions = new ArrayList<ModuleDefinition>(); definitions.add(new ModuleDefinition(ModuleType.PROCESSOR.getTypeName(), ModuleType.PROCESSOR.getTypeName(), resource)); when(moduleRegistry.findDefinitions(ModuleType.PROCESSOR.getTypeName())).thenReturn(definitions); }

Target:
public void before() { Resource resource = mock(Resource.class); ModuleDefinition sinkDefinition = new ModuleDefinition(ModuleType.SINK.getTypeName(), ModuleType.SINK.getTypeName(), resource); ModuleDefinition sourceDefinition = new ModuleDefinition(ModuleType.SOURCE.getTypeName(), ModuleType.SOURCE.getTypeName(), resource); ArrayList<ModuleDefinition> definitions = new ArrayList<ModuleDefinition>(); definitions.add(new ModuleDefinition(ModuleType.SOURCE.getTypeName(), ModuleType.SOURCE.getTypeName(), resource)); when(moduleRegistry.findDefinitions(ModuleType.SOURCE.getTypeName())).thenReturn(definitions); when(moduleRegistry.findDefinitions("time")).thenReturn(definitions); when(moduleRegistry.lookup("time", "source")).thenReturn(sourceDefinition); definitions = new ArrayList<ModuleDefinition>(); definitions.add(new ModuleDefinition(ModuleType.SINK.getTypeName(), ModuleType.SINK.getTypeName(), resource)); when(moduleRegistry.findDefinitions(ModuleType.SINK.getTypeName())).thenReturn(definitions); when(moduleRegistry.findDefinitions("log")).thenReturn(definitions); when(moduleRegistry.lookup("log", "sink")).thenReturn(sinkDefinition); definitions = new ArrayList<ModuleDefinition>(); definitions.add(new ModuleDefinition(ModuleType.PROCESSOR.getTypeName(), ModuleType.PROCESSOR.getTypeName(), resource)); when(moduleRegistry.findDefinitions(ModuleType.PROCESSOR.getTypeName())).thenReturn(definitions); }
Source:
public void storeDescriptor(Map<String, String> props, String namePrefix) { if(namePrefix == null) namePrefix = ""; props.put(namePrefix + STUN_ADDRESS, getAddress()); if(getPort() != -1) props.put(namePrefix + STUN_PORT, Integer.toString( getPort() )); if (getUsername() != null && getUsername().length > 0) try { props.put(namePrefix + STUN_USERNAME, StringUtils.toString(getUsername(), StandardCharsets.UTF_8.name())); } catch (UnsupportedEncodingException e) { props.put(namePrefix + STUN_USERNAME, getUsername().toString()); } if (getPassword() != null && getPassword().length > 0) { props.put(namePrefix + "." + STUN_PASSWORD, new String(getPassword())); } props.put(namePrefix + STUN_IS_TURN_SUPPORTED, Boolean.toString( isTurnSupported() )); }

Target:
public void storeDescriptor(Map<String, String> props, String namePrefix) { if(namePrefix == null) namePrefix = ""; props.put(namePrefix + STUN_ADDRESS, getAddress()); if(getPort() != -1) props.put(namePrefix + STUN_PORT, Integer.toString( getPort() )); if (getUsername() != null && getUsername().length > 0) props.put(namePrefix + STUN_USERNAME, StringUtils.toEncodedString(getUsername(), StandardCharsets.UTF_8)); if (getPassword() != null && getPassword().length > 0) { props.put(namePrefix + "." + STUN_PASSWORD, new String(getPassword())); } props.put(namePrefix + STUN_IS_TURN_SUPPORTED, Boolean.toString( isTurnSupported() )); }
Source:
public String toString() { return schemaName + ":" + tableName + ":" + analyzeHandle; }

Target:
public String toString() { return toStringHelper(this) .add("schemaName", schemaName) .add("tableName", tableName) .add("analyzePartitionValues", analyzePartitionValues) .toString(); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof CleanUpDomainCommand)) return false; if (!super.equals(o)) return false; CleanUpDomainCommand that = (CleanUpDomainCommand) o; if (_domainCleanUp != null ? !_domainCleanUp.equals(that._domainCleanUp) : that._domainCleanUp != null) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof CleanUpDomainCommand)) { return false; } CleanUpDomainCommand that = (CleanUpDomainCommand) o; return super.equals(that) && Objects.equals(_domainCleanUp, that._domainCleanUp); }
Source:
private void emitContentLengthMismatchFailureEvent(final BulkObject ds3Object, final Throwable t) { final FailureEvent failureEvent = new FailureEvent.Builder() .doingWhat(FailureEvent.FailureActivity.GettingObject) .usingSystemWithEndpoint(client.getConnectionDetails().getEndpoint()) .withCausalException(t) .withObjectNamed(ds3Object.getName()) .build(); emitFailureEvent(failureEvent); }

Target:
private void emitContentLengthMismatchFailureEvent(final BulkObject ds3Object, final Throwable t) { final FailureEvent failureEvent = FailureEvent.builder() .doingWhat(FailureEvent.FailureActivity.GettingObject) .usingSystemWithEndpoint(client.getConnectionDetails().getEndpoint()) .withCausalException(t) .withObjectNamed(ds3Object.getName()) .build(); emitFailureEvent(failureEvent); }
Source:
public Map<String, String> toConfig(Config jobConfig, Config tableConfig) { final Gson gson = new GsonBuilder().excludeFieldsWithModifiers(Modifier.TRANSIENT, Modifier.STATIC).create(); return Collections.singletonMap(String.format("%s.%s", getTableId(), this.getClass().getCanonicalName()), gson.toJson(this)); }

Target:
public Map<String, String> toConfig(Config jobConfig, Config tableConfig) { return Collections.singletonMap(this.getClass().getSimpleName(), SerdeUtils.toJson("table retry policy", this)); }
Source:
boolean canReconnectNow() { return System.currentTimeMillis() >= nextReconnectionTime; }

Target:
boolean canReconnectNow() { return nextReconnectionTime == Long.MIN_VALUE || System.nanoTime() >= nextReconnectionTime; }
Source:
public void testCastOptimization() { assertOptimizedEquals("cast(bound_integer as VARCHAR)", "'1234'"); assertOptimizedEquals("cast(bound_long as VARCHAR)", "'1234'"); assertOptimizedEquals("cast(bound_integer + 1 as VARCHAR)", "'1235'"); assertOptimizedEquals("cast(bound_long + 1 as VARCHAR)", "'1235'"); assertOptimizedEquals("cast(unbound_string as VARCHAR)", "cast(unbound_string as VARCHAR)"); assertOptimizedMatches("cast(unbound_string as VARCHAR)", "unbound_string"); assertOptimizedMatches("cast(unbound_integer as INTEGER)", "unbound_integer"); }

Target:
public void testCastOptimization() { assertOptimizedEquals("cast(bound_integer as VARCHAR)", "'1234'"); assertOptimizedEquals("cast(bound_long as VARCHAR)", "'1234'"); assertOptimizedEquals("cast(bound_integer + 1 as VARCHAR)", "'1235'"); assertOptimizedEquals("cast(bound_long + 1 as VARCHAR)", "'1235'"); assertOptimizedEquals("cast(unbound_string as VARCHAR)", "cast(unbound_string as VARCHAR)"); assertOptimizedMatches("cast(unbound_string as VARCHAR)", "unbound_string"); assertOptimizedMatches("cast(unbound_integer as INTEGER)", "unbound_integer"); assertOptimizedMatches("cast(unbound_string as VARCHAR(10))", "cast(unbound_string as VARCHAR(10))"); }
Source:
public void cancelRepeatPrompt() { analytics.logEvent(ADD_REPEAT, "InlineDecline"); FormController formController = this.formController; if (jumpBackIndex != null) { formController.jumpToIndex(jumpBackIndex); jumpBackIndex = null; } else { try { this.formController.stepToNextScreenEvent(); } catch (JavaRosaException exception) { error.setValue(exception.getCause().getMessage()); } } }

Target:
public void cancelRepeatPrompt() { if (formController == null) { return; } analytics.logEvent(ADD_REPEAT, "InlineDecline", formController.getCurrentFormIdentifierHash()); if (jumpBackIndex != null) { formController.jumpToIndex(jumpBackIndex); jumpBackIndex = null; } else { try { this.formController.stepToNextScreenEvent(); } catch (JavaRosaException exception) { error.setValue(exception.getCause().getMessage()); } } }
Source:
public void reset(Site site) { currentAge = 0; cards.clear(); for (FeedClientInterface client : currentScript) { client.cancel(); } currentScript.clear(); cards.clear(); currentScript.add(new BecauseYouReadClient(site)); currentScript.add(new ContinueReadingClient()); getNextCard(); }

Target:
public void reset(Site site) { currentAge = 0; cards.clear(); for (FeedClientInterface client : currentScript) { client.cancel(); } currentScript.clear(); cards.clear(); buildScript(site); getNextCard(); }
Source:
void addExternalEncoding(final DataSeries dataSeries, final EncodingParams params, final ExternalCompressor compressor) { header.externalIds.add(dataSeries.ordinal()); header.externalCompressors.put(dataSeries.ordinal(), compressor); header.encodingMap.put(dataSeries, params); }

Target:
private void addExternalEncoding(final DataSeries dataSeries, final EncodingParams params, final ExternalCompressor compressor) { header.externalIds.add(dataSeries.getExternalBlockContentId()); header.externalCompressors.put(dataSeries.getExternalBlockContentId(), compressor); header.encodingMap.put(dataSeries, params); }
Source:
public static TokenEndpointResponse swapJWTForTokens(HttpAccess httpAccessor, URI loginServerUrl, String jwt) throws IOException, URISyntaxException, OAuthFailedException { FormBody.Builder formBodyBuilder = new FormBody.Builder() .add(GRANT_TYPE, JWT_BEARER) .add(ASSERTION, jwt); TokenEndpointResponse tr = makeTokenEndpointRequest(httpAccessor, loginServerUrl, formBodyBuilder); return tr; }

Target:
public static TokenEndpointResponse swapJWTForTokens(HttpAccess httpAccessor, URI loginServerUrl, String jwt) throws IOException, URISyntaxException, OAuthFailedException { FormBody.Builder formBodyBuilder = new FormBody.Builder() .add(GRANT_TYPE, JWT_BEARER) .add(ASSERTION, jwt); return makeTokenEndpointRequest(httpAccessor, loginServerUrl, formBodyBuilder); }
Source:
public SimplisticQuadTree getOrCreateSubTree(int x, int y, int zm) { SimplisticQuadTree result = this; while (true) { if (zm <= result.zoom) { return result; } else { result.initChildren(); int nx = (x >> (zm - result.zoom - 1)) - (result.x << 1); int ny = (y >> (zm - result.zoom - 1)) - (result.y << 1); if (nx > 1 || nx < 0 || ny > 1 || ny < 0) { return null; } result = result.children[nx * 2 + ny]; } } }

Target:
public SimplisticQuadTree getOrCreateSubTree(int x, int y, int zm) { if (zm <= zoom) { return this; } else { initChildren(); int nx = (x >> (zm - zoom - 1)) - (this.x << 1); int ny = (y >> (zm - zoom - 1)) - (this.y << 1); if (nx > 1 || nx < 0 || ny > 1 || ny < 0) { return null; } return children[nx * 2 + ny].getOrCreateSubTree(x, y, zm); } }
Source:
public void testOrder() { assertEquals(0, MethodMatchEnum.NONE.ordinal()); assertEquals(1, MethodMatchEnum.APPROXIMATE.ordinal()); assertEquals(2, MethodMatchEnum.PERFECT.ordinal()); }

Target:
public void testOrder() { assertEquals(0, MethodMatchEnum.NONE.ordinal()); assertEquals(1, MethodMatchEnum.APPROXIMATE.ordinal()); assertEquals(2, MethodMatchEnum.EXACT.ordinal()); }
Source:
public int read(int offset, int[] positions, int positionCount) throws IOException { checkState(!valuesInUse, "BlockLease hasn't been closed yet"); if (!rowGroupOpen) { openRowGroup(); } allNulls = false; if (outputRequired) { ensureValuesCapacity(positionCount, nullsAllowed && presentStream != null); } if (filter != null) { ensureOutputPositionsCapacity(positionCount); } else { outputPositions = positions; } systemMemoryContext.setBytes(getRetainedSizeInBytes()); if (readOffset < offset) { skip(offset - readOffset); } int streamPosition = 0; if (dataStream == null && presentStream != null) { streamPosition = readAllNulls(positions, positionCount); } else if (filter == null) { streamPosition = readNoFilter(positions, positionCount); } else { outputPositionCount = 0; for (int i = 0; i < positionCount; i++) { int position = positions[i]; if (position > streamPosition) { skip(position - streamPosition); streamPosition = position; } if (presentStream != null && !presentStream.nextBit()) { if (nullsAllowed) { if (outputRequired) { nulls[outputPositionCount] = true; } outputPositions[outputPositionCount] = position; outputPositionCount++; } } else { byte value = dataStream.next(); if (filter.testLong(value)) { if (outputRequired) { values[outputPositionCount] = value; if (nullsAllowed && presentStream != null) { nulls[outputPositionCount] = false; } } outputPositions[outputPositionCount] = position; outputPositionCount++; } } streamPosition++; } } readOffset = offset + streamPosition; return outputPositionCount; }

Target:
public int read(int offset, int[] positions, int positionCount) throws IOException { checkState(!valuesInUse, "BlockLease hasn't been closed yet"); if (!rowGroupOpen) { openRowGroup(); } allNulls = false; if (outputRequired) { ensureValuesCapacity(positionCount, nullsAllowed && presentStream != null); } if (filter != null) { ensureOutputPositionsCapacity(positionCount); } else { outputPositions = positions; } systemMemoryContext.setBytes(getRetainedSizeInBytes()); if (readOffset < offset) { skip(offset - readOffset); } int streamPosition = 0; if (dataStream == null && presentStream != null) { streamPosition = readAllNulls(positions, positionCount); } else if (filter == null) { streamPosition = readNoFilter(positions, positionCount); } else { streamPosition = readWithFilter(positions, positionCount); } readOffset = offset + streamPosition; return outputPositionCount; }
Source:
public void registerSettingListeners(Object o) { for(Method m : o.getClass().getMethods()) { for(Annotation a : m.getAnnotations()) { if( a instanceof SettingListener ) { Setting s = ((SettingListener) a).setting(); settingListeners.get(s).add(Pair.of(o,m)); try { m.invoke(o, getSettingValue(s)); } catch (IllegalAccessException ex) { Exceptions.printStackTrace(ex); } catch (IllegalArgumentException ex) { Exceptions.printStackTrace(ex); } catch (InvocationTargetException ex) { Exceptions.printStackTrace(ex); } break; } } } }

Target:
public void registerSettingListeners(Object o) { for(Method m : o.getClass().getMethods()) { for(Annotation a : m.getAnnotationsByType( SettingListener.class )) { Setting s = ((SettingListener) a).setting(); settingListeners.get(s).add(Pair.of(o,m)); try { m.invoke(o, s.getValue()); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { Exceptions.printStackTrace(ex); } break; } } }
Source:
private void setNumaInfoMsg(String message) { if (message == null) { message = ""; } numaInfoIcon.setText(SafeHtmlUtils.fromTrustedString(message)); }

Target:
private void setNumaInfoMsg(String message) { if (message == null) { message = ""; } numaInfoIcon.setText(applicationTemplates.italicText(message)); }
Source:
public VariantContextBuilder filter(final String filter) { makeFiltersModifiable(); if ( this.filters == null ) { filtersAsIs(new LinkedHashSet<>(1)); } this.filters.add(filter); return this; }

Target:
public VariantContextBuilder filter(final String filter) { makeFiltersModifiable(); this.filters.add(filter); return this; }
Source:
private void readCentralDirectoryFileHeaders(ZipFileData fileData, DataInputSource dataInputSource, long fileOffset, Charset charset, long count) throws IOException { try { long position = fileOffset; for (long i = 0; i < count; ++i) { position += CentralDirectoryFileHeader.read(fileData, dataInputSource, position, charset); } } catch (ZipException e) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, e); } }

Target:
private void readCentralDirectoryFileHeaders(ZipFileData fileData, DataInputSource dataInputSource, long fileOffset, Charset charset, long count) throws IOException { try { long position = fileOffset; for (long i = 0; i < count; i++) { position += CentralDirectoryFileHeader.read(fileData, dataInputSource, position, charset); } } catch (ZipException e) { throw new PrestoException(DRUID_SEGMENT_LOAD_ERROR, e); } }
Source:
public static GitInfo readGitProperties(final String fileName) { final Properties properties = new Properties(); LOGGER.info("Retrieving git properties"); try { properties.load(GitInfo.class.getClassLoader().getResourceAsStream(fileName)); return new GitInfo(String.valueOf(properties.get("git.commit.id.abbrev")), String.valueOf(properties.get("git.build.version"))); } catch (Exception e) { LOGGER.error("Could not load git.properties", e); String propertyNotFound = "git property not found"; return new GitInfo(propertyNotFound, propertyNotFound); } }

Target:
public static GitInfo readGitProperties(final String fileName) { final Properties properties = new Properties(); LOGGER.debug("Retrieving git properties from file: " + fileName); try { properties.load(GitInfo.class.getClassLoader().getResourceAsStream(fileName)); return new GitInfo(String.valueOf(properties.get("git.commit.id.abbrev")), String.valueOf(properties.get("git.build.version"))); } catch (Exception e) { LOGGER.error("Could not load git.properties", e); String propertyNotFound = "git property not found"; return new GitInfo(propertyNotFound, propertyNotFound); } }
Source:
boolean authorize(URIish uri, CredentialsProvider credentialsProvider) { String username = null; String password = null; if (credentialsProvider != null) { Credentials credentials = credentialsProvider.getCredentials(uri); if (credentials instanceof UsernamePasswordCredentials) { UsernamePasswordCredentials usernamePasswordCredentials = (UsernamePasswordCredentials) credentials; username = usernamePasswordCredentials.getUsername(); password = usernamePasswordCredentials.getPassword(); } } else { username = uri.getUser(); password = uri.getPass(); } if (username != null) { authorize(username, password); return true; } return false; }

Target:
boolean authorize(URIish uri, CredentialsProvider credentialsProvider) { String username; String password; if (credentialsProvider != null) { if (credentialsProvider.supports(CredentialType.USERNAME, CredentialType.PASSWORD)) { username = (String) credentialsProvider.getCredentials(uri, CredentialType.USERNAME); password = (String) credentialsProvider.getCredentials(uri, CredentialType.PASSWORD); } else return false; } else { username = uri.getUser(); password = uri.getPass(); } if (username != null) { authorize(username, password); return true; } return false; }
Source:
private CisConversionResult createFailureResult(String filename, ConversionOption conversionOption, MediaType mediaType, String message) { CisConversionResult result; StringBuilder msg = new StringBuilder(); if (filename != null) { msg.append(filename); } msg.append(" " + message); LOGGER.info("Conversion not supported: " + msg.toString()); result = CisConversionResult.createFailureResult(conversionOption, mediaType, filename, msg.toString()); return result; }

Target:
private CisConversionResult createFailureResult(String filename, ConversionOption conversionOption, MediaType mediaType, String message) { CisConversionResult result; StringBuilder msg = new StringBuilder(); if (filename != null) { msg.append(filename); } msg.append(" " + message); LOGGER.warn("Conversion not supported: " + msg.toString()); result = CisConversionResult.createFailureResult(conversionOption, mediaType, filename, msg.toString()); return result; }
Source:
private void testJBossWSRuntimeEdition() { jbossWSRuntimePreferencePage.select(0); jbossWSRuntimePreferencePage.edit(); jbossWsRuntimeDialog = new JBossWSRuntimeListFieldEditor(true); jbossWsRuntimeDialog.setName(runtimeEditedName); jbossWsRuntimeDialog.finish(); new WaitWhile(new ShellIsActive(EDIT_JBOSS_WS_RUNTIME_DIALOG_TITLE)); assertRuntimeName(runtimeEditedName); }

Target:
private void testJBossWSRuntimeEdition() { jbossWSRuntimePreferencePage.select(0); jbossWSRuntimePreferencePage.edit(); jbossWsRuntimeDialog = new JBossWSRuntimeListFieldEditor(true); jbossWsRuntimeDialog.setName(runtimeEditedName); jbossWsRuntimeDialog.finish(); new WaitWhile(new ShellIsAvailable(EDIT_JBOSS_WS_RUNTIME_DIALOG_TITLE)); assertRuntimeName(runtimeEditedName); }
Source:
private static Function<String, BiFunction> fastClass(Executable member) { Class<?> hostClass = member.getDeclaringClass(); if (hostClass.getSimpleName().contains(ENHANCER_BY_GUICE_MARKER)) { hostClass = hostClass.getSuperclass(); } return FAST_CLASSES.get(hostClass); }

Target:
private static Function<String, BiFunction> fastClass(Executable member) { return FAST_CLASSES.get(member.getDeclaringClass()); }
Source:
public QueryUpdateEmitter resolveParameterValue(Message<?> message) { return CurrentUnitOfWork.map(uow -> (QueryUpdateEmitter) uow.getResource(QUERY_UPDATE_EMITTER_KEY)) .orElse(null); }

Target:
public QueryUpdateEmitter resolveParameterValue(Message<?> message) { return CurrentUnitOfWork.map(uow -> (QueryUpdateEmitter) uow.getResource(QUERY_UPDATE_EMITTER_KEY)) .orElseThrow(() -> new IllegalStateException( "QueryUpdateEmitter should have been injected")); }
Source:
public PaginatedArrayList<Host> search(String filter, boolean showArchived, boolean showSystemHost, int limit, int offset, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { try { Structure st = CacheLocator.getContentTypeCache().getStructureByVelocityVarName("Host"); String condition=""; if(showArchived){ condition=" +deleted:true"; }else { condition=" +deleted:false"; } if(UtilMethods.isSet(filter)){ condition += " +Host.hostName:"+filter.trim()+"*"; } if(!showSystemHost){ condition += " +Host.isSystemHost:false"; } PaginatedArrayList<Contentlet> list = (PaginatedArrayList<Contentlet>)APILocator.getContentletAPI().search("+structureInode:" + st.getInode() + condition, limit, offset, "Host.hostName", user, respectFrontendRoles); return convertToHostPaginatedArrayList(list); } catch (Exception e) { Logger.error(HostAPIImpl.class, e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } }

Target:
public PaginatedArrayList<Host> search(String filter, boolean showArchived, boolean showSystemHost, int limit, int offset, User user, boolean respectFrontendRoles) { try { Structure st = CacheLocator.getContentTypeCache().getStructureByVelocityVarName("Host"); StringBuilder condition = new StringBuilder( String.format(" +deleted:%b", showArchived) ); if(UtilMethods.isSet(filter)){ condition.append( String.format(" +Host.hostName:%s*", filter.trim() ) ); } if(!showSystemHost){ condition.append( " +Host.isSystemHost:false" ); } PaginatedArrayList<Contentlet> list = (PaginatedArrayList<Contentlet>)APILocator.getContentletAPI().search("+structureInode:" + st.getInode() + condition, limit, offset, "Host.hostName", user, respectFrontendRoles); return convertToHostPaginatedArrayList(list); } catch (Exception e) { Logger.error(HostAPIImpl.class, e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } }
Source:
protected void executeVdsBrokerCommand() { if (getParameters().getAction() == FenceActionType.STATUS || !isAlreadyInRequestedStatus()) { _result = fenceNode( getParameters().getAction(), getParameters().getAction() != FenceActionType.STATUS); FenceOperationResult actionResult = new FenceOperationResult( getParameters().getAction(), _result.mStatus.mCode, _result.mStatus.mMessage, _result.power, _result.operationStatus); setReturnValue(actionResult); getVDSReturnValue().setSucceeded(actionResult.getStatus() != Status.ERROR); if (getParameters().getAction() == FenceActionType.STATUS && actionResult.getPowerStatus() == HostPowerStatus.UNKNOWN &&!getParameters().getTargetVdsID().equals(Guid.Empty)) { alertPowerManagementStatusFailed(actionResult.getMessage()); } } else { alertActionSkippedAlreadyInStatus(); getVDSReturnValue().setSucceeded(true); setReturnValue( new FenceOperationResult(Status.SKIPPED_ALREADY_IN_STATUS, HostPowerStatus.UNKNOWN)); } }

Target:
protected void executeVdsBrokerCommand() { if (getParameters().getAction() == FenceActionType.STATUS || !isAlreadyInRequestedStatus()) { FenceStatusReturnForXmlRpc result = fenceNode(getParameters().getAction()); FenceOperationResult actionResult = new FenceOperationResult( getParameters().getAction(), result.mStatus.mCode, result.mStatus.mMessage, result.power, result.operationStatus); setReturnValue(actionResult); getVDSReturnValue().setSucceeded(actionResult.getStatus() != Status.ERROR); if (getParameters().getAction() == FenceActionType.STATUS && actionResult.getPowerStatus() == PowerStatus.UNKNOWN && !getParameters().getTargetVdsID().equals(Guid.Empty)) { alertPowerManagementStatusFailed(actionResult.getMessage()); } } else { alertActionSkippedAlreadyInStatus(); getVDSReturnValue().setSucceeded(true); setReturnValue( new FenceOperationResult(Status.SKIPPED_ALREADY_IN_STATUS, PowerStatus.UNKNOWN)); } }
Source:
protected void onFirstPeerRegistered() { assert(mDOMProvider == null); mObjectMapper = new ObjectMapper(); mObjectIdMapper = new DOMObjectIdMapper(); mDOMProvider = mDOMProviderFactory.create(); mDOMProvider.setListener(new ProviderListener()); }

Target:
protected synchronized void onFirstPeerRegistered() { mDOMProvider = mDOMProviderFactory.create(); mDOMProvider.setListener(new ProviderListener()); }
Source:
KeyManagerFactoryWrapper(KeyManager km) { this.km = km; }

Target:
KeyManagerFactoryWrapper(KeyManager km) { this.km = ObjectUtil.checkNotNull(km, "km"); }
Source:
public List<Tag> getTags(Tool tool) { LOG.info(quayToken.getUsername() + " ======================= Getting tags for: {}================================", tool.getPath()); final String repo = tool.getNamespace() + '/' + tool.getName(); final List<Tag> tags = new ArrayList<>(); final Optional<QuayRepo> toolFromQuay = getToolFromQuay(tool); if (toolFromQuay.isPresent()) { final QuayRepo quayRepo = toolFromQuay.get(); final Map<String, QuayTag> tagsFromRepo = quayRepo.getTags(); final int maxQuayTagsReturnedByRepo = 500; if (tagsFromRepo.size() == maxQuayTagsReturnedByRepo) { try { List<QuayTag> allQuayTags = getAllQuayTags(repo); for (QuayTag tagItem : allQuayTags) { try { final Tag tag = convertQuayTagToTag(tagItem, tool); tags.add(tag); } catch (IllegalAccessException | InvocationTargetException ex) { LOG.error(quayToken.getUsername() + " Exception: {}", ex); } } } catch (ApiException e) { throw new CustomWebApplicationException("Could not get QuayTag", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } else { for (QuayTag tagItem : tagsFromRepo.values()) { try { final Tag tag = convertQuayTagToTag(tagItem, tool); tags.add(tag); } catch (IllegalAccessException | InvocationTargetException ex) { LOG.error(quayToken.getUsername() + " Exception: {}", ex); } } } } String repository = tool.getNamespace() + "/" + tool.getName(); updateTagsWithBuildInformation(repository, tags, tool); return tags; }

Target:
public List<Tag> getTags(Tool tool) { LOG.info(quayToken.getUsername() + " ======================= Getting tags for: {}================================", tool.getPath()); final String repo = tool.getNamespace() + '/' + tool.getName(); final List<Tag> tags = new ArrayList<>(); final Optional<QuayRepo> toolFromQuay = getToolFromQuay(tool); if (toolFromQuay.isPresent()) { final QuayRepo quayRepo = toolFromQuay.get(); final Map<String, QuayTag> tagsFromRepo = quayRepo.getTags(); final int maxQuayTagsReturnedByRepo = 500; List<QuayTag> quayTags = new ArrayList<>(tagsFromRepo.values()); if (tagsFromRepo.size() == maxQuayTagsReturnedByRepo) { try { quayTags = getAllQuayTags(repo); } catch (ApiException e) { throw new CustomWebApplicationException("Could not get QuayTag", HttpStatus.SC_INTERNAL_SERVER_ERROR); } } for (QuayTag tagItem : quayTags) { try { final Tag tag = convertQuayTagToTag(tagItem, tool); tags.add(tag); } catch (IllegalAccessException | InvocationTargetException ex) { LOG.error(quayToken.getUsername() + " Exception: {}", ex); } } } String repository = tool.getNamespace() + "/" + tool.getName(); updateTagsWithBuildInformation(repository, tags, tool); return tags; }
Source:
public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) return false; float eventX = event.getX(); float eventY = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: getParent().requestDisallowInterceptTouchEvent(true); mPoints.clear(); if (isDoubleClick()) { setIsEmpty(true); break; } mLastTouchX = eventX; mLastTouchY = eventY; addPoint(getNewPoint(eventX, eventY)); if(mOnSignedListener != null) mOnSignedListener.onStartSigning(); case MotionEvent.ACTION_MOVE: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); break; case MotionEvent.ACTION_UP: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); getParent().requestDisallowInterceptTouchEvent(true); setIsEmpty(false); break; default: return false; } invalidate( (int) (mDirtyRect.left - mMaxWidth), (int) (mDirtyRect.top - mMaxWidth), (int) (mDirtyRect.right + mMaxWidth), (int) (mDirtyRect.bottom + mMaxWidth)); return true; }

Target:
public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) return false; float eventX = event.getX(); float eventY = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: getParent().requestDisallowInterceptTouchEvent(true); mPoints.clear(); if (isDoubleClick()) { this.clearView(); setIsEmpty(true); break; } mLastTouchX = eventX; mLastTouchY = eventY; addPoint(getNewPoint(eventX, eventY)); if(mOnSignedListener != null) mOnSignedListener.onStartSigning(); case MotionEvent.ACTION_MOVE: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); break; case MotionEvent.ACTION_UP: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); getParent().requestDisallowInterceptTouchEvent(true); setIsEmpty(false); break; default: return false; } invalidate( (int) (mDirtyRect.left - mMaxWidth), (int) (mDirtyRect.top - mMaxWidth), (int) (mDirtyRect.right + mMaxWidth), (int) (mDirtyRect.bottom + mMaxWidth)); return true; }
Source:
public void autoJPushReferrerRewardAlert(long loanId) { List<InvestModel> successInvestList = investMapper.findSuccessInvestsByLoanId(loanId); for (InvestModel invest : successInvestList) { List<InvestReferrerRewardModel> investReferrerRewardModelList = investReferrerRewardMapper.findByInvestId(invest.getId()); for(InvestReferrerRewardModel investReferrerRewardModel : investReferrerRewardModelList){ if("SUCCESS".equals(investReferrerRewardModel.getStatus())){ AccountModel accountModel = accountMapper.findByLoginName(investReferrerRewardModel.getReferrerLoginName()); JPushAlertModel jPushAlertModel = jPushAlertMapper.findJPushAlertByPushType(PushType.REFERRER_REWARD_ALERT); if (jPushAlertModel != null) { Map<String, List<String>> loginNameMap = Maps.newHashMap(); List<String> amountLists = Lists.newArrayList(invest.getLoginName(), AmountConverter.convertCentToString(investReferrerRewardModel.getAmount()), AmountConverter.convertCentToString(accountModel.getBalance())); loginNameMap.put(accountModel.getLoginName(), amountLists); autoJPushByRegistrationId(jPushAlertModel, loginNameMap); loginNameMap.clear(); } else { logger.debug("REFERRER_REWARD_ALERT is disabled"); } } } } }

Target:
public void autoJPushReferrerRewardAlert(long loanId) { List<InvestModel> successInvestList = investMapper.findSuccessInvestsByLoanId(loanId); for (InvestModel invest : successInvestList) { List<InvestReferrerRewardModel> investReferrerRewardModelList = investReferrerRewardMapper.findByInvestId(invest.getId()); for(InvestReferrerRewardModel investReferrerRewardModel : investReferrerRewardModelList){ if(investReferrerRewardModel.getStatus() == ReferrerRewardStatus.SUCCESS){ AccountModel accountModel = accountMapper.findByLoginName(investReferrerRewardModel.getReferrerLoginName()); JPushAlertModel jPushAlertModel = jPushAlertMapper.findJPushAlertByPushType(PushType.REFERRER_REWARD_ALERT); if (jPushAlertModel != null) { Map<String, List<String>> loginNameMap = Maps.newHashMap(); List<String> amountLists = Lists.newArrayList(invest.getLoginName(), AmountConverter.convertCentToString(investReferrerRewardModel.getAmount()), AmountConverter.convertCentToString(accountModel.getBalance())); loginNameMap.put(accountModel.getLoginName(), amountLists); autoJPushByRegistrationId(jPushAlertModel, loginNameMap); loginNameMap.clear(); } else { logger.debug("REFERRER_REWARD_ALERT is disabled"); } } } } }
Source:
public void testCleanupJobsLimitsJobStatesToTerminalStates() { Set<JobState> jobStates = Util.asSet(JobState.values()); AsyncJobStatusQueryBuilder input = new AsyncJobStatusQueryBuilder() .setJobStates(jobStates); int expected = new Random().nextInt(); ArgumentCaptor<AsyncJobStatusQueryBuilder> captor = ArgumentCaptor.forClass(AsyncJobStatusQueryBuilder.class); doReturn(expected).when(this.jobCurator).deleteJobs(eq(input)); JobManager manager = this.createJobManager(); int output = manager.cleanupJobs(input); verify(this.jobCurator, times(1)).deleteJobs(captor.capture()); AsyncJobStatusQueryBuilder captured = captor.getValue(); assertNotNull(captured); Collection<JobState> actual = captured.getJobStates(); assertNotNull(actual); assertTrue(actual.size() > 0); assertTrue(jobStates.size() > actual.size()); for (JobState state : actual) { assertNotNull(state); assertTrue(state.isTerminal()); } }

Target:
public void testCleanupJobsLimitsJobStatesToTerminalStates() { Set<JobState> jobStates = Util.asSet(JobState.values()); AsyncJobStatusQueryBuilder input = new AsyncJobStatusQueryBuilder() .setJobStates(jobStates); int expected = new Random().nextInt(); ArgumentCaptor<AsyncJobStatusQueryBuilder> captor = ArgumentCaptor.forClass(AsyncJobStatusQueryBuilder.class); doReturn(expected).when(this.jobCurator).deleteJobs(eq(input)); JobManager manager = this.createJobManager(); int output = manager.cleanupJobs(input); verify(this.jobCurator, times(1)).deleteJobs(captor.capture()); AsyncJobStatusQueryBuilder captured = captor.getValue(); assertNotNull(captured); Collection<JobState> actual = captured.getJobStates(); assertNotNull(actual); assertThat(actual, not(empty())); assertThat(actual.size(), lessThan(jobStates.size())); for (JobState state : actual) { assertNotNull(state); assertTrue(state.isTerminal()); } }
Source:
private String getIndex(BridgeDefinedField bridgeDefinedField) { if ( bridgeDefinedField.getType().equals( FieldType.BOOLEAN ) ) { return "not_analyzed"; } Field.Index index = bridgeDefinedField.getIndex(); return getIndexValue( index ); }

Target:
private String getIndex(BridgeDefinedField bridgeDefinedField) { if ( FieldHelper.isBoolean( bridgeDefinedField ) || FieldHelper.isNumeric( bridgeDefinedField ) || FieldHelper.isDate( bridgeDefinedField ) ) { return NOT_ANALYZED; } Field.Index index = bridgeDefinedField.getIndex(); return getIndexValue( index ); }
Source:
public void clearMappingErrors(String vreName) { final GraphTraversal<Vertex, Vertex> collectionT = getRawCollectionsTraversal(vreName); while (collectionT.hasNext()) { final Vertex collection = collectionT.next(); collection.vertices(Direction.OUT, HAS_NEXT_ERROR).forEachRemaining(this::clearMappingErrors); } }

Target:
public void clearMappingErrors(String vreName) { getRawCollectionsTraversal(vreName) .emit() .repeat(__.out(HAS_NEXT_ERROR)) .forEachRemaining(vertex -> { vertex.edges(Direction.IN, HAS_NEXT_ERROR).forEachRemaining(Edge::remove); vertex.properties().forEachRemaining(property -> { if (property.key().startsWith(ERROR_PREFIX)) { property.remove(); } }); }); }
Source:
public static void viewCurrentSite(Context context, SiteModel site, boolean openFromHeader) { if (site == null) { ToastUtils.showToast(context, R.string.blog_not_found, ToastUtils.Duration.SHORT); return; } AnalyticsTracker.Stat stat = openFromHeader ? AnalyticsTracker.Stat.OPENED_VIEW_SITE_FROM_HEADER : AnalyticsTracker.Stat.OPENED_VIEW_SITE; AnalyticsUtils.trackWithSiteDetails(stat, site); final String siteUrl = site.getUrl(); if (siteUrl == null) { ToastUtils.showToast(context, context.getString(R.string.site_url_null), ToastUtils.Duration.LONG); AppLog.w(AppLog.T.UTILS, "Site URL is null. Login URL: " + site.getLoginUrl()); } else { openUrlExternal(context, siteUrl); } }

Target:
public static void viewCurrentSite(Context context, SiteModel site, boolean openFromHeader) { AnalyticsTracker.Stat stat = openFromHeader ? AnalyticsTracker.Stat.OPENED_VIEW_SITE_FROM_HEADER : AnalyticsTracker.Stat.OPENED_VIEW_SITE; AnalyticsUtils.trackWithSiteDetails(stat, site); if (site == null) { ToastUtils.showToast(context, R.string.blog_not_found, ToastUtils.Duration.SHORT); } else if (site.getUrl() == null) { ToastUtils.showToast(context, R.string.blog_not_found, ToastUtils.Duration.SHORT); AppLog.w(AppLog.T.UTILS, "Site URL is null. Login URL: " + site.getLoginUrl()); } else { openUrlExternal(context, site.getUrl()); } }
Source:
private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { boolean allowNewSessionCommand = true; if(volumeEntity == null) { allowNewSessionCommand = false; } if(getEntity().getStatus() != GlusterStatus.UP) { allowNewSessionCommand = false; } getNewSessionCommand().setIsAvailable(allowNewSessionCommand); getRemoveSessionCommand().setIsAvailable(false); getStartSessionCommand().setIsAvailable(false); getStopSessionCommand().setIsAvailable(false); getSessionOptionsCommand().setIsAvailable(false); getViewSessionDetailsCommand().setIsAvailable(false); getRefreshSessionsCommand().setIsAvailable(true); }

Target:
private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { boolean allowNewGeoRepSessionCommand = true; boolean allowStartSessionCommand = false; boolean allowStopSessionCommand = false; boolean allowResumeSessionCommand = false; boolean allowPauseSessionCommand = false; if(volumeEntity == null) { return; } if (getSelectedItems() != null && getSelectedItems().size() == 1) { GlusterGeoRepSession selectedSession = getSelectedItem(); GeoRepSessionStatus sessionStatus = selectedSession.getStatus(); allowStartSessionCommand = sessionStatus == GeoRepSessionStatus.NOTSTARTED || sessionStatus == GeoRepSessionStatus.STOPPED; allowStopSessionCommand = !allowStartSessionCommand; allowResumeSessionCommand = sessionStatus == GeoRepSessionStatus.PAUSED; allowPauseSessionCommand = sessionStatus == GeoRepSessionStatus.ACTIVE || sessionStatus == GeoRepSessionStatus.INITIALIZING; allowNewGeoRepSessionCommand = volumeEntity.getStatus() == GlusterStatus.UP; } getNewSessionCommand().setIsExecutionAllowed(allowNewGeoRepSessionCommand); getRemoveSessionCommand().setIsAvailable(false); getStartSessionCommand().setIsExecutionAllowed(allowStartSessionCommand); getStopSessionCommand().setIsExecutionAllowed(allowStopSessionCommand); getPauseSessionCommand().setIsExecutionAllowed(allowPauseSessionCommand); getResumeSessionCommand().setIsExecutionAllowed(allowResumeSessionCommand); getSessionOptionsCommand().setIsExecutionAllowed(true); getViewSessionDetailsCommand().setIsAvailable(false); getRefreshSessionsCommand().setIsAvailable(true); }
Source:
public void activate(ComponentContext componentContext) { XmlDocumentReader<BindingInfoXmlResult> bindingInfoReader = new BindingInfoReader(); bindingInfoTracker = new XmlDocumentBundleTracker<>(componentContext.getBundleContext(), XML_DIRECTORY, bindingInfoReader, this, READY_MARKER, readyService); trackerJob = scheduler.schedule(() -> { bindingInfoTracker.open(); }, 0, TimeUnit.SECONDS); }

Target:
public void activate(ComponentContext componentContext) { XmlDocumentReader<BindingInfoXmlResult> bindingInfoReader = new BindingInfoReader(); bindingInfoTracker = new XmlDocumentBundleTracker<>(componentContext.getBundleContext(), XML_DIRECTORY, bindingInfoReader, this, READY_MARKER, readyService); trackerJob = scheduler.submit(() -> { bindingInfoTracker.open(); }); }
Source:
public Map<String, ValueResolver<? extends Object>> getParameters() { return resolverSet.getResolvers(); }

Target:
public Map<String, ValueResolver<? extends Object>> getParameters() { return unmodifiableMap(resolverSet.getResolvers()); }
Source:
public Entity toEntity() { Entity branchEntity = new Entity(this.key); return branchEntity; }

Target:
public Entity toEntity() { return new Entity(this.key); }
Source:
private void testSegmentSplitsHelperNoFilter(PinotTableHandle table, int segmentsPerSplit, int expectedNumSplits, boolean expectFilter) { PinotConfig pinotConfig = new PinotConfig().setForbidBrokerQueries(false); SessionHolder sessionHolder = new SessionHolder(pinotConfig); PlanBuilder planBuilder = createPlanBuilder(sessionHolder); PlanNode plan = tableScan(planBuilder, table, regionId, city, fare, secondsSinceEpoch); PinotQueryGenerator.PinotQueryGeneratorResult pinotQueryGeneratorResult = new PinotQueryGenerator(pinotConfig, typeManager, functionMetadataManager, standardFunctionResolution).generate(plan, sessionHolder.getConnectorSession()).get(); ImmutableList<PinotColumnHandle> expectedHandles = ImmutableList.copyOf(pinotQueryGeneratorResult.getContext().getAssignments().values()); PinotQueryGenerator.GeneratedPql generatedPql = pinotQueryGeneratorResult.getGeneratedPql(); PinotTableHandle pinotTableHandle = new PinotTableHandle(table.getConnectorId(), table.getSchemaName(), table.getTableName(), Optional.of(false), Optional.of(expectedHandles), Optional.of(generatedPql)); List<PinotSplit> splits = getSplitsHelper(pinotTableHandle, segmentsPerSplit, false); assertSplits(splits, expectedNumSplits, SEGMENT); splits.forEach(s -> assertSegmentSplitWellFormed(s, expectFilter)); }

Target:
private void testSegmentSplitsHelperNoFilter(PinotTableHandle table, int segmentsPerSplit, int expectedNumSplits, boolean expectFilter) { PinotConfig pinotConfig = new PinotConfig().setForbidBrokerQueries(false); SessionHolder sessionHolder = new SessionHolder(pinotConfig); PlanBuilder planBuilder = createPlanBuilder(sessionHolder); PlanNode plan = tableScan(planBuilder, table, regionId, city, fare, secondsSinceEpoch); PinotQueryGenerator.PinotQueryGeneratorResult pinotQueryGeneratorResult = new PinotQueryGenerator(pinotConfig, typeManager, functionMetadataManager, standardFunctionResolution).generate(plan, sessionHolder.getConnectorSession()).get(); List<PinotColumnHandle> expectedHandles = ImmutableList.copyOf(pinotQueryGeneratorResult.getContext().getAssignments().values()); PinotQueryGenerator.GeneratedPql generatedPql = pinotQueryGeneratorResult.getGeneratedPql(); PinotTableHandle pinotTableHandle = new PinotTableHandle(table.getConnectorId(), table.getSchemaName(), table.getTableName(), Optional.of(false), Optional.of(expectedHandles), Optional.of(generatedPql)); List<PinotSplit> splits = getSplitsHelper(pinotTableHandle, segmentsPerSplit, false); assertSplits(splits, expectedNumSplits, SEGMENT); splits.forEach(s -> assertSegmentSplitWellFormed(s, expectFilter)); }
Source:
public void logout(final HttpServletRequest request, final HttpServletResponse response) { assertNotNull("logoutLogic", logoutLogic); assertNotNull("config", config); final JEEContext context = new JEEContext(request, response, config.getSessionStore()); logoutLogic.perform(context, config, (action, theContext) -> null, this.defaultUrl, this.logoutUrlPattern, this.localLogout, this.destroySession, this.centralLogout); }

Target:
public void logout(final HttpServletRequest request, final HttpServletResponse response) { assertNotNull("logoutLogic", logoutLogic); assertNotNull("config", config); final JEEContext context = new JEEContext(request, response, config.getSessionStore()); logoutLogic.perform(context, config, JEEHttpActionAdapter.INSTANCE, this.defaultUrl, this.logoutUrlPattern, this.localLogout, this.destroySession, this.centralLogout); }
Source:
private Stringer getLinearStringerForName(String name, byte code, int createMediaMask) { if ((name == null) || (name.length() == 0)) return null; Table t = getTable(code); Stringer rv; try { t.acquireReadLock(); rv = getLinearStringerForNameWhileLocked(t, name); if (rv != null && rv.hasMediaMask(createMediaMask)) return rv; } finally { t.releaseReadLock(); } try { t.acquireWriteLock(); rv = getLinearStringerForNameWhileLocked(t, name); if (rv != null && rv.hasMediaMask(createMediaMask)) return rv; if ( rv == null ) { rv = new Stringer(getNextWizID()); rv.name = name; rv.ignoreCaseHash = rv.name.toLowerCase().hashCode(); rv.setMediaMask(createMediaMask); t.add(rv, true); } else { rv.addMediaMask(createMediaMask); logUpdate(rv, code); } return rv; } finally { t.releaseWriteLock(); } }

Target:
private Stringer getLinearStringerForName(String name, byte code, int createMediaMask) { if ((name == null) || (name.length() == 0)) return null; Table t = getTable(code); Stringer rv; try { t.acquireReadLock(); rv = getLinearStringerForNameWhileLocked(t, name); if (rv != null && rv.hasMediaMask(createMediaMask)) return rv; } finally { t.releaseReadLock(); } try { t.acquireWriteLock(); rv = getLinearStringerForNameWhileLocked(t, name); if (rv != null && rv.hasMediaMask(createMediaMask)) return rv; if ( rv == null ) { rv = new Stringer(getNextWizID()); rv.name = name; rv.ignoreCaseHash = name.toLowerCase().hashCode(); rv.setMediaMask(createMediaMask); t.add(rv, true); } else { rv.addMediaMask(createMediaMask); logUpdate(rv, code); } return rv; } finally { t.releaseWriteLock(); } }
Source:
public void processModule(Study study, String isModuleEnabled, String accessToken) { StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource); StudyParameterValueBean spv = spvdao.findByHandleAndStudy(study.getStudyId(), "participantPortal"); String statusValue = isModuleEnabled.toLowerCase(); if (!spv.isActive()) { spv = new StudyParameterValueBean(); spv.setStudyId(study.getStudyId()); spv.setParameter("participantPortal"); spv.setValue(statusValue); spvdao.create(spv); } else if (spv.isActive() && !spv.getValue().equals(statusValue)) { spv.setValue(statusValue); spvdao.update(spv); } }

Target:
public void processModule(Study study, String isModuleEnabled, String accessToken) { StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource); StudyParameterValueBean spv = spvdao.findByHandleAndStudy(study.getStudyId(), "participantPortal"); String statusValue = isModuleEnabled; if (!spv.isActive()) { spv = new StudyParameterValueBean(); spv.setStudyId(study.getStudyId()); spv.setParameter("participantPortal"); spv.setValue(statusValue); spvdao.create(spv); } else if (spv.isActive() && !spv.getValue().equals(statusValue)) { spv.setValue(statusValue); spvdao.update(spv); } }
Source:
InMemorySystemDescriptor withInMemoryScope(String inMemoryScope) { this.inMemoryScope = inMemoryScope; return this; }

Target:
public InMemorySystemDescriptor withInMemoryScope(String inMemoryScope) { this.inMemoryScope = inMemoryScope; return this; }