auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static OMClientRequest getOMAclRequest(OMRequest omRequest) { Type cmdType = omRequest.getCmdType(); if (Type.AddAcl == cmdType) { ObjectType type = omRequest.getAddAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeAddAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketAddAclRequest(omRequest); } else if (type == ObjectType.KEY) { return new OMKeyAddAclRequest(omRequest); } } else if (Type.RemoveAcl == cmdType) { ObjectType type = omRequest.getRemoveAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeRemoveAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketRemoveAclRequest(omRequest); } else if (type == ObjectType.KEY) { return new OMKeyRemoveAclRequest(omRequest); } } else if (Type.SetAcl == cmdType) { ObjectType type = omRequest.getSetAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeSetAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketSetAclRequest(omRequest); } else if (ObjectType.KEY == type) { return new OMKeySetAclRequest(omRequest); } } return null; }

Target:
private static OMClientRequest getOMAclRequest(OMRequest omRequest) { Type cmdType = omRequest.getCmdType(); if (Type.AddAcl == cmdType) { ObjectType type = omRequest.getAddAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeAddAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketAddAclRequest(omRequest); } else if (ObjectType.KEY == type) { return new OMKeyAddAclRequest(omRequest); } } else if (Type.RemoveAcl == cmdType) { ObjectType type = omRequest.getRemoveAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeRemoveAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketRemoveAclRequest(omRequest); } else if (ObjectType.KEY == type) { return new OMKeyRemoveAclRequest(omRequest); } } else if (Type.SetAcl == cmdType) { ObjectType type = omRequest.getSetAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeSetAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketSetAclRequest(omRequest); } else if (ObjectType.KEY == type) { return new OMKeySetAclRequest(omRequest); } } return null; }
Source:
private boolean miniBatchEnabled() { return !"1".equals(this.modelConfig.getTrain().getParams().getOrDefault(CommonConstants.MINI_BATCH, "1").toString()); }

Target:
private boolean miniBatchEnabled() { return null != this.modelConfig.getTrain().getParams().get(CommonConstants.MINI_BATCH); }
Source:
public CuratorFramework provideCurator(ZooKeeperConfiguration config, BaragonConnectionStateListener connectionStateListener) { CuratorFramework client = CuratorFrameworkFactory.builder() .connectString(config.getQuorum()) .sessionTimeoutMs(config.getSessionTimeoutMillis()) .connectionTimeoutMs(config.getConnectTimeoutMillis()) .retryPolicy(new ExponentialBackoffRetry(config.getRetryBaseSleepTimeMilliseconds(), config.getRetryMaxTries())) .defaultData(new byte[] {}) .build(); client.getConnectionStateListenable().addListener(connectionStateListener); client.start(); return client.usingNamespace(config.getZkNamespace()); }

Target:
public CuratorFramework provideCurator(ZooKeeperConfiguration config, BaragonConnectionStateListener connectionStateListener) { CuratorFramework client = CuratorFrameworkFactory.builder() .connectString(config.getQuorum()) .sessionTimeoutMs(config.getSessionTimeoutMillis()) .connectionTimeoutMs(config.getConnectTimeoutMillis()) .retryPolicy(new ExponentialBackoffRetry(config.getRetryBaseSleepTimeMilliseconds(), config.getRetryMaxTries())) .defaultData(new byte[0]) .build(); client.getConnectionStateListenable().addListener(connectionStateListener); client.start(); return client.usingNamespace(config.getZkNamespace()); }
Source:
public DDF[] listDDFs() { return mDDFCache.asMap().values().toArray(new DDF[]{}); }

Target:
public DDF[] listDDFs() { List<DDF> ddfs = new ArrayList<DDF>(); ddfs.addAll(mDDFCache.asMap().values()); ddfs.addAll(mDDFwithNameCache.asMap().values()); return ddfs.toArray(new DDF[] {}); }
Source:
Collection<String> getBundleCategories() { if(bundle!=null) { String categories = bundle.getHeaders().get(Constants.BUNDLE_CATEGORY); if(categories!=null) { String[] catArray = categories.split(","); if(catArray.length==1) { return Arrays.asList(new String[]{categories}); } else { return Arrays.asList(catArray); } } } return new ArrayList<String>(); }

Target:
public Collection<String> getBundleCategories() { if(bundle!=null) { String categories = bundle.getHeaders().get(Constants.BUNDLE_CATEGORY); if(categories!=null) { String[] catArray = categories.split(","); if(catArray.length==1) { return Arrays.asList(new String[]{categories}); } else { return Arrays.asList(catArray); } } } else if(obrResource!=null && obrResource.getCategories()!=null) { return Arrays.asList(obrResource.getCategories()); } return new ArrayList<String>(); }
Source:
public EntitlerJobConfig setOwner(final Owner owner) { if (owner == null) { throw new IllegalArgumentException("Owner is null"); } this.setJobArgument(OWNER_KEY, owner.getKey()) .setLogLevel(owner.getLogLevel()); return this; }

Target:
public EntitlerJobConfig setOwner(final Owner owner) { if (owner == null) { throw new IllegalArgumentException("Owner is null"); } this.setJobMetadata(OWNER_KEY, owner.getKey()) .setLogLevel(owner.getLogLevel()); return this; }
Source:
private static Link getConfirmMobileLink(UUID userID) { ControllerLinkBuilder linkBuilder = linkTo( methodOn(UserController.class).confirmMobileNumber(Optional.empty(), userID, null)); return linkBuilder.withSelfRel(); }

Target:
private static Link getConfirmMobileLink(UUID userID) { ControllerLinkBuilder linkBuilder = linkTo( methodOn(UserController.class).confirmMobileNumber(Optional.empty(), userID, null)); return linkBuilder.withRel("confirmMobileNumber"); }
Source:
DraftBox addReplyBox() { DraftBox box = getDiffScreen().addDraftBox(getDiffScreen().createReply(comment), getSide()); registerReplyBox(box); return box; }

Target:
void addReplyBox() { getCommentManager().addDraftBox( getCm().side(), CommentInfo.createReply(comment)).setEdit(true); }
Source:
static Collection<TagNameDefinition> getProjectVICDefaultDefinitions() { return PROJECT_VIC_TAG_DEFINITIONS.values(); }

