auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>void clean() throws IOException { Project rootProject = getProject(); Path rootProjectPath = rootProject.getProjectDir().toPath(); File okbuckState = rootProject.file(OkBuckGradlePlugin.OKBUCK_STATE); Set<String> lastProjectPaths; if (okbuckState.exists()) { try (Stream<String> lines = Files.lines(okbuckState.toPath())) { lastProjectPaths = lines.map(String::trim) <START> .filter(s -> s.length() > 0) <END> .collect(MoreCollectors.toImmutableSet()); } } else { lastProjectPaths = ImmutableSet.of(); okbuckState.getParentFile().mkdirs(); okbuckState.createNewFile(); } Set<String> currentProjectPaths = projects .stream() .filter(project -> ProjectUtil.getType(project) != ProjectType.UNKNOWN) .map(project -> rootProjectPath.relativize(project.getProjectDir().toPath()).toString()) .collect(MoreCollectors.toImmutableSet()); Sets.SetView<String> difference = Sets.difference(lastProjectPaths, currentProjectPaths); difference .stream() .map(p -> rootProjectPath.resolve(p).resolve(OkBuckGradlePlugin.BUCK)) .forEach(FileUtil::deleteQuietly); Files.write( okbuckState.toPath(), currentProjectPaths.stream().sorted().collect(MoreCollectors.toImmutableList())); }</code><technical_language>!Strings.isEmpty(), !Strings.isBlank() rule out whitespace-only text</technical_language>

Target:
void clean() throws IOException { Project rootProject = getProject(); Path rootProjectPath = rootProject.getProjectDir().toPath(); File okbuckState = rootProject.file(OkBuckGradlePlugin.OKBUCK_STATE); Set<String> lastProjectPaths; if (okbuckState.exists()) { try (Stream<String> lines = Files.lines(okbuckState.toPath())) { lastProjectPaths = lines .map(String::trim) .filter(s -> !Strings.isNullOrEmpty(s)) .collect(MoreCollectors.toImmutableSet()); } } else { lastProjectPaths = ImmutableSet.of(); okbuckState.getParentFile().mkdirs(); okbuckState.createNewFile(); } Set<String> currentProjectPaths = projects .stream() .filter(project -> ProjectUtil.getType(project) != ProjectType.UNKNOWN) .map(project -> rootProjectPath.relativize(project.getProjectDir().toPath()).toString()) .collect(MoreCollectors.toImmutableSet()); Sets.SetView<String> difference = Sets.difference(lastProjectPaths, currentProjectPaths); difference .stream() .map(p -> rootProjectPath.resolve(p).resolve(OkBuckGradlePlugin.BUCK)) .forEach(FileUtil::deleteQuietly); Files.write( okbuckState.toPath(), currentProjectPaths.stream().sorted().collect(MoreCollectors.toImmutableList())); }
Source:
<code>default <T> Optional<T> get(String key, Function<String, T> transformer) { return get(key).map(input -> { try { return transformer.apply(input); } catch (Exception ex) { <START> String message = String.format("Failed to convert configuration parameter with key '%s' for input: %s", <END> key, input); throw new JUnitException(message, ex); } }); }</code><technical_language>-> Failed transform configuration parameter key '%s' initial '%s'</technical_language>

Target:
default <T> Optional<T> get(String key, Function<String, T> transformer) { Preconditions.notNull(transformer, "transformer must not be null"); return get(key).map(input -> { try { return transformer.apply(input); } catch (Exception ex) { String message = String.format( "Failed to transform configuration parameter with key '%s' and initial value '%s'", key, input); throw new JUnitException(message, ex); } }); }
Source:
<code><START> public static <T extends CharSequence> Predicate<T> containsAllLiterals(final String... fragments) { <END> return Predicates.and(Iterables.transform(Arrays.asList(fragments), new ConvertStringToContainsLiteralPredicate())); }</code><technical_language>for code below, feels a lot simpler me: public static Predicate<CharSequence> containsAllLiterals(final String... fragments) { List<Predicate<CharSequence>> fragmentPredicates = Lists.newArrayList(); for (String fragment : fragments) { fragmentPredicates.add(containsLiteral(fragment)); } return Predicates.and(fragmentPredicates); }</technical_language>

Target:
public static <T extends CharSequence> Predicate<T> containsAllLiterals(final String... fragments) { List<Predicate<CharSequence>> fragmentPredicates = Lists.newArrayList(); for (String fragment : fragments) { fragmentPredicates.add(containsLiteral(fragment)); } return Predicates.and(fragmentPredicates); }
Source:
<code>public void testGeneratePasswordFromPassPhrase() throws Exception { final String algorithm = ALGORITHM_OTP_SHA1; <START> final SaslClientFactory clientFactory = obtainSaslClientFactory(OTPSaslClientFactory.class); <END> assertNotNull(clientFactory); PasswordFactory passwordFactory = PasswordFactory.getInstance(algorithm); final Password password = passwordFactory.generatePassword(new OneTimePasswordSpec(CodePointIterator.ofString("103029b112deb117").hexDecode().drain(), "TeSt".getBytes(StandardCharsets.US_ASCII), 100)); OneTimePasswordAlgorithmSpec otpSpec = new OneTimePasswordAlgorithmSpec(algorithm, "TeSt", 100); EncryptablePasswordSpec passwordSpec = new EncryptablePasswordSpec("This is a test.".toCharArray(), otpSpec); OneTimePassword generatedOTPassword = (OneTimePassword) passwordFactory.generatePassword(passwordSpec); assertTrue(password.equals(generatedOTPassword)); }</code><technical_language>a minor note, this line removed this test of clientFactory</technical_language>

Target:
public void testGeneratePasswordFromPassPhrase() throws Exception { final String algorithm = ALGORITHM_OTP_SHA1; PasswordFactory passwordFactory = PasswordFactory.getInstance(algorithm); final Password password = passwordFactory.generatePassword(new OneTimePasswordSpec(CodePointIterator.ofString("103029b112deb117").hexDecode().drain(), "TeSt", 100)); OneTimePasswordAlgorithmSpec otpSpec = new OneTimePasswordAlgorithmSpec(algorithm, "TeSt", 100); EncryptablePasswordSpec passwordSpec = new EncryptablePasswordSpec("This is a test.".toCharArray(), otpSpec); OneTimePassword generatedOTPassword = (OneTimePassword) passwordFactory.generatePassword(passwordSpec); assertTrue(password.equals(generatedOTPassword)); }
Source:
<code>public static String escape(Object content) { <START> return escapeAttributeValue(Objects.toString(content, null)); <END> }</code><technical_language>I call escape in line @deprecated message escape methods behave (someone update escape(String) updating deprecated escape(Object)). This is minor a practice IMO</technical_language>

