auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public IndexIOConfig( @Deprecated @JsonProperty("firehose") @Nullable FirehoseFactory firehoseFactory, @JsonProperty("inputSource") @Nullable InputSource inputSource, @JsonProperty("inputFormat") @Nullable InputFormat inputFormat, @JsonProperty("appendToExisting") @Nullable Boolean appendToExisting ) { Checks.checkOneNotNullOrEmpty( ImmutableList.of(new Property<>("firehose", firehoseFactory), new Property<>("inputSource", inputSource)) ); if (firehoseFactory != null && inputFormat != null) { <START> throw new IAE("Cannot use firehose and inputFormat together. Try use inputSource instead of firehose."); <END> } this.firehoseFactory = firehoseFactory; this.inputSource = inputSource; this.inputFormat = inputFormat; this.appendToExisting = appendToExisting == null ? DEFAULT_APPEND_TO_EXISTING : appendToExisting; }</code><technical_language>Typo: Try inputFormat -> Try inputSource</technical_language>

Target:
public IndexIOConfig( @Deprecated @JsonProperty("firehose") @Nullable FirehoseFactory firehoseFactory, @JsonProperty("inputSource") @Nullable InputSource inputSource, @JsonProperty("inputFormat") @Nullable InputFormat inputFormat, @JsonProperty("appendToExisting") @Nullable Boolean appendToExisting ) { Checks.checkOneNotNullOrEmpty( ImmutableList.of(new Property<>("firehose", firehoseFactory), new Property<>("inputSource", inputSource)) ); if (firehoseFactory != null && inputFormat != null) { throw new IAE("Cannot use firehose and inputFormat together. Try using inputSource instead of firehose."); } this.firehoseFactory = firehoseFactory; this.inputSource = inputSource; this.inputFormat = inputFormat; this.appendToExisting = appendToExisting == null ? DEFAULT_APPEND_TO_EXISTING : appendToExisting; }
Source:
<code><START> public ReadOnlyArrayInterface getArray(int index) { <END> return (ReadOnlyArrayInterface) fleeceValueToObject(index); }</code><technical_language>return ReadOnlyArray ReadOnlyArrayInterface. IIRC, ReadOnlyArrayInterface is internal for Java</technical_language>

Target:
public ReadOnlyArray getArray(int index) { return (ReadOnlyArray) fleeceValueToObject(index); }
Source:
<code>public void testValidateOverlapWithOtherPools( String range1From, String range1To, String range2From, String range2To, boolean overlapping) { MacRange range1 = new MacRange(); range1.setMacFrom(range1From); range1.setMacTo(range1To); MacRange range2 = new MacRange(); range2.setMacFrom(range2From); range2.setMacTo(range2To); <START> PARAM_POOL.setId(Guid.newGuid()); PARAM_POOL.setName("p1"); PARAM_POOL.setRanges(Collections.singletonList(range1)); <END> MacPool macPool2 = new MacPool(); macPool2.setId(Guid.newGuid()); macPool2.setName("p2"); macPool2.setRanges(Collections.singletonList(range2)); when(macPoolDao.getAll()).thenReturn(Collections.singletonList(macPool2)); MacPool oldMacPool = new MacPool(); oldMacPool.setId(Guid.newGuid()); when(macPoolDao.get(any())).thenReturn(oldMacPool); when(macPoolPerCluster.isDuplicateMacAddressesAllowed(any())).thenReturn(false); assertEquals(!overlapping, command.validate()); }</code><technical_language>MacPool p1 = command.getParameters().getMacPool(); p1.setRanges(Collections.singletonList(range1));</technical_language>

Target:
public void testValidateOverlapWithOtherPools( String range1From, String range1To, String range2From, String range2To, boolean overlapping) { MacRange range1 = new MacRange(); range1.setMacFrom(range1From); range1.setMacTo(range1To); MacRange range2 = new MacRange(); range2.setMacFrom(range2From); range2.setMacTo(range2To); command.getParameters().getMacPool().setId(Guid.newGuid()); command.getParameters().getMacPool().setName("p1"); command.getParameters().getMacPool().setRanges(Collections.singletonList(range1)); MacPool macPool2 = new MacPool(); macPool2.setId(Guid.newGuid()); macPool2.setName("p2"); macPool2.setRanges(Collections.singletonList(range2)); when(macPoolDao.getAll()).thenReturn(Collections.singletonList(macPool2)); MacPool oldMacPool = new MacPool(); oldMacPool.setId(Guid.newGuid()); when(macPoolDao.get(any())).thenReturn(oldMacPool); when(macPoolPerCluster.isDuplicateMacAddressesAllowed(any())).thenReturn(false); assertEquals(!overlapping, command.validate()); }
Source:
<code>private Set<Descriptor> queryStatisticsRegistry() { Set<Descriptor> capabilities = new HashSet<Descriptor>(); Map<String, RegisteredStatistic> registrations = statisticsRegistry.getRegistrations(); for(Entry entry : registrations.entrySet()) { String statisticName = entry.getKey().toString(); RegisteredStatistic registeredStatistic = registrations.get(statisticName); if(registeredStatistic instanceof RegisteredCompoundStatistic) { List<StatisticDescriptor> statistics = new ArrayList<StatisticDescriptor>(); statistics.add(new StatisticDescriptor(entry.getKey() + "Count", StatisticType.COUNTER_HISTORY)); statistics.add(new StatisticDescriptor(entry.getKey() + "Rate", StatisticType.RATE_HISTORY)); statistics.add(new StatisticDescriptor(entry.getKey() + "LatencyMinimum", StatisticType.DURATION_HISTORY)); statistics.add(new StatisticDescriptor(entry.getKey() + "LatencyMaximum", StatisticType.DURATION_HISTORY)); statistics.add(new StatisticDescriptor(entry.getKey() + "LatencyAverage", StatisticType.AVERAGE_HISTORY)); capabilities.addAll(statistics); } else if(registeredStatistic instanceof RegisteredRatioStatistic) { capabilities.add(new StatisticDescriptor(entry.getKey() + "Ratio", StatisticType.RATIO_HISTORY)); } else if(registeredStatistic instanceof RegisteredValueStatistic) { <START> capabilities.add(new StatisticDescriptor(statisticName, statisticName.endsWith("Size") ? <END> StatisticType.SIZE_HISTORY : StatisticType.COUNTER_HISTORY)); } } return capabilities; }</code><technical_language>question - find a rely naming convention</technical_language>

