auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testEncodeLocalProxyV2() { HAProxyMessageEncoder encoder = new HAProxyMessageEncoder(); EmbeddedChannel ch = new EmbeddedChannel(encoder); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V2, HAProxyCommand.LOCAL, HAProxyProxiedProtocol.UNKNOWN, null, null, 0, 0); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); byte[] headerBytes = new byte[12]; byteBuf.readBytes(headerBytes); assertArrayEquals(BINARY_PREFIX, headerBytes); byte commandByte = byteBuf.readByte(); assertEquals(0x02, (commandByte & 0xf0) >> 4); assertEquals(0x00, commandByte & 0x0f); byte transportByte = byteBuf.readByte(); assertEquals(0x00, transportByte); int sourceAddrLength = byteBuf.readUnsignedShort(); assertEquals(0, sourceAddrLength); assertFalse(byteBuf.isReadable()); }

Target:
public void testEncodeLocalProxyV2() { EmbeddedChannel ch = new EmbeddedChannel(INSTANCE); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V2, HAProxyCommand.LOCAL, HAProxyProxiedProtocol.UNKNOWN, null, null, 0, 0); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); byte[] headerBytes = new byte[12]; byteBuf.readBytes(headerBytes); assertArrayEquals(BINARY_PREFIX, headerBytes); byte commandByte = byteBuf.readByte(); assertEquals(0x02, (commandByte & 0xf0) >> 4); assertEquals(0x00, commandByte & 0x0f); byte transportByte = byteBuf.readByte(); assertEquals(0x00, transportByte); int sourceAddrLength = byteBuf.readUnsignedShort(); assertEquals(0, sourceAddrLength); assertFalse(byteBuf.isReadable()); byteBuf.release(); assertFalse(ch.finish()); }
Source:
private void connectToClusterInternal() { CandidateClusterContext currentClusterContext = discoveryService.current(); logger.info("Trying to connect to cluster with client name: " + currentClusterContext.getClusterName()); if (connectToCandidate(currentClusterContext)) { return; } discoveryService.resetSearch(); while (discoveryService.hasNext() && client.getLifecycleService().isRunning()) { CandidateClusterContext candidateClusterContext = discoveryService.next(); beforeClusterSwitch(candidateClusterContext); logger.info("Trying to connect to next cluster with client name: " + candidateClusterContext.getClusterName()); if (connectToCandidate(candidateClusterContext)) { client.getQueryCacheContext().recreateAllCaches(); fireLifecycleEvent(LifecycleEvent.LifecycleState.CLIENT_CHANGED_CLUSTER); return; } } if (!client.getLifecycleService().isRunning()) { throw new IllegalStateException("Client is being shutdown."); } else { throw new IllegalStateException("Unable to connect to any cluster."); } }

Target:
private void connectToClusterInternal() { CandidateClusterContext currentClusterContext = discoveryService.current(); logger.info("Trying to connect to cluster with cluster name: " + currentClusterContext.getClusterName()); if (connectToCandidate(currentClusterContext)) { return; } discoveryService.resetSearch(); while (discoveryService.hasNext() && client.getLifecycleService().isRunning()) { CandidateClusterContext candidateClusterContext = discoveryService.next(); beforeClusterSwitch(candidateClusterContext); logger.info("Trying to connect to next cluster with cluster name: " + candidateClusterContext.getClusterName()); if (connectToCandidate(candidateClusterContext)) { client.getQueryCacheContext().recreateAllCaches(); fireLifecycleEvent(LifecycleEvent.LifecycleState.CLIENT_CHANGED_CLUSTER); return; } } if (!client.getLifecycleService().isRunning()) { throw new IllegalStateException("Client is being shutdown."); } else { throw new IllegalStateException("Unable to connect to any cluster."); } }
Source:
QName normaliseBuiltInTypeTypeRef(final QName typeRef) { String namespace = typeRef.getNamespaceURI(); String localPart = typeRef.getLocalPart(); String prefix = typeRef.getPrefix(); final Definitions definitions = dmnGraphUtils.getDefinitions(); final Optional<String> nsPrefix = definitions.getPrefixForNamespaceURI(namespace); if (nsPrefix.isPresent()) { prefix = nsPrefix.get(); namespace = ""; } return new QName(namespace, localPart, prefix); }

Target:
QName normaliseBuiltInTypeTypeRef(final QName typeRef) { String namespace = typeRef.getNamespaceURI(); String localPart = typeRef.getLocalPart(); String prefix = typeRef.getPrefix(); final Definitions definitions = dmnGraphUtils.getDefinitions(); final Optional<String> nsPrefix = definitions == null ? Optional.empty() : definitions.getPrefixForNamespaceURI(namespace); if (nsPrefix.isPresent()) { prefix = nsPrefix.get(); namespace = ""; } return new QName(namespace, localPart, prefix); }
Source:
public TrackedVisit createTrackedVisit(TrackedVisit trackedVisit, Long userId) { final String remoteIp = trackedVisit.getIp(); try { ipTranslationService.getLocationForIp(remoteIp).ifPresent(location -> { trackedVisit.setCountry(location.getCountry()); trackedVisit.setCity(location.getCity()); }); } catch (IpFormatException e) { if (!isLocalhost(remoteIp)) { log.warn("Failed to resolve location for IP {}", remoteIp); } } TrackedVisitor2User trackedVisitor = null; if (StringUtils.isNotBlank(trackedVisit.getUuid_())) { trackedVisitor = trackedVisitor2UserDao.getByUUID(trackedVisit.getUuid_()) .orElse(null); } if (trackedVisitor == null) { trackedVisitor = trackedVisitor2UserService.getOrCreate(userId); trackedVisit.setUuid_(trackedVisitor.getUuid_()); } else { if (trackedVisitor.getUserId() == null && userId != null) { trackedVisitor.setUserId(userId); trackedVisitor2UserDao.update(trackedVisitor); } } return trackedVisitDao.create(trackedVisit); }

