auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shutdown() { acceptTasks = false; queue.submit(new Runnable() { @Override public void run() { db.close(); } }); queue.shutdown(); try { queue.awaitTermination(200, TimeUnit.SECONDS); } catch (InterruptedException e){ logger.log(Level.WARNING,"Interrupted while waiting for queue to shutdown",e); } }

Target:
public void shutdown() { acceptTasks = false; queue.submit(new Runnable() { @Override public void run() { db.close(); } }); queue.shutdown(); try { queue.awaitTermination(5,TimeUnit.MINUTES); } catch (InterruptedException e) { logger.log(Level.SEVERE,"Interrupted while waiting for queue to terminate",e); } }
Source:
private TriggerResponse triggerWithRetries(Pipeline pipeline) { int attempts = 0; while (true) { try { attempts++; return orca.trigger(pipeline); } catch (RetrofitError e) { if ((attempts >= retryCount) || !isRetryableError(e)) { throw e; } } try { Thread.sleep(retryDelayMillis); } catch (InterruptedException ignored) { } log.warn("Retrying pipeline trigger for {}", pipeline); } }

Target:
private TriggerResponse triggerWithRetries(Pipeline pipeline) { int attempts = 0; while (true) { try { attempts++; return orca.trigger(pipeline); } catch (RetrofitError e) { if ((attempts >= retryCount) || !isRetryableError(e)) { throw e; } else { log.warn( "Error triggering with (attempt {}/{}). Retrying...", pipeline, e, attempts, retryCount); } } try { Thread.sleep(retryDelayMillis); registry.counter("orca.trigger.retries").increment(); } catch (InterruptedException ignored) { } } }
Source:
public void copyFrom( final Transfer f ) throws IOException { provider.waitForWriteUnlock( resource ); provider.lockWrite( resource ); try { if ( decorator != null ) { decorator.decorateCopyFrom( f, this, new EventMetadata( ) ); } provider.copy( f.getResource(), resource ); } finally { provider.unlockWrite( resource ); } }

Target:
public void copyFrom( final Transfer f ) throws IOException { copyFrom( f, new EventMetadata( ) ); }
Source:
public void visitToken(DetailAST ast) { final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS); switch (ast.getType()) { case TokenTypes.PACKAGE_DEF: packageName = extractQualifiedName(ast); break; case TokenTypes.CLASS_DEF: currentDepthLevel++; final ClassDesc classDesc = buildClassDesc(ast, modifiers); classes.push(classDesc); break; case TokenTypes.CTOR_DEF: registerClassConstructors(ast, modifiers); break; default: throw new IllegalStateException(ast.toString()); } }

Target:
public void visitToken(DetailAST ast) { final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS); switch (ast.getType()) { case TokenTypes.PACKAGE_DEF: packageName = extractQualifiedName(ast); break; case TokenTypes.CLASS_DEF: currentDepthLevel++; final ClassDesc classDesc = registerClassDesc(ast, modifiers); classes.push(classDesc); break; case TokenTypes.CTOR_DEF: registerClassConstructors(ast, modifiers); break; default: throw new IllegalStateException(ast.toString()); } }
Source:
public static int compare(StarlarkInt x, StarlarkInt y) { long xl = 0, yl = 0; boolean xbig = false, ybig = false; try { xl = x.toLongFast(); } catch (Overflow unused) { xbig = true; } try { yl = y.toLongFast(); } catch (Overflow unused) { ybig = true; } if (xbig && ybig) { return ((Big) x).v.compareTo(((Big) y).v); } else if (xbig) { return ((Big) x).v.signum(); } else if (ybig) { return -((Big) y).v.signum(); } else { return Long.compare(xl, yl); } }

Target:
public static int compare(StarlarkInt x, StarlarkInt y) { try { long xl = x.toLongFast(); try { long yl = y.toLongFast(); return Long.compare(xl, yl); } catch (Overflow unused) { return -((Big) y).v.signum(); } } catch (Overflow unused) { try { y.toLongFast(); return ((Big) x).v.signum(); } catch (Overflow unused2) { return ((Big) x).v.compareTo(((Big) y).v); } } }
Source:
public void testQueryExactMatch() { Assert.assertEquals(0, testRealmResource().users().search("a", true).size()); Assert.assertEquals(1, testRealmResource().users().search("apollo", true).size()); Assert.assertEquals(1, testRealmResource().users().search("tbrady", true).size()); }

Target:
public void testQueryExactMatch() { Assert.assertThat(testRealmResource().users().search("a", true), Matchers.hasSize(0)); Assert.assertThat(testRealmResource().users().search("apollo", true), Matchers.hasSize(1)); Assert.assertThat(testRealmResource().users().search("tbrady", true), Matchers.hasSize(1)); }
Source:
private static final boolean allCellsHaveTimestamps(Iterable<Mutation> mutations) { for (Mutation mut : mutations) { if (mut.getSetCell().getTimestampMicros() == -1) { return false; } } return true; }