Target:
private Set<Descriptor> queryStatisticsRegistry() { Set<Descriptor> capabilities = new HashSet<Descriptor>(); Map<String, RegisteredStatistic> registrations = statisticsRegistry.getRegistrations(); for(Entry entry : registrations.entrySet()) { String statisticName = entry.getKey().toString(); RegisteredStatistic registeredStatistic = registrations.get(statisticName); if(registeredStatistic instanceof RegisteredCompoundStatistic) { List<StatisticDescriptor> statistics = new ArrayList<StatisticDescriptor>(); statistics.add(new StatisticDescriptor(entry.getKey() + "Count", StatisticType.COUNTER_HISTORY)); statistics.add(new StatisticDescriptor(entry.getKey() + "Rate", StatisticType.RATE_HISTORY)); statistics.add(new StatisticDescriptor(entry.getKey() + "LatencyMinimum", StatisticType.DURATION_HISTORY)); statistics.add(new StatisticDescriptor(entry.getKey() + "LatencyMaximum", StatisticType.DURATION_HISTORY)); statistics.add(new StatisticDescriptor(entry.getKey() + "LatencyAverage", StatisticType.AVERAGE_HISTORY)); capabilities.addAll(statistics); } else if(registeredStatistic instanceof RegisteredRatioStatistic) { capabilities.add(new StatisticDescriptor(entry.getKey() + "Ratio", StatisticType.RATIO_HISTORY)); } else if(registeredStatistic instanceof RegisteredCounterStatistic) { capabilities.add(new StatisticDescriptor(statisticName, StatisticType.COUNTER_HISTORY)); } else if(registeredStatistic instanceof RegisteredSizeStatistic) { capabilities.add(new StatisticDescriptor(statisticName, StatisticType.SIZE_HISTORY)); } } return capabilities; }
Source:
<code>public <T> T[] runRelocateVerificationTest( AggregatorFactory factory, ColumnSelectorFactory selector, Class<T> clazz ) { T[] results = (T[]) Array.newInstance(clazz, 2); BufferAggregator agg = factory.factorizeBuffered(selector); <START> ByteBuffer myBuf = ByteBuffer.allocate(10040902); <END> agg.init(myBuf, 0); agg.aggregate(myBuf, 0); results[0] = (T) agg.get(myBuf, 0); byte[] theBytes = new byte[factory.getMaxIntermediateSize()]; myBuf.get(theBytes); ByteBuffer newBuf = ByteBuffer.allocate(941209); newBuf.position(7574); newBuf.put(theBytes); newBuf.position(0); agg.relocate(0, 7574, newBuf); results[1] = (T) agg.get(newBuf, 7574); return results; }</code><technical_language>numbers in this method meaningful. explain if are</technical_language>

Target:
public <T> T[] runRelocateVerificationTest( AggregatorFactory factory, ColumnSelectorFactory selector, Class<T> clazz ) { T[] results = (T[]) Array.newInstance(clazz, 2); BufferAggregator agg = factory.factorizeBuffered(selector); ByteBuffer myBuf = ByteBuffer.allocate(10040902); agg.init(myBuf, 0); agg.aggregate(myBuf, 0); results[0] = (T) agg.get(myBuf, 0); byte[] theBytes = new byte[factory.getMaxIntermediateSize()]; myBuf.get(theBytes); ByteBuffer newBuf = ByteBuffer.allocate(941209); newBuf.position(7574); newBuf.put(theBytes); newBuf.position(0); agg.relocate(0, 7574, myBuf, newBuf); results[1] = (T) agg.get(newBuf, 7574); return results; }
Source:
<code>private static OkHttpClient createClient() { SharedPreferenceCookieManager cookieManager = SharedPreferenceCookieManager.getInstance(); CookieJar cookieJar = new JavaNetCookieJar(cookieManager); ConnectionPool cp = new <START> ConnectionPool(0, 10, <END> TimeUnit.SECONDS); return new OkHttpClient.Builder() .connectionPool(cp) .cookieJar(cookieJar) .cache(NET_CACHE) .addInterceptor(new HttpLoggingInterceptor().setLevel(Prefs.getRetrofitLogLevel())) .addInterceptor(new UnsuccessfulResponseInterceptor()) .addInterceptor(new StatusResponseInterceptor(RbSwitch.INSTANCE)) .addNetworkInterceptor(new StripMustRevalidateResponseInterceptor()) .addInterceptor(new CommonHeaderRequestInterceptor()) .addInterceptor(new DefaultMaxStaleRequestInterceptor()) .addInterceptor(new CacheControlRequestInterceptor()) .addInterceptor(new CacheDelegateInterceptor(CacheDelegate.internalCache(SAVE_CACHE), CacheDelegate.internalCache(NET_CACHE))) .addInterceptor(new WikipediaZeroResponseInterceptor(WikipediaApp.getInstance().getWikipediaZeroHandler())) .addInterceptor(new TestStubInterceptor()) .build(); }</code><technical_language>this allow idle connections, Tor? desirable for normal usage of app..</technical_language>

Target:
private static OkHttpClient createClient() { SharedPreferenceCookieManager cookieManager = SharedPreferenceCookieManager.getInstance(); CookieJar cookieJar = new JavaNetCookieJar(cookieManager); return new OkHttpClient.Builder() .cookieJar(cookieJar) .cache(NET_CACHE) .addInterceptor(new HttpLoggingInterceptor().setLevel(Prefs.getRetrofitLogLevel())) .addInterceptor(new UnsuccessfulResponseInterceptor()) .addInterceptor(new StatusResponseInterceptor(RbSwitch.INSTANCE)) .addNetworkInterceptor(new StripMustRevalidateResponseInterceptor()) .addInterceptor(new CommonHeaderRequestInterceptor()) .addInterceptor(new DefaultMaxStaleRequestInterceptor()) .addInterceptor(new CacheControlRequestInterceptor()) .addInterceptor(new CacheDelegateInterceptor(CacheDelegate.internalCache(SAVE_CACHE), CacheDelegate.internalCache(NET_CACHE))) .addInterceptor(new WikipediaZeroResponseInterceptor(WikipediaApp.getInstance().getWikipediaZeroHandler())) .addInterceptor(new TestStubInterceptor()) .build(); }
Source:
<code>public void putsCapOnStream() throws IOException { final byte[] bytes = "test1".getBytes(); MatcherAssert.assertThat( <START> (long) new CapInputStream( <END> new ByteArrayInputStream(bytes), bytes.length * 2 ).available(), Matchers.equalTo((long) bytes.length) ); }</code><technical_language>@prondzyn this return int is enough bytes.length is int avoid casting a long</technical_language>

