auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void defersToIndividualStepsIfStartTransactionNotAvailable() { givenServerThrows404sOnStartTransaction(); <START> whenStandardClientStartsTransactionNTimes(1); <END> thenStartTransactionIsCalledNTimes(1); thenIndividualEndpointsAreCalledNTimes(1); thenNoCallsFailed(); }</code><technical_language>nit: method name is awkward, whenStandardClientStartsTransactionTimes? for subsequent methods</technical_language>

Target:
public void defersToIndividualStepsIfStartTransactionNotAvailable() { givenServerThrows404sOnStartTransaction(); whenStandardClientStartsTransactionTimes(1); thenStartTransactionIsCalledTimes(1); thenIndividualEndpointsAreCalledTimes(1); thenNoCallsFailed(); }
Source:
<code>private void makeNode(Node node) { nodes.append(" "); nodes.append(node.hashCode()); nodes.append(" ["); <START> nodes.append("label=\"" + node.toString().replace("\"", "\\\"") + "\n" + node.getLocation().toString().replace("\"", "\\\"") + "\" "); <END> nodes.append("color=\"" + describeColor(node.getColor()) + "\" ");; nodes.append("fillcolor=\"" + describeColor(node.getColor().brighter().brighter()) + "\""); nodes.append("];\n"); }</code><technical_language>I turned this a String.valueOf in master</technical_language>

Target:
private void makeNode(Node node) { nodes.append(" "); nodes.append(node.hashCode()); nodes.append(" ["); String label = node.toString() + "\n" + node.getLocation().toString(); nodes.append("label=\"" + label.replace("\"", "\\\"").replace("\\", "\\\\") + "\" "); nodes.append("color=\"" + describeColor(node.getColor()) + "\" ");; nodes.append("fillcolor=\"" + describeColor(node.getColor().brighter().brighter()) + "\""); nodes.append("];\n"); }
Source:
<code>static NetworkConfiguration createNetworkConfiguration(){ AzureTokenCredentials token = new ApplicationTokenCredentials( System.getenv("CLIENT_ID"), "72f988bf-86f1-41af-91ab-2d7cd011db47", System.getenv("APPLICATION_SECRET"), AzureEnvironment.AZURE); Azure azure = Azure.authenticate(token).withSubscription(System.getenv("AZURE_BATCH_SUBSCRIPTION_ID")); String vnetName = "AzureBatchTestVnet"; String subnetName = "AzureBatchTestSubnet"; if (azure.networks().list().size() == 0) { Network virtualNetwork = azure.networks().define(vnetName) .withRegion("westcentralus") .withExistingResourceGroup("sdktest2") .withAddressSpace("192.168.0.0/16") .withSubnet(subnetName, "192.168.1.0/24") .create(); } String vNetResourceId = String.format( "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s/subnets/%s", <START> System.getenv("677f962b-9abf-4423-a27b-0c2f4094dcec"), <END> "sdktest2", vnetName, subnetName); return new NetworkConfiguration().withSubnetId(vNetResourceId); }</code><technical_language>need remove System.getEnv here</technical_language>

Target:
static NetworkConfiguration createNetworkConfiguration(){ String vnetName = "AzureBatchTestVnet"; String subnetName = "AzureBatchTestSubnet"; if(isRecordMode()) { AzureTokenCredentials token = new ApplicationTokenCredentials( System.getenv("CLIENT_ID"), "72f988bf-86f1-41af-91ab-2d7cd011db47", System.getenv("APPLICATION_SECRET"), AzureEnvironment.AZURE); Azure azure = Azure.authenticate(token).withSubscription("677f962b-9abf-4423-a27b-0c2f4094dcec"); if (azure.networks().list().size() == 0) { Network virtualNetwork = azure.networks().define(vnetName) .withRegion("westcentralus") .withExistingResourceGroup("sdktest2") .withAddressSpace("192.168.0.0/16") .withSubnet(subnetName, "192.168.1.0/24") .create(); } } String vNetResourceId = String.format( "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s/subnets/%s", "677f962b-9abf-4423-a27b-0c2f4094dcec", "sdktest2", vnetName, subnetName); return new NetworkConfiguration().withSubnetId(vNetResourceId); }
Source:
<code>private long getCacheScopeSizeInBytes(long cacheScopeIdentifier) { <START> long sum = 0; <END> for (Path path : cacheScopeFiles.get(cacheScopeIdentifier)) { CacheRange cacheRange = persistedRanges.get(path); Lock readLock = cacheRange.getLock().readLock(); readLock.lock(); try { for (Range<Long> range : cacheRange.getRange().asDescendingMapOfRanges().keySet()) { sum += range.upperEndpoint() - range.lowerEndpoint(); } } finally { readLock.unlock(); } } return sum; }</code><technical_language>bytes</technical_language>

Target:
private long getCacheScopeSizeInBytes(long cacheScopeIdentifier) { long bytes = 0; for (Path path : cacheScopeFiles.get(cacheScopeIdentifier)) { CacheRange cacheRange = persistedRanges.get(path); Lock readLock = cacheRange.getLock().readLock(); readLock.lock(); try { for (Range<Long> range : cacheRange.getRange().asDescendingMapOfRanges().keySet()) { bytes += range.upperEndpoint() - range.lowerEndpoint(); } } finally { readLock.unlock(); } } return bytes; }
Source:
<code>protected void next(String email) { if (!NetworkUtils.checkConnection(getActivity())) { return; } if (isValidEmail(email)) { clearEmailError(); startProgress(); mRequestedEmail = email; mDispatcher.dispatch(AccountActionBuilder.newIsAvailableEmailAction(email)); <START> mAnalyticsListener.trackEmailFilled(); <END> } else { showEmailError(R.string.email_invalid); } }</code><technical_language>tracking this event user taps next button email is valid, call "email filled", misinterpreted user filling in email input. sense you? honest, need this event. idea here</technical_language>

