auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public long initiateFlush(TInfo tinfo, TCredentials c, String tableId) throws ThriftSecurityException, ThriftTableOperationException { String namespaceId; try { namespaceId = Tables.getNamespaceId(instance, tableId); } catch (TableNotFoundException e1) { throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.NOTFOUND, e1.getMessage()); } master.security.canFlush(c, tableId, namespaceId); String zTablePath = Constants.ZROOT + "/" + master.getInstance().getInstanceID() + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_FLUSH_ID; IZooReaderWriter zoo = ZooReaderWriter.getInstance(); byte fid[]; try { fid = zoo.mutate(zTablePath, null, null, new Mutator() { @Override public byte[] mutate(byte[] currentValue) throws Exception { long flushID = Long.parseLong(new String(currentValue)); flushID++; return ("" + flushID).getBytes(); } }); } catch (NoNodeException nne) { throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.NOTFOUND, null); } catch (Exception e) { Master.log.warn("{}", e.getMessage(), e); throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.OTHER, null); } return Long.parseLong(new String(fid)); }

Target:
public long initiateFlush(TInfo tinfo, TCredentials c, String tableId) throws ThriftSecurityException, ThriftTableOperationException { String namespaceId = getNamespaceIdFromTableId(TableOperation.FLUSH, tableId); master.security.canFlush(c, tableId, namespaceId); String zTablePath = Constants.ZROOT + "/" + master.getInstance().getInstanceID() + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_FLUSH_ID; IZooReaderWriter zoo = ZooReaderWriter.getInstance(); byte fid[]; try { fid = zoo.mutate(zTablePath, null, null, new Mutator() { @Override public byte[] mutate(byte[] currentValue) throws Exception { long flushID = Long.parseLong(new String(currentValue)); flushID++; return ("" + flushID).getBytes(); } }); } catch (NoNodeException nne) { throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.NOTFOUND, null); } catch (Exception e) { Master.log.warn("{}", e.getMessage(), e); throw new ThriftTableOperationException(tableId, null, TableOperation.FLUSH, TableOperationExceptionType.OTHER, null); } return Long.parseLong(new String(fid)); }
Source:
public static boolean isOsSupportedForVirtIoScsi(int osId, Version clusterVersion) { ArrayList<String> diskInterfaces = SimpleDependecyInjector.getInstance().get(OsRepository.class).getDiskInterfaces(osId, clusterVersion); return diskInterfaces.contains(DiskInterface.VirtIO_SCSI.toString()); }

Target:
public static boolean isOsSupportedForVirtIoScsi(int osId, Version clusterVersion) { List<String> diskInterfaces = SimpleDependecyInjector.getInstance().get(OsRepository.class).getDiskInterfaces(osId, clusterVersion); return diskInterfaces.contains(DiskInterface.VirtIO_SCSI.toString()); }
Source:
splitCurrentByRegex(SortedMap<TServerInstance,TabletServerStatus> current) { LOG.debug("Performing pool recheck - regrouping tablet servers based on regular expressions"); Map<String,SortedMap<TServerInstance,TabletServerStatus>> newPools = new HashMap<>(); for (Entry<TServerInstance,TabletServerStatus> e : current.entrySet()) { List<String> poolNames = getPoolNamesForHost(e.getKey().host()); for (String pool : poolNames) { SortedMap<TServerInstance,TabletServerStatus> np = newPools.get(pool); if (null == np) { np = new TreeMap<>(current.comparator()); newPools.put(pool, np); } np.put(e.getKey(), e.getValue()); } } if (newPools.get(DEFAULT_POOL) == null) { LOG.info("Default pool is empty; assigning all tablet servers to the default pool"); for (Entry<TServerInstance,TabletServerStatus> e : current.entrySet()) { SortedMap<TServerInstance,TabletServerStatus> np = newPools.get(DEFAULT_POOL); if (null == np) { np = new TreeMap<>(current.comparator()); newPools.put(DEFAULT_POOL, np); } np.put(e.getKey(), e.getValue()); } } pools = newPools; LOG.trace("Pool to TabletServer mapping:"); if (LOG.isTraceEnabled()) { for (Entry<String,SortedMap<TServerInstance,TabletServerStatus>> e : pools.entrySet()) { LOG.trace("\tpool: -> tservers: {}", e.getKey(), e.getValue().keySet()); } } return pools; }

Target:
splitCurrentByRegex(SortedMap<TServerInstance,TabletServerStatus> current) { LOG.debug("Performing pool recheck - regrouping tablet servers based on regular expressions"); Map<String,SortedMap<TServerInstance,TabletServerStatus>> newPools = new HashMap<>(); for (Entry<TServerInstance,TabletServerStatus> e : current.entrySet()) { List<String> poolNames = getPoolNamesForHost(e.getKey().host()); for (String pool : poolNames) { SortedMap<TServerInstance,TabletServerStatus> np = newPools.get(pool); if (null == np) { np = new TreeMap<>(current.comparator()); newPools.put(pool, np); } np.put(e.getKey(), e.getValue()); } } if (newPools.get(DEFAULT_POOL) == null) { LOG.warn("Default pool is empty; assigning all tablet servers to the default pool"); SortedMap<TServerInstance, TabletServerStatus> dp = new TreeMap<>(current.comparator()); dp.putAll(current); newPools.put(DEFAULT_POOL, dp); } pools = newPools; LOG.trace("Pool to TabletServer mapping:"); if (LOG.isTraceEnabled()) { for (Entry<String,SortedMap<TServerInstance,TabletServerStatus>> e : pools.entrySet()) { LOG.trace("\tpool: -> tservers: {}", e.getKey(), e.getValue().keySet()); } } return pools; }
Source:
private void handleOperations() { eventBus.addHandler(WsAgentStateEvent.TYPE, new WsAgentStateHandler() { @Override public void onWsAgentStarted(WsAgentStateEvent event) { } @Override public void onWsAgentStopped(WsAgentStateEvent event) { dependencyResolver.hide(); } }); eventBus.addHandler(WorkspaceStoppedEvent.TYPE, event -> dependencyResolver.hide()); }

Target:
private void handleOperations() { eventBus.addHandler(WorkspaceStoppedEvent.TYPE, event -> dependencyResolver.hide()); }
Source:
protected String getLogFileLocation() { return Urls.mergePaths("/var/log/riak", "solr.log"); }