Target:
public void putsCapOnStream() throws IOException { final long length = 50L; MatcherAssert.assertThat( (long) new CapInputStream( new ByteArrayInputStream("test".getBytes()), length ).available(), Matchers.equalTo(length) ); }
Source:
<code>private void bindIfUnbound(Class<?> entityClass) { if (lookupBoundClass(entityClass) != null) { return; } <START> bindEntity(entityClass); <END> }</code><technical_language>Java if (lookupBoundClass(entityClass) == null) { bindEntity(entityClass); } simpler more straight forward</technical_language>

Target:
private void bindIfUnbound(Class<?> entityClass) { if (lookupBoundClass(entityClass) == null) { bindEntity(entityClass); } }
Source:
<code><START> public IHyperlink[] detectHyperlinks(ITextViewer textViewer, final IRegion region, boolean canShowMultipleHyperlinks) { <END> ITextEditor editor = (ITextEditor) getAdapter(ITextEditor.class); if (editor == null || region == null || !(editor instanceof CEditor)) return null; ISelection selection = textViewer.getSelectionProvider().getSelection(); if (!(selection instanceof ITextSelection)){ return null; } IExecutionDMContext context = resolveDebugContext(); if (context == null) { return null; } final DsfSession session = DsfSession.getSession(context.getSessionId()); if (session == null || !session.isActive()) { return null; } if(!isExecutable(context)) { return null; } return new IHyperlink[] {new DsfStepIntoSelectionHyperlink((ITextSelection) selection, editor) }; }</code><technical_language>In this method, JDT hyperlink is a method/function. This allows prevent showing "Step Into" hyperlink option for non-methods. do same</technical_language>

Target:
public IHyperlink[] detectHyperlinks(ITextViewer textViewer, final IRegion region, boolean canShowMultipleHyperlinks) { ITextEditor editor = (ITextEditor) getAdapter(ITextEditor.class); if (editor == null || region == null || !(editor instanceof CEditor)) return null; ITextSelection selection = resolveSelection(editor, region); if (selection == null){ return null; } IExecutionDMContext context = resolveDebugContext(); if (context == null) { return null; } final DsfSession session = DsfSession.getSession(context.getSessionId()); if (session == null || !session.isActive()) { return null; } if(!isExecutable(context)) { return null; } return new IHyperlink[] {new DsfStepIntoSelectionHyperlink(selection, editor) }; }
Source:
<code>public boolean isTOCUnderArticleName() { int h1Pos = 0; boolean h1Found = false; int index = 0; if (isH2AndTOC()) { for (WebElement element : articleBodyTags) { if (element.getTagName().equals("h1") && !h1Found) { h1Pos = index++; h1Found = true; continue; } if (element.getTagName().equals("nav") && element.getAttribute("class").contains("table-of-content") <START> && index > 0 && h1Found && h1Pos + 1 == index) { <END> return true; } ++index; } } return false; }</code><technical_language>Rethink if need &&</technical_language>

Target:
public boolean isTOCUnderArticleName() throws WebDriverException { waitForElementByElement(tocUnderH1); return tocUnderH1.isDisplayed() && tocUnderH1.getTagName().equals("nav"); }
Source:
<code>public String toString() { return "ConnectionPolicy{" + "requestTimeout=" + requestTimeout + ", connectionMode=" + connectionMode + ", maxConnectionPoolSize=" + maxConnectionPoolSize + ", idleHttpConnectionTimeout=" + idleHttpConnectionTimeout + ", idleTcpConnectionTimeout=" + idleTcpConnectionTimeout + ", userAgentSuffix='" + userAgentSuffix + '\'' + ", throttlingRetryOptions=" + throttlingRetryOptions + ", endpointDiscoveryEnabled=" + endpointDiscoveryEnabled + ", preferredRegions=" + preferredRegions + ", multipleWriteRegionsEnabled=" + multipleWriteRegionsEnabled + ", proxyType=" + (proxy != null ? proxy.getType() : null) + ", inetSocketProxyAddress=" + (proxy != null ? proxy.getAddress() : null) + ", readRequestsFallbackEnabled=" + readRequestsFallbackEnabled + ", connectTimeout=" + connectTimeout + ", idleEndpointTimeout=" + idleTcpEndpointTimeout + <START> ", maxConnectionsPerEndpoint=" + maxConnectionsPerEndpoint + <END> ", maxRequestsPerConnection=" + maxRequestsPerConnection + '}'; }</code><technical_language>add enableTcpConnectionEndpointRediscovery too. helpful for troubleshooting</technical_language>

Target:
public String toString() { return "ConnectionPolicy{" + "requestTimeout=" + requestTimeout + ", connectionMode=" + connectionMode + ", maxConnectionPoolSize=" + maxConnectionPoolSize + ", idleHttpConnectionTimeout=" + idleHttpConnectionTimeout + ", idleTcpConnectionTimeout=" + idleTcpConnectionTimeout + ", userAgentSuffix='" + userAgentSuffix + '\'' + ", throttlingRetryOptions=" + throttlingRetryOptions + ", endpointDiscoveryEnabled=" + endpointDiscoveryEnabled + ", preferredRegions=" + preferredRegions + ", multipleWriteRegionsEnabled=" + multipleWriteRegionsEnabled + ", proxyType=" + (proxy != null ? proxy.getType() : null) + ", inetSocketProxyAddress=" + (proxy != null ? proxy.getAddress() : null) + ", readRequestsFallbackEnabled=" + readRequestsFallbackEnabled + ", connectTimeout=" + connectTimeout + ", idleTcpEndpointTimeout=" + idleTcpEndpointTimeout + ", maxConnectionsPerEndpoint=" + maxConnectionsPerEndpoint + ", maxRequestsPerConnection=" + maxRequestsPerConnection + ", tcpConnectionEndpointRediscoveryEnabled=" + tcpConnectionEndpointRediscoveryEnabled + '}'; }
Source:
<code>public static Object[][] testAdsHopPostMessage() { return new Object[][]{ {"adtest", "DFP/hop", 1, "mobile"}, <START> {"adtest", "DFP/hophop", 2, "mobile_remnant"} <END> }; }</code><technical_language>Consider removing magic numbers source get right div want</technical_language>