Target:
public static String escape(Object content) { return escape(Objects.toString(content, null)); }
Source:
<code>private static String getNormalizedPointsListColorizedDescending(int[] subs, int index){ List<String> result = new ArrayList<String>(); for(int i=0 ; i<subs.length ; i++){ if(i==index){ continue; } result.add(getPointsAsColorizedHtml(subs[i])); } if (result.isEmpty()) { return "<span class=\"color_neutral\" data-toggle=\"tooltip\" data-placement=\"top\" " <START> + "title=\"Not Available: There is no data for this or the data is not enough\">N/A</span>"; <END> } Collections.sort(result); Collections.reverse(result); String resultString = ""; for(String s : result){ if(!resultString.isEmpty()){ resultString+=", "; } resultString += s; } return resultString; }</code><technical_language>constant <code>Const.Tooltips.FEEDBACK_CONTRIBUTION_NOT_AVAILABLE</code> In fact, this <code>getPointsAsColorizedHtml(Const.POINTS_NOT_SUBMITTED)</code></technical_language>

Target:
private static String getNormalizedPointsListColorizedDescending(int[] subs, int index){ List<String> result = new ArrayList<String>(); for(int i=0 ; i<subs.length ; i++){ if(i==index){ continue; } result.add(getPointsAsColorizedHtml(subs[i])); } if (result.isEmpty()) { return getPointsAsColorizedHtml(Const.POINTS_NOT_SUBMITTED); } Collections.sort(result); Collections.reverse(result); String resultString = ""; for(String s : result){ if(!resultString.isEmpty()){ resultString+=", "; } resultString += s; } return resultString; }
Source:
<code>public static <START> List<String> getValidFenceAgentTypes(String <END> clusterCompatibilityVersion) { return Arrays.asList(FenceConfigHelper.getFenceConfigurationValue( ConfigValues.VdsFenceType.name(), clusterCompatibilityVersion).split(",")); }</code><technical_language>Set<String> more me, is some need values ordered</technical_language>

Target:
public static Set<String> getValidFenceAgentTypes(String clusterCompatibilityVersion) { return new HashSet<>(Arrays.asList(FenceConfigHelper.getFenceConfigurationValue( ConfigValues.VdsFenceType.name(), clusterCompatibilityVersion).split(COMMA))); }
Source:
<code>NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, NetworkClientFactory networkClientFactory, NotificationSystem notificationSystem, ClusterMap clusterMap, Time time) throws IOException { this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.networkClientFactory = networkClientFactory; this.notificationSystem = notificationSystem; this.clusterMap = clusterMap; responseHandler = new ResponseHandler(clusterMap); this.time = time; ocCount = routerConfig.routerScalingUnitCount; ocList = new ArrayList<>(); for (int i = 0; i < ocCount; i++) { ocList.add(new OperationController(Integer.toString(i))); } backgroundDeleter = new BackgroundDeleter(); <START> ocList.add(backgroundDeleter); <END> routerMetrics.initializeNumActiveOperationsMetrics(currentOperationsCount); }</code><technical_language>if purpose of adding ocList is for shutdown, I recommend it. is instance of BackgroundDeleter, easy shutdown/wait for shutdown of one. I feel keeping _real_ ocs separated utility ocs is useful - e.g. changes required for getOperationController()</technical_language>

Target:
NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, NetworkClientFactory networkClientFactory, NotificationSystem notificationSystem, ClusterMap clusterMap, Time time) throws IOException { this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.networkClientFactory = networkClientFactory; this.notificationSystem = notificationSystem; this.clusterMap = clusterMap; responseHandler = new ResponseHandler(clusterMap); this.time = time; ocCount = routerConfig.routerScalingUnitCount; ocList = new ArrayList<>(); for (int i = 0; i < ocCount; i++) { ocList.add(new OperationController(Integer.toString(i))); } backgroundDeleter = new BackgroundDeleter(); ocList.add(backgroundDeleter); routerMetrics.initializeNumActiveOperationsMetrics(currentOperationsCount, currentBackgroundOperationsCount); }
Source:
<code>public List<CommunicationDetails> getById(String tenantId, String id) { QueryFactory<?> queryFactory = Search.getQueryFactory(communicationDetails); Query query = queryFactory.from(CommunicationDetails.class) .having("id") <START> .eq(id) <END> .toBuilder().build(); return query.list(); }</code><technical_language>if id is null? tenantId, is correct ignore it</technical_language>

Target:
public List<CommunicationDetails> getById(String tenantId, String id) { if (id == null) { throw new NullPointerException("Id should not be null!"); } QueryFactory<?> queryFactory = Search.getQueryFactory(communicationDetails); Query query = queryFactory.from(CommunicationDetails.class) .having("id") .eq(id) .toBuilder().build(); return query.list(); }
Source:
<code>private void refreshLunSize(StorageDomain incoming, StorageDomain storageDomain, StorageType storageType) { if (incoming.getStorage() == null) { return; } List<LogicalUnit> incomingLuns = getIncomingLuns(incoming.getStorage()); <START> if (!incomingLuns.isEmpty()) { <END> List<LogicalUnit> lunsToResize = new ArrayList<>(); for(LogicalUnit logicalUnit: incomingLuns){ if(logicalUnit.isSetRefreshSize() && logicalUnit.isRefreshSize()){ lunsToResize.add(logicalUnit); } } if(!lunsToResize.isEmpty()){ ExtendSANStorageDomainParameters params = createParameters(guid, lunsToResize, false); performAction(VdcActionType.RefreshLunsSize, params); } } }</code><technical_language>need this check. find luns need resized. If luns list is empty, find luns resize anyway</technical_language>