Target:
protected String getLogFileLocation() { return "/var/log/riak/solr.log"; }
Source:
protected Integer parseNodeInteger(XmlNode sourceNode, String string, Integer defaultValue) { XmlNode subNode = sourceNode.SelectSingleNode(string, _xmlNS); if (subNode != null && subNode.innerText != null) { Integer ret = Integer.parseInt(subNode.innerText); return ret; } return defaultValue; }

Target:
protected Integer parseNodeInteger(XmlNode sourceNode, String string, Integer defaultValue) { XmlNode subNode = selectSingleNode(sourceNode, string, _xmlNS); if (subNode != null && subNode.innerText != null) { Integer ret = Integer.parseInt(subNode.innerText); return ret; } return defaultValue; }
Source:
public boolean test(IPerson person) { String personHash = person.getEntityIdentifier().getKey() + hashcode + Thread.currentThread().getId(); logger.debug(personHash); if (currentPersons.contains(personHash)) return false; currentPersons.add(personHash); IGroupMember gmPerson = findPersonAsGroupMember(person); boolean pass = true; Iterator<IEntityGroup> groups = includes.iterator(); while (pass && groups.hasNext()) { IEntityGroup group = groups.next(); if (!gmPerson.isDeepMemberOf(group)) { logger.debug("!! is not a member of {}", person.getUserName(), group.getDescription()); pass = false; } else { logger.debug("{} is a member of {}", person.getUserName(), group.getDescription()); } } groups = excludes.iterator(); while (pass && groups.hasNext()) { IEntityGroup group = groups.next(); if (gmPerson.isDeepMemberOf(group)) { logger.debug("!! is a member of {}", person.getUserName(), group.getDescription()); pass = false; } else { logger.debug("{} is a not member of {}", person.getUserName(), group.getDescription()); } } currentPersons.remove(personHash); return pass; }

Target:
public boolean test(IPerson person) { String personHash = person.getEntityIdentifier().getKey() + groupHash + Thread.currentThread().getId(); logger.debug("Entering test() for {}", personHash); IEntityGroup entityGroup = findGroupByName(groupName); if (entityGroup == null) { logger.error("Group named '{}' in ad hoc group tester definition not found!!", groupName); return false; } IGroupMember gmPerson = findPersonAsGroupMember(person); if (currentTests.getQuiet(personHash) != null) { logger.debug("Returning from test() for due to recusion for person = {}", personHash, person.toString()); return false; } Element cacheEl = new Element(personHash, personHash); currentTests.put(cacheEl); boolean isPersonGroupMember = gmPerson.isDeepMemberOf(entityGroup); currentTests.remove(personHash); logger.debug("Returning from test() for {}", personHash); return isPersonGroupMember ^ isNotTest; }
Source:
public LockHelper(final OsmandApplication app) { this.app = app; uiHandler = new Handler(); lockRunnable = new LockRunnable(); mSensorManager = (SensorManager) app.getSystemService(Context.SENSOR_SERVICE); mProximity = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); switchOnSensor(); voiceMessageListener = new VoiceRouter.VoiceMessageListener() { @Override public void onVoiceMessage() { LOG.debug("onVoiceMessage"); unlockEvent(); } }; }

Target:
public LockHelper(final OsmandApplication app) { this.app = app; uiHandler = new Handler(); lockRunnable = new LockRunnable(); settings = app.getSettings(); mSensorManager = (SensorManager) app.getSystemService(Context.SENSOR_SERVICE); mProximity = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); voiceMessageListener = new VoiceRouter.VoiceMessageListener() { @Override public void onVoiceMessage() { unlockEvent(); } }; }
Source:
public void checkIoExceptionsAreHandled() throws InterruptedException { this.client.failMessageSending.set( true ); AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); processor.scopedInstance = new TestApplicationTemplate().getMySqlVm(); processor.processMessage( new MsgCmdSendInstances()); }

Target:
public void checkIoExceptionsAreHandled() { this.client.failMessageSending.set( true ); AgentMessageProcessor processor = (AgentMessageProcessor) this.agent.getMessagingClient().getMessageProcessor(); processor.scopedInstance = new TestApplicationTemplate().getMySqlVm(); processor.processMessage( new MsgCmdSendInstances()); }
Source:
private void createExternalWorkspaces() { Snapshot current = this.snapshot.get(); Collection<String> workspaces = current.externalSources(); for (String workspaceName : workspaces) { repository.repositoryCache().createExternalWorkspace(workspaceName, this); } }

Target:
private void createExternalWorkspaces() throws RepositoryException { Snapshot current = this.snapshot.get(); Collection<String> externalSources = current.externalSources(); for (String sourceName : externalSources) { Connector connector = current.getConnectorWithSourceKey(NodeKey.keyForSourceName(sourceName)); if (connector != null && connector.isExposeAsWorkspace()) { repository.repositoryCache().createExternalWorkspace(sourceName, this); } } }
Source:
protected InputStream onSuccessfulProxyRepositoryResponse(InputStream is, String storageId, String repositoryId, String path) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { final Storage storage = configurationManager.getConfiguration().getStorage(storageId); final Repository repository = storage.getRepository(repositoryId); final LayoutProvider layoutProvider = layoutProviderRegistry.getProvider(repository.getLayout()); final RepositoryPath artifactPath = layoutProvider.resolve(repository).resolve(path); final RepositoryFileSystemProvider fileSystemProvider = artifactPath.getFileSystem().provider(); final RepositoryPath tempArtifact = fileSystemProvider.getTempPath(artifactPath); try ( final InputStream remoteIs = new MultipleDigestInputStream(is)) { long totalNumberOfArtifactBytes = layoutProvider.getArtifactManagementService().store(tempArtifact, remoteIs); fileSystemProvider.moveFromTemporaryDirectory(artifactPath); RemoteArtifactEntry artifactEntry = (RemoteArtifactEntry) artifactEntryService.findOneArtifact(storageId, repositoryId, path) .orElse(new RemoteArtifactEntry()); ArtifactCoordinates c = RepositoryFiles.readCoordinates(artifactPath); artifactEntry.setArtifactCoordinates(c); artifactEntry.setStorageId(storageId); artifactEntry.setRepositoryId(repositoryId); artifactEntry.setIsCached(Boolean.TRUE); artifactEntry.setArtifactPath(path); Date now = new Date(); artifactEntry.setLastUpdated(now); artifactEntry.setLastUsed(now); artifactEntry.setSizeInBytes(totalNumberOfArtifactBytes); artifactEntryService.save(artifactEntry); return Files.newInputStream(artifactPath); } }