Target:
static Collection<TagNameDefinition> getProjectVICDefaultDefinitions() { return Collections.unmodifiableCollection(PROJECT_VIC_TAG_DEFINITIONS.values()); }
Source:
public InstallModel() { setUserPassword(new EntityModel()); setOVirtISO(new ListModel()); setHostVersion(new EntityModel()); setOverrideIpTables(new EntityModel()); getOverrideIpTables().setEntity(false); setUserName(new EntityModel()); getUserName().setEntity("root"); getUserName().setIsChangable(false); setPublicKey(new EntityModel()); getPublicKey().setEntity(constants.empty()); fetchPublicKey(); setNetworkProviderModel(new HostNetworkProviderModel()); }

Target:
public InstallModel() { setUserPassword(new EntityModel()); setOVirtISO(new ListModel()); setHostVersion(new EntityModel()); setOverrideIpTables(new EntityModel()); getOverrideIpTables().setEntity(false); setUserName(new EntityModel()); getUserName().setEntity(RootUserName); getUserName().setIsChangable(false); setPublicKey(new EntityModel()); getPublicKey().setEntity(constants.empty()); fetchPublicKey(); setNetworkProviderModel(new HostNetworkProviderModel()); }
Source:
public Task update(UpdateTaskPayload updateTaskPayload) { TaskUpdater taskUpdater= new TaskUpdater(taskService,taskConverter,securityManager,userGroupManager); return taskUpdater.applyUpdateTaskPayload(false, updateTaskPayload); }

Target:
public Task update(UpdateTaskPayload updateTaskPayload) { return taskRuntimeHelper.applyUpdateTaskPayload(false, updateTaskPayload); }
Source:
public StorageDomain recoverStorageDomain(String sdUUID) { log.info("about to recover SD {}", sdUUID); StorageDomain storageDomain = new StorageDomain(); storageDomain.setId(sdUUID); updateStorageDomain(storageDomain); return storageDomain; }

Target:
private StorageDomain recoverStorageDomain(String sdUUID) { log.info("about to recover SD {}", sdUUID); StorageDomain storageDomain = new StorageDomain(); storageDomain.setId(sdUUID); updateStorageDomain(storageDomain); return storageDomain; }
Source:
public static boolean dialogCancellable(IEditCommandRequest request) { Object value = request.getParameter(RequestParameterConstants.DIALOG_CANCELLABLE); if (value instanceof Boolean) { return (Boolean) value; } else if (value instanceof String) { Boolean booleanObject = Boolean.valueOf((String) value); return booleanObject.booleanValue(); } return true; }

Target:
public static boolean dialogCancellable(IEditCommandRequest request) { Object value = request.getParameter(RequestParameterConstants.DIALOG_CANCELLABLE); if (value instanceof Boolean) { return (Boolean) value; } else if (value instanceof String) { Boolean booleanObject = Boolean.valueOf((String) value); return booleanObject.booleanValue(); } return false; }
Source:
public void showFinishOperation(String url, String body, final String injectedJs) { if (webView != null) { webView.getSettings().setJavaScriptEnabled(true); webView.addJavascriptInterface(new PortletDisplayInterface(), "android"); webView.postUrl(url, body.getBytes()); webView.setWebViewClient(new WebViewClient() { boolean isLoaded = false; @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); if (!isLoaded && !url.contains("/c/portal/login")) { render(view, injectedJs); isLoaded = true; } } }); } }

Target:
public void showFinishOperation(String url, String body, final String injectedJs) { if (webView != null) { webView.getSettings().setJavaScriptEnabled(true); webView.addJavascriptInterface(new PortletDisplayInterface(), "android"); webView.postUrl(url, body.getBytes()); webView.setWebViewClient(new WebViewClient() { boolean isLoaded = false; @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); if (!isLoaded && !url.contains(URL_LOGIN)) { render(view, injectedJs); isLoaded = true; } } }); } }
Source:
public void testLateData() throws Exception { expectPublishedSegments(1); final AppenderatorDriverRealtimeIndexTask task = makeRealtimeTask(null); final ListenableFuture<TaskStatus> statusFuture = runTask(task); while (task.getFirehose() == null) { Thread.sleep(50); } final TestFirehose firehose = (TestFirehose) task.getFirehose(); firehose.addRows( ImmutableList.of( ImmutableMap.of("t", now.getMillis(), "dim1", "foo", "met1", "1"), ImmutableMap.of("t", now.minus(new Period("P2D")).getMillis(), "dim2", "bar", "met1", 2.0) ) ); firehose.close(); Collection<DataSegment> publishedSegments = awaitSegments(); Assert.assertEquals(2, task.getMetrics().processed()); Assert.assertEquals(0, task.getMetrics().thrownAway()); Assert.assertEquals(0, task.getMetrics().unparseable()); Assert.assertEquals(2, sumMetric(task, null, "rows")); Assert.assertEquals(3, sumMetric(task, null, "met1")); awaitHandoffs(); for (DataSegment publishedSegment : publishedSegments) { Optional<Map.Entry<SegmentDescriptor, Pair<Executor, Runnable>>> optional = handOffCallbacks .entrySet().stream() .filter(e -> e .getKey() .equals( new SegmentDescriptor( publishedSegment.getInterval(), publishedSegment.getVersion(), publishedSegment.getShardSpec().getPartitionNum() ) ) ) .findFirst(); Assert.assertTrue( publishedSegment + " missing from handoff callbacks: " + handOffCallbacks, optional.isPresent() ); Pair<Executor, Runnable> executorRunnablePair = optional.get().getValue(); executorRunnablePair.lhs.execute(executorRunnablePair.rhs); } handOffCallbacks.clear(); final TaskStatus taskStatus = statusFuture.get(); Assert.assertEquals(TaskState.SUCCESS, taskStatus.getStatusCode()); }