Target:
protected void next(String email) { if (!NetworkUtils.checkConnection(getActivity())) { return; } if (isValidEmail(email)) { clearEmailError(); startProgress(); mRequestedEmail = email; mDispatcher.dispatch(AccountActionBuilder.newIsAvailableEmailAction(email)); } else { showEmailError(R.string.email_invalid); } }
Source:
<code>protected static String calculateMethodCanonicalName(Class<?> methodClass, String methodName) { StringBuilder result = new StringBuilder(); Set<Method> methods = ClassHelper.getAvailableMethods(methodClass); <START> methods.stream() <END> .filter(method -> methodName.equals(method.getName())) .findFirst() .ifPresent(method -> result.append(calculateMethodCanonicalName(method))); return result.length() == 0 ? null : result.toString(); }</code><technical_language>Try java return methods.stream() .filter(method -> methodName.equals(method.getName())) .findFirst() .ifPresent(method -> calculateMethodCanonicalName(method)) // calculateMethodCanonicalName return null .orElse(null);</technical_language>

Target:
protected static String calculateMethodCanonicalName(Class<?> methodClass, String methodName) { Set<Method> methods = ClassHelper.getAvailableMethods(methodClass); return methods.stream() .filter(method -> methodName.equals(method.getName())) .findFirst() .map(MethodHelper::calculateMethodCanonicalName) .orElse(null); }
Source:
<code>private void updateConnectionMapForFiberChannel(Set<StorageDomainStatus> statuses) { if (FeatureSupported.refreshLunSupported(getStoragePool().getCompatibilityVersion())) { List<StorageDomain> storageDomainList = getStorageDomainDao().getAllForStoragePool(getStoragePool().getId()); for (StorageDomain sd : storageDomainList) { <START> if ((sd.getStorageType() == StorageType.FCP) && statuses.contains(sd.getStatus())) { <END> MultiValueMapUtils.addToMap(StorageType.FCP, FCPStorageHelper.getFCPConnection(), getConnectionsTypeMap()); break; } } } }</code><technical_language>remove redundant brackets</technical_language>

Target:
private void updateConnectionMapForFiberChannel(Set<StorageDomainStatus> statuses) { if (FeatureSupported.refreshLunSupported(getStoragePool().getCompatibilityVersion())) { List<StorageDomain> storageDomainList = getStorageDomainDao().getAllForStoragePool(getStoragePool().getId()); for (StorageDomain sd : storageDomainList) { if (sd.getStorageType() == StorageType.FCP && statuses.contains(sd.getStatus())) { MultiValueMapUtils.addToMap(StorageType.FCP, FCPStorageHelper.getFCPConnection(), getConnectionsTypeMap()); break; } } } }
Source:
<code>public Mono<Instant> renewMessageLock(ServiceBusReceivedMessage messageForLockRenew) { return renewMessageLock(new ServiceBusReceivedMessage[]{messageForLockRenew}) <START> .elementAt(0) <END> .publishOn(scheduler); }</code><technical_language>element at? forcing another scheduler</technical_language>

Target:
public Mono<Instant> renewMessageLock(ServiceBusReceivedMessage messageForLockRenew) { return renewMessageLock(new ServiceBusReceivedMessage[]{messageForLockRenew}) .last() .publishOn(scheduler); }
Source:
<code>private Field getField(ConstraintViolation<?> firstException) { Class<?> leafBean = firstException.getLeafBean().getClass(); <START> String fieldName = getLastElementOfPath(firstException.getPropertyPath()); <END> try { return leafBean.getField(fieldName); } catch (NoSuchFieldException e) { LOGGER.error(String.format("Field %s does not exist on class %s", fieldName, leafBean.toString())); throw new WebApplicationException(e); } }</code><technical_language>Purely unfamiliarity javax.validation API. is element of path first</technical_language>

Target:
private Field getField(ConstraintViolation<?> firstException) { Class<?> leafBean = firstException.getLeafBean().getClass(); String fieldName = getFieldNameFromPath(firstException.getPropertyPath()); try { return leafBean.getField(fieldName); } catch (NoSuchFieldException e) { LOGGER.error(String.format("Cannot process violation exception. " + "Field %s does not exist or is not public on class %s", fieldName, leafBean.toString())); throw new WebApplicationException(e); } }
Source:
<code>public void addLinks(String sourceId, List<String> targetIds, Session session) throws DirectoryException { if (readOnly) { return; } checkDualReference(); <START> dualReference.addLinks(sourceId, targetIds, session); <END> }</code><technical_language>this addLinks(targetIds, sourceId, session)? need symmetrical addLinks(List<String> sourceIds, String targetId, Session session) method in Reference interface too, no</technical_language>

Target:
public void addLinks(String sourceId, List<String> targetIds, Session session) throws DirectoryException { if (readOnly) { return; } checkDualReference(); dualReference.addLinks(targetIds, sourceId, session); }
Source:
<code>private static String ipBytesToString(ByteBuf header, int addressLen) { StringBuilder sb = new StringBuilder(); final int ipv4Len = 4; final int ipv6Len = 8; if (addressLen == ipv4Len) { for (int i = 0; i < ipv4Len; i++) { sb.append(header.readByte() & 0xff); sb.append('.'); } sb.setLength(sb.length() - 1); } else { for (int i = 0; i < ipv6Len; i++) { sb.append(Integer.toHexString(header.readUnsignedShort())); sb.append(':'); } <START> sb.setLength(sb.length() - 1); <END> } return sb.toString(); }</code><technical_language>nit... move this out of this block remove code above</technical_language>

Target:
private static String ipBytesToString(ByteBuf header, int addressLen) { StringBuilder sb = new StringBuilder(); final int ipv4Len = 4; final int ipv6Len = 8; if (addressLen == ipv4Len) { for (int i = 0; i < ipv4Len; i++) { sb.append(header.readByte() & 0xff); sb.append('.'); } } else { for (int i = 0; i < ipv6Len; i++) { sb.append(Integer.toHexString(header.readUnsignedShort())); sb.append(':'); } } sb.setLength(sb.length() - 1); return sb.toString(); }
Source:
<code>public static <C extends RdfCloudTripleStoreConfiguration> RyaQueryEngine<C> getQueryEngine(RdfCloudTripleStoreConfiguration conf) { if(conf instanceof AccumuloRdfConfiguration) { AccumuloRdfConfiguration aConf = (AccumuloRdfConfiguration) conf; Instance instance; String instanceName = aConf.get("sc.cloudbase.instancename"); String user = aConf.get("sc.cloudbase.username"); String password = aConf.get("sc.cloudbase.password"); if(aConf.getBoolean(".useMockInstance", false)) { instance = new MockInstance(instanceName); } else { String zookeepers = aConf.get("sc.cloudbase.zookeepers"); instance = new ZooKeeperInstance(instanceName, zookeepers); } Connector conn; try { conn = instance.getConnector(user, new PasswordToken(password)); } catch (AccumuloException | AccumuloSecurityException e) { throw new RuntimeException(e); } return (RyaQueryEngine<C>) new AccumuloRyaQueryEngine(conn, aConf); <START> } else if(conf instanceof StatefulMongoDBRdfConfiguration && conf.getBoolean("sc.useMongo", false)) { <END> StatefulMongoDBRdfConfiguration mongoConf = (StatefulMongoDBRdfConfiguration)conf; MongoDBQueryEngine mongoQueryEngine = new MongoDBQueryEngine(); mongoQueryEngine.setConf(mongoConf); return (RyaQueryEngine<C>) mongoQueryEngine; } else { throw new IllegalArgumentException("Invalid configuration type."); } }</code><technical_language>a constant for "sc.useMongo" ConfigUtils. move constant MongoDBRdfConfiguration it</technical_language>

