auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void render(StringBuilder sb, int indent, boolean atRoot, ConfigRenderOptions options) { if (isEmpty()) { sb.append("{}"); } else { String[] keys = keySet().toArray(new String[size()]); Arrays.sort(keys, new com.typesafe.config.impl.AlphanumericComparator()); boolean outerBraces = options.getJson() || !atRoot; int innerIndent; if (outerBraces) { innerIndent = indent + 1; sb.append("{"); if (options.getFormatted()) sb.append('\n'); } else { innerIndent = indent; } int separatorCount = 0; for (String k : keys) { AbstractConfigValue v; v = value.get(k); if (options.getOriginComments()) { indent(sb, innerIndent, options); sb.append("# "); sb.append(v.origin().description()); sb.append("\n"); } if (options.getComments()) { for (String comment : v.origin().comments()) { indent(sb, innerIndent, options); sb.append("#"); if (!comment.startsWith(" ")) sb.append(' '); sb.append(comment); sb.append("\n"); } } indent(sb, innerIndent, options); v.render(sb, innerIndent, false , k, options); if (options.getFormatted()) { if (options.getJson()) { sb.append(","); separatorCount = 2; } else { separatorCount = 1; } sb.append('\n'); } else { sb.append(","); separatorCount = 1; } } sb.setLength(sb.length() - separatorCount); if (outerBraces) { if (options.getFormatted()) { sb.append('\n'); if (outerBraces) indent(sb, indent, options); } sb.append("}"); } } if (atRoot && options.getFormatted()) sb.append('\n'); }

Target:
protected void render(StringBuilder sb, int indent, boolean atRoot, ConfigRenderOptions options) { if (isEmpty()) { sb.append("{}"); } else { boolean outerBraces = options.getJson() || !atRoot; int innerIndent; if (outerBraces) { innerIndent = indent + 1; sb.append("{"); if (options.getFormatted()) sb.append('\n'); } else { innerIndent = indent; } int separatorCount = 0; String[] keys = keySet().toArray(new String[size()]); Arrays.sort(keys, new com.typesafe.config.impl.AlphanumericComparator()); for (String k : keys) { AbstractConfigValue v; v = value.get(k); if (options.getOriginComments()) { indent(sb, innerIndent, options); sb.append("# "); sb.append(v.origin().description()); sb.append("\n"); } if (options.getComments()) { for (String comment : v.origin().comments()) { indent(sb, innerIndent, options); sb.append("#"); if (!comment.startsWith(" ")) sb.append(' '); sb.append(comment); sb.append("\n"); } } indent(sb, innerIndent, options); v.render(sb, innerIndent, false , k, options); if (options.getFormatted()) { if (options.getJson()) { sb.append(","); separatorCount = 2; } else { separatorCount = 1; } sb.append('\n'); } else { sb.append(","); separatorCount = 1; } } sb.setLength(sb.length() - separatorCount); if (outerBraces) { if (options.getFormatted()) { sb.append('\n'); if (outerBraces) indent(sb, indent, options); } sb.append("}"); } } if (atRoot && options.getFormatted()) sb.append('\n'); }
Source:
public int markScheduledExecutionsTimedOut(int timeoutSecs) throws InvalidOperationException, MetaException { if (timeoutSecs < 0) { LOG.debug("scheduled executions - time_out mark is disabled"); return 0; } boolean committed = false; try (Query q = pm.newQuery(MScheduledExecution.class)) { openTransaction(); int maxLastUpdateTime = (int) (System.currentTimeMillis() / 1000) - timeoutSecs; q.setFilter("lastUpdateTime <= maxLastUpdateTime && (state == 'INITED' || state == 'EXECUTING')"); q.declareParameters("int maxLastUpdateTime"); List<MScheduledExecution> results = (List<MScheduledExecution>) q.execute(maxLastUpdateTime); for (MScheduledExecution e : results) { ScheduledQueryProgressInfo info = new ScheduledQueryProgressInfo(); info.setScheduledExecutionId(e.getScheduledExecutionId()); info.setState(QueryState.TIMED_OUT); info.setErrorMessage( "Query stuck in: " + e.getState() + " state for >" + timeoutSecs + " seconds. Execution timed out."); scheduledQueryProgress(info); } recoverInvalidScheduledQueryState(timeoutSecs); committed = commitTransaction(); return results.size(); } catch (InvalidOperationException | MetaException e) { throw e; } catch (Exception e) { throw new MetaException(e.getMessage()); } finally { if (!committed) { rollbackTransaction(); } } }

Target:
public int markScheduledExecutionsTimedOut(int timeoutSecs) throws InvalidOperationException, MetaException { if (timeoutSecs < 0) { LOG.debug("scheduled executions - time_out mark is disabled"); return 0; } boolean committed = false; Query q = null; try { openTransaction(); int maxLastUpdateTime = (int) (System.currentTimeMillis() / 1000) - timeoutSecs; q = pm.newQuery(MScheduledExecution.class); q.setFilter("lastUpdateTime <= maxLastUpdateTime && (state == 'INITED' || state == 'EXECUTING')"); q.declareParameters("int maxLastUpdateTime"); List<MScheduledExecution> results = (List<MScheduledExecution>) q.execute(maxLastUpdateTime); for (MScheduledExecution e : results) { ScheduledQueryProgressInfo info = new ScheduledQueryProgressInfo(); info.setScheduledExecutionId(e.getScheduledExecutionId()); info.setState(QueryState.TIMED_OUT); info.setErrorMessage( "Query stuck in: " + e.getState() + " state for >" + timeoutSecs + " seconds. Execution timed out."); scheduledQueryProgress(info); } recoverInvalidScheduledQueryState(timeoutSecs); committed = commitTransaction(); return results.size(); } finally { rollbackAndCleanup(committed, q); } }
Source:
public void shouldNotRecordWhenRecorderIsDisabled() { String oldValue = System.getProperty("RECORDER_DISABLED"); System.setProperty("RECORDER_DISABLED", "true"); TestRecorderRule testRecorderRule = new TestRecorderRule(); Description shouldNotRecordSuccessTestExecutionByDefault = Description.createTestDescription("org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest", "shouldNotRecordWhenRecorderIsDisabled"); testRecorderRule.starting(shouldNotRecordSuccessTestExecutionByDefault); System.out.println("Hello World"); testRecorderRule.finished(shouldNotRecordSuccessTestExecutionByDefault); File outputFile = new File("target", "org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest-shouldNotRecordWhenRecorderIsDisabled.mov"); assertThat(outputFile.exists(), is(false)); if(oldValue != null) { System.setProperty("RECORDER_DISABLED", oldValue); } else { System.clearProperty("RECORDER_DISABLED"); } outputFile.delete(); }