Target:
public static Object[][] testAdsHopPostMessage() { return new Object[][]{ {"adtest", "DFP/hop", "mobile"}, {"adtest", "DFP/hophop", "mobile_remnant"} }; }
Source:
<code>public ClientMap(GameDTO serverGame, BorderPane gameBox, Broker broker, GameObject clientChar) { this.unassignedBullets = new ConcurrentLinkedQueue<>(); this.serverGameId = serverGame.getGameId(); this.clientChar = clientChar; <START> System.out.println("MY ID: "+clientChar.getId()); <END> if (clientChar.getWeapon() != null) { clientChar.getWeapon().addObserver(this); System.out.println(clientChar.getWeapon().countObservers()); } mapActive = true; gameObjects = new ConcurrentHashMap<>(); gameObjects.put(clientChar.getId(), clientChar); this.broker = broker; broker.activate(this); timer = new Timer(); timer.start(); for (GameObjectDTO dto : serverGame.getGameObjects()) { if (dto.getBody().getType() == Body.Geometry.CIRCLE.ordinal()) { if (dto.getId() != clientChar.getId()) { GameObject enemy = EntityFactory.getEntity(dto, EntityFactory.EntityType.ENEMY_CHARACTER); gameObjects.put(dto.getId(), enemy); } } else if (dto.getBody().getType() == Body.Geometry.RECTANGLE.ordinal()) { GameObject wall = EntityFactory.getEntity(dto, EntityFactory.EntityType.WALL); gameObjects.put(dto.getId(), wall); } } fpsLabel = new Label(); fpsLabel.setPrefSize(50, 20); gameBox.setLeft(fpsLabel); this.canvas = (Canvas)gameBox.getCenter(); gc = canvas.getGraphicsContext2D(); }</code><technical_language>remove please</technical_language>

Target:
public ClientMap(GameDTO serverGame, BorderPane gameBox, Broker broker, GameObject clientChar) { this.unassignedBullets = new ConcurrentLinkedQueue<>(); this.serverGameId = serverGame.getGameId(); this.clientChar = clientChar; if (clientChar.getWeapon() != null) { clientChar.getWeapon().addObserver(this); System.out.println(clientChar.getWeapon().countObservers()); } mapActive = true; gameObjects = new ConcurrentHashMap<>(); gameObjects.put(clientChar.getId(), clientChar); this.broker = broker; broker.activate(this); timer = new Timer(); timer.start(); for (GameObjectDTO dto : serverGame.getGameObjects()) { if (dto.getBody().getType() == Body.Geometry.CIRCLE.ordinal()) { if (dto.getId() != clientChar.getId()) { GameObject enemy = EntityFactory.getEntity(dto, EntityFactory.EntityType.ENEMY_CHARACTER); gameObjects.put(dto.getId(), enemy); } } else if (dto.getBody().getType() == Body.Geometry.RECTANGLE.ordinal()) { GameObject wall = EntityFactory.getEntity(dto, EntityFactory.EntityType.WALL); gameObjects.put(dto.getId(), wall); } } fpsLabel = new Label(); fpsLabel.setPrefSize(50, 20); gameBox.setLeft(fpsLabel); this.canvas = (Canvas)gameBox.getCenter(); gc = canvas.getGraphicsContext2D(); }
Source:
<code>final static public < A extends LongAccess > ArrayImg< Unsigned4BitType, A > unsigned4Bits( final A access, final long... dim ) { <START> final ArrayImg< Unsigned4BitType, A > img = new ArrayImg<>( access, dim, new Fraction( 1, 64 ) ); <END> final Unsigned4BitType t = new Unsigned4BitType( img ); img.setLinkedType( t ); return img; }</code><technical_language>this new Fraction( t.getBitsPerPixel(), 64 ) instead of new Fraction( 1, 64 ) here</technical_language>

Target:
final static public < A extends LongAccess > ArrayImg< Unsigned4BitType, A > unsigned4Bits( final A access, final long... dim ) { final ArrayImg< Unsigned4BitType, A > img = new ArrayImg<>( access, dim, new Fraction( 4, 64 ) ); final Unsigned4BitType t = new Unsigned4BitType( img ); img.setLinkedType( t ); return img; }
Source:
<code>private boolean appliesToEvent(ITmfEvent event) { String eventName = event.getType().getName(); String eventHandlerName = fName; if (eventName.equals(eventHandlerName)) { return true; } <START> if ((eventHandlerName.endsWith(TmfXmlStrings.WILDCARD) && eventName.startsWith(eventHandlerName.replace(TmfXmlStrings.WILDCARD, TmfXmlStrings.NULL)))) { <END> return true; } return false; }</code><technical_language>cut &&</technical_language>

Target:
private boolean appliesToEvent(ITmfEvent event) { String eventName = event.getType().getName(); if (eventName.equals(fName)) { return true; } if ((fName.endsWith(TmfXmlStrings.WILDCARD) && eventName.startsWith(fName.replace(TmfXmlStrings.WILDCARD, TmfXmlStrings.NULL)))) { return true; } return false; }
Source:
<code>public static void init() { if (initialized.getAndSet(true)) return; TypeCoercions.registerAdapter(Map.class, ProxySslConfig.class, new Function<Map, ProxySslConfig>() { @Override public ProxySslConfig apply(final Map input) { ProxySslConfig sslConfig = new ProxySslConfig(); sslConfig.certificateSourceUrl = (String) input.get("certificateSourceUrl"); sslConfig.keySourceUrl = (String) input.get("keySourceUrl"); sslConfig.certificateDestination = (String) input.get("certificateDestination"); sslConfig.keyDestination = (String) input.get("keyDestination"); Object targetIsSsl = input.get("targetIsSsl"); if (targetIsSsl != null) { sslConfig.targetIsSsl = TypeCoercions.coerce(targetIsSsl, Boolean.TYPE); } Object reuseSessions = input.get("reuseSessions"); if (reuseSessions != null) { sslConfig.reuseSessions = TypeCoercions.coerce(reuseSessions, Boolean.TYPE); } <START> return sslConfig; <END> } }); }</code><technical_language>Can/should warn if config options in map recognized</technical_language>