Target:
private void refreshLunSize(StorageDomain incoming, StorageDomain storageDomain, StorageType storageType) { if (incoming.getStorage() == null) { return; } List<LogicalUnit> incomingLuns = getIncomingLuns(incoming.getStorage()); List<LogicalUnit> lunsToResize = new ArrayList<>(); for (LogicalUnit logicalUnit : incomingLuns) { if (logicalUnit.isSetNeedsResize() && logicalUnit.isNeedsResize()) { lunsToResize.add(logicalUnit); } } if (!lunsToResize.isEmpty()) { ExtendSANStorageDomainParameters params = createParameters(guid, lunsToResize, false); performAction(VdcActionType.RefreshLunsSize, params); } }
Source:
<code>public boolean containsElementWithId(String plotId) { if (layout == Layout.ONE_COLUMN) { for (int i = 0; i < getWidgetCount(); i ++) { HorizontalPanel hp = (HorizontalPanel) getWidget(i); if (plotId.equals(hp.getWidget(0).getElement().getId())) { return true; } } } else { for (int i = 0; i < getWidgetCount(); i ++) { HorizontalPanel hp = (HorizontalPanel) getWidget(i); for (int j = 0; j < hp.getWidgetCount(); j++) { if (plotId.equals(hp.getWidget(j).getElement().getId())) { return true; } } } <START> } <END> return false; }</code><technical_language>simplify part (after else)</technical_language>

Target:
public boolean containsElementWithId(String plotId) { for (int i = 0; i < getWidgetCount(); i ++) { HorizontalPanel hp = (HorizontalPanel) getWidget(i); for (int j = 0; j < hp.getWidgetCount(); j++) { if (plotId.equals(hp.getWidget(j).getElement().getId())) { return true; } } } return false; }
Source:
<code>private Observation getObservation(String lookupName, Map<String, String> lookupFields, String configName) { ObservationListResult observations; Observation latestObservation = null; switch(lookupName) { case BY_PATIENT_UUID_AND_CONCEPT_UUID: observations = observationService.getObservationByPatientUUIDAndConceptUUID(configName, lookupFields.get(PATIENT_UUID), lookupFields.get(CONCEPT_UUID)); if (CollectionUtils.isNotEmpty(observations.getResults())) { latestObservation = observationService.getObservationByUuid(configName, observations.getResults().get(0).getUuid()); <START> latestObservation.setNumberOfObservations("1"); <END> } break; default: LOGGER.error("Lookup with name doesn't exist for observation object", lookupName); break; } if (latestObservation == null) { latestObservation = new Observation(); latestObservation.setNumberOfObservations("0"); } return latestObservation; }</code><technical_language>please move this lines new method</technical_language>

Target:
private Observation getObservation(String lookupName, Map<String, String> lookupFields, String configName) { ObservationListResult observations; Observation latestObservation = null; switch(lookupName) { case BY_PATIENT_UUID_AND_CONCEPT_UUID: observations = observationService.getObservationByPatientUUIDAndConceptUUID(configName, lookupFields.get(PATIENT_UUID), lookupFields.get(CONCEPT_UUID)); latestObservation = getLatestObservation(configName, observations); break; default: LOGGER.error("Lookup with name doesn't exist for observation object", lookupName); break; } return latestObservation; }
Source:
<code>public void saveDraftShouldDeleteDraftIfTitleAndBodyAreEmptyAndRecipientIsNotExists() throws Exception { mockMvc = MockMvcBuilders.standaloneSetup(controller).build(); <START> saveDraft(EMPTY, EMPTY, null).andExpect(model() <END> .attributeHasErrors("privateMessageDto")) .andExpect(view().name("redirect:/drafts")) .andExpect(status().isMovedTemporarily()); verify(pmService).delete(anyList()); }</code><technical_language>necessarily need constants for these.. Plain "" fine too</technical_language>

Target:
public void saveDraftShouldDeleteDraftIfTitleAndBodyAreEmptyAndRecipientIsNotExists() throws Exception { saveDraft("", "", null) .andExpect(model() .attributeHasErrors("privateMessageDto")) .andExpect(view().name("redirect:/drafts")) .andExpect(status().isMovedTemporarily()); verify(pmService).delete(anyList()); }
Source:
<code>protected IFile getFile(IResource resource) { if <START> (resource instanceof <END> IFile) { return (IFile) resource; } return Adapters.getAdapter(resource, IFile.class, true); }</code><technical_language>Lines 1051-1053 redundant</technical_language>

Target:
protected IFile getFile(IResource resource) { return Adapters.getAdapter(resource, IFile.class, true); }
Source:
<code>public QueryTranslator(SamzaSqlApplicationConfig sqlConfig) { this.sqlConfig = sqlConfig; schemaResolversBySystem = sqlConfig.getSchemaResolversBySystem(); <START> samzaToRelMsgConvertersBySystem = sqlConfig.getSamzaToRelMsgConvertersBySystem(); <END> relToSamzaMsgConvertersBySystem = sqlConfig.getRelToSamzaMsgConvertersBySystem(); schemaConvertersBySystem = sqlConfig.getSchemaConvertersBySystem(); scanTranslator = new ScanTranslator(samzaToRelMsgConvertersBySystem); }</code><technical_language>Noticed in SamzaSqlQueryPlanner.parseQuery(), is a SqlSelect generated for part SELECT statement. this planner.plan(), in QueryPlanner, parsing select statement (as queryInfo.getSelectQuery() is returning a string). question: do a single parse instead of double parse</technical_language>

Target:
public QueryTranslator(SamzaSqlApplicationConfig sqlConfig) { this.sqlConfig = sqlConfig; scanTranslator = new ScanTranslator(sqlConfig.getSamzaRelConverters()); }
Source:
<code>public void export(OutputStream os) throws TableException { ExcelWriter excelWriter = new ExcelWriter(os); try { int colOffset = tupleTable.getColOffset(); int colLimit = tupleTable.getColLimit(); int rowOffset = tupleTable.getOffset(); int rowLimit = tupleTable.getLimit(); tupleTable.setColOffset(0); tupleTable.setColLimit(0); tupleTable.setOffset(0); tupleTable.setLimit(0); TupleWriter tupleWriter = excelWriter.createTupleWriter("Sheet1"); try { tupleWriter.writeColNames(Iterables.transform(tupleTable.getColumns(), new Function<Field, String>() { @Override @Nullable <START> public String apply(Field field) <END> { return field.getName(); } })); for (Iterator<Tuple> it = tupleTable.iterator(); it.hasNext();) tupleWriter.write(it.next()); } finally { IOUtils.closeQuietly(tupleWriter); tupleTable.setColOffset(colOffset); tupleTable.setColLimit(colLimit); tupleTable.setOffset(rowOffset); tupleTable.setLimit(rowLimit); } } catch (IOException e) { throw new TableException(e); } finally { IOUtils.closeQuietly(excelWriter); } }</code><technical_language>@Nullable annotation implies argument null. Correct fix is @Nullable annotation do following: return field != null ? field.getName() : null;</technical_language>