Target:
public void shouldNotRecordWhenRecorderIsDisabled() { TestRecorderRule.RECORDER_OPTION = TestRecorderRule.OFF; TestRecorderRule testRecorderRule = new TestRecorderRule(); Description shouldNotRecordSuccessTestExecutionByDefault = Description.createTestDescription("org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest", "shouldNotRecordWhenRecorderIsDisabled"); testRecorderRule.starting(shouldNotRecordSuccessTestExecutionByDefault); System.out.println("Hello World"); testRecorderRule.finished(shouldNotRecordSuccessTestExecutionByDefault); File outputFile = new File("target", "org.jenkinsci.test.acceptance.recorder.TestRecorderRuleTest-shouldNotRecordWhenRecorderIsDisabled.mov"); assertThat(outputFile.exists(), is(false)); TestRecorderRule.RECORDER_OPTION = TestRecorderRule.FAILURES; outputFile.delete(); }
Source:
public void perform(GraphRewrite event, EvaluationContext context, WindupConfigurationModel payload) { WindupJavaConfigurationModel javaCfg = WindupJavaConfigurationService.getJavaConfigurationModel(event.getGraphContext()); for (FileModel ignoreDirectory : payload.getUserIgnorePaths()) { final List<Path> filesUrl = new ArrayList<>(); try { Files.walkFileTree(Paths.get(ignoreDirectory.getFilePath()), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.getFileName().toString().toLowerCase().endsWith(IGNORE_FILE_EXTENSION)) { filesUrl.add(file); } return FileVisitResult.CONTINUE; } }); for (Path filePath : filesUrl) { File file = filePath.toFile(); if (file.exists()) { try (BufferedReader reader = new BufferedReader(new FileReader(file));) { String line = null; while ((line = reader.readLine()) != null) { GraphService<IgnoredFileModel> graphService = new GraphService<IgnoredFileModel>( event.getGraphContext(), IgnoredFileModel.class); IgnoredFileModel ignored = graphService.create(); ignored.setRegex(line); javaCfg.addIgnoredFile(ignored); } } catch (FileNotFoundException e) { } catch (IOException e) { } } } } catch (IOException e1) { } } }

Target:
public void perform(GraphRewrite event, EvaluationContext context, WindupConfigurationModel payload) { WindupJavaConfigurationModel javaCfg = WindupJavaConfigurationService.getJavaConfigurationModel(event .getGraphContext()); final List<Path> filesUrl = new ArrayList<>(); for (FileModel ignoredRegexesFileModel : payload.getUserIgnorePaths()) { if (ignoredRegexesFileModel.isDirectory()) { try { Files.walkFileTree(Paths.get(ignoredRegexesFileModel.getFilePath()), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.getFileName().toString().toLowerCase().endsWith(IGNORE_FILE_EXTENSION)) { filesUrl.add(file); } return FileVisitResult.CONTINUE; } }); } catch (IOException e1) { log.warning("IOException thrown when trying to access the ignored file regexes in " + ignoredRegexesFileModel.getFilePath()); } } else { filesUrl.add(Paths.get(ignoredRegexesFileModel.getFilePath())); } } for (Path filePath : filesUrl) { readAndAddFileRegexes(filePath, javaCfg, event.getGraphContext()); } }
Source:
private Message<?> getMessageById(UUID messageId) { Message<?> theMessage = null; if (this.messageStore instanceof SimpleMessageStore) { synchronized (this.messageGroupId) { Collection<Message<?>> messages = this.messageStore.getMessageGroup(this.messageGroupId).getMessages(); for (Message<?> message : messages) { if (message.getHeaders().getId().equals(messageId)) { theMessage = message; break; } } } } else { theMessage = ((MessageStore) this.messageStore).getMessage(messageId); } if (theMessage == null) { if (logger.isDebugEnabled()) { logger.debug("No message in the Message Store for id: " + messageId + ". Likely another instance has already released it."); } return null; } else { return theMessage; } }

Target:
private Message<?> getMessageById(UUID messageId) { Message<?> theMessage = ((MessageStore) this.messageStore).getMessage(messageId); if (theMessage == null) { if (logger.isDebugEnabled()) { logger.debug("No message in the Message Store for id: " + messageId + ". Likely another instance has already released it."); } return null; } else { return theMessage; } }
Source:
public static JSITFunctionDefinition dmnFromWB(final FunctionDefinition wb, final Consumer<JSITComponentWidths> componentWidthsConsumer) { if (wb == null) { return null; } final JSITFunctionDefinition result = new JSITFunctionDefinition(); result.setId(wb.getId().getValue()); if (Objects.isNull(result.getFormalParameter())) { result.setFormalParameter(new ArrayList<>()); } final Optional<String> description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); description.ifPresent(result::setDescription); QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); result.setExpression(ExpressionPropertyConverter.dmnFromWB(wb.getExpression(), componentWidthsConsumer)); final Kind kind = wb.getKind(); switch (kind) { case FEEL: result.setKind(Js.uncheckedCast(JSITFunctionKind.FEEL.value())); break; case JAVA: result.setKind(Js.uncheckedCast(JSITFunctionKind.JAVA.value())); break; case PMML: result.setKind(Js.uncheckedCast(JSITFunctionKind.PMML.value())); break; default: result.setKind(Js.uncheckedCast(JSITFunctionKind.FEEL.value())); break; } for (InformationItem ii : wb.getFormalParameter()) { final JSITInformationItem iiConverted = InformationItemPropertyConverter.dmnFromWB(ii); result.addFormalParameter(iiConverted); } return result; }