Target:
public TrackedVisit createTrackedVisit(TrackedVisit trackedVisit, Long userId) { final String remoteIp = trackedVisit.getIp(); try { ipTranslationService.getLocationForIp(remoteIp).ifPresent(location -> { trackedVisit.setCountry(location.getCountry()); trackedVisit.setCity(location.getCity()); }); } catch (IpFormatException e) { if (!isLocalhost(remoteIp)) { log.warn("Failed to resolve location for IP {}", remoteIp); } } TrackedVisitor2User trackedVisitor = null; if (StringUtils.isNotBlank(trackedVisit.getUuid_())) { trackedVisitor = trackedVisitor2UserDao.getByUUID(trackedVisit.getUuid_()) .orElse(null); } if (trackedVisitor == null) { trackedVisitor = trackedVisitor2UserService.getOrCreate(userId); trackedVisit.setUuid_(trackedVisitor.getUuid_()); } else if (trackedVisitor.getUserId() == null && userId != null) { trackedVisitor.setUserId(userId); trackedVisitor2UserDao.update(trackedVisitor); } return trackedVisitDao.create(trackedVisit); }
Source:
private void usageForNamespaceName(NamespaceNameTree namespaceName, Symbol.Kind kind) { if (namespaceName.name().is(Kind.NAME_IDENTIFIER)) { NameIdentifierTree usageIdentifier = (NameIdentifierTree) namespaceName.name(); QualifiedName qualifiedName = getFullyQualifiedName(namespaceName); Symbol symbol = symbolTable.getSymbol(qualifiedName); if (symbol == null && namespaceName.namespaces().isEmpty()) { symbol = currentScope.getSymbol(usageIdentifier.text(), kind); } if (symbol == null) { symbol = symbolTable.createUnresolvedSymbol(getFullyQualifiedName(namespaceName), Symbol.Kind.FUNCTION); } if (symbol != null) { associateSymbol(usageIdentifier, symbol); } } }

Target:
private void usageForNamespaceName(NamespaceNameTree namespaceName, Symbol.Kind kind) { if (namespaceName.name().is(Kind.NAME_IDENTIFIER)) { NameIdentifierTree usageIdentifier = (NameIdentifierTree) namespaceName.name(); QualifiedName qualifiedName = getFullyQualifiedName(namespaceName); Symbol symbol = symbolTable.getSymbol(qualifiedName); if (symbol == null && namespaceName.namespaces().isEmpty()) { symbol = currentScope.getSymbol(usageIdentifier.text(), kind); } if (symbol == null) { symbol = symbolTable.createUndeclaredSymbol(getFullyQualifiedName(namespaceName), Symbol.Kind.FUNCTION); } if (symbol != null) { associateSymbol(usageIdentifier, symbol); } } }
Source:
public void test19CloseImportedProjectsZipFile() throws Exception { WizardProjectsImportPage wpip = createImportWizardWithZipLocation( "ImportExistingProjectsWizardTestRebuildProject"); wpip.setCloseProjectsAfterImport(true); wpip.createProjects(); IProject testProject = ResourcesPlugin.getWorkspace().getRoot() .getProject("ImportExistingProjectsWizardTestRebuildProject"); assertFalse("Expected imported project to be closd due to setting dialog option checkbox", testProject.isAccessible()); }

Target:
public void test19CloseImportedProjectsZipFile() throws Exception { WizardProjectsImportPage wpip = createImportWizardWithZipLocation( "ImportExistingProjectsWizardTestRebuildProject"); try (AutoCloseable restore = setPageSetting(wpip, "WizardProjectsImportPage.STORE_CLOSE_CREATED_PROJECTS_ID", true)) { wpip.createProjects(); IProject testProject = ResourcesPlugin.getWorkspace().getRoot() .getProject("ImportExistingProjectsWizardTestRebuildProject"); assertFalse("Expected imported project to be closd due to setting dialog option checkbox", testProject.isAccessible()); } }
Source:
public static AggregatedPayload createPayload(String json) throws JsonSyntaxException { AggregatedPayload payload = new Gson().fromJson(json, AggregatedPayload.class); return payload; }

Target:
public static AggregatedPayload createPayload(String json) { AggregatedPayload payload = new Gson().fromJson(json, AggregatedPayload.class); return payload; }
Source:
private synchronized void onNotification(Notification notification) { if ("com.sun.management.gc.notification".equals(notification.getType())) { GarbageCollectionNotificationInfo info = new GarbageCollectionNotificationInfo((CompositeData) notification.getUserData()); if (info.isMajorGc()) { majorGcCount.incrementAndGet(); majorGcTime.addAndGet(info.getDurationMs()); majorGc.add(info.getDurationMs(), MILLISECONDS); long applicationRuntime = max(0, info.getStartTime() - lastGcEndTime); lastGcEndTime = info.getEndTime(); log.info( "Major GC: application %sms, stopped %sms:: %s -> %s", applicationRuntime, info.getDurationMs(), info.getBeforeGcTotalMb(), info.getAfterGcTotalMb()); } else if (info.isMinorGc()) { minorGc.add(info.getDurationMs(), MILLISECONDS); log.debug( "Minor GC: duration %sms:: %s -> %s", info.getDurationMs(), info.getBeforeGcTotalMb(), info.getAfterGcTotalMb()); } } }

Target:
private synchronized void onNotification(Notification notification) { if ("com.sun.management.gc.notification".equals(notification.getType())) { GarbageCollectionNotificationInfo info = new GarbageCollectionNotificationInfo((CompositeData) notification.getUserData()); if (info.isMajorGc()) { majorGcCount.incrementAndGet(); majorGcTime.addAndGet(info.getDurationMs()); majorGc.add(info.getDurationMs(), MILLISECONDS); long applicationRuntime = max(0, info.getStartTime() - lastGcEndTime); lastGcEndTime = info.getEndTime(); log.info( "Major GC: application %sms, stopped %sms:: %s -> %s", applicationRuntime, info.getDurationMs(), info.getBeforeGcTotal(), info.getAfterGcTotal()); } else if (info.isMinorGc()) { minorGc.add(info.getDurationMs(), MILLISECONDS); log.debug( "Minor GC: duration %sms:: %s -> %s", info.getDurationMs(), info.getBeforeGcTotal(), info.getAfterGcTotal()); } } }
Source:
public AuditLogType getAuditLogTypeValue() { if (getSucceeded()) { return AuditLogType.USER_VDS_STOP; } else { return skippedDueToFencingPolicy ? AuditLogType.VDS_NOT_STOPPED_DUE_TO_POLICY : AuditLogType.USER_FAILED_VDS_STOP; } }