Target:
private static final boolean allCellsHaveTimestamps(Iterable<Mutation> mutations) { for (Mutation mut : mutations) { if (mut.getSetCell().getTimestampMicros() <= 0) { return false; } } return true; }
Source:
public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice(List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { qosClient.checkLimit(); Map<ByteBuffer, List<ColumnOrSuperColumn>> result = delegate.multiget_slice(keys, column_parent, predicate, consistency_level); try { recordBytesRead(getApproximateReadByteCount(result)); } catch (Exception e) { log.warn("Encountered an exception when recording write metrics for multiget_slice.", e); } return result; }

Target:
public Map<ByteBuffer, List<ColumnOrSuperColumn>> multiget_slice(List<ByteBuffer> keys, ColumnParent column_parent, SlicePredicate predicate, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { qosClient.checkLimit(); Map<ByteBuffer, List<ColumnOrSuperColumn>> result = delegate.multiget_slice(keys, column_parent, predicate, consistency_level); recordBytesRead(getApproximateReadByteCount(result)); return result; }
Source:
public void testGetAPI() { VersionRange v1 = new VersionRange(1, 2); VersionRange v2 = new VersionRange(3, 4); Map<String, VersionRange> allFeatures = new HashMap<String, VersionRange>() { { put("feature_1", v1); put("feature_2", v2); } }; Features<VersionRange> features = Features.supportedFeatures(allFeatures); assertEquals(v1, features.get("feature_1")); assertEquals(v2, features.get("feature_2")); assertNull(features.get("nonexistent_feature")); }

Target:
public void testGetAPI() { SupportedVersionRange v1 = new SupportedVersionRange((short) 1, (short) 2); SupportedVersionRange v2 = new SupportedVersionRange((short) 3, (short) 4); Map<String, SupportedVersionRange> allFeatures = mkMap(mkEntry("feature_1", v1), mkEntry("feature_2", v2)); Features<SupportedVersionRange> features = Features.supportedFeatures(allFeatures); assertEquals(v1, features.get("feature_1")); assertEquals(v2, features.get("feature_2")); assertNull(features.get("nonexistent_feature")); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Attribute)) { return false; } Attribute other = (Attribute) o; return ObjectUtils.equals(uuid, other.uuid) && ObjectUtils.equals(display, other.display) && ObjectUtils.equals(value, other.value) && ObjectUtils.equals(name, other.name) && ObjectUtils.equals(description, other.description) && ObjectUtils.equals(format, other.format) && ObjectUtils.equals(attributeType, other.attributeType) && ObjectUtils.equals(links, other.links); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Attribute)) { return false; } Attribute other = (Attribute) o; return Objects.equals(uuid, other.uuid) && Objects.equals(display, other.display) && Objects.equals(value, other.value) && Objects.equals(name, other.name) && Objects.equals(description, other.description) && Objects.equals(format, other.format) && Objects.equals(attributeType, other.attributeType) && Objects.equals(links, other.links); }
Source:
public void reset() { super.reset(); traits = null; clearlisteners(); }

Target:
public void reset() { super.reset(); traits = null; }
Source:
protected int getExpirationDays(final int expirationDays) { final int jsonWebTokenMaxAllowedExpirationDay = Config.getIntProperty(LoginService.JSON_WEB_TOKEN_MAX_ALLOWED_EXPIRATION_DAYS, -1); final int maxAllowedExpirationDays = (jsonWebTokenMaxAllowedExpirationDay > 0 && (expirationDays > jsonWebTokenMaxAllowedExpirationDay))? jsonWebTokenMaxAllowedExpirationDay: expirationDays; Logger.debug(this, "Json Web Token Expiration days value: " + expirationDays + " days"); return maxAllowedExpirationDays; }

Target:
protected int getExpirationDays(final int expirationDays) { final int jsonWebTokenMaxAllowedExpirationDay = Config.getIntProperty(LoginService.JSON_WEB_TOKEN_MAX_ALLOWED_EXPIRATION_DAYS, -1); final int maxAllowedExpirationDays = (jsonWebTokenMaxAllowedExpirationDay > 0 && (expirationDays > jsonWebTokenMaxAllowedExpirationDay))? this.getJsonWebTokenMaxAllowedExpirationDay(jsonWebTokenMaxAllowedExpirationDay, expirationDays): expirationDays; Logger.debug(this, "Json Web Token Expiration days value: " + expirationDays + " days"); return maxAllowedExpirationDays; }
Source:
public String createNew(User user) { String content = String.format("%s%d", PageContent.ARTICLE_TEXT, DateTime.now().getMillis()); String boardName = String.format("%s%d", "ForumBoard", DateTime.now().getMillis()); String boardTitle = String.format("%s:%s", URLsContent.FORUM_BOARD_NAMESPACE, boardName); new ForumBoardContent(user, boardTitle, content).call(); try { Thread.sleep(5000); } catch (InterruptedException e) { PageObjectLogging.logInfo("Sleep interrupted after forum board creation", e); } return boardName; }

Target:
public String createNew(User user) { String content = String.format("%s%d", PageContent.ARTICLE_TEXT, DateTime.now().getMillis()); String boardName = String.format("%s%d", "ForumBoard", DateTime.now().getMillis()); new ForumBoardContent(user, boardName, content).call(); try { Thread.sleep(5000); } catch (InterruptedException e) { PageObjectLogging.logInfo("Sleep interrupted after forum board creation", e); } return boardName; }
Source:
public InputStream getInputStream() throws IOException { URI parsedUri = URI.create(uri); return parsedUri.getScheme().equals("http") || parsedUri.getScheme().equals("https") ? parsedUri.toURL().openConnection().getInputStream() : getHadoopFileSystemInputStream(parsedUri); }

Target:
public InputStream getInputStream() throws IOException { URI parsedUri = URI.create(uri); return (parsedUri.getScheme().equals("http") || parsedUri.getScheme().equals("https")) ? parsedUri.toURL().openConnection().getInputStream() : getHadoopFileSystemInputStream(parsedUri); }
Source:
private static StateListener getStateListener(final KafkaStreams streams) { try { final Field field = streams.getClass().getDeclaredField("stateListener"); field.setAccessible(true); return (StateListener) field.get(streams); } catch (IllegalAccessException | NoSuchFieldException e) { throw new RuntimeException("Failed to get StateListener through reflection", e); } }

Target:
private static StateListener getStateListener(final KafkaStreams streams) { try { final Field field = streams.getClass().getDeclaredField("stateListener"); field.setAccessible(true); return (StateListener) field.get(streams); } catch (final IllegalAccessException | NoSuchFieldException e) { throw new RuntimeException("Failed to get StateListener through reflection", e); } }
Source:
public void testReentrantLockMultinode(final boolean fair) throws Exception { final AtomicInteger inx = new AtomicInteger(0); GridTestUtils.runMultiThreadedAsync(new Runnable() { @Override public void run() { try { IgniteLock lock = createReentrantLock(inx.getAndIncrement(), fair ? "lock1" : "lock2", fair); lock.lock(); try { assertTrue(lock.isLocked()); Thread.sleep(1_000L); } catch (InterruptedException e) { e.printStackTrace(); } finally { lock.unlock(); } } catch (Exception e) { e.printStackTrace(); } } }, NODES_CNT, "worker").get(30_000L); }