Target:
public static JSITFunctionDefinition dmnFromWB(final FunctionDefinition wb, final Consumer<JSITComponentWidths> componentWidthsConsumer) { if (Objects.isNull(wb)) { return null; } final JSITFunctionDefinition result = new JSITFunctionDefinition(); result.setId(wb.getId().getValue()); if (Objects.isNull(result.getFormalParameter())) { result.setFormalParameter(new ArrayList<>()); } final Optional<String> description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription())); description.ifPresent(result::setDescription); QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef); result.setExpression(ExpressionPropertyConverter.dmnFromWB(wb.getExpression(), componentWidthsConsumer)); final Kind kind = wb.getKind(); switch (kind) { case FEEL: result.setKind(Js.uncheckedCast(JSITFunctionKind.FEEL.value())); break; case JAVA: result.setKind(Js.uncheckedCast(JSITFunctionKind.JAVA.value())); break; case PMML: result.setKind(Js.uncheckedCast(JSITFunctionKind.PMML.value())); break; default: result.setKind(Js.uncheckedCast(JSITFunctionKind.FEEL.value())); break; } for (InformationItem ii : wb.getFormalParameter()) { final JSITInformationItem iiConverted = InformationItemPropertyConverter.dmnFromWB(ii); result.addFormalParameter(iiConverted); } return result; }
Source:
public void shouldCommitNextOffsetFromQueueIfAvailable() { task = createStatelessTask(createConfig(false, "0"), StreamsConfig.METRICS_LATEST); task.initializeIfNeeded(); task.completeRestoration(); task.addRecords(partition1, Arrays.asList(getConsumerRecord(partition1, 0L), getConsumerRecord(partition1, 5L))); task.process(0L); final Map<TopicPartition, OffsetAndMetadata> offsetsAndMetadata = task.prepareCommit(); assertThat(offsetsAndMetadata, equalTo(mkMap(mkEntry(partition1, new OffsetAndMetadata(5L, encodeTimestamp(5L)))))); }

Target:
public void shouldCommitNextOffsetFromQueueIfAvailable() { task = createStatelessTask(createConfig(false, "0"), StreamsConfig.METRICS_LATEST); task.initializeIfNeeded(); task.completeRestoration(); task.addRecords(partition1, Arrays.asList(getConsumerRecord(partition1, 0L), getConsumerRecord(partition1, 5L))); task.process(0L); task.prepareCommit(); final Map<TopicPartition, OffsetAndMetadata> offsetsAndMetadata = task.committableOffsetsAndMetadata(); assertThat(offsetsAndMetadata, equalTo(mkMap(mkEntry(partition1, new OffsetAndMetadata(5L, encodeTimestamp(5L)))))); }
Source:
public Mask parseFromInput(String input, ParserContext context) throws InputParseException { if (!input.startsWith("^[") || !input.endsWith("]")) { return null; } Extent extent = Request.request().getEditSession(); String states = input.substring(2, input.length() - 1); try { return new BlockStateMask(extent, Arrays.stream(states.split(",")).map(s -> s.split("=")) .collect(Collectors.toMap(s -> s[0], s -> s[1]))); } catch (Exception e) { throw new InputParseException("Invalid states.", e); } }

Target:
public Mask parseFromInput(String input, ParserContext context) throws InputParseException { if (!(input.startsWith("^[") || input.startsWith("^=[")) || !input.endsWith("]")) { return null; } Extent extent = Request.request().getEditSession(); boolean strict = input.charAt(1) == '='; String states = input.substring(2 + (strict ? 1 : 0), input.length() - 1); try { return new BlockStateMask(extent, Splitter.on(',').omitEmptyStrings().trimResults().withKeyValueSeparator('=').split(states), strict); } catch (Exception e) { throw new InputParseException("Invalid states.", e); } }
Source:
public <T> T[] toArray(T[] array) { checkForParentModification(); if (array.length < size) { final Class<?> type = array.getClass().getComponentType(); array = (T[]) Array.newInstance(type, size); } if (size > 0) { if(parent instanceof IonSequenceLite) { System.arraycopy(IonSequenceLite.this._children, fromIndex, array, 0, size); } else { for(int i = 0; i < size; i++) { array[i] = (T) get(i); } } } if (size < array.length) { array[size] = null; } return array; }

Target:
public <T> T[] toArray(T[] array) { checkForParentModification(); if (array.length < size) { final Class<?> type = array.getClass().getComponentType(); array = (T[]) Array.newInstance(type, size); } if (size > 0) { System.arraycopy(IonSequenceLite.this._children, fromIndex, array, 0, size); } if (size < array.length) { array[size] = null; } return array; }
Source:
public CoreQueryManager( @Named("features") final Features features, final AsyncFramework async, final ClusterManager cluster, final QueryParser parser, final QueryCache queryCache, final AggregationFactory aggregations, @Named("groupLimit") final OptionalLimit groupLimit, @Named("smallQueryThreshold") final long smallQueryThreshold, final ApiReporter reporter ) { this.features = features; this.async = async; this.cluster = cluster; this.parser = parser; this.queryCache = queryCache; this.aggregations = aggregations; this.groupLimit = groupLimit; this.reporter = reporter; this.smallQueryThreshold = smallQueryThreshold; log.info("smallQueryThreshold: " + smallQueryThreshold); }

Target:
public CoreQueryManager( @Named("features") final Features features, final AsyncFramework async, final ClusterManager cluster, final QueryParser parser, final QueryCache queryCache, final AggregationFactory aggregations, @Named("groupLimit") final OptionalLimit groupLimit, @Named("smallQueryThreshold") final long smallQueryThreshold, final ApiReporter reporter ) { this.features = features; this.async = async; this.cluster = cluster; this.parser = parser; this.queryCache = queryCache; this.aggregations = aggregations; this.groupLimit = groupLimit; this.reporter = reporter; this.smallQueryThreshold = smallQueryThreshold; }
Source:
public Row lockRow(Session session, Row row) { syncLastModificationIdWithDatabase(); return primaryIndex.lockRow(session, row); }

Target:
public Row lockRow(Session session, Row row) { Row lockedRow = primaryIndex.lockRow(session, row); if (lockedRow == null || !row.hasSharedData(lockedRow)) { syncLastModificationIdWithDatabase(); } return lockedRow; }
Source:
DesiredCapabilities getDriverCapabilities(Proxy proxy) { DesiredCapabilities capabilities = createCommonCapabilities(proxy); capabilities.setBrowserName(getBrowserNameForGrid()); if (headless) { capabilities.merge(getHeadlessCapabilities()); } if (!browserBinary.isEmpty()) { log.info("Using browser binary: " + browserBinary); if (isChrome()) { ChromeOptions options = new ChromeOptions(); options.setBinary(browserBinary); capabilities.merge(options); } else if (isFirefox()) { FirefoxOptions options = new FirefoxOptions(); options.setBinary(browserBinary); capabilities.merge(options); } else { log.warning("Changing browser binary on remote server is only supported for Chrome/Firefox, setting will be ignored."); } } return capabilities; }