Target:
public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? AuditLogType.USER_VDS_STOP : AuditLogType.USER_FAILED_VDS_STOP; }
Source:
private void removeConnection(String connectionId) { connectionIdToPoolManager.get(connectionId).removeConnection(connectionId); connectionIdToPoolManager.remove(connectionId); }

Target:
public void removeConnection(String connectionId) { if (!isOpen) { throw new IllegalStateException("Connection Manager is closed"); } HostPortPoolManager hostPortPoolManager = connectionIdToPoolManager.remove(connectionId); if (hostPortPoolManager == null) { throw new IllegalArgumentException("Attempt to remove an invalid connection id"); } totalManagedConnectionsCount--; hostPortPoolManager.removeConnection(connectionId); }
Source:
public static boolean isJobUsingRuntimeLineage(IProcess process) { RuntimeLineageManager runtimeLineageManager = new RuntimeLineageManager(); if (runtimeLineageManager.getDynamicFields().isEmpty()) { runtimeLineageManager.load(); } return runtimeLineageManager.isUseRuntimeLineageAll() || runtimeLineageManager.isRuntimeLineageSetting(process.getId(), process.getVersion()); }

Target:
public static boolean isJobUsingRuntimeLineage(IProcess process) { boolean isSupport = isStandardJob(process) && !ProcessUtils.isTestContainer(process) && !isGuessSchemaJob(process); if (!isSupport) { return false; } RuntimeLineageManager runtimeLineageManager = new RuntimeLineageManager(); if (runtimeLineageManager.isUseRuntimeLineageAll()) { return true; } if (runtimeLineageManager.getSelectedJobIds().isEmpty()) { runtimeLineageManager.load(); } return runtimeLineageManager.isRuntimeLineageSetting(process.getId()); }
Source:
protected void performDefaults() { fgChangeSet.clear(); fSwitchLaunch.loadDefault(); fSwitchSuspend.loadDefault(); PerspectiveManager pm = DebugUIPlugin.getDefault().getPerspectiveManager(); ILaunchConfigurationType type = null; Set<Set<String>> modes = null; for (TreeItem item : fTree.getItems()) { type = (ILaunchConfigurationType) item.getData(); modes = type.getSupportedModeCombinations(); for (Set<String> modeset : modes) { fgChangeSet.add(new PerspectiveChange(type, null, modeset, pm.getDefaultLaunchPerspective(type, null, modeset))); } for (Object delegate2 : fTreeViewer.getFilteredChildren(type)) { ILaunchDelegate delegate = (ILaunchDelegate) delegate2; modes = new HashSet<>(delegate.getModes()); for (Set<String> modeset : modes) { fgChangeSet.add(new PerspectiveChange(type, delegate, modeset, pm.getDefaultLaunchPerspective(type, delegate, modeset))); } } } if(fTree.getItemCount() > 0) { TreeItem item = fTree.getItem(0); fTreeViewer.setSelection(new StructuredSelection(item.getData())); fTreeViewer.expandToLevel(item.getData(), 1); } super.performDefaults(); }

Target:
protected void performDefaults() { fgChangeSet.clear(); fSwitchLaunch.loadDefault(); fSwitchSuspend.loadDefault(); PerspectiveManager pm = DebugUIPlugin.getDefault().getPerspectiveManager(); for (TreeItem item : fTree.getItems()) { ILaunchConfigurationType type = (ILaunchConfigurationType) item.getData(); for (Set<String> modeset : type.getSupportedModeCombinations()) { fgChangeSet.add(new PerspectiveChange(type, null, modeset, pm.getDefaultLaunchPerspective(type, null, modeset))); } for (Object child : fTreeViewer.getFilteredChildren(type)) { ILaunchDelegate delegate = (ILaunchDelegate) child; for (Set<String> modeset : new HashSet<>(delegate.getModes())) { fgChangeSet.add(new PerspectiveChange(type, delegate, modeset, pm.getDefaultLaunchPerspective(type, delegate, modeset))); } } } if(fTree.getItemCount() > 0) { TreeItem item = fTree.getItem(0); fTreeViewer.setSelection(new StructuredSelection(item.getData())); fTreeViewer.expandToLevel(item.getData(), 1); } super.performDefaults(); }
Source:
private static int insertQuotesIfAbsent(@NotNull InsertionContext context, int startOffset, int tailOffset) { int insertedQuotesCount = 0; Editor editor = context.getEditor(); Document document = editor.getDocument(); context.commitDocument(); CharSequence fileText = document.getCharsSequence(); if (!alreadyHasQuote(fileText, startOffset - 1)) { document.insertString(startOffset, QUOTA); context.commitDocument(); insertedQuotesCount++; tailOffset++; } if (!alreadyHasQuote(fileText, tailOffset)) { document.insertString(tailOffset, QUOTA); insertedQuotesCount++; } return insertedQuotesCount; }

Target:
private static int insertQuotesIfAbsent(@NotNull InsertionContext context, int startOffset, int tailOffset) { int insertedQuotesCount = 0; Document document = context.getEditor().getDocument(); CharSequence fileText = document.getCharsSequence(); if (!alreadyHasQuote(fileText, startOffset - 1)) { context.commitDocument(); document.insertString(startOffset, QUOTA); insertedQuotesCount++; tailOffset++; } if (!alreadyHasQuote(fileText, tailOffset)) { context.commitDocument(); document.insertString(tailOffset, QUOTA); insertedQuotesCount++; } return insertedQuotesCount; }
Source:
public Single<List<U>> getCached() { return Observable.fromIterable(() -> cache.keySet().iterator()) .map(cache::get) .toList(); }

Target:
public Single<List<U>> getCached() { return Observable.fromIterable(cache.keySet()) .map(cache::get) .toList(); }
Source:
@Override public Call<List<String>> getServiceNames() { String queryStr = String.format("SHOW TAG VALUES FROM \"%s\" WITH KEY = \"service_name\"", this.storage.measurement()); Query query = new Query(queryStr, this.storage.measurement()); QueryResult result = this.storage.get().query(query); throw new UnsupportedOperationException(); }