Target:
private void testReentrantLockMultinode(final boolean fair) throws IgniteCheckedException { final AtomicInteger inx = new AtomicInteger(0); GridTestUtils.runMultiThreadedAsync((Callable<Void>) () -> { IgniteLock lock = createReentrantLock(inx.getAndIncrement() % NODES_CNT, fair ? "fair lock" : "unfair lock", fair); lock.lock(); try { assertTrue(lock.isLocked()); } finally { lock.unlock(); } return null; }, NODES_CNT * THREAD_CNT, "worker").get(30_000L); }
Source:
private Message getMessageFromSchema(String topic, String filename) { DynamicMessage message = null; DynamicSchema.Builder schemaBuilder = DynamicSchema.newBuilder(); topic = StringUtils.capitalize(topic.replaceAll("-", " ")).replaceAll("\\s+", ""); schemaBuilder.setName("SecorBuilder" + topic + ".proto"); com.github.os72.protobuf.dynamic.MessageDefinition.Builder builder = MessageDefinition.newBuilder(topic); try { BufferedReader reader = new BufferedReader(new FileReader(new File(filename))); String line; int i=0; while ((line = reader.readLine()) != null) { String[] splits = line.split(COLON_SEPARATOR); builder.addField("optional", splits[1], splits[0], ++i); } reader.close(); MessageDefinition msgDef = builder.build(); schemaBuilder.addMessageDefinition(msgDef); DynamicSchema schema = schemaBuilder.build(); DynamicMessage.Builder msgBuilder = schema.newMessageBuilder(topic); message = msgBuilder.build(); } catch (IOException e) { LOG.error("Unable to read schema for Orc due to {}, Orc conversion cannot work", e); Throwables.propagate(e); } catch (DescriptorValidationException e) { LOG.error("Unable to create protobuf messages for OrcScheme due to {}", e); Throwables.propagate(e); } return message; }

Target:
private Message getMessageFromSchema(String topic, String filename) { DynamicMessage message = null; DynamicSchema.Builder schemaBuilder = DynamicSchema.newBuilder(); topic = StringUtils.capitalize(topic.replaceAll("-", " ")).replaceAll("\\s+", ""); schemaBuilder.setName("SecorBuilder" + topic + ".proto"); Builder builder = MessageDefinition.newBuilder(topic); try { BufferedReader reader = new BufferedReader(new FileReader(new File(filename))); String line; int i=0; while ((line = reader.readLine()) != null) { String[] splits = line.split(COLON_SEPARATOR); builder.addField("optional", splits[1], splits[0], ++i); } reader.close(); MessageDefinition msgDef = builder.build(); schemaBuilder.addMessageDefinition(msgDef); DynamicSchema schema = schemaBuilder.build(); DynamicMessage.Builder msgBuilder = schema.newMessageBuilder(topic); message = msgBuilder.build(); } catch (IOException e) { LOG.error("Unable to read schema for Orc due to {}, Orc conversion cannot work", e); Throwables.propagate(e); } catch (DescriptorValidationException e) { LOG.error("Unable to create protobuf messages for OrcScheme due to {}", e); Throwables.propagate(e); } return message; }
Source:
public Diagnostics(Configuration config, Context context, Client client) { super(config); this.client = client; applicationContext = context; Diagnostics.startSessionTimer(); packageName = applicationContext.getPackageName(); client.setUser(getUUID(), null, null); client.setOsVersion(android.os.Build.VERSION.RELEASE); client.setAppVersion(getPackageVersion(packageName)); client.setReleaseStage(guessReleaseStage(packageName)); client.setProjectPackages(packageName); }

Target:
public Diagnostics(Configuration config, Context context, Client client) { super(config); applicationContext = context; Diagnostics.startSessionTimer(); packageName = applicationContext.getPackageName(); config.setProjectPackages(packageName); config.getOsVersion().set(android.os.Build.VERSION.RELEASE); config.getAppVersion().set(getPackageVersion(packageName)); config.getReleaseStage().set(guessReleaseStage(packageName)); this.initialiseDeviceData(); this.initialiseAppData(); }
Source:
public void close() throws Exception { if (released || isEmpty()) return; if (!closeable()) throw new ND4JIllegalStateException("Can't release this INDArray"); data.close(); released = true; }

Target:
public void close() { if (released || isEmpty()) return; if (!closeable()) throw new ND4JIllegalStateException("Can't release this INDArray"); data.close(); released = true; }
Source:
private static void showInAppReview() { Context context = mContext.get(); if (context == null) { return; } ReviewManager manager = ReviewManagerFactory.create(context); Task<ReviewInfo> request = manager.requestReviewFlow(); request .addOnCompleteListener(task -> { if (task.isSuccessful()) { ReviewInfo reviewInfo = task.getResult(); Task<Void> flow = manager.launchReviewFlow((Activity) context, reviewInfo); flow .addOnCompleteListener(task1 -> { saveRated(); Toast.makeText(context, "Review saved", Toast.LENGTH_SHORT).show(); Log.i("ReviewDialog", "Successfully finished in-app review"); }) .addOnFailureListener(error -> { Log.i("ReviewDialog", "failed in reviewing process"); }); } }) .addOnFailureListener(error -> { Log.i("ReviewDialog", "failed to get in-app review request"); }); }

Target:
private static void showInAppReview() { Context context = mContext.get(); if (context == null) { return; } ReviewManager manager = ReviewManagerFactory.create(context); Task<ReviewInfo> request = manager.requestReviewFlow(); request.addOnCompleteListener(task -> { if (task.isSuccessful()) { ReviewInfo reviewInfo = task.getResult(); Task<Void> flow = manager.launchReviewFlow((Activity) context, reviewInfo); flow.addOnCompleteListener(task1 -> { int previousAttempts = mPreferences.getInt(KEY_NUMBER_OF_REVIEWS, 0); if (previousAttempts >= 3) { saveRated(); } else { resetStartDate(); mPreferences .edit() .putInt(KEY_NUMBER_OF_REVIEWS, previousAttempts + 1) .apply(); } Log.i("ReviewDialog", "Successfully finished in-app review"); }) .addOnFailureListener(error -> { Log.i("ReviewDialog", "failed in reviewing process"); }); } }) .addOnFailureListener(error -> { Log.i("ReviewDialog", "failed to get in-app review request"); }); }
Source:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<>(); locks.put(getVmId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); return locks; }

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { return Collections.singletonMap(getVmId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); }
Source:
public void testUpdateWhenNotCachingData() throws Exception { client.create().forPath("/test"); cache = new TreeCache(client, "/test", false); cache.start(); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test"); assertEvent(TreeCacheEvent.Type.INITIALIZED); client.create().forPath("/test/foo", "first".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/foo"); client.setData().forPath("/test/foo", "something new".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_UPDATED, "/test/foo"); assertNoMoreEvents(); }