Target:
public static void init() { if (initialized.getAndSet(true)) return; TypeCoercions.registerAdapter(Map.class, ProxySslConfig.class, new Function<Map, ProxySslConfig>() { @Override public ProxySslConfig apply(final Map input) { Map map = MutableMap.copyOf(input); ProxySslConfig sslConfig = new ProxySslConfig(); sslConfig.certificateSourceUrl = (String) map.remove("certificateSourceUrl"); sslConfig.keySourceUrl = (String) map.remove("keySourceUrl"); sslConfig.certificateDestination = (String) map.remove("certificateDestination"); sslConfig.keyDestination = (String) map.remove("keyDestination"); Object targetIsSsl = map.remove("targetIsSsl"); if (targetIsSsl != null) { sslConfig.targetIsSsl = TypeCoercions.coerce(targetIsSsl, Boolean.TYPE); } Object reuseSessions = map.remove("reuseSessions"); if (reuseSessions != null) { sslConfig.reuseSessions = TypeCoercions.coerce(reuseSessions, Boolean.TYPE); } if (!map.isEmpty()) { LOG.info("Extra unused keys found in ProxySslConfig config: [{}]", Joiner.on(",").withKeyValueSeparator("=").join(map)); } return sslConfig; } }); }
Source:
<code>public ValidationResult hasUniqueName() { <START> if (!macPoolNameUnique(newMacPool.getName())) { <END> return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_MAC_POOL_OF_THIS_NAME_ALREADY_EXIST); } else { return ValidationResult.VALID; } }</code><technical_language>pass in parameter? a field in class.</technical_language>

Target:
public ValidationResult hasUniqueName() { return firstValidationResult( testNameNullity(), ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED). when(!macPoolNameUnique()) ); }
Source:
<code>public String getResponseCommentVisibilityString(FeedbackQuestionAttributes qn) { String visibilityString = StringHelper.removeEnclosingSquareBrackets(qn.showResponsesTo.toString()); if (StringHelper.isWhiteSpace(visibilityString)) { return "GIVER"; } else { return "GIVER, " + visibilityString; <START> } <END> }</code><technical_language>if write this more concisely, perhaps, return StringHelper.isWhiteSpace(visibilityString) ? "GIVER" : "GIVER, " + visibilityString;</technical_language>

Target:
public String getResponseCommentVisibilityString(FeedbackQuestionAttributes qn) { String visibilityString = StringHelper.removeEnclosingSquareBrackets(qn.showResponsesTo.toString()); return StringHelper.isWhiteSpace(visibilityString) ? "GIVER" : "GIVER, " + visibilityString; }
Source:
<code>public static void prepareLinks() throws Exception { View sourceBlockView = createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView()); View targetBlockView = createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView()); createEdgeFromPalette("blockdefinition.tool.association_none", sourceBlockView, targetBlockView, true); createEdgeFromPalette("blockdefinition.tool.association_none", sourceBlockView, targetBlockView, true); Set<Edge> edges = ViewUtil.getAllInnerEdges(sourceBlockView.getDiagram()); <START> ArrayList<Edge> <END> edgeList = new ArrayList<Edge>(); for (Edge edge : edges) { if (!edge.getType().equals("StereotypeCommentLink")) { edgeList.add(edge); } } Assert.assertEquals("There should be 2 edges", 2, edgeList.size()); associationSourceView = edgeList.toArray(new Edge[] {})[0]; associationTargetView = edgeList.toArray(new Edge[] {})[1]; Assert.assertNotNull("association should not be null", associationSourceView); Assert.assertNotNull("association should not be null", associationTargetView); }</code><technical_language>List interface instead of concrete implementation</technical_language>

Target:
public static void prepareLinks() throws Exception { View sourceBlockView = createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView()); View targetBlockView = createGraphicalNode(SysMLElementTypes.BLOCK, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID, getDiagramView()); createEdgeFromPalette("blockdefinition.tool.association_none", sourceBlockView, targetBlockView, true); createEdgeFromPalette("blockdefinition.tool.association_none", sourceBlockView, targetBlockView, true); Set<Edge> edges = ViewUtil.getAllInnerEdges(sourceBlockView.getDiagram()); List<Edge> edgeListToTest = new ArrayList<Edge>(); for (Edge edge : edges) { if (!edge.getType().equals("StereotypeCommentLink")) { edgeListToTest.add(edge); } } Assert.assertEquals("There should be 2 edges", 2, edgeListToTest.size()); associationSourceView = edgeListToTest.toArray(new Edge[] {})[0]; associationTargetView = edgeListToTest.toArray(new Edge[] {})[1]; Assert.assertNotNull("association should not be null", associationSourceView); Assert.assertNotNull("association should not be null", associationTargetView); }
Source:
<code><START> public void println() { <END> try { entered.set(Boolean.TRUE); delegate.println(); } finally { entered.remove(); } }</code><technical_language>Do need entered check boolean variant below</technical_language>

Target:
public void println() { if (entered.get() != null) { return; } try { entered.set(Boolean.TRUE); delegate.println(); } finally { entered.remove(); } }
Source:
<code>public Table<Locator, String, String> getAllValues( Set<Locator> locators ) throws IOException { <START> Timer.Context ctx = Instrumentation.getReadTimerContext( CassandraModel.CF_METRICS_STATE_NAME ); <END> Session session = DatastaxIO.getSession(); try { List<String> query = new ArrayList<String>(); for( Locator l : locators) { query.add( l.toString() ); } Select.Where select = select() .all() .from( CassandraModel.CF_METRICS_METADATA_NAME ) .where( in( KEY, query ) ); List<Row> results = session.execute( select ).all(); Table<Locator, String, String> metaTable = HashBasedTable.create(); for ( Row row : results ) { if ( LOG.isDebugEnabled() ) { LOG.debug( "Read metrics_metadata: " + row.getString( KEY ) + row.getString( COLUMN1 ) + serDes.deserialize( row.getBytes( VALUE ) ) ); } metaTable.put( Locator.createLocatorFromDbKey( row.getString( KEY ) ), row.getString( COLUMN1 ), serDes.deserialize( row.getBytes( VALUE ) ) ); } return metaTable; } finally { ctx.stop(); } }</code><technical_language>METRICS_METADATA_NAME</technical_language>