Target:
@Override public Call<List<String>> getServiceNames() { String q = String.format("SHOW TAG VALUES FROM \"%s\".\"%s\" WITH KEY IN (\"local_service_name\",\"remote_service_name\")", this.storage.retentionPolicy(), this.storage.measurement()); Query query = new Query(q, this.storage.database()); QueryResult response = this.storage.get().query(query); if (response.hasError()){ throw new RuntimeException(response.getError()); } List<String> services = new ArrayList<>(); List<QueryResult.Result> results = response.getResults(); if (results != null) { for (QueryResult.Result result : results) { if (result != null && result.getSeries() != null) { for (QueryResult.Series series : result.getSeries()) { for (List<Object> values : series.getValues()) { services.add(values.get(1).toString()); } } } } } return Call.create(services); }
Source:
public boolean isPullSuccessIndicated() { if (isErrorIndicated() || getStatus() == null) { return false; } return (getStatus().contains("Download complete") || getStatus().contains("Image is up to date") || getStatus().contains("Downloaded newer image") || getStatus().contains("this image was pulled from a legacy registry")); }

Target:
public boolean isPullSuccessIndicated() { if (isErrorIndicated() || getStatus() == null) { return false; } return (getStatus().contains(DOWNLOAD_COMPLETE) || getStatus().contains(IMAGE_UP_TO_DATE) || getStatus().contains(DOWNLOADED_NEWER_IMAGE) || getStatus().contains(LEGACY_REGISTRY)); }
Source:
public void testBasicOperation() throws Exception { URI fullPathKey = rest.fullPathKey(KEY_A); String initialXML = "<hey>ho</hey>"; HttpResponse insert = rest.put(fullPathKey, initialXML, "application/octet-stream"); assertEquals(0, insert.getEntity().getContentLength()); HttpResponse get = rest.get(fullPathKey, initialXML); assertEquals("application/octet-stream;charset=UTF-8", get.getHeaders("Content-Type")[0].getValue()); rest.delete(fullPathKey); rest.get(fullPathKey, HttpStatus.SC_NOT_FOUND); rest.put(fullPathKey, initialXML, "application/octet-stream"); rest.get(fullPathKey, initialXML); rest.delete(rest.fullPathKey(null)); rest.get(fullPathKey, HttpStatus.SC_NOT_FOUND); ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oo = new ObjectOutputStream(bout); oo.writeObject(new TestSerializable("CONTENT")); oo.flush(); byte[] byteData = bout.toByteArray(); rest.put(fullPathKey, byteData, "application/octet-stream"); HttpResponse resp = rest.getWithoutClose(fullPathKey); ObjectInputStream oin = new ObjectInputStream(resp.getEntity().getContent()); TestSerializable ts = (TestSerializable) oin.readObject(); EntityUtils.consume(resp.getEntity()); assertEquals("CONTENT", ts.getContent()); }

Target:
public void testBasicOperation() throws Exception { URI fullPathKey = rest.fullPathKey(KEY_A); String initialXML = "<hey>ho</hey>"; HttpResponse insert = rest.put(fullPathKey, initialXML, "application/octet-stream"); assertEquals(0, insert.getEntity().getContentLength()); HttpResponse get = rest.get(fullPathKey, initialXML); assertEquals("application/octet-stream", get.getHeaders("Content-Type")[0].getValue()); rest.delete(fullPathKey); rest.get(fullPathKey, HttpStatus.SC_NOT_FOUND); rest.put(fullPathKey, initialXML, "application/octet-stream"); rest.get(fullPathKey, initialXML); rest.delete(rest.fullPathKey(null)); rest.get(fullPathKey, HttpStatus.SC_NOT_FOUND); ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oo = new ObjectOutputStream(bout); oo.writeObject(new TestSerializable("CONTENT")); oo.flush(); byte[] byteData = bout.toByteArray(); rest.put(fullPathKey, byteData, "application/octet-stream"); HttpResponse resp = rest.getWithoutClose(fullPathKey); ObjectInputStream oin = new ObjectInputStream(resp.getEntity().getContent()); TestSerializable ts = (TestSerializable) oin.readObject(); EntityUtils.consume(resp.getEntity()); assertEquals("CONTENT", ts.getContent()); }
Source:
private GenericUrl( String scheme, String host, int port, String path, String fragment, String query, String userInfo, boolean verbatim) { this.scheme = scheme.toLowerCase(Locale.US); this.host = host; this.port = port; this.pathParts = toPathParts(path, verbatim); this.verbatim = verbatim; if (verbatim) { this.fragment = fragment != null ? fragment : null; if (query != null) { UrlEncodedParser.parse(query, this, false); } this.userInfo = userInfo != null ? userInfo : null; } else { this.fragment = fragment != null ? CharEscapers.decodeUri(fragment) : null; if (query != null) { UrlEncodedParser.parse(query, this); } this.userInfo = userInfo != null ? CharEscapers.decodeUri(userInfo) : null; } }

Target:
private GenericUrl( String scheme, String host, int port, String path, String fragment, String query, String userInfo, boolean verbatim) { this.scheme = scheme.toLowerCase(Locale.US); this.host = host; this.port = port; this.pathParts = toPathParts(path, verbatim); this.verbatim = verbatim; if (verbatim) { this.fragment = fragment; if (query != null) { UrlEncodedParser.parse(query, this, false); } this.userInfo = userInfo; } else { this.fragment = fragment != null ? CharEscapers.decodeUri(fragment) : null; if (query != null) { UrlEncodedParser.parse(query, this); } this.userInfo = userInfo != null ? CharEscapers.decodeUri(userInfo) : null; } }
Source:
private int calculateIndex(int seq) { if (s_l == -1) { s_l = seq; return seq; } int v = ROC; if (s_l < 0x7fff) if (seq - s_l > 0x7fff) v = (int) ((ROC - 1) & 0xffff_ffffL); else if (s_l - 0xffff > seq) v = (int) ((ROC + 1) & 0xffff_ffffL ); if (v == ROC && seq > s_l) s_l = seq; else if (v == ((ROC + 1) & 0xffff_ffffL)) { s_l = seq; ROC = v; } return seq + v * 0xffff; }