Target:
public void testUpdateWhenNotCachingData() throws Exception { client.create().forPath("/test"); cache = new MyTreeCache(client, "/test", false); cache.start(); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test"); assertEvent(TreeCacheEvent.Type.INITIALIZED); client.create().forPath("/test/foo", "first".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_ADDED, "/test/foo"); client.setData().forPath("/test/foo", "something new".getBytes()); assertEvent(TreeCacheEvent.Type.NODE_UPDATED, "/test/foo"); assertNoMoreEvents(); }
Source:
public void loadLaunchConfigOsgiRepoTestCase() throws MalformedURLException { URL osgiRepoURL = launchConfig.getCarbonOSGiRepository(); Path expectedPath = Paths.get(System.getProperty(Constants.CARBON_HOME), "wso2/lib"); if (System.getProperty("os.name").toLowerCase(Locale.getDefault()).contains("windows")) { Assert.assertEquals(Paths.get(osgiRepoURL.getPath()).toUri().toURL().toString(), expectedPath.toUri().toURL().toString()); } else { Assert.assertEquals(osgiRepoURL.toString(), "file:".concat(expectedPath.toString())); } }

Target:
public void loadLaunchConfigOsgiRepoTestCase() throws MalformedURLException { final String osgiRepo = "wso2/lib"; URL osgiRepoURL = launchConfig.getCarbonOSGiRepository(); Path expectedPath = Paths.get(System.getProperty(Constants.CARBON_HOME), osgiRepo); if (System.getProperty("os.name").toLowerCase(Locale.getDefault()).contains("windows")) { Assert.assertEquals(Paths.get(osgiRepoURL.getPath()).toUri().toURL().toString(), expectedPath.toUri().toURL().toString()); } else { Assert.assertEquals(osgiRepoURL.toString(), "file:".concat(expectedPath.toString())); } }
Source:
public void testLoadOpportunityMRUObjectsFromServer() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(Constants.OPPORTUNITY, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); Map<String, String> idToNames = new HashMap<String, String>(); int numberOfRecords = 1; idToNames = createRecordsOnServer(numberOfRecords, Constants.OPPORTUNITY); String[] names = idToNames.values().toArray(new String[numberOfRecords]);; String[] ids = idToNames.keySet().toArray(new String[numberOfRecords]); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(Constants.OPPORTUNITY, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size()+numberOfRecords, mruObjects.size()); assertEquals("Recently viewed object name is incorrect", names[0], mruObjects.get(0).getName()); } finally { deleteRecordsOnServer(ids, Constants.OPPORTUNITY); } }

Target:
public void testLoadOpportunityMRUObjectsFromServer() throws Exception { final List<SalesforceObject> mruObjects_before = metadataManager.loadMRUObjects(Constants.OPPORTUNITY, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); int numberOfRecords = 1; Map<String, String> idToNames = createRecordsOnServer(numberOfRecords, Constants.OPPORTUNITY); Collection<String> names = idToNames.values(); Set<String> ids = idToNames.keySet(); try { Thread.sleep(2000); final List<SalesforceObject> mruObjects = metadataManager.loadMRUObjects(Constants.OPPORTUNITY, MAX_QUERY_LIMIT, CachePolicy.RELOAD_AND_RETURN_CACHE_DATA, REFRESH_INTERVAL, null); assertNotNull("MRU list should not be null", mruObjects); assertEquals("MRU list size should not be changed", mruObjects_before.size()+numberOfRecords, mruObjects.size()); assertEquals("Recently viewed object name is incorrect", names.toArray()[0], mruObjects.get(0).getName()); } finally { deleteRecordsOnServer(ids, Constants.OPPORTUNITY); } }
Source:
private static List<URI> findPreferredURIs(AbstractInvocationContext context, List<URI> uris) { Collection<URI> attachment = context.getAttachment(TransactionInterceptor.PREFERRED_DESTINATIONS); if (attachment == null) { return null; } HashSet<URI> preferred = new HashSet<>(attachment); List<URI> result = null; for (URI check : uris) { if (preferred.contains(check) && !isBlackListed(context, check)) { if (result == null) { result = new ArrayList<>(preferred.size()); } result.add(check); } } if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("NamingEJBClientInterceptor: computing preffered URIs: URIs = %s, preferred URIs = %s", uris, result); } return result; }

Target:
private static List<URI> findPreferredURIs(AbstractInvocationContext context, List<URI> uris) { Collection<URI> attachment = context.getAttachment(TransactionInterceptor.PREFERRED_DESTINATIONS); if (attachment == null) { return null; } HashSet<URI> preferred = new HashSet<>(attachment); List<URI> result = null; for (URI check : uris) { if (preferred.contains(check) && !isBlackListed(context, check)) { if (result == null) { result = new ArrayList<>(preferred.size()); } result.add(check); } } if (Logs.INVOCATION.isDebugEnabled()) { Logs.INVOCATION.debugf("NamingEJBClientInterceptor: computing preferred URIs: URIs = %s, preferred URIs = %s", uris, result); } return result; }
Source:
public String injectOrganisationId(String path) { String organisationId = organisationIdSupplier.get(); List<String> list = Lists.newArrayList(Splitter.on("/").split(path)); if (list.size() > ORGANIZATION_ID_INDEX && !list.get(ORGANIZATION_ID_INDEX).equals(organisationId)) { list.add(ORGANIZATION_ID_INDEX, organisationId); } return Joiner.on("/").join(list); }