Target:
DesiredCapabilities getDriverCapabilities(Proxy proxy) { DesiredCapabilities capabilities = createCommonCapabilities(proxy); capabilities.setBrowserName(getBrowserNameForGrid()); if (headless) { capabilities.merge(getHeadlessCapabilities()); } if (!browserBinary.isEmpty()) { capabilities.merge(getBrowserBinaryCapabilites()); } return capabilities; }
Source:
public CompletableFuture<Void> resolveConflicts(CacheTopology topology, Set<Address> preferredNodes) { if (!running) return CompletableFuture.completedFuture(null); LocalizedCacheTopology localizedTopology; if (topology instanceof LocalizedCacheTopology) { localizedTopology = (LocalizedCacheTopology) topology; } else { localizedTopology = distributionManager.createLocalizedCacheTopology(topology); } conflictFuture = resolutionExecutor.execute(() -> doResolveConflicts(localizedTopology, entryMergePolicy, preferredNodes), localizedTopology.getTopologyId()) .toCompletableFuture(); return conflictFuture.whenComplete((Void, t) -> { if (t != null) { log.errorf("Cache %s encountered exception whilst trying to resolve conflicts on merge: %s", cacheName, t); if (conflictSpliterator != null) { conflictSpliterator.stop(); conflictSpliterator = null; } } }); }

Target:
public CompletionStage<Void> resolveConflicts(CacheTopology topology, Set<Address> preferredNodes) { if (!running) return CompletableFuture.completedFuture(null); LocalizedCacheTopology localizedTopology; if (topology instanceof LocalizedCacheTopology) { localizedTopology = (LocalizedCacheTopology) topology; } else { localizedTopology = distributionManager.createLocalizedCacheTopology(topology); } conflictFuture = resolutionExecutor.execute(() -> doResolveConflicts(localizedTopology, entryMergePolicy, preferredNodes), localizedTopology.getTopologyId()) .toCompletableFuture(); return conflictFuture.whenComplete((Void, t) -> { if (t != null) { log.errorf("Cache %s encountered exception whilst trying to resolve conflicts on merge: %s", cacheName, t); if (conflictSpliterator != null) { conflictSpliterator.stop(); conflictSpliterator = null; } } }); }
Source:
protected static Integer convertToSenseVolumePercent(final Double maxDecibels, final Integer volumePercent) { if (volumePercent > 100 || volumePercent <= 1) { throw new IllegalArgumentException(String.format("volumePercent must be in the range (0, 100], not %s", volumePercent)); } final double decibelOffsetFromMaximum = 33.22 * Math.log10(volumePercent / 100.0); final double decibels = maxDecibels + decibelOffsetFromMaximum; return (int) Math.round((decibels / maxDecibels) * 100); }

Target:
protected static Integer convertToSenseVolumePercent(final Double maxDecibels, final Integer volumePercent) { if (volumePercent > 100 || volumePercent < 0) { throw new IllegalArgumentException(String.format("volumePercent must be in the range [0, 100], not %s", volumePercent)); } else if (volumePercent <= 1) { return 0; } final double decibelOffsetFromMaximum = 33.22 * Math.log10(volumePercent / 100.0); final double decibels = maxDecibels + decibelOffsetFromMaximum; return (int) Math.round((decibels / maxDecibels) * 100); }
Source:
public AdUserConditionFieldAutoCompleter() { mVerbs.put("NAME", "NAME"); mVerbs.put("USERNAME", "USERNAME"); if (StringHelper.EqOp(SyntaxCheckerFactory.getConfigAuthenticationMethod().toUpperCase(), "LDAP")) { mVerbs.put("LASTNAME", "LASTNAME"); mVerbs.put("DEPARTMENT", "DEPARTMENT"); mVerbs.put("TITLE", "TITLE"); } mVerbs.put("ALLNAMES", "ALLNAMES"); buildCompletions(); getTypeDictionary().put("NAME", String.class); getTypeDictionary().put("USERNAME", String.class); if (StringHelper.EqOp(SyntaxCheckerFactory.getConfigAuthenticationMethod().toUpperCase(), "LDAP")) { getTypeDictionary().put("LASTNAME", String.class); getTypeDictionary().put("DEPARTMENT", String.class); getTypeDictionary().put("TITLE", String.class); } mColumnNameDict.put("NAME", "$GIVENNAME"); mColumnNameDict.put("USERNAME", "$SAMACCOUNTNAME"); if (StringHelper.EqOp(SyntaxCheckerFactory.getConfigAuthenticationMethod().toUpperCase(), "LDAP")) { mColumnNameDict.put("LASTNAME", "$SN"); mColumnNameDict.put("DEPARTMENT", "$DEPARTMENT"); mColumnNameDict.put("TITLE", "$TITLE"); } ValueValidationFunction charValidation = validCahracters; for (String key : mVerbs.keySet()) { java.util.ArrayList<ValueValidationFunction> curList = new java.util.ArrayList<ValueValidationFunction>(); curList.add(charValidation); mValidationDict.put(key, curList); } }

Target:
public AdUserConditionFieldAutoCompleter() { mVerbs.put("NAME", "NAME"); mVerbs.put("USERNAME", "USERNAME"); if (StringHelper.EqOp(SyntaxCheckerFactory.getConfigAuthenticationMethod().toUpperCase(), "LDAP")) { mVerbs.put("LASTNAME", "LASTNAME"); mVerbs.put("DEPARTMENT", "DEPARTMENT"); mVerbs.put("TITLE", "TITLE"); } mVerbs.put("ALLNAMES", "ALLNAMES"); buildCompletions(); getTypeDictionary().put("NAME", String.class); getTypeDictionary().put("USERNAME", String.class); if (StringHelper.EqOp(SyntaxCheckerFactory.getConfigAuthenticationMethod().toUpperCase(), "LDAP")) { getTypeDictionary().put("LASTNAME", String.class); getTypeDictionary().put("DEPARTMENT", String.class); getTypeDictionary().put("TITLE", String.class); } mColumnNameDict.put("NAME", "$GIVENNAME"); mColumnNameDict.put("USERNAME", "$SAMACCOUNTNAME"); if (StringHelper.EqOp(SyntaxCheckerFactory.getConfigAuthenticationMethod().toUpperCase(), "LDAP")) { mColumnNameDict.put("LASTNAME", "$SN"); mColumnNameDict.put("DEPARTMENT", "$DEPARTMENT"); mColumnNameDict.put("TITLE", "$TITLE"); } ValueValidationFunction charValidation = validCahracters; for (String key : mVerbs.keySet()) { List<ValueValidationFunction> curList = new ArrayList<ValueValidationFunction>(1); curList.add(charValidation); mValidationDict.put(key, curList); } }
Source:
public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); if (delta != null) { ImageResourceDeltaVisitor visitor = getImageResourceDeltaVisitor(); try { delta.accept(visitor); } catch (CoreException e) { e.printStackTrace(); } for (String imageFileURI : visitor.changedImageFilesURI) { DiagramUIPlugin.getPlugin().removeImageFileStatusAndURIFromMaps(imageFileURI); } } }