Target:
private int calculateIndex(int seq) { if (s_l == -1) { s_l = seq; return seq; } int v = ROC; if (s_l < 0x8000) if (seq - s_l > 0x8000) v = (int) ((ROC - 1) & 0xffff_ffffL); else if (s_l - 0x1_0000 > seq) v = (int) ((ROC + 1) & 0xffff_ffffL ); if (v == ROC && seq > s_l) s_l = seq; else if (v == ((ROC + 1) & 0xffff_ffffL)) { s_l = seq; ROC = v; } return seq + v * 0x1_0000; }
Source:
public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException { if (bytes == null) { return 0; } try { if (isDebugEnabled()) { debugCode("setBytes(" + pos + ", " + quoteBytes(bytes) + ", " + offset + ", " + len + ");"); } checkEditable(); if (pos != 1) { throw DbException.getInvalidValueException("pos", pos); } completeWrite(conn.createBlob(new ByteArrayInputStream(bytes, offset, len), -1)); return (int) value.getPrecision(); } catch (Exception e) { throw logAndConvert(e); } }

Target:
public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException { if (bytes == null) { throw new NullPointerException(); } try { if (isDebugEnabled()) { debugCode("setBytes(" + pos + ", " + quoteBytes(bytes) + ", " + offset + ", " + len + ");"); } checkEditable(); if (pos != 1) { throw DbException.getInvalidValueException("pos", pos); } completeWrite(conn.createBlob(new ByteArrayInputStream(bytes, offset, len), -1)); return (int) value.getPrecision(); } catch (Exception e) { throw logAndConvert(e); } }
Source:
public void fire(Project.NameKey project, String ref, ObjectId oldObjectId, ObjectId newObjectId) { Event event = new Event(project, ref, oldObjectId.name(), newObjectId.name()); for (GitReferenceUpdatedListener l : listeners) { l.onGitReferenceUpdated(event); } }

Target:
public void fire(Project.NameKey project, String ref, ObjectId oldObjectId, ObjectId newObjectId) { ObjectId old = oldObjectId != null ? oldObjectId : ObjectId.zeroId(); Event event = new Event(project, ref, old.name(), newObjectId.name()); for (GitReferenceUpdatedListener l : listeners) { l.onGitReferenceUpdated(event); } }
Source:
public void bindTo(MeterRegistry registry) { messages = Counter.builder("runtime_log_messages") .baseUnit("message") .description("number of sent messages to runtime log") .register(registry); bytes = Counter.builder("runtime_log_bytes") .baseUnit("byte") .description("number of sent bytes to runtime log") .register(registry); eventService.subscribe( (e) -> { messages.increment(); bytes.increment(e.getText().getBytes().length); }, RuntimeLogEvent.class); }

Target:
public void bindTo(MeterRegistry registry) { messages = Counter.builder("runtime_log_messages") .baseUnit("message") .description("number of sent messages to runtime log") .register(registry); bytes = Counter.builder("runtime_log_bytes") .baseUnit("byte") .description("number of sent bytes to runtime log") .register(registry); eventService.subscribe( (e) -> { messages.increment(); bytes.increment(e.getText().getBytes(StandardCharsets.UTF_8).length); }, RuntimeLogEvent.class); }
Source:
public void update(ImageStorageDomainMap entity) { getCallsHandler().executeModification("Updateimage_storage_domain_map", getCustomMapSqlParameterSource().addValue("image_id", entity.getImageId()).addValue("storage_domain_id", entity.getStorageDomainId()) .addValue("quota_id", entity.getQuotaId()) .addValue("disk_profile_id", entity.getDiskProfileId())); }

Target:
public void update(ImageStorageDomainMap entity) { throw new UnsupportedOperationException(); }
Source:
public CompletionStage<Boolean> reload() { if (!primaryConfigLoader.supportsReloading() && !fallbackConfigLoader.supportsReloading()) { return CompletableFutures.failedFuture( new UnsupportedOperationException( "Reloading is not supported (this is a composite config, " + "and neither the primary nor the fallback are reloadable)")); } else if (!primaryConfigLoader.supportsReloading()) { return fallbackConfigLoader.reload(); } else if (!fallbackConfigLoader.supportsReloading()) { return primaryConfigLoader.reload(); } else { return fallbackConfigLoader .reload() .thenCompose( fallbackChanged -> primaryConfigLoader .reload() .thenApply(primaryChanged -> primaryChanged || fallbackChanged)); } }

Target:
public CompletionStage<Boolean> reload() { if (!primaryConfigLoader.supportsReloading() && !fallbackConfigLoader.supportsReloading()) { return CompletableFutures.failedFuture( new UnsupportedOperationException( "Reloading is not supported (this is a composite config, " + "and neither the primary nor the fallback are reloadable)")); } else if (!primaryConfigLoader.supportsReloading()) { return fallbackConfigLoader.reload(); } else if (!fallbackConfigLoader.supportsReloading()) { return primaryConfigLoader.reload(); } else { CompletionStage<Boolean> primaryFuture = primaryConfigLoader.reload(); CompletionStage<Boolean> fallbackFuture = fallbackConfigLoader.reload(); CompletableFuture<Boolean> compositeFuture = new CompletableFuture<>(); primaryFuture.whenComplete( (primaryChanged, primaryError) -> fallbackFuture.whenComplete( (fallbackChanged, fallbackError) -> { if (primaryError == null && fallbackError == null) { compositeFuture.complete(primaryChanged || fallbackChanged); } else if (fallbackError == null) { compositeFuture.completeExceptionally(primaryError); } else if (primaryError == null) { compositeFuture.completeExceptionally(fallbackError); } else { primaryError.addSuppressed(fallbackError); compositeFuture.completeExceptionally(primaryError); } })); return compositeFuture; } }
Source:
public String toString() { return Objects.toStringHelper(this) .add("LevelName", this.worldInfo.getWorldName()) .add("DimensionId:", this.provider.getDimensionId()) .add("DimensionType", this.worldInfo.getTerrainType().getWorldTypeName()) .toString(); }

Target:
public String toString() { return Objects.toStringHelper(this) .add("LevelName", this.worldInfo.getWorldName()) .add("DimensionId", this.provider.getDimensionType()) .add("DimensionType", this.worldInfo.getTerrainType().getWorldTypeName()) .toString(); }
Source:
protected void initialize() { super.initialize(); List<Server> servers = api.serverApi().getAllServers(); assertNotNull(servers, "At least one server is required to run drives test."); Server server = Iterables.getFirst(servers, null); assertNotNull(server); this.serverId = server.id(); List<Image> images = api.imageApi().getAllImages(); assertNotNull(images, "At least one image is required to run drives test."); Image image = Iterables.getFirst(images, null); assertNotNull(image); this.imageId = image.id(); }

