auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void reset() { rollbackFailed = false; commitFailed = false; prepareFailed = false; putFailed = false; removeFailed = false; clearFailed = false; putMapFailed = false; dontFailPrepare = false; isFailing = true; }

Target:
public void reset() { rollbackFailed = false; commitFailed = false; prepareFailed = false; putFailed = false; removeFailed = false; replaceFailed = false; clearFailed = false; putMapFailed = false; dontFailPrepare = false; isFailing = true; }
Source:
public void filenameFilterTest() throws IOException { File tempFile = File.createTempFile("ambry", ".tmp"); tempFile.deleteOnExit(); int validFileCount = 10; int invalidFileCount = 5; Set<File> validFiles = new HashSet<>(validFileCount); File tempDir = Files.createTempDirectory("nameHelper-" + UtilsTest.getRandomString(10)).toFile(); tempDir.deleteOnExit(); try { String filename = LogSegmentNameHelper.nameToFilename(""); File file = createFile(tempDir, filename); validFiles.add(file); for (int i = 1; i < validFileCount; i++) { long pos = Utils.getRandomLong(TestUtils.RANDOM, 1000); long gen = Utils.getRandomLong(TestUtils.RANDOM, 1000); filename = LogSegmentNameHelper.nameToFilename(LogSegmentNameHelper.getName(pos, gen)); file = createFile(tempDir, filename); validFiles.add(file); } for (int i = 0; i < invalidFileCount; i++) { filename = UtilsTest.getRandomString(10); switch (i) { case 0: filename = filename + "_index"; break; case 1: filename = filename + LogSegmentNameHelper.SUFFIX + "_temp"; break; default: break; } createFile(tempDir, filename); } Set<File> filteredFiles = new HashSet<>(Arrays.asList(tempDir.listFiles(LogSegmentNameHelper.LOG_FILE_FILTER))); assertEquals("Filtered files do not have the valid files", validFiles, filteredFiles); } finally { File[] files = tempDir.listFiles(); if (files != null) { for (File file : files) { assertTrue("The file [" + file.getAbsolutePath() + "] could not be deleted", file.delete()); } } assertTrue("The directory [" + tempDir.getAbsolutePath() + "] could not be deleted", tempDir.delete()); } }

Target:
public void filenameFilterTest() throws IOException { int validFileCount = 10; int invalidFileCount = 5; Set<File> validFiles = new HashSet<>(validFileCount); File tempDir = Files.createTempDirectory("nameHelper-" + UtilsTest.getRandomString(10)).toFile(); tempDir.deleteOnExit(); try { String filename = LogSegmentNameHelper.nameToFilename(""); File file = createFile(tempDir, filename); validFiles.add(file); for (int i = 1; i < validFileCount; i++) { long pos = Utils.getRandomLong(TestUtils.RANDOM, 1000); long gen = Utils.getRandomLong(TestUtils.RANDOM, 1000); filename = LogSegmentNameHelper.nameToFilename(LogSegmentNameHelper.getName(pos, gen)); file = createFile(tempDir, filename); validFiles.add(file); } for (int i = 0; i < invalidFileCount; i++) { filename = UtilsTest.getRandomString(10); switch (i) { case 0: filename = filename + "_index"; break; case 1: filename = filename + LogSegmentNameHelper.SUFFIX + "_temp"; break; default: break; } createFile(tempDir, filename); } Set<File> filteredFiles = new HashSet<>(Arrays.asList(tempDir.listFiles(LogSegmentNameHelper.LOG_FILE_FILTER))); assertEquals("Filtered files do not have the valid files", validFiles, filteredFiles); } finally { File[] files = tempDir.listFiles(); if (files != null) { for (File file : files) { assertTrue("The file [" + file.getAbsolutePath() + "] could not be deleted", file.delete()); } } assertTrue("The directory [" + tempDir.getAbsolutePath() + "] could not be deleted", tempDir.delete()); } }
Source:
public <T> Subscription addOnAddedListener(final Class<T> beanClass, final BeanAddedListener<? super T> listener) { DolphinUtils.assertIsDolphinBean(beanClass); if (beanAddedListenerMap.containsKey(beanClass)) { beanAddedListenerMap.get(beanClass).add(listener); } else { beanAddedListenerMap.put(beanClass, Arrays.asList(listener)); } return () -> { if (beanAddedListenerMap.containsKey(beanClass)) { beanAddedListenerMap.get(beanClass).remove(listener); } }; }

Target:
public <T> Subscription addOnAddedListener(final Class<T> beanClass, final BeanAddedListener<? super T> listener) { DolphinUtils.assertIsDolphinBean(beanClass); beanAddedListenerMap.computeIfAbsent(beanClass, s -> new ArrayList()).add(listener); return () -> { if (beanAddedListenerMap.containsKey(beanClass)) { beanAddedListenerMap.get(beanClass).remove(listener); } }; }
Source:
private void doGetByLocalCopy() throws IOException { System.err.print("Copying " + jarUrl + " ..."); File f = url2file(jarUrl); if (!f.exists()) { StringBuilder msg = new StringBuilder(); msg.append("\n"); msg.append("Can not find the %s at this location: %s\n"); msg.append("Please provide alternative URL"); f = url2file(ui.readString(null, msg.toString(), name, jarUrl)); } Files.copy(f, dst); }

Target:
private void doGetByLocalCopy() throws IOException { System.err.print("Copying " + jarUrl + " ..."); File f = url2file(jarUrl); if (!f.exists()) { StringBuilder msg = new StringBuilder() .append("\n") .append("Can not find the %s at this location: %s\n") .append("Please provide alternative URL"); f = url2file(ui.readString(null, msg.toString(), name, jarUrl)); } Files.copy(f, dst); }
Source:
public Vector<T> insertAll(int index, Iterable<? extends T> elements) { if ((index < 0) || (index > length())) { throw new IndexOutOfBoundsException("insert(" + index + ", e) on Vector of length " + length()); } final Vector<T> begin = take(index); final Vector<T> end = drop(index); return begin.appendAll(elements).appendAll(end); }

Target:
public Vector<T> insertAll(int index, Iterable<? extends T> elements) { if ((index < 0) || (index > length())) { throw new IndexOutOfBoundsException("insert(" + index + ", e) on Vector of length " + length()); } HashArrayMappedTrie<Integer, T> trie = HashArrayMappedTrie.empty(); for (int i = 0; i <= length(); i++) { if (i == index) { for (T element : elements) { trie = trie.put(trie.size(), element); } } if (i < length()) { trie = trie.put(trie.size(), get(i)); } } return new Vector<>(trie); }
Source:
public ServiceKeyAuthentication(@Provider Supplier<Credentials> creds) { this.creds = checkNotNull(creds, "creds"); }

Target:
ServiceKeyAuthentication(@Provider Supplier<Credentials> creds) { this.creds = creds; }
Source:
public void testShouldNotCrashOnGarbageData() { byte[] n = new byte[10000]; new Random().nextBytes(n); ByteBuf randomBufferData = Unpooled.wrappedBuffer(n); EmbeddedChannel channel = new EmbeddedChannel(new BeatsParser()); channel.writeOutbound(randomBufferData); Object o = channel.readOutbound(); channel.writeInbound(o); }

Target:
public void testShouldNotCrashOnGarbageData() { thrown.expectCause(isA(BeatsParser.InvalidFrameProtocolException.class)); byte[] n = new byte[10000]; new Random().nextBytes(n); ByteBuf randomBufferData = Unpooled.wrappedBuffer(n); sendPayloadToParser(randomBufferData); }
Source:
Picasso(Context context, Loader loader, ExecutorService service, Cache cache, Listener listener, Stats stats) { this.context = context; this.loader = loader; this.service = service; this.cache = cache; this.listener = listener; this.stats = stats; this.targetsToRequests = new WeakHashMap<Object, Request>(); this.requestSparseArray = new SparseArray<Request>(); this.imageReferenceQueue = new ReferenceQueue<ImageView>(); this.targetReferenceQueue = new ReferenceQueue<Target>(); CleanupThread imageRefQueueThread = new CleanupThread(imageReferenceQueue, handler); imageRefQueueThread.start(); CleanupThread targetRefQueueThread = new CleanupThread(targetReferenceQueue, handler); targetRefQueueThread.start(); }

Target:
Picasso(Context context, Loader loader, ExecutorService service, Cache cache, Listener listener, Stats stats) { this.context = context; this.loader = loader; this.service = service; this.cache = cache; this.listener = listener; this.stats = stats; this.targetsToRequests = new WeakHashMap<Object, Request>(); this.referenceQueue = new ReferenceQueue<Object>(); new CleanupThread(referenceQueue, handler).start(); }
Source:
public static boolean checkTakeoverInAppActivityAvailable(Context context) { if (Build.VERSION.SDK_INT < MPConfig.UI_FEATURES_MIN_API) { return false; } final Intent takeoverInAppIntent = new Intent(context, TakeoverInAppActivity.class); takeoverInAppIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); takeoverInAppIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); final PackageManager packageManager = context.getPackageManager(); final List<ResolveInfo> intentActivities = packageManager.queryIntentActivities(takeoverInAppIntent, 0); if (intentActivities.size() == 0) { MPLog.w(LOGTAG, TakeoverInAppActivity.class.getName() + " is not registered as an activity in your application, so takeover in-apps can't be shown."); MPLog.i(LOGTAG, "Please add the child tag <activity android:name=\"com.mixpanel.android.surveys.TakeoverInAppActivity\" /> to your <application> tag."); return false; } return true; }

Target:
public static boolean checkTakeoverInAppActivityAvailable(Context context) { if (mTakeoverActivityAvailable == null) { if (Build.VERSION.SDK_INT < MPConfig.UI_FEATURES_MIN_API) { mTakeoverActivityAvailable = false; } final Intent takeoverInAppIntent = new Intent(context, TakeoverInAppActivity.class); takeoverInAppIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); takeoverInAppIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); final PackageManager packageManager = context.getPackageManager(); final List<ResolveInfo> intentActivities = packageManager.queryIntentActivities(takeoverInAppIntent, 0); if (intentActivities.size() == 0) { MPLog.w(LOGTAG, TakeoverInAppActivity.class.getName() + " is not registered as an activity in your application, so takeover in-apps can't be shown."); MPLog.i(LOGTAG, "Please add the child tag <activity android:name=\"com.mixpanel.android.takeoverinapp.TakeoverInAppActivity\" /> to your <application> tag."); mTakeoverActivityAvailable = false; } mTakeoverActivityAvailable = true; } return mTakeoverActivityAvailable; }
Source:
public static DeleteResourceJob createDeleteProjectJob(final IProject project) { Assert.isNotNull(project, "A project must not be null"); DeleteResourceJob deleteProjectJob = new DeleteResourceJob(project) { @Override protected IStatus doRun(IProgressMonitor monitor) { Connection connection = ConnectionsRegistryUtil.getConnectionFor(project); WatchManager.getInstance().stopWatch(project); List<IProject> oldProjects = connection.getResources(ResourceKind.PROJECT); IStatus status = super.doRun(monitor); if(status.isOK()) { if(waitForServerToReconcileProjectDelete(connection, project)) { List<IProject> newProjects = new ArrayList<>(oldProjects); newProjects.remove(project); ConnectionsRegistrySingleton.getInstance().fireConnectionChanged( connection , ConnectionProperties.PROPERTY_PROJECTS, oldProjects, newProjects); } } return status; } private boolean waitForServerToReconcileProjectDelete(Connection conn, IProject project) { boolean deleted = false; long sleep = 0; do { try { conn.getResource(project); Thread.sleep(PROJECT_DELETE_DELAY); sleep = sleep + PROJECT_DELETE_DELAY; } catch (InterruptedException e1) { } catch(OpenShiftException ex) { if(ex.getStatus() != null) { final int code = ex.getStatus().getCode(); if(code == IHttpConstants.STATUS_NOT_FOUND || code == IHttpConstants.STATUS_FORBIDDEN) { deleted = true; } } } }while(!deleted || sleep > MAX_PROJECT_DELETE_DELAY); return deleted; } }; return deleteProjectJob; }

Target:
public static DeleteResourceJob createDeleteProjectJob(final IProject project) { Assert.isNotNull(project, "A project must not be null"); DeleteResourceJob deleteProjectJob = new DeleteResourceJob(project) { @Override protected IStatus doRun(IProgressMonitor monitor) { Connection connection = ConnectionsRegistryUtil.getConnectionFor(project); WatchManager.getInstance().stopWatch(project); List<IProject> oldProjects = connection.getResources(ResourceKind.PROJECT); IStatus status = super.doRun(monitor); if(status.isOK()) { if(waitForServerToReconcileProjectDelete(connection, project)) { List<IProject> newProjects = new ArrayList<>(oldProjects); newProjects.remove(project); ConnectionsRegistrySingleton.getInstance().fireConnectionChanged( connection , ConnectionProperties.PROPERTY_PROJECTS, oldProjects, newProjects); } } return status; } private boolean waitForServerToReconcileProjectDelete(Connection conn, IProject project) { boolean deleted = false; long sleep = 0; do { try { conn.getResource(project); Thread.sleep(PROJECT_DELETE_DELAY); } catch (InterruptedException e1) { } catch(OpenShiftException ex) { if(ex.getStatus() != null) { final int code = ex.getStatus().getCode(); if(code == IHttpConstants.STATUS_NOT_FOUND || code == IHttpConstants.STATUS_FORBIDDEN) { deleted = true; } } }finally { sleep = sleep + PROJECT_DELETE_DELAY; } }while(!deleted && sleep < MAX_PROJECT_DELETE_DELAY); return deleted; } }; return deleteProjectJob; }
Source:
private static String relaxPropertyName(String propertyName) { return propertyName.replace("-", "").toLowerCase(); }

Target:
private static String relaxPropertyName(String propertyName) { return propertyName.replace("-", "").replace("_", "").toLowerCase(); }
Source:
private void selectMapTheme() { final File[] themeFiles = Settings.getMapThemeFiles(); String currentTheme = StringUtils.EMPTY; int currentItem = 0; if (StringUtils.isNotEmpty(Settings.getCustomRenderThemeFile())) { File currentThemeFile = new File(Settings.getCustomRenderThemeFile()); currentTheme = currentThemeFile.getName(); } int index = 0; List<String> names = new ArrayList<String>(); names.add(res.getString(R.string.map_theme_builtin)); for (File file : themeFiles) { index++; if (currentTheme.equalsIgnoreCase(file.getName())) { currentItem = index; } names.add(file.getName()); } final int selectedItem = currentItem; AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(R.string.map_theme_select); builder.setSingleChoiceItems(names.toArray(new String[] {}), selectedItem, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int newItem) { if (newItem == selectedItem) { } else { if (newItem > 0) { Settings.setCustomRenderThemeFile(themeFiles[newItem - 1].getPath()); } else { Settings.setCustomRenderThemeFile(StringUtils.EMPTY); } mapView.setMapTheme(); } dialog.cancel(); } }); builder.show(); }

Target:
private void selectMapTheme() { final File[] themeFiles = Settings.getMapThemeFiles(); String currentTheme = StringUtils.EMPTY; String currentThemePath = Settings.getCustomRenderThemeFilePath(); if (StringUtils.isNotEmpty(currentThemePath)) { File currentThemeFile = new File(currentThemePath); currentTheme = currentThemeFile.getName(); } int currentItem = 0; List<String> names = new ArrayList<String>(); names.add(res.getString(R.string.map_theme_builtin)); for (File file : themeFiles) { if (currentTheme.equalsIgnoreCase(file.getName())) { currentItem = names.size(); } names.add(file.getName()); } final int selectedItem = currentItem; AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(R.string.map_theme_select); builder.setSingleChoiceItems(names.toArray(new String[] {}), selectedItem, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int newItem) { if (newItem == selectedItem) { } else { if (newItem > 0) { Settings.setCustomRenderThemeFile(themeFiles[newItem - 1].getPath()); } else { Settings.setCustomRenderThemeFile(StringUtils.EMPTY); } mapView.setMapTheme(); } dialog.cancel(); } }); builder.show(); }
Source:
public void should_define_correct_slugged_url() { assertNotNull(tags.findBySluggedName("java")); assertNotNull(tags.findBySluggedName("ruby")); assertNotNull(tags.findBySluggedName("cemaz-weird")); }

Target:
public void should_define_correct_slugged_url() { assertEquals(tags.findByUriName("java"), java); assertEquals(tags.findByUriName("ruby"), ruby); assertEquals(tags.findByUriName("c%2b%2b"), cplus); }
Source:
public void test() throws Exception { try { DesktopAgent desktop = connect(); } catch (Exception e) { Assert.assertFalse(true); } }

Target:
public void test() throws Exception { try { DesktopAgent desktop = connect(); } catch (Exception e) { Assert.fail(); } }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } EntryValue other = (EntryValue) obj; if (key == null) { if (other.key != null) { return false; } } else if (!key.equals(other.key)) { return false; } if (value == null) { if (other.value != null) { return false; } } else if (!value.equals(other.value)) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (!(obj instanceof EntryValue)) { return false; } final EntryValue other = (EntryValue) obj; return Objects.equal(key, other.key) && Objects.equal(value, other.value); }
Source:
public void visit(MetricsVisitor visitor) { updateGaugeValues(percentile); visitor.gauge(this); }

Target:
public void visit(MetricsVisitor visitor) { visitor.gauge(this); }
Source:
public TypeBinding upperBoundForProjection() { TypeBinding upperBound = null; if (this.wildcard != null) { ReferenceBinding[] supers = this.superInterfaces(); if (this.wildcard.boundKind == Wildcard.EXTENDS) { ReferenceBinding[] allBounds = new ReferenceBinding[supers.length + 1]; System.arraycopy(supers, 0, allBounds, 1, supers.length); allBounds[0] = this.superclass(); if (supers.length > 0) { ReferenceBinding[] glbs = Scope.greaterLowerBound(allBounds); if (glbs == null) { upperBound = new ProblemReferenceBinding(null, null, ProblemReasons.ParameterBoundMismatch); } else if (glbs.length == 1) { upperBound = glbs[0]; } else { upperBound = this.environment.createIntersectionType18(glbs); } } else { upperBound = this.superclass; } } else { boolean superClassIsObject = TypeBinding.equalsEquals(this.superclass(), this.environment.getResolvedJavaBaseType(TypeConstants.JAVA_LANG_OBJECT, null)); if (supers.length == 0) { upperBound = this.superclass(); } else if (supers.length == 1) { upperBound = superClassIsObject ? supers[0] : this.environment.createIntersectionType18(new ReferenceBinding[] {this.superclass(), supers[0]}); } else { if (superClassIsObject) { upperBound = this.environment.createIntersectionType18(supers); } else { ReferenceBinding[] allBounds = new ReferenceBinding[supers.length + 1]; System.arraycopy(supers, 0, allBounds, 1, supers.length); allBounds[0] = this.superclass(); upperBound = this.environment.createIntersectionType18(allBounds); } } } } else { upperBound = super.upperBound(); } return upperBound; }

Target:
public TypeBinding upperBoundForProjection() { TypeBinding upperBound = null; if (this.wildcard != null) { ReferenceBinding[] supers = this.superInterfaces(); if (this.wildcard.boundKind == Wildcard.EXTENDS) { if (supers.length > 0) { ReferenceBinding[] allBounds = new ReferenceBinding[supers.length + 1]; System.arraycopy(supers, 0, allBounds, 1, supers.length); allBounds[0] = this.superclass(); ReferenceBinding[] glbs = Scope.greaterLowerBound(allBounds); if (glbs == null) { upperBound = new ProblemReferenceBinding(null, null, ProblemReasons.ParameterBoundMismatch); } else if (glbs.length == 1) { upperBound = glbs[0]; } else { upperBound = this.environment.createIntersectionType18(glbs); } } else { upperBound = this.superclass; } } else { boolean superClassIsObject = TypeBinding.equalsEquals(this.superclass(), this.environment.getResolvedJavaBaseType(TypeConstants.JAVA_LANG_OBJECT, null)); if (supers.length == 0) { upperBound = this.superclass(); } else if (supers.length == 1) { upperBound = superClassIsObject ? supers[0] : this.environment.createIntersectionType18(new ReferenceBinding[] {this.superclass(), supers[0]}); } else { if (superClassIsObject) { upperBound = this.environment.createIntersectionType18(supers); } else { ReferenceBinding[] allBounds = new ReferenceBinding[supers.length + 1]; System.arraycopy(supers, 0, allBounds, 1, supers.length); allBounds[0] = this.superclass(); upperBound = this.environment.createIntersectionType18(allBounds); } } } } else { upperBound = super.upperBound(); } return upperBound; }
Source:
private static String prepareUrl( final String resolvedUrl, final File deprecatedFile, final String url, File basedir, String defaultFilePath ) { if ( resolvedUrl != null && !NO_URL.equals( resolvedUrl ) ) { return resolvedUrl; } if ( deprecatedFile != null && url != null && !url.isEmpty() ) { throw new IllegalArgumentException( "You can't use both overrideFile and overrideUrl" ); } if ( deprecatedFile != null && deprecatedFile.exists() ) { try { return deprecatedFile.toURI().toURL().toExternalForm(); } catch ( MalformedURLException e ) { throw new RuntimeException( e ); } } final Path basedirPath = basedir.toPath(); if ( url != null && UrlRequester.isStringUrl( url ) ) { try { return basedirPath.toUri().toURL().toExternalForm(); } catch ( MalformedURLException e ) { throw new RuntimeException( e ); } } final Path defaultPath = basedirPath.resolve( defaultFilePath ); if ( Files.exists( defaultPath ) ) { try { return defaultPath.toUri().toURL().toExternalForm(); } catch ( MalformedURLException e ) { throw new RuntimeException( e ); } } return NO_URL; }

Target:
private static String prepareUrl( final String resolvedUrl, final File deprecatedFile, final String url, File basedir, String defaultFilePath ) { if ( resolvedUrl != null && !NO_URL.equals( resolvedUrl ) ) { return resolvedUrl; } if ( deprecatedFile != null && url != null && !url.isEmpty() ) { throw new IllegalArgumentException( "You can't use both overrideFile and overrideUrl" ); } if ( deprecatedFile != null && deprecatedFile.exists() ) { return deprecatedFile.toURI().toString(); } final Path basedirPath = basedir.toPath(); if ( url != null && UrlRequester.isStringUrl( url ) ) { return basedirPath.toUri().toString(); } final Path defaultPath = basedirPath.resolve( defaultFilePath ); if ( Files.exists( defaultPath ) ) { return defaultPath.toUri().toString(); } return NO_URL; }
Source:
private void cleanOlderProjects() { Map<Integer, ArrayList<ProjectVersion>> projectVersions = new HashMap<Integer, ArrayList<ProjectVersion>>(); for (ProjectVersion version : installedProjects.values()) { ArrayList<ProjectVersion> versionList = projectVersions.get(version.getProjectId()); if (versionList == null) { versionList = new ArrayList<ProjectVersion>(); projectVersions.put(version.getProjectId(), versionList); } versionList.add(version); } HashSet<Pair<Integer, Integer>> activeProjectVersions = new HashSet<Pair<Integer, Integer>>(); for (FlowRunner runner : runningFlows.values()) { ExecutableFlow flow = runner.getExecutableFlow(); activeProjectVersions.add(new Pair<Integer, Integer>(flow .getProjectId(), flow.getVersion())); } for (Map.Entry<Integer, ArrayList<ProjectVersion>> entry : projectVersions .entrySet()) { ArrayList<ProjectVersion> installedVersions = entry.getValue(); if (installedVersions.size() == 1) { continue; } Collections.sort(installedVersions); for (int i = 0; i < installedVersions.size() - 1; ++i) { ProjectVersion version = installedVersions.get(i); Pair<Integer, Integer> versionKey = new Pair<Integer, Integer>(version.getProjectId(), version.getVersion()); if (!activeProjectVersions.contains(versionKey)) { try { logger.info("Removing old unused installed project " + version.getProjectId() + ":" + version.getVersion()); deleteDirectory(version); installedProjects.remove(new Pair<Integer, Integer>(version .getProjectId(), version.getVersion())); } catch (IOException e) { e.printStackTrace(); } installedVersions.remove(versionKey); } } } }

Target:
private void cleanOlderProjects() { Map<Integer, ArrayList<ProjectVersion>> projectVersions = new HashMap<Integer, ArrayList<ProjectVersion>>(); for (ProjectVersion version : installedProjects.values()) { ArrayList<ProjectVersion> versionList = projectVersions.get(version.getProjectId()); if (versionList == null) { versionList = new ArrayList<ProjectVersion>(); projectVersions.put(version.getProjectId(), versionList); } versionList.add(version); } HashSet<Pair<Integer, Integer>> activeProjectVersions = new HashSet<Pair<Integer, Integer>>(); for (FlowRunner runner : runningFlows.values()) { ExecutableFlow flow = runner.getExecutableFlow(); activeProjectVersions.add(new Pair<Integer, Integer>(flow .getProjectId(), flow.getVersion())); } for (Map.Entry<Integer, ArrayList<ProjectVersion>> entry : projectVersions .entrySet()) { ArrayList<ProjectVersion> installedVersions = entry.getValue(); if (installedVersions.size() == 1) { continue; } Collections.sort(installedVersions); for (int i = 0; i < installedVersions.size() - 1; ++i) { ProjectVersion version = installedVersions.get(i); Pair<Integer, Integer> versionKey = new Pair<Integer, Integer>(version.getProjectId(), version.getVersion()); if (!activeProjectVersions.contains(versionKey)) { try { logger.info("Removing old unused installed project " + version.getProjectId() + ":" + version.getVersion()); deleteDirectory(version); installedProjects.remove(new Pair<Integer, Integer>(version .getProjectId(), version.getVersion())); } catch (IOException e) { logger.error(e); } installedVersions.remove(versionKey); } } } }
Source:
public boolean act (float delta) { if (complete) return true; complete = true; Pool pool = getPool(); setPool(null); try { Array<Action> actions = this.actions; for (int i = 0, n = actions.size; i < n && actor != null; i++) { if (currentAction.getActor()!=null && !currentAction.act(delta)) complete = false; if (actor == null) return true; if (actor == null) return true; } return complete; } finally { setPool(pool); } }

Target:
public boolean act (float delta) { if (complete) return true; complete = true; Pool pool = getPool(); setPool(null); try { Array<Action> actions = this.actions; for (int i = 0, n = actions.size; i < n && actor != null; i++) { Action currentAction = actions.get(i); if (currentAction.getActor()!=null && !currentAction.act(delta)) complete = false; if (actor == null) return true; } return complete; } finally { setPool(pool); } }
Source:
public void startElement(TagNode node) { if (!stack.isEmpty()) { stack.peekFirst().hasAlternativeContent = true; } if (isObject(node)) { stack.addFirst(new ObjectEntry(node)); } }

Target:
public void startElement(TagNode node) { object = isObject(node) ? node : null; }
Source:
private void createShallowFile(ObjectId... shallowCommits) throws IOException { rw = createRevWalk(); StringBuilder builder = new StringBuilder(); for (ObjectId commit : shallowCommits) { builder.append(commit.getName() + "\n"); } JGitTestUtil.write(new File(db.getDirectory(), "shallow"), builder.toString()); }

Target:
private void createShallowFile(ObjectId... shallowCommits) throws IOException { rw.close(); rw = createRevWalk(); StringBuilder builder = new StringBuilder(); for (ObjectId commit : shallowCommits) { builder.append(commit.getName() + "\n"); } JGitTestUtil.write(new File(db.getDirectory(), "shallow"), builder.toString()); }
Source:
private void addObjectsToTable(CorfuRuntime rt, final int count) { System.out.println("Start Writing Java Obj" + System.currentTimeMillis()); long start = System.currentTimeMillis(); Map<UUID, Event> map = rt.getObjectsView() .build() .setStreamName("s1") .setType(CorfuTable.class) .open(); Event event; for(int i=0; i<count; i++) { event = new Event(i, "TestEvent"+i, 8000, 20000, 10 ); rt.getObjectsView().TXBegin(); map.put(UUID.randomUUID(), event); rt.getObjectsView().TXEnd(); } long end = System.currentTimeMillis(); System.out.println("Time Taken: "+ (end - start)); System.out.println("End Writing Java Obj" + System.currentTimeMillis()); }

Target:
private void addObjectsToTable(CorfuRuntime rt, final int count) { System.out.println("Start Writing Java Obj" + System.currentTimeMillis()); long start = System.currentTimeMillis(); Map<UUID, Event> map = rt.getObjectsView() .build() .setStreamName("s1") .setType(CorfuTable.class) .open(); Event event; for(int i=0; i<count; i++) { event = new Event(i, "TestEvent"+i, randomPort, eventTime, randomFreq ); rt.getObjectsView().TXBegin(); map.put(UUID.randomUUID(), event); rt.getObjectsView().TXEnd(); } long end = System.currentTimeMillis(); System.out.println("Time Taken: "+ (end - start)); System.out.println("End Writing Java Obj" + System.currentTimeMillis()); }
Source:
public void testClearMessages() { final AbstractCheck check = new DummyAbstractCheck(); check.log(0, "key", "args"); final Collection<LocalizedMessage> messages = (Collection<LocalizedMessage>) Whitebox.getInternalState(check, "messages"); check.clearMessages(); Assert.assertEquals(0, messages.size()); }

Target:
public void testClearMessages() { final AbstractCheck check = new DummyAbstractCheck(); check.log(0, "key", "args"); final Collection<LocalizedMessage> messages = (Collection<LocalizedMessage>) Whitebox.getInternalState(check, "messages"); Assert.assertEquals(1, messages.size()); check.clearMessages(); Assert.assertEquals(0, messages.size()); }
Source:
public void testgetServerAddress_ValidIpAndValidPort_ShouldGetAddressSemiColonPort() { final String ipAddress = "192.168.1.186"; final int port = 9300; final Server server = Server.builder().withIpAddress(ipAddress).withEsTransportTcpPort(port).build(); ESClient esClient = new ESClient(); final String fullAddress = esClient.getServerAddress(server); final String expectedAddress = ipAddress + ":" + port; assertEquals(expectedAddress, fullAddress); }

Target:
public void testgetServerAddress_ValidIpAndValidPort_ShouldGetAddressSemiColonPort() { final String ipAddress = "192.168.1.186"; final int port = 9300; final Server server = Server.builder().withIpAddress(ipAddress).withEsTransportTcpPort(port).build(); final ESClient esClient = new ESClient(); final String fullAddress = esClient.getServerAddress(server); final String expectedAddress = ipAddress + StringPool.COLON + port; assertEquals(expectedAddress, fullAddress); }
Source:
public void checkMoveItem0() throws Exception { setFieldsForTest("test0"); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/A0.java"); editor.waitActive(); editor.waitTextIntoEditor(contentFromInA); projectExplorer.waitAndSelectItemByName("A0.java"); menu.runCommand( TestMenuCommandsConstants.Assistant.ASSISTANT, TestMenuCommandsConstants.Assistant.Refactoring.REFACTORING, TestMenuCommandsConstants.Assistant.Refactoring.MOVE); refactor.waitMoveItemFormIsOpen(); refactor.clickCancelButtonRefactorForm(); refactor.waitRenameFieldFormIsClosed(); menu.runCommand( TestMenuCommandsConstants.Assistant.ASSISTANT, TestMenuCommandsConstants.Assistant.Refactoring.REFACTORING, TestMenuCommandsConstants.Assistant.Refactoring.MOVE); refactor.waitMoveItemFormIsOpen(); refactor.clickOnExpandIconTree(PROJECT_NAME); refactor.clickOnExpandIconTree("/src/main/java"); refactor.chooseDestinationForItem("p1"); refactor.clickOkButtonRefactorForm(); loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); loader.waitOnClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, LOAD_PAGE_TIMEOUT_SEC); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/p1/A0.java"); editor.waitTextIntoEditor(contentFromOutA); projectExplorer.waitDisappearItemByPath(pathToPackageInChePrefix + "/r/A0.java"); editor.closeFileByNameWithSaving("A0"); }

Target:
public void checkMoveItem0() throws Exception { setFieldsForTest("test0"); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/r/A0.java"); editor.waitActive(); editor.waitTextIntoEditor(contentFromInA); projectExplorer.waitAndSelectItemByName("A0.java"); menu.runCommand( TestMenuCommandsConstants.Assistant.ASSISTANT, TestMenuCommandsConstants.Assistant.Refactoring.REFACTORING, TestMenuCommandsConstants.Assistant.Refactoring.MOVE); refactor.waitMoveItemFormIsOpen(); refactor.clickCancelButtonRefactorForm(); refactor.waitRenameFieldFormIsClosed(); menu.runCommand( TestMenuCommandsConstants.Assistant.ASSISTANT, TestMenuCommandsConstants.Assistant.Refactoring.REFACTORING, TestMenuCommandsConstants.Assistant.Refactoring.MOVE); refactor.waitMoveItemFormIsOpen(); refactor.clickOnExpandIconTree(PROJECT_NAME); refactor.clickOnExpandIconTree("/src/main/java"); refactor.chooseDestinationForItem("p1"); refactor.clickOkButtonRefactorForm(); loader.waitOnClosed(); refactor.waitMoveItemFormIsClosed(); events.waitExpectedMessage(APPLY_WORKSPACE_CHANGES, DEFAULT_TIMEOUT); projectExplorer.openItemByPath(pathToPackageInChePrefix + "/p1/A0.java"); editor.waitTextIntoEditor(contentFromOutA); projectExplorer.waitDisappearItemByPath(pathToPackageInChePrefix + "/r/A0.java"); editor.closeFileByNameWithSaving("A0"); }
Source:
public CompletableFuture<Long> readLastAddConfirmed() { CompletableFuture<Long> counter = new CompletableFuture<>(); ReadLastConfirmedCallback callback = (int rc, long lastConfirmed, Object ctx) -> { SyncCallbackUtils.finish(rc, lastConfirmed, counter); }; asyncReadLastConfirmed(callback, counter); return counter; }

Target:
public CompletableFuture<Long> readLastAddConfirmed() { FutureReadLastConfirmed result = new FutureReadLastConfirmed(); asyncReadLastConfirmed(result, null); return result; }
Source:
public CompletableFuture<Void> restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot) { CompletableFuture<Void> future = new CompletableFuture<>(); listSnapshots(Pattern.compile(snapshotName)) .whenComplete((snapshotDescriptions, err) -> { if (err != null) { future.completeExceptionally(err); return; } TableName tableName = snapshotExists(snapshotName, snapshotDescriptions); if (tableName == null) { future.completeExceptionally(new RestoreSnapshotException( "Unable to find the table name for snapshot=" + snapshotName)); return; } final TableName finalTableName = tableName; tableExists(finalTableName).whenComplete((exists, err2) -> { if (err2 != null) { future.completeExceptionally(err2); } else if (!exists) { completeConditionalOnFuture(future, cloneSnapshot(snapshotName, finalTableName)); } else { isTableDisabled(finalTableName).whenComplete((disabled, err4) -> { if (err4 != null) { future.completeExceptionally(err4); } else if (!disabled) { future.completeExceptionally( new TableNotDisabledException(finalTableName)); } else { completeConditionalOnFuture(future, restoreSnapshot(snapshotName, takeFailSafeSnapshot)); } }); } }); }); return future; }

Target:
public CompletableFuture<Void> restoreSnapshot(String snapshotName, boolean takeFailSafeSnapshot) { CompletableFuture<Void> future = new CompletableFuture<>(); listSnapshots(Pattern.compile(snapshotName)).whenComplete( (snapshotDescriptions, err) -> { if (err != null) { future.completeExceptionally(err); return; } final TableName tableName = snapshotExists(snapshotName,snapshotDescriptions); if (tableName == null) { future.completeExceptionally(new RestoreSnapshotException( "Unable to find the table name for snapshot=" + snapshotName)); return; } tableExists(tableName) .whenComplete((exists, err2) -> { if (err2 != null) { future.completeExceptionally(err2); } else if (!exists) { completeConditionalOnFuture(future,cloneSnapshot(snapshotName, tableName)); } else { isTableDisabled(tableName).whenComplete( (disabled, err4) -> { if (err4 != null) { future.completeExceptionally(err4); } else if (!disabled) { future.completeExceptionally(new TableNotDisabledException(tableName)); } else { completeConditionalOnFuture(future, restoreSnapshot(snapshotName,takeFailSafeSnapshot)); } }); } }); }); return future; }
Source:
public AlertFragment getAlertArea() { WebElement element = browser.findElement(By.cssSelector(AlertFragment.ROOT_SELECTOR)); AlertFragment alert = Graphene.createPageFragment(AlertFragment.class, element); return alert; }

Target:
public AlertFragment getAlertArea() { By alertSelector = By.cssSelector(AlertFragment.ROOT_SELECTOR); Graphene.waitGui().until().element(alertSelector).is().visible(); WebElement element = browser.findElement(alertSelector); AlertFragment alert = Graphene.createPageFragment(AlertFragment.class, element); return alert; }
Source:
private void mergeBranch(String branchToMerge, boolean squash) throws Exception { SWTBotShell mergeDialog = openMergeDialog(); mergeDialog.bot().tree().getTreeItem(LOCAL_BRANCHES).expand().getNode(branchToMerge).select(); if (squash) { mergeDialog.bot().radio(UIText.MergeTargetSelectionDialog_MergeTypeSquashButton).click(); } mergeDialog.bot().button(UIText.MergeTargetSelectionDialog_ButtonMerge).click(); bot.shell(UIText.MergeAction_MergeResultTitle).close(); }

Target:
private void mergeBranch(String branchToMerge, boolean squash) throws Exception { SWTBotShell mergeDialog = openMergeDialog(); mergeDialog.bot().tree().getTreeItem(LOCAL_BRANCHES).expand().getNode(branchToMerge).select(); if (squash) mergeDialog.bot().radio(UIText.MergeTargetSelectionDialog_MergeTypeSquashButton).click(); mergeDialog.bot().button(UIText.MergeTargetSelectionDialog_ButtonMerge).click(); bot.shell(UIText.MergeAction_MergeResultTitle).close(); }
Source:
public ExpressionTree ENCAPSULATED_COMPLEX_VARIABLE() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.COMPLEX_ENCAPS_VARIABLE) .is(f.encapsulatedComplexVariable( b.token(PHPPunctuator.LCURLYBRACE), b.token(PHPLexicalGrammar.NEXT_IS_DOLLAR), EXPRESSION(), b.token(PHPPunctuator.RCURLYBRACE) )); }

Target:
public ExpressionTree ENCAPSULATED_COMPLEX_VARIABLE() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.COMPLEX_ENCAPS_VARIABLE) .is(f.encapsulatedComplexVariable( b.token(LCURLYBRACE), b.token(PHPLexicalGrammar.NEXT_IS_DOLLAR), EXPRESSION(), b.token(RCURLYBRACE) )); }
Source:
public ResourceMonitorImpl(FileMonitor fileMonitor, Resource<?> resource, ResourceFactory resourceFactory, ResourceFilter resourceFilter) { if (resource instanceof DirectoryResource || resource instanceof PathResource) { this.fileMonitor = fileMonitor; this.resource = resource; this.resourceFactory = resourceFactory; this.resourceFilter = resourceFilter; } else { throw new IllegalArgumentException("resource parameter must be DirectoryResource or PathResource"); } }

Target:
public ResourceMonitorImpl(FileMonitor fileMonitor, Resource<?> resource, ResourceFactory resourceFactory, ResourceFilter resourceFilter) { Assert.isTrue(resource instanceof DirectoryResource || resource instanceof PathResource, "resource parameter must be either DirectoryResource or PathResource"); this.resourceIsFile = resource instanceof FileResource; this.fileMonitor = fileMonitor; this.resource = resource; this.resourceFactory = resourceFactory; this.resourceFilter = resourceFilter; }
Source:
private void assertLanRemoved(Lan lan) { assertPredicate(new Predicate<String>() { @Override public boolean apply(String args) { String[] params = args.split(","); return lanApi().get(params[0], params[1]) == null; } }, complexId(lan.dataCenterId(), lan.id())); }

Target:
private void assertLanRemoved(Lan lan) { assertPredicate(new Predicate<Lan>() { @Override public boolean apply(Lan testLan) { return lanApi().get(testLan.dataCenterId(), testLan.id()) == null; } }, lan); }
Source:
public Object[][] expectedParsing() { return new Object[][] { {"<LINK_8>", "eclipse", "che", "master", null}, {"<LINK_8>123", "eclipse", "che123", "master", null}, {"<LINK_0>", "eclipse", "che", "master", null}, {"<LINK_4>", "eclipse", "che.with.dot", "master", null}, {"<LINK_5>", "eclipse", "che-with-hyphen", "master", null}, { "<LINK_2>", "eclipse", "che-with-hyphen", "master", null }, {"<LINK_8>/", "eclipse", "che", "master", null}, {"<LINK_8>/tree/4.2.x", "eclipse", "che", "4.2.x", null}, { "<LINK_8>/tree/master/dashboard/", "eclipse", "che", "master", "dashboard/" }, { "<LINK_6>", "eclipse", "che", "master", "plugins/plugin-git/che-plugin-git-ext-git" } }; }

Target:
public Object[][] expectedParsing() { return new Object[][] { {"<LINK_8>", "eclipse", "che", "master", null}, {"<LINK_8>123", "eclipse", "che123", "master", null}, {"<LINK_0>", "eclipse", "che", "master", null}, {"<LINK_4>", "eclipse", "che.with.dot", "master", null}, {"<LINK_1>", "eclipse", "-", "master", null}, {"<LINK_7>", "eclipse", "-j", "master", null}, {"<LINK_12>", "eclipse", "-", "master", null}, {"<LINK_5>", "eclipse", "che-with-hyphen", "master", null}, { "<LINK_2>", "eclipse", "che-with-hyphen", "master", null }, {"<LINK_8>/", "eclipse", "che", "master", null}, {"<LINK_3>", "eclipse", "repositorygit", "master", null}, {"<LINK_8>/tree/4.2.x", "eclipse", "che", "4.2.x", null}, { "<LINK_8>/tree/master/dashboard/", "eclipse", "che", "master", "dashboard/" }, { "<LINK_6>", "eclipse", "che", "master", "plugins/plugin-git/che-plugin-git-ext-git" } }; }
Source:
public void SaveM3U(final String filePath, final String fileName) { Toast toast = Toast.makeText(context, context.getResources().getText(R.string.notify_save_playlist_now, filePath, fileName), Toast.LENGTH_LONG); toast.show(); new AsyncTask<Void, Void, Boolean>() { @Override protected Boolean doInBackground(Void... params) { return SaveM3UInternal(filePath, fileName); } @Override protected void onPostExecute(Boolean result) { if (result.booleanValue()) { Log.i("SAVE", "OK"); Toast toast = Toast.makeText(context, context.getResources().getText(R.string.notify_save_playlist_ok, filePath, fileName), Toast.LENGTH_LONG); toast.show(); } else { Log.i("SAVE", "NOK"); Toast toast = Toast.makeText(context, context.getResources().getText(R.string.notify_save_playlist_nok, filePath, fileName), Toast.LENGTH_LONG); toast.show(); } super.onPostExecute(result); } }.execute(); }

Target:
public void SaveM3U(final String filePath, final String fileName) { Toast toast = Toast.makeText(context, context.getResources().getString(R.string.notify_save_playlist_now, filePath, fileName), Toast.LENGTH_LONG); toast.show(); new AsyncTask<Void, Void, Boolean>() { @Override protected Boolean doInBackground(Void... params) { return SaveM3UInternal(filePath, fileName); } @Override protected void onPostExecute(Boolean result) { if (result.booleanValue()) { Log.i("SAVE", "OK"); Toast toast = Toast.makeText(context, context.getResources().getString(R.string.notify_save_playlist_ok, filePath, fileName), Toast.LENGTH_LONG); toast.show(); } else { Log.i("SAVE", "NOK"); Toast toast = Toast.makeText(context, context.getResources().getString(R.string.notify_save_playlist_nok, filePath, fileName), Toast.LENGTH_LONG); toast.show(); } super.onPostExecute(result); } }.execute(); }
Source:
public static Vector<String> extractEntityOwners(UserSandbox sandbox) { Vector<String> owners = new Vector<String>(); Vector<String> users = new Vector<String>(); for (IStorageIterator<User> userIterator = sandbox.getUserStorage().iterate(); userIterator.hasMore(); ) { String id = userIterator.nextRecord().getUniqueId(); owners.addElement(id); users.addElement(id); } for (String userId : users) { DataInstance instance = loadFixture(sandbox, "user-groups", userId); if (instance == null) { continue; } EvaluationContext ec = new EvaluationContext(instance); for (TreeReference ref : ec.expandReference(XPathReference.getPathExpr("/groups/group/@id").getReference())) { AbstractTreeElement<AbstractTreeElement> idelement = ec.resolveReference(ref); if (idelement.getValue() != null) { owners.addElement(idelement.getValue().uncast().getString()); } } } return owners; }

Target:
public static Vector<String> extractEntityOwners(UserSandbox sandbox) { Vector<String> owners = new Vector<String>(); Vector<String> users = new Vector<String>(); for (IStorageIterator<User> userIterator = sandbox.getUserStorage().iterate(); userIterator.hasMore(); ) { String id = userIterator.nextRecord().getUniqueId(); owners.addElement(id); users.addElement(id); } for (String userId : users) { DataInstance instance = loadFixture(sandbox, "user-groups", userId); if (instance == null) { continue; } EvaluationContext ec = new EvaluationContext(instance); for (TreeReference ref : ec.expandReference(XPathReference.getPathExpr("/groups/group/@id").getReference())) { AbstractTreeElement idElement = ec.resolveReference(ref); if (idElement.getValue() != null) { owners.addElement(idElement.getValue().uncast().getString()); } } } return owners; }
Source:
public void returnsProperResponseCodeOnNoContentLength() throws Exception { final ByteArrayOutputStream output = new ByteArrayOutputStream(); final ServerSocket server = new ServerSocket(0); try { new Thread( new Runnable() { @Override public void run() { try { new BkBasic(new TkText("411 Test")).accept( server.accept() ); } catch (final IOException exception) { throw new IllegalStateException(exception); } } } ).start(); final Socket socket = new Socket( server.getInetAddress(), server.getLocalPort() ); try { socket.getOutputStream().write( Joiner.on(BkBasicTest.CRLF).join( BkBasicTest.POST, BkBasicTest.HOST, "", BkBasicTest.HELLO_WORLD ).getBytes() ); final InputStream input = socket.getInputStream(); final byte[] buffer = new byte[4096]; for (int count = input.read(buffer); count != -1; count = input.read(buffer)) { output.write(buffer, 0, count); } } finally { socket.close(); } } finally { server.close(); } MatcherAssert.assertThat( output.toString(), Matchers.containsString("HTTP/1.1 411 Length Required") ); }

Target:
public void returnsProperResponseCodeOnNoContentLength() throws Exception { final ByteArrayOutputStream output = new ByteArrayOutputStream(); final ServerSocket server = new ServerSocket(0); final String text = "Say hello!"; try { new Thread( new Runnable() { @Override public void run() { try { new BkBasic(new TkText("411 Test")).accept( server.accept() ); } catch (final IOException exception) { throw new IllegalStateException(exception); } } } ).start(); final Socket socket = new Socket( server.getInetAddress(), server.getLocalPort() ); try { socket.getOutputStream().write( Joiner.on(BkBasicTest.CRLF).join( BkBasicTest.POST, BkBasicTest.HOST, "", text ).getBytes() ); final InputStream input = socket.getInputStream(); final byte[] buffer = new byte[4096]; for (int count = input.read(buffer); count != -1; count = input.read(buffer)) { output.write(buffer, 0, count); } } finally { socket.close(); } } finally { server.close(); } MatcherAssert.assertThat( output.toString(), Matchers.containsString("HTTP/1.1 411 Length Required") ); }
Source:
public String getDescriptorFile() { return _descriptorFile; }

Target:
public URI getDescriptorFile() { return _descriptorFile; }
Source:
public static void setLogDelegateFactory(LogDelegateFactory factory) { LogDelegateFactory current = delegateFactory; if (current != null) { try { getLogger(LoggerFactory.class).info("Replacing LogDelegateFactory " + current + " by " + factory); } catch (Throwable t) { t.printStackTrace(); } loggers.clear(); } delegateFactory = factory; }

Target:
public static synchronized void setLogDelegateFactory(LogDelegateFactory factory) { requireNonNull(factory, "factory == null"); LogDelegateFactory current = delegateFactory; if (current != null) { try { getLogger(LoggerFactory.class).debug("Replacing LogDelegateFactory " + current + " by " + factory); } catch (Throwable t) { factory.createDelegate(LoggerFactory.class.getCanonicalName()) .error("Failed to log LogDelegateFactory replacement on previous implementation", t); } loggers.clear(); } delegateFactory = factory; }
Source:
public ThriftIndexHandle( SchemaTableName schemaTableName, TupleDomain<ColumnHandle> tupleDomain, ConnectorSession session) { this.schemaTableName = requireNonNull(schemaTableName, "schemaTableName is null"); this.tupleDomain = requireNonNull(tupleDomain, "tupleDomain is null"); this.session = Optional.of(requireNonNull(session, "session is null")); }

Target:
public ThriftIndexHandle( SchemaTableName schemaTableName, TupleDomain<ColumnHandle> tupleDomain, ConnectorSession session) { this(schemaTableName, tupleDomain, Optional.of(requireNonNull(session, "session is null"))); }