auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean canDoAction() { <START> boolean toReturn = false; <END> if (IrsBrokerCommand.tryLockIrsProxyData(getStoragePool().getId())) { try { toReturn = performChecks(); } catch (Exception e) { IrsBrokerCommand.unLockIrsProxyData(getStoragePool().getId()); toReturn = false; } finally { if (!toReturn) { IrsBrokerCommand.unLockIrsProxyData(getStoragePool().getId()); } } } return toReturn; }</code><technical_language>starvation, reconstruct run, of VdsManager.OnTimer case of couple vdsms master domain in problem. understand solve here</technical_language>

Target:
protected boolean canDoAction() { boolean toReturn = false; boolean isLockSucceded = true; if (VdcActionType.RecoveryStoragePool.equals(getActionType())) { isLockSucceded = IrsBrokerCommand.tryLockIrsProxyData(getStoragePool().getId()); } else { IrsBrokerCommand.lockIrsProxyData(getStoragePool().getId()); } if (isLockSucceded) { try { toReturn = performChecks(); } catch (Exception e) { IrsBrokerCommand.unLockIrsProxyData(getStoragePool().getId()); toReturn = false; } finally { if (!toReturn) { IrsBrokerCommand.unLockIrsProxyData(getStoragePool().getId()); } } } return toReturn; }
Source:
<code>public void queryOneExistedObjectObservable() { final List<User> users = putUsersBlocking(3); final User expectedUser = users.get(0); final Observable<User> userObservable = storIOSQLite .get() .object(User.class) .withQuery(Query.builder() .table(UserTableMeta.TABLE) .where(UserTableMeta.COLUMN_EMAIL + "=?") .whereArgs(expectedUser.email()) .build()) .prepare() .createObservable(); TestSubscriber<User> testSubscriber = new TestSubscriber<User>(); userObservable.subscribe(testSubscriber); <START> testSubscriber.awaitTerminalEvent(500, TimeUnit.MILLISECONDS); <END> testSubscriber.assertValueCount(1); testSubscriber.assertValue(expectedUser); testSubscriber.assertNoErrors(); testSubscriber.unsubscribe(); }</code><technical_language>static import for milliseconds please :)</technical_language>

Target:
public void queryOneExistedObjectObservable() { final List<User> users = putUsersBlocking(3); final User expectedUser = users.get(0); final Observable<User> userObservable = storIOSQLite .get() .object(User.class) .withQuery(Query.builder() .table(UserTableMeta.TABLE) .where(UserTableMeta.COLUMN_EMAIL + "=?") .whereArgs(expectedUser.email()) .build()) .prepare() .createObservable() .take(1); TestSubscriber<User> testSubscriber = new TestSubscriber<User>(); userObservable.subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(5, SECONDS); testSubscriber.assertValue(expectedUser); testSubscriber.assertNoErrors(); testSubscriber.unsubscribe(); }
Source:
<code>protected void appendAbbreviatedPackageFragment(IPackageFragment pack) { refreshPackageNameAbbreviation(); String pkgName= pack.getElementName(); if (fgPkgNameAbbreviation != null && fgPkgNameAbbreviation.length != 0) { for (PackageNameAbbreviation abbr : fgPkgNameAbbreviation) { String abbrPrefix= abbr.getPackagePrefix(); if (pkgName.startsWith(abbrPrefix)) { int abbrPrefixLength= abbrPrefix.length(); int pkgLength= pkgName.length(); if ((pkgLength != abbrPrefixLength) && (pkgName.charAt(abbrPrefixLength) != '.')) <START> continue; <END> fBuffer.append(abbr.getAbbreviation()); if (pkgLength > abbrPrefixLength) { fBuffer.append('.'); String remaining= pkgName.substring(abbrPrefixLength + 1); if (isPackageNameCompressionEnabled()) appendCompressedPackageFragment(remaining); else fBuffer.append(remaining); } return; } } } if (isPackageNameCompressionEnabled()) { appendCompressedPackageFragment(pkgName); } else { fBuffer.append(pkgName); } }</code><technical_language>For some eclipse projects is expected add braces for simple if cases touching code. I is in jdt.ui</technical_language>

Target:
protected void appendAbbreviatedPackageFragment(IPackageFragment pack) { refreshPackageNameAbbreviation(); String pkgName= pack.getElementName(); if (fgPkgNameAbbreviation != null && fgPkgNameAbbreviation.length != 0) { for (PackageNameAbbreviation abbr : fgPkgNameAbbreviation) { String abbrPrefix= abbr.getPackagePrefix(); if (pkgName.startsWith(abbrPrefix)) { int abbrPrefixLength= abbrPrefix.length(); int pkgLength= pkgName.length(); if ((pkgLength != abbrPrefixLength) && (pkgName.charAt(abbrPrefixLength) != '.')) { continue; } fBuffer.append(abbr.getAbbreviation()); if (pkgLength > abbrPrefixLength) { fBuffer.append('.'); String remaining= pkgName.substring(abbrPrefixLength + 1); if (isPackageNameCompressionEnabled()) appendCompressedPackageFragment(remaining); else fBuffer.append(remaining); } return; } } } if (isPackageNameCompressionEnabled()) { appendCompressedPackageFragment(pkgName); } else { fBuffer.append(pkgName); } }
Source:
<code>public void start() { decoderA.start(); decoderB.start(); boolean initialized = false; final List<String> ipAddresses = new ArrayList<String>(); try { final Enumeration<NetworkInterface> network = NetworkInterface.getNetworkInterfaces(); for (; network.hasMoreElements();) { final Enumeration<InetAddress> inet = network.nextElement().getInetAddresses(); for (; inet.hasMoreElements();) { <START> ipAddresses.add(inet.nextElement().toString()); <END> } } } catch (final SocketException error) { Logger.error(error); } for (String newAddress: ipAddresses) { final int lastLocation = newAddress.lastIndexOf('.'); String testAddress = "0"; if (lastLocation >= 0) { testAddress = newAddress.substring(1, lastLocation - 1); } if (broadcastIP.equals(testAddress)) { eventPublisher.emit(new VideoValueA(newAddress, config.portA())); eventPublisher.emit(new VideoValueB(newAddress, config.portB())); initialized = true; break; } } if (!initialized) { throw new IllegalStateException(); } }</code><technical_language>while loops instead of for loops here</technical_language>