Target:
public void resourceChanged(IResourceChangeEvent event) { }
Source:
public String cleanUp(String searchText) { if(searchText.contains("@")) { return searchText.split("@")[0]; } return searchText; }

Target:
private String cleanUp(String searchText) { return searchText.split("@")[0]; }
Source:
protected void buildAndValidateSaml( String samlRequest, String relayState, String signatureAlgorithm, String signature, SignableXMLObject xmlObject) throws ValidationException { String destination = request.getRequestURL().toString(); try { URL url = new URL(destination); if (url.getHost().equals(SystemBaseUrl.EXTERNAL.getHost()) && String.valueOf(url.getPort()).equals(SystemBaseUrl.EXTERNAL.getPort())) { destination = SystemBaseUrl.EXTERNAL.constructUrl(request.getRequestURI()); } } catch (MalformedURLException e) { LOGGER.error("Unable to convert request URL to URL object."); } new SamlValidator.Builder(simpleSign) .setRedirectParams( relayState, signature, signatureAlgorithm, samlRequest, idpMetadata.getSigningCertificate()) .buildAndValidate(destination, SamlProtocol.Binding.HTTP_REDIRECT, xmlObject); }

Target:
protected void buildAndValidateSaml( String samlRequest, String relayState, String signatureAlgorithm, String signature, SignableXMLObject xmlObject) throws ValidationException { String destination = request.getRequestURL().toString(); try { URL url = new URL(destination); if (url.getHost().equals(SystemBaseUrl.EXTERNAL.getHost()) && String.valueOf(url.getPort()).equals(SystemBaseUrl.EXTERNAL.getPort()) && !url.getPath().startsWith(SystemBaseUrl.EXTERNAL.getRootContext())) { destination = SystemBaseUrl.EXTERNAL.constructUrl(request.getRequestURI()); } } catch (MalformedURLException e) { LOGGER.error("Unable to convert request URL to URL object."); } new SamlValidator.Builder(simpleSign) .setRedirectParams( relayState, signature, signatureAlgorithm, samlRequest, idpMetadata.getSigningCertificate()) .buildAndValidate(destination, SamlProtocol.Binding.HTTP_REDIRECT, xmlObject); }
Source:
private static SSLCustomizerInterceptor checkAndGetTlsInterceptor() { if (Misc.isRunningOnAndroid()) { System.out.println("RUNNING ON ANDROID"); try { String tlsv1_2 = "TLSv1.2"; int androidApiLevel = Class.forName("android.os.Build$VERSION").getField ("SDK_INT").getInt(null); if (androidApiLevel < 20) { SSLContext defSslCtx = SSLContext.getDefault(); if (!Arrays.asList(defSslCtx.getDefaultSSLParameters().getProtocols()) .contains(tlsv1_2) && Arrays.asList(defSslCtx.getSupportedSSLParameters().getProtocols()) .contains(tlsv1_2)) { SSLContext sc = SSLContext.getInstance(tlsv1_2); sc.init(null, null, null); SSLSocketFactory s = sc.getSocketFactory(); return new Special(s); } } } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } catch (KeyManagementException e) { throw new RuntimeException(e); } } return null; }

Target:
private static SSLCustomizerInterceptor checkAndGetTlsInterceptor() { if (Misc.isRunningOnAndroid()) { try { int androidApiLevel = Class.forName("android.os.Build$VERSION").getField ("SDK_INT").getInt(null); if (androidApiLevel < 20) { SSLContext defSslCtx = SSLContext.getDefault(); if (!Arrays.asList(defSslCtx.getDefaultSSLParameters().getProtocols()) .contains(TlsOnlySslSocketFactory.TLSv12) && Arrays.asList(defSslCtx.getSupportedSSLParameters().getProtocols()) .contains(TlsOnlySslSocketFactory.TLSv12)) { SSLContext sc = SSLContext.getInstance(TlsOnlySslSocketFactory.TLSv12); sc.init(null, null, null); SSLSocketFactory s = sc.getSocketFactory(); return new SSLCustomizerInterceptor(new TlsOnlySslSocketFactory(s)); } } } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } catch (KeyManagementException e) { throw new RuntimeException(e); } } return null; }
Source:
public static boolean cacheProperty( Map<String, String> versionPropertyUpdateMap, String oldVersion, String newVersion, Object originalType ) throws ManipulationException { if (oldVersion == null) { return false; } boolean result = false; if ( oldVersion.startsWith( "${" ) ) { final int endIndex = oldVersion.indexOf( '}' ); final String oldProperty = oldVersion.substring( 2, endIndex ); if ( endIndex != oldVersion.length() - 1 ) { throw new ManipulationException( "NYI : handling for versions (" + oldVersion + ") with multiple embedded properties is NYI. " ); } else if ( "project.version".equals( oldProperty ) ) { logger.debug( "For ; original version was a property mapping. Not caching value as property is built-in ( -> )", originalType, oldProperty, newVersion ); } else { logger.debug( "For ; original version was a property mapping; caching new value for update -> {}", originalType, oldProperty, newVersion ); final String oldVersionProp = oldVersion.substring( 2, oldVersion.length() - 1 ); versionPropertyUpdateMap.put( oldVersionProp, newVersion ); } result = true; } return result; }