Target:
protected void initialize() { super.initialize(); List<Server> servers = api.serverApi().getAllServers(); assertFalse(servers.isEmpty(), "At least one server is required to run drives test."); Server server = Iterables.getFirst(servers, null); assertNotNull(server); this.serverId = server.id(); List<Image> images = api.imageApi().getAllImages(); assertFalse(images.isEmpty(), "At least one image is required to run drives test."); Image image = Iterables.getFirst(images, null); assertNotNull(image); this.imageId = image.id(); }
Source:
public static Value from(ChangedLines changedLines, Config cfg) { int n = changedLines.deletions + changedLines.insertions; int largeChangeTreshold = cfg.getInt("change", "largeChange", 500); if (n < largeChangeTreshold / 4) { return XS; } else if (n < largeChangeTreshold / 2) { return S; } else if (n < largeChangeTreshold) { return M; } else if (n < largeChangeTreshold * 2) { return L; } else { return XL; } }

Target:
public static Value from(ChangedLines changedLines, Config cfg) { int n = changedLines.deletions + changedLines.insertions; int largeChangeThreshold = cfg.getInt("change", "largeChange", 500); if (n < largeChangeThreshold / 4) { return XS; } else if (n < largeChangeThreshold / 2) { return S; } else if (n < largeChangeThreshold) { return M; } else if (n < largeChangeThreshold * 2) { return L; } else { return XL; } }
Source:
public void setUp() { cqlClient = mock(CqlClient.class); }

Target:
public void setUp() { cqlFuturesCombiner = new DefaultCqlFuturesCombiner(MoreExecutors.newDirectExecutorService()); asyncCellLoader = AsyncCellLoader.create(cqlClient, cqlFuturesCombiner, KEYSPACE); }
Source:
public ArrayList<Pojo> getResults(String query) { query = StringNormalizer.normalize(query); ArrayList<Pojo> results = new ArrayList<>(); query = query.replaceAll("-", " "); int relevance; int matchPositionStart; int matchPositionEnd; String contactNameNormalized; String phoneNormalized; final String queryWithSpace = " " + query; for (ContactPojo contact : pojos) { relevance = 0; contactNameNormalized = contact.nameNormalized; phoneNormalized = contact.phone.replaceAll("[-.(): ]","");; matchPositionStart = 0; matchPositionEnd = 0; if (contactNameNormalized.startsWith(query)) { relevance = 50; matchPositionEnd = matchPositionStart + query.length(); } else if ((matchPositionStart = contactNameNormalized.indexOf(queryWithSpace)) > -1) { relevance = 40; matchPositionEnd = matchPositionStart + queryWithSpace.length(); } else if (query.length()>2) { matchPositionStart = 0; matchPositionEnd = 0; if (phoneNormalized.startsWith(query)) { relevance = 10; } else if (phoneNormalized.indexOf(query) > -1) { relevance = 5; } } if (relevance > 0) { relevance += contact.timesContacted; if (contact.starred) relevance += 30; if (contact.homeNumber) relevance -= 1; contact.setDisplayNameHighlightRegion(matchPositionStart, matchPositionEnd); contact.relevance = relevance; results.add(contact); if (results.size() > 50) { break; } } } return results; }

Target:
public ArrayList<Pojo> getResults(String query) { query = StringNormalizer.normalize(query); ArrayList<Pojo> results = new ArrayList<>(); query = query.replaceAll("-", " "); int relevance; int matchPositionStart; int matchPositionEnd; String contactNameNormalized; final String queryWithSpace = " " + query; for (ContactPojo contact : pojos) { relevance = 0; contactNameNormalized = contact.nameNormalized; matchPositionStart = 0; matchPositionEnd = 0; if (contactNameNormalized.startsWith(query)) { relevance = 50; matchPositionEnd = matchPositionStart + query.length(); } else if ((matchPositionStart = contactNameNormalized.indexOf(queryWithSpace)) > -1) { relevance = 40; matchPositionEnd = matchPositionStart + queryWithSpace.length(); } else if (query.length()>2) { matchPositionStart = 0; matchPositionEnd = 0; if (contact.phoneSimplified.startsWith(query)) { relevance = 10; } else if (contact.phoneSimplified.indexOf(query) > -1) { relevance = 5; } } if (relevance > 0) { relevance += contact.timesContacted; if (contact.starred) relevance += 30; if (contact.homeNumber) relevance -= 1; contact.setDisplayNameHighlightRegion(matchPositionStart, matchPositionEnd); contact.relevance = relevance; results.add(contact); if (results.size() > 50) { break; } } } return results; }
Source:
public String saveOrUpdate(@Valid @ModelAttribute StateDTO stateDTO, BindingResult result) throws ObjectNotFoundException { if (result.hasErrors()) { throw new IllegalArgumentException(); } validateIdsBeforeExecuteSaveOrUpdate(stateDTO.getCandidateId(), stateDTO.getChannel().getId(), stateDTO.getPosition().getId()); stateDTO.setStateType("newstate"); stateDTO.setStateIndex(0); ApplicationDTO applicationDTO = ApplicationDTO.builder() .creationDate(new Date()) .candidateId(stateDTO.getCandidateId()) .positionId(stateDTO.getPosition().getId()) .channelId(stateDTO.getChannel().getId()) .build(); applicationsService.saveApplicaton(applicationDTO, stateDTO); return "redirect:/secure/candidate/" + stateDTO.getCandidateId(); }

Target:
public String saveOrUpdate(@Valid @ModelAttribute StateDTO stateDTO, BindingResult result) { if (!result.hasErrors()) { stateDTO.setStateType("newstate"); stateDTO.setStateIndex(0); ApplicationDTO applicationDTO = ApplicationDTO.builder() .creationDate(new Date()) .candidateId(stateDTO.getCandidateId()) .positionId(stateDTO.getPosition().getId()) .channelId(stateDTO.getChannel().getId()) .build(); applicationsService.saveApplicaton(applicationDTO, stateDTO); } return "redirect:/secure/candidate/" + stateDTO.getCandidateId(); }
Source:
private void loadFunctionNamespaceManager(File file) throws Exception { String functionNamespaceManagerId = getNameWithoutExtension(file.getName()); log.info("-- Loading function namespace managers from %s --", file); Map<String, String> properties = new HashMap<>(loadProperties(file)); String functionNamespaceManagerName = properties.remove("function-namespace-manager.name"); checkState(functionNamespaceManagerName != null, "Function namespace configuration %s does not contain function-namespace-manager.name", file.getAbsoluteFile()); String functionNamespaces = properties.remove("serving-namespaces"); checkState(functionNamespaces != null, "Function namespace configuration %s does not contain serving-namespaces", file.getAbsoluteFile()); functionManager.loadFunctionNamespaceManager(functionNamespaceManagerName, functionNamespaceManagerId, SPLITTER.splitToList(functionNamespaces), properties); log.info("-- Added function namespaces [%s] using function namespace manager [%s] --", functionNamespaces, functionNamespaceManagerId); }