Target:
public void start() { decoderA.start(); decoderB.start(); boolean initialized = false; final List<String> ipAddresses = new ArrayList<String>(); try { final Enumeration<NetworkInterface> network = NetworkInterface.getNetworkInterfaces(); while (network.hasMoreElements()) { final Enumeration<InetAddress> inet = network.nextElement().getInetAddresses(); while (inet.hasMoreElements()) { ipAddresses.add(inet.nextElement().toString()); } } } catch (final SocketException error) { Logger.error(error); } for (final String newAddress: ipAddresses) { final int lastLocation = newAddress.lastIndexOf('.'); if (lastLocation >= 0) { final String testAddress = newAddress.substring(1, lastLocation - 1); if (broadcastIP.equals(testAddress)) { eventPublisher.emit(new VideoValueA(newAddress, config.portA())); eventPublisher.emit(new VideoValueB(newAddress, config.portB())); initialized = true; break; } } } if (!initialized) { Logger.warn("Could not detect the IP of the runtime system"); } }
Source:
<code>public void createTestData() throws Exception { Bundle b1 = Util.readELBundles()[0][0]; b1.generateUniqueBundle(); Bundle b2 = Util.readELBundles()[0][0]; b2.generateUniqueBundle(); Bundle b3 = Util.readELBundles()[0][0]; b3.generateUniqueBundle(); try { b1 = new Bundle(b1, cluster1.getEnvFileName(), cluster1.getPrefix()); b2 = new Bundle(b2, cluster2.getEnvFileName(), cluster2.getPrefix()); b3 = new Bundle(b3, cluster3.getEnvFileName(), cluster3.getPrefix()); <START> String postFix = "/US/" + b2.getClusterHelper().getColo().split("=")[1]; <END> HadoopUtil.deleteDirIfExists(baseTestDir, cluster2FS); Util.lateDataReplenish(cluster2, 80, 1, baseTestDir, postFix); postFix = "/UK/" + b3.getClusterHelper().getColo().split("=")[1]; HadoopUtil.deleteDirIfExists(baseTestDir, cluster3FS); Util.lateDataReplenish(cluster3, 80, 1, baseTestDir, postFix); } finally { b1.deleteBundle(prism); b2.deleteBundle(prism); b3.deleteBundle(prism); } }</code><technical_language>I this done in number of places. Please create a coloName var in IEntityManagerHelper populate this add a get method that</technical_language>

Target:
public void createTestData() throws Exception { Bundle b1 = Util.readELBundles()[0][0]; b1.generateUniqueBundle(); Bundle b2 = Util.readELBundles()[0][0]; b2.generateUniqueBundle(); Bundle b3 = Util.readELBundles()[0][0]; b3.generateUniqueBundle(); try { b1 = new Bundle(b1, cluster1.getEnvFileName(), cluster1.getPrefix()); b2 = new Bundle(b2, cluster2.getEnvFileName(), cluster2.getPrefix()); b3 = new Bundle(b3, cluster3.getEnvFileName(), cluster3.getPrefix()); String postFix = "/US/" + b2.getClusterHelper().getColoName(); HadoopUtil.deleteDirIfExists(baseTestDir, cluster2FS); Util.lateDataReplenish(cluster2, 80, 1, baseTestDir, postFix); postFix = "/UK/" + b3.getClusterHelper().getColoName(); HadoopUtil.deleteDirIfExists(baseTestDir, cluster3FS); Util.lateDataReplenish(cluster3, 80, 1, baseTestDir, postFix); } finally { removeBundles(b1, b2, b3); } }
Source:
<code>public List<RichMember> findRichMembersWithAttributesInVo(PerunSession sess, Vo vo, String searchString, <START> List<String> attrsNames) throws InternalErrorException { <END> List<RichMember> list = findRichMembersInVo(sess, vo, searchString); List<AttributeDefinition> attrsDefs = new ArrayList<>(); for (String attrsName : attrsNames) { try { attrsDefs.add(getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, attrsName)); } catch (AttributeNotExistsException e) { throw new InternalErrorException("Attribute with given name: '" + attrsName + "' does not exist", e); } } return convertMembersToRichMembersWithAttributes(sess, list, attrsDefs); }</code><technical_language>Format</technical_language>

Target:
public List<RichMember> findRichMembersWithAttributesInVo(PerunSession sess, Vo vo, String searchString, List<String> attrsNames) throws InternalErrorException { List<RichMember> list = findRichMembersInVo(sess, vo, searchString); List<AttributeDefinition> attrsDefs = new ArrayList<>(); for (String attrsName : attrsNames) { try { attrsDefs.add(getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, attrsName)); } catch (AttributeNotExistsException e) { } } return convertMembersToRichMembersWithAttributes(sess, list, attrsDefs); }
Source:
<code>private void enableCancelButton() { <START> showCancelButton = true; <END> publishCancelDialogUpdate(); }</code><technical_language>I "isCancellable"</technical_language>

Target:
private void enableCancelButton() { isCancelable = true; publishCancelDialogUpdate(); }
Source:
<code>public static boolean supportedInConfig(ConfigValues feature, Version version, ArchitectureType arch) { Map<String, String> archOptions = Config.<Map>getValue(feature, version.getValue()); if (archOptions != null) { String val = archOptions.get(arch.name()); if (val == null) { val = archOptions.get(arch.getFamily().name()); } return Boolean.parseBoolean(val); } <START> return false; <END> }</code><technical_language>replace with: return Boolean.parseBoolean( ((Map<String, String>) Config.<Map>getValue(feature, version.getValue())).get(arch.getFamily().name())); ? I this code is cumbersome</technical_language>