Target:
public static boolean cacheProperty( Map<String, String> versionPropertyUpdateMap, String oldVersion, String newVersion, Object originalType ) throws ManipulationException { boolean result = false; if ( oldVersion != null && oldVersion.startsWith( "${" ) ) { final int endIndex = oldVersion.indexOf( '}' ); final String oldProperty = oldVersion.substring( 2, endIndex ); if ( endIndex != oldVersion.length() - 1 ) { throw new ManipulationException( "NYI : handling for versions (" + oldVersion + ") with multiple embedded properties is NYI. " ); } else if ( "project.version".equals( oldProperty ) ) { logger.debug( "For ; original version was a property mapping. Not caching value as property is built-in ( -> )", originalType, oldProperty, newVersion ); } else { logger.debug( "For ; original version was a property mapping; caching new value for update -> {}", originalType, oldProperty, newVersion ); final String oldVersionProp = oldVersion.substring( 2, oldVersion.length() - 1 ); versionPropertyUpdateMap.put( oldVersionProp, newVersion ); } result = true; } return result; }
Source:
public void handleNewSession() { LOG.info("Got new session created event for processor=" + processorId); debounceTimer.cancelAction(ZK_SESSION_ERROR); LOG.info("register zk controller for the new session"); zkController.register(); }

Target:
public void handleNewSession() { LOG.info("Got new session created event for processor=" + processorId); debounceTimer.cancelAllScheduledActions(); LOG.info("register zk controller for the new session"); zkController.register(); }
Source:
public void onBindViewHolder(@NonNull SyncedPatientsRecyclerViewAdapter.PatientViewHolder holder, final int position) { holder.update(mItems.get(position)); final Patient patient = mItems.get(position); if (null != patient.getIdentifier()) { String patientIdentifier = String.format(mContext.getResources().getString(R.string.patient_identifier), patient.getIdentifier().getIdentifier()); holder.mIdentifier.setText(patientIdentifier); } if (null != patient.getName()) { holder.mDisplayName.setText(patient.getName().getNameString()); } if (null != patient.getGender()) { if (patient.getPhoto()!=null ){ holder.mGender.setImageBitmap(patient.getPhoto()); } else { if (patient.getGender().equals("M")) { holder.mGender.setImageResource(R.drawable.patient_male); } else { holder.mGender.setImageResource(R.drawable.patient_female); } } } if (patient.getDead()) { holder.mRowLayout.setCardBackgroundColor(mContext.getResources().getColor(R.color.deceased_red)); } try { holder.mBirthDate.setText(DateUtils.convertTime(DateUtils.convertTime(patient.getBirthdate()))); } catch (Exception e) { holder.mBirthDate.setText(""); } }

Target:
public void onBindViewHolder(@NonNull SyncedPatientsRecyclerViewAdapter.PatientViewHolder holder, final int position) { holder.update(mItems.get(position)); final Patient patient = mItems.get(position); if (null != patient.getIdentifier()) { String patientIdentifier = String.format(mContext.getResources().getString(R.string.patient_identifier), patient.getIdentifier().getIdentifier()); holder.mIdentifier.setText(patientIdentifier); } if (null != patient.getName()) { holder.mDisplayName.setText(patient.getName().getNameString()); } if (null != patient.getGender()) { if (patient.getPhoto()!=null ){ holder.mGender.setImageBitmap(patient.getPhoto()); } else { if (patient.getGender().equals(ApplicationConstants.MALE)) { holder.mGender.setImageResource(R.drawable.patient_male); } else { holder.mGender.setImageResource(R.drawable.patient_female); } } } if (patient.isDeceased()) { holder.mRowLayout.setCardBackgroundColor(mContext.getResources().getColor(R.color.deceased_red)); } try { holder.mBirthDate.setText(DateUtils.convertTime(DateUtils.convertTime(patient.getBirthdate()))); } catch (Exception e) { holder.mBirthDate.setText(""); } }
Source:
private String header(final Environment env) { final String name = env.param("license", "LICENSE.txt"); final URL url = CheckstyleValidator.toUrl(env, name); final String content; try { content = IOUtils.toString( url.openStream(), Charset.defaultCharset() ).trim().replaceAll("[\\r\\n]+$", ""); } catch (final IOException ex) { throw new IllegalStateException("Failed to read license", ex); } final StringBuilder builder = new StringBuilder(Tv.HUNDRED); final String eol = System.getProperty("line.separator"); builder.append(" "); final String license = builder.toString(); Logger.debug(this, "LICENSE found: %s", url); Logger.debug( this, "LICENSE full text after parsing:\n%s", license ); return license; }

Target:
private String header(final Environment env) { final String name = env.param("license", "LICENSE.txt"); final URL url = CheckstyleValidator.toUrl(env, name); final String content; try { content = new ReplacedText( new TrimmedText( new TextOf( url.openStream() ) ), "[\\r\\n]+$", "" ).asString(); } catch (final IOException ex) { throw new IllegalStateException("Failed to read license", ex); } final StringBuilder builder = new StringBuilder(Tv.HUNDRED); final String eol = System.getProperty("line.separator"); builder.append(" "); final String license = builder.toString(); Logger.debug(this, "LICENSE found: %s", url); Logger.debug( this, "LICENSE full text after parsing:\n%s", license ); return license; }
Source:
public void dispose() { this.mHandler.removeCallbacksAndMessages(null); this.mHandler = null; this.mPhone = null; }

Target:
public void dispose() { }
Source:
synchronized boolean onChannelClosed() throws IOException { numOpenChannels--; if (numBarriersReceived > 0) { resetReceivedBarriers(); notifyAbort(new CheckpointException(CheckpointFailureReason.CHECKPOINT_DECLINED_INPUT_END_OF_STREAM)); return true; } return false; }

Target:
synchronized void onChannelClosed() throws IOException { numOpenChannels--; if (resetPendingCheckpoint()) { handler.notifyAbort( currentReceivedCheckpointId, new CheckpointException(CheckpointFailureReason.CHECKPOINT_DECLINED_INPUT_END_OF_STREAM)); } }
Source:
protected void executeCommand() { try { boolean commandSucceeded = reconstructMaster(); connectAndRefreshAllUpHosts(commandSucceeded); if (!_isLastMaster && commandSucceeded) { SearchParameters p = new SearchParameters( MessageFormat.format(DesktopsInStoragePoolQuery, getStoragePool().getname()), SearchType.VM); p.setMaxCount(Integer.MAX_VALUE); @SuppressWarnings("unchecked") List<VM> vmsInPool = (List<VM>) Backend.getInstance() .runInternalQuery(VdcQueryType.Search, p).getReturnValue(); VmCommand.updateVmInSpm(getStoragePool().getId(), vmsInPool); } setSucceeded(commandSucceeded); } finally { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.MarkPoolInReconstructMode, new MarkPoolInReconstructModeVDSCommandParameters(getStoragePoolId() .getValue(), ReconstructMarkAction.ClearCache)); } IrsBrokerCommand.unLockIrsProxyData(getStoragePool().getId()); }