Target:
String injectOrganisationId(String path) { String organisationId = organisationIdSupplier.get(); List<String> list = Lists.newArrayList(Splitter.on("/").split(path)); if (list.size() > ORGANIZATION_ID_INDEX && !list.get(ORGANIZATION_ID_INDEX).equals(organisationId)) { list.add(ORGANIZATION_ID_INDEX, organisationId); } return Joiner.on("/").join(list); }
Source:
private String getProcessingTitleForAction(String actionType) { if (actionType.equals(ARG_ACTION_LIKE)) { return getString(R.string.comment_q_action_liking); } else if (actionType.equals(ARG_ACTION_APPROVE)) { return getString(R.string.comment_q_action_approving); } else if (actionType.equals(ARG_ACTION_REPLY)) { return getString(R.string.comment_q_action_replying); } else { return getString(R.string.comment_q_action_processing); } }

Target:
private String getProcessingTitleForAction(String actionType) { if (actionType != null) { switch (actionType) { case ARG_ACTION_LIKE: return getString(R.string.comment_q_action_liking); case ARG_ACTION_APPROVE: return getString(R.string.comment_q_action_approving); case ARG_ACTION_REPLY: return getString(R.string.comment_q_action_replying); default: return getString(R.string.comment_q_action_processing); } } else { return getString(R.string.comment_q_action_processing); } }
Source:
private void normalizeMachine(String name, CheServiceImpl service, ExtendedMachine extendedMachine) { if (extendedMachine.getAttributes() != null && extendedMachine.getAttributes().containsKey("memoryLimitBytes")) { try { service.setMemLimit(Long.parseLong(extendedMachine.getAttributes().get("memoryLimitBytes"))); } catch (NumberFormatException e) { throw new IllegalArgumentException( format("Value of attribute 'memoryLimitBytes' of machine '%s' is illegal", name)); } } if (service.getExpose() != null) { service.setExpose(service.getExpose() .stream() .map(expose -> expose.contains("/") ? expose : expose + "/tcp") .collect(toList())); } if (extendedMachine.getServers() != null) { extendedMachine.getServers().forEach((serverRef, serverConf) -> { String normalizedPort = serverConf.getPort().contains("/") ? serverConf.getPort() : serverConf.getPort() + "/tcp"; service.getExpose().add(normalizedPort); service.getLabels().put(SERVER_CONF_LABEL_PREFIX + normalizedPort + SERVER_CONF_LABEL_REF_SUFFIX, serverRef); if (serverConf.getProperties() != null && serverConf.getProperties().get("path") != null) { service.getLabels().put(SERVER_CONF_LABEL_PREFIX + normalizedPort + SERVER_CONF_LABEL_PATH_SUFFIX, serverConf.getProperties().get("path")); } if (serverConf.getProtocol() != null) { service.getLabels().put(SERVER_CONF_LABEL_PREFIX + normalizedPort + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, serverConf.getProtocol()); } }); } }

Target:
private void normalizeMachine(String name, CheServiceImpl service, ExtendedMachine extendedMachine) { if (extendedMachine.getAttributes().containsKey("memoryLimitBytes")) { try { service.setMemLimit(Long.parseLong(extendedMachine.getAttributes().get("memoryLimitBytes"))); } catch (NumberFormatException e) { throw new IllegalArgumentException( format("Value of attribute 'memoryLimitBytes' of machine '%s' is illegal", name)); } } service.setExpose(service.getExpose() .stream() .map(expose -> expose.contains("/") ? expose : expose + "/tcp") .collect(toList())); extendedMachine.getServers().forEach((serverRef, serverConf) -> { String normalizedPort = serverConf.getPort().contains("/") ? serverConf.getPort() : serverConf.getPort() + "/tcp"; service.getExpose().add(normalizedPort); String portLabelPrefix = SERVER_CONF_LABEL_PREFIX + normalizedPort; service.getLabels().put(portLabelPrefix + SERVER_CONF_LABEL_REF_SUFFIX, serverRef); if (serverConf.getProperties() != null && serverConf.getProperties().get("path") != null) { service.getLabels().put(portLabelPrefix + SERVER_CONF_LABEL_PATH_SUFFIX, serverConf.getProperties().get("path")); } if (serverConf.getProtocol() != null) { service.getLabels().put(portLabelPrefix + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, serverConf.getProtocol()); } }); }
Source:
public void perform(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException { if(run instanceof AbstractBuild) { AbstractBuild<?,?> abstractBuild = (AbstractBuild<?,?>) run; Updater updater = new Updater(abstractBuild.getParent().getScm(), labels); updater.perform(run, listener, getIssueSelector()); } else if(scm != null) { Updater updater = new Updater(scm, labels); updater.perform(run, listener, getIssueSelector()); } else { throw new IllegalArgumentException("Unsupported job type "+run.getClass().getName()); } }

Target:
public void perform(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException { if (run instanceof MatrixRun) { return; } else if(run instanceof AbstractBuild) { AbstractBuild<?,?> abstractBuild = (AbstractBuild<?,?>) run; Updater updater = new Updater(abstractBuild.getParent().getScm(), labels); updater.perform(run, listener, getIssueSelector()); } else if(scm != null) { Updater updater = new Updater(scm, labels); updater.perform(run, listener, getIssueSelector()); } else { throw new IllegalArgumentException("Unsupported run type "+run.getClass().getName()); } }
Source:
public DistributedQueryRunner(Session defaultSession, int workersCount, Map<String, String> extraProperties) throws Exception { this(defaultSession, workersCount, extraProperties, ImmutableMap.of(), DEFAULT_SQL_PARSER_OPTIONS, ENVIRONMENT); }

Target:
public DistributedQueryRunner(Session defaultSession, int workersCount, Map<String, String> extraProperties) throws Exception { this(defaultSession, workersCount, extraProperties, ImmutableMap.of(), DEFAULT_SQL_PARSER_OPTIONS, ENVIRONMENT, DEFAULT_PROTOCOL_VERSION); }
Source:
public void prepareRun(BatchSourceContext context) throws IOException { Job job = JobUtils.createInstance(); Configuration conf = job.getConfiguration(); CopybookInputFormat.setCopybookInputformatCblContents(job, config.copybookContents); CopybookInputFormat.setBinaryFilePath(job, config.binaryFilePath); CopybookInputFormat.setInputPaths(job, config.binaryFilePath); CopybookInputFormat.setMaxInputSplitSize(job, conf.getLong(CopybookInputFormat.MAX_SPLIT_SIZE_DESCRIPTION, DEFAULT_MAX_SPLIT_SIZE)); context.setInput(Input.of(config.referenceName, new SourceInputFormatProvider(CopybookInputFormat.class, conf))); }

Target:
public void prepareRun(BatchSourceContext context) throws IOException { Job job = JobUtils.createInstance(); CopybookInputFormat.setCopybookInputformatCblContents(job, config.copybookContents); CopybookInputFormat.setBinaryFilePath(job, config.binaryFilePath); CopybookInputFormat.setInputPaths(job, config.binaryFilePath); CopybookInputFormat.setMaxInputSplitSize(job, config.maxSplitSize); context.setInput(Input.of(config.referenceName, new SourceInputFormatProvider(CopybookInputFormat.class, job.getConfiguration()))); }
Source:
private SAMFileHeader loadSamHeader() throws ErrorMsg { if (run == null) { throw new RuntimeException("Cannot load SAMFileHeader - SRA run is uninitialized"); } String runName = run.getName(); SAMFileHeader header = new SAMFileHeader(); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); ReadGroupIterator itRg = run.getReadGroups(); while (itRg.nextReadGroup()) { String rgName = itRg.getName(); if (rgName.equals("")) rgName = "_"; SAMReadGroupRecord rg = new SAMReadGroupRecord(rgName); rg.setSample(runName); header.addReadGroup(rg); } ReferenceIterator itRef = run.getReferences(); while (itRef.nextReference()) { header.addSequence(new SAMSequenceRecord(itRef.getCanonicalName(), (int) itRef.getLength())); } return header; }

Target:
private SAMFileHeader loadSamHeader() throws ErrorMsg { if (run == null) { throw new RuntimeException("Cannot load SAMFileHeader - SRA run is uninitialized"); } String runName = run.getName(); SAMFileHeader header = new SAMFileHeader(); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); ReadGroupIterator itRg = run.getReadGroups(); while (itRg.nextReadGroup()) { String rgName = itRg.getName(); if (rgName.isEmpty()) rgName = runName; SAMReadGroupRecord rg = new SAMReadGroupRecord(rgName); rg.setSample(runName); header.addReadGroup(rg); } ReferenceIterator itRef = run.getReferences(); while (itRef.nextReference()) { header.addSequence(new SAMSequenceRecord(itRef.getCanonicalName(), (int) itRef.getLength())); } return header; }
Source:
ScriptRunner getScriptRunner(String type) { ScriptRunner scriptRunner = scriptRunners.get(type); if (scriptRunner == null) { throw new UnknownScriptTypeException(type); } return scriptRunner; }