Target:
public void export(OutputStream os) throws TableException { ExcelWriter excelWriter = new ExcelWriter(os); try { int colOffset = tupleTable.getColOffset(); int colLimit = tupleTable.getColLimit(); int rowOffset = tupleTable.getOffset(); int rowLimit = tupleTable.getLimit(); tupleTable.setColOffset(0); tupleTable.setColLimit(0); tupleTable.setOffset(0); tupleTable.setLimit(0); TupleWriter tupleWriter = excelWriter.createTupleWriter("Sheet1"); try { tupleWriter.writeColNames(Iterables.transform(tupleTable.getColumns(), new Function<Field, String>() { @Override @Nullable public String apply(@Nullable Field field) { return field != null ? field.getName() : null; } })); for (Iterator<Tuple> it = tupleTable.iterator(); it.hasNext();) tupleWriter.write(it.next()); } finally { IOUtils.closeQuietly(tupleWriter); tupleTable.setColOffset(colOffset); tupleTable.setColLimit(colLimit); tupleTable.setOffset(rowOffset); tupleTable.setLimit(rowLimit); } } catch (IOException e) { throw new TableException(e); } finally { IOUtils.closeQuietly(excelWriter); } }
Source:
<code>public QueryControlResult sendBatchQueries(final AvroOperatorChainDag chainDag, final int batchSize) throws AvroRemoteException { <START> final List<String> queryIdList = new LinkedList<>(); <END> for (int i = 0; i < batchSize; i++) { queryIdList.add(queryIdGenerator.generate(chainDag)); } return queryManager.batchCreate(new Tuple<>(queryIdList, chainDag)); }</code><technical_language>linked list? I guess ArrayList more efficient..</technical_language>

Target:
public QueryControlResult sendBatchQueries(final AvroOperatorChainDag chainDag, final int batchSize) throws AvroRemoteException { final List<String> queryIdList = new ArrayList<>(); for (int i = 0; i < batchSize; i++) { queryIdList.add(queryIdGenerator.generate(chainDag)); } return queryManager.createBatch(new Tuple<>(queryIdList, chainDag)); }
Source:
<code>private void populate(ApplicationDTO verbs) { final VBox verbsPane = new VBox(); final Text title = new TextWithStyle(tr("Verbs"), TITLE_CSS_CLASS); verbsPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS); verbsPane.getChildren().add(title); final TilePane verbsContentPane = new TilePane(); verbsContentPane.setPrefColumns(3); verbsContentPane.getStyleClass().add("grid"); for (ScriptDTO verb : verbs.getScripts()) { Button verbButton = new Button(verb.getScriptName()); verbButton.getStyleClass().addAll("toolButton"); verbButton.setStyle("-fx-background-image: url('" + verb.getIcon() + "');"); verbButton.setOnMouseClicked(event -> { this.lockAll(); this.verbsManager.installVerb(container.getEngine().toLowerCase(), container.getName(), verb.getId(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show())); }); this.lockableElements.add(verbButton); verbsContentPane.getChildren().add(verbButton); } verbsPane.getChildren().add(verbsContentPane); final ScrollPane scrollPane = new ScrollPane(); <START> scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); END> verbsContentPane.prefWidthProperty().bind(scrollPane.widthProperty()); verbsContentPane.prefHeightProperty().bind(scrollPane.heightProperty()); scrollPane.setBackground(verbsContentPane.getBackground()); scrollPane.setContent(verbsPane); this.setContent(scrollPane); }</code><technical_language>This line css files</technical_language>

Target:
private void populate(ApplicationDTO verbs) { final VBox verbsPane = new VBox(); final Text title = new TextWithStyle(tr("Verbs"), "title"); verbsPane.getStyleClass().add("containerConfigurationPane"); verbsPane.getChildren().add(title); final TilePane verbsContentPane = new TilePane(); verbsContentPane.setPrefColumns(3); verbsContentPane.getStyleClass().add("grid"); for (ScriptDTO verb : verbs.getScripts()) { Button verbButton = new Button(verb.getScriptName()); verbButton.getStyleClass().addAll("toolButton"); verbButton.setStyle("-fx-background-image: url('" + verb.getIcon() + "');"); verbButton.setOnMouseClicked(event -> { this.lockAll(); this.verbsManager.installVerb(container.getEngine().toLowerCase(), container.getName(), verb.getId(), this::unlockAll, e -> Platform.runLater(() -> new ErrorMessage("Error", e).show())); }); this.lockableElements.add(verbButton); verbsContentPane.getChildren().add(verbButton); } verbsPane.getChildren().add(verbsContentPane); final ScrollPane scrollPane = new ScrollPane(); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); verbsContentPane.prefWidthProperty().bind(scrollPane.widthProperty()); verbsContentPane.prefHeightProperty().bind(scrollPane.heightProperty()); scrollPane.setBackground(verbsContentPane.getBackground()); scrollPane.setContent(verbsPane); this.setContent(scrollPane); }
Source:
<code>private DatePicker.OnDateChangedListener buildDateListener() { final Handler mainHandler = new Handler(getContext().getMainLooper()); final Runnable updateFormRelevancyRunnable = new Runnable() { @Override public void run() { widgetEntryChanged(); isRelevancyUpdateScheduled = false; } }; return new DatePicker.OnDateChangedListener() { @Override public void onDateChanged(DatePicker view, int year, int month, int day) { if (mPrompt.isReadOnly()) { setAnswer(); } else { Calendar c = Calendar.getInstance(); c.set(year, month, 1); int max = c.getActualMaximum(Calendar.DAY_OF_MONTH); if (day > max) { mDatePicker.updateDate(year, month, max); } else { if (!(mDatePicker.getDayOfMonth() == day && mDatePicker.getMonth() == month && mDatePicker.getYear() == year)) { mDatePicker.updateDate(year, month, day); } } } if (!isRelevancyUpdateScheduled) { <START> mainHandler.postDelayed(updateFormRelevancyRunnable, 750); <END> } } }; }</code><technical_language>isRelevancyUpdateScheduled set true here</technical_language>