Target:
private void loadFunctionNamespaceManager(File file) throws Exception { String functionNamespaceManagerId = getNameWithoutExtension(file.getName()); log.info("-- Loading function namespace manager from %s --", file); Map<String, String> properties = new HashMap<>(loadProperties(file)); String functionNamespaceManagerName = properties.remove("function-namespace-manager.name"); checkState(functionNamespaceManagerName != null, "Function namespace configuration %s does not contain function-namespace-manager.name", file.getAbsoluteFile()); String functionNamespaces = properties.remove("serving-namespaces"); checkState(functionNamespaces != null, "Function namespace configuration %s does not contain serving-namespaces", file.getAbsoluteFile()); functionManager.loadFunctionNamespaceManager(functionNamespaceManagerName, functionNamespaceManagerId, SPLITTER.splitToList(functionNamespaces), properties); log.info("-- Added function namespaces [%s] using function namespace manager [%s] --", functionNamespaces, functionNamespaceManagerId); }
Source:
private static void buildRequest(GitHubRequest request, HttpURLConnection connection) throws IOException { for (Map.Entry<String, String> e : request.headers().entrySet()) { String v = e.getValue(); if (v != null) connection.setRequestProperty(e.getKey(), v); } connection.setRequestProperty("Accept-Encoding", "gzip"); if (request.inBody()) { connection.setDoOutput(true); Object body = request.body(); if (body instanceof InputStream) { try (InputStream stream = (InputStream) body) { connection.setRequestProperty("Content-type", defaultString(request.contentType(), "application/x-www-form-urlencoded")); byte[] bytes = new byte[32768]; int read; while ((read = stream.read(bytes)) != -1) { connection.getOutputStream().write(bytes, 0, read); } } } else { connection.setRequestProperty("Content-type", defaultString(request.contentType(), "application/json")); if (body == null) { Map<String, Object> json = new HashMap<>(); for (GitHubRequest.Entry e : request.args()) { json.put(e.key, e.value); } body = json; } getMappingObjectWriter().writeValue(connection.getOutputStream(), body); } } }

Target:
private static void buildRequest(GitHubRequest request, HttpURLConnection connection) throws IOException { for (Map.Entry<String, String> e : request.headers().entrySet()) { String v = e.getValue(); if (v != null) connection.setRequestProperty(e.getKey(), v); } connection.setRequestProperty("Accept-Encoding", "gzip"); if (request.inBody()) { connection.setDoOutput(true); try (InputStream body = request.body()) { if (body != null) { connection.setRequestProperty("Content-type", defaultString(request.contentType(), "application/x-www-form-urlencoded")); byte[] bytes = new byte[32768]; int read; while ((read = body.read(bytes)) != -1) { connection.getOutputStream().write(bytes, 0, read); } } else { connection.setRequestProperty("Content-type", defaultString(request.contentType(), "application/json")); Map<String, Object> json = new HashMap<>(); for (GitHubRequest.Entry e : request.args()) { json.put(e.key, e.value); } getMappingObjectWriter().writeValue(connection.getOutputStream(), json); } } } }
Source:
public URL getFileLink(Path path) throws IOException { String value = String.format("%s/view/head%s", url, path.getValue()); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("FileLink URL: " + value); } return new URL(value); }

Target:
public URL getFileLink(Path path) throws IOException { String value = String.format("%s/view/head%s", url, path.getValue()); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("FileLink URL: " + value); } return new URL(value); }
Source:
private static String doc(TypeInfo type) { return null; }

Target:
private static String doc(TypeInfo type) { if (type instanceof StructTypeInfo) { return null; } return "Converted from '" + String.valueOf(type) + "'"; }
Source:
public void visitEnd() { for (final Jump j : jumps) { final Instruction target = LabelInfo.getInstruction(j.target); final int sourceOpcode = j.source.getNode().getOpcode(); if ((sourceOpcode == Opcodes.LOOKUPSWITCH || sourceOpcode == Opcodes.TABLESWITCH) && ignored.contains(target.getNode())) { continue; } target.setPredecessor(j.source, j.branch); } for (final CoveredProbe p : coveredProbes) { p.instruction.setCovered(p.branch); } for (final Instruction i : instructions) { final AbstractInsnNode m = i.getNode(); final AbstractInsnNode r = findRepresentative(m); if (r != m) { ignored.add(m); nodeToInstruction.get(r).merge(i); } } coverage.ensureCapacity(firstLine, lastLine); for (final Instruction i : instructions) { if (ignored.contains(i.getNode())) { continue; } final int total = i.getBranches(); final int covered = i.getCoveredBranches(); final ICounter instrCounter = covered == 0 ? CounterImpl.COUNTER_1_0 : CounterImpl.COUNTER_0_1; final ICounter branchCounter = total > 1 ? CounterImpl.getInstance(total - covered, covered) : CounterImpl.COUNTER_0_0; coverage.increment(instrCounter, branchCounter, i.getLine()); } coverage.incrementMethodCounter(); }