Target:
public void testLateData() throws Exception { expectPublishedSegments(1); final AppenderatorDriverRealtimeIndexTask task = makeRealtimeTask(null); final ListenableFuture<TaskStatus> statusFuture = runTask(task); while (task.getFirehose() == null) { Thread.sleep(50); } final TestFirehose firehose = (TestFirehose) task.getFirehose(); firehose.addRows( ImmutableList.of( ImmutableMap.of("t", now.getMillis(), "dim1", "foo", "met1", "1"), ImmutableMap.of("t", now.minus(new Period("P2D")).getMillis(), "dim2", "bar", "met1", 2.0) ) ); firehose.close(); Collection<DataSegment> publishedSegments = awaitSegments(); Assert.assertEquals(2, task.getMetrics().processed()); Assert.assertEquals(0, task.getMetrics().thrownAway()); Assert.assertEquals(0, task.getMetrics().unparseable()); Assert.assertEquals(2, sumMetric(task, null, "rows")); Assert.assertEquals(3, sumMetric(task, null, "met1")); awaitHandoffs(); for (DataSegment publishedSegment : publishedSegments) { Pair<Executor, Runnable> executorRunnablePair = handOffCallbacks.get( new SegmentDescriptor( publishedSegment.getInterval(), publishedSegment.getVersion(), publishedSegment.getShardSpec().getPartitionNum() ) ); Assert.assertNotNull( publishedSegment + " missing from handoff callbacks: " + handOffCallbacks, executorRunnablePair ); executorRunnablePair.lhs.execute(executorRunnablePair.rhs); } handOffCallbacks.clear(); final TaskStatus taskStatus = statusFuture.get(); Assert.assertEquals(TaskState.SUCCESS, taskStatus.getStatusCode()); }
Source:
public ImageLicense processPage(int pageId, PageTitle pageTitle, JSONObject result) { try { if (result.optJSONArray("imageinfo") != null) { JSONObject imageInfo = (JSONObject) result.optJSONArray("imageinfo").get(0); ImageLicense license = parseImageLicenseMetadata(imageInfo.getJSONObject("extmetadata")); return license; } return null; } catch (JSONException e) { Log.d(TAG, "Caught exception: " + e.getMessage(), e); return null; } }

Target:
public ImageLicense processPage(int pageId, PageTitle pageTitle, JSONObject result) { try { if (result.getJSONArray("imageinfo") != null) { JSONObject imageInfo = (JSONObject) result.getJSONArray("imageinfo").get(0); ImageLicense license = parseImageLicenseMetadata(imageInfo.getJSONObject("extmetadata")); return license; } return null; } catch (JSONException e) { Log.w(TAG, e); return null; } }
Source:
static FEEL newInstance() { return new FEELImpl(Thread.currentThread().getContextClassLoader()); }

Target:
static FEEL newInstance() { return new FEELImpl(); }
Source:
public void startWatching(Collection<File> paths) { closeLock.readLock().lock(); try { ensureOpen(); startWatching0(server, toAbsolutePaths(paths)); } finally { closeLock.readLock().unlock(); } }

Target:
public void startWatching(Collection<File> paths) { ensureOpen(); startWatching0(server, toAbsolutePaths(paths)); }
Source:
public Status(Map<String, Object> innerMap) { code = (Integer) innerMap.get(CODE); if (innerMap.get(MESSAGE) == null) { message = ""; } else if (innerMap.get(MESSAGE) instanceof Object[]) { message = Arrays.toString((Object[]) innerMap.get(MESSAGE)); } else { message = innerMap.get(MESSAGE).toString(); } }

Target:
public Status(Map<String, Object> innerMap) { code = (Integer) innerMap.get(CODE); Object obj = innerMap.get(MESSAGE); if (obj == null) { message = ""; } else if (obj instanceof Object[]) { message = Arrays.toString((Object[]) obj); } else { message = obj.toString(); } }
Source:
protected void executeCommand() { if (getVmTemplate() != null) { getVmStaticDAO().incrementDbGeneration(getVmTemplate().getId()); VmHandler.LockVm(getVm().getDynamicData(), getCompensationContext()); freeLock(); UpdateVmTemplate(); setSucceeded(true); } }

Target:
protected void executeCommand() { if (getVmTemplate() != null) { getVmStaticDAO().incrementDbGeneration(getVmTemplate().getId()); UpdateVmTemplate(); setSucceeded(true); } }
Source:
private boolean cloneIsInvalid(File gitBaseDir) { if (Files.isRegularFile(gitBaseDir.toPath().resolve(".git/objects/info/alternates"))) { LOG.warn("This repository references another local repository which is not well supported. SCM information might be missing for some files. " + "You can avoid borrow objects from another local repository by not using --reference or --shared when cloning it."); } if (Files.isRegularFile(gitBaseDir.toPath().resolve(".git/shallow"))) { LOG.warn("Shallow clone detected, no blame information will be provided. " + "You can convert to non-shallow with 'git fetch --unshallow'."); analysisWarnings.addUnique("Shallow clone detected during the analysis. " + "Some files will miss SCM information. This will affect features like auto-assignment of issues. " + "Please configure your build to disable shallow clone."); return true; } return false; }

Target:
private boolean cloneIsInvalid(File gitBaseDir) { if (Files.isRegularFile(gitBaseDir.toPath().resolve(".git/objects/info/alternates"))) { LOG.info("This git repository references another local repository which is not well supported. SCM information might be missing for some files. " + "You can avoid borrow objects from another local repository by not using --reference or --shared when cloning it."); } if (Files.isRegularFile(gitBaseDir.toPath().resolve(".git/shallow"))) { LOG.warn("Shallow clone detected, no blame information will be provided. " + "You can convert to non-shallow with 'git fetch --unshallow'."); analysisWarnings.addUnique("Shallow clone detected during the analysis. " + "Some files will miss SCM information. This will affect features like auto-assignment of issues. " + "Please configure your build to disable shallow clone."); return true; } return false; }
Source:
public String call() throws Exception { String msg = "Found the following problems with your installation: "; if (hasOptifine) { msg += "\"Optifine is installed. This is NOT supported.\" "; } if (hasBadAE2) { msg += "\"AE2 rv1 is installed. Ender IO is no longer compatible with rv1, please update to rv2.\" "; } if (hasUnknownAE2) { msg += "\"An unknwon AE2 API is installed. Ender IO was build against API version rv2.\" "; } msg += "This may have caused the error. Try reproducing the crash WITHOUT this/these mods before reportin it."; return msg; }