Target:
protected InputStream onSuccessfulProxyRepositoryResponse(InputStream is, String storageId, String repositoryId, String path) throws IOException, NoSuchAlgorithmException, ProviderImplementationException { final Storage storage = configurationManager.getConfiguration().getStorage(storageId); final Repository repository = storage.getRepository(repositoryId); final LayoutProvider layoutProvider = layoutProviderRegistry.getProvider(repository.getLayout()); final RepositoryPath artifactPath = layoutProvider.resolve(repository).resolve(path); final RepositoryPath tempArtifact = RepositoryFiles.temporary(artifactPath); try ( final InputStream remoteIs = new MultipleDigestInputStream(is)) { layoutProvider.getArtifactManagementService().store(tempArtifact, remoteIs); RepositoryFiles.permanent(artifactPath); return Files.newInputStream(artifactPath); } }
Source:
private boolean hasTheSameSchema(Table newTable, Table existingTable) { List<Column> newTableColumns = newTable.getDataColumns(); List<Column> existingTableColumns = existingTable.getDataColumns(); for (Column existingColumn : existingTableColumns) { Optional<Column> createTableColumnMetadata = newTableColumns.stream() .filter(newColumn -> newColumn.getName().equals(existingColumn.getName()) && newColumn.getType().equals(existingColumn.getType())) .findFirst(); if (!createTableColumnMetadata.isPresent()) { return false; } } return true; }

Target:
private boolean hasTheSameSchema(Table newTable, Table existingTable) { List<Column> newTableColumns = newTable.getDataColumns(); List<Column> existingTableColumns = existingTable.getDataColumns(); if (newTableColumns.size() != existingTableColumns.size()) { return false; } for (Column existingColumn : existingTableColumns) { if (newTableColumns.stream() .noneMatch(newColumn -> newColumn.getName().equals(existingColumn.getName()) && newColumn.getType().equals(existingColumn.getType()))) { return false; } } return true; }
Source:
protected boolean validateAttachedDirectLuns() { if (getParameters().getAttachedDirectLunsIds() == null) { return true; } Set<String> idsOfDirectLunsAttachedToVmsInPool = getIdsOfDirectLunsAttachedToVmsInPool(); Collection<String> directLunsNotAttachedToVmInPool = getParameters().getAttachedDirectLunsIds() .stream() .filter(lunId -> !idsOfDirectLunsAttachedToVmsInPool.contains(lunId)) .collect(Collectors.toList()); return directLunsNotAttachedToVmInPool.isEmpty() || failValidation( EngineMessage.ACTION_TYPE_FAILED_CANNOT_SYNC_DIRECT_LUNS_NOT_ATTACHED_TO_VM_IN_POOL, String.format("$lunIds %s", directLunsNotAttachedToVmInPool.stream().sorted().collect(Collectors.joining(","))), String.format("$storagePoolId %s", getParameters().getStoragePoolId())); }

Target:
protected boolean validateAttachedDirectLuns() { if (getParameters().getAttachedDirectLunsIds() == null) { return true; } Set<String> idsOfDirectLunsAttachedToVmsInStoragePool = getIdsOfDirectLunsAttachedToVmsInPool(); Collection<String> directLunsNotAttachedToVmInPool = getParameters().getAttachedDirectLunsIds() .stream() .filter(lunId -> !idsOfDirectLunsAttachedToVmsInStoragePool.contains(lunId)) .collect(Collectors.toList()); return directLunsNotAttachedToVmInPool.isEmpty() || failValidation( EngineMessage.ACTION_TYPE_FAILED_CANNOT_SYNC_DIRECT_LUNS_NOT_ATTACHED_TO_VM_IN_POOL, String.format("$lunIds %s", directLunsNotAttachedToVmInPool.stream().sorted().collect(Collectors.joining(", "))), String.format("$storagePoolId %s", getParameters().getStoragePoolId())); }
Source:
protected String[] createParamsForTypicalFeedbackSession(String courseId, String fsName) { return new String[] { Const.ParamsNames.COURSE_ID, courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, fsName, Const.ParamsNames.FEEDBACK_SESSION_STARTDATE, "Wed, 01 Feb, 2012", Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_ENDDATE, "Thu, 01 Jan, 2015", Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_SESSIONVISIBLEBUTTON, Const.INSTRUCTOR_FEEDBACK_SESSION_VISIBLE_TIME_CUSTOM, Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE, "Sun, 01 Jan, 2012", Const.ParamsNames.FEEDBACK_SESSION_VISIBLETIME, "0", Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON, Const.INSTRUCTOR_FEEDBACK_RESULTS_VISIBLE_TIME_ATVISIBLE, Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE, "", Const.ParamsNames.FEEDBACK_SESSION_PUBLISHTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_TIMEZONE, "UTC+08:00", Const.ParamsNames.FEEDBACK_SESSION_GRACEPERIOD, "10", Const.ParamsNames.FEEDBACK_SESSION_INSTRUCTIONS, "instructions" }; }

Target:
protected String[] createParamsForTypicalFeedbackSession(String courseId, String fsName) { return new String[] { Const.ParamsNames.COURSE_ID, courseId, Const.ParamsNames.FEEDBACK_SESSION_NAME, fsName, Const.ParamsNames.FEEDBACK_SESSION_STARTDATE, "Wed, 01 Feb, 2012", Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_ENDDATE, "Thu, 01 Jan, 2015", Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_SESSIONVISIBLEBUTTON, Const.INSTRUCTOR_FEEDBACK_SESSION_VISIBLE_TIME_CUSTOM, Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE, "Sun, 01 Jan, 2012", Const.ParamsNames.FEEDBACK_SESSION_VISIBLETIME, "0", Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON, Const.INSTRUCTOR_FEEDBACK_RESULTS_VISIBLE_TIME_ATVISIBLE, Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE, "", Const.ParamsNames.FEEDBACK_SESSION_PUBLISHTIME, "0", Const.ParamsNames.FEEDBACK_SESSION_TIMEZONE, "Asia/Singapore", Const.ParamsNames.FEEDBACK_SESSION_GRACEPERIOD, "10", Const.ParamsNames.FEEDBACK_SESSION_INSTRUCTIONS, "instructions" }; }
Source:
private Pair<StorageDomainStatic, Guid> executeHSMGetStorageDomainInfo() { return (Pair<StorageDomainStatic, Guid>) runVdsCommand(VDSCommandType.HSMGetStorageDomainInfo, new HSMGetStorageDomainInfoVDSCommandParameters(getVds().getId(), getStorageDomain().getId())).getReturnValue(); }