Target:
ScriptRunner getScriptRunner(String type) { ScriptRunner scriptRunner = scriptRunners.get(type); if (scriptRunner == null) { throw new UnknownEntityException(scriptTypeMetaData, type); } return scriptRunner; }
Source:
public SortedSet<Marker> getMarkers(Alloc a) { SortedSet<Marker> ret = a.getMarkers(); ret.removeIf(m -> m.isQcOnly() && !showQcMarkers); return ret; }

Target:
public SortedSet<Marker> getMarkers(Alloc a) { final SortedSet<Marker> ret = a.getMarkers(); if (!showQcMarkers) ret.removeIf(Marker::isQcOnly); return ret; }
Source:
public CRParseResult responseMessageForParseDirectory(String responseBody) { ErrorCollection errors = new ErrorCollection(); try { ResponseScratch responseMap = parseResponseForMigration(responseBody); ParseDirectoryResponseMessage parseDirectoryResponseMessage; if (responseMap.target_version == null) { errors.addError("Plugin response message", "missing 'target_version' field"); return new CRParseResult(errors); } else { int version = responseMap.target_version; while (version < CURRENT_CONTRACT_VERSION) { responseBody = migrate(responseBody, version + 1); version++; } parseDirectoryResponseMessage = codec.getGson().fromJson(responseBody, ParseDirectoryResponseMessage.class); parseDirectoryResponseMessage.validateResponse(errors); errors.addErrors(parseDirectoryResponseMessage.getPluginErrors()); return new CRParseResult(parseDirectoryResponseMessage.getEnvironments(), parseDirectoryResponseMessage.getPipelines(), errors); } } catch (Exception ex) { StringBuilder builder = new StringBuilder(); builder.append("Unexpected error when handling plugin response").append('\n'); builder.append(ex); errors.addError("runtime", builder.toString()); LOGGER.error(builder.toString(), ex); return new CRParseResult(errors); } }