Target:
private DatePicker.OnDateChangedListener buildDateListener() { final Handler mainHandler = new Handler(getContext().getMainLooper()); final Runnable updateFormRelevancyRunnable = new Runnable() { @Override public void run() { widgetEntryChanged(); isRelevancyUpdateScheduled = false; } }; return new DatePicker.OnDateChangedListener() { @Override public void onDateChanged(DatePicker view, int year, int month, int day) { if (mPrompt.isReadOnly()) { setAnswer(); } else { Calendar c = Calendar.getInstance(); c.set(year, month, 1); int max = c.getActualMaximum(Calendar.DAY_OF_MONTH); if (day > max) { mDatePicker.updateDate(year, month, max); } else { if (!(mDatePicker.getDayOfMonth() == day && mDatePicker.getMonth() == month && mDatePicker.getYear() == year)) { mDatePicker.updateDate(year, month, day); } } } if (!isRelevancyUpdateScheduled) { isRelevancyUpdateScheduled = true; mainHandler.postDelayed(updateFormRelevancyRunnable, 750); } } }; }
Source:
<code>public void close() throws IOException { <START> backingStream.close(); <END> if (onCloseAction != null) { onCloseAction.run(); } }</code><technical_language>do need a try-finally ensure close action called</technical_language>

Target:
public void close() throws IOException { try { backingStream.close(); } finally { if (onCloseAction != null) { onCloseAction.run(); } } }
Source:
<code>public ResponseEntity<Problem> noEventTypeException(final NoEventTypeException exception, final NativeWebRequest request) { <START> return Responses.create(UNPROCESSABLE_ENTITY, exception.getMessage(), request); <END> }</code><technical_language>I - this is class for default exception handlers. default for NoSuchEventType is NOT_FOUND</technical_language>

Target:
public ResponseEntity<Problem> noEventTypeException(final NoEventTypeException exception, final NativeWebRequest request) { return Responses.create(Response.Status.NOT_FOUND, exception.getMessage(), request); }
Source:
<code>public void copy(Position other) { <START> this.position = other.position; <END> }</code><technical_language>a deep copy</technical_language>

Target:
public void copy(Position other) { position = other.position.cpy(); }
Source:
<code>public void testReboot() throws Exception { Set<? extends NodeMetadata> rebootNodes = client.rebootNodesMatching(inGroup(group)); for (ComputeMetadata node : rebootNodes) { assert node.getProviderId() != null : node; <START> assert node.getLocation() != null : node; <END> assertEquals(node.getType(), ComputeType.NODE); } testGet(); }</code><technical_language>Please assertNotNull TestNG fix indents</technical_language>

Target:
public void testReboot() throws Exception { Set<? extends NodeMetadata> rebootNodes = client.rebootNodesMatching(inGroup(group)); for (ComputeMetadata node : rebootNodes){ assertNotNull(node); assert node.getProviderId() != null : node; assert node.getLocation() != null : node; } testGet(); }
Source:
<code>public static void fixNmMdAndUq(final SAMRecord record, final ReferenceSequenceFileWalker refSeqWalker, final boolean isBisulfiteSequence) { final byte[] referenceBases = refSeqWalker.get(refSeqWalker.getSequenceDictionary().getSequenceIndex(record.getReferenceName())).getBases(); SequenceUtil.calculateMdAndNmTags(record, referenceBases, true, !isBisulfiteSequence); if (isBisulfiteSequence) { record.setAttribute(SAMTag.NM.name(), SequenceUtil.calculateSamNmTag(record, referenceBases, 0, isBisulfiteSequence)); } <START> if (record.getBaseQualities() != SAMRecord.NULL_QUALS) { <END> calculateUq(record, refSeqWalker, isBisulfiteSequence); } }</code><technical_language>This if is unnecessary tested calculateUq()</technical_language>

Target:
public static void fixNmMdAndUq(final SAMRecord record, final ReferenceSequenceFileWalker refSeqWalker, final boolean isBisulfiteSequence) { final byte[] referenceBases = refSeqWalker.get(refSeqWalker.getSequenceDictionary().getSequenceIndex(record.getReferenceName())).getBases(); SequenceUtil.calculateMdAndNmTags(record, referenceBases, true, !isBisulfiteSequence); if (isBisulfiteSequence) { record.setAttribute(SAMTag.NM.name(), SequenceUtil.calculateSamNmTag(record, referenceBases, 0, isBisulfiteSequence)); } calculateUq(record, refSeqWalker, isBisulfiteSequence); }
Source:
<code><START> public String getTableName() { <END> return this.tableName; }</code><technical_language>methods package-private</technical_language>

Target:
String getTableName() { return tableName; }
Source:
<code>public void lex_generalInputs() { <START> assertEquals(getTokens(""), Arrays.asList( <END> new Token(TokenType.EOF, ""))); assertEquals(getTokens("a' b' c'"), Arrays.asList( new Token(TokenType.SYMBOL, "a'"), new Token(TokenType.SYMBOL, "b'"), new Token(TokenType.SYMBOL, "c'"), new Token(TokenType.EOF, ""))); }</code><technical_language>tokenise? getTokens is a bit general for does</technical_language>

Target:
public void lex_generalInputs() { assertEquals(tokenise(""), Arrays.asList( new Token(TokenType.EOF, ""))); assertEquals(tokenise("a' b' c'"), Arrays.asList( new Token(TokenType.SYMBOL, "a'"), new Token(TokenType.SYMBOL, "b'"), new Token(TokenType.SYMBOL, "c'"), new Token(TokenType.EOF, ""))); }
Source:
<code>protected <T> void processBean(Bean<T> b) { Bean<T> bean = b; BeanManagerImpl beanManager = getOrCreateBeanDeployment(bean.getBeanClass()).getBeanManager(); ExternalBeanAttributesFactory.validateBeanAttributes(bean, beanManager); ContainerLifecycleEvents containerLifecycleEvents = beanManager.getServices().get(ContainerLifecycleEvents.class); if (bean instanceof Interceptor<?>) { beanManager.addInterceptor((Interceptor<?>) bean); } else if (bean instanceof Decorator<?>) { beanManager.addDecorator(CustomDecoratorWrapper.of((Decorator<?>) bean, beanManager)); } else { <START> if (bean instanceof PassivationCapable) { <END> PassivationCapable passivationCapable = (PassivationCapable) bean; if (passivationCapable.getId() == null) { throw new IllegalArgumentException("Passivation capable bean cannot have a null id: " + bean); } } beanManager.addBean(bean); } containerLifecycleEvents.fireProcessBean(beanManager, bean); }</code><technical_language>check needs happen for decorators interceptors also</technical_language>