Target:
private StorageDomainStatic executeHSMGetStorageDomainInfo() { return ((Pair<StorageDomainStatic, Guid>) runVdsCommand( VDSCommandType.HSMGetStorageDomainInfo, new HSMGetStorageDomainInfoVDSCommandParameters( getVds().getId(), getStorageDomain().getId())) .getReturnValue()).getFirst(); }
Source:
protected void onHandleIntent(@NonNull Intent intent) { List<ReadingListPageDiskRow> queue = new ArrayList<>(); Collection<ReadingListPageDiskRow> rows = dao.startDiskTransaction(); if (rows.isEmpty()) { return; } for (final ReadingListPageDiskRow row : rows) { if (row.status() == DELETED) { final PageTitle title = makeTitleFrom(row); new SavedPage(title).deleteFromFileSystem(); dao.completeDiskTransaction(row); continue; } if (row.status() == UNSAVED || row.status() == OUTDATED) { queue.add(row); continue; } throw new UnsupportedOperationException("Invalid disk row status: " + row.status().name()); } saveNewEntries(queue); }

Target:
protected void onHandleIntent(@NonNull Intent intent) { List<ReadingListPageDiskRow> queue = new ArrayList<>(); Collection<ReadingListPageDiskRow> rows = dao.startDiskTransaction(); for (final ReadingListPageDiskRow row : rows) { if (row.status() == UNSAVED || row.status() == DELETED) { final PageTitle title = makeTitleFrom(row); new SavedPage(title).deleteFromFileSystem(); dao.completeDiskTransaction(row); continue; } if (row.status() == OUTDATED) { queue.add(row); continue; } throw new UnsupportedOperationException("Invalid disk row status: " + row.status().name()); } saveNewEntries(queue); }
Source:
private Integer readLine(Text value) { Retryer<Integer> retryer = RetryerBuilder.<Integer>newBuilder() .retryIfExceptionOfType(IOException.class) .retryIfExceptionOfType(TimeoutException.class) .retryIfRuntimeException() .retryIfResult(Predicates.isNull()) .withWaitStrategy(WaitStrategies.exponentialWait(MAX_SLEEP_MS, TimeUnit.MILLISECONDS)) .withStopStrategy(StopStrategies.stopAfterAttempt(MAX_RETRY_NUMBER)) .build(); try { return retryer.call(() -> { if (isFirstLine) { recordsFromS3 = 0; selectObjectContent = selectClient.getRecordsContent(); reader = new LineReader(selectObjectContent, lineDelimiter.getBytes(StandardCharsets.UTF_8)); isFirstLine = false; } try { return reader.readLine(value); } catch (Exception e) { isFirstLine = true; recordsFromS3 = 0; log.warn("Failed to get the line during retry: %s/%s", selectClient.getBucketName(), selectClient.getKeyName()); throw e; } }); } catch (ExecutionException | RetryException e) { log.error(e, "Failed to get record for key: %s/%s", selectClient.getBucketName(), selectClient.getKeyName()); throw new RuntimeException(e); } }

Target:
private int readLine(Text value) throws IOException { try { return retry() .maxAttempts(maxAttempts) .exponentialBackoff(BACKOFF_MIN_SLEEP, maxBackoffTime, maxRetryTime, 2.0) .stopOn(InterruptedException.class, UnrecoverableS3OperationException.class) .run("readRecordsContentStream", () -> { if (isFirstLine) { recordsFromS3 = 0; selectObjectContent = selectClient.getRecordsContent(selectObjectContentRequest); closer.register(selectObjectContent); reader = new LineReader(selectObjectContent, lineDelimiter.getBytes(StandardCharsets.UTF_8)); closer.register(reader); isFirstLine = false; } try { return reader.readLine(value); } catch (RuntimeException e) { isFirstLine = true; recordsFromS3 = 0; if (e instanceof AmazonS3Exception) { switch (((AmazonS3Exception) e).getStatusCode()) { case SC_FORBIDDEN: case SC_NOT_FOUND: case SC_BAD_REQUEST: throw new UnrecoverableS3OperationException(selectClient.getBucketName(), selectClient.getKeyName(), e); } } throw e; } }); } catch (Exception e) { throwIfInstanceOf(e, IOException.class); throwIfUnchecked(e); throw new RuntimeException(e); } }
Source:
public void onMessage(Message message) { if (this.applicationEventPublisher != null) { this.applicationEventPublisher.publishEvent(new BrokerEvent(this, message.getMessageProperties())); } }

Target:
public void onMessage(Message message) { if (this.applicationEventPublisher != null) { this.applicationEventPublisher.publishEvent(new BrokerEvent(this, message.getMessageProperties())); } else { if (logger.isWarnEnabled()) { logger.warn("No event publisher available for " + message + "; if the BrokerEventListener " + "is not defined as a bean, you must provide an ApplicationEventPublisher"); } } }
Source:
public void apply(RevisionWriter index) throws IOException { for (final Class<?> type : rawDeletions.keySet()) { final Map<Class<?>, Set<String>> map = Collections.<Class<?>, Set<String>> singletonMap(type, Sets.newHashSet(rawDeletions.get(type))); index.writer().removeAll(map); } for (Entry<String, Object> doc : rawMappings.entrySet()) { index.writer().put(doc.getKey(), doc.getValue()); } final Multimap<Class<? extends Revision>, Long> copiedRevision = ImmutableMultimap.copyOf(revisionDeletions); for (Class<? extends Revision> type : copiedRevision.keySet()) { index.remove(type, copiedRevision.get(type)); } for (Entry<Long, Revision> doc : revisionMappings.entrySet()) { if (!revisionDeletions.containsValue(doc.getKey())) { index.put(doc.getKey(), doc.getValue()); } } }

Target:
public void apply(RevisionWriter index) throws IOException { for (final Class<?> type : rawDeletions.keySet()) { final Map<Class<?>, Set<String>> map = Collections.<Class<?>, Set<String>> singletonMap(type, Sets.newHashSet(rawDeletions.get(type))); index.writer().removeAll(map); } for (Entry<String, Object> doc : rawMappings.entrySet()) { if (!rawDeletions.containsValue(doc.getKey())) { index.writer().put(doc.getKey(), doc.getValue()); } } final Multimap<Class<? extends Revision>, Long> copiedRevision = ImmutableMultimap.copyOf(revisionDeletions); for (Class<? extends Revision> type : copiedRevision.keySet()) { index.remove(type, copiedRevision.get(type)); } for (Entry<Long, Revision> doc : revisionMappings.entrySet()) { if (!revisionDeletions.containsValue(doc.getKey())) { index.put(doc.getKey(), doc.getValue()); } } }
Source:
protected boolean shouldSkipCommandExecution() { return StringUtils.equals(getVm().getCurrentCd(), getParameters().getCdImagePath()); }