Target:
public static <C extends RdfCloudTripleStoreConfiguration> RyaQueryEngine<C> getQueryEngine(RdfCloudTripleStoreConfiguration conf) { if(conf instanceof AccumuloRdfConfiguration) { AccumuloRdfConfiguration aConf = (AccumuloRdfConfiguration) conf; Instance instance; String instanceName = aConf.get("sc.cloudbase.instancename"); String user = aConf.get("sc.cloudbase.username"); String password = aConf.get("sc.cloudbase.password"); if(aConf.getBoolean(".useMockInstance", false)) { instance = new MockInstance(instanceName); } else { String zookeepers = aConf.get("sc.cloudbase.zookeepers"); instance = new ZooKeeperInstance(instanceName, zookeepers); } Connector conn; try { conn = instance.getConnector(user, new PasswordToken(password)); } catch (AccumuloException | AccumuloSecurityException e) { throw new RuntimeException(e); } return (RyaQueryEngine<C>) new AccumuloRyaQueryEngine(conn, aConf); } else if(conf instanceof StatefulMongoDBRdfConfiguration && ConfigUtils.getUseMongo(conf)) { StatefulMongoDBRdfConfiguration mongoConf = (StatefulMongoDBRdfConfiguration)conf; MongoDBQueryEngine mongoQueryEngine = new MongoDBQueryEngine(); mongoQueryEngine.setConf(mongoConf); return (RyaQueryEngine<C>) mongoQueryEngine; } else { throw new IllegalArgumentException("Invalid configuration type."); } }
Source:
<code>public void scalarSubQueryInClause() { <START> this.query() <END> .select(employee) .from(employee) .where( SQLExpressions .select(employee.firstname) .from(employee) .orderBy(employee.salary.asc()) .limit(1) .in(Arrays.asList("Mike", "Mary")) ) .fetch(); }</code><technical_language>assertions here, checking Exception is thrown? Improve naming, aid readability putting in try catch black, catching Exception calling fail(). test forgot assert</technical_language>

Target:
public void scalarSubQueryInClause() { SQLSerializer serializer = new SQLSerializer(Configuration.DEFAULT); serializer.handle( this.query() .from(employee) .where( SQLExpressions .select(employee.firstname) .from(employee) .orderBy(employee.salary.asc()) .limit(1) .in(Arrays.asList("Mike", "Mary")) )); expectedQuery = "(\nfrom EMPLOYEE e\n" + "where (select e.FIRSTNAME\n" + "from EMPLOYEE e\n" + "order by e.SALARY asc\n" + "limit ?) in (?, ?))"; System.out.println(">>>> " + serializer.toString()); assertEquals(expectedQuery, serializer.toString()); }
Source:
<code>private static CsvParserSettings createParserSettings(String delimiter, String lineSeparator, char quote, String emptyValue, int maxCharsPerColumn) { CsvParserSettings settings = new CsvParserSettings(); settings.getFormat().setDelimiter(delimiter); settings.getFormat().setLineSeparator(lineSeparator); settings.getFormat().setQuote(quote); settings.getFormat().setQuoteEscape(quote); settings.setEmptyValue(emptyValue); settings.setAutoConfigurationEnabled(false); <START> settings.setMaxCharsPerColumn(maxCharsPerColumn == 0 ? DEFAULT_MAX_CHARS_PER_COLUMN : maxCharsPerColumn); <END> return settings; }</code><technical_language>annotations define a default is this 0</technical_language>

Target:
private static CsvParserSettings createParserSettings(String delimiter, String lineSeparator, char quote, String emptyValue, int maxCharsPerColumn) { CsvParserSettings settings = new CsvParserSettings(); settings.getFormat().setDelimiter(delimiter); settings.getFormat().setLineSeparator(lineSeparator); settings.getFormat().setQuote(quote); settings.getFormat().setQuoteEscape(quote); settings.setEmptyValue(emptyValue); settings.setAutoConfigurationEnabled(false); Preconditions.condition(maxCharsPerColumn > 0, () -> "maxCharsPerColumn must be a positive number: " + maxCharsPerColumn); settings.setMaxCharsPerColumn(maxCharsPerColumn); return settings; }
Source:
<code>public void afterClass() { if (_store != null) { _store.close(); } <START> _baseAccessor.remove("/" + CLUSTER_NAME + "/ASSIGNMENT_METADATA", AccessOption.PERSISTENT); <END> }</code><technical_language>removing cluster deleteRecursively("/CLUSTER_NAME")</technical_language>

Target:
public void afterClass() { if (_store != null) { _store.close(); } _gSetupTool.deleteCluster(CLUSTER_NAME); }
Source:
<code>public void testDeserializeWithParamsAndLinks() throws Exception { String content = IOUtils.toString(resource("auditevents/auditEventWithParamAndLink.json")); final AuditEvent deserializedObject = json.readValue(content, AuditEvent.class); assertThat(deserializedObject.getParams(), is(not(Collections.emptyMap()))); <START> assertThat(deserializedObject.getLinks(), is(not(Collections.emptyMap()))); <END> }</code><technical_language>This check links null. I suggest Matchers.hasEntry()</technical_language>