Target:
public static boolean supportedInConfig(ConfigValues feature, Version version, ArchitectureType arch) { Map<String, String> archOptions = Config.<Map>getValue(feature, version.getValue()); return Boolean.parseBoolean(archOptions.getOrDefault(arch.name(), archOptions.get(arch.getFamily().name()))); }
Source:
<code>private void retrieve() { int persistedLinesFromCursor = Integer.parseInt(propertiesComponent.getValue( RefreshAction.LINES_FROM_CURSOR, String.valueOf(RefreshAction.LINES_FROM_CURSOR_DEFAULT_VALUE))); int persistedResultSize = Integer.parseInt(propertiesComponent.getValue( RefreshAction.SIZE, String.valueOf(RefreshAction.SIZE_DEFAULT_VALUE))); int persistedTopCount = Integer.parseInt(propertiesComponent.getValue( RefreshAction.TOP_COUNT, String.valueOf(RefreshAction.TOP_COUNT_DEFAULT_VALUE))); if (isWithInLimits(persistedLinesFromCursor, LimitsPanel.LINES_FROM_CURSOR_MIN, LimitsPanel.LINES_FROM_CURSOR_MAX)) { <START> this.setLinesFromCursor(persistedLinesFromCursor); <END> } else { this.setLinesFromCursor(RefreshAction.LINES_FROM_CURSOR_DEFAULT_VALUE); } if (isWithInLimits(persistedResultSize, LimitsPanel.MIN, LimitsPanel.RESULT_SIZE_MAX)) { this.setResultSize(persistedResultSize); } else { this.setResultSize(RefreshAction.SIZE_DEFAULT_VALUE); } if (isWithInLimits(persistedTopCount, LimitsPanel.MIN, LimitsPanel.TOP_COUNT_MAX)) { this.setTopCount(persistedTopCount); } else { this.setTopCount(RefreshAction.TOP_COUNT_DEFAULT_VALUE); } }</code><technical_language>instead of repeating this logic agina a utility function call everywhere</technical_language>

Target:
private void retrieve() { int persistedLinesFromCursor = Integer.parseInt(propertiesComponent.getValue( RefreshAction.LINES_FROM_CURSOR, String.valueOf(RefreshAction.LINES_FROM_CURSOR_DEFAULT_VALUE))); int persistedResultSize = Integer.parseInt(propertiesComponent.getValue( RefreshAction.SIZE, String.valueOf(RefreshAction.SIZE_DEFAULT_VALUE))); int persistedTopCount = Integer.parseInt(propertiesComponent.getValue( RefreshAction.TOP_COUNT, String.valueOf(RefreshAction.TOP_COUNT_DEFAULT_VALUE))); this.setLinesFromCursor(getValueBasedOnLimits(persistedLinesFromCursor, LimitsPanel.LINES_FROM_CURSOR_MIN, LimitsPanel.LINES_FROM_CURSOR_MAX, RefreshAction.LINES_FROM_CURSOR_DEFAULT_VALUE)); this.setResultSize(getValueBasedOnLimits(persistedResultSize, LimitsPanel.MIN, LimitsPanel.RESULT_SIZE_MAX, RefreshAction.SIZE_DEFAULT_VALUE)); this.setTopCount(getValueBasedOnLimits(persistedTopCount, LimitsPanel.MIN, LimitsPanel.TOP_COUNT_MAX, RefreshAction.TOP_COUNT_DEFAULT_VALUE)); }
Source:
<code>private void cancelAllNotifications() { if (DBG) <START> log("cancelAllNotifications"); <END> NotificationManager notificationManager = (NotificationManager) mPhone.getContext().getSystemService(Context.NOTIFICATION_SERVICE); if (SubscriptionManager.isValidSubscriptionId(mPrevSubId)) { notificationManager.cancel(Integer.toString(mPrevSubId), PS_NOTIFICATION); notificationManager.cancel(Integer.toString(mPrevSubId), CS_NOTIFICATION); notificationManager.cancel(Integer.toString(mPrevSubId), CS_REJECT_CAUSE_NOTIFICATION); } }</code><technical_language>print subId well</technical_language>

Target:
private void cancelAllNotifications() { if (DBG) log("cancelAllNotifications: mPrevSubId=" + mPrevSubId); NotificationManager notificationManager = (NotificationManager) mPhone.getContext().getSystemService(Context.NOTIFICATION_SERVICE); if (SubscriptionManager.isValidSubscriptionId(mPrevSubId)) { notificationManager.cancel(Integer.toString(mPrevSubId), PS_NOTIFICATION); notificationManager.cancel(Integer.toString(mPrevSubId), CS_NOTIFICATION); notificationManager.cancel(Integer.toString(mPrevSubId), CS_REJECT_CAUSE_NOTIFICATION); } }
Source:
<code>private String getASGAccount(String asgName) { Applications apps = PeerAwareInstanceRegistry.getInstance().getApplications(false); for (Application app : apps.getRegisteredApplications()) { for (InstanceInfo instanceInfo : app.getInstances()) { String thisAsgName = instanceInfo.getASGName(); if (thisAsgName != null && thisAsgName.equals(asgName)) { <START> return ((AmazonInfo) instanceInfo.getDataCenterInfo()).get(MetaDataKey.accountId); <END> } } } logger.error("Couldn't get the ASG account for " + asgName); return accountId; }</code><technical_language>accountId metadata field added eureka-client recently, for compatibility, is in existing deployments older clients do register this field. This return null NPE upstream. please add a null check fall instead</technical_language>

Target:
private String getASGAccount(String asgName) { Applications apps = PeerAwareInstanceRegistry.getInstance().getApplications(false); for (Application app : apps.getRegisteredApplications()) { for (InstanceInfo instanceInfo : app.getInstances()) { String thisAsgName = instanceInfo.getASGName(); if (thisAsgName != null && thisAsgName.equals(asgName)) { String accountId = ((AmazonInfo) instanceInfo.getDataCenterInfo()).get(MetaDataKey.accountId); if (accountId != null) { return accountId; } } } } logger.error("Couldn't get the ASG account for " + asgName); return accountId; }
Source:
<code>private void putReadersUpdate(int backups) throws Exception { final int SRVS = 3; startGrids(SRVS); awaitPartitionMapExchange(); Ignite srv = ignite(0); srv.createCache(cacheConfiguration(backups)); <START> Ignite client1 = startClientGrid(SRVS); <END> IgniteCache<Object, Object> cache1 = client1.createNearCache(DEFAULT_CACHE_NAME, new NearCacheConfiguration<>()); Integer key = primaryKey(srv.cache(DEFAULT_CACHE_NAME)); Ignite client2 = startGrid(SRVS + 1); IgniteCache<Object, Object> cache2 = client2.cache(DEFAULT_CACHE_NAME); cache1.put(key, 1); cache2.put(key, 2); checkCacheData(F.asMap(key, 2), DEFAULT_CACHE_NAME); int val = 10; for (TransactionConcurrency concurrency : TransactionConcurrency.values()) { for (TransactionIsolation isolation : TransactionIsolation.values()) { try (Transaction tx = client2.transactions().txStart(concurrency, isolation)) { cache2.put(key, val); tx.commit(); } checkCacheData(F.asMap(key, val), DEFAULT_CACHE_NAME); val++; } } }</code><technical_language>Ignite client2 = startGrid(SRVS + 1); starts a client node</technical_language>