Target:
protected <T> void processBean(Bean<T> b) { Bean<T> bean = b; BeanManagerImpl beanManager = getOrCreateBeanDeployment(bean.getBeanClass()).getBeanManager(); ExternalBeanAttributesFactory.validateBeanAttributes(bean, beanManager); ContainerLifecycleEvents containerLifecycleEvents = beanManager.getServices().get(ContainerLifecycleEvents.class); if (bean instanceof PassivationCapable) { PassivationCapable passivationCapable = (PassivationCapable) bean; if (passivationCapable.getId() == null) { throw new IllegalArgumentException(PASSIVATION_CAPABLE_BEAN_HAS_NULL_ID, bean); } } if (bean instanceof Interceptor<?>) { beanManager.addInterceptor((Interceptor<?>) bean); } else if (bean instanceof Decorator<?>) { beanManager.addDecorator(CustomDecoratorWrapper.of((Decorator<?>) bean, beanManager)); } else { beanManager.addBean(bean); } containerLifecycleEvents.fireProcessBean(beanManager, bean); }
Source:
<code>public List<CodeSystem> getCodeSystems() { final CDOResource cdoResource = transaction.getOrCreateResource(getMetaRootResourceName()); <START> return Lists.transform(cdoResource.getContents(), new UncheckedCastFunction<>(CodeSystem.class)); <END> }</code><technical_language>FluentIterable.filter() Iterables.filter</technical_language>

Target:
public List<CodeSystem> getCodeSystems() { final CDOResource cdoResource = transaction.getOrCreateResource(getMetaRootResourceName()); return FluentIterable.from(cdoResource.getContents()).filter(CodeSystem.class).toList(); }
Source:
<code>public ActiveMQBuffer getDataBuffer() { ActiveMQBuffer buffer; try { if (isLargeMessage()) { <START> LargeBodyEncoder encoder = getBodyEncoder(); <END> encoder.open(); int bodySize = (int) encoder.getLargeBodySize(); buffer = new ChannelBufferWrapper(UnpooledByteBufAllocator.DEFAULT.heapBuffer(bodySize)); encoder.encode(buffer, bodySize); encoder.close(); } else { buffer = getReadOnlyBodyBuffer(); } if (Boolean.TRUE.equals(getBooleanProperty(Message.HDR_LARGE_COMPRESSED))) { buffer = inflate(buffer); } } catch (Exception e) { ActiveMQIOErrorException e2 = new ActiveMQIOErrorException(); e2.initCause(e); logger.warn(e.getMessage(), e); return getReadOnlyBodyBuffer(); } return buffer; }</code><technical_language>pack uncommon path a separate method</technical_language>

Target:
public ActiveMQBuffer getDataBuffer() { ActiveMQBuffer buffer; try { if (isLargeMessage()) { buffer = getLargeMessageBuffer(); } else { buffer = getReadOnlyBodyBuffer(); } if (Boolean.TRUE.equals(getBooleanProperty(Message.HDR_LARGE_COMPRESSED))) { buffer = inflate(buffer); } } catch (Exception e) { logger.warn(e.getMessage(), e); return getReadOnlyBodyBuffer(); } return buffer; }
Source:
<code>public boolean isSupported() { <START> return SystemUtils.IS_OS_LINUX && gnomeLoginKeyring != null; <END> }</code><technical_language>suggestion return SystemUtils.IS_OS_LINUX && gnomeLoginKeyring.isPresent();</technical_language>

Target:
public boolean isSupported() { return SystemUtils.IS_OS_LINUX && gnomeLoginKeyring.isPresent(); }
Source:
<code>private void generateStructSupportClasses(StructType type) { generateStructSupportReader(type); <START> generateStructSupportWriter(type); <END> }</code><technical_language>I "Support" word needed in names, is name "generateStructReader", "generateStructWriter", etc. accurately describes do</technical_language>

Target:
private void generateStructSupportClasses(StructType type) { generateStructReader(type); generateStructWriter(type); }
Source:
<code>private void registerListeners() { final IWorkbench workbench = PlatformUI.getWorkbench(); workbench.getDisplay().asyncExec(new Runnable() { @Override public void run() { <START> IWorkbenchWindow active = workbench.getActiveWorkbenchWindow(); <END> if (active == null) return; CodanPartListener.installOnWindow(active); workbench.addWindowListener(new CodanWindowListener()); } }); }</code><technical_language>I this needs windows. Otherwise, if I quit Eclipse multiple windows opened, is restarted, of window listener (the focus). 1. Open a source file in window 2. Open a window open file 3. Exit Eclipse (File > Exit) 4. Start 5. Close window focus 6. Start typing errors in remaining window: reported</technical_language>

Target:
private void registerListeners() { final IWorkbench workbench = PlatformUI.getWorkbench(); workbench.getDisplay().asyncExec(new Runnable() { @Override public void run() { for (IWorkbenchWindow window : workbench.getWorkbenchWindows()) { CodanPartListener.installOnWindow(window); } workbench.addWindowListener(new CodanWindowListener()); } }); }
Source:
<code>public void statusesChanged(Collection<ResourceStatusChange> changes) { if (session != null) { <START> if (SessionStatus.SYNC.equals(session.getStatus())) { <END> marker = null; } } }</code><technical_language>== is sufficient</technical_language>

Target:
public void statusesChanged(Collection<ResourceStatusChange> changes) { if (session != null) { if (SessionStatus.SYNC == session.getStatus()) { marker = null; } } }
Source:
<code><START> public PresenceStatus getPresenceStatusObject(Registration reg) { <END> return clientStatusList.get(reg.getEndpoint()); }</code><technical_language>I this public, right</technical_language>