Target:
public void testDeserializeWithParamsAndLinks() throws Exception { final AuditEvent deserializedObject = readObjectFromResource("/auditevents/auditEventWithParamAndLink.json", AuditEvent.class); assertThat(deserializedObject.getParams(), hasEntry("KEY", "VALUE")); assertThat(deserializedObject.getLinks(), hasEntry("LINK_KEY", "LINK_VALUE")); }
Source:
<code>public void testShutdownHookInvokesShutdownHookCallback() { doNothing().when(mockShutdownHookCallback).run(); clusterBasedProcessorLifecycleListener.beforeStart(); clusterBasedProcessorLifecycleListener.getShutdownHookThread().run(); <START> clusterBasedProcessorLifecycleListener.afterStop(); <END> Mockito.verify(mockShutdownHookCallback).run(); }</code><technical_language>clarify, this is address line waiting timeout? <LINK_0></technical_language>

Target:
public void testShutdownHookInvokesShutdownHookCallback() { doAnswer(invocation -> { clusterBasedProcessorLifecycleListener.afterStop(); return null; }).when(mockShutdownHookCallback).run(); clusterBasedProcessorLifecycleListener.beforeStart(); clusterBasedProcessorLifecycleListener.getShutdownHookThread().run(); Mockito.verify(mockShutdownHookCallback).run(); }
Source:
<code>public RecordWriter<byte[],Either<Exception, KVPair>> getRecordWriter(TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException { try { if (outputCommitter == null) getOutputCommitter(taskAttemptContext); <START> assert taskAttemptContext != null && taskAttemptContext.getConfiguration() != null:"configuration passed in is null"; <END> DataSetWriterBuilder tableWriter =TableWriterUtils.deserializeTableWriter(taskAttemptContext.getConfiguration()); TxnView childTxn = outputCommitter.getChildTransaction(taskAttemptContext.getTaskAttemptID()); if (childTxn == null) throw new IOException("child transaction lookup failed"); tableWriter.txn(childTxn); return new HTableRecordWriter(tableWriter.buildTableWriter(), outputCommitter); } catch (Exception e) { throw new IOException(e); } }</code><technical_language>this assertion moved call of getOutputCommitter()</technical_language>

Target:
public RecordWriter<byte[],Either<Exception, KVPair>> getRecordWriter(TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException { try { assert taskAttemptContext != null && taskAttemptContext.getConfiguration() != null:"configuration passed in is null"; if (outputCommitter == null) getOutputCommitter(taskAttemptContext); DataSetWriterBuilder tableWriter =TableWriterUtils.deserializeTableWriter(taskAttemptContext.getConfiguration()); TxnView childTxn = outputCommitter.getChildTransaction(taskAttemptContext.getTaskAttemptID()); if (childTxn == null) throw new IOException("child transaction lookup failed"); tableWriter.txn(childTxn); return new HTableRecordWriter(tableWriter.buildTableWriter(), outputCommitter); } catch (Exception e) { throw new IOException(e); } }
Source:
<code>protected String createSqlStatement() { final Table table = getTable(); final FromItem fromItem = new FromItem(table); final String tableLabel = _queryRewriter.rewriteFromItem(fromItem); if (table.getType() != null && table.getType() == TableType.VIEW) { <START> return "DROP VIEW " + tableLabel; <END> } else { return "DROP TABLE " + tableLabel; } }</code><technical_language>I if simply this: TableType type = table.getType() == null ? TableType.TABLE : table.getType(); return "DROP " + type + " " + tableLabel; Oh, I rename tableLabel qualifiedTableName something</technical_language>

Target:
protected String createSqlStatement() { final Table table = getTable(); final FromItem fromItem = new FromItem(table); final String qualifiedTableName = _queryRewriter.rewriteFromItem(fromItem); if (table.getType() != null && table.getType() == TableType.VIEW) { return "DROP VIEW " + qualifiedTableName; } else { return "DROP TABLE " + qualifiedTableName; } }
Source:
<code>public void onActivate(ActivateEvent event, EntityRef entity) { blockFactory = new BlockItemFactory(entityManager); <START> inventoryManager = new InventoryAuthoritySystem(); <END> EntityRef flagTaker = event.getInstigator(); if (!playerTeamMatchesFlagTeam(entity, flagTaker)) { giveFlagToPlayer(entity, flagTaker); attachParticleEmitterToPlayer(flagTaker); } }</code><technical_language>I doubt if inventoryManager needs initialisation injected</technical_language>

Target:
public void onActivate(ActivateEvent event, EntityRef entity) { EntityRef flagTaker = event.getInstigator(); if (!playerTeamMatchesFlagTeam(entity, flagTaker)) { giveFlagToPlayer(entity, flagTaker); } }
Source:
<code>protected Command doRun(Task task, Map<String, String> prefs) throws PackageException { if (!file.exists()) { log.warn("Can't deploy file " + file + ". File is missing."); return null; } ReloadService srv = Framework.getLocalService(ReloadService.class); boolean useFormerReload = Framework.isBooleanPropertyTrue(ReloadService.USE_FORMER_HOT_RELOAD); if (useFormerReload) { return doFormerRun(srv); } if (file.isDirectory()) { return _deployDirectory(file, srv); } <START> return _deployFile(file, srv); <END> }</code><technical_language>else for symmetry</technical_language>

Target:
protected Command doRun(Task task, Map<String, String> prefs) throws PackageException { if (!file.exists()) { log.warn("Can't deploy file " + file + ". File is missing."); return null; } ReloadService srv = Framework.getLocalService(ReloadService.class); boolean useCompatReload = Framework.isBooleanPropertyTrue(ReloadService.USE_COMPAT_HOT_RELOAD); if (useCompatReload) { return doCompatRun(srv); } if (file.isDirectory()) { return _deployDirectory(file, srv); } else { return _deployFile(file, srv); } }
Source:
<code>private String getCapsFilePath() { String filePath = appiumDriverManager.getCapsPath(); if (new File(filePath).exists()) { Path path = FileSystems.getDefault().getPath(filePath); if (!path.getParent().isAbsolute()) { filePath = path.normalize() .toAbsolutePath().toString(); } return filePath; } else { System.out.println("Capability file not found"); <START> return null; <END> } }</code><technical_language>good. throw exception instead of returning null</technical_language>

Target:
private String getCapsFilePath() throws FileNotFoundException { String filePath = appiumDriverManager.getCapsPath(); if (new File(filePath).exists()) { Path path = FileSystems.getDefault().getPath(filePath); if (!path.getParent().isAbsolute()) { filePath = path.normalize() .toAbsolutePath().toString(); } return filePath; } else { throw new FileNotFoundException("Capability file not found"); } }
Source:
<code>public <E extends Enum<E>> List<E> validateEnums(Class<E> clz, List<String> names) { ArrayList<E> enumList = new ArrayList<E>(); String reason = localize(Messages.INVALID_ENUM_REASON); String detail = localize(Messages.INVALID_ENUM_DETAIL); for (String name : names) { <START> enumList.add(EnumValidator.validateEnum(reason, detail, clz, name)); <END> } return enumList; }</code><technical_language>simply call BaseBackendResource.validateEnum(Class<E> clz, String name)? (instead of EnumValidator.validateEnum(reason, detail, clz, name), this maintain localization in places)</technical_language>

Target:
public <E extends Enum<E>> List<E> validateEnums(Class<E> clz, List<String> names) { ArrayList<E> enumList = new ArrayList<E>(); for (String name : names) { enumList.add(validateEnum(clz, name)); } return enumList; }
Source:
<code>private boolean onResetPinEntry(String pin) { <START> if (!mDefaultLogic) return false; <END> clearPin(); switch (mCurrentResetStep) { case RESET_STEP_YOUR: if (PinManager.get().isRealPin(pin)) { mCurrentResetStep++; showResetText(); return true; } else { return false; } case RESET_STEP_FIRST: mResettingPin = pin; mCurrentResetStep++; showResetText(); return true; case RESET_STEP_SECOND: if (pin.equals(mResettingPin)) { PinManager.get().setRealPin(pin); mCurrentResetStep++; showResetText(); return true; } else { return false; } case RESET_STEP_DONE: if (PinManager.get().isRealPin(pin)) { mCurrentResetStep++; showResetText(); return true; } else { return false; } case RESET_STEP_SPAM: if (PinManager.get().isRealPin(pin)) { showResetText(); return true; } else { return false; } } return false; }</code><technical_language>Run formatter</technical_language>

Target:
private boolean onResetPinEntry(String pin) { if (!mDefaultLogic) { return false; } clearPin(); switch (mCurrentResetStep) { case RESET_STEP_YOUR: if (PinManager.get().isRealPin(pin)) { mCurrentResetStep++; showResetText(); return true; } else { return false; } case RESET_STEP_FIRST: mResettingPin = pin; mCurrentResetStep++; showResetText(); return true; case RESET_STEP_SECOND: if (pin.equals(mResettingPin)) { PinManager.get().setRealPin(pin); mCurrentResetStep++; showResetText(); return true; } else { return false; } case RESET_STEP_DONE: if (PinManager.get().isRealPin(pin)) { mCurrentResetStep++; showResetText(); return true; } else { return false; } case RESET_STEP_SPAM: if (PinManager.get().isRealPin(pin)) { showResetText(); return true; } else { return false; } } return false; }
Source:
<code>private void onPreview() { Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } VM vm = getEntity(); SnapshotModel snapshotModel = (SnapshotModel) getWindow(); boolean memory = false; List<DiskImage> disks; Set<Guid> diskImages = null; if (snapshotModel.isShowPartialSnapshotWarning()) { switch (snapshotModel.getPartialPreviewSnapshotOptions().getSelectedItem()) { case preserveActiveDisks: disks = snapshotModel.getDisks(); disks.addAll(imagesSubtract(getVmDisks(), disks)); <START> diskImages = <END> disks.stream().map(DiskImage::getImageId).collect(Collectors.toSet()); break; case excludeActiveDisks: break; case openCustomPreviewDialog: setWindow(null); getCustomPreviewCommand().execute(); return; } } if (snapshotModel.isShowMemorySnapshotWarning()) { memory = snapshotModel.getMemory().getEntity(); } runTryBackToAllSnapshotsOfVm(snapshotModel, vm, snapshot, memory, diskImages); }</code><technical_language>call 'disksIds'</technical_language>

Target:
private void onPreview() { Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } VM vm = getEntity(); SnapshotModel snapshotModel = (SnapshotModel) getWindow(); boolean memory = false; List<DiskImage> disks; Set<Guid> diskIds = null; if (snapshotModel.isShowPartialSnapshotWarning()) { switch (snapshotModel.getPartialPreviewSnapshotOptions().getSelectedItem()) { case preserveActiveDisks: disks = snapshotModel.getDisks(); disks.addAll(imagesSubtract(getVmDisks(), disks)); diskIds = disks.stream().map(DiskImage::getImageId).collect(Collectors.toSet()); break; case excludeActiveDisks: break; case openCustomPreviewDialog: setWindow(null); getCustomPreviewCommand().execute(); return; } } if (snapshotModel.isShowMemorySnapshotWarning()) { memory = snapshotModel.getMemory().getEntity(); } runTryBackToAllSnapshotsOfVm(snapshotModel, vm, snapshot, memory, diskIds); }
Source:
<code>public void testThreadLeakWhenClientCanNotConstructDueToNoMemberDiscoveryStrategyConfig() { ClientConfig config = new ClientConfig(); config.getNetworkConfig().getDiscoveryConfig().addDiscoveryStrategyConfig( new DiscoveryStrategyConfig(new ClientDiscoverySpiTest.NoMemberDiscoveryStrategyFactory(), Collections.<String, Comparable>emptyMap())); HazelcastClient.newHazelcastClient(config); <START> Assert.fail(); <END> }</code><technical_language>This statement is superfluous. 'expected = ', Junit framework fail this test if exit expected exception</technical_language>