Target:
public Table<Locator, String, String> getAllValues( Set<Locator> locators ) throws IOException { Timer.Context ctx = Instrumentation.getReadTimerContext( CassandraModel.CF_METRICS_METADATA_NAME ); Session session = DatastaxIO.getSession(); try { List<String> query = new ArrayList<String>(); for( Locator l : locators) { query.add( l.toString() ); } Select.Where select = select() .all() .from( CassandraModel.CF_METRICS_METADATA_NAME ) .where( in( KEY, query ) ); List<Row> results = session.execute( select ).all(); Table<Locator, String, String> metaTable = HashBasedTable.create(); for ( Row row : results ) { if ( LOG.isTraceEnabled() ) { LOG.trace( "Read metrics_metadata: " + row.getString( KEY ) + row.getString( COLUMN1 ) + serDes.deserialize( row.getBytes( VALUE ) ) ); } metaTable.put( Locator.createLocatorFromDbKey( row.getString( KEY ) ), row.getString( COLUMN1 ), serDes.deserialize( row.getBytes( VALUE ) ) ); } return metaTable; } finally { ctx.stop(); } }
Source:
<code>public boolean equals(Object o) { <START> if (this == o) <END> return true; if (o == null || getClass() != o.getClass()) return false; Authority authority = (Authority) o; return title != null ? title.equals(authority.title) : authority.title == null; }</code><technical_language>Wrong formatting in method. Please fix it</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Authority authority = (Authority) o; return title != null ? title.equals(authority.title) : authority.title == null; }
Source:
<code>private String determineSubpackageName(Path baseDir, String basePackageName, Path classFile) { Path relativePath = baseDir.relativize(classFile.getParent()); String pathSeparator = baseDir.getFileSystem().getSeparator(); String subpackageName = relativePath.toString().replace(pathSeparator, PACKAGE_SEPARATOR_STRING); if (StringUtils.isNotBlank(basePackageName) && subpackageName.startsWith(basePackageName)) { if (subpackageName.length() == basePackageName.length()) { subpackageName = ""; } else { subpackageName = subpackageName.substring(basePackageName.length() + 1); <START> } <END> } if (subpackageName.endsWith(pathSeparator)) { subpackageName = subpackageName.substring(0, subpackageName.length() - pathSeparator.length()); } return subpackageName; }</code><technical_language>I this if..else shortened a ternary statement, critical. :)</technical_language>

Target:
private String determineSubpackageName(Path baseDir, String basePackageName, Path classFile) { Path relativePath = baseDir.relativize(classFile.getParent()); String pathSeparator = baseDir.getFileSystem().getSeparator(); String subpackageName = relativePath.toString().replace(pathSeparator, PACKAGE_SEPARATOR_STRING); if (StringUtils.isNotBlank(basePackageName) && subpackageName.startsWith(basePackageName)) { subpackageName = subpackageName.length() == basePackageName.length() ? "" : subpackageName.substring(basePackageName.length() + 1); } if (subpackageName.endsWith(pathSeparator)) { subpackageName = subpackageName.substring(0, subpackageName.length() - pathSeparator.length()); } return subpackageName; }
Source:
<code>public SWTBrowser(Composite parent, int style) { browser = new Browser(parent, style); browser.addDisposeListener( (DisposeEvent e) -> { synchronized (runOnDisposalList) { for (Runnable runnable : runOnDisposalList) { <START> runnable.run(); <END> } } }); }</code><technical_language>runnable raises a runtime exception executed afterwards. Is this intended</technical_language>

Target:
public SWTBrowser(Composite parent, int style) { browser = new Browser(parent, style); browser.addDisposeListener( (DisposeEvent event) -> { synchronized (runOnDisposalList) { for (Runnable runnable : runOnDisposalList) { try { runnable.run(); } catch (RuntimeException exception) { log.error("error running on disposal: " + exception.getMessage(), exception); } } } }); }
Source:
<code>public PermissionsOperationsParameters(Permission permission, Guid targetId) { <START> this.permission = permission; <END> this.targetId = targetId; }</code><technical_language>reuse existing constructors? public PermissionsOperationsParameters(Permission permission, Guid targetId) { this(permission); this.targetId = targetId; }</technical_language>

Target:
public PermissionsOperationsParameters(Permission permission, Guid targetId) { this(permission); this.targetId = targetId; }
Source:
<code>String extractClassificationMetadata(List<ClassificationType> classifications, String classificationSchemeUUID, String classificationValueName) { String classificationValue = null; LOG.debug("Looking for classificationScheme={}", classificationSchemeUUID); LOG.debug("Looking for classificationValueName={}", classificationValueName); for (ClassificationType classification : classifications) { String classificationSchemeName = classification.getClassificationScheme(); LOG.debug("Found classificationScheme={}", classificationSchemeName); if (classificationSchemeUUID.equals(classificationSchemeName)) { switch (classificationValueName) { case DocRepoConstants.XDS_NAME: classificationValue = classification.getName().getLocalizedString().get(0).getValue(); break; case DocRepoConstants.XDS_NODE_REPRESENTATION: classificationValue = classification.getNodeRepresentation(); break; case DocRepoConstants.XDS_CLASSIFIED_OBJECT: classificationValue = classification.getClassifiedObject(); break; case DocRepoConstants.XDS_CLASSIFICATION_ID: classificationValue = classification.getClassifiedObject(); break; default: break; } break; } } <START> if (classificationValue != null && !classificationValue.isEmpty()) { <END> classificationValue = StringUtil.extractStringFromTokens(classificationValue, "'()"); } LOG.debug("{}: {}", classificationValueName, classificationValue); return classificationValue; }</code><technical_language>Optional: NullChecker class, utilize some method(isNotNullishIgnoreSpace) in there? StringUtil apache package</technical_language>

Target:
String extractClassificationMetadata(List<ClassificationType> classifications, String classificationSchemeUUID, String classificationValueName) { String classificationValue = null; LOG.debug("Looking for classificationScheme={}", classificationSchemeUUID); LOG.debug("Looking for classificationValueName={}", classificationValueName); for (ClassificationType classification : classifications) { String classificationSchemeName = classification.getClassificationScheme(); LOG.debug("Found classificationScheme={}", classificationSchemeName); if (classificationSchemeUUID.equals(classificationSchemeName)) { switch (classificationValueName) { case DocRepoConstants.XDS_NAME: classificationValue = classification.getName().getLocalizedString().get(0).getValue(); break; case DocRepoConstants.XDS_NODE_REPRESENTATION: classificationValue = classification.getNodeRepresentation(); break; case DocRepoConstants.XDS_CLASSIFIED_OBJECT: classificationValue = classification.getClassifiedObject(); break; case DocRepoConstants.XDS_CLASSIFICATION_ID: classificationValue = classification.getClassifiedObject(); break; default: break; } break; } } if (StringUtils.isNotEmpty(classificationValue)) { classificationValue = StringUtil.extractStringFromTokens(classificationValue, "'()"); } LOG.debug("{}: {}", classificationValueName, classificationValue); return classificationValue; }
Source:
<code>@Override public RequestBody convert(final T value) throws IOException { return new RequestBody() { @Override public MediaType contentType() { return JaxbConverterFactory.XML; } @Override public void writeTo(BufferedSink sink) throws IOException { try { Marshaller marshaller = context.createMarshaller(); marshaller.setEventHandler(IGNORE_UNRECOGNIZED_FIELDS); XMLStreamWriter xmlWriter = xmlOutputFactory.createXMLStreamWriter( sink.outputStream(), JaxbConverterFactory.XML.charset().name()); <START> marshaller.marshal(value, xmlWriter); <END> } catch (JAXBException | XMLStreamException e) { throw new XmlDataException(e); } } }; }</code><technical_language>if mutates while written out</technical_language>