Target:
private void putReadersUpdate(int backups) throws Exception { final int SRVS = 3; startGrids(SRVS); awaitPartitionMapExchange(); Ignite srv = ignite(0); srv.createCache(cacheConfiguration(backups)); Ignite client1 = startClientGrid(SRVS); IgniteCache<Object, Object> cache1 = client1.createNearCache(DEFAULT_CACHE_NAME, new NearCacheConfiguration<>()); Integer key = primaryKey(srv.cache(DEFAULT_CACHE_NAME)); Ignite client2 = startClientGrid(SRVS + 1); IgniteCache<Object, Object> cache2 = client2.cache(DEFAULT_CACHE_NAME); cache1.put(key, 1); cache2.put(key, 2); checkCacheData(F.asMap(key, 2), DEFAULT_CACHE_NAME); int val = 10; for (TransactionConcurrency concurrency : TransactionConcurrency.values()) { for (TransactionIsolation isolation : TransactionIsolation.values()) { try (Transaction tx = client2.transactions().txStart(concurrency, isolation)) { cache2.put(key, val); tx.commit(); } checkCacheData(F.asMap(key, val), DEFAULT_CACHE_NAME); val++; } } }
Source:
<code>public void printInfo(String dbId) { try { StringBuilder builder = new StringBuilder(); <START> builder.append("HyperSQL Database: "); <END> if (serverControls.containsKey(dbId)) { Server server = serverControls.get(dbId).getFirst(); builder.append("\n\tAddress : "); builder.append(server.getAddress()); builder.append("\n\tDatabase Name : "); builder.append(server.getDatabaseName(0, true)); builder.append("\n\tDatabasePath : "); builder.append(server.getDatabasePath(0, true)); builder.append("\n\tPort : "); builder.append(server.getPort()); builder.append("\n\tDefaultWebPage : "); builder.append(server.getDefaultWebPage()); builder.append("\n\tProductName : "); builder.append(server.getProductName()); builder.append("\n\tProductVersion : "); builder.append(server.getProductVersion()); builder.append("\n\tProtocol : "); builder.append(server.getProtocol()); builder.append("\n\tServerId : "); builder.append(server.getServerId()); builder.append("\n\tState : "); builder.append(server.getState()); builder.append("\n\tStateDescriptor : "); builder.append(server.getStateDescriptor()); builder.append("\n\tWebRoot : "); builder.append(server.getWebRoot()); } OseeLog.log(HyperSqlDbServer.class, Level.INFO, builder.toString()); } catch (Exception ex) { OseeLog.log(HyperSqlDbServer.class, Level.SEVERE, "Error getting Server Information", ex); } }</code><technical_language>want print if key found. null check pattern avoid performing a double lookup</technical_language>

Target:
public void printInfo(String dbId) { try { StringBuilder builder = new StringBuilder(); builder.append("HyperSQL Database: "); Pair<Server, Thread> entry = serverControls.get(dbId); if (entry != null) { Server server = entry.getFirst(); builder.append("\n\tAddress : "); builder.append(server.getAddress()); builder.append("\n\tDatabase Name : "); builder.append(server.getDatabaseName(0, true)); builder.append("\n\tDatabasePath : "); builder.append(server.getDatabasePath(0, true)); builder.append("\n\tPort : "); builder.append(server.getPort()); builder.append("\n\tDefaultWebPage : "); builder.append(server.getDefaultWebPage()); builder.append("\n\tProductName : "); builder.append(server.getProductName()); builder.append("\n\tProductVersion : "); builder.append(server.getProductVersion()); builder.append("\n\tProtocol : "); builder.append(server.getProtocol()); builder.append("\n\tServerId : "); builder.append(server.getServerId()); builder.append("\n\tState : "); builder.append(server.getState()); builder.append("\n\tStateDescriptor : "); builder.append(server.getStateDescriptor()); builder.append("\n\tWebRoot : "); builder.append(server.getWebRoot()); } else { builder.append("\n\tDatabase not found for id: "); builder.append(dbId); } OseeLog.log(HyperSqlDbServer.class, Level.INFO, builder.toString()); } catch (Exception ex) { OseeLog.log(HyperSqlDbServer.class, Level.SEVERE, "Error getting Server Information", ex); } }
Source:
<code>public void emitMetrics(ServiceEmitter emitter, ServiceMetricEvent.Builder metricBuilder) { if (delegate instanceof PrioritizedExecutorService) { emitter.emit(metricBuilder.build("segment/scan/pending", ((PrioritizedExecutorService) delegate).getQueueSize())); <START> emitter.emit(metricBuilder.build("merge/buffers/size", ((DefaultBlockingPool) mergeBufferPool).getPoolSize())); <END> } }</code><technical_language>Suggest calling this query/merge/buffersUsed. Presumably, other metric (merge buffer wait time) query/merge/wait</technical_language>

Target:
public void emitMetrics(ServiceEmitter emitter, ServiceMetricEvent.Builder metricBuilder) { if (delegate instanceof PrioritizedExecutorService) { emitter.emit(metricBuilder.build("segment/scan/pending", ((PrioritizedExecutorService) delegate).getQueueSize())); } }
Source:
<code>public void run() { for (User user : this.config.getUsersInfo().getUsers()) { try { collectInstagramDataForUser(user); } catch (Exception e) { <START> LOGGER.error("Exception thrown while polling for user, {}, skipping user.", user.getUserId()); <END> LOGGER.error("Exception thrown while polling for user : ", e); } } this.isCompleted.set(true); }</code><technical_language>If get InterruptedException, this catch move on</technical_language>