Target:
public String call() throws Exception { String msg = "Found the following problems with your installation: "; if (hasOptifine) { msg += "\"Optifine is installed. This is NOT supported.\" "; } if (hasUnknownAE2) { msg += "\"An unknown AE2 API is installed. Ender IO was build against API version rv2.\" "; } msg += "This may have caused the error. Try reproducing the crash WITHOUT this/these mods before reporting it."; return msg; }
Source:
protected ActivationKey fetchActivationKey(String keyId) { if (keyId == null || keyId.isEmpty()) { throw new BadRequestException(i18n.tr("Activation key ID is null or empty")); } ActivationKey key = this.activationKeyCurator.secureGet(keyId); if (key == null) { throw new BadRequestException(i18n.tr("Activation key with id {0} could not be found.", keyId)); } return key; }

Target:
protected ActivationKey fetchActivationKey(String keyId) { if (keyId == null || keyId.isEmpty()) { throw new BadRequestException(i18n.tr("Activation key ID is null or empty")); } ActivationKey key = this.activationKeyCurator.secureGet(keyId); if (key == null) { throw new BadRequestException(i18n.tr("Activation key with ID \"{0}\" could not be found.", keyId)); } return key; }
Source:
public void onDialogResult(int requestCode, int resultCode, Bundle arguments) { if (RESULT_OK != resultCode) { return; } switch (requestCode) { case COMMENT_DELETE: final GitHubComment comment = arguments.getParcelable(EXTRA_COMMENT); ServiceGenerator.createService(getActivity(), GistCommentService.class) .deleteGistComment(gistId, comment.id()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .compose(RxProgress.bindToLifecycle(getActivity(), R.string.deleting_comment)) .as(AutoDisposeUtils.bindToLifecycle(this)) .subscribe(response -> { if (comments != null) { int position = Collections.binarySearch(comments, comment, (lhs, rhs) -> Integer.valueOf(lhs.id().intValue()) .compareTo(rhs.id().intValue())); comments.remove(position); updateList(gist, comments); } else { refreshGist(); } }, e -> { Log.d(TAG, "Exception deleting comment on gist", e); ToastUtils.show((Activity) getContext(), e.getMessage()); }); break; } }

Target:
public void onDialogResult(int requestCode, int resultCode, Bundle arguments) { if (RESULT_OK != resultCode) { return; } switch (requestCode) { case COMMENT_DELETE: final GitHubComment comment = arguments.getParcelable(EXTRA_COMMENT); ServiceGenerator.createService(getActivity(), GistCommentService.class) .deleteGistComment(gistId, comment.id()) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .compose(RxProgress.bindToLifecycle(getActivity(), R.string.deleting_comment)) .as(AutoDisposeUtils.bindToLifecycle(this)) .subscribe(response -> { if (comments != null) { int position = Collections.binarySearch(comments, comment, (lhs, rhs) -> lhs.id().compareTo(rhs.id())); comments.remove(position); updateList(gist, comments); } else { refreshGist(); } }, e -> { Log.d(TAG, "Exception deleting comment on gist", e); ToastUtils.show((Activity) getContext(), e.getMessage()); }); break; } }
Source:
private MenuItem updateCloseReopenIssueMenuItem() { Optional<GuiElement> item = listView.getSelectedItem(); if (item.isPresent()) { closeReopenIssueMenuItem.setDisable(false); TurboIssue selectedIssue = item.get().getIssue(); if (selectedIssue.isOpen()) { closeReopenIssueMenuItem.setText(closeIssueMenuItemText); } else { closeReopenIssueMenuItem.setText(reopenIssueMenuItemText); } } else { closeReopenIssueMenuItem.setDisable(true); } return closeReopenIssueMenuItem; }

Target:
private MenuItem updateCloseReopenIssueMenuItem() { Optional<GuiElement> item = listView.getSelectedItem(); if (!item.isPresent()) { closeReopenIssueMenuItem.setDisable(true); return closeReopenIssueMenuItem; } closeReopenIssueMenuItem.setDisable(false); TurboIssue selectedIssue = item.get().getIssue(); if (selectedIssue.isOpen()) { closeReopenIssueMenuItem.setText(closeIssueMenuItemText); } else { closeReopenIssueMenuItem.setText(reopenIssueMenuItemText); } return closeReopenIssueMenuItem; }
Source:
public PlanNode optimize(PlanNode plan, Session session, TypeProvider types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator, WarningCollector warningCollector) { requireNonNull(plan, "plan is null"); requireNonNull(session, "session is null"); requireNonNull(symbolAllocator, "symbolAllocator is null"); requireNonNull(types, "types is null"); return SimplePlanRewriter.rewriteWith(new Rewriter(), plan); }

Target:
public PlanNode optimize(PlanNode plan, Session session, TypeProvider types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator, WarningCollector warningCollector) { requireNonNull(plan, "plan is null"); return SimplePlanRewriter.rewriteWith(new Rewriter(), plan); }
Source:
public WorkflowFilePersistenceBackendService(WorkflowRepresentationConverter marshaller) { super(); this.converter = marshaller; String persistenceFolder = System.getProperty("karaf.data") + PERSISTENCE_FOLDER; folder = new File(persistenceFolder); if (!folder.exists()) { folder.mkdirs(); } }

Target:
public WorkflowFilePersistenceBackendService(WorkflowRepresentationConverter marshaller) { this.converter = marshaller; String persistenceFolder = System.getProperty("karaf.data") + PERSISTENCE_FOLDER; folder = new File(persistenceFolder); if (!folder.exists()) { LOGGER.info("Creating Persistence Folder"); folder.mkdirs(); } }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == IMPORT_FILE_REQUEST_CODE) { maybeOpenImportFileActivity(resultCode,data,true); } else if (requestCode == IMPORT_CSV_REQUEST_CODE) { maybeOpenImportFileActivity(resultCode,data,false); } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == IMPORT_TXT_REQUEST_CODE) { maybeOpenImportFileActivity(resultCode, data, FileImportType.TEXT); } else if (requestCode == IMPORT_CSV_REQUEST_CODE) { maybeOpenImportFileActivity(resultCode, data, FileImportType.CSV); } }
Source:
public void testNotSortedSerialization() throws Exception { final String[] strings = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "k", "j", "l"}; GenericIndexed<String> deserialized = serializeAndDeserialize( GenericIndexed.fromArray( strings, GenericIndexed.STRING_STRATEGY ) ); checkBasicAPIs(strings, deserialized, deserialized.isAllowReverseLookup()); }