Target:
@Override public RequestBody convert(final T value) throws IOException { Buffer buffer = new Buffer(); try { Marshaller marshaller = context.createMarshaller(); XMLStreamWriter xmlWriter = xmlOutputFactory.createXMLStreamWriter( buffer.outputStream(), JaxbConverterFactory.XML.charset().name()); marshaller.marshal(value, xmlWriter); } catch (JAXBException | XMLStreamException e) { throw new RuntimeException(e); } return RequestBody.create(JaxbConverterFactory.XML, buffer.readByteString()); }
Source:
<code>public Response invokeAction( @QueryParam( ActionUtil.INVOKER_ASYNC_EXEC ) @DefaultValue( ActionUtil.INVOKER_DEFAULT_ASYNC_EXEC_VALUE ) String async, @QueryParam( ActionUtil.INVOKER_ACTIONID ) String actionId, @QueryParam( ActionUtil.INVOKER_ACTIONCLASS ) String actionClass, @QueryParam( ActionUtil.INVOKER_ACTIONUSER ) String actionUser, final String actionParams ) { boolean isAsyncExecution = Boolean.parseBoolean( async ); int httpStatus = HttpStatus.SC_INTERNAL_SERVER_ERROR; if ( isAsyncExecution ) { executorService.submit( createRunnable( actionId, actionClass, actionUser, actionParams ) ); httpStatus = HttpStatus.SC_ACCEPTED; } else { try { <START> IActionInvokeStatus status = internalInvokeAction( actionId, actionClass, actionUser, actionParams ); <END> httpStatus = ( status != null && status.getThrowable() == null ) ? HttpStatus.SC_OK : HttpStatus.SC_INTERNAL_SERVER_ERROR; } catch ( Throwable t ) { getLogger().error( t ); } } return Response.status( httpStatus ).build(); }</code><technical_language>If I understand correctly, purpose of introducing internalInvokeAction() methods is able get status of run, in Runnable. Instead, consider refactoring createRunnable a createCallable returns a Callable. cleaner, asych sync invoke callable...like so: if (isAsyncExecution) { .... submit( createCallable(...) ); } .... else { ... IActionInvokeStatus status = createCallable(...).call(); }</technical_language>

Target:
public Response invokeAction( @QueryParam( ActionUtil.INVOKER_ASYNC_EXEC ) @DefaultValue( ActionUtil.INVOKER_DEFAULT_ASYNC_EXEC_VALUE ) String async, @QueryParam( ActionUtil.INVOKER_ACTIONID ) String actionId, @QueryParam( ActionUtil.INVOKER_ACTIONCLASS ) String actionClass, @QueryParam( ActionUtil.INVOKER_ACTIONUSER ) String actionUser, final String actionParams ) { boolean isAsyncExecution = Boolean.parseBoolean( async ); int httpStatus = HttpStatus.SC_INTERNAL_SERVER_ERROR; if ( isAsyncExecution ) { executorService.submit( createCallable( actionId, actionClass, actionUser, actionParams ) ); httpStatus = HttpStatus.SC_ACCEPTED; } else { try { IActionInvokeStatus status = createCallable( actionId, actionClass, actionUser, actionParams ).call(); httpStatus = ( status != null && status.getThrowable() == null ) ? HttpStatus.SC_OK : HttpStatus.SC_INTERNAL_SERVER_ERROR; } catch ( Throwable t ) { getLogger().error( t ); } } return Response.status( httpStatus ).build(); }
Source:
<code>public void onAllRequiredCapabilitiesAvailable() { try { AndesConfigurationManager.initialize(readPortOffset()); brokerService = new BrokerServiceImpl(BrokerServiceDataHolder.getInstance().getAccessKey()); brokerService.loadConfigurations(); AndesContext.getInstance().constructStoreConfiguration(); String mode = AndesConfigurationManager.readValue(AndesConfiguration.DEPLOYMENT_MODE); String authenticatorName = AndesConfigurationManager.readValue(AndesConfiguration.AUTHENTICATOR_CLASS); authList.forEach(service -> { if (authenticatorName.equals(service.getClass().getName())) { authService = service; BrokerServiceDataHolder.getInstance().setAuthenticationService(authService); } else { <START> log.error("No matching authentication implementation was found for:" + authenticatorName); <END> } }); if (Modes.STANDALONE.name().equalsIgnoreCase(mode)) { AndesContext.getInstance().setClusteringEnabled(false); this.startAndesBroker(bundleContext); } else if (mode.equalsIgnoreCase(Modes.CLUSTERED.name())) { AndesContext.getInstance().setClusteringEnabled(true); this.startAndesBroker(bundleContext); } else { throw new ConfigurationException("Invalid value " + mode + " for deployment/mode in broker.xml"); } } catch (ConfigurationException e) { String error = "Invalid configuration found in a configuration file"; log.error(error, e); } catch (AndesException e) { String error = "An error occurred while broker startup."; log.error(error, e); } }</code><technical_language>this print error message time find a mismatch? For example if 4 authenticator classes, this print 3 times</technical_language>