Target:
public void testThreadLeakWhenClientCanNotConstructDueToNoMemberDiscoveryStrategyConfig() { ClientConfig config = new ClientConfig(); config.getNetworkConfig().getDiscoveryConfig().addDiscoveryStrategyConfig( new DiscoveryStrategyConfig(new ClientDiscoverySpiTest.NoMemberDiscoveryStrategyFactory(), Collections.<String, Comparable>emptyMap())); Set<Thread> testStartThreads = getThreads(); try { HazelcastClient.newHazelcastClient(config); } finally { assertHazelcastThreadShutdown(testStartThreads); } }
Source:
<code>private List<VulnerabilityDTO> getDtosFromRelations(List<ReleaseVulnerabilityRelation> relations, User user) { Set<String> vulnerabilityIds = relations.stream() .map(ReleaseVulnerabilityRelation::getVulnerabilityId) .collect(Collectors.toSet()); List<Vulnerability> vulnerabilities = dbHandler.getByIds(Vulnerability.class, vulnerabilityIds); <START> Map<String, Vulnerability> vulnerabilityMap = vulnerabilities.stream() <END> .collect(Collectors.toMap(Vulnerability::getId, Function.identity())); LoadingCache<String, Release> releaseCache = makeReleaseCache(user); LoadingCache<String, Component> componentCache = makeComponentCache(user); return relations.stream() .map(relation -> getDtoFromRelation(relation, vulnerabilityMap.get(relation.getVulnerabilityId()))) .map(dto -> enrichVulnerabilityDTO(dto, componentCache, releaseCache)) .collect(Collectors.toList()); }</code><technical_language>I this ThriftUtils.getIdMap()</technical_language>