Target:
public void testNotSortedSerialization() throws Exception { final String[] strings = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "k", "j", "l"}; GenericIndexed<String> deserialized = serializeAndDeserialize( GenericIndexed.fromArray( strings, GenericIndexed.STRING_STRATEGY ) ); checkBasicAPIs(strings, deserialized, false); }
Source:
public int compare(ItemStack o1, ItemStack o2) { List<Property<?, ?>> properties = Lists.newArrayList(o2.getApplicableProperties()); for (Property<?, ?> property : o1.getApplicableProperties()) { if (properties.contains(property)) { properties.remove(property); } else { return -1; } } return properties.size(); }

Target:
public int compare(ItemStack o1, ItemStack o2) { Set<Property<?, ?>> properties = new HashSet<>(o2.getApplicableProperties()); for (Property<?, ?> property : o1.getApplicableProperties()) { if (properties.contains(property)) { properties.remove(property); } else { return -1; } } return properties.size(); }
Source:
private void startGeoTagging() { File folder = getApplicationContext().getExternalFilesDir(null); File tlogFile = new File(folder.getPath() + "/camera_msgs.tlog"); Timber.d("path: " + tlogFile.getPath()); geoTagImages(getApplicationContext(), tlogFile); }

Target:
private void startGeoTagging() { File folder = getExternalFilesDir(null); File tlogFile = new File(folder.getPath() + "/camera_msgs.tlog"); Timber.d("path: " + tlogFile.getPath()); geoTagImages(tlogFile); }
Source:
public String fetchStore(int nodeId, String storeName, String storeDir, long pushVersion, long timeoutMs) { VAdminProto.FetchStoreRequest.Builder fetchStoreRequest = VAdminProto.FetchStoreRequest.newBuilder() .setStoreName(storeName) .setStoreDir(storeDir); if(pushVersion > 0) { fetchStoreRequest.setPushVersion(pushVersion); } VAdminProto.VoldemortAdminRequest adminRequest = VAdminProto.VoldemortAdminRequest.newBuilder() .setFetchStore(fetchStoreRequest) .setType(VAdminProto.AdminRequestType.FETCH_STORE) .build(); VAdminProto.AsyncOperationStatusResponse.Builder response = rpcOps.sendAndReceive(nodeId, adminRequest, VAdminProto.AsyncOperationStatusResponse.newBuilder()); if(response.hasError()) { helperOps.throwException(response.getError()); } int asyncId = response.getRequestId(); try { return rpcOps.waitForCompletion(nodeId, asyncId, timeoutMs, TimeUnit.MILLISECONDS); } catch (AsyncOperationTimeoutException aote) { logger.error("Got an AsyncOperationTimeoutException for nodeId " + nodeId + ", asyncId " + asyncId + ". Will attempt to kill the job and rethrow the original exception afterwards."); try { rpcOps.stopAsyncRequest(nodeId, asyncId); logger.info("Successfully killed async job " + asyncId); } catch (Exception e) { logger.error("Failed to kill async job " + asyncId, e); } throw aote; } }

Target:
public String fetchStore(int nodeId, String storeName, String storeDir, long pushVersion, long timeoutMs) { VAdminProto.FetchStoreRequest.Builder fetchStoreRequest = VAdminProto.FetchStoreRequest.newBuilder() .setStoreName(storeName) .setStoreDir(storeDir); if(pushVersion > 0) { fetchStoreRequest.setPushVersion(pushVersion); } VAdminProto.VoldemortAdminRequest adminRequest = VAdminProto.VoldemortAdminRequest.newBuilder() .setFetchStore(fetchStoreRequest) .setType(VAdminProto.AdminRequestType.FETCH_STORE) .build(); VAdminProto.AsyncOperationStatusResponse.Builder response = rpcOps.sendAndReceive(nodeId, adminRequest, VAdminProto.AsyncOperationStatusResponse.newBuilder()); if(response.hasError()) { helperOps.throwException(response.getError()); } int asyncId = response.getRequestId(); try { return rpcOps.waitForCompletion(nodeId, asyncId, timeoutMs, TimeUnit.MILLISECONDS); } catch (AsyncOperationTimeoutException aote) { logger.error("Got an AsyncOperationTimeoutException for nodeId " + nodeId + " while waiting for" + " completion of Async Operation ID " + asyncId + ". Will attempt to kill the job" + " and rethrow the original exception afterwards."); try { rpcOps.stopAsyncRequest(nodeId, asyncId); logger.info("Successfully killed Async Operation ID " + asyncId); } catch (Exception e) { logger.error("Failed to kill Async Operation ID " + asyncId, e); } throw aote; } catch (VoldemortException ve) { logger.error("Got a " + ve.getClass().getSimpleName() + " for nodeId " + nodeId + " while waiting for" + " completion of Async Operation ID " + asyncId + ". Bubbling up."); throw ve; } }
Source:
public void testTimerEventListenerOccurExecution(){ CaseInstance ci = createCaseInstanceByKey("case"); assertNotNull(ci); List<JobDefinition> allJobs = managementService.createJobDefinitionQuery().list(); assertNotNull(allJobs); assertTrue(!allJobs.isEmpty()); assertTrue(allJobs.size()==1); executeAvailableJobs(); CaseExecution exe = processEngine.getCaseService().createCaseExecutionQuery().caseInstanceId(ci.getCaseInstanceId()).singleResult(); assertNotNull(exe); Map<String, Object> vars = processEngine.getCaseService().getVariables(exe.getId()); assertNotNull(vars); assertTrue(vars.containsKey("occur")); }