Target:
public void onAllRequiredCapabilitiesAvailable() { try { AndesConfigurationManager.initialize(readPortOffset()); brokerService = new BrokerServiceImpl(BrokerServiceDataHolder.getInstance().getAccessKey()); brokerService.loadConfigurations(); AndesContext.getInstance().constructStoreConfiguration(); String mode = AndesConfigurationManager.readValue(AndesConfiguration.DEPLOYMENT_MODE); String authenticatorName = AndesConfigurationManager.readValue(AndesConfiguration.AUTHENTICATOR_CLASS); authList.forEach(service -> { if (authenticatorName.equals(service.getClass().getName())) { authService = service; BrokerServiceDataHolder.getInstance().setAuthenticationService(authService); } }); if (BrokerServiceDataHolder.getInstance().getAuthenticationService() == null) { log.error("No matching authentication implementation was found for:" + authenticatorName); } if (Modes.STANDALONE.name().equalsIgnoreCase(mode)) { AndesContext.getInstance().setClusteringEnabled(false); this.startAndesBroker(bundleContext); } else if (mode.equalsIgnoreCase(Modes.CLUSTERED.name())) { AndesContext.getInstance().setClusteringEnabled(true); this.startAndesBroker(bundleContext); } else { throw new ConfigurationException("Invalid value " + mode + " for deployment/mode in broker.xml"); } } catch (ConfigurationException e) { String error = "Invalid configuration found in a configuration file"; log.error(error, e); } catch (AndesException e) { log.error("An error occurred while broker startup", e); } }
Source:
<code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { <START> Script.runSimpleBashScript("mkdir /tmp/upload"); String location = "/tmp/upload"; <END> long maxFileSize = 1024 * 1024 * 1024; long maxRequestSize = 1024 * 1024 * 1024; int fileSizeThreshold = 64 * 1024; MultipartConfigElement multipartConfig = new MultipartConfigElement(location, maxFileSize, maxRequestSize, fileSizeThreshold); request.setAttribute(Request.__MULTIPART_CONFIG_ELEMENT, multipartConfig); response.setContentType("application/json;charset=UTF-8"); ServletOutputStream os = response.getOutputStream(); ServletConfig sc = getServletConfig(); String path = sc.getInitParameter("location"); Part filePart = request.getPart("file"); String fileName = filePart.getSubmittedFileName(); InputStream is = filePart.getInputStream(); Files.copy(is, Paths.get(path + request.getPathInfo()), StandardCopyOption.REPLACE_EXISTING); response.setStatus(200); os.print("{ filePath: '" + Paths.get(path + request.getPathInfo()) + "' }"); }</code><technical_language>blocker in case current user ('cloud'?) rights system (think rbac). get tempdir syscall better</technical_language>

Target:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Script.runSimpleBashScript(String.format("mkdir %s", uploadPath)); long maxFileSize = 1024 * 1024 * 1024; long maxRequestSize = 1024 * 1024 * 1024; int fileSizeThreshold = 64 * 1024; MultipartConfigElement multipartConfig = new MultipartConfigElement(uploadPath, maxFileSize, maxRequestSize, fileSizeThreshold); request.setAttribute(Request.__MULTIPART_CONFIG_ELEMENT, multipartConfig); response.setContentType("application/json;charset=UTF-8"); ServletOutputStream os = response.getOutputStream(); ServletConfig sc = getServletConfig(); String path = sc.getInitParameter("location"); Part filePart = request.getPart("file"); String fileName = filePart.getSubmittedFileName(); InputStream is = filePart.getInputStream(); Files.copy(is, Paths.get(path + request.getPathInfo()), StandardCopyOption.REPLACE_EXISTING); response.setStatus(200); os.print("{ filePath: '" + Paths.get(path + request.getPathInfo()) + "' }"); }
Source:
<code><START> public ArrayList<String> getAdditionalClasspathElements() { <END> return additionalClasspathElements; }</code><technical_language>List<String>? This construction forces code this method explicit ArrayList is considered a code smell</technical_language>

Target:
public List<String> getAdditionalClasspathElements() { return additionalClasspathElements; }
Source:
<code>public Thing createThingOfType(ThingTypeUID thingTypeUID, ThingUID thingUID, ThingUID bridgeUID, String label, Configuration configuration) { logger.debug("Creating thing for type '{}'.", thingTypeUID); for (ThingHandlerFactory thingHandlerFactory : thingHandlerFactories) { if (thingHandlerFactory.supportsThingType(thingTypeUID)) { Thing thing = thingHandlerFactory.createThing(thingTypeUID, configuration, thingUID, bridgeUID); <START> if (thing == null) { <END> logger.warn( "Cannot create thing of type '{}'. Binding '{}' says it supports it, but it could not be created.", thingTypeUID, thingHandlerFactory.getClass().getName()); } else { thing.setLabel(label); } return thing; } } logger.warn("Cannot create thing. No binding found that supports creating a thing of type '{}'.", thingTypeUID); return null; }</code><technical_language>This change is related PR. Is this fixing else witnessed? create another PR for fixing this issue</technical_language>

Target:
public Thing createThingOfType(ThingTypeUID thingTypeUID, ThingUID thingUID, ThingUID bridgeUID, String label, Configuration configuration) { logger.debug("Creating thing for type '{}'.", thingTypeUID); for (ThingHandlerFactory thingHandlerFactory : thingHandlerFactories) { if (thingHandlerFactory.supportsThingType(thingTypeUID)) { Thing thing = thingHandlerFactory.createThing(thingTypeUID, configuration, thingUID, bridgeUID); thing.setLabel(label); return thing; } } logger.warn("Cannot create thing. No binding found that supports creating a thing of type '{}'.", thingTypeUID); return null; }
Source:
<code>protected Duration calculateNextRetryInterval(final Exception lastException, final Duration remainingTime, final int baseWaitSeconds, final int retryCount) { <START> if ((!Retry.isRetriableException(lastException)) || retryCount >= super.maxRetryCount()) { <END> return null; } final double nextRetryInterval = Math.pow(retryFactor, (double) retryCount); final long nextRetryIntervalSeconds = (long) nextRetryInterval; final long nextRetryIntervalNano = (long) ((nextRetryInterval - (double) nextRetryIntervalSeconds) * 1000000000); if (remainingTime.getSeconds() < Math.max(nextRetryInterval, TIMER_TOLERANCE.getSeconds())) { return null; } final Duration retryAfter = this.minBackoff.plus(Duration.ofSeconds(nextRetryIntervalSeconds, nextRetryIntervalNano)); return retryAfter.plus(Duration.ofSeconds(baseWaitSeconds)); }</code><technical_language>This check is longer necessary verified in calling method. (ie. Retry.getNextRetryInterval)</technical_language>

Target:
protected Duration calculateNextRetryInterval(final Exception lastException, final Duration remainingTime, final int baseWaitSeconds, final int retryCount) { final double nextRetryInterval = Math.pow(retryFactor, (double) retryCount); final long nextRetryIntervalSeconds = (long) nextRetryInterval; final long nextRetryIntervalNano = (long) ((nextRetryInterval - (double) nextRetryIntervalSeconds) * 1000000000); if (remainingTime.getSeconds() < Math.max(nextRetryInterval, TIMER_TOLERANCE.getSeconds())) { return null; } final Duration retryAfter = minBackoff.plus(Duration.ofSeconds(nextRetryIntervalSeconds, nextRetryIntervalNano)); return retryAfter.plus(Duration.ofSeconds(baseWaitSeconds)); }