Target:
public CRParseResult responseMessageForParseDirectory(String responseBody) { ErrorCollection errors = new ErrorCollection(); try { ResponseScratch responseMap = parseResponseForMigration(responseBody); ParseDirectoryResponseMessage parseDirectoryResponseMessage; if (responseMap.target_version == null) { errors.addError("Plugin response message", "missing 'target_version' field"); return new CRParseResult(errors); } else { int version = responseMap.target_version; while (version < CURRENT_CONTRACT_VERSION) { version++; responseBody = migrate(responseBody, version); } parseDirectoryResponseMessage = codec.getGson().fromJson(responseBody, ParseDirectoryResponseMessage.class); parseDirectoryResponseMessage.validateResponse(errors); errors.addErrors(parseDirectoryResponseMessage.getPluginErrors()); return new CRParseResult(parseDirectoryResponseMessage.getEnvironments(), parseDirectoryResponseMessage.getPipelines(), errors); } } catch (Exception ex) { StringBuilder builder = new StringBuilder(); builder.append("Unexpected error when handling plugin response").append('\n'); builder.append(ex); errors.addError("runtime", builder.toString()); LOGGER.error(builder.toString(), ex); return new CRParseResult(errors); } }
Source:
public void testTableNames() throws IOException { String[] goodNames = { "a", "1", "_", "_x", "a-._5x", "_a-._5x", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi", "jklmnopqrstuvwxyz1234567890_-." }; String[] badNames = { "-x", ".x", "a!", "a@", "a#", "a$", "a%", "a^", "a&", "a*", "a(", "a+", "a=", "a~", "a`", "a{", "a[", "a|", "a\\", "a/", "a<", "a,", "a?", "a" + RandomStringUtils.random(10, false, false) }; Admin admin = getConnection().getAdmin(); for (String badName : badNames) { boolean failed = false; try { HTableDescriptor descriptor = new HTableDescriptor(TableName.valueOf(badName)); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); admin.createTable(descriptor); } catch (IllegalArgumentException e) { failed = true; } Assert.assertTrue("Should fail as table name: '" + badName + "'", failed); } for(String goodName : goodNames) { TableName tableName = TableName.valueOf(goodName); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); IOException exception = null; if (!admin.tableExists(tableName)) { try { admin.createTable(descriptor); } catch (IOException e){ exception = e; } } try { admin.disableTable(tableName); admin.deleteTable(tableName); } catch (Exception e) { new Logger(getClass()).warn("Clould not delete table %s", e, tableName); } if (exception != null) { throw exception; } } }

Target:
public void testTableNames() throws IOException { String[] goodNames = { "a", "1", "_", "_x", "a-._5x", "_a-._5x", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi", "jklmnopqrstuvwxyz1234567890_-." }; String[] badNames = { "-x", ".x", "a!", "a@", "a#", "a$", "a%", "a^", "a&", "a*", "a(", "a+", "a=", "a~", "a`", "a{", "a[", "a|", "a\\", "a/", "a<", "a,", "a?", "a" + RandomStringUtils.random(10, false, false) }; Admin admin = getConnection().getAdmin(); for (String badName : badNames) { boolean failed = false; try { HTableDescriptor descriptor = new HTableDescriptor(TableName.valueOf(badName)); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); admin.createTable(descriptor); } catch (IllegalArgumentException e) { failed = true; } Assert.assertTrue("Should fail as table name: '" + badName + "'", failed); } for(String goodName : goodNames) { TableName tableName = TableName.valueOf(goodName); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); admin.createTable(descriptor); admin.disableTable(tableName); admin.deleteTable(tableName); } }
Source:
public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? (disksLeftInVm.isEmpty() ? AuditLogType.USER_REMOVE_VM_FINISHED : AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS) : AuditLogType.USER_FAILED_REMOVE_VM; }

Target:
public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? AuditLogType.USER_REMOVE_VM_FINISHED : AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS; }
Source:
public void testFilterBuilderUri() { Warp .execute(clientAction) .filter(request().uri().endsWith(".jsf").build()) .verify(serverAssertion); }

Target:
public void testFilterBuilderUri() { Warp .execute(clientAction) .filter(request().uri().endsWith(".jsf")) .verify(serverAssertion); }
Source:
public Response intercept(final Chain chain) throws IOException { final Response response = chain.proceed(chain.request()); if (response.isSuccessful()) { return response; } else { final ResponseBody body = response.body(); if (body != null) { final Reader bodyReader = body.charStream(); if (bodyReader != null) { try { final JsonNode responseBody = this.mapper.readTree(bodyReader); throw new GenieClientException( response.code(), response.message() + " : " + responseBody.get(ERROR_MESSAGE_KEY).asText() ); } catch (final JsonProcessingException jpe) { throw new GenieClientException(response.code(), response.message() + " " + jpe.getMessage()); } } } throw new GenieClientException(response.code(), "Unable to find response body to parse error message from"); } }

Target:
public Response intercept(final Chain chain) throws IOException { final Response response = chain.proceed(chain.request()); if (response.isSuccessful()) { return response; } else { final ResponseBody body = response.body(); if (body != null) { final Reader bodyReader = body.charStream(); if (bodyReader != null) { try { final JsonNode responseBody = this.mapper.readTree(bodyReader); final String errorMessage = responseBody == null || !responseBody.has(ERROR_MESSAGE_KEY) ? EMPTY_STRING : responseBody.get(ERROR_MESSAGE_KEY).asText(); throw new GenieClientException( response.code(), response.message() + " : " + errorMessage ); } catch (final JsonProcessingException jpe) { throw new GenieClientException(response.code(), response.message() + " " + jpe.getMessage()); } } } throw new GenieClientException(response.code(), "Unable to find response body to parse error message from"); } }
Source:
public CompositeMenuBuilder(final String label, final Collection<AbstractMenuBuilder> menus) { this.label = label; this.menus = menus; AbstractMenuBuilder firstMenu = (AbstractMenuBuilder) menus.toArray()[0]; priority = firstMenu.getPriority(); }

Target:
public CompositeMenuBuilder(final String label, final Collection<AbstractMenuBuilder> menus) { this.label = label; this.menus = menus; if (menus != null && menus.toArray().length > 0) { AbstractMenuBuilder firstMenu = (AbstractMenuBuilder) menus.toArray()[0]; priority = firstMenu.getPriority(); } }
Source:
public static void main(String[] args) { MungeOptions options = handleOptions(MungeOptions.class, args); UrisScheme uris = OptionsUtils.WikibaseOptions.wikibaseUris(options); Munger munger = mungerFromOptions(options); int chunksize = options.chunkSize(); if (chunksize < 1) { chunksize = Integer.MAX_VALUE; } try { Munge munge = new Munge(uris, munger, CliUtils.reader(options.from()), chunksize, options.to()); munge.run(); } catch (IOException | RDFHandlerException | RDFParseException | InterruptedException e) { log.error("Fatal error munging RDF", e); System.exit(1); } }

Target:
public static void main(String[] args) { MungeOptions options = handleOptions(MungeOptions.class, args); UrisScheme uris = OptionsUtils.WikibaseOptions.wikibaseUris(options); Munger munger = mungerFromOptions(options); int chunksize = options.chunkSize(); if (chunksize < 1) { chunksize = Integer.MAX_VALUE; } try { Munge munge = new Munge(uris, munger, CliUtils.reader(options.from()), chunksize, options.to()); munge.run(); } catch (Exception e) { log.error("Fatal error munging RDF", e); System.exit(1); } }
Source:
public String getResourceName() { return null; }

Target:
public String getResourceName() { return name; }
Source:
public Transaction beginTransaction(MuleContext muleContext) throws TransactionException { try { XaTransaction xat = new XaTransaction(muleContext.getConfiguration().getId(), muleContext.getTransactionManager(), ((MuleContextWithRegistry) muleContext).getRegistry().lookupObject(NotificationDispatcher.class), timeout); xat.begin(); return xat; } catch (Exception e) { throw new TransactionException(cannotStartTransaction("XA"), e); } }

Target:
public Transaction beginTransaction(MuleContext muleContext) throws TransactionException { try { return this.beginTransaction(muleContext.getConfiguration().getId(), ((MuleContextWithRegistry) muleContext).getRegistry() .lookupObject(NotificationDispatcher.class), muleContext.getTransactionFactoryManager(), muleContext.getTransactionManager(), 10000); } catch (RegistrationException e) { throw new TransactionException(cannotStartTransaction("XA"), e); } }
Source:
protected ImmutableMap<String, ImmutableList<Object>> getParameters() { ImmutableList.Builder<Object> listOfActionChains = ImmutableList.builder(); ImmutableList<TouchAction> touchActions = actions.build(); touchActions.forEach(action -> listOfActionChains.add(action.getParameters().get("actions"))); return ImmutableMap.of("actions", listOfActionChains.build()); }

Target:
protected Map<String, List<Object>> getParameters() { ImmutableList<TouchAction> touchActions = actions.build(); return ImmutableMap.of("actions", touchActions.stream().map(touchAction -> touchAction.getParameters().get("actions")).collect(toList())); }
Source:
public void moveMarker(View view, int left, int top) { MarkerPlugin.LayoutParams lp = (LayoutParams) view.getLayoutParams(); if (lp == null) { return; } lp.mLeft = left; lp.mTop = top; view.setLeft(left); view.setTop(top); }

Target:
public void moveMarker(View view, int left, int top) { MarkerPlugin.LayoutParams lp = (LayoutParams) view.getLayoutParams(); if (lp == null) { return; } lp.x = left; lp.y = top; populateLayoutParams(view); view.setLeft(lp.mLeft); view.setTop(lp.mTop); }
Source:
public static SshMachineLocation getSshMachine(Entity entity) { try { Collection<Location> locations = entity.getLocations(); if (locations.size()==1) return (SshMachineLocation) Iterables.getOnlyElement( entity.getLocations() ); Collection<Location> sshs = LocationFunctions.filter(locations, LocationFunctions.isOfType(SshMachineLocation.class)); return (SshMachineLocation) Iterables.getOnlyElement( sshs ); } catch (Exception e) { throw new IllegalStateException("Entity "+entity+" (in "+Tasks.current()+") requires a single SshMachineLocation, but has "+entity.getLocations(), e); } }

Target:
public static SshMachineLocation getSshMachine(Entity entity) { try { return Machines.findUniqueSshMachineLocation(entity.getLocations()).get(); } catch (Exception e) { throw new IllegalStateException("Entity "+entity+" (in "+Tasks.current()+") requires a single SshMachineLocation, but has "+entity.getLocations(), e); } }
Source:
protected AbstractTransmission( TransmissionMeta meta, BooleanSupplier stopChecker, IgniteLogger log, int chunkSize ) { A.notNull(meta, "Initial file meta cannot be null"); A.notNullOrEmpty(meta.name(), "Trasmisson name cannot be empty or null"); A.ensure(meta.offset() >= 0, "File start position cannot be negative"); A.ensure(meta.count() >= 0, "Total number of bytes to transfer must be greater than zero"); A.notNull(stopChecker, "Process stop checker cannot be null"); A.ensure(chunkSize > 0, "Size of chunks to transfer data must be positive"); this.stopChecker = stopChecker; this.log = log.getLogger(AbstractTransmission.class); this.chunkSize = chunkSize; this.meta = meta; }

Target:
protected AbstractTransmission( TransmissionMeta meta, BooleanSupplier stopChecker, IgniteLogger log, int chunkSize ) { A.notNull(meta, "Initial file meta cannot be null"); A.notNullOrEmpty(meta.name(), "Trasmisson name cannot be empty or null"); A.ensure(meta.offset() >= 0, "File start position cannot be negative"); A.ensure(meta.count() >= 0, "Total number of bytes to transfer can't be less than zero"); A.notNull(stopChecker, "Process stop checker cannot be null"); A.ensure(chunkSize > 0, "Size of chunks to transfer data must be positive"); this.stopChecker = stopChecker; this.log = log.getLogger(AbstractTransmission.class); this.chunkSize = chunkSize; this.meta = meta; }
Source:
private IStatus importTraceFiles(TracePackageFilesElement traceFilesElement, IProgressMonitor monitor) { List<Pair<String, String>> fileNameAndLabelPairs = new ArrayList<>(); String sourceName = traceFilesElement.getFileName(); String destinationName = traceFilesElement.getParent().getText(); fileNameAndLabelPairs.add(new Pair<>(sourceName, destinationName)); IPath containerPath = fTmfTraceFolder.getPath(); IStatus status = importFiles(getSpecifiedArchiveFile(), fileNameAndLabelPairs, containerPath, monitor); if (status.isOK()) { new TmfNavigatorContentProvider().getChildren(fTmfTraceFolder); } return status; }

Target:
private IStatus importTraceFiles(TracePackageFilesElement traceFilesElement, IProgressMonitor monitor) { List<Pair<String, String>> fileNameAndLabelPairs = new ArrayList<>(); String sourceName = traceFilesElement.getFileName(); String destinationName = traceFilesElement.getParent().getText(); fileNameAndLabelPairs.add(new Pair<>(sourceName, destinationName)); IPath containerPath = fTmfTraceFolder.getPath(); IStatus status = importFiles(getSpecifiedArchiveFile(), fileNameAndLabelPairs, containerPath, monitor); return status; }