Target:
private PresenceStatus getPresenceStatusObject(Registration reg) { return clientStatusList.get(reg.getEndpoint()); }
Source:
<code>public void removeInstance(Object instance) { <START> deployedCacheStores.put(instance.getClass().getName(), new CompletableFuture<>()); <END> }</code><technical_language>setting new a new empty CompletableFuture? Is removing sufficient</technical_language>

Target:
public void removeInstance(Object instance) { deployedCacheStores.remove(instance.getClass().getName()); }
Source:
<code>protected List<String> getLdapServers(CLIParser parser, String domainName) throws ManageDomainsResult { String argValue = parser.getArg(Arguments.ldapServers.toString().toLowerCase()); if (StringUtils.isEmpty(argValue)) { LdapSRVLocator locator = new LdapSRVLocator(); DnsSRVResult ldapDnsResult = null; boolean foundServers = true; try { <START> InetAddress ia = InetAddress.getByName(domainName); <END> ia.getCanonicalHostName(); } catch (UnknownHostException e) { foundServers = false; } try { ldapDnsResult = locator.getLdapServers(domainName); if (!foundSrvRecords(ldapDnsResult)) { foundServers = false; } } catch (Exception ex) { foundServers = false; } if (!foundServers) { throw new ManageDomainsResult("Could not locate LDAP servers to be used to validate the input of the utility", ManageDomainsResultEnum.NO_LDAP_SERVERS_FOR_DOMAIN, domainName); } ArrayList<String> result = new ArrayList<String>(); for (int counter = 0; counter < ldapDnsResult.getNumOfValidAddresses(); counter++) { result.add(ldapDnsResult.getAddresses()[counter]); } return result; } return new ArrayList<String>(Arrays.asList(argValue.split(","))); }</code><technical_language>domainName is host name. In addition, check done if ldapServers is provided. need check for example - ldapserver1.acme.com is resolvable</technical_language>

Target:
protected List<String> getLdapServers(CLIParser parser, String domainName) throws ManageDomainsResult { String argValue = parser.getArg(Arguments.ldapServers.toString().toLowerCase()); if (StringUtils.isEmpty(argValue)) { LdapSRVLocator locator = new LdapSRVLocator(); DnsSRVResult ldapDnsResult = null; boolean foundServers = true; try { ldapDnsResult = locator.getLdapServers(domainName); if (!foundSrvRecords(ldapDnsResult)) { foundServers = false; } } catch (Exception ex) { foundServers = false; } if (!foundServers) { throw new ManageDomainsResult("Could not locate LDAP servers to be used to validate the input of the utility", ManageDomainsResultEnum.NO_LDAP_SERVERS_FOR_DOMAIN, domainName); } ArrayList<String> result = new ArrayList<String>(); for (int counter = 0; counter < ldapDnsResult.getNumOfValidAddresses(); counter++) { result.add(ldapDnsResult.getAddresses()[counter]); } return result; } else { for (String host: argValue.split(DOMAIN_SEPERATOR)) { try { InetAddress ia = InetAddress.getByName(host); ia.getCanonicalHostName(); } catch (UnknownHostException e) { log.error("Cannot resolve FQDN: " + e.getMessage()); } } } return new ArrayList<String>(Arrays.asList(argValue.split(DOMAIN_SEPERATOR))); }
Source:
<code>private void makeManagerAddonVersionOlder(String homeAddonsDirPath) { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder; try { dBuilder = dbFactory.newDocumentBuilder(); File installedXml = new File(homeAddonsDirPath + "/installed.xml"); Document doc = dBuilder.parse(installedXml); Element documentElement = doc.getDocumentElement(); NodeList childNodes = documentElement.getElementsByTagName("addon"); for (int i = 0; i <= childNodes.getLength() - 1; i++) { Element item = (Element) childNodes.item(i); if (item.getNodeName().equals("addon")) { String addonName = item.getAttribute("name"); if (addonName.equals("org.jboss.forge.addon:addon-manager")) { item.setAttribute("version", FORGE_OLD_VERSION); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(installedXml); transformer.transform(source, result); return; } } } } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (Exception e) { <START> System.out.println("Why?"); <END> } return; }</code><technical_language>$#it :)</technical_language>

Target:
private void makeManagerAddonVersionOlder(String homeAddonsDirPath) throws TransformerException, SAXException, IOException { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder; try { dBuilder = dbFactory.newDocumentBuilder(); File installedXml = new File(homeAddonsDirPath + "/installed.xml"); Document doc = dBuilder.parse(installedXml); Element documentElement = doc.getDocumentElement(); NodeList childNodes = documentElement.getElementsByTagName("addon"); for (int i = 0; i <= childNodes.getLength() - 1; i++) { Element item = (Element) childNodes.item(i); if (item.getNodeName().equals("addon")) { String addonName = item.getAttribute("name"); if (addonName.equals("org.jboss.forge.addon:addon-manager")) { item.setAttribute("version", FORGE_OLD_VERSION); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(installedXml); transformer.transform(source, result); return; } } } } catch (ParserConfigurationException e) { e.printStackTrace(); } return; }
Source:
<code>private OrderSet orderSetBuilder(boolean orderSetRetired, boolean orderSetMemberRetired) { OrderSet orderSet = new OrderSet(); orderSet.setName("Test Order Set"); orderSet.setDescription("Test Order Set Description"); orderSet.setOperator(OrderSet.Operator.ALL); OrderSetMember orderSetMember = new OrderSetMember(); orderSetMember.setOrderType(orderService.getOrderType(100)); orderSetMember.setConcept(conceptService.getConcept(1000)); orderSetMember.setCreator(new User(1)); orderSetMember.setDateCreated(new Date()); orderSetMember.setRetired(orderSetMemberRetired); orderSetMember.setOrderSet(orderSet); <START> List<OrderSetMember> orderSetMembers = new ArrayList<>(Arrays.asList(orderSetMember)); <END> orderSet.setOrderSetMembers(orderSetMembers); orderSet.setCreator(new User(1)); orderSet.setDateCreated(new Date()); orderSet.setRetired(orderSetRetired); return orderSet; }</code><technical_language>intentionally change this Collections.singletonList</technical_language>