Target:
protected void executeCommand() { try { boolean commandSucceeded = reconstructMaster(); connectAndRefreshAllUpHosts(commandSucceeded); if (!_isLastMaster && commandSucceeded) { SearchParameters p = new SearchParameters( MessageFormat.format(DesktopsInStoragePoolQuery, getStoragePool().getname()), SearchType.VM); p.setMaxCount(Integer.MAX_VALUE); @SuppressWarnings("unchecked") List<VM> vmsInPool = (List<VM>) Backend.getInstance() .runInternalQuery(VdcQueryType.Search, p).getReturnValue(); VmCommand.updateVmInSpm(getStoragePool().getId(), vmsInPool); } setSucceeded(commandSucceeded); } finally { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.MarkPoolInReconstructMode, new MarkPoolInReconstructModeVDSCommandParameters(getStoragePoolId() .getValue(), ReconstructMarkAction.ClearCache)); IrsBrokerCommand.unLockIrsProxyData(getStoragePool().getId()); } }
Source:
protected boolean isProcessed(String group, TopicPartition topicPartition, long offset) { Properties props = (Properties) consumerProps.clone(); props.put(ConsumerConfig.GROUP_ID_CONFIG, group); try (KafkaConsumer<String, Bytes> consumer = new KafkaConsumer<>(props)) { consumer.assign(Collections.singletonList(topicPartition)); long last = consumer.position(topicPartition); boolean ret = (last > 0) && (last > offset); if (log.isDebugEnabled()) { log.debug("isProcessed " + topicPartition.topic() + ":" + topicPartition.partition() + "/" + group + ":+" + offset + "? " + ret + ", current position: " + last); } return ret; } }

Target:
protected boolean isProcessed(String group, TopicPartition topicPartition, long offset) { Properties props = (Properties) consumerProps.clone(); props.put(ConsumerConfig.GROUP_ID_CONFIG, group); try (KafkaConsumer<String, Bytes> consumer = new KafkaConsumer<>(props)) { consumer.assign(Collections.singletonList(topicPartition)); long last = consumer.position(topicPartition); boolean ret = last > 0 && last > offset; if (log.isDebugEnabled()) { log.debug("isProcessed " + topicPartition.topic() + ":" + topicPartition.partition() + "/" + group + ":+" + offset + "? " + ret + ", current position: " + last); } return ret; } }
Source:
private static void initQuotaSeverities() { mSeverities.put(AuditLogType.USER_ADD_QUOTA, AuditLogSeverity.NORMAL); mSeverities.put(AuditLogType.USER_UPDATE_QUOTA, AuditLogSeverity.NORMAL); mSeverities.put(AuditLogType.USER_DELETE_QUOTA, AuditLogSeverity.NORMAL); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_VDS_GROUP_GRACE_LIMIT, AuditLogSeverity.ALERT); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_VDS_GROUP_LIMIT, AuditLogSeverity.ALERT); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_VDS_GROUP_THRESHOLD, AuditLogSeverity.WARNING); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_STORAGE_GRACE_LIMIT, AuditLogSeverity.ALERT); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_STORAGE_LIMIT, AuditLogSeverity.ALERT); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_STORAGE_THRESHOLD, AuditLogSeverity.WARNING); }