Target:
protected boolean shouldSkipCommandExecution() { if (getVm() == null) { return false; } return StringUtils.equals(getVm().getCurrentCd(), getParameters().getCdImagePath()); }
Source:
protected boolean isDiskExist(Disk disk) { if (disk == null || isDiskExistInVm(disk)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); return false; } return true; }

Target:
protected boolean isDiskExist(Disk disk) { if (disk == null || !isDiskExistInVm(disk)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); return false; } return true; }
Source:
public void setDescription(@Nullable String text) { if (invokeSource != SUGGESTED_EDITS_ADD_CAPTION && invokeSource != SUGGESTED_EDITS_TRANSLATE_CAPTION) { pageDescriptionText.setText(text); } }

Target:
public void setDescription(@Nullable String text) { pageDescriptionText.setText(text); }
Source:
protected void processRequestPayload(SignableRequest<?> request, byte[] signature, byte[] signingKey, AWS4SignerRequestParams signerRequestParams) { if (useChunkEncoding(request) && this.isChunkedEncoding) { AwsChunkedEncodingInputStream chunkEncodededStream = new AwsChunkedEncodingInputStream( request.getContent(), signingKey, signerRequestParams.getFormattedSigningDateTime(), signerRequestParams.getScope(), BinaryUtils.toHex(signature), this); request.setContent(chunkEncodededStream); } }

Target:
protected void processRequestPayload(SignableRequest<?> request, byte[] signature, byte[] signingKey, AWS4SignerRequestParams signerRequestParams) { if (useChunkEncoding(request)) { AwsChunkedEncodingInputStream chunkEncodededStream = new AwsChunkedEncodingInputStream( request.getContent(), signingKey, signerRequestParams.getFormattedSigningDateTime(), signerRequestParams.getScope(), BinaryUtils.toHex(signature), this); request.setContent(chunkEncodededStream); } }
Source:
public void postProcessRequest(RestRequest restRequest, Callback<Void> callback) { Exception exception = null; frontendMetrics.securityServicePostProcessRequestRate.mark(); long startTimeMs = System.currentTimeMillis(); if (!isOpen) { exception = new RestServiceException("SecurityService is closed", RestServiceErrorCode.ServiceUnavailable); } else if (restRequest == null || callback == null) { throw new IllegalArgumentException("RestRequest or Callback is null"); } else if (throttlingHandler.shouldThrottle(restRequest)) { exception = new RestServiceException("Too many requests", RestServiceErrorCode.TooManyRequests); } if (restRequest.getRestMethod() == RestMethod.DELETE || restRequest.getRestMethod() == RestMethod.PUT) { try { accountAndContainerNamePreconditionCheck(restRequest); } catch (Exception e) { exception = e; } } frontendMetrics.securityServicePostProcessRequestTimeInMs.update(System.currentTimeMillis() - startTimeMs); callback.onCompletion(null, exception); }

Target:
public void postProcessRequest(RestRequest restRequest, Callback<Void> callback) { Exception exception = null; frontendMetrics.securityServicePostProcessRequestRate.mark(); long startTimeMs = System.currentTimeMillis(); if (!isOpen) { exception = new RestServiceException("SecurityService is closed", RestServiceErrorCode.ServiceUnavailable); } else if (restRequest == null || callback == null) { throw new IllegalArgumentException("RestRequest or Callback is null"); } else if (quotaManager.shouldThrottle(restRequest)) { exception = new RestServiceException("Too many requests", RestServiceErrorCode.TooManyRequests); } else if (restRequest.getRestMethod() == RestMethod.DELETE || restRequest.getRestMethod() == RestMethod.PUT) { try { accountAndContainerNamePreconditionCheck(restRequest); } catch (Exception e) { exception = e; } } frontendMetrics.securityServicePostProcessRequestTimeInMs.update(System.currentTimeMillis() - startTimeMs); callback.onCompletion(null, exception); }
Source:
public void onSignOutButtonClicked() { mSignInClicked = false; Games.signOut(mGoogleApiClient); mGoogleApiClient.disconnect(); mMainMenuFragment.setGreeting(getString(R.string.signed_out_greeting)); mMainMenuFragment.setShowSignInButton(true); mWinFragment.setShowSignInButton(true); }

Target:
public void onSignOutButtonClicked() { mSignInClicked = false; Games.signOut(mGoogleApiClient); if (mGoogleApiClient.isConnected()) { mGoogleApiClient.disconnect(); } mMainMenuFragment.setGreeting(getString(R.string.signed_out_greeting)); mMainMenuFragment.setShowSignInButton(true); mWinFragment.setShowSignInButton(true); }
Source:
protected void ExecuteVdsBrokerCommand() { final Map<String, String> domains = new HashMap<String, String>(); final Version vdsVersion = new Version(getVds().getsoftware_version()); final Version hostIdMinVersion = new Version( Config.<String> GetValue(ConfigValues.ReconstructMasterHostIdVdsMinVersion)); for (storage_pool_iso_map domain : getParameters().getDomainsList()) { domains.put(domain.getstorage_id().toString(), domain.getstatus() != null ? domain.getstatus() == StorageDomainStatus.InActive ? "attached" : domain.getstatus().toString().toLowerCase() : StorageDomainStatus.Unknown.toString() .toLowerCase()); } if (vdsVersion.compareTo(hostIdMinVersion) < 0) { status = getBroker().reconstructMaster(getParameters().getStoragePoolId().toString(), getParameters().getStoragePoolName(), getParameters().getMasterDomainId().toString(), domains, getParameters().getMasterVersion(), Config.<String> GetValue(ConfigValues.LockPolicy), Config.<Integer> GetValue(ConfigValues.LockRenewalIntervalSec), Config.<Integer> GetValue(ConfigValues.LeaseTimeSec), Config.<Integer> GetValue(ConfigValues.IoOpTimeoutSec), Config.<Integer> GetValue(ConfigValues.LeaseRetries)); } else { status = getBroker().reconstructMaster(getParameters().getStoragePoolId().toString(), getParameters().getVdsSpmId(), getParameters().getStoragePoolName(), getParameters().getMasterDomainId().toString(), domains, getParameters().getMasterVersion(), Config.<String> GetValue(ConfigValues.LockPolicy), Config.<Integer> GetValue(ConfigValues.LockRenewalIntervalSec), Config.<Integer> GetValue(ConfigValues.LeaseTimeSec), Config.<Integer> GetValue(ConfigValues.IoOpTimeoutSec), Config.<Integer> GetValue(ConfigValues.LeaseRetries)); } ProceedProxyReturnValue(); }