Target:
private List<VulnerabilityDTO> getDtosFromRelations(List<ReleaseVulnerabilityRelation> relations, User user) { Set<String> vulnerabilityIds = relations.stream() .map(ReleaseVulnerabilityRelation::getVulnerabilityId) .collect(Collectors.toSet()); List<Vulnerability> vulnerabilities = dbHandler.getByIds(Vulnerability.class, vulnerabilityIds); Map<String, Vulnerability> vulnerabilityMap= ThriftUtils.getIdMap(vulnerabilities); LoadingCache<String, Release> releaseCache = makeReleaseCache(user); LoadingCache<String, Component> componentCache = makeComponentCache(user); return relations.stream() .map(relation -> getDtoFromRelation(relation, vulnerabilityMap.get(relation.getVulnerabilityId()))) .map(dto -> enrichVulnerabilityDTO(dto, componentCache, releaseCache)) .collect(Collectors.toList()); }
Source:
<code>private void process(final DuplicateSet set) { if (nextSetsIterator.hasNext()) { throw new PicardException("nextSetsIterator is expected to be empty, but already contains data."); } final UmiGraph umiGraph = new UmiGraph(set, umiTag, inferredUmiTag, allowMissingUmis); List<DuplicateSet> duplicateSets = umiGraph.joinUmisIntoDuplicateSets(maxEditDistanceToJoin); <START> <END> for (DuplicateSet ds : duplicateSets) { List<SAMRecord> records = ds.getRecords(); SAMRecord representativeRead = ds.getRepresentative(); String inferredUmi = representativeRead.getStringAttribute(inferredUmiTag); for (SAMRecord rec : records) { String currentUmi = UmiUtil.sanitizeUMI(rec, umiTag); if (currentUmi != null) { if (currentUmi.contains("N")) { metrics.addUmiObservationN(); } else { if (!haveWeSeenFirstRead) { metrics.MEAN_UMI_LENGTH = currentUmi.length(); haveWeSeenFirstRead = true; } else { if (metrics.MEAN_UMI_LENGTH != currentUmi.length()) { throw new PicardException("UMIs of differing lengths were found."); } } metrics.OBSERVED_BASE_ERRORS += hammingDistance(currentUmi, inferredUmi); observedUmiBases += currentUmi.length(); metrics.addUmiObservation(currentUmi, inferredUmi); } } } } metrics.DUPLICATE_SETS_WITH_UMI += duplicateSets.size(); metrics.DUPLICATE_SETS_IGNORING_UMI++; nextSetsIterator = duplicateSets.iterator(); }</code><technical_language>Remove lines of whitespace</technical_language>

Target:
private void process(final DuplicateSet set) { if (nextSetsIterator.hasNext()) { throw new PicardException("nextSetsIterator is expected to be empty, but already contains data."); } final UmiGraph umiGraph = new UmiGraph(set, umiTag, inferredUmiTag, allowMissingUmis); List<DuplicateSet> duplicateSets = umiGraph.joinUmisIntoDuplicateSets(maxEditDistanceToJoin); for (DuplicateSet ds : duplicateSets) { List<SAMRecord> records = ds.getRecords(); SAMRecord representativeRead = ds.getRepresentative(); String inferredUmi = representativeRead.getStringAttribute(inferredUmiTag); for (SAMRecord rec : records) { String currentUmi = UmiUtil.getSanitizedUMI(rec, umiTag); if (currentUmi != null) { if (currentUmi.contains("N")) { metrics.addUmiObservationN(); } else { if (!haveWeSeenFirstRead) { metrics.MEAN_UMI_LENGTH = currentUmi.length(); haveWeSeenFirstRead = true; } else { if (metrics.MEAN_UMI_LENGTH != currentUmi.length()) { throw new PicardException("UMIs of differing lengths were found."); } } metrics.OBSERVED_BASE_ERRORS += hammingDistance(currentUmi, inferredUmi); observedUmiBases += currentUmi.length(); metrics.addUmiObservation(currentUmi, inferredUmi); } } } } metrics.DUPLICATE_SETS_WITH_UMI += duplicateSets.size(); metrics.DUPLICATE_SETS_IGNORING_UMI++; nextSetsIterator = duplicateSets.iterator(); }
Source:
<code>public void append(K key, V value) { int attempt = 0; boolean success = false; while(!success) { RootReference rootReference = getRoot(); if (rootReference.appendCounter >= keysPerPage) { rootReference = flushAppendBuffer(rootReference); assert rootReference.appendCounter < keysPerPage; } keysBuffer[rootReference.appendCounter] = key; <START> valuesBuffer[rootReference.appendCounter] = value; <END> RootReference updatedRootReference = new RootReference(rootReference, (byte) (rootReference.appendCounter + 1), ++attempt); success = root.compareAndSet(rootReference, updatedRootReference); } }</code><technical_language>I protection concurrent execution of MVMap.append() if MVStore is itself. MVMap implements ConcurrentMap expected public methods, including non-standard ones, thread-safe. H2 session locked, however</technical_language>