Target:
public void run() { for (User user : this.config.getUsersInfo().getUsers()) { try { collectInstagramDataForUser(user); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } catch (Exception e) { LOGGER.error("Exception thrown while polling for user, {}, skipping user.", user.getUserId()); LOGGER.error("Exception thrown while polling for user : ", e); } } this.isCompleted.set(true); }
Source:
<code>public String stringPrefix() { <START> return getClass().getSimpleName() + "[" + emptyContainer.get().stringPrefix() + "]"; <END> }</code><technical_language>I mind, this purpose, i.e. "HashMultimap[" +</technical_language>

Target:
public String stringPrefix() { return "HashMultimap[" + emptyContainer.get().stringPrefix() + "]"; }
Source:
<code><START> public DiskExistenceValidator <END> createDiskExistenceValidator(Set<Guid> disksGuids) { return Injector.injectMembers(new DiskExistenceValidator(disksGuids)); }</code><technical_language>for tests? work 'protected' then..</technical_language>

Target:
protected DiskExistenceValidator createDiskExistenceValidator(Set<Guid> disksGuids) { return Injector.injectMembers(new DiskExistenceValidator(disksGuids)); }
Source:
<code>private DirContext kerberosOpen(final Properties env) throws LoginException, NamingException { LoginContext ctx = new LoginContext("KerberosLogin"); ctx.login(); Subject subject = ctx.getSubject(); try { return Subject.doAs(subject, new PrivilegedExceptionAction<DirContext>() { @Override public DirContext run() throws NamingException { return new InitialDirContext(env); } }); } catch (PrivilegedActionException e) { <START> if (e.getException() instanceof NamingException) <END> throw (NamingException)e.getException(); if (e.getException() instanceof RuntimeException) throw (RuntimeException)e.getException(); LdapRealm.log.warn("Internal error", e.getException()); return null; } finally { ctx.logout(); } }</code><technical_language>this instead of if blocks: Throwables.propagateIfPossible(e.getException(), NamingException.class);</technical_language>

Target:
private DirContext kerberosOpen(final Properties env) throws LoginException, NamingException { LoginContext ctx = new LoginContext("KerberosLogin"); ctx.login(); Subject subject = ctx.getSubject(); try { return Subject.doAs(subject, new PrivilegedExceptionAction<DirContext>() { @Override public DirContext run() throws NamingException { return new InitialDirContext(env); } }); } catch (PrivilegedActionException e) { Throwables.propagateIfPossible(e.getException(), NamingException.class); Throwables.propagateIfPossible(e.getException(), RuntimeException.class); LdapRealm.log.warn("Internal error", e.getException()); return null; } finally { ctx.logout(); } }
Source:
<code>public static void removeDanglingReferences(final Resource resource) { DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.REMOVE_DANGLING_REFERENCE_KEY); if (resource != null && resource.getResourceSet() != null) { ModelAccessor accessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(resource.getResourceSet()); <START> SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(resource.getResourceSet()); <END> removeDanglingReferences(accessor, new DanglingReferencesDetector(resource)); } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.REMOVE_DANGLING_REFERENCE_KEY); }</code><technical_language>reason for this call getModelAccessor() a line itself</technical_language>

Target:
public static void removeDanglingReferences(final Resource resource) { DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.REMOVE_DANGLING_REFERENCE_KEY); if (resource != null && resource.getResourceSet() != null) { ModelAccessor accessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(resource.getResourceSet()); removeDanglingReferences(accessor, new DanglingReferencesDetector(resource)); } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.REMOVE_DANGLING_REFERENCE_KEY); }
Source:
<code>public void initialize() { this.documents = dataParser.parse(); for (final Document document : documents) { for (int i = 0; i < document.size(); i++) { final int word = document.getWord(i); parameterWorker.push(word, new int[]{document.getAssignment(i), 1}); <START> parameterWorker.push(numVocabs, new int[]{document.getAssignment(i), 1}); <END> } } LOG.log(Level.INFO, "All random topic assignments are updated"); synchronizer.globalBarrier(); }</code><technical_language>pushes here. reduce number of pushes batching for word. In this case, preValue semantics need change, too</technical_language>

Target:
public void initialize() { this.documents = dataParser.parse(); for (final Document document : documents) { for (int i = 0; i < document.size(); i++) { final int word = document.getWord(i); batchWorker.addTopicChange(word, document.getAssignment(i), 1); batchWorker.addTopicChange(numVocabs, document.getAssignment(i), 1); } batchWorker.pushAndClear(); } LOG.log(Level.INFO, "All random topic assignments are updated"); synchronizer.globalBarrier(); }
Source:
<code>public void checkAttributeValue(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { <START> if(!attribute.equals(getAttributeValue(sess, user, attribute))) throw new WrongAttributeValueException(attribute, user, "Attribute value is not the highest value from user's UserExtSources Loas."); <END> }</code><technical_language>This check sense, store attribute get it, contains value. e.g. for 100 users get user ext. sources compare simple string/int. if changed, is bad ? I guess check null present. do @licehammer? If @licehammer agree, please fix in member:virt:loa attribute module. Thank you</technical_language>

Target:
public void checkAttributeValue(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() != null) throw new WrongAttributeValueException(attribute, user, "Attribute value is null."); }
Source:
<code>private static ICleanUp[] getCleanUps(Map<String, String> settings, Set<String> ids) { ICleanUp[] result= JavaPlugin.getDefault().getCleanUpRegistry().createCleanUps(ids); for (ICleanUp <START> r : <END> result) { r.setOptions(new MapCleanUpOptions(settings)); } return result; }</code><technical_language>rename cleanUp</technical_language>

Target:
private static ICleanUp[] getCleanUps(Map<String, String> settings, Set<String> ids) { ICleanUp[] result= JavaPlugin.getDefault().getCleanUpRegistry().createCleanUps(ids); for (ICleanUp cleanUp : result) { cleanUp.setOptions(new MapCleanUpOptions(settings)); } return result; }
Source:
<code>public Mono<HttpResponse> send(HttpRequest request, Context contextData) { if(request.body() != null){ <START> request.body().map(ByteBuffer::reset); <END> } return httpPipeline.send(request, contextData); }</code><technical_language>Is this happening UnexpectedLengthException is reading ByteBuffer? If so, is check implemented read ByteBuffer need reset</technical_language>