Target:
private static void initQuotaSeverities() { mSeverities.put(AuditLogType.USER_ADD_QUOTA, AuditLogSeverity.NORMAL); mSeverities.put(AuditLogType.USER_FAILED_ADD_QUOTA, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.USER_UPDATE_QUOTA, AuditLogSeverity.NORMAL); mSeverities.put(AuditLogType.USER_FAILED_UPDATE_QUOTA, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.USER_DELETE_QUOTA, AuditLogSeverity.NORMAL); mSeverities.put(AuditLogType.USER_FAILED_DELETE_QUOTA, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_VDS_GROUP_GRACE_LIMIT, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_VDS_GROUP_LIMIT, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_VDS_GROUP_THRESHOLD, AuditLogSeverity.WARNING); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_STORAGE_GRACE_LIMIT, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_STORAGE_LIMIT, AuditLogSeverity.ERROR); mSeverities.put(AuditLogType.USER_EXCEEDED_QUOTA_STORAGE_THRESHOLD, AuditLogSeverity.WARNING); mSeverities.put(AuditLogType.USER_NOT_PERMITTED_TO_CONSUME_QUOTA, AuditLogSeverity.WARNING); }
Source:
OperatorImpl createOperatorImpl(OperatorSpec prevOperatorSpec, OperatorSpec operatorSpec, Config config, TaskContext context) { if (operatorSpec instanceof InputOperatorSpec) { return new InputOperatorImpl((InputOperatorSpec) operatorSpec); } else if (operatorSpec instanceof StreamOperatorSpec) { return new StreamOperatorImpl((StreamOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof SinkOperatorSpec) { return new SinkOperatorImpl((SinkOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof OutputOperatorSpec) { return new OutputOperatorImpl((OutputOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof PartitionByOperatorSpec) { return new PartitionByOperatorImpl((PartitionByOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof WindowOperatorSpec) { return new WindowOperatorImpl((WindowOperatorSpec) operatorSpec, clock); } else if (operatorSpec instanceof JoinOperatorSpec) { return createPartialJoinOperatorImpl(prevOperatorSpec, (JoinOperatorSpec) operatorSpec, config, context, clock); } else if (operatorSpec instanceof StreamTableJoinOperatorSpec) { return new StreamTableJoinOperatorImpl((StreamTableJoinOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof WriteToOperatorSpec) { return new WriteToOperatorImpl((WriteToOperatorSpec) operatorSpec, config, context); } throw new IllegalArgumentException( String.format("Unsupported OperatorSpec: %s", operatorSpec.getClass().getName())); }

Target:
OperatorImpl createOperatorImpl(OperatorSpec prevOperatorSpec, OperatorSpec operatorSpec, Config config, TaskContext context) { if (operatorSpec instanceof InputOperatorSpec) { return new InputOperatorImpl((InputOperatorSpec) operatorSpec); } else if (operatorSpec instanceof StreamOperatorSpec) { return new StreamOperatorImpl((StreamOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof SinkOperatorSpec) { return new SinkOperatorImpl((SinkOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof OutputOperatorSpec) { return new OutputOperatorImpl((OutputOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof PartitionByOperatorSpec) { return new PartitionByOperatorImpl((PartitionByOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof WindowOperatorSpec) { return new WindowOperatorImpl((WindowOperatorSpec) operatorSpec, clock); } else if (operatorSpec instanceof JoinOperatorSpec) { return createPartialJoinOperatorImpl(prevOperatorSpec, (JoinOperatorSpec) operatorSpec, config, context, clock); } else if (operatorSpec instanceof StreamTableJoinOperatorSpec) { return new StreamTableJoinOperatorImpl((StreamTableJoinOperatorSpec) operatorSpec, config, context); } else if (operatorSpec instanceof SendToTableOperatorSpec) { return new SendToTableOperatorImpl((SendToTableOperatorSpec) operatorSpec, config, context); } throw new IllegalArgumentException( String.format("Unsupported OperatorSpec: %s", operatorSpec.getClass().getName())); }
Source:
int blockFork() { int firstAIMark, firstAIMarkRow, firstAIMarkColumn; for (int i = 0; i < fieldSize; i++) for (int j = 0; j < fieldSize; j++) { if (fieldArray[i][j] != 0) continue; fieldArray[i][j] = playerMark; firstAIMark = blockPlayerWin(); if (blockPlayerWin() >= 0) { firstAIMarkRow = firstAIMark / fieldSize; firstAIMarkColumn = firstAIMark % fieldSize; fieldArray[firstAIMarkRow][firstAIMarkColumn] = aIMark; } else { fieldArray[i][j] = 0; continue; } if (blockPlayerWin() >= 0) { fieldArray[firstAIMarkRow][firstAIMarkColumn] = 0; if (!autoGameEnabled) fieldArray[i][j] = aIMark; return (i * fieldSize + j); } fieldArray[i][j] = 0; fieldArray[firstAIMarkRow][firstAIMarkColumn] = 0; } return NOTHING_TO_PREVENT; }

Target:
int blockFork() { int firstAIMark, firstAIMarkRow, firstAIMarkColumn; for (int i = 0; i < fieldSize; i++) for (int j = 0; j < fieldSize; j++) { if (fieldArray[i][j] != 0) { continue; } fieldArray[i][j] = playerMark; firstAIMark = blockPlayerWin(); if (blockPlayerWin() >= 0) { firstAIMarkRow = firstAIMark / fieldSize; firstAIMarkColumn = firstAIMark % fieldSize; fieldArray[firstAIMarkRow][firstAIMarkColumn] = aIMark; } else { fieldArray[i][j] = 0; continue; } if (blockPlayerWin() >= 0) { fieldArray[firstAIMarkRow][firstAIMarkColumn] = 0; if (!autoGameEnabled) { fieldArray[i][j] = aIMark; } return (i * fieldSize + j); } fieldArray[i][j] = 0; fieldArray[firstAIMarkRow][firstAIMarkColumn] = 0; } return NOTHING_TO_PREVENT; }
Source:
public static MavenConfiguration getMavenConfig() { return safetelyGetConfig(() -> mavenConfig); }

Target:
public static MavenConfiguration getMavenConfig() { return safelyGetConfig(() -> mavenConfig); }
Source:
private void initSsl(Channel channel) { SslConfiguration ssl = configuration.security().ssl(); SSLContext jdkSslContext = ssl.sslContext(); if (jdkSslContext == null) { jdkSslContext = SslContextFactory.getContext( ssl.keyStoreFileName(), ssl.keyStoreType(), ssl.keyStorePassword(), ssl.keyStoreCertificatePassword(), ssl.keyAlias(), ssl.trustStoreFileName(), ssl.trustStoreType(), ssl.trustStorePassword(), ssl.protocol(), configuration.classLoader()); } SslContext nettySslContext = new JdkSslContext(jdkSslContext, true, ClientAuth.NONE); channel.pipeline().addFirst(nettySslContext.newHandler(channel.alloc(), ssl.sniHostName(), -1), SslHandshakeExceptionHandler.INSTANCE); }

Target:
private void initSsl(Channel channel) { SslConfiguration ssl = configuration.security().ssl(); SslContext nettySslContext; SSLContext jdkSslContext = ssl.sslContext(); if (jdkSslContext == null) { SslContextBuilder builder = SslContextBuilder.forClient(); try { if (ssl.keyStoreFileName() != null) { builder.keyManager(SslContextFactory.getKeyManagerFactory( ssl.keyStoreFileName(), ssl.keyStoreType(), ssl.keyStorePassword(), ssl.keyStoreCertificatePassword(), ssl.keyAlias(), configuration.classLoader())); } if (ssl.trustStoreFileName() != null) { builder.trustManager(SslContextFactory.getTrustManagerFactory( ssl.trustStoreFileName(), ssl.trustStoreType(), ssl.trustStorePassword(), configuration.classLoader())); } if (ssl.protocol() != null) { builder.protocols(ssl.protocol()); } nettySslContext = builder.build(); } catch (Exception e) { throw new CacheConfigurationException(e); } } else { nettySslContext = new JdkSslContext(jdkSslContext, true, ClientAuth.NONE); } SslHandler sslHandler = nettySslContext.newHandler(channel.alloc(), ssl.sniHostName(), -1); if (ssl.sniHostName() != null) { SSLParameters sslParameters = sslHandler.engine().getSSLParameters(); sslParameters.setServerNames(Collections.singletonList(new SNIHostName(ssl.sniHostName()))); sslHandler.engine().setSSLParameters(sslParameters); } channel.pipeline().addFirst(sslHandler, SslHandshakeExceptionHandler.INSTANCE); }
Source:
public void verifyContributionQuestionDetails(int questionNum, FeedbackContributionQuestionDetails questionDetails) { if (questionDetails.isNotSureAllowed()) { assertTrue(getAllowNotSureConstributionCheckbox(questionNum).isSelected()); } else { assertFalse(getAllowNotSureConstributionCheckbox(questionNum).isSelected()); } }

Target:
public void verifyContributionQuestionDetails(int questionNum, FeedbackContributionQuestionDetails questionDetails) { assertEquals(questionDetails.isNotSureAllowed(), getAllowNotSureContributionCheckbox(questionNum).isSelected()); }