Target:
public void append(K key, V value) { int attempt = 0; boolean success = false; while(!success) { RootReference rootReference = getRoot(); int appendCounter = rootReference.getAppendCounter(); if (appendCounter >= keysPerPage) { rootReference = flushAppendBuffer(rootReference); appendCounter = rootReference.getAppendCounter(); assert appendCounter < keysPerPage; } keysBuffer[appendCounter] = key; valuesBuffer[appendCounter] = value; RootReference updatedRootReference = new RootReference(rootReference, appendCounter + 1, ++attempt); success = root.compareAndSet(rootReference, updatedRootReference); } }
Source:
<code>public void testConcat() throws DatabaseEngineException { test5Columns(); engine.persist("TEST", entry().set("COL1", 1).set("COL5", "teste") .build()); engine.persist("TEST", entry().set("COL1", 2).set("COL5", "xpto") .build()); engine.persist("TEST", entry().set("COL1", 3).set("COL5", "xpto") .build()); engine.persist("TEST", entry().set("COL1", 4).set("COL5", "teste") .build()); engine.persist("TEST", entry().set("COL1", 5).set("COL5", "pomme de terre") .build()); final Query query = select( <START> concat(k("."), <END> column("COL5"), cast(column("COL1"), STRING)).alias("concat")) .from(table("TEST")); final List<Map<String, ResultColumn>> result = engine.query(query); assertEquals("Concat must be 'teste.1'", "teste.1", result.get(0).get("concat").toString()); assertEquals("Concat must be 'xpto.2'", "xpto.2", result.get(1).get("concat").toString()); assertEquals("Concat must be 'xpto.3'", "xpto.3", result.get(2).get("concat").toString()); assertEquals("Concat must be 'teste.4'", "teste.4", result.get(3).get("concat").toString()); assertEquals("Concat must be 'pomme de terre.5'", "pomme de terre.5", result.get(4).get("concat").toString()); }</code><technical_language>try other delimiters result is consistent implementations. I suggest null, empty, a number a delimiter coming another column</technical_language>

Target:
public void testConcat() throws DatabaseEngineException { test6Columns(); engine.persist("TEST", entry().set("COL1", 1).set("COL5", "teste").set("COL6", "teste") .build()); engine.persist("TEST", entry().set("COL1", 2).set("COL5", "xpto").set("COL6", "xpto") .build()); engine.persist("TEST", entry().set("COL1", 3).set("COL5", "xpto").set("COL6", "xpto") .build()); engine.persist("TEST", entry().set("COL1", 4).set("COL5", "teste").set("COL6", "teste") .build()); engine.persist("TEST", entry().set("COL1", 5).set("COL5", "pomme de terre").set("COL6", "pomme de terre") .build()); final Query query = select( concat(k("."), column("COL5"), column("COL6")).alias("concat")) .from(table("TEST")); final List<Map<String, ResultColumn>> result = engine.query(query); assertEquals("teste.teste", result.get(0).get("concat").toString()); assertEquals("xpto.xpto", result.get(1).get("concat").toString()); assertEquals("xpto.xpto", result.get(2).get("concat").toString()); assertEquals("teste.teste", result.get(3).get("concat").toString()); assertEquals("pomme de terre.pomme de terre", result.get(4).get("concat").toString()); }
Source:
<code>public void sendMessage_success_sendsFirebaseMessage() throws FirebaseMessagingException { UUID deviceAnonymizedId = UUID.randomUUID(); String registrationToken = "token-" + UUID.randomUUID(); <START> SystemMessage message = SystemMessage.createInstance("Hi there!"); <END> setId(message, 5); service.sendMessage(deviceAnonymizedId, registrationToken, message); verify(mockFirebaseMessaging, times(1)).send(any()); verify(mockDeviceService, never()).clearFirebaseInstanceId(any()); }</code><technical_language>lines extracted a method createTestMessage</technical_language>

Target:
public void sendMessage_success_sendsFirebaseMessage() throws FirebaseMessagingException { UUID deviceAnonymizedId = UUID.randomUUID(); String registrationToken = "token-" + UUID.randomUUID(); SystemMessage message = createMessage(); service.sendMessage(deviceAnonymizedId, registrationToken, message); verify(mockFirebaseMessaging, times(1)).send(any()); verify(mockDeviceService, never()).clearFirebaseInstanceId(any()); }
Source:
<code>public void decorate(World world, Random random, Chunk source) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = flowing ? 4 + random.nextInt(120) : 10 + random.nextInt(108); Block block = world.getBlockAt(sourceX, sourceY, sourceZ); if ((block.getType() != Material.NETHERRACK && !block.isEmpty()) || block.getRelative(BlockFace.UP).getType() != Material.NETHERRACK) { return; } int netherrackBlockCount = 0; for (BlockFace face : SIDES) { <START> if (block.getRelative(face).getType() == Material.NETHERRACK) { <END> netherrackBlockCount++; } } int airBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).isEmpty()) { airBlockCount++; } } if (netherrackBlockCount == 5 || flowing && airBlockCount == 1 && netherrackBlockCount == 4) { BlockState state = block.getState(); state.setType(Material.LAVA); state.update(true); new PulseTask((GlowBlock) block, true, 1, true).startPulseTask(); } }</code><technical_language>Combine loops</technical_language>

Target:
public void decorate(World world, Random random, Chunk source) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = flowing ? 4 + random.nextInt(120) : 10 + random.nextInt(108); Block block = world.getBlockAt(sourceX, sourceY, sourceZ); if ((block.getType() != Material.NETHERRACK && !block.isEmpty()) || block.getRelative(BlockFace.UP).getType() != Material.NETHERRACK) { return; } int netherrackBlockCount = 0; int airBlockCount = 0; for (BlockFace face : SIDES) { Block neighbor = block.getRelative(face); if (neighbor.getType() == Material.NETHERRACK) { netherrackBlockCount++; } else if (neighbor.isEmpty()) { airBlockCount++; } } if (netherrackBlockCount == 5 || flowing && airBlockCount == 1 && netherrackBlockCount == 4) { BlockState state = block.getState(); state.setType(Material.LAVA); state.update(true); new PulseTask((GlowBlock) block, true, 1, true).startPulseTask(); } }
Source:
<code>public static SeekableInputStream wrap(FSDataInputStream stream) { <START> if (byteBufferReadableClass != null && h2SeekableConstructor != null && <END> byteBufferReadableClass.isInstance(stream) && supportsByteBufferReads(stream)) { try { return h2SeekableConstructor.newInstance(stream); } catch (InstantiationException e) { LOG.warn("Could not instantiate H2SeekableInputStream, falling back to byte array reads", e); return new H1SeekableInputStream(stream); } catch (IllegalAccessException e) { LOG.warn("Could not instantiate H2SeekableInputStream, falling back to byte array reads", e); return new H1SeekableInputStream(stream); } catch (InvocationTargetException e) { throw new ParquetDecodingException( "Could not instantiate H2SeekableInputStream", e.getTargetException()); } } else { return new H1SeekableInputStream(stream); } }</code><technical_language>lets wrap conditionals a method improve readability. like: private boolean useHadoop2Reads() { ... }</technical_language>