Target:
public Mono<HttpResponse> send(HttpRequest request, Context contextData) { return httpPipeline.send(request, contextData); }
Source:
<code>private List<Modification> gitLog(String... args) { InMemoryStreamConsumer outputStreamConsumer = inMemoryConsumer(); try { if (!isSubmodule) { fetch(outputStreamConsumer); } } catch (Exception e) { throw new RuntimeException(String.format("Working directory: %s\n%s", workingDir, outputStreamConsumer.getStdError()), e); } CommandLine gitCmd = git(environment).withArg("log").withArgs(args).withWorkingDir(workingDir); ConsoleResult result; try { result = runOrBomb(gitCmd); } catch (CommandLineException exception) { <START> if (exception.getMessage().contains("Invalid revision range")) { <END> throw new InvalidRangeException(exception.getMessage()); } else { throw exception; } } GitModificationParser parser = new GitModificationParser(); List<Modification> mods = parser.parse(result.output()); for (Modification mod : mods) { addModifiedFiles(mod); } return mods; }</code><technical_language>assume this message, prone change in future versions of git (and in previous versions). This message based locale language settings git print this message in French Russion for :)</technical_language>

Target:
private List<Modification> gitLog(String... args) { InMemoryStreamConsumer outputStreamConsumer = inMemoryConsumer(); try { if (!isSubmodule) { fetch(outputStreamConsumer); } } catch (Exception e) { throw new RuntimeException(String.format("Working directory: %s\n%s", workingDir, outputStreamConsumer.getStdError()), e); } CommandLine gitCmd = git(environment).withArg("log").withArgs(args).withWorkingDir(workingDir); ConsoleResult result = runOrBomb(gitCmd); GitModificationParser parser = new GitModificationParser(); List<Modification> mods = parser.parse(result.output()); for (Modification mod : mods) { addModifiedFiles(mod); } return mods; }
Source:
<code>private static boolean getBoolValue(Object valueObj) throws TemplateModelException { <START> return valueObj instanceof TemplateScalarModel && Boolean.parseBoolean(((TemplateScalarModel) valueObj).getAsString()); <END> }</code><technical_language>Do parse Strings here? Assuming is pass in FreeMarker's model for a raw boolean type, expected result</technical_language>

Target:
private static boolean getBoolValue(Object valueObj) throws TemplateModelException { return valueObj instanceof TemplateBooleanModel && ((TemplateBooleanModel) valueObj).getAsBoolean(); }
Source:
<code>public void logAndThrow(RuntimeException runtimeException) { if (runtimeException == null) { return; } int currentLevel = level; if (level == DISABLED_LEVEL) { level = ERROR_LEVEL; } if (canLogAtLevel(level)) { performLogging(runtimeException.getClass().getName(), false, runtimeException); } <START> level = currentLevel; <END> throw runtimeException; }</code><technical_language>convinced need this extra complexity. call logger.error("", runtimeException) changing level modifying of other code</technical_language>

Target:
public void logAndThrow(RuntimeException runtimeException) { if (runtimeException == null) { return; } if (canLogAtLevel(ERROR_LEVEL)) { logger.error(runtimeException.getMessage(), runtimeException); } throw runtimeException; }
Source:
<code>public static URL getAccumuloSiteLocation() { String configFile = System.getProperty("accumulo.configuration", "accumulo-site.xml"); if (configFile.startsWith("file://")) { try { File f = new File(new URI(configFile)); if (f.exists() && !f.isDirectory()) { log.info("Found Accumulo configuration at {}", configFile); return f.toURI().toURL(); } else { log.warn("Failed to load Accumulo configuration at " + configFile, new Throwable()); } } catch (MalformedURLException | URISyntaxException e) { <START> log.warn("Failed to load Accumulo configuration from " + configFile, e); <END> } } else { URL accumuloConfigUrl = SiteConfiguration.class.getClassLoader().getResource(configFile); if (accumuloConfigUrl == null) { log.warn("Failed to load Accumulo configuration '" + configFile + "' from classpath", new Throwable()); } else { log.info("Found Accumulo configuration on classpath at {}", accumuloConfigUrl.getFile()); return accumuloConfigUrl; } } return null; }</code><technical_language>This a hard fail if configuration user available. fall magic behavior, configuration drives a lot of security-related elements</technical_language>