Target:
private OrderSet orderSetBuilder(boolean orderSetRetired, boolean orderSetMemberRetired) { OrderSet orderSet = new OrderSet(); orderSet.setName("Test Order Set"); orderSet.setDescription("Test Order Set Description"); orderSet.setOperator(OrderSet.Operator.ALL); OrderSetMember orderSetMember = new OrderSetMember(); orderSetMember.setOrderType(orderService.getOrderType(100)); orderSetMember.setConcept(conceptService.getConcept(1000)); orderSetMember.setCreator(new User(1)); orderSetMember.setDateCreated(new Date()); orderSetMember.setRetired(orderSetMemberRetired); orderSetMember.setOrderSet(orderSet); List<OrderSetMember> orderSetMembers = new ArrayList<>(Collections.singletonList(orderSetMember)); orderSet.setOrderSetMembers(orderSetMembers); orderSet.setCreator(new User(1)); orderSet.setDateCreated(new Date()); orderSet.setRetired(orderSetRetired); return orderSet; }
Source:
<code>public void testBounds() { int low = fCondition.min(); <START> assertEquals(LOW, low); <END> int high = fCondition.max(); assertEquals(HIGH, high); }</code><technical_language>assertEquals(LOW, fCondition.min());</technical_language>

Target:
public void testBounds() { assertEquals(LOW, (int) fCondition.min()); assertEquals(HIGH, (int) fCondition.max()); }
Source:
<code><START> public void testCreateTableWithDefaultCFProperties() throws Exception { <END> String tableName = generateUniqueName(); String schemaName = generateUniqueName(); String properties = "KEEP_DELETED_CELLS=TRUE, TTL=1209600, IMMUTABLE_STORAGE_SCHEME=ONE_CELL_PER_COLUMN, REPLICATION_SCOPE=1, DEFAULT_COLUMN_FAMILY=cv"; String pTableFullName = SchemaUtil.getQualifiedTableName(schemaName, tableName); String query = "create table " + pTableFullName + "(a_char CHAR(15) NOT NULL, " + "b_char CHAR(10) NOT NULL, " + "\"av\".\"_\" CHAR(1), " + "\"bv\".\"_\" CHAR(1), " + "\"cv\".\"_\" CHAR(1), " + "\"dv\".\"_\" CHAR(1) CONSTRAINT PK PRIMARY KEY (a_char, b_char)) " + properties; List<String> queries = new ArrayList<String>(){}; queries.add(query); String result = runSchemaExtractionTool(schemaName, tableName, null, queries); Assert.assertTrue(compareProperties(properties, getProperties(result))); }</code><technical_language>this clubbed is extra property here</technical_language>

Target:
public void testCreateTableWithDefaultCFProperties() throws Exception { String tableName = generateUniqueName(); String schemaName = generateUniqueName(); String properties = "KEEP_DELETED_CELLS=TRUE, TTL=1209600, IMMUTABLE_STORAGE_SCHEME=ONE_CELL_PER_COLUMN, REPLICATION_SCOPE=1, DEFAULT_COLUMN_FAMILY=cv, SALT_BUCKETS=16, MULTI_TENANT=true"; String pTableFullName = SchemaUtil.getQualifiedTableName(schemaName, tableName); String query = "create table " + pTableFullName + "(a_char CHAR(15) NOT NULL, " + "b_char CHAR(10) NOT NULL, " + "\"av\".\"_\" CHAR(1), " + "\"bv\".\"_\" CHAR(1), " + "\"cv\".\"_\" CHAR(1), " + "\"dv\".\"_\" CHAR(1) CONSTRAINT PK PRIMARY KEY (a_char, b_char)) " + properties; List<String> queries = new ArrayList<String>(){}; queries.add(query); String result = runSchemaExtractionTool(schemaName, tableName, null, queries); Assert.assertTrue(compareProperties(properties, getProperties(result))); }
Source:
<code>public Thing createThing(ThingTypeUID thingTypeUID, Configuration configuration, ThingUID thingUID, ThingUID bridgeUID) { if (BridgeHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { ThingUID dSSUID = getBridgeThingUID(thingTypeUID, thingUID, configuration); if (dSSUID != null) { <START> logger.info("{}", dSSUID.toString()); <END> return super.createThing(thingTypeUID, configuration, dSSUID, null); } else { logger.error("Can't generate thing UID for thing type {}" + ", because digitalSTROM-Server is not reachable. Please check these points:\n" + "Are the server address and portnumber correct?\n" + "Is the server turned on?\n" + "Is the network configured correctly?", thingTypeUID); return null; } } if (DeviceHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { ThingUID dsDeviceUID = getDeviceUID(thingTypeUID, thingUID, configuration, bridgeUID); return super.createThing(thingTypeUID, configuration, dsDeviceUID, bridgeUID); } if (SceneHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { ThingUID dsSceneUID = getSceneUID(thingTypeUID, thingUID, configuration, bridgeUID); return super.createThing(thingTypeUID, configuration, dsSceneUID, bridgeUID); } throw new IllegalArgumentException( "The thing type " + thingTypeUID + " is not supported by the digitalSTROM binding."); }</code><technical_language>remove toString()</technical_language>

Target:
public Thing createThing(ThingTypeUID thingTypeUID, Configuration configuration, ThingUID thingUID, ThingUID bridgeUID) { if (BridgeHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { ThingUID dSSUID = getBridgeThingUID(thingTypeUID, thingUID, configuration); if (dSSUID != null) { logger.info("{}", dSSUID); return super.createThing(thingTypeUID, configuration, dSSUID, null); } else { logger.error("Can't generate thing UID for thing type {}" + ", because digitalSTROM-Server is not reachable. Please check these points:\n" + "Are the server address and portnumber correct?\n" + "Is the server turned on?\n" + "Is the network configured correctly?", thingTypeUID); return null; } } if (DeviceHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { ThingUID dsDeviceUID = getDeviceUID(thingTypeUID, thingUID, configuration, bridgeUID); return super.createThing(thingTypeUID, configuration, dsDeviceUID, bridgeUID); } if (SceneHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) { ThingUID dsSceneUID = getSceneUID(thingTypeUID, thingUID, configuration, bridgeUID); return super.createThing(thingTypeUID, configuration, dsSceneUID, bridgeUID); } throw new IllegalArgumentException( "The thing type " + thingTypeUID + " is not supported by the digitalSTROM binding."); }