Target:
public static SeekableInputStream wrap(FSDataInputStream stream) { if (byteBufferReadableClass != null && h2SeekableConstructor != null && byteBufferReadableClass.isInstance(stream.getWrappedStream())) { try { return h2SeekableConstructor.newInstance(stream); } catch (InstantiationException e) { LOG.warn("Could not instantiate H2SeekableInputStream, falling back to byte array reads", e); return new H1SeekableInputStream(stream); } catch (IllegalAccessException e) { LOG.warn("Could not instantiate H2SeekableInputStream, falling back to byte array reads", e); return new H1SeekableInputStream(stream); } catch (InvocationTargetException e) { throw new ParquetDecodingException( "Could not instantiate H2SeekableInputStream", e.getTargetException()); } } else { return new H1SeekableInputStream(stream); } }
Source:
<code>public void afterClass() { <START> embeddedCacheManager.stop(); <END> remoteCacheManager.stop(); hotrodServer.stop(); }</code><technical_language>change order? stop in order creation. So, if create embedded cache manager server, stop server first, cache manager</technical_language>

Target:
public void afterClass() { remoteCacheManager.stop(); hotrodServer.stop(); embeddedCacheManager.stop(); }
Source:
<code>public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { IResource resource = (IResource) args[0]; IRootResource rootResource = coreModelCapability.getRootResource(resource); Class<?> apiClass = (Class<?>) args[1]; <START> Endpoint ep = (endpointSelectionStrategy != null) ? endpointSelectionStrategy.select(internalAPIProvider.getProtocols(), <END> rootResource.getEndpoints()) : new BasicEndpointSelectionStrategy().select(internalAPIProvider.getProtocols(), rootResource.getEndpoints()); if (ep == null) { String message = String.format("Unable to find any valid Endpoint from endpoints = %s and protocols = %s.", rootResource.getEndpoints(), internalAPIProvider.getProtocols()); log.error(message); throw new EndpointNotFoundException(message); } Credentials c = null; switch (args.length) { case 2: return internalAPIProvider.getClient(apiClass, ep, c); case 3: @SuppressWarnings("unchecked") CC clientConfiguration1 = (CC) args[2]; return internalAPIProvider.getClient(apiClass, ep, c, clientConfiguration1); case 4: @SuppressWarnings("unchecked") CC clientConfiguration2 = (CC) args[2]; Object applicationSpecificConfiguration = args[3]; return internalAPIProvider.getClient(apiClass, ep, c, clientConfiguration2, applicationSpecificConfiguration); } throw new IllegalStateException("No mapping for method " + method); }</code><technical_language>clearer read if a variable initialized strategy for selection process, p.e. IEndpointStrategy strategy = endpointSelectionStrategy != null ? endpointSelectionStategy : new BasicEndpointSelectionStrategy() Endpoint ep = strategy = endpointSelectionStrategy.select(...)</technical_language>

Target:
public Object invoke(Object proxy, Method method, Object[] args) throws EndpointNotFoundException { IResource resource = (IResource) args[0]; IRootResource rootResource = coreModelCapability.getRootResource(resource); Class<?> apiClass = (Class<?>) args[1]; Endpoint ep = endpointSelectionStrategy.select(internalAPIProvider.getProtocols(), rootResource.getEndpoints()); if (ep == null) { String message = String.format("Unable to find any valid Endpoint from endpoints = %s and protocols = %s.", rootResource.getEndpoints(), internalAPIProvider.getProtocols()); log.error(message); throw new EndpointNotFoundException(message); } Credentials c = null; switch (args.length) { case 2: return internalAPIProvider.getClient(apiClass, ep, c); case 3: @SuppressWarnings("unchecked") CC clientConfiguration1 = (CC) args[2]; return internalAPIProvider.getClient(apiClass, ep, c, clientConfiguration1); case 4: @SuppressWarnings("unchecked") CC clientConfiguration2 = (CC) args[2]; Object applicationSpecificConfiguration = args[3]; return internalAPIProvider.getClient(apiClass, ep, c, clientConfiguration2, applicationSpecificConfiguration); } throw new IllegalStateException("No mapping for method " + method); }
Source:
<code><START> private void initSession(ActionContext actionContext) { <END> if (actionContext.getSession() == null) { actionContext.setSession(new HashMap<String, Object>()); request.setSession(new MockHttpSession(servletContext)); } }</code><technical_language>here, making methods protected allows users override them</technical_language>

Target:
protected void initSession(ActionContext actionContext) { if (actionContext.getSession() == null) { actionContext.setSession(new HashMap<String, Object>()); request.setSession(new MockHttpSession(servletContext)); } }
Source:
<code>public ContentType getContentType() { final ContentType contentType; try { contentType = APILocator.getContentTypeAPI(APILocator.systemUser()).find(contentTypeId); return contentType; <START> } catch (final DotSecurityException e) { <END> Logger.error(this, String.format("An error occurred when returning the Content Type associated to " + "Contentlet '%s'", this.getIdentifier())); } catch (final DotDataException e) { Logger.error(this, String.format("An error occurred when returning the Content Type associated to " + "Contentlet '%s'", this.getIdentifier())); } return null; }</code><technical_language>better: suggestion } catch (final DotSecurityException | DotDataException e) { ..</technical_language>

Target:
public ContentType getContentType() { final ContentType contentType; try { contentType = APILocator.getContentTypeAPI(APILocator.systemUser()).find(contentTypeId); return contentType; } catch (final DotSecurityException | DotDataException e) { Logger.error(this, String.format("An error occurred when returning the Content Type associated to " + "Contentlet '%s'", this.getIdentifier())); } return null; }