Target:
public void visitEnd() { for (final Jump j : jumps) { LabelInfo.getInstruction(j.target).setPredecessor(j.source, j.branch); } for (final CoveredProbe p : coveredProbes) { p.instruction.setCovered(p.branch); } for (final Instruction i : instructions) { final AbstractInsnNode m = i.getNode(); final AbstractInsnNode r = findRepresentative(m); if (r != m) { ignored.add(m); nodeToInstruction.get(r).merge(i); } } coverage.ensureCapacity(firstLine, lastLine); for (final Instruction i : instructions) { if (ignored.contains(i.getNode())) { continue; } final int total; final int covered; final Set<AbstractInsnNode> r = replacements.get(i.getNode()); if (r != null) { int cb = 0; for (AbstractInsnNode b : r) { if (nodeToInstruction.get(b).getCoveredBranches() > 0) { cb++; } } total = r.size(); covered = cb; } else { total = i.getBranches(); covered = i.getCoveredBranches(); } final ICounter instrCounter = covered == 0 ? CounterImpl.COUNTER_1_0 : CounterImpl.COUNTER_0_1; final ICounter branchCounter = total > 1 ? CounterImpl.getInstance(total - covered, covered) : CounterImpl.COUNTER_0_0; coverage.increment(instrCounter, branchCounter, i.getLine()); } coverage.incrementMethodCounter(); }
Source:
@Override public void active(boolean active) { cluster().state(active ? ClusterState.ACTIVE : ClusterState.INACTIVE); }

Target:
@Override public void active(boolean active) { cluster().active(active); }
Source:
public Object getIssueTracker(@CheckForNull String scmUrl) { if (scmUrl != null) { try { String slug = UrlToGitHubSlugConverter.convert(scmUrl); boolean issuesEnabled = GitHubSource.getInstance().issuesEnabled(slug); if (issuesEnabled) { return githubIssueTracker("<LINK_0>" + slug + "/issues"); } } catch (Exception e) { System.out.println("Failed to check if issues are enabled: " + e.getMessage()); } } else { System.out.println("SCM url is empty, defaulting to Jenkins JIRA for issue tracking"); } return JIRA_ISSUE_TRACKER; }

Target:
public Object getIssueTracker(@CheckForNull String scmUrl) { if (scmUrl != null) { try { String slug = UrlToGitHubSlugConverter.convert(scmUrl); boolean issuesEnabled = GitHubSource.getInstance().issuesEnabled(slug); if (issuesEnabled) { return githubIssueTracker("<LINK_0>" + slug + "/issues"); } } catch (Exception e) { System.out.println("Failed to check if issues are enabled: " + e.getMessage()); } } else { System.out.println("SCM url is empty, defaulting to Jenkins Jira for issue tracking"); } return JIRA_ISSUE_TRACKER; }
Source:
public void testRebaseInteractiveSingleFixup() throws Exception { writeTrashFile(FILE1, FILE1); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("Add file1\nnew line").call(); assertTrue(new File(db.getWorkTree(), FILE1).exists()); writeTrashFile("file2", "file2"); git.add().addFilepattern("file2").call(); git.commit().setMessage("Add file2\nnew line").call(); assertTrue(new File(db.getWorkTree(), "file2").exists()); writeTrashFile(FILE1, "blah"); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("updated file1 on master\nnew line").call(); writeTrashFile("file2", "more change"); git.add().addFilepattern("file2").call(); git.commit().setMessage("update file2 on side\nnew line").call(); git.rebase().setUpstream("HEAD~3") .runInteractively(new InteractiveHandler() { public void prepareSteps(List<RebaseTodoLine> steps) { steps.get(1).setAction(Action.FIXUP); } public String modifyCommitMessage(String commit) { fail("No callback to modify commit message expected for single fixup"); return commit; } }).call(); RevWalk walk = new RevWalk(db); ObjectId headId = db.resolve(Constants.HEAD); RevCommit headCommit = walk.parseCommit(headId); assertEquals(headCommit.getFullMessage(), "update file2 on side\nnew line"); ObjectId head1Id = db.resolve(Constants.HEAD + "^1"); RevCommit head1Commit = walk.parseCommit(head1Id); assertEquals("updated file1 on master\nnew line", head1Commit.getFullMessage()); }

Target:
public void testRebaseInteractiveSingleFixup() throws Exception { writeTrashFile(FILE1, FILE1); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("Add file1\nnew line").call(); assertTrue(new File(db.getWorkTree(), FILE1).exists()); writeTrashFile("file2", "file2"); git.add().addFilepattern("file2").call(); git.commit().setMessage("Add file2\nnew line").call(); assertTrue(new File(db.getWorkTree(), "file2").exists()); writeTrashFile(FILE1, "blah"); git.add().addFilepattern(FILE1).call(); git.commit().setMessage("updated file1 on master\nnew line").call(); writeTrashFile("file2", "more change"); git.add().addFilepattern("file2").call(); git.commit().setMessage("update file2 on master\nnew line").call(); git.rebase().setUpstream("HEAD~3") .runInteractively(new InteractiveHandler() { public void prepareSteps(List<RebaseTodoLine> steps) { steps.get(1).setAction(Action.FIXUP); } public String modifyCommitMessage(String commit) { fail("No callback to modify commit message expected for single fixup"); return commit; } }).call(); RevWalk walk = new RevWalk(db); ObjectId headId = db.resolve(Constants.HEAD); RevCommit headCommit = walk.parseCommit(headId); assertEquals("update file2 on master\nnew line", headCommit.getFullMessage()); ObjectId head1Id = db.resolve(Constants.HEAD + "^1"); RevCommit head1Commit = walk.parseCommit(head1Id); assertEquals("Add file2\nnew line", head1Commit.getFullMessage()); }
Source:
public List<CloudSubnet> chooseSubnetForPrivateEndpoint(Collection<CloudSubnet> subnetMetas, DBStack dbStack, boolean existingNetwork) { NetworkConnector networkConnector = cloudPlatformConnectors.get(new CloudPlatformVariant(dbStack.getCloudPlatform(), dbStack.getPlatformVariant())) .networkConnector(); return networkConnector.chooseSubnetsForPrivateEndpoint(subnetMetas, existingNetwork).getResult(); }

Target:
public List<CloudSubnet> chooseSubnetForPrivateEndpoint(Collection<CloudSubnet> subnetMetas, DBStack dbStack, boolean existingNetwork) { NetworkConnector networkConnector = cloudPlatformConnectors.get(new CloudPlatformVariant(dbStack.getCloudPlatform(), dbStack.getPlatformVariant())) .networkConnector(); List<CloudSubnet> suitableCloudSubnets = networkConnector.chooseSubnetsForPrivateEndpoint(subnetMetas, existingNetwork).getResult(); LOGGER.debug("Subnets suitable for private endpoint: {}", suitableCloudSubnets); return suitableCloudSubnets; }