Target:
protected void ExecuteVdsBrokerCommand() { final Map<String, String> domains = new HashMap<String, String>(); for (storage_pool_iso_map domain : getParameters().getDomainsList()) { domains.put(domain.getstorage_id().toString(), domain.getstatus() != null ? domain.getstatus() == StorageDomainStatus.InActive ? "attached" : domain.getstatus().toString().toLowerCase() : StorageDomainStatus.Unknown.toString() .toLowerCase()); } status = getBroker().reconstructMaster(getParameters().getStoragePoolId().toString(), getParameters().getStoragePoolName(), getParameters().getMasterDomainId().toString(), domains, getParameters().getMasterVersion(), Config.<String> GetValue(ConfigValues.LockPolicy), Config.<Integer> GetValue(ConfigValues.LockRenewalIntervalSec), Config.<Integer> GetValue(ConfigValues.LeaseTimeSec), Config.<Integer> GetValue(ConfigValues.IoOpTimeoutSec), Config.<Integer> GetValue(ConfigValues.LeaseRetries), getParameters().getVdsSpmId()); ProceedProxyReturnValue(); }
Source:
public boolean onMenuItemClick(MenuItem item) { if (controller == null) { return false; } Playable media = controller.getMedia(); if (media == null) { return false; } final @Nullable FeedItem feedItem = (media instanceof FeedMedia) ? ((FeedMedia) media).getItem() : null; if (feedItem != null && FeedItemMenuHandler.onMenuItemClicked(this, item.getItemId(), feedItem)) { return true; } switch (item.getItemId()) { case R.id.disable_sleeptimer_item: case R.id.set_sleeptimer_item: new SleepTimerDialog().show(getParentFragmentManager(), "SleepTimerDialog"); return true; case R.id.audio_controls: PlaybackControlsDialog dialog = PlaybackControlsDialog.newInstance(false); dialog.show(getParentFragmentManager(), "playback_controls"); return true; case R.id.open_feed_item: if (feedItem != null) { Intent intent = MainActivity.getIntentToOpenFeed(getContext(), feedItem.getFeedId()); startActivity(intent); } return true; } return false; }

Target:
public boolean onMenuItemClick(MenuItem item) { if (controller == null) { return false; } Playable media = controller.getMedia(); if (media == null) { return false; } final @Nullable FeedItem feedItem = (media instanceof FeedMedia) ? ((FeedMedia) media).getItem() : null; if (feedItem != null && FeedItemMenuHandler.onMenuItemClicked(this, item.getItemId(), feedItem)) { return true; } switch (item.getItemId()) { case R.id.disable_sleeptimer_item: case R.id.set_sleeptimer_item: new SleepTimerDialog().show(getChildFragmentManager(), "SleepTimerDialog"); return true; case R.id.audio_controls: PlaybackControlsDialog dialog = PlaybackControlsDialog.newInstance(false); dialog.show(getChildFragmentManager(), "playback_controls"); return true; case R.id.open_feed_item: if (feedItem != null) { Intent intent = MainActivity.getIntentToOpenFeed(getContext(), feedItem.getFeedId()); startActivity(intent); } return true; } return false; }
Source:
public void eachNonZeroInRow(int i, MatrixProcedure procedure) { eachInRow(i,procedure); }

Target:
public void eachNonZeroInRow(int i, MatrixProcedure procedure) { for (int j = rowPointers[i]; j < rowPointers[i + 1]; j++) { procedure.apply(i, columnIndices[j], values[j]); } }
Source:
public String getEmergencyNumber() { return emergencyNumber; }

Target:
String getEmergencyNumber() { return emergencyNumber; }
Source:
private short rangeMap(final float speed) { return (short) rangeMap(speed, -1f, 1f, MAX_FORWARD, MAX_REVERSE); }

Target:
private short rangeMap(final float speed) { return (short) Math.round(rangeMap(speed, -1f, 1f, MAX_FORWARD, MAX_REVERSE)); }
Source:
protected void executeVdsBrokerCommand() { GlusterVolumeSnapshotEntity snapshot = new GlusterVolumeSnapshotEntity(); String volumeName = getParameters().getVolumeName(); String snapshotName = getParameters().getSnapshotName(); String description = getParameters().getDescription() == null ? "" : getParameters().getDescription(); boolean force = getParameters().getForce() ? true : false; uuidReturn = getBroker().glusterSnapshotCreate(volumeName, snapshotName, description, force); proceedProxyReturnValue(); if (getVDSReturnValue().getSucceeded()) { snapshot.setId(Guid.createGuidFromStringDefaultEmpty(uuidReturn.mUuid)); setReturnValue(snapshot); } }

Target:
protected void executeVdsBrokerCommand() { String volumeName = getParameters().getVolumeName(); String snapshotName = getParameters().getSnapshotName(); String description = getParameters().getDescription() == null ? "" : getParameters().getDescription(); boolean force = getParameters().getForce() ? true : false; uuidReturn = getBroker().glusterSnapshotCreate(volumeName, snapshotName, description, force); proceedProxyReturnValue(); if (getVDSReturnValue().getSucceeded()) { setReturnValue(Guid.createGuidFromStringDefaultEmpty(uuidReturn.mUuid)); } }
Source:
final void tag(Object span, I input, @Nullable TraceContext context) { String value; try { value = parseValue(input, context); } catch (Throwable e) { propagateIfFatal(e); Platform.get().log("Error parsing tag value of input %s", input, e); return; } if (value == null) return; if (span instanceof SpanCustomizer) { ((SpanCustomizer) span).tag(key, value); } else if (span instanceof ScopedSpan) { ((ScopedSpan) span).tag(key, value); } else if (span instanceof MutableSpan) { ((MutableSpan) span).tag(key, value); } }