Target:
public void testTimerEventListenerOccurExecution(){ CaseInstance ci = createCaseInstanceByKey("case"); assertNotNull(ci); List<JobDefinition> allJobs = managementService.createJobDefinitionQuery().list(); assertNotNull(allJobs); assertTrue(!allJobs.isEmpty()); assertTrue(allJobs.size()==1); Date startTime = new Date(); ClockUtil.setCurrentTime(new Date(startTime.getTime() + ((60 * 60 * 1000) + 5000))); waitForJobExecutorToProcessAllJobs(5000L); assertEquals(0L, managementService.createJobQuery().count()); CaseExecution exe = processEngine.getCaseService().createCaseExecutionQuery().caseInstanceId(ci.getCaseInstanceId()).singleResult(); assertNotNull(exe); Map<String, Object> vars = processEngine.getCaseService().getVariables(exe.getId()); assertNotNull(vars); assertTrue(vars.containsKey("occur")); }
Source:
protected TextAnnotation parseLines(ArrayList<String> lines) throws AnnotatorException { StringBuilder sb = new StringBuilder(); int numParen = 0; int currentLineId = 0; ArrayList<String[]> sentences = new ArrayList<> (); ArrayList<Tree<String>> trees = new ArrayList<> (); while (currentLineId < lines.size()) { String line = lines.get(currentLineId++); if (line.length() == 0) continue; numParen += countUnclosedParens(line); sb.append(line); if (numParen == 0) { Tree<String> tree = TreeParserFactory.getStringTreeParser().parse( sb.toString().replaceAll("\\\\/", "/")); String[] text = ParseUtils.getTerminalStringSentence(tree); if (text.length != 0) { sentences.add(text); trees.add(tree); treesProduced++; } else { System.err.println("This tree produced no sentence text:\n"+tree); System.err.println("from file:\n"+this.currentfile); System.err.flush(); return null; } sb = new StringBuilder(); } } TextAnnotation ta = BasicTextAnnotationBuilder.createTextAnnotationFromTokens( VIEW_NAME, currentfile, sentences); TreeView parse = new TreeView(VIEW_NAME, "Ontonotes-5-GOLD", ta, 1.0); int treecount = 0; for (Tree<String> tree : trees) { parse.setParseTree(treecount++, tree); } ta.addView(VIEW_NAME, parse); POSFromParse pos = new POSFromParse(VIEW_NAME); ta.addView(pos); return ta; }

Target:
protected TextAnnotation parseLines(ArrayList<String> lines) throws AnnotatorException { StringBuilder sb = new StringBuilder(); int numParen = 0; int currentLineId = 0; ArrayList<String[]> sentences = new ArrayList<> (); ArrayList<Tree<String>> trees = new ArrayList<> (); while (currentLineId < lines.size()) { String line = lines.get(currentLineId++); if (line.length() == 0) continue; numParen += countUnclosedParens(line); sb.append(line); if (numParen == 0) { Tree<String> tree = TreeParserFactory.getStringTreeParser().parse( sb.toString().replaceAll("\\\\/", "/")); String[] text = ParseUtils.getTerminalStringSentence(tree); if (text.length != 0) { sentences.add(text); trees.add(tree); treesProduced++; } else { System.err.println("This tree produced no sentence text:\n"+tree); System.err.println("from file:\n"+this.currentfile); System.err.flush(); return null; } sb = new StringBuilder(); } } TextAnnotation ta = BasicTextAnnotationBuilder.createTextAnnotationFromTokens( VIEW_NAME, currentfile, sentences); TreeView parse = new TreeView(VIEW_NAME, this.getClass().getCanonicalName(), ta, 1.0); int treecount = 0; for (Tree<String> tree : trees) { parse.setParseTree(treecount++, tree); } ta.addView(VIEW_NAME, parse); POSFromParse pos = new POSFromParse(VIEW_NAME); ta.addView(pos); return ta; }
Source:
private void pullFromRemoteStream() { try { LOG.debug("Pull latest changed from remote stream"); PullCommand pullCommand = git.pull(); pullCommand.setCredentialsProvider( new UsernamePasswordCredentialsProvider( zeppelinConfiguration.getZeppelinNotebookGitUsername(), zeppelinConfiguration.getZeppelinNotebookGitAccessToken() ) ); pullCommand.call(); } catch (GitAPIException e) { LOG.error("Error when pulling latest changes from remote repository"); e.printStackTrace(); } }

Target:
private void pullFromRemoteStream() { try { LOG.debug("Pull latest changed from remote stream"); PullCommand pullCommand = git.pull(); pullCommand.setCredentialsProvider( new UsernamePasswordCredentialsProvider( zeppelinConfiguration.getZeppelinNotebookGitUsername(), zeppelinConfiguration.getZeppelinNotebookGitAccessToken() ) ); pullCommand.call(); } catch (GitAPIException e) { LOG.error("Error when pulling latest changes from remote repository", e); } }
Source:
public void onReceive(Context context, Intent intent) { String action = intent.getAction(); WifiHelper wifiHelper = new WifiHelper(context); if (action.equals("android.net.wifi.SCAN_RESULTS")) { List<String> nearbyBSSIDs = wifiHelper.getNearbyBSSIDs(); observableHelper.notifyObservers(new WifiBSSIDChangeEvent(nearbyBSSIDs)); } else if (intent.getAction().equals("android.net.wifi.WIFI_STATE_CHANGED")) { int wifiState = intent.getIntExtra("wifi_state", -1); if (wifiState == WifiManager.WIFI_STATE_ENABLED || wifiState == WifiManager.WIFI_STATE_DISABLED) { boolean wifiEnabled = wifiHelper.isWifiEnabled(); observableHelper.notifyObservers(new WifiBSSIDChangeEvent(new ArrayList<String>())); observableHelper.notifyObservers(new WifiStateChangeEvent(wifiEnabled)); } } }

Target:
public void onReceive(Context context, Intent intent) { String action = intent.getAction(); WifiHelper wifiHelper = new WifiHelper(context); if (action.equals("android.net.wifi.SCAN_RESULTS")) { List<String> nearbyBSSIDs = wifiHelper.getNearbyBSSIDs(); observableHelper.notifyObservers(new WifiBSSIDChangeEvent(nearbyBSSIDs)); } else if (intent.getAction().equals("android.net.wifi.WIFI_STATE_CHANGED")) { int wifiState = intent.getIntExtra("wifi_state", -1); if (wifiState == WifiManager.WIFI_STATE_ENABLED || wifiState == WifiManager.WIFI_STATE_DISABLED) { boolean wifiEnabled = wifiHelper.isWifiEnabled(); observableHelper.notifyObservers(new WifiStateChangeEvent(wifiEnabled)); } } }
Source:
private void writeXml(BinaryContent content, HierarchicalStreamWriter writer) { try (InputStreamReader inputStreamReader = new InputStreamReader(content.getInputStream(), StandardCharsets.UTF_8)) { XmlPullParser parser = XppFactory.createDefaultParser(); new HierarchicalStreamCopier().copy(new XppReader(inputStreamReader, parser), writer); } catch (IOException | XmlPullParserException e) { throw new ConversionException("Unable to copy metadata to XML Output.", e); } }

Target:
private void writeXml(BinaryContent content, HierarchicalStreamWriter writer) { try { XmlPullParser parser = XppFactory.createDefaultParser(); InputStreamReader inputStreamReader = new InputStreamReader(content.getInputStream(), StandardCharsets.UTF_8); try { new HierarchicalStreamCopier().copy(new XppReader(inputStreamReader, parser), writer); } finally { IOUtils.closeQuietly(inputStreamReader); } } catch (XmlPullParserException e) { throw new ConversionException("Unable to copy metadata to XML Output.", e); } }
Source:
protected ConfigurationBuilder getDefaultHotRodConfig() { ConfigurationBuilder config = super.getDefaultHotRodConfig(); if (transactionManagerLookup != null) { try { config.transaction().transactionManagerLookup((TransactionManagerLookup) Class.forName(transactionManagerLookup).newInstance()); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Cannot find " + transactionManagerLookup + " in the classpath", e); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Cannot initialize " + transactionManagerLookup, e); } catch (InstantiationException e) { throw new IllegalArgumentException("Cannot initialize " + transactionManagerLookup, e); } } if (transactionMode != null) { config.transaction().transactionMode(TransactionMode.valueOf(transactionMode)); } config.maxRetries(maxRetries).socketTimeout(connectionTimeout).connectionTimeout(connectionTimeout); if (propertiesPath != null) { Properties p = new Properties(); try (Reader r = new FileReader(propertiesPath)) { p.load(r); config.withProperties(p); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } return config; }

Target:
protected ConfigurationBuilder getDefaultHotRodConfig() { ConfigurationBuilder config = super.getDefaultHotRodConfig(); if (transactionManagerLookup != null) { try { config.transaction().transactionManagerLookup((TransactionManagerLookup) Class.forName(transactionManagerLookup).newInstance()); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Cannot find " + transactionManagerLookup + " in the classpath", e); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Cannot initialize " + transactionManagerLookup, e); } catch (InstantiationException e) { throw new IllegalArgumentException("Cannot initialize " + transactionManagerLookup, e); } } if (transactionMode != null) { config.transaction().transactionMode(TransactionMode.valueOf(transactionMode)); } config.maxRetries(maxRetries).socketTimeout(connectionTimeout).connectionTimeout(connectionTimeout); if (propertiesPath != null) { Properties p = new Properties(); try (Reader r = new FileReader(propertiesPath)) { p.load(r); config.withProperties(p); } catch (IOException e) { throw new IllegalStateException("Something went wrong with provided properties file:" + propertiesPath, e); } } return config; }
Source:
public static Annotation getAnnotationPlusStrand(TranscriptModel kgl, int frame_s, String wtnt3, String ref, String var, int refvarstart, int refvarend, int exonNumber) throws AnnotationException { String canno = null; String panno = null; int refcdsstart = kgl.getRefCDSStart(); int startPosMutationInCDS = refvarstart - refcdsstart + 1; if (frame_s == 1) { } else if (frame_s == 2) { } else { } canno = String.format("c.%d_%ddelins%s", refvarstart - refcdsstart + 1, refvarend - refcdsstart + 1, var); if ((refvarend - refvarstart + 1 - var.length()) % 3 == 0) { panno = String.format("%s:%s:exon:%d:%s", kgl.getGeneSymbol(), kgl.getName(), exonNumber, canno); Annotation ann = new Annotation(kgl, panno, VariantType.NON_FS_SUBSTITUTION, refvarstart); return ann; } else { panno = String.format("%s:exon:%d:%s", kgl.getName(), exonNumber, canno); Annotation ann = new Annotation(kgl, panno, VariantType.FS_SUBSTITUTION, startPosMutationInCDS); return ann; } }

Target:
public static Annotation getAnnotationPlusStrand(TranscriptModel kgl, int frame_s, String wtnt3, String ref, String var, int refvarstart, int refvarend, int exonNumber) throws AnnotationException { String annotation = null; Translator translator = Translator.getTranslator(); String canno = null; String panno = null; String varnt3 = null; int refcdsstart = kgl.getRefCDSStart(); int startPosMutationInCDS = refvarstart - refcdsstart + 1; if (frame_s == 1) { varnt3 = String.format("%c%s%c", wtnt3.charAt(0), var, wtnt3.charAt(2)); } else if (frame_s == 2) { varnt3 = String.format("%c%c%s", wtnt3.charAt(0), wtnt3.charAt(1), var); } else { varnt3 = String.format("%s%c%c", var, wtnt3.charAt(1), wtnt3.charAt(2)); } canno = String.format("c.%d_%ddelins%s", refvarstart - refcdsstart + 1, refvarend - refcdsstart + 1, var); if ((refvarend - refvarstart + 1 - var.length()) % 3 == 0) { panno = String.format("%s:%s:exon:%d:%s", kgl.getGeneSymbol(), kgl.getName(), exonNumber, canno); Annotation ann = new Annotation(kgl, panno, VariantType.NON_FS_SUBSTITUTION, refvarstart); return ann; } else { panno = String.format("%s:exon:%d:%s", kgl.getName(), exonNumber, canno); Annotation ann = new Annotation(kgl, panno, VariantType.FS_SUBSTITUTION, startPosMutationInCDS); return ann; } }
Source:
public void append(byte[] buffer, int length) throws IOException { if (writer == null) { writer = new FSWALWriter(bfs, new HDHTLogEntry.HDHTLogSerializer(), walKey, WAL_FILE_PREFIX + walFileId); } ((FSWALWriter)writer).append(buffer, length); stats.totalBytes += length; }

Target:
public void append(byte[] buffer, int length) throws IOException { if (writer == null) { writer = new FSWALWriter<HDHTLogEntry.HDHTWalEntry>(bfs, new HDHTLogEntry.HDHTLogSerializer(), walKey, WAL_FILE_PREFIX + walFileId); } writer.append(buffer, length); stats.totalBytes += length; }
Source:
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws IOException, InterruptedException { try { String version = module.getVersion(); String path = StorageUtil.replaceMacro(getBucketUri(), run, listener); BucketPath bucketPath = new BucketPath(path); if (bucketPath.error()) { throw new IOException("Invalid bucket path: " + getBucketUri()); } String dirName = StorageUtil .replaceMacro(getLocalDirectory(), run, listener); FilePath dirPath = workspace.child(dirName); List<StorageObjectId> objects = resolveBucketPath(bucketPath, getCredentials(), version); listener.getLogger() .println(module.prefix( Messages.Download_FoundForPattern(objects.size(), path))); DownloadSpec spec = new DownloadSpec(objects); String resolvedPrefix = StorageUtil .replaceMacro(pathPrefix, run, listener); initiateDownloadsAtWorkspace(getCredentials(), run, spec, dirPath, listener, version, resolvedPrefix); } catch (ExecutorException e) { throw new IOException(Messages.Download_DownloadException(), e); } }

Target:
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws IOException, InterruptedException { try { String version = module.getVersion(); String path = StorageUtil.replaceMacro(getBucketUri(), run, listener); BucketPath bucketPath = new BucketPath(path); if (bucketPath.error()) { throw new IOException("Invalid bucket path: " + getBucketUri()); } String dirName = StorageUtil .replaceMacro(getLocalDirectory(), run, listener); FilePath dirPath = workspace.child(dirName); List<StorageObjectId> objects = resolveBucketPath(bucketPath, getCredentials(), version); listener.getLogger() .println(module.prefix( Messages.Download_FoundForPattern(objects.size(), path))); String resolvedPrefix = StorageUtil .replaceMacro(pathPrefix, run, listener); initiateDownloadsAtWorkspace(getCredentials(), run, objects, dirPath, listener, version, resolvedPrefix); } catch (ExecutorException e) { throw new IOException(Messages.Download_DownloadException(), e); } }
Source:
protected void ProceedVGLunsInDb() { final ArrayList<LUNs> luns = (ArrayList<LUNs>) Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.GetVGInfo, new GetVGInfoVDSCommandParameters(getVds().getId(), getStorageDomain().getstorage())) .getReturnValue(); storage_server_connections sdConn = getStorageDomain().getStorageStaticData().getConnection(); if (sdConn != null && sdConn.getuser_name() != null && sdConn.getpassword() != null) { for (LUNs lun : luns) { for (storage_server_connections lunConn : lun.getLunConnections()) { lunConn.setuser_name(sdConn.getuser_name()); lunConn.setpassword(sdConn.getpassword()); } } } TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { for (LUNs lun : luns) { proceedLUNInDb(lun, getStorageDomain().getstorage_type()); } return null; } }); }

Target:
protected void ProceedVGLunsInDb() { final ArrayList<LUNs> luns = (ArrayList<LUNs>) Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.GetVGInfo, new GetVGInfoVDSCommandParameters(getVds().getId(), getStorageDomain().getstorage())) .getReturnValue(); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { for (LUNs lun : luns) { proceedLUNInDb(lun, getStorageDomain().getstorage_type()); } return null; } }); }
Source:
public void testNowPlusOneDay() throws Exception { Collection<CompoundVariable> params = makeParams("YYYY-MM-dd", "", "1d", ""); function.setParameters(params); value = function.execute(result, null); LocalDate tomorrow = LocalDate.now().plusDays(1); LocalDate tomorrowFromFunction = LocalDate.parse(value); assertThat(tomorrowFromFunction, sameDay(tomorrow)); }

Target:
public void testNowPlusOneDay() throws Exception { Collection<CompoundVariable> params = makeParams("YYYY-MM-dd", "", "P1d", ""); function.setParameters(params); value = function.execute(result, null); LocalDate tomorrow = LocalDate.now().plusDays(1); LocalDate tomorrowFromFunction = LocalDate.parse(value); assertThat(tomorrowFromFunction, sameDay(tomorrow)); }
Source:
public Priority getPriority() { final String priorityString = this.getOptionValue(PRIORITY.getLongOpt()); try { if (priorityString == null) { return null; } else { return Priority.valueOf(priorityString.toUpperCase()); } } catch (final IllegalArgumentException e) { System.err.printf("Error: Unknown priority: %s", priorityString); System.exit(1); } return null; }

Target:
public Priority getPriority() throws BadArgumentException { final String priorityString = this.getOptionValue(PRIORITY.getLongOpt()); try { if (priorityString == null) { return null; } else { return Priority.valueOf(priorityString.toUpperCase()); } } catch (final IllegalArgumentException e) { throw new BadArgumentException("Unknown priority: " + priorityString, e); } }
Source:
private String getPathFromSourceText(Set<String> paths, String sourceText) { if (paths != null && sourceText != null) { for (String path : paths) { if (sourceText.contains(path)) { return path; } } } return null; }

Target:
private String getPathFromSourceText(Set<String> paths, String sourceText) { if (paths != null && !StringUtils.isBlank(sourceText)) { for (String path : paths) { if (sourceText.contains(path)) { return path; } } } return null; }
Source:
private void checkHitPolicy() { if (dtable.getHitPolicy() != GuidedDecisionTable52.HitPolicy.NONE) { throw new UnsupportedOperationException("Migrating Hit Policies is supported."); } }

Target:
private void checkHitPolicy() { if (dtable.getHitPolicy() != GuidedDecisionTable52.HitPolicy.NONE) { throw new UnsupportedOperationException("Migrating Hit Policies is not supported."); } }
Source:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((lun == null) ? 0 : lun.hashCode()); return result; }

Target:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (usingScsiReservation ? 1231 : 1237); result = prime * result + ((lun == null) ? 0 : lun.hashCode()); return result; }
Source:
public boolean isOnSameHierarchyChainInternal( MemberBase member2 ) { for ( List<Member> subList : tupleList ) { for ( Member m : subList ) { if ( member2.isOnSameHierarchyChainInternal( (MemberBase) m ) ) { return true; } } } return false; }

Target:
public boolean isOnSameHierarchyChainInternal( MemberBase member2 ) { int index = -1; for ( List<mondrian.olap.Member> subList : tupleList ) { if ( index == -1 ) { for ( int i = 0; i < subList.size(); i++ ) { if ( member2.getHierarchy().equals( subList.get( i ).getHierarchy() ) ) { index = i; } break; } if ( index == -1 ) { return false; } } if ( member2.isOnSameHierarchyChainInternal( (MemberBase) subList.get( index ) ) ) { return true; } } return false; }