Target:
public static URL getAccumuloSiteLocation() { String configFile = System.getProperty("accumulo.configuration", "accumulo-site.xml"); if (configFile.startsWith("file://")) { try { File f = new File(new URI(configFile)); if (f.exists() && !f.isDirectory()) { log.info("Found Accumulo configuration at {}", configFile); return f.toURI().toURL(); } else { throw new IllegalArgumentException( "Failed to load Accumulo configuration at " + configFile); } } catch (MalformedURLException | URISyntaxException e) { throw new IllegalArgumentException( "Failed to load Accumulo configuration from " + configFile, e); } } else { URL accumuloConfigUrl = SiteConfiguration.class.getClassLoader().getResource(configFile); if (accumuloConfigUrl == null) { throw new IllegalArgumentException( "Failed to load Accumulo configuration '" + configFile + "' from classpath"); } else { log.info("Found Accumulo configuration on classpath at {}", accumuloConfigUrl.getFile()); return accumuloConfigUrl; } } }
Source:
<code>private CompletableFuture<Void> downloadOrUpdate(Collection<? extends LocallyCachedBlob> blobs) { CompletableFuture<Void>[] all = new CompletableFuture[blobs.size()]; int i = 0; for (final LocallyCachedBlob blob : blobs) { all[i] = CompletableFuture.runAsync(() -> { LOG.debug("STARTING download of {}", blob); try (ClientBlobStore blobStore = getClientBlobStore()) { boolean done = false; long failures = 0; while (!done) { try { synchronized (blob) { long localVersion = blob.getLocalVersion(); long remoteVersion = blob.getRemoteVersion(blobStore); if (localVersion != remoteVersion || !blob.isFullyDownloaded()) { <START> if (!blob.isFullyDownloaded()) { <END> numBlobUpdateVersionChanged.mark(); } Timer.Context t = singleBlobLocalizationDuration.time(); try { long newVersion = blob.fetchUnzipToTemp(blobStore); blob.informAllOfChangeAndWaitForConsensus(); blob.commitNewVersion(newVersion); blob.informAllChangeComplete(); t.stop(); } finally { blob.cleanupOrphanedData(); } } } done = true; } catch (Exception e) { failures++; if (failures > blobDownloadRetries) { throw new RuntimeException("Could not download...", e); } LOG.warn("Failed to download blob will try again in ms", blob, ATTEMPTS_INTERVAL_TIME, e); Utils.sleep(ATTEMPTS_INTERVAL_TIME); } } } LOG.debug("FINISHED download of {}", blob); }, execService); i++; } return CompletableFuture.allOf(all); }</code><technical_language>if (blob.isFullyDownloaded()) {</technical_language>

Target:
private CompletableFuture<Void> downloadOrUpdate(Collection<? extends LocallyCachedBlob> blobs) { CompletableFuture<Void>[] all = new CompletableFuture[blobs.size()]; int i = 0; for (final LocallyCachedBlob blob : blobs) { all[i] = CompletableFuture.runAsync(() -> { LOG.debug("STARTING download of {}", blob); try (ClientBlobStore blobStore = getClientBlobStore()) { boolean done = false; long failures = 0; while (!done) { try { synchronized (blob) { long localVersion = blob.getLocalVersion(); long remoteVersion = blob.getRemoteVersion(blobStore); if (localVersion != remoteVersion || !blob.isFullyDownloaded()) { if (blob.isFullyDownloaded()) { numBlobUpdateVersionChanged.mark(); } Timer.Context t = singleBlobLocalizationDuration.time(); try { long newVersion = blob.fetchUnzipToTemp(blobStore); blob.informAllOfChangeAndWaitForConsensus(); blob.commitNewVersion(newVersion); blob.informAllChangeComplete(); t.stop(); } finally { blob.cleanupOrphanedData(); } } } done = true; } catch (Exception e) { failures++; if (failures > blobDownloadRetries) { throw new RuntimeException("Could not download...", e); } LOG.warn("Failed to download blob will try again in ms", blob, ATTEMPTS_INTERVAL_TIME, e); Utils.sleep(ATTEMPTS_INTERVAL_TIME); } } } LOG.debug("FINISHED download of {}", blob); }, execService); i++; } return CompletableFuture.allOf(all); }
Source:
<code><START> public ImportTableDesc(String dbName, Table table) throws Exception { <END> this.dbName = dbName; TableName tableName = HiveTableName.ofNullable(table.getTableName(), dbName); this.createTblDesc = new CreateTableDesc(tableName, false, false, table.getSd().getCols(), table.getPartitionKeys(), table.getSd().getBucketCols(), table.getSd().getSortCols(), table.getSd().getNumBuckets(), null, null, null, null, null, null, table.getSd().getInputFormat(), table.getSd().getOutputFormat(), null, table.getSd().getSerdeInfo().getSerializationLib(), null, table.getSd().getSerdeInfo().getParameters(), table.getParameters(), false, (null == table.getSd().getSkewedInfo()) ? null : table.getSd().getSkewedInfo().getSkewedColNames(), (null == table.getSd().getSkewedInfo()) ? null : table.getSd().getSkewedInfo().getSkewedColValues(), null, null, null, null, null, null, table.getColStats(), table.getTTable().getWriteId()); this.createTblDesc.setStoredAsSubDirectories(table.getSd().isStoredAsSubDirectories()); }</code><technical_language>throw exception in table is of type view</technical_language>

Target:
public ImportTableDesc(String dbName, Table table) throws Exception { if (table.getTableType() == TableType.VIRTUAL_VIEW || table.getTableType() == TableType.MATERIALIZED_VIEW) { throw new IllegalStateException("Trying to import view or materialized view: " + table.getTableName()); } this.dbName = dbName; TableName tableName = HiveTableName.ofNullable(table.getTableName(), dbName); this.createTblDesc = new CreateTableDesc(tableName, false, false, table.getSd().getCols(), table.getPartitionKeys(), table.getSd().getBucketCols(), table.getSd().getSortCols(), table.getSd().getNumBuckets(), null, null, null, null, null, null, table.getSd().getInputFormat(), table.getSd().getOutputFormat(), null, table.getSd().getSerdeInfo().getSerializationLib(), null, table.getSd().getSerdeInfo().getParameters(), table.getParameters(), false, (null == table.getSd().getSkewedInfo()) ? null : table.getSd().getSkewedInfo().getSkewedColNames(), (null == table.getSd().getSkewedInfo()) ? null : table.getSd().getSkewedInfo().getSkewedColValues(), null, null, null, null, null, null, table.getColStats(), table.getTTable().getWriteId()); this.createTblDesc.setStoredAsSubDirectories(table.getSd().isStoredAsSubDirectories()); }
Source:
<code>public void testApplicationContextLoads() throws JobParametersInvalidException, JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, InterruptedException { myBatchJobConfig.setExpectedCount(1); <START> myJobLauncher.run(myJob, new JobParameters()); <END> myBatchJobConfig.awaitExpected(); }</code><technical_language>This job appears run</technical_language>

Target:
public void testApplicationContextLoads() throws JobParametersInvalidException, JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, InterruptedException { myJobLauncher.run(myJob, new JobParameters()); }
Source:
<code>public Iterable<ObjectNode> getAllListLead(List<String> fieldNames) { RecordPagingIterable<ObjectNode> lists = marketoRestClient.getLists(); List<Iterable<ObjectNode>> iterables = new ArrayList<>(); for (ObjectNode node : lists) { final String id = node.get("id").asText(); <START> iterables.add(Iterables.transform(marketoRestClient.getLeadsByList(id, FluentIterable.from(fieldNames).filter(new Predicate<String>() <END> { @Override public boolean apply(@Nullable String input) { return !LIST_ID_COLUMN_NAME.equals(input); } }).toList()), new Function<ObjectNode, ObjectNode>() { @Nullable @Override public ObjectNode apply(@Nullable ObjectNode input) { input.put(LIST_ID_COLUMN_NAME, id); return input; } })); } return Iterables.concat(iterables); }</code><technical_language>2 issues this line: - long & complicated due chaining method invocations reader hard realize purpose. If break multiple lines, great. - Function object refactored a method reused in next getAllProgramLead function</technical_language>

Target:
public Iterable<ObjectNode> getAllListLead(List<String> fieldNames) { RecordPagingIterable<ObjectNode> lists = marketoRestClient.getLists(); List<Iterable<ObjectNode>> iterables = new ArrayList<>(); for (ObjectNode node : lists) { final String id = node.get("id").asText(); iterables.add(Iterables.transform(marketoRestClient.getLeadsByList(id, fieldNames), new Function<ObjectNode, ObjectNode>() { @Override public ObjectNode apply(ObjectNode input) { input.put(MarketoUtils.LIST_ID_COLUMN_NAME, id); return input; } })); } return Iterables.concat(iterables); }
Source:
<code>public void shouldLogInAudit() throws Exception { DocumentModel doc = session.createDocumentModel("/", "a-file", "File"); doc.setPropertyValue("dc:title", "A File"); doc = session.createDocument(doc); LogEntryGen.flushAndSync(); doc.setPropertyValue("dc:title", "A modified File"); doc = session.saveDocument(doc); LogEntryGen.flushAndSync(); AuditReader reader = Framework.getLocalService(AuditReader.class); List<LogEntry> trail = reader.getLogEntriesFor(doc.getId(), doc.getRepositoryName()); Assert.assertNotNull(trail); <START> assertEquals(2, trail.size()); <END> LogEntry entry = trail.get(0); assertEquals(2L, entry.getId()); assertEquals("documentModified", entry.getEventId()); assertEquals("eventDocumentCategory", entry.getCategory()); assertEquals("A modified File", entry.getExtendedInfos().get("title").getValue(String.class)); entry = trail.get(1); assertEquals(1L, entry.getId()); assertEquals("documentCreated", entry.getEventId()); assertEquals("eventDocumentCategory", entry.getCategory()); assertEquals("A File", entry.getExtendedInfos().get("title").getValue(String.class)); LogEntry entryById = reader.getLogEntryByID(entry.getId()); assertEquals(entry.getId(), entryById.getId()); entryById = reader.getLogEntryByID(123L); Assert.assertNull(entryById); NXAuditEventsService audit = (NXAuditEventsService) Framework.getRuntime() .getComponent(NXAuditEventsService.NAME); AuditBackend backend = audit.getBackend(); assertEquals(1L, backend.getEventsCount(entry.getEventId()).longValue()); }</code><technical_language>do a static import assertNotNull while it... (although this in a cleanup commit)</technical_language>

Target:
public void shouldLogInAudit() throws Exception { DocumentModel doc = session.createDocumentModel("/", "a-file", "File"); doc.setPropertyValue("dc:title", "A File"); doc = session.createDocument(doc); LogEntryGen.flushAndSync(); doc.setPropertyValue("dc:title", "A modified File"); doc = session.saveDocument(doc); LogEntryGen.flushAndSync(); AuditReader reader = Framework.getLocalService(AuditReader.class); List<LogEntry> trail = reader.getLogEntriesFor(doc.getId(), doc.getRepositoryName()); assertNotNull(trail); assertEquals(2, trail.size()); LogEntry entry = trail.get(0); assertEquals(2L, entry.getId()); assertEquals("documentModified", entry.getEventId()); assertEquals("eventDocumentCategory", entry.getCategory()); assertEquals("A modified File", entry.getExtendedInfos().get("title").getValue(String.class)); entry = trail.get(1); assertEquals(1L, entry.getId()); assertEquals("documentCreated", entry.getEventId()); assertEquals("eventDocumentCategory", entry.getCategory()); assertEquals("A File", entry.getExtendedInfos().get("title").getValue(String.class)); LogEntry entryById = reader.getLogEntryByID(entry.getId()); assertEquals(entry.getId(), entryById.getId()); entryById = reader.getLogEntryByID(123L); assertNull(entryById); NXAuditEventsService audit = (NXAuditEventsService) Framework.getRuntime() .getComponent(NXAuditEventsService.NAME); AuditBackend backend = audit.getBackend(); assertEquals(1L, backend.getEventsCount(entry.getEventId()).longValue()); }
Source:
<code><START> public void testGetVariantsByExistingGenes() throws URISyntaxException { <END> List<String> chromosomes = testGetVariantsGeneHelper("ENSG00000227232,ENSG00000227244", 2, HttpStatus.OK); assertEquals("20", chromosomes.get(0)); assertEquals("20", chromosomes.get(1)); }</code><technical_language>is ok check chromosomes variants checked</technical_language>

Target:
public void testGetVariantsByExistingGenes() throws URISyntaxException { List<Variant> variants = testGetVariantsByGeneHelper("ENSG00000227232,ENSG00000227244", 2, HttpStatus.OK); assertEquals("20", variants.get(0).getChromosome()); assertEquals("A", variants.get(0).getReference()); assertEquals("C", variants.get(0).getAlternate()); assertEquals("20", variants.get(1).getChromosome()); assertEquals("A", variants.get(1).getReference()); assertEquals("C", variants.get(1).getAlternate()); }
Source:
<code>public void delete(String storageId, String repositoryId, String path, boolean force) throws ArtifactOperationException { <START> try <END> { @SuppressWarnings("ConstantConditions") String url = getContextBaseUrl() + "/storages/" + storageId + "/" + repositoryId + "/" + path + (force ? "?force=" + force : ""); WebTarget resource = getClientInstance().target(url); setupAuthentication(resource); Response response = resource.request().delete(); handleFailures(response, "Failed to delete artifact!"); } catch (Exception e){ e.printStackTrace(); } }</code><technical_language>@AlexOreshkevich : I I agree try/catch here... please remove it, is a good reason missing</technical_language>

Target:
public void delete(String storageId, String repositoryId, String path, boolean force) throws ArtifactOperationException { @SuppressWarnings("ConstantConditions") String url = getContextBaseUrl() + "/storages/" + storageId + "/" + repositoryId + "/" + path + (force ? "?force=" + force : ""); WebTarget resource = getClientInstance().target(url); setupAuthentication(resource); Response response = resource.request().delete(); handleFailures(response, "Failed to delete artifact!"); }