Target:
final void tag(Object span, I input, @Nullable TraceContext context) { String value; try { value = parseValue(input, context); } catch (Throwable e) { propagateIfFatal(e); Platform.get().log("Error parsing tag value of input %s", input, e); return; } if (value == null) return; if (span instanceof SpanCustomizer) { ((SpanCustomizer) span).tag(key, value); } else if (span instanceof MutableSpan) { ((MutableSpan) span).tag(key, value); } }
Source:
public List<SingleColumn> generateChecksumColumns(Column column) { checkArgument(column.getType() instanceof MapType, "Expect MapType, found %s", column.getType().getDisplayName()); Type keyType = ((MapType) column.getType()).getKeyType(); Type valueType = ((MapType) column.getType()).getValueType(); ImmutableList.Builder<Expression> checksums = ImmutableList.builder(); checksums.add(new FunctionCall(QualifiedName.of("checksum"), ImmutableList.of(column.getIdentifier()))); Expression mapCardinalitySum = new CoalesceExpression( new FunctionCall( QualifiedName.of("sum"), ImmutableList.of(new FunctionCall(QualifiedName.of("cardinality"), ImmutableList.of(column.getIdentifier())))), new LongLiteral("0")); if (keyType.isOrderable()) { FunctionCall mapKeys = new FunctionCall(QualifiedName.of("map_keys"), ImmutableList.of(column.getIdentifier())); FunctionCall sortKeys = new FunctionCall(QualifiedName.of("array_sort"), ImmutableList.of(mapKeys)); checksums.add(new FunctionCall(QualifiedName.of("checksum"), ImmutableList.of(sortKeys))); } if (valueType.isOrderable()) { FunctionCall mapValues = new FunctionCall(QualifiedName.of("map_values"), ImmutableList.of(column.getIdentifier())); FunctionCall sortValues = new FunctionCall(QualifiedName.of("array_sort"), ImmutableList.of(mapValues)); checksums.add(new FunctionCall(QualifiedName.of("checksum"), ImmutableList.of(sortValues))); } return ImmutableList.of( new SingleColumn(new CoalesceExpression(checksums.build()), Optional.of(delimitedIdentifier(getChecksumColumnAlias(column)))), new SingleColumn(mapCardinalitySum, Optional.of(delimitedIdentifier(getCardinalitySumColumnAlias(column))))); }

Target:
public List<SingleColumn> generateChecksumColumns(Column column) { checkArgument(column.getType() instanceof MapType, "Expect MapType, found %s", column.getType().getDisplayName()); Type keyType = ((MapType) column.getType()).getKeyType(); Type valueType = ((MapType) column.getType()).getValueType(); Expression checksum = functionCall("checksum", column.getExpression()); Expression keys = functionCall("map_keys", column.getExpression()); if (keyType.isOrderable()) { keys = functionCall("array_sort", keys); } Expression keysChecksum = functionCall("checksum", keys); Expression values = functionCall("map_values", column.getExpression()); if (valueType.isOrderable()) { values = functionCall("array_sort", values); } Expression valuesChecksum = functionCall("checksum", values); Expression mapCardinalitySum = new CoalesceExpression( functionCall("sum", functionCall("cardinality", column.getExpression())), new LongLiteral("0")); return ImmutableList.of( new SingleColumn(checksum, Optional.of(delimitedIdentifier(getChecksumColumnAlias(column)))), new SingleColumn(keysChecksum, Optional.of(delimitedIdentifier(getKeysChecksumColumnAlias(column)))), new SingleColumn(valuesChecksum, Optional.of(delimitedIdentifier(getValuesChecksumColumnAlias(column)))), new SingleColumn(mapCardinalitySum, Optional.of(delimitedIdentifier(getCardinalitySumColumnAlias(column))))); }
Source:
public ResponseEntity getRolesMapping() { if (!springSecurityLdapInternalsSupplier.isLdapAuthenticationEnabled()) { return toResponseEntityError(LdapConstants.LdapMessages.NOT_CONFIGURED, HttpStatus.BAD_REQUEST); } return ResponseEntity.ok(springSecurityLdapInternalsSupplier.getAuthoritiesMapper()); }

Target:
public ResponseEntity getRolesMapping() { if (!springSecurityLdapInternalsSupplier.isLdapAuthenticationEnabled()) { return toResponseEntityError(LdapMessages.NOT_CONFIGURED, HttpStatus.BAD_REQUEST); } return ResponseEntity.ok(springSecurityLdapInternalsSupplier.getAuthoritiesMapper()); }
Source:
public BlockLease getBlockView(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); if (positionCount < outputPositionCount) { compactValues(positions, positionCount); } return newLease(new DictionaryBlock(positionCount, dictionaryBlock, values)); }

Target:
public BlockLease getBlockView(int[] positions, int positionCount) { checkArgument(outputPositionCount > 0, "outputPositionCount must be greater than zero"); checkState(outputRequired, "This stream reader doesn't produce output"); checkState(positionCount <= outputPositionCount, "Not enough values"); checkState(!valuesInUse, "BlockLease hasn't been closed yet"); if (positionCount < outputPositionCount) { compactValues(positions, positionCount); } return newLease(new DictionaryBlock(positionCount, dictionaryBlock, values)); }
Source:
public AbstractCreatureSteeringControl(Creature creature) { this.creature = creature; maxLinearSpeed = creature.getSpeed(); maxLinearSpeed = maxLinearSpeed * 10; }

Target:
public AbstractCreatureSteeringControl(Creature creature) { this.creature = creature; maxLinearSpeed = creature.getSpeed(); maxLinearAcceleration = maxLinearSpeed * 10; }
Source:
public ComplexSearchQueryBuilder terms(Collection<Term> terms) { terms.forEach(term -> { String termText = term.text(); switch (term.field().toLowerCase()) { case "author" -> this.author(termText); case "title" -> this.titlePhrase(termText); case "journal" -> this.journal(termText); case "year" -> this.singleYear(Integer.valueOf(termText)); case "year-range" -> this.fromYearAndToYear(Integer.valueOf(termText.split("-")[0]), Integer.valueOf(termText.split("-")[1])); case "default" -> this.defaultFieldPhrase(termText); } }); return this; }

Target:
public ComplexSearchQueryBuilder terms(Collection<Term> terms) { terms.forEach(term -> { String termText = term.text(); switch (term.field().toLowerCase()) { case "author" -> this.author(termText); case "title" -> this.titlePhrase(termText); case "journal" -> this.journal(termText); case "year" -> this.singleYear(Integer.valueOf(termText)); case "year-range" -> this.parseYearRange(termText); case "default" -> this.defaultFieldPhrase(termText); } }); return this; }
Source:
public void testMergeProjects1() { Configuration cfg = new Configuration(); cfg.setTabSize(8); Project p1 = new Project(); p1.setNavigateWindowEnabled(true); p1.completeWithDefaults(cfg); assertNotNull(p1); assertTrue("Navigate window should be turned on", p1.isNavigateWindowEnabled()); assertEquals(8, p1.getTabSize()); }

Target:
public void testMergeProjects1() { Configuration cfg = new Configuration(); cfg.setTabSize(new Configuration().getTabSize() + 3731); Project p1 = new Project(); p1.setNavigateWindowEnabled(true); p1.completeWithDefaults(cfg); assertNotNull(p1); assertTrue("Navigate window should be turned on", p1.isNavigateWindowEnabled()); assertEquals(new Configuration().getTabSize() + 3731, p1.getTabSize()); }
Source:
public String getTuple(ResultSet rs) { StringBuilder resultTuple = new StringBuilder(); try { for (String obj : emitColumns) { resultTuple.append(rs.getObject(obj) + ","); } resultTuple.substring(0, resultTuple.length() - 1); } catch (SQLException e) { throw new RuntimeException(e); } return resultTuple.toString(); }

Target:
public String getTuple(ResultSet rs) { StringBuilder resultTuple = new StringBuilder(); try { for (String obj : emitColumns) { resultTuple.append(rs.getObject(obj) + ","); } return resultTuple.substring(0, resultTuple.length() - 1); } catch (SQLException e) { throw new RuntimeException(e); } }
Source:
public void initialise() { renderingDebugConfig = config.getRendering().getDebug(); renderingDebugConfig.subscribe(RenderingDebugConfig.ENABLED, this); enablePostMaterial = new EnableMaterial(POST_MATERIAL.toString()); enableDebugMaterial = new EnableMaterial(DEBUG_MATERIAL.toString()); if (!renderingDebugConfig.isEnabled()) { addDesiredStateChange(enablePostMaterial); } else { addDesiredStateChange(enableDebugMaterial); } addDesiredStateChange(new BindFBO(new ResourceUrn("engine:sceneFinal"), displayResolutionDependentFBOs)); addDesiredStateChange(new SetViewportToSizeOf(new ResourceUrn("engine:sceneFinal"), displayResolutionDependentFBOs)); }

Target:
public void initialise() { renderingDebugConfig = config.getRendering().getDebug(); renderingDebugConfig.subscribe(RenderingDebugConfig.ENABLED, this); enablePostMaterial = new EnableMaterial(POST_MATERIAL.toString()); enableDebugMaterial = new EnableMaterial(DEBUG_MATERIAL.toString()); if (!renderingDebugConfig.isEnabled()) { addDesiredStateChange(enablePostMaterial); } else { addDesiredStateChange(enableDebugMaterial); } addDesiredStateChange(new BindFBO(FINAL_BUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new SetViewportToSizeOf(FINAL_BUFFER, displayResolutionDependentFBOs)); }
Source:
public static ConnectionInfo fromUrl(@Nullable PluginContainer container, String fullUrl) throws SQLException { Matcher match = URL_REGEX.matcher(fullUrl); if (!match.matches()) { throw new IllegalArgumentException("URL " + fullUrl + " is not a valid JDBC URL"); } final String protocol = match.group(1); final boolean hasSlashes = match.group(2) != null; final String user = match.group(3); final String pass = match.group(4); String serverDatabaseSpecifier = match.group(5); BiFunction<PluginContainer, String, String> derelativizer = PATH_CANONICALIZERS.get(protocol); if (container != null && derelativizer != null) { serverDatabaseSpecifier = derelativizer.apply(container, serverDatabaseSpecifier); } final String unauthedUrl = "jdbc:" + protocol + (hasSlashes ? "://" : ":") + serverDatabaseSpecifier; final String driverClass = DriverManager.getDriver(unauthedUrl).getClass().getCanonicalName(); if (protocol.equals("mysql")) { return new ConnectionInfo(user, pass, driverClass, unauthedUrl + "?disableMariaDbDriver", fullUrl); } else { return new ConnectionInfo(user, pass, driverClass, unauthedUrl, fullUrl); } }

Target:
public static ConnectionInfo fromUrl(@Nullable PluginContainer container, String fullUrl) throws SQLException { Matcher match = URL_REGEX.matcher(fullUrl); if (!match.matches()) { throw new IllegalArgumentException("URL " + fullUrl + " is not a valid JDBC URL"); } final String protocol = match.group(1); final boolean hasSlashes = match.group(2) != null; final String user = match.group(3); final String pass = match.group(4); String serverDatabaseSpecifier = match.group(5); BiFunction<PluginContainer, String, String> derelativizer = PATH_CANONICALIZERS.get(protocol); if (container != null && derelativizer != null) { serverDatabaseSpecifier = derelativizer.apply(container, serverDatabaseSpecifier); } final boolean hasOptions = match.group(6) != null; final Set<String> rawOptions = hasOptions ? Sets.newHashSet(match.group(7).split("&")) : Collections.EMPTY_SET; final String options = !rawOptions.isEmpty() ? "?" + String.join("&", rawOptions) : ""; final String unauthedUrl = "jdbc:" + protocol + (hasSlashes ? "://" : ":") + serverDatabaseSpecifier; final String driverClass; if (protocol.equals("mysql")) { driverClass = MYSQL_DRIVER_CLASS_NAME; } else { driverClass = DriverManager.getDriver(unauthedUrl).getClass().getCanonicalName(); } return new ConnectionInfo(user, pass, options, driverClass, unauthedUrl, fullUrl); }
Source:
public void stop() { try { lock.lock(); for (FluxSender fluxSender : fluxSenders) { if (fluxSender.getClass().isAssignableFrom(FluxSenderImpl.class)) { ((FluxSenderImpl) fluxSender).dispose(); } } for (Disposable disposable : fluxDisposables) { disposable.dispose(); } if (running) { this.running = false; } } finally { lock.unlock(); } }

Target:
public void stop() { try { this.lock.lock(); if (this.running) { for (Closeable closeable : closeableFluxResources) { try { closeable.close(); } catch (IOException e) { log.error("Error closing reactive source", e); } } this.running = false; } } finally { this.lock.unlock(); } }