auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int compareTo(ApplicationInfoEx other) { if (mContext == null) return TextUtils.join(", ", getApplicationName()).compareToIgnoreCase( TextUtils.join(", ", other.getApplicationName())); Collator collator = Collator.getInstance(Locale.getDefault()); return collator.compare(TextUtils.join(", ", getApplicationName()), TextUtils.join(", ", other.getApplicationName())); }

Target:
public int compareTo(ApplicationInfoEx other) { Collator collator = Collator.getInstance(Locale.getDefault()); return collator.compare(TextUtils.join(", ", getApplicationName()), TextUtils.join(", ", other.getApplicationName())); }
Source:
public void markAsInvalid(List<String> validationHints) { super.markAsInvalid(validationHints); getValidatedWidgetStyle().setBorderStyle(BorderStyle.SOLID); }

Target:
public void markAsInvalid(List<String> validationHints) { super.markAsInvalid(validationHints); }
Source:
private void abandonAudioFocus() { if (audioFocusRequest != null && AudioManagerCompat.abandonAudioFocusRequest(audioManager, audioFocusRequest) != AudioManager.AUDIOFOCUS_REQUEST_FAILED) { audioFocusRequest = null; } isAudioFocusGranted = false; }

Target:
private void abandonAudioFocus() { AudioManagerCompat.abandonAudioFocusRequest(audioManager, audioFocusRequest); isAudioFocusGranted = false; if (!audioFocusRequestAbandoned()) { Log.d(TAG, "Failed to abandon audioFocusRequest."); } }
Source:
public void execute() throws MojoExecutionException, MojoFailureException { if (emulatorPath == null) { GcloudHelper helper = new GcloudHelper(Executors.newCachedThreadPool()); emulatorPath = helper.getEmulatorPath(); } EmulatorController controller = new EmulatorController.Builder() .setEmulatorPath(emulatorPath) .setPortFilePath(propertiesPath) .build(); getLog().debug("Starting bigtable emulator"); try { controller.start(); } catch (IOException e) { throw new MojoExecutionException("Failed to start emulator", e); } getLog().info("Bigtable emulator is running on port " + controller.getPort()); try { controller.waitForTermination(); } catch (InterruptedException e) { controller.stop(); getLog().info("Exiting"); } }

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if (emulatorPath == null) { GcloudHelper helper = new GcloudHelper(Executors.newCachedThreadPool()); emulatorPath = helper.getEmulatorPath(); } EmulatorController controller = new EmulatorController.Builder() .setEmulatorPath(emulatorPath) .setPortFilePath(propertiesPath) .setLogPath(logPath) .build(); getLog().debug("Starting bigtable emulator"); try { controller.start(); } catch (IOException e) { throw new MojoExecutionException("Failed to start emulator", e); } getLog().info("Bigtable emulator is running on port " + controller.getPort()); try { controller.waitForTermination(); } catch (InterruptedException e) { controller.stop(); getLog().info("Exiting"); } }
Source:
public RGB buttonColour() { Color c = Color.decode(buttonColour); return new RGB(c.getRed(), c.getGreen(), c.getBlue()); }

Target:
public RGB buttonColour() { return getRGBFromHex(buttonColour); }
Source:
protected void initRPCDispatcher() { this.dispatcher = new CommandAwareRpcDispatcher(channel, this, globalHandler, this.getTimeoutExecutor(), timeService, marshaller); Field bufField; try { bufField = ByteArrayDataInputStream.class.getDeclaredField("buf"); bufField.setAccessible(true); } catch (NoSuchFieldException e) { throw new IllegalStateException("Field not found", e); } this.dispatcher.start(); }

Target:
protected void initRPCDispatcher() { this.dispatcher = new CommandAwareRpcDispatcher(channel, this, globalHandler, timeoutExecutor, timeService, remoteExecutor, marshaller); this.dispatcher.start(); }
Source:
private List<String> getSwiftParams(SwiftTO swift, String container, String ldir, String lfilename, Boolean isISCSI) { List<String> params = Arrays.asList( "op", "upload", "url", swift.getUrl(), "account", swift.getAccount(), "username", swift.getUserName(), "key", swift.getKey(), "container", container, "ldir", ldir, "lfilename", lfilename, "isISCSI", isISCSI.toString() ); if (swift.getStoragePolicy() != null) { params.add("storagepolicy"); params.add(swift.getStoragePolicy()); } return params; }

Target:
List<String> getSwiftParams(SwiftTO swift, String container, String ldir, String lfilename, Boolean isISCSI) { List<String> params = new ArrayList<>(); params.add("op"); params.add("upload"); params.add("url"); params.add(swift.getUrl()); params.add("account"); params.add(swift.getAccount()); params.add("username"); params.add(swift.getUserName()); params.add("key"); params.add(swift.getKey()); params.add("container"); params.add(container); params.add("ldir"); params.add(ldir); params.add("lfilename"); params.add(lfilename); params.add("isISCSI"); params.add(isISCSI.toString()); if (swift.getStoragePolicy() != null) { params.add("storagepolicy"); params.add(swift.getStoragePolicy()); } return params; }
Source:
public void checkAttributeSemantics(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute) throws InternalErrorException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException{ Integer isSystemUnixGroup = attribute.valueAsInteger(); if(isSystemUnixGroup == null) return; Attribute sysUnixGroupName; Attribute sysUnixGID; if(isSystemUnixGroup == 1) { try { sysUnixGroupName = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, group, A_GR_systemUnixGroupName); sysUnixGID = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, group, A_GR_systemUnixGID); } catch (AttributeNotExistsException ex) { throw new ConsistencyErrorException("Attributes sysUnixGroupName or sysUnixGID not exist.",ex); } catch (GroupResourceMismatchException ex) { throw new InternalErrorException(ex); } try { sess.getPerunBl().getAttributesManagerBl().checkAttributeSemantics(sess, resource, group, sysUnixGroupName); } catch(WrongReferenceAttributeValueException ex) { throw new WrongReferenceAttributeValueException("Bad value in sysUnixGroupName attribute.",ex); } catch (GroupResourceMismatchException ex) { throw new InternalErrorException(ex); } try { sess.getPerunBl().getAttributesManagerBl().checkAttributeSemantics(sess, resource, group, sysUnixGID); } catch(WrongReferenceAttributeValueException ex) { throw new WrongReferenceAttributeValueException("Bad value in sysUnixGID.",ex); } catch (GroupResourceMismatchException ex) { throw new InternalErrorException(ex); } } }

Target:
public void checkAttributeSemantics(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute) throws InternalErrorException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException{ Integer isSystemUnixGroup = attribute.valueAsInteger(); if(isSystemUnixGroup == null) return; Attribute sysUnixGroupName; Attribute sysUnixGID; if(isSystemUnixGroup == 1) { try { sysUnixGroupName = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, group, A_GR_systemUnixGroupName); sysUnixGID = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, group, A_GR_systemUnixGID); } catch (AttributeNotExistsException ex) { throw new ConsistencyErrorException("Attributes sysUnixGroupName or sysUnixGID not exist.",ex); } catch (GroupResourceMismatchException ex) { throw new InternalErrorException(ex); } try { sess.getPerunBl().getAttributesManagerBl().checkAttributeSemantics(sess, resource, group, sysUnixGroupName); } catch (GroupResourceMismatchException ex) { throw new InternalErrorException(ex); } try { sess.getPerunBl().getAttributesManagerBl().checkAttributeSemantics(sess, resource, group, sysUnixGID); } catch (GroupResourceMismatchException ex) { throw new InternalErrorException(ex); } } }
Source:
void start() { stop(); if (mLastLocation == null) { return; } LocationManager lm = (LocationManager)mContext.getSystemService(Context.LOCATION_SERVICE); lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mListener); handler.postDelayed(mRunnable, 30 * 1000); }

Target:
void start() { stop(); if (mLastLocation == null) { AppGlobals.guiLogInfo("Updated location for false pos. filter"); LocationManager lm = (LocationManager)mContext.getSystemService(Context.LOCATION_SERVICE); mLastLocation = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER); if (mLastLocation != null) { mLastLocation.setTime(mClock.currentTimeMillis()); } } if (mLastLocation == null) { return; } LocationManager lm = (LocationManager)mContext.getSystemService(Context.LOCATION_SERVICE); lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mListener); mHandler.postDelayed(mStopListeningTimer, MAX_TIME_TO_WAIT_FOR_GPS_MS); }
Source:
public Callout parse() throws InvalidStructureException, IOException, XmlPullParserException { String actionName = parser.getAttributeValue(null, "action"); String image = parser.getAttributeValue(null, "image"); String dislayName = parser.getAttributeValue(null, "name"); Callout callout = new Callout(actionName, image, dislayName); while(nextTagInBlock("lookup")){ String tagname = parser.getName(); if(tagname != null && tagname.equals("extra")){ callout.addExtra(parser.getAttributeValue(null, "key"), parser.getAttributeValue(null, "value")); } else if (tagname != null && tagname.equals("response")){ callout.addResponse(parser.getAttributeValue(null, "key")); } } return callout; }

Target:
public Callout parse() throws InvalidStructureException, IOException, XmlPullParserException { String actionName = parser.getAttributeValue(null, "action"); String image = parser.getAttributeValue(null, "image"); String displayName = parser.getAttributeValue(null, "name"); Callout callout = new Callout(actionName, image, displayName); while(nextTagInBlock("lookup")){ String tagName = parser.getName(); if(("extra").equals(tagName)){ callout.addExtra(parser.getAttributeValue(null, "key"), parser.getAttributeValue(null, "value")); } else if ("response".equals(tagName)){ callout.addResponse(parser.getAttributeValue(null, "key")); } } return callout; }
Source:
public void LargeTest() { ITmfStateSystemBuilder fixture = createFixture(); int parentQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH, CALLSTACK_PATH); for (int i = 0; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i)); TmfStateValue statev = TmfStateValue.newValueLong(i); fixture.pushAttribute(0, statev, quark); } for (int i = 0; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i)); fixture.popAttribute(10, quark); } fixture.closeHistory(1002); CGAnalysis cga = new CGAnalysis(); assertTrue(cga.iterateOverStateSystem(fixture, tp, pp, csp, new NullProgressMonitor())); ISegmentStore<@NonNull ISegment> segmentStore = cga.getSegmentStore(); assertNotNull(segmentStore); Object[] segments = segmentStore.toArray(); assertEquals("Number of segments found", LARGE_AMOUNT_OF_SEGMENTS, segments.length, ERROR); }

Target:
public void LargeTest() { ITmfStateSystemBuilder fixture = createFixture(); int parentQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH, CALLSTACK_PATH); for (int i = 0; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i)); TmfStateValue statev = TmfStateValue.newValueLong(i); fixture.pushAttribute(0, statev, quark); } for (int i = 0; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i)); fixture.popAttribute(10, quark); } fixture.closeHistory(11); CGAnalysis cga = new CGAnalysis(); assertTrue(cga.iterateOverStateSystem(fixture, tp, pp, csp, new NullProgressMonitor())); ISegmentStore<@NonNull ISegment> segmentStore = cga.getSegmentStore(); assertNotNull(segmentStore); Object[] segments = segmentStore.toArray(); assertEquals("Number of segments found", LARGE_AMOUNT_OF_SEGMENTS, segments.length); for (int i = 1; i < LARGE_AMOUNT_OF_SEGMENTS; i++) { assertEquals("Test parenthood", ((CalledFunction) segments[i - 1]).getAddr(), NonNullUtils.checkNotNull(((CalledFunction) segments[i]).getParent()).getAddr()); } }
Source:
public DbUser(LdapUser ldapUser) { externalId = ldapUser.getUserId(); domain = ldapUser.getDomainControler(); namespace = ldapUser.getNamespace(); loginName = ldapUser.getUserName(); firstName = ldapUser.getName(); lastName = ldapUser.getSurName(); department = ldapUser.getDepartment(); email = ldapUser.getEmail(); active = true; groupNames = new HashSet<String>(Arrays.asList(ldapUser.getGroup().split(","))); role = ""; note = ""; }

Target:
public DbUser(LdapUser ldapUser) { externalId = ldapUser.getUserId(); domain = ldapUser.getDomainControler(); namespace = ldapUser.getNamespace(); loginName = ldapUser.getUserName(); firstName = ldapUser.getName(); lastName = ldapUser.getSurName(); department = ldapUser.getDepartment(); email = ldapUser.getEmail(); active = true; groupNames = new HashSet<String>(Arrays.asList(ldapUser.getGroup().trim().split(" *, *"))); role = ""; note = ""; }
Source:
private int formatStdin(CommandLineOptions parameters, JavaFormatterOptions options) { String input; try { input = new String(ByteStreams.toByteArray(inStream), UTF_8); } catch (IOException e) { throw new IOError(e); } try { String output = new FormatFileCallable(parameters, input, options).call(); if (parameters.isDryRun()) { outWriter.println(STDIN_FILENAME); } else { outWriter.write(output); } if (input.equals(output)) { return 0; } return parameters.isSetExitIfChanged() ? 1 : 0; } catch (FormatterException e) { for (FormatterDiagnostic diagnostic : e.diagnostics()) { errWriter.println(STDIN_FILENAME + ":" + diagnostic.toString()); } return 1; } }

Target:
private int formatStdin(CommandLineOptions parameters, JavaFormatterOptions options) { String input; try { input = new String(ByteStreams.toByteArray(inStream), UTF_8); } catch (IOException e) { throw new IOError(e); } try { String output = new FormatFileCallable(parameters, input, options).call(); boolean changed = !output.equals(input); if (parameters.isDryRun()) { if (changed) { outWriter.println(STDIN_FILENAME); } } else { outWriter.write(output); } if (changed) { return parameters.isSetExitIfChanged() ? 1 : 0; } return 0; } catch (FormatterException e) { for (FormatterDiagnostic diagnostic : e.diagnostics()) { errWriter.println(STDIN_FILENAME + ":" + diagnostic.toString()); } return 1; } }
Source:
public static <T> T randomElement(List<T> list) { int idx = randomInt(list.size()); return list.get(idx); }

Target:
public static <T> T randomElement(List<T> list) { int index = randomInt(list.size()); return list.get(index); }
Source:
public void setClan(Clan clan) { nameLabel.setText(clan.getName()); membersLabel.setText(String.valueOf(clan.getMembers().size())); descriptionLabel.setText(clan.getDescription()); leaderLabel.setText(clan.getLeader().getUsername()); descriptionLabel.setText(Optional.ofNullable(clan.getDescription()).orElse("")); }

Target:
public void setClan(Clan clan) { nameLabel.setText(clan.getName()); membersLabel.setText(i18n.number(clan.getMembers().size())); descriptionLabel.setText(clan.getDescription()); leaderLabel.setText(clan.getLeader().getUsername()); descriptionLabel.setText(Optional.ofNullable(clan.getDescription()).orElse("")); }
Source:
public void testConcurrentReadStateAndProcessAndClose() throws Exception { final int totalStates = 5; final int[] states = {1, 2, 3, 4}; final ChannelStateReader stateReader = new ResultPartitionTest.FiniteChannelStateReader(totalStates, states); final int totalBuffers = 3; final NettyShuffleEnvironment environment = new NettyShuffleEnvironmentBuilder() .setBufferSize(states.length * Integer.BYTES) .setNumNetworkBuffers(totalBuffers) .build(); final SingleInputGate inputGate = createInputGate(environment); final ExecutorService executor = Executors.newFixedThreadPool(3); try { inputGate.setup(); Callable<Void> closeTask = () -> { inputGate.close(); return null; }; Callable<Void> readRecoveredStateTask = () -> { inputGate.readRecoveredState(executor, stateReader); return null; }; Callable<Void> processStateTask = () -> { while (true) { try { if (!getNextBufferAndVerify(inputGate, states)) { Thread.sleep(1); } } catch (Throwable t) { assertTrue("The gate is expected closed, but the actual exception is " + t.getMessage(), inputGate.getCloseFuture().isDone()); return null; } } }; submitTasksAndWaitForResults(executor, new Callable[] {closeTask, readRecoveredStateTask, processStateTask}); assertEquals(totalBuffers, environment.getNetworkBufferPool().getNumberOfAvailableMemorySegments()); } finally { executor.shutdown(); environment.close(); } }

Target:
public void testConcurrentReadStateAndProcessAndClose() throws Exception { final int totalStates = 5; final int[] states = {1, 2, 3, 4}; final ChannelStateReader stateReader = new ResultPartitionTest.FiniteChannelStateReader(totalStates, states); final int totalBuffers = 3; final NettyShuffleEnvironment environment = new NettyShuffleEnvironmentBuilder() .setBufferSize(states.length * Integer.BYTES) .setNumNetworkBuffers(totalBuffers) .build(); final SingleInputGate inputGate = createInputGate(environment); final ExecutorService executor = Executors.newFixedThreadPool(3); try { inputGate.setup(); Callable<Void> closeTask = () -> { inputGate.close(); return null; }; Callable<Void> readRecoveredStateTask = () -> { inputGate.readRecoveredState(executor, stateReader); return null; }; Callable<Void> processStateTask = () -> { while (true) { try { if (!getNextBufferAndVerify(inputGate, states)) { Thread.sleep(1); } } catch (Throwable t) { if (!inputGate.getCloseFuture().isDone()) { throw new AssertionError("Exceptions are expected here only if the gate was closed", t); } return null; } } }; submitTasksAndWaitForResults(executor, new Callable[] {closeTask, readRecoveredStateTask, processStateTask}); assertEquals(totalBuffers, environment.getNetworkBufferPool().getNumberOfAvailableMemorySegments()); } finally { executor.shutdown(); environment.close(); } }
Source:
public static boolean validResponse(String request, String responsePattern, BufferedReader r, Writer wr) throws IOException { boolean validResponse = true; if (!Strings.isNullOrEmpty(request) && !Strings.isNullOrEmpty(responsePattern)) { String l = null; validResponse = false; LOG.debug("writing {}, hoping response matches /{}/", request, responsePattern); wr.write(request); wr.flush(); Pattern p = Pattern.compile(responsePattern); String str = ""; int i; try { while((i = r.read()) != -1) { str += (char)i; } } catch (InterruptedIOException e) { LOG.debug("response was: {}", str); } validResponse = p.matcher(str).matches(); } return validResponse; }

Target:
public static boolean validResponse(String request, String responsePattern, BufferedReader r, Writer wr) throws IOException { boolean validResponse = true; if (!Strings.isNullOrEmpty(request) && !Strings.isNullOrEmpty(responsePattern)) { String l = null; validResponse = false; LOG.debug("writing {}, hoping response matches /{}/", request, responsePattern); wr.write(request); wr.flush(); Pattern p = Pattern.compile(responsePattern); StringBuilder sb = new StringBuilder(); int i; try { while((i = r.read()) != -1) { sb.append((char)i); } } catch (InterruptedIOException e) { LOG.debug("response was: {}", sb.toString()); } validResponse = p.matcher(sb.toString()).matches(); } return validResponse; }
Source:
public void ovfUpdate_timer() { log.info("OvfDataUpdater: Attempting to update VMs/Templates Ovf."); List<storage_pool> storagePools = DbFacade.getInstance().getStoragePoolDao().getAll(); for (storage_pool pool : storagePools) { try { if (StoragePoolStatus.Up == pool.getstatus()) { log.infoFormat("OvfDataUpdater: Attempting to update VMs/Templates Ovf in Data Center {0}", pool.getname()); List<VM> vmsForUpdate = getVmsForUpdate(DbFacade.getInstance() .getVmDao() .getAllVmsForOvfUpdateForStoragePool(pool.getId())); VmCommand.updateVmInSpm(pool.getId(), vmsForUpdate); if (!vmsForUpdate.isEmpty()) { for (VM vm : vmsForUpdate) { DbFacade.getInstance() .getVmDao() .updateVmOvfGeneration(vm.getId(), vm.getStaticData().getDb_generation()); } } List<VmTemplate> templatesForUpdate = getTemplatesForUpdate(DbFacade.getInstance() .getVmTemplateDao() .getAllVmTemplatesForOvfUpdateForStoragePool(pool.getId())); if (!templatesForUpdate.isEmpty()) { VmTemplateCommand.UpdateTemplateInSpm(pool.getId(), templatesForUpdate); for (VmTemplate template : templatesForUpdate) { DbFacade.getInstance() .getVmDao() .updateVmOvfGeneration(template.getId(), template.getDb_generation()); } } } } catch (Exception ex) { addAuditLogError(pool.getname()); log.errorFormat("Exception while trying to update VMs/Templates ovf in Data Center {0}, the exception is {1}", pool.getname(), ex.getMessage()); } } }

Target:
public void ovfUpdate_timer() { log.info("OvfDataUpdater: Attempting to update VMs/Templates Ovf."); List<storage_pool> storagePools = getStoragePoolDao().getAll(); for (storage_pool pool : storagePools) { try { if (StoragePoolStatus.Up == pool.getstatus()) { log.infoFormat("OvfDataUpdater: Attempting to update vms Ovf in Data Center {0}", pool.getname()); updateOvfForVmsOfStoragePool(pool.getId()); log.infoFormat("OvfDataUpdater: Attempting to update templates Ovf in Data Center {0}", pool.getname()); updateOvfForTemplatesOfStoragePool(pool.getId()); if (!proccessedIdsInfo.isEmpty()) { performVdsUpdateOperationIfNeeded(pool.getId(), true); } } } catch (Exception ex) { addAuditLogError(pool.getname()); log.errorFormat("Exception while trying to update VMs/Templates ovf in Data Center {0}, the exception is {1}", pool.getname(), ex.getMessage()); log.debug(ex.getStackTrace()); } } }
Source:
public void handleTaskCompletion(AppInstallStatus result) { if (result == AppInstallStatus.UpdateStaged) { uiController.unappliedUpdateAvailableUiState(); if (proceedAutomatically) { launchUpdateInstallTask(); return; } } else if (result == AppInstallStatus.UpToDate) { uiController.upToDateUiState(); if (proceedAutomatically) { finishWithResult(RefreshToLatestBuildActivity.ALREADY_UP_TO_DATE); return; } } else { uiController.checkFailedUiState(); if (proceedAutomatically) { finishWithResult(RefreshToLatestBuildActivity.UPDATE_ERROR); return; } } unregisterTask(); uiController.refreshView(); }

Target:
public void handleTaskCompletion(AppInstallStatus result) { if (result == AppInstallStatus.UpdateStaged) { uiController.unappliedUpdateAvailableUiState(); if (proceedAutomatically) { launchUpdateInstallTask(); return; } } else if (result == AppInstallStatus.UpToDate) { uiController.upToDateUiState(); if (proceedAutomatically) { unregisterTask(); finishWithResult(RefreshToLatestBuildActivity.ALREADY_UP_TO_DATE); return; } } else { uiController.checkFailedUiState(); if (proceedAutomatically) { unregisterTask(); finishWithResult(RefreshToLatestBuildActivity.UPDATE_ERROR); return; } } unregisterTask(); uiController.refreshView(); }
Source:
public void start(final BundleContext context) throws Exception { super.start(context); pluginId = context.getBundle().getSymbolicName(); Dictionary<String, String> props = new Hashtable<String, String>(4); props.put(DebugOptions.LISTENER_SYMBOLICNAME, pluginId); context.registerService(DebugOptionsListener.class.getName(), this, props); repositoryCache = new RepositoryCache(); indexDiffCache = new IndexDiffCache(); try { GitProjectData.reconfigureWindowCache(); } catch (RuntimeException e) { logError(CoreText.Activator_ReconfigureWindowCacheError, e); } GitProjectData.attachToWorkspace(true); IEclipsePreferences node = InstanceScope.INSTANCE.getNode(Activator.getPluginId()); String gitPrefix = node.get(GitCorePreferences.core_gitPrefix, null); if (gitPrefix != null) FS.DETECTED.setGitPrefix(new File(gitPrefix)); repositoryUtil = new RepositoryUtil(); secureStore = new EGitSecureStore(SecurePreferencesFactory.getDefault()); registerAutoShareProjects(); if (egitChangeListener == null) { egitChangeListener = new IResourceChangeListener() { public void resourceChanged(IResourceChangeEvent event) { IResource project = event.getResource(); if (project != null && project instanceof IProject) GitProjectData.reconfigureWindowCache(); } }; ResourcesPlugin.getWorkspace().addResourceChangeListener(egitChangeListener, IResourceChangeEvent.PRE_DELETE); } }

Target:
public void start(final BundleContext context) throws Exception { super.start(context); pluginId = context.getBundle().getSymbolicName(); Dictionary<String, String> props = new Hashtable<String, String>(4); props.put(DebugOptions.LISTENER_SYMBOLICNAME, pluginId); context.registerService(DebugOptionsListener.class.getName(), this, props); repositoryCache = new RepositoryCache(); indexDiffCache = new IndexDiffCache(); try { GitProjectData.reconfigureWindowCache(); } catch (RuntimeException e) { logError(CoreText.Activator_ReconfigureWindowCacheError, e); } GitProjectData.attachToWorkspace(true); IEclipsePreferences node = InstanceScope.INSTANCE.getNode(Activator.getPluginId()); String gitPrefix = node.get(GitCorePreferences.core_gitPrefix, null); if (gitPrefix != null) FS.DETECTED.setGitPrefix(new File(gitPrefix)); repositoryUtil = new RepositoryUtil(); secureStore = new EGitSecureStore(SecurePreferencesFactory.getDefault()); registerAutoShareProjects(); if (egitChangeListener == null) { egitChangeListener = new IResourceChangeListener() { public void resourceChanged(IResourceChangeEvent event) { IResource project = event.getResource(); if (project instanceof IProject) GitProjectData.reconfigureWindowCache(); } }; ResourcesPlugin.getWorkspace().addResourceChangeListener(egitChangeListener, IResourceChangeEvent.PRE_DELETE); } }
Source:
public GASMeterDevice findGASMeteringDevice(final String deviceIdentification) throws FunctionalException { final GASMeterDevice gASMeteringDevice; try { gASMeteringDevice = this.smartMeteringDeviceDomainService.searchGASMeteringDevice(deviceIdentification); } catch (final UnknownEntityException e) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICE, COMPONENT_TYPE, e); } return gASMeteringDevice; }

Target:
public GasMeterDevice findGASMeteringDevice(final String deviceIdentification) throws FunctionalException { final GasMeterDevice gasMeteringDevice; try { gasMeteringDevice = this.smartMeteringDeviceDomainService.searchGasMeteringDevice(deviceIdentification); } catch (final UnknownEntityException e) { throw new FunctionalException(FunctionalExceptionType.UNKNOWN_DEVICE, COMPONENT_TYPE, e); } return gasMeteringDevice; }
Source:
public Observable<Void> unregister() { STATE currentState = moveToState(STATE.Closed); switch (currentState) { case Registered: InstanceInfo instanceInfo = registrationSubject.getValue(); logger.info("Unregistering service in registry: {}", instanceInfo.getId()); registrationSubject.onCompleted(); break; case Closed: logger.info("Unregister on an already closed channel. This is a no-op"); return Observable.empty(); case Idle: logger.info("Unregistered an Idle channel, This is a no-op"); break; } return sendAckOnTransport().doOnTerminate(new Action0() { @Override public void call() { close(); } }); }

Target:
public Observable<Void> unregister() { STATE currentState = moveToState(STATE.Closed); switch (currentState) { case Registered: logger.info("Unregistering service in registry: {}", lastInstanceInfo.getId()); registrationSubject.onCompleted(); break; case Closed: logger.info("Unregister on an already closed channel. This is a no-op"); return Observable.empty(); case Idle: logger.info("Unregistered an Idle channel, This is a no-op"); break; } return sendAckOnTransport().doOnTerminate(new Action0() { @Override public void call() { close(); } }); }
Source:
public int getStatus() { return response.getStatus().code(); }

Target:
public int getStatus() { return response.status().code(); }
Source:
private static <T> Observable<T> bindLifecycle(Observable<LifecycleEvent> lifecycle, Observable<T> source, Func1<LifecycleEvent, LifecycleEvent> correspondingEvents) { if (lifecycle == null || source == null) { throw new IllegalArgumentException("Lifecycle and Observable must be given"); } Observable<LifecycleEvent> sharedLifecycle = lifecycle.share(); return source.lift( new OperatorSubscribeUntil<T, Boolean>( Observable.combineLatest( sharedLifecycle.take(1).map(correspondingEvents), sharedLifecycle.skip(1), new Func2<LifecycleEvent, LifecycleEvent, Boolean>() { @Override public Boolean call(LifecycleEvent lifecycleEvent, LifecycleEvent bindUntilEvent) { return lifecycleEvent == bindUntilEvent; } }) .takeFirst(new Func1<Boolean, Boolean>() { @Override public Boolean call(Boolean shouldComplete) { return shouldComplete; } }) ) ); }

Target:
private static <T> Observable<T> bindLifecycle(Observable<LifecycleEvent> lifecycle, Observable<T> source, Func1<LifecycleEvent, LifecycleEvent> correspondingEvents) { if (lifecycle == null || source == null) { throw new IllegalArgumentException("Lifecycle and Observable must be given"); } Observable<LifecycleEvent> sharedLifecycle = lifecycle.share(); return source.lift( new OperatorSubscribeUntil<T, Boolean>( Observable.combineLatest( sharedLifecycle.take(1).map(correspondingEvents), sharedLifecycle.skip(1), new Func2<LifecycleEvent, LifecycleEvent, Boolean>() { @Override public Boolean call(LifecycleEvent bindUntilEvent, LifecycleEvent lifecycleEvent) { return lifecycleEvent == bindUntilEvent; } }) .takeFirst(new Func1<Boolean, Boolean>() { @Override public Boolean call(Boolean shouldComplete) { return shouldComplete; } }) ) ); }
Source:
public void updateVersion(String version) { CorfuStoreMetadata.Timestamp timestamp = corfuStore.getTimestamp(); String persistedVersion = queryString(timestamp, LogReplicationMetadataType.VERSION); if (persistedVersion.equals(version)) { log.warn("Skip update the current version with new version as they are the same", persistedVersion, version); return; } TxBuilder txBuilder = corfuStore.tx(NAMESPACE); for (LogReplicationMetadataType key : LogReplicationMetadataType.values()) { long val = Address.NON_ADDRESS; if (key == LogReplicationMetadataType.VERSION) { appendUpdate(txBuilder, key, version); } else if (key == LogReplicationMetadataType.TOPOLOGY_CONFIG_ID) { val = query(timestamp, LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); appendUpdate(txBuilder, key, val); } else { appendUpdate(txBuilder, key, val); } } txBuilder.commit(timestamp); }

Target:
public void updateVersion(String version) { CorfuStoreMetadata.Timestamp timestamp = corfuStore.getTimestamp(); String persistedVersion = queryString(timestamp, LogReplicationMetadataType.VERSION); if (persistedVersion.equals(version)) { log.warn("Skip update of the current version to as they are the same", persistedVersion, version); return; } TxBuilder txBuilder = corfuStore.tx(NAMESPACE); for (LogReplicationMetadataType key : LogReplicationMetadataType.values()) { long val = Address.NON_ADDRESS; if (key == LogReplicationMetadataType.VERSION) { appendUpdate(txBuilder, key, version); } else if (key == LogReplicationMetadataType.TOPOLOGY_CONFIG_ID) { val = query(timestamp, LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); appendUpdate(txBuilder, key, val); } else { appendUpdate(txBuilder, key, val); } } txBuilder.commit(timestamp); }
Source:
public void testBankAccountResourceFields() throws HTTPError { BankAccount bankAccount = createdAssociatedBankAccount(); assertNotNull(bankAccount.customer); assertNotNull(bankAccount.account_number); assertNotNull(bankAccount.account_type); assertNotNull(bankAccount.address); assertNotNull(bankAccount.bank_name); assertNotNull(bankAccount.can_credit); assertNotNull(bankAccount.can_debit); assertNotNull(bankAccount.created_at); assertNotNull(bankAccount.fingerprint); assertNotNull(bankAccount.href); assertNotNull(bankAccount.id); assertNotNull(bankAccount.verifications); assertNull(bankAccount.verification); assertNotNull(bankAccount.credits); assertNotNull(bankAccount.debits); assertNotNull(bankAccount.meta); assertNotNull(bankAccount.name); assertNotNull(bankAccount.routing_number); assertNotNull(bankAccount.updated_at); }

Target:
public void testBankAccountResourceFields() throws HTTPError { Map<String, Object> payload = personCustomerPayload(); Customer customer = new Customer(payload); customer.save(); BankAccount bankAccount = new BankAccount(); bankAccount.name = "Harry Fakester"; bankAccount.routing_number = "121042882"; bankAccount.account_number = "112233a"; bankAccount.account_type = "checking"; bankAccount.save(); bankAccount.associateToCustomer(customer); Map<String, String> meta = new HashMap<String, String>(); meta.put("facebook", "0192837465"); bankAccount.meta = meta; bankAccount.save(); assertEquals(bankAccount.customer.href, customer.href); assertEquals(bankAccount.account_number, "xxx233a"); assertEquals(bankAccount.account_type, "checking"); assertEquals(bankAccount.address.toString(), "{city=null, line2=null, " + "line1=null, state=null, postal_code=null, country_code=null}"); assertEquals(bankAccount.bank_name, "WELLS FARGO BANK NA"); assertTrue(bankAccount.can_credit); assertFalse(bankAccount.can_debit); assertNotNull(bankAccount.created_at); assertNotNull(bankAccount.fingerprint); assertTrue(bankAccount.href.contains("/bank_accounts/BA")); assertTrue(bankAccount.id.contains("BA")); assertTrue(bankAccount.links.containsKey("customer")); assertTrue(bankAccount.links.containsKey("bank_account_verification")); assertEquals(bankAccount.meta.get("facebook"), "0192837465"); assertEquals(bankAccount.name, "Harry Fakester"); assertEquals(bankAccount.routing_number, "121042882"); assertNotNull(bankAccount.updated_at); assertNull(bankAccount.verification); assertTrue(bankAccount.verifications instanceof BankAccountVerification.Collection); assertTrue(bankAccount.credits instanceof Credit.Collection); assertEquals(bankAccount.bank_name, "WELLS FARGO BANK NA"); }
Source:
public Groups list() { if (isFiltered()) { return mapDbGroupsCollection(getBackendCollection(DbUser.class, VdcQueryType.GetDbUserByUserId, new GetDbUserByUserIdParameters(getCurrent().get(VdcUser.class).getUserId()))); } else { return mapDbGroupsCollection(getGroupsCollection(SearchType.DBUser, getSearchPattern())); } }

Target:
public Groups list() { if (isFiltered()) { return mapDbGroupsCollection(getBackendCollection(DbUser.class, VdcQueryType.GetAllDbUsers, new VdcQueryParametersBase())); } else { return mapDbGroupsCollection(getGroupsCollection(SearchType.DBUser, getSearchPattern())); } }
Source:
private QueryResult executeInternal(QueryContext context, String rewrittenQuery) throws GrillException { checkConfigured(); JdbcQueryContext queryContext = new JdbcQueryContext(context); queryContext.setPrepared(false); queryContext.setRewrittenQuery(rewrittenQuery); QueryResult result = new QueryCallable(queryContext).call(); return result; }

Target:
private QueryResult executeInternal(QueryContext context, String rewrittenQuery) throws GrillException { JdbcQueryContext queryContext = new JdbcQueryContext(context); queryContext.setPrepared(false); queryContext.setRewrittenQuery(rewrittenQuery); QueryResult result = new QueryCallable(queryContext).call(); return result; }
Source:
public T map(int row, ResultSet rs, StatementContext ctx) throws SQLException { T bean; try { bean = type.newInstance(); } catch (Exception e) { throw new IllegalArgumentException(String.format("A bean, %s, was mapped " + "which was not instantiable", type.getName()), e); } ResultSetMetaData metadata = rs.getMetaData(); for (int i = 1; i <= metadata.getColumnCount(); ++i) { String name = metadata.getColumnLabel(i).toLowerCase(); PropertyDescriptor descriptor = properties.get(name); if (descriptor != null) { Class type = descriptor.getPropertyType(); Object value; ResultColumnMapper mapper = ctx.columnMapperFor(type); if (mapper != null) { value = mapper.mapColumn(rs, i, ctx); } else if (type.isEnum()) { String str = rs.getString(i); value = str == null ? null : Enum.valueOf(type, str); } else { value = rs.getObject(i); } try { descriptor.getWriteMethod().invoke(bean, value); } catch (IllegalAccessException e) { throw new IllegalArgumentException(String.format("Unable to access setter for " + "property, %s", name), e); } catch (InvocationTargetException e) { throw new IllegalArgumentException(String.format("Invocation target exception trying to " + "invoker setter for the %s property", name), e); } catch (NullPointerException e) { throw new IllegalArgumentException(String.format("No appropriate method to " + "write property %s", name), e); } } } return bean; }

Target:
public T map(int row, ResultSet rs, StatementContext ctx) throws SQLException { T bean; try { bean = type.newInstance(); } catch (Exception e) { throw new IllegalArgumentException(String.format("A bean, %s, was mapped " + "which was not instantiable", type.getName()), e); } ResultSetMetaData metadata = rs.getMetaData(); for (int i = 1; i <= metadata.getColumnCount(); ++i) { String name = metadata.getColumnLabel(i).toLowerCase(); PropertyDescriptor descriptor = properties.get(name); if (descriptor != null) { Class type = descriptor.getPropertyType(); Object value; ResultColumnMapper mapper = ctx.columnMapperFor(type); if (mapper != null) { value = mapper.mapColumn(rs, i, ctx); } else { value = rs.getObject(i); } try { descriptor.getWriteMethod().invoke(bean, value); } catch (IllegalAccessException e) { throw new IllegalArgumentException(String.format("Unable to access setter for " + "property, %s", name), e); } catch (InvocationTargetException e) { throw new IllegalArgumentException(String.format("Invocation target exception trying to " + "invoker setter for the %s property", name), e); } catch (NullPointerException e) { throw new IllegalArgumentException(String.format("No appropriate method to " + "write property %s", name), e); } } } return bean; }
Source:
private void populate() { choiceBox = new ComboBox<>(repositoryChoices); choiceBox.setPromptText(tr("Please select the repository type you want to add")); choiceBox.setConverter(new StringConverter<RepositoryType>() { @Override public String toString(RepositoryType repositoryType) { return repositoryType.getLabel(); } @Override public RepositoryType fromString(String string) { return Arrays.stream(RepositoryType.values()).filter(type -> type.getLabel().equals(string)).findAny() .orElse(null); } }); choiceBox.setOnAction( event -> onRepositoryTypeSelection.accept(choiceBox.getSelectionModel().getSelectedItem())); Label choiceBoxLabel = new Label(tr("Repository type:")); choiceBoxLabel.setLabelFor(choiceBox); HBox content = new HBox(choiceBoxLabel, choiceBox); content.setId("repositoryTypeSelection"); HBox.setHgrow(choiceBox, Priority.ALWAYS); this.setCenter(content); setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); }

Target:
private void populate() { choiceBox = new ComboBox<>(repositoryChoices); choiceBox.setPromptText(tr("Please select the repository type you want to add")); choiceBox.setConverter(new StringConverter<RepositoryType>() { @Override public String toString(RepositoryType repositoryType) { return repositoryType.getLabel(); } @Override public RepositoryType fromString(String string) { return Arrays.stream(RepositoryType.values()).filter(type -> type.getLabel().equals(string)).findAny() .orElse(null); } }); choiceBox.setOnAction( event -> onRepositoryTypeSelection.accept(choiceBox.getSelectionModel().getSelectedItem())); Label choiceBoxLabel = new Label(tr("Repository type:")); choiceBoxLabel.setLabelFor(choiceBox); HBox content = new HBox(choiceBoxLabel, choiceBox); content.setId("repositoryTypeSelection"); HBox.setHgrow(choiceBox, Priority.ALWAYS); this.setCenter(content); }
Source:
<T> List<T> createInstrumentedRemoteProxies(Class<T> clazz, String name) { Set<String> remoteUris = PaxosRemotingUtils.getRemoteServerPaths(install()); Optional<TrustContext> trustContext = PaxosRemotingUtils .getSslConfigurationOptional(install()) .map(SslSocketFactories::createTrustContext); return remoteUris.stream() .map(uri -> AtlasDbFeignTargetFactory.DEFAULT.createProxy( trustContext, uri, clazz, name, false)) .map(proxy -> metrics().instrument(clazz, proxy, name)) .collect(Collectors.toList()); }

Target:
<T> List<T> createInstrumentedRemoteProxies(Class<T> clazz, String name) { Set<String> remoteUris = PaxosRemotingUtils.getRemoteServerPaths(install()); Optional<TrustContext> trustContext = PaxosRemotingUtils .getSslConfigurationOptional(install()) .map(SslSocketFactories::createTrustContext); return remoteUris.stream() .map(uri -> AtlasDbHttpClients.DEFAULT_TARGET_FACTORY.createProxy( trustContext, uri, clazz, name, false)) .map(proxy -> metrics().instrument(clazz, proxy, name)) .collect(Collectors.toList()); }
Source:
public void executionStarted(final TestIdentifier testIdentifier) { if (!testIdentifier.isContainer()) { final String testUniqueName = getUniqueTestName(testIdentifier); listener.onTestStart(testUniqueName); } }

Target:
public void executionStarted(final TestIdentifier testIdentifier) { if (testIdentifier.isContainer()) { return; } final String testUniqueName = getUniqueTestName(testIdentifier); listener.onTestStart(testUniqueName); }
Source:
public void visitFeatureAnnotation(T annotation, FeatureInfo feature) { Closure condition = createCondition(annotation); try { Object result = evaluateCondition(condition); featureConditionResult(GroovyRuntimeUtil.isTruthy(result), annotation, feature); } catch (ExtensionException ee) { if (!(ee.getCause() instanceof MissingPropertyException)) { throw ee; } MissingPropertyException mpe = (MissingPropertyException) ee.getCause(); if (!feature.getDataVariables().contains(mpe.getProperty())) { throw ee; } feature.getFeatureMethod().addInterceptor(invocation -> { List<String> dataVariables = invocation.getFeature().getDataVariables(); Object[] dataValues = invocation.getIteration().getDataValues(); Object result = evaluateCondition(condition, dataVariables, dataValues); iterationConditionResult(GroovyRuntimeUtil.isTruthy(result), annotation, invocation); invocation.proceed(); }); } }

Target:
public void visitFeatureAnnotation(T annotation, FeatureInfo feature) { Closure condition = createCondition(annotation); try { Object result = evaluateCondition(condition); featureConditionResult(GroovyRuntimeUtil.isTruthy(result), annotation, feature); } catch (ExtensionException ee) { if (!(ee.getCause() instanceof MissingPropertyException)) { throw ee; } MissingPropertyException mpe = (MissingPropertyException) ee.getCause(); if (!feature.getDataVariables().contains(mpe.getProperty())) { throw ee; } feature.getFeatureMethod().addInterceptor(new IterationCondition(condition, annotation)); } }
Source:
private void startGattServer() { BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE); mGattServer = bluetoothManager.openGattServer(this, gattServerCallback); BluetoothGattService batteryService = buildBatteryService(); mGattServer.addService(batteryService); }

Target:
private void startGattServer() { mGattServer = mBluetoothManager.openGattServer(this, mGattServerCallback); BluetoothGattService batteryService = buildBatteryService(); mGattServer.addService(batteryService); }
Source:
public static <P extends VdcActionParametersBase> CommandBase<P> createCommand(VdcActionType action, P parameters, CommandContext commandContext) { try { Constructor<CommandBase<? extends VdcActionParametersBase>> commandConstructor = findCommandConstructor(getCommandClass(action.name()), parameters.getClass(), CommandContext.class); if (commandContext == null) { commandContext = CommandContext.createContext(parameters.getSessionId()); } else if (commandContext.getEngineContext().getSessionId() == null) { commandContext.getEngineContext().withSessionId(parameters.getSessionId()); } CommandBase<P> command = (CommandBase<P>) commandConstructor.newInstance(parameters, commandContext); return Injector.injectMembers(command); } catch (InvocationTargetException ex) { log.error("Error in invocating CTOR of command '{}': {}", action.name(), ex.getMessage()); log.debug("Exception", ex); return null; } catch (Exception ex) { log.error("An exception has occured while trying to create a command object for command '{}': {}", action.name(), ex.getMessage()); log.debug("Exception", ex); return null; } }

Target:
public static <P extends VdcActionParametersBase> CommandBase<P> createCommand(VdcActionType action, P parameters, CommandContext commandContext) { try { Constructor<CommandBase<? extends VdcActionParametersBase>> commandConstructor = findCommandConstructor(getCommandClass(action.name()), parameters.getClass(), CommandContext.class); if (commandContext == null) { commandContext = CommandContext.createContext(parameters.getSessionId()); } else if (commandContext.getEngineContext().getSessionId() == null) { commandContext.getEngineContext().withSessionId(parameters.getSessionId()); } @SuppressWarnings("unchecked") CommandBase<P> command = (CommandBase<P>) commandConstructor.newInstance(parameters, commandContext); return Injector.injectMembers(command); } catch (InvocationTargetException ex) { log.error("Error in invocating CTOR of command '{}': {}", action.name(), ex.getMessage()); log.debug("Exception", ex); return null; } catch (Exception ex) { log.error("An exception has occured while trying to create a command object for command '{}': {}", action.name(), ex.getMessage()); log.debug("Exception", ex); return null; } }
Source:
public void onTaskSelectionEvent(@Observes final TaskSelectionEvent event) { boolean resetTabs = (taskId != event.getTaskId()); taskId = event.getTaskId(); serverTemplateId = event.getServerTemplateId(); containerId = event.getContainerId(); processId = event.getTaskName(); if (!event.isForLog()) { taskFormPresenter.getTaskFormView().getDisplayerView().setOnCloseCommand(() -> closeDetails()); taskFormDisplayProvider.setup(new HumanTaskDisplayerConfig(new TaskKey(serverTemplateId, containerId, taskId)), taskFormPresenter.getTaskFormView().getDisplayerView()); } setIsForLog(event.isForLog()); setIsForAdmin(event.isForAdmin()); changeTitleWidgetEvent.fire(new ChangeTitleWidgetEvent(this.place, String.valueOf(taskId) + " - " + processId)); if (isForLog()) { view.displayOnlyLogTab(); disableTaskDetailsEdition(); } else { view.displayAllTabs(); } if (isForAdmin()) { view.setAdminTabVisible(true); } else { view.setAdminTabVisible(false); } if (resetTabs) { view.resetTabs(event.isForLog()); } }

Target:
public void onTaskSelectionEvent(@Observes final TaskSelectionEvent event) { boolean refreshDetails = (event != null && event.getTaskId() != null && event.getTaskId().equals(taskId)); taskId = event.getTaskId(); serverTemplateId = event.getServerTemplateId(); containerId = event.getContainerId(); processId = event.getTaskName(); if (!event.isForLog()) { taskFormPresenter.getTaskFormView().getDisplayerView().setOnCloseCommand(() -> closeDetails()); taskFormDisplayProvider.setup(new HumanTaskDisplayerConfig(new TaskKey(serverTemplateId, containerId, taskId)), taskFormPresenter.getTaskFormView().getDisplayerView()); } setIsForLog(event.isForLog()); setIsForAdmin(event.isForAdmin()); changeTitleWidgetEvent.fire(new ChangeTitleWidgetEvent(this.place, String.valueOf(taskId) + " - " + processId)); if (isForLog()) { view.displayOnlyLogTab(); disableTaskDetailsEdition(); } else { view.displayAllTabs(); } if (isForAdmin()) { view.setAdminTabVisible(true); } else { view.setAdminTabVisible(false); } if (!refreshDetails) { view.resetTabs(event.isForLog()); } }