auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public HazelcastServerCacheManager(HazelcastServerCachingProvider cachingProvider, HazelcastInstance hazelcastInstance, URI uri, ClassLoader classLoader, Properties properties) { super(cachingProvider, hazelcastInstance, uri, classLoader, properties); if (hazelcastInstance instanceof HazelcastInstanceProxy) { instance = ((HazelcastInstanceProxy) hazelcastInstance).getOriginal(); } else { instance = (HazelcastInstanceImpl) hazelcastInstance; } nodeEngine = instance.node.getNodeEngine(); cacheService = nodeEngine.getService(ICacheService.SERVICE_NAME); logger = nodeEngine.getLogger(HazelcastCacheManager.class); }

Target:
public HazelcastServerCacheManager(HazelcastServerCachingProvider cachingProvider, HazelcastInstance hazelcastInstance, URI uri, ClassLoader classLoader, Properties properties) { super(cachingProvider, hazelcastInstance, uri, classLoader, properties); if (hazelcastInstance instanceof HazelcastInstanceProxy) { instance = ((HazelcastInstanceProxy) hazelcastInstance).getOriginal(); } else { instance = (HazelcastInstanceImpl) hazelcastInstance; } nodeEngine = instance.node.getNodeEngine(); cacheService = nodeEngine.getService(ICacheService.SERVICE_NAME); }
Source:
public static void initialize(java.util.List<AnimationFrame> frames) { isRunning = true; selectedFrameIndex = 0; animationContext = new AnimationContextSWT(PlatformUI.getWorkbench() .getDisplay()); AnimationView.frames = new ArrayList<AnimationFrame>(frames); if (isInitialized()) initializeFrames(); ExecutionMode currentMode = SimulationModeDispatcher.getMode(); disableAnimation(currentMode == ExecutionMode.NO_ANIMATION ? true : false); }

Target:
public static void initialize(java.util.List<AnimationFrame> frames) { isInitialized = true; selectedFrameIndex = 0; animationContext = new AnimationContextSWT(PlatformUI.getWorkbench() .getDisplay()); AnimationView.frames = new ArrayList<AnimationFrame>(frames); if (isInitialized()) initializeFrames(); ExecutionMode currentMode = SimulationModeDispatcher.getMode(); setAnimationEnabled(currentMode != ExecutionMode.NO_ANIMATION); }
Source:
public PageTitle titleForInternalLink(String internalLink) { return new PageTitle(RbSwitch.INSTANCE.isRestBaseEnabled() ? internalLink.replaceFirst("./", "") : internalLink.replaceFirst("/wiki/", ""), this); }

Target:
public PageTitle titleForInternalLink(String internalLink) { return new PageTitle(internalLink.replaceFirst("./", "").replaceFirst("/wiki/", ""), this); }
Source:
public Void call() throws Exception { final RDFFormat rdfFormat = props.getProperty("format") == null ? null : Rio.getParserFormatForMIMEType(props.getProperty("format")); final String baseURI = props.getProperty("baseURI"); final String defaultGraph = props.getProperty("defaultGraph"); final String fileOrDirs = props.getProperty("fileOrDirs"); if (log.isInfoEnabled()) { log.info("ParallelDataLoader called ( rdfFormat = ; baseURI = ; defaultGraph = ; " + "namespace = ; fileOrDirs = )", rdfFormat, baseURI, defaultGraph, namespace, fileOrDirs); } final long begin = System.currentTimeMillis(); BigdataSailConnection conn = null; boolean success = false; try { conn = getUnisolatedSailConnection(); final AtomicLong nmodified = new AtomicLong(0L); FilenameFilter filter = DataLoader.getFilenameFilter(); final String[] fileToLoad = fileOrDirs.split(","); List<File> files = collectFiles(fileToLoad, filter); log.trace("Collected {}", files); runParallelLoad(rdfFormat, baseURI, defaultGraph, conn, files); final long elapsed = System.currentTimeMillis() - begin; reportModifiedCount(nmodified.get(), elapsed); return (Void) null; } finally { if (conn != null) { if (!success) { conn.rollback(); } conn.close(); } } }

Target:
public Void call() throws Exception { final RDFFormat rdfFormat = props.getProperty("format") == null ? null : Rio.getParserFormatForMIMEType(props.getProperty("format")); final String baseURI = props.getProperty("baseURI"); final String defaultGraph = props.getProperty("defaultGraph"); final String fileOrDirs = props.getProperty("fileOrDirs"); if (log.isInfoEnabled()) { log.info("ParallelDataLoader called ( rdfFormat = ; baseURI = ; defaultGraph = ; " + "namespace = ; fileOrDirs = )", rdfFormat, baseURI, defaultGraph, namespace, fileOrDirs); } final long begin = System.currentTimeMillis(); BigdataSailConnection conn = null; boolean success = false; try { conn = getUnisolatedSailConnection(); final AtomicLong nmodified = new AtomicLong(0L); FilenameFilter filter = DataLoader.getFilenameFilter(); final String[] fileToLoad = fileOrDirs.split(","); List<File> files = collectFiles(fileToLoad, filter); log.trace("Collected {}", files); runParallelLoad(rdfFormat, baseURI, defaultGraph, conn, files); success = true; final long elapsed = System.currentTimeMillis() - begin; reportModifiedCount(nmodified.get(), elapsed); return (Void) null; } finally { if (conn != null) { if (!success) { conn.rollback(); } conn.close(); } } }
Source:
private void doFocusChanged(Widget control) { for (StructuredViewer fViewer : fViewers) { if (fViewer.getControl() == control) { propagateFocusChanged(fViewer); return; } } }

Target:
private void doFocusChanged(Widget control) { for (StructuredViewer viewer : fViewers) { if (viewer.getControl() == control) { propagateFocusChanged(viewer); return; } } }
Source:
private List<Tuple2<Integer, PrestoSparkRow>> doExecute(SubPlan root) { PlanFragment rootFragment = root.getFragment(); if (rootFragment.getPartitioning().equals(COORDINATOR_DISTRIBUTION)) { checkArgument(root.getChildren().size() == 1, "exactly one children fragment is expected"); PrestoSparkTaskDescriptor taskDescriptor = new PrestoSparkTaskDescriptor( session.toSessionRepresentation(), session.getIdentity().getExtraCredentials(), rootFragment, ImmutableList.of(), tableWriteInfo); SerializedPrestoSparkTaskDescriptor serializedTaskDescriptor = new SerializedPrestoSparkTaskDescriptor(sparkTaskDescriptorJsonCodec.toJsonBytes(taskDescriptor)); SubPlan child = getOnlyElement(root.getChildren()); JavaPairRDD<Integer, PrestoSparkRow> rdd = createRdd(child); List<Tuple2<Integer, PrestoSparkRow>> sparkDriverInput = rdd.collect(); return ImmutableList.copyOf(executorFactoryProvider.get().create( 0, 0, serializedTaskDescriptor, new PrestoSparkTaskInputs(ImmutableMap.of(child.getFragment().getId().toString(), sparkDriverInput.iterator())), taskStatsCollector)); } return createRdd(root).collect(); }

Target:
private List<Tuple2<Integer, PrestoSparkRow>> doExecute(SubPlan root) { List<Broadcast<?>> broadcastsToDestroy = new ArrayList<>(); PlanFragment rootFragment = root.getFragment(); if (rootFragment.getPartitioning().equals(COORDINATOR_DISTRIBUTION)) { PrestoSparkTaskDescriptor taskDescriptor = new PrestoSparkTaskDescriptor( session.toSessionRepresentation(), session.getIdentity().getExtraCredentials(), rootFragment, ImmutableList.of(), tableWriteInfo); SerializedPrestoSparkTaskDescriptor serializedTaskDescriptor = new SerializedPrestoSparkTaskDescriptor(sparkTaskDescriptorJsonCodec.toJsonBytes(taskDescriptor)); Map<PlanFragmentId, JavaPairRDD<Integer, PrestoSparkRow>> inputRdds = root.getChildren().stream() .collect(toImmutableMap(child -> child.getFragment().getId(), child -> createRdd(child, broadcastsToDestroy))); Map<String, Iterator<Tuple2<Integer, PrestoSparkRow>>> inputs = inputRdds.entrySet().stream() .collect(toImmutableMap(entry -> entry.getKey().toString(), entry -> entry.getValue().collect().iterator())); broadcastsToDestroy.forEach(Broadcast::destroy); return ImmutableList.copyOf(executorFactoryProvider.get().create( 0, 0, serializedTaskDescriptor, new PrestoSparkTaskInputs(inputs, ImmutableMap.of()), taskStatsCollector)); } List<Tuple2<Integer, PrestoSparkRow>> result = createRdd(root, broadcastsToDestroy).collect(); broadcastsToDestroy.forEach(Broadcast::destroy); return result; }
Source:
private String timeToString(int time) { String result = ""; int days = time / 86400; if (days != 0) { time -= days * 3600; result += days; } int hours = time / 3600; if (days != 0 || hours != 0) { time -= hours * 3600; result += " " + hours; } int minutes = time / 60; if (days != 0 || hours != 0 || minutes != 0) { time -= minutes * 60; result += ":" + minutes; } int seconds = time; result += ":" + seconds; return result.trim(); }

Target:
private String timeToString(int time) { String result = ""; int days = time / 86400; if (days != 0) { time -= days * 86400; result += days; } int hours = time / 3600; if (days != 0 || hours != 0) { time -= hours * 3600; result += String.format(" %02d", hours); } int minutes = time / 60; if (days != 0 || hours != 0 || minutes != 0) { time -= minutes * 60; result += String.format(":%02d", minutes); } int seconds = time; result += String.format(":%02d", seconds); return result.trim(); }
Source:
protected void onCreate(Bundle savedInstanceState) { if (savedInstanceState == null) { selectedAddonId = savedInstanceState.getString(ADDONID, null); selectedAddonTitle = savedInstanceState.getString(ADDONTITLE, null); } super.onCreate(savedInstanceState); }

Target:
protected void onCreate(Bundle savedInstanceState) { if (savedInstanceState != null) { selectedAddonId = savedInstanceState.getString(ADDONID, null); selectedAddonTitle = savedInstanceState.getString(ADDONTITLE, null); } super.onCreate(savedInstanceState); }
Source:
public void addFilter(ITmfFilterTreeNode filter) { ITmfFilterTreeNode root = fViewer.getInput(); for (int i = 0; i < root.getChildrenCount(); i++) { if (root.getChild(i).equals(filter)) { return; } } root.addChild(filter); fViewer.setInput(root); }

Target:
public void addFilter(ITmfFilterTreeNode filter) { ITmfFilterTreeNode root = fViewer.getInput(); for (ITmfFilterTreeNode node : root.getChildren()) { if (node.equals(filter)) { return; } } root.addChild(filter); fViewer.setInput(root); }
Source:
public static Object fromTaskClassConfig(Config config) { String taskClassName = new TaskConfig(config).getTaskClass().getOrElse( new AbstractFunction0<String>() { @Override public String apply() { throw new ConfigException("There is no task class defined in the configuration. Failed to create a valid TaskFactory"); } }); log.info("Got task class name: {}", taskClassName); boolean isAsyncTaskClass; try { isAsyncTaskClass = AsyncStreamTask.class.isAssignableFrom(Class.forName(taskClassName)); } catch (Throwable t) { throw new ConfigException(String.format("Invalid configuration for AsyncStreamTask class: %s", taskClassName), t); } if (isAsyncTaskClass) { return new AsyncStreamTaskFactory() { @Override public AsyncStreamTask createInstance() { try { return (AsyncStreamTask) Class.forName(taskClassName).newInstance(); } catch (Throwable t) { log.error("Error loading AsyncStreamTask class: {}. error: {}", taskClassName, t); throw new SamzaException(String.format("Error loading AsyncStreamTask class: %s", taskClassName), t); } } }; } return new StreamTaskFactory() { @Override public StreamTask createInstance() { try { return (StreamTask) Class.forName(taskClassName).newInstance(); } catch (Throwable t) { log.error("Error loading StreamTask class: {}. error: {}", taskClassName, t); throw new SamzaException(String.format("Error loading StreamTask class: %s", taskClassName), t); } } }; }

Target:
private static Object fromTaskClassConfig(Config config) { String taskClassName = new TaskConfig(config).getTaskClass().getOrElse( new AbstractFunction0<String>() { @Override public String apply() { throw new ConfigException("There is no task class defined in the configuration. Failed to create a valid TaskFactory"); } }); log.info("Got task class name: {}", taskClassName); boolean isAsyncTaskClass; try { isAsyncTaskClass = AsyncStreamTask.class.isAssignableFrom(Class.forName(taskClassName)); } catch (Throwable t) { throw new ConfigException(String.format("Invalid configuration for AsyncStreamTask class: %s", taskClassName), t); } if (isAsyncTaskClass) { return new AsyncStreamTaskFactory() { @Override public AsyncStreamTask createInstance() { try { return (AsyncStreamTask) Class.forName(taskClassName).newInstance(); } catch (Throwable t) { log.error("Error loading AsyncStreamTask class: {}. error: {}", taskClassName, t); throw new SamzaException(String.format("Error loading AsyncStreamTask class: %s", taskClassName), t); } } }; } return new StreamTaskFactory() { @Override public StreamTask createInstance() { try { return (StreamTask) Class.forName(taskClassName).newInstance(); } catch (Throwable t) { log.error("Error loading StreamTask class: {}. error: {}", taskClassName, t); throw new SamzaException(String.format("Error loading StreamTask class: %s", taskClassName), t); } } }; }
Source:
private void presentShowcaseSequence() { ShowcaseConfig config = new ShowcaseConfig(); config.setDelay(4000); MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(this, SHOWCASE_ID); sequence.setOnItemShownListener(new MaterialShowcaseSequence.OnSequenceItemShownListener() { @Override public void onShow(MaterialShowcaseView itemView, int position) { } }); sequence.setConfig(config); sequence.addSequenceItem(nav_home, getResources().getString(R.string.home_button), getResources().getString(R.string.ok_button)); sequence.addSequenceItem( new MaterialShowcaseView.Builder(this) .setTarget(nav_cam) .setDismissText(getResources().getString(R.string.ok_button)) .setContentText(getResources().getString(R.string.camera_button)) .hideOnTouchOutside() .build() ); sequence.addSequenceItem( new MaterialShowcaseView.Builder(this) .setTarget(nav_acc) .setDismissText(getResources().getString(R.string.ok_button)) .setContentText(getResources().getString(R.string.accounts_button)) .hideOnTouchOutside() .build() ); sequence.start(); }

Target:
private void presentShowcaseSequence() { ShowcaseConfig config = new ShowcaseConfig(); config.setDelay(4000); MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(this, SHOWCASE_ID); sequence.setOnItemShownListener(new MaterialShowcaseSequence.OnSequenceItemShownListener() { @Override public void onShow(MaterialShowcaseView itemView, int position) { } }); sequence.setConfig(config); sequence.addSequenceItem(nav_home, getResources().getString(R.string.home_button), getResources().getString(R.string.ok_button)); sequence.addSequenceItem( new MaterialShowcaseView.Builder(this) .setTarget(nav_cam) .setDismissText(getResources().getString(R.string.ok_button)) .setContentText(getResources().getString(R.string.camera_button)) .setDismissOnTouch(true) .build() ); sequence.addSequenceItem( new MaterialShowcaseView.Builder(this) .setTarget(nav_acc) .setDismissText(getResources().getString(R.string.ok_button)) .setContentText(getResources().getString(R.string.accounts_button)) .setDismissOnTouch(true) .build() ); sequence.start(); }
Source:
public void testSingleRequestException() throws InterruptedException { TmfTrace trace = setupTrace(TEST_TRACE.getFullPath()); TmfEventRequest requestFail = new TmfEventRequestStub(ITmfEvent.class, TmfTimeRange.ETERNITY, 2, 0, ExecutionType.BACKGROUND, 0) { @Override public void handleData(@NonNull ITmfEvent data) { throw new IllegalArgumentException(); } }; trace.sendRequest(requestFail); requestFail.waitForCompletion(); assertTrue(requestFail.isCompleted()); assertFalse(requestFail.isCancelled()); assertTrue(requestFail.isFailed()); trace.dispose(); }

Target:
public void testSingleRequestException() throws InterruptedException { TmfTrace trace = fTrace; TmfEventRequest requestFail = new TmfEventRequestStub(ITmfEvent.class, TmfTimeRange.ETERNITY, 2, 0, ExecutionType.BACKGROUND, 0) { @Override public void handleData(@NonNull ITmfEvent data) { throw new IllegalArgumentException(); } }; trace.sendRequest(requestFail); requestFail.waitForCompletion(); assertTrue(requestFail.isCompleted()); assertFalse(requestFail.isCancelled()); assertTrue(requestFail.isFailed()); }
Source:
public void notifyValueTransferFinished() { for (int i = 0; i < numSegments; ++i) { do { SegmentState state = segmentStates.get(i); switch (state) { case BLOCKED: case KEY_TRANSFER: blockedFutures.get(i).completeExceptionally(new CacheException("Failed to request versions")); log.warnf("Stopped applying state for segment %d in topology %d but the segment is in state %s", i, topologyId, state); case VALUE_TRANSFER: if (!segmentStates.compareAndSet(i, state, SegmentState.OWNED)) { continue; } } } while (false); } synchronized (valuesLock) { valuesTopology = Math.max(topologyId, valuesTopology); transferingValues = false; valuesFuture.complete(null); valuesFuture = new CompletableFuture<>(); } log.debugf("Node %s received values for all segments in topology %d", rpcManager.getAddress(), topologyId); }

Target:
public void notifyValueTransferFinished() { for (int i = 0; i < numSegments; ++i) { LOOP: for (;;) { SegmentState state = segmentStates.get(i); switch (state) { case NOT_OWNED: case OWNED: break LOOP; case BLOCKED: case KEY_TRANSFER: blockedFutures.get(i).completeExceptionally(new CacheException("Failed to request versions")); log.warnf("Stopped applying state for segment %d in topology %d but the segment is in state %s", i, topologyId, state); case VALUE_TRANSFER: if (segmentStates.compareAndSet(i, state, SegmentState.OWNED)) { break LOOP; } } } } synchronized (valuesLock) { valuesTopology = Math.max(topologyId, valuesTopology); transferringValues = false; valuesFuture.complete(null); valuesFuture = new CompletableFuture<>(); } log.debugf("Node %s received values for all segments in topology %d", rpcManager.getAddress(), topologyId); }
Source:
protected Promise<Expression> eval(BranchContext context, final TermFilter termFilter) { final String term = termFilter.getTerm(); return SnomedRequests.prepareSearchDescription() .all() .filterByTerm(term) .build(context.id(), context.branchPath()) .execute(context.service(IEventBus.class)) .then(descriptions -> { Set<String> ids = descriptions.stream() .map(SnomedDescription::getConceptId) .collect(Collectors.toSet()); return Expressions.builder().filter(SnomedConceptDocument.Expressions.ids(ids)).build(); }); }

Target:
protected Promise<Expression> eval(BranchContext context, final TermFilter termFilter) { final String term = termFilter.getTerm(); return SnomedRequests.prepareSearchDescription() .all() .filterByActive(true) .filterByTerm(term) .setFields(SnomedDescriptionIndexEntry.Fields.ID, SnomedDescriptionIndexEntry.Fields.CONCEPT_ID) .build(context.id(), context.branchPath()) .execute(context.service(IEventBus.class)) .then(descriptions -> { Set<String> ids = descriptions.stream() .map(SnomedDescription::getConceptId) .collect(Collectors.toSet()); return Expressions.builder().filter(SnomedConceptDocument.Expressions.ids(ids)).build(); }); }
Source:
public void testIndividualRead(byte[][] writtenBytes, byte[] expectedBytes) throws IOException { AppendableByteArrayInputStream in = new AppendableByteArrayInputStream(); for (byte[] writtenByte : writtenBytes) { in.add(writtenByte); } for (int i = 0; i < expectedBytes.length; i++) { final int readByte = in.read(); if (expectedBytes[i] != (byte) readByte) { Assert.assertEquals(StringUtils.format("%s[%d", Arrays.toString(expectedBytes), i), expectedBytes[i], readByte); } } }

Target:
public void testIndividualRead(byte[][] writtenBytes, byte[] expectedBytes) throws IOException { AppendableByteArrayInputStream in = new AppendableByteArrayInputStream(); for (byte[] writtenByte : writtenBytes) { in.add(writtenByte); } for (int i = 0; i < expectedBytes.length; i++) { final int readByte = in.read(); if (expectedBytes[i] != (byte) readByte) { Assert.assertEquals(StringUtils.format("%s[%d]", Arrays.toString(expectedBytes), i), expectedBytes[i], readByte); } } }
Source:
public void clearErrors() { this.errors = Collections.emptyList(); }

Target:
public void clearErrors() { this.errors.clear(); }
Source:
public static <TYPE> Collection<ScanResult<TYPE>> scan(IOService ioService, Path rootPath, Collection<String> extensions, Function<InputStream, TYPE> converter) { return scan(ioService, rootPath, extensions, converter, resouce -> true); }

Target:
public static <TYPE> Collection<ScanResult<TYPE>> scan(IOService ioService, Path rootPath, Collection<String> extensions, Function<InputStream, TYPE> converter) { return scan(ioService, rootPath, extensions, converter, resource -> true); }
Source:
private void changeSelectedServerInJobs(String oldName) { for (Job job : PluginImpl.getConfiguredJobs_(oldName)) { if (!(job instanceof AbstractProject)) { return; } AbstractProject project = (AbstractProject)job; GerritTrigger trigger = (GerritTrigger)project.getTrigger(GerritTrigger.class); if (trigger != null) { try { trigger.setServerName(name); trigger.start(job, false); project.addTrigger(trigger); project.save(); } catch (IOException e) { logger.error("Error saving Gerrit Trigger configurations for job [" + job.getName() + "] after Gerrit server has been renamed from [" + oldName + "] to [" + name + "]"); } } } }

Target:
private void changeSelectedServerInJobs(String oldName) { for (Job job : PluginImpl.getConfiguredJobs_(oldName)) { if (!(job instanceof AbstractProject)) { logger.warn("Unable to modify Gerrit Trigger configurations for job [" + job.getName() + "] after Gerrit server has been renamed from [" + oldName + "] to [" + name + "]." + " This feature is only supported for AbstractProject types e.g. Freestyle Jobs."); return; } AbstractProject project = (AbstractProject)job; GerritTrigger trigger = (GerritTrigger)project.getTrigger(GerritTrigger.class); if (trigger != null) { try { trigger.setServerName(name); trigger.start(job, false); project.addTrigger(trigger); project.save(); } catch (IOException e) { logger.error("Error saving Gerrit Trigger configurations for job [" + job.getName() + "] after Gerrit server has been renamed from [" + oldName + "] to [" + name + "]"); } } } }
Source:
private Observable<Event> createEvents(final Controller controller) { final Observable<Event> events = Observable.create(subscriber -> { final EventQueue eventQueue = controller.getEventQueue(); while (!subscriber.isUnsubscribed()) { if (!controller.poll()) { subscriber.unsubscribe(); joystickSink.onNext(connect()); return; } final Event event = new Event(); if (!eventQueue.getNextEvent(event)) { continue; } subscriber.onNext(event); } }); return events.subscribeOn(Schedulers.io()).share(); }

Target:
private Observable<Event> createEvents(final Controller controller) { final Observable<Event> events = Observable.create(subscriber -> { final EventQueue eventQueue = controller.getEventQueue(); subscriber.add(Observable.interval(0, TimeUnit.MILLISECONDS, scheduler).subscribe(tick -> { if (controller.poll()) { final Event event = new Event(); if (eventQueue.getNextEvent(event)) { subscriber.onNext(event); } } else { subscriber.unsubscribe(); } })); }); return events.subscribeOn(scheduler).share(); }
Source:
static LegacyLabelTypes getLegacyTypes(ReviewDb db) throws SQLException { List<LegacyLabelType> types = Lists.newArrayListWithCapacity(2); Statement catStmt = ((JdbcSchema) db).getConnection().createStatement(); try { ResultSet catRs = catStmt.executeQuery( "SELECT category_id, name, abbreviated_name, function_name, " + " copy_min_score" + " FROM approval_categories" + " ORDER BY position, name"); PreparedStatement valStmt = ((JdbcSchema) db).getConnection().prepareStatement( "SELECT value, name" + " FROM approval_category_values" + " WHERE category_id = ?"); try { while (catRs.next()) { String id = catRs.getString("category_id"); valStmt.setString(1, id); List<LabelValue> values = Lists.newArrayListWithCapacity(5); ResultSet valRs = valStmt.executeQuery(); while (valRs.next()) { values.add(new LabelValue( valRs.getShort("value"), valRs.getString("name"))); } LegacyLabelType type = new LegacyLabelType(getLabelName(catRs.getString("name")), values); type.setId(id); type.setFunctionName(catRs.getString("function_name")); type.setCopyMinScore("Y".equals(catRs.getString("copy_min_score"))); types.add(type); } } finally { valStmt.close(); } } finally { catStmt.close(); } return new LegacyLabelTypes(types); }

Target:
static LegacyLabelTypes getLegacyTypes(ReviewDb db) throws SQLException { List<LegacyLabelType> types = Lists.newArrayListWithCapacity(2); Statement catStmt = ((JdbcSchema) db).getConnection().createStatement(); try { ResultSet catRs = catStmt.executeQuery( "SELECT category_id, name, function_name, copy_min_score" + " FROM approval_categories" + " ORDER BY position, name"); PreparedStatement valStmt = ((JdbcSchema) db).getConnection().prepareStatement( "SELECT value, name" + " FROM approval_category_values" + " WHERE category_id = ?"); try { while (catRs.next()) { String id = catRs.getString("category_id"); valStmt.setString(1, id); List<LabelValue> values = Lists.newArrayListWithCapacity(5); ResultSet valRs = valStmt.executeQuery(); while (valRs.next()) { values.add(new LabelValue( valRs.getShort("value"), valRs.getString("name"))); } LegacyLabelType type = new LegacyLabelType(getLabelName(catRs.getString("name")), values); type.setId(id); type.setFunctionName(catRs.getString("function_name")); type.setCopyMinScore("Y".equals(catRs.getString("copy_min_score"))); types.add(type); } } finally { valStmt.close(); } } finally { catStmt.close(); } return new LegacyLabelTypes(types); }
Source:
public List<ObserverConfiguration> getObserverConfiguration() { String[] observers = getRequiredProperty("observers").split(","); List<ObserverConfiguration> observersConfiguration = new ArrayList<ObserverConfiguration>(observers.length); for (String observer : observers) { String pipe = getRequiredProperty("observers." + observer + ".pipe"); Properties newProperties = new Properties(); newProperties.putAll(getProperties()); newProperties.put("pipes." + pipe + ".source.work_dir", getWorkDir() + observer); newProperties.put("pipes." + pipe + ".source.read_rotated_files", "false"); observersConfiguration.add(new ObserverConfigurationImpl(observer, new PipeConfigurationImpl(newProperties, pipe))); } return observersConfiguration; }

Target:
public List<ObserverConfiguration> getObserverConfiguration() { String[] observers = getRequiredProperty("observers").split(","); List<ObserverConfiguration> observersConfiguration = new ArrayList<ObserverConfiguration>(observers.length); for (String observer : observers) { String pipe = getRequiredProperty("observers." + observer + ".pipe"); Properties newProperties = new Properties(); newProperties.putAll(getProperties()); String daemonDir = newProperties.getProperty("daemon_dir"); if (daemonDir == null || daemonDir.equals("")) { newProperties.put("daemon_dir", "/var/run/file-drop-zone/state_dir"); } String authClientPath = newProperties.getProperty("pipes." + pipe + ".sink.auth_client_properties"); if (authClientPath == null || authClientPath.equals("")) { newProperties.put("pipes." + pipe + ".sink.auth_client_properties", "/etc/file-drop-zone/conf/auth-client.properties"); } newProperties.put("pipes." + pipe + ".source.work_dir", getWorkDir() + observer); newProperties.put("pipes." + pipe + ".source.read_rotated_files", "false"); observersConfiguration.add(new ObserverConfigurationImpl(observer, newProperties, pipe)); } return observersConfiguration; }
Source:
public CliCommand init(final Arguments args) throws Exception { this.userId = args.getId(); if (this.userId == null) { throw new MissingOptionException("The alter policy command requires '-i' to be set with the username or Id"); } this.metadata = args.getMetadata(); if ((this.metadata == null) || (this.metadata.isEmpty())) { throw new MissingOptionException("The alter policy command requires '--metatdata' to be set with at least one key:value default_data_policy_id:a85aa599-7a58-4141-adbe-79bfd1d42e48,key2:value2"); } return this; }

Target:
public CliCommand init(final Arguments args) throws Exception { this.userId = args.getId(); if (Guard.isStringNullOrEmpty(this.userId)) { throw new MissingOptionException("The modify_user command requires '-i' to be set with the username or Id"); } this.modifyParams = args.getModifyParams(); if (Guard.isMapNullOrEmpty(this.modifyParams)) { throw new MissingOptionException("The modify_user command requires '--modify-params' to be set with at least one key:value default_data_policy_id:a85aa599-7a58-4141-adbe-79bfd1d42e48,key2:value2"); } return this; }
Source:
public static String toAvroIdentifier(String candidate) { char[] data = candidate.toCharArray(); int stringIndex = 0; for (char c:data) { if (Character.isLetterOrDigit(c) || c == '_') { data[stringIndex++] = c; } } char initial = data[0]; if (Character.isLetter(initial) || initial == '_') { return new String(data, 0, stringIndex); } else { return "AVRO_".concat(new String(data, 0, stringIndex)); } }

Target:
public static String toAvroIdentifier(String candidate) { char[] data = candidate.toCharArray(); boolean skip = false; int stringIndex = 0; for (char c:data) { if (Character.isLetterOrDigit(c) || c == '_') { data[stringIndex++] = c; skip = false; } else if(!skip) { data[stringIndex++] = '_'; skip = true; } } char initial = data[0]; if (Character.isLetter(initial) || initial == '_') { return new String(data, 0, stringIndex); } else { return "AVRO_".concat(new String(data, 0, stringIndex)); } }
Source:
public void stop() { if (queuedRequestSender instanceof Stoppable) { ((Stoppable) queuedRequestSender).stop(); } }

Target:
public void stop() { if (queuedRequestSender instanceof Stoppable) { ((Stoppable) queuedRequestSender).stop(); } if (defaultRequestSender instanceof Stoppable) { ((Stoppable) defaultRequestSender).stop(); } }
Source:
public void pmHealthCheck() { if (!inWork) { synchronized (instance) { List<VDS> hosts = DbFacade.getInstance().getVdsDao().getAll(); for (VDS host : hosts) { if (host.getpm_enabled()) { boolean hasSecondary = (host.getPmSecondaryIp() != null && !host.getPmSecondaryIp().isEmpty()); boolean isConcurrent = host.isPmSecondaryConcurrent(); FenceExecutor executor = new FenceExecutor(host, FenceActionType.Status); if (executor.findProxyHost() && executor.fence(FenceAgentOrder.Primary).getSucceeded()) { removeAlarm(host.getId(), isConcurrent, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_CON_PRIMARY_AGENT, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_SEQ_PRIMARY_AGENT); if (hasSecondary) { if (executor.findProxyHost() && executor.fence(FenceAgentOrder.Secondary).getSucceeded()) { removeAlarm(host.getId(), isConcurrent, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_CON_SECONDARY_AGENT, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_SEQ_SECONDARY_AGENT); } else{ addAlarm(host.getId(), isConcurrent, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_CON_SECONDARY_AGENT, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_SEQ_SECONDARY_AGENT); } } } else { addAlarm(host.getId(), isConcurrent, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_CON_PRIMARY_AGENT, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_SEQ_PRIMARY_AGENT); } } } inWork=false; } } }

Target:
public void pmHealthCheck() { if (!inWork) { synchronized (instance) { log.info("Power Management Health Check started."); List<VDS> hosts = DbFacade.getInstance().getVdsDao().getAll(); for (VDS host : hosts) { if (host.getpm_enabled()) { boolean hasSecondary = (host.getPmSecondaryIp() != null && !host.getPmSecondaryIp().isEmpty()); boolean isConcurrent = host.isPmSecondaryConcurrent(); FenceExecutor executor = new FenceExecutor(host, FenceActionType.Status); if (executor.findProxyHost() && executor.fence(FenceAgentOrder.Primary).getSucceeded()) { removeAlarm(host.getId(), isConcurrent, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_CON_PRIMARY_AGENT, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_SEQ_PRIMARY_AGENT); if (hasSecondary) { if (executor.findProxyHost() && executor.fence(FenceAgentOrder.Secondary).getSucceeded()) { removeAlarm(host.getId(), isConcurrent, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_CON_SECONDARY_AGENT, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_SEQ_SECONDARY_AGENT); } else{ addAlarm(host.getId(), isConcurrent, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_CON_SECONDARY_AGENT, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_SEQ_SECONDARY_AGENT); } } } else { addAlarm(host.getId(), isConcurrent, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_CON_PRIMARY_AGENT, AuditLogType.VDS_ALERT_PM_HEALTH_CHECK_FAILED_FOR_SEQ_PRIMARY_AGENT); } } } log.info("Power Management Health Check completed."); inWork=false; } } }
Source:
public void updatePipeline(PipelineConfig pipelineConfig, LocalizedOperationResult result, Username currentUser, PipelineConfigService.SaveCommand saveCommand) { synchronized (goConfigWriteLock.mutex()) { if (saveCommand.hasWritePermissions()) { try { cachedConfigService.writePipelineWithLock(pipelineConfig, saveCommand, currentUser); } catch (ConfigUpdateCheckFailedException e) { result.unprocessableEntity(LocalizedMessage.string("PIPELINE_CONFIG_VALIDATION_FAILED", pipelineConfig.name())); } } } }

Target:
public void updatePipeline(PipelineConfig pipelineConfig, LocalizedOperationResult result, Username currentUser, PipelineConfigService.SaveCommand saveCommand) { synchronized (GoConfigWriteLock.class) { if (saveCommand.hasWritePermissions()) { try { cachedConfigService.writePipelineWithLock(pipelineConfig, saveCommand, currentUser); } catch (ConfigUpdateCheckFailedException e) { result.unprocessableEntity(LocalizedMessage.string("PIPELINE_CONFIG_VALIDATION_FAILED", pipelineConfig.name())); } } } }
Source:
public Block split(@TypeParameter("map<varchar,varchar>") Type mapType, @SqlType(StandardTypes.VARCHAR) Slice string, @SqlType(StandardTypes.VARCHAR) Slice entryDelimiter, @SqlType(StandardTypes.VARCHAR) Slice keyValueDelimiter) { return splitToMap(pageBuilder, mapType, string, entryDelimiter, keyValueDelimiter, null); }

Target:
public Block split( @TypeParameter("map<varchar,varchar>") Type mapType, @SqlType(StandardTypes.VARCHAR) Slice string, @SqlType(StandardTypes.VARCHAR) Slice entryDelimiter, @SqlType(StandardTypes.VARCHAR) Slice keyValueDelimiter) { return splitToMap(pageBuilder, mapType, string, entryDelimiter, keyValueDelimiter, Optional.empty()); }
Source:
public CompletableFuture<AsyncConnection> createAsyncConnection() throws IOException { Configuration clientConfig = HBaseConfiguration.create(); String[] keys = new String[]{ "hbase.zookeeper.quorum", "hbase.zookeeper.property.clientPort" }; for (String key : keys) { clientConfig.set(key, helper.getConfiguration().get(key)); } return ConnectionFactory.createAsyncConnection(clientConfig); }

Target:
public AsyncConnection createAsyncConnection() throws Exception { Configuration clientConfig = HBaseConfiguration.create(); String[] keys = new String[]{ "hbase.zookeeper.quorum", "hbase.zookeeper.property.clientPort" }; for (String key : keys) { clientConfig.set(key, helper.getConfiguration().get(key)); } return ConnectionFactory.createAsyncConnection(clientConfig).get(); }
Source:
@Override public void expand(EnvVars env) throws IOException, InterruptedException { for (Map.Entry<String,Secret> override : overrides.entrySet()) { String keyOverride = override.getKey(); env.override(keyOverride, override.getValue().getPlainText()); sensitiveVariables.add(keyOverride); } }

Target:
@Override public void expand(EnvVars env) throws IOException, InterruptedException { for (Map.Entry<String,Secret> override : overrides.entrySet()) { env.override(override.getKey(), override.getValue().getPlainText()); } }
Source:
private void updateBackup() { if (getCurrentStorageItem() != null && getAvailableStorageTypeItems().getSelectedItem() != null) { boolean isStorageDomainUnattached = getDataCenter().getSelectedItem().getId().equals(Guid.Empty); if (isStorageDomainUnattached) { getBackup().setIsAvailable(false); getBackup().setEntity(false); return; } if (getCurrentStorageItem().getRole() == StorageDomainType.ISO || getCurrentStorageItem().getRole() == StorageDomainType.ImportExport) { getBackup().setIsAvailable(false); getBackup().setEntity(false); return; } else { boolean backupSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigValues.BackupSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); getBackup().setIsAvailable(backupSupported); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); return; } } getBackup().setIsAvailable(false); getBackup().setEntity(false); return; }

Target:
private void updateBackup() { if (getCurrentStorageItem() != null && getAvailableStorageTypeItems().getSelectedItem() != null) { boolean isStorageDomainUnattached = getDataCenter().getSelectedItem().getId().equals(UnassignedDataCenterId); if (isStorageDomainUnattached) { if (getCurrentStorageItem().getRole().isDataDomain()) { getBackup().setIsAvailable(true); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); return; } else { getBackup().setIsAvailable(false); getBackup().setEntity(false); return; } } if (getCurrentStorageItem().getRole() == StorageDomainType.ISO || getCurrentStorageItem().getRole() == StorageDomainType.ImportExport) { getBackup().setIsAvailable(false); getBackup().setEntity(false); return; } else { boolean backupSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigValues.BackupSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); getBackup().setIsAvailable(backupSupported); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); return; } } getBackup().setIsAvailable(false); getBackup().setEntity(false); return; }
Source:
public boolean isSkipWorkTree() { return (getExtendedFlags() & SKIP_WORKTREE) == SKIP_WORKTREE; }

Target:
public boolean isSkipWorkTree() { return (getExtendedFlags() & SKIP_WORKTREE) != 0; }
Source:
public static MergePolicy fromConfiguration(EntryMergePolicy policy) { if (policy == null) return NONE; for (MergePolicy mp : MergePolicy.values()) if (mp.impl != null && Objects.equals(mp.impl.getClass(), policy.getClass())) return mp; return CUSTOM; }

Target:
public static MergePolicy fromConfiguration(EntryMergePolicy policy) { if (policy == null) return NONE; for (MergePolicy mp : MergePolicy.values()) if (mp == policy) return mp; return CUSTOM; }
Source:
private <T> Mono<CosmosAsyncItemResponse<T>> createItemInternal(T item, CosmosItemRequestOptions options, Context context) { String spanName = "createItem." + this.getId(); Mono<CosmosAsyncItemResponse<T>> responseMono = createItemInternal(item, options); return database.getClient().getTracerProvider().traceEnabledCosmosItemResponsePublisher(responseMono, context , spanName, database.getId(), database.getClient().getServiceEndpoint()); }

Target:
private <T> Mono<CosmosItemResponse<T>> createItemInternal(T item, CosmosItemRequestOptions options, Context context) { Mono<CosmosItemResponse<T>> responseMono = createItemInternal(item, options); return database.getClient().getTracerProvider().traceEnabledCosmosItemResponsePublisher(responseMono, context, this.createItemSpanName, database.getId(), database.getClient().getServiceEndpoint()); }
Source:
public void testParseIntMinM1() throws EvaluationException { PARSE_INTEGER.evaluate(s(Long.toString((long) Integer.MIN_VALUE - 1))); fail("parse_Integer(Long.toString((long) Integer.MIN_VALUE - 1)) did not throw"); }

Target:
public void testParseIntMinM1() throws EvaluationException { PARSE_INTEGER.evaluate(s(Long.toString((long) Integer.MIN_VALUE - 1))); }
Source:
private List<DiskImage> getDisksList() { if (selectedDisks == null) { selectedDisks = new ArrayList<DiskImage>(); List<DiskImage> vmDisksNotShared = new ArrayList<DiskImage>(); List<DiskImage> allVmDisks = DbFacade.getInstance().getDiskImageDAO().getAllForVm(getVmId()); for (DiskImage vmDisk : allVmDisks) { if (!vmDisk.isShareable()) { if (getParameters().getDisksList().contains(Integer.toString(vmDisk.getInternalDriveMapping()))) { selectedDisks.add(vmDisk); } vmDisksNotShared.add(vmDisk); } } selectedDisks = (selectedDisks.size() > 0) ? selectedDisks : vmDisksNotShared; } return selectedDisks; }

Target:
private List<DiskImage> getDisksList() { if (selectedDisks == null) { selectedDisks = new ArrayList<DiskImage>(); List<DiskImage> vmDisksNotShareable = new ArrayList<DiskImage>(); List<DiskImage> allVmDisks = DbFacade.getInstance().getDiskImageDAO().getAllForVm(getVmId()); for (DiskImage vmDisk : allVmDisks) { if (!vmDisk.isShareable()) { if (getParameters().getDisksList().contains(Integer.toString(vmDisk.getInternalDriveMapping()))) { selectedDisks.add(vmDisk); } vmDisksNotShareable.add(vmDisk); } } selectedDisks = (selectedDisks.size() > 0) ? selectedDisks : vmDisksNotShareable; } return selectedDisks; }
Source:
private static ManifestElement[] getGenericRequires(Dictionary<String, String> manifest, String[][] genericAliases) throws BundleException { ManifestElement[] genericRequires = ManifestElement.parseHeader(GENERIC_REQUIRE, manifest.get(GENERIC_REQUIRE)); List<ManifestElement> aliasList = null; if (genericAliases.length > 0) { aliasList = new ArrayList<>(genericRequires == null ? 0 : genericRequires.length); for (String[] genericAliase : genericAliases) { ManifestElement[] aliasReqs = ManifestElement.parseHeader(genericAliase[1], manifest.get(genericAliase[1])); if (aliasReqs == null) continue; for (ManifestElement aliasReq : aliasReqs) { StringBuffer strBuf = new StringBuffer(); strBuf.append(aliasReq.getValue()).append(':').append(genericAliase[2]); String filter = aliasReq.getAttribute(Constants.SELECTION_FILTER_ATTRIBUTE); if (filter != null) strBuf.append("; ").append(Constants.SELECTION_FILTER_ATTRIBUTE).append(filter).append("=\"").append(filter).append("\""); ManifestElement[] withType = ManifestElement.parseHeader(genericAliase[1], strBuf.toString()); aliasList.add(withType[0]); } } } if (aliasList == null || aliasList.size() == 0) return genericRequires; if (genericRequires != null) for (ManifestElement genericRequire : genericRequires) { aliasList.add(genericRequire); } return aliasList.toArray(new ManifestElement[aliasList.size()]); }

Target:
private static ManifestElement[] getGenericRequires(Dictionary<String, String> manifest, String[][] genericAliases) throws BundleException { ManifestElement[] genericRequires = ManifestElement.parseHeader(GENERIC_REQUIRE, manifest.get(GENERIC_REQUIRE)); List<ManifestElement> aliasList = null; if (genericAliases.length > 0) { aliasList = new ArrayList<>(genericRequires == null ? 0 : genericRequires.length); for (String[] genericAlias : genericAliases) { ManifestElement[] aliasReqs = ManifestElement.parseHeader(genericAlias[1], manifest.get(genericAlias[1])); if (aliasReqs == null) continue; for (ManifestElement aliasReq : aliasReqs) { StringBuffer strBuf = new StringBuffer(); strBuf.append(aliasReq.getValue()).append(':').append(genericAlias[2]); String filter = aliasReq.getAttribute(Constants.SELECTION_FILTER_ATTRIBUTE); if (filter != null) strBuf.append("; ").append(Constants.SELECTION_FILTER_ATTRIBUTE).append(filter).append("=\"").append(filter).append("\""); ManifestElement[] withType = ManifestElement.parseHeader(genericAlias[1], strBuf.toString()); aliasList.add(withType[0]); } } } if (aliasList == null || aliasList.size() == 0) return genericRequires; if (genericRequires != null) for (ManifestElement genericRequire : genericRequires) { aliasList.add(genericRequire); } return aliasList.toArray(new ManifestElement[aliasList.size()]); }
Source:
public void testSelectDistinct() throws Exception { String selectStatement = db.createQuery() .from(User.TBL) .select(User.TBL.getAllColumns()) .getQueryStatement(); String selectDistinctStatement = db.createQuery() .from(User.TBL) .selectDistinct(User.TBL.getAllColumns()) .getQueryStatement(); assertFalse(selectStatement.contains("SELECT DISTINCT")); assertTrue(selectDistinctStatement.contains("SELECT DISTINCT")); }

Target:
public void testSelectDistinct() throws Exception { String selectStatement = db.createQuery() .from(User.TBL) .select(User.TBL.getAllColumns()) .getQueryStatement(); String selectDistinctStatement = db.createQuery() .from(User.TBL) .select(User.TBL.getAllColumns()).distinct() .getQueryStatement(); assertFalse(selectStatement.contains("SELECT DISTINCT")); assertTrue(selectDistinctStatement.contains("SELECT DISTINCT")); }
Source:
static <T> Future<T> ofCallable(ExecutorService executorService, Callable<? extends T> computation) { return of(executorService, computation::call); }

Target:
static <T> Future<T> ofCallable(ExecutorService executorService, Callable<? extends T> computation) { Objects.requireNonNull(computation, "computation is null"); return of(executorService, computation::call); }
Source:
public CodeWriter indent() { for (int i = 0; i < indentationFactor; i++) indent += ' '; return this; }

Target:
public CodeWriter indent() { for (int i = 0; i < indentationFactor; i++) { indent += ' '; } return this; }
Source:
public void supportsPreciseLocation() { assertThat(launcher.hasPreciseIssueLocation("5.2.9")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("5.2")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("5.")).isFalse(); assertThat(launcher.hasPreciseIssueLocation(null)).isFalse(); assertThat(launcher.hasPreciseIssueLocation("4.5")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("6")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("e6.0")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("5.3")).isTrue(); assertThat(launcher.hasPreciseIssueLocation("5.10.1")).isTrue(); assertThat(launcher.hasPreciseIssueLocation("5.3.1")).isTrue(); assertThat(launcher.hasPreciseIssueLocation("6.0")).isTrue(); assertThat(launcher.hasPreciseIssueLocation("5.3")).isTrue(); }

Target:
public void supportsPreciseLocation() { assertThat(launcher.hasPreciseIssueLocation("5.2.9")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("5.2")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("5.")).isFalse(); assertThat(launcher.hasPreciseIssueLocation(null)).isFalse(); assertThat(launcher.hasPreciseIssueLocation("4.5")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("4.5-SNAPSHOT")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("4-RC1")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("6")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("e6.0")).isFalse(); assertThat(launcher.hasPreciseIssueLocation("5.3")).isTrue(); assertThat(launcher.hasPreciseIssueLocation("5.10.1")).isTrue(); assertThat(launcher.hasPreciseIssueLocation("5.3.1")).isTrue(); assertThat(launcher.hasPreciseIssueLocation("6.0")).isTrue(); assertThat(launcher.hasPreciseIssueLocation("5.3-SNAPSHOT")).isTrue(); assertThat(launcher.hasPreciseIssueLocation("5.3-RC1")).isTrue(); }
Source:
private boolean processRemoteNotification(Bundle msg) { if (isSwrveRemoteNotification(msg)) { Iterator<SwrveQAUser> iter = SwrveQAUser.getBindedListeners().iterator(); while (iter.hasNext()) { SwrveQAUser sdkListener = iter.next(); sdkListener.pushNotification(msg); } swrveGcmService.processNotification(msg); } }

Target:
private boolean processRemoteNotification(Bundle msg) { if (isSwrveRemoteNotification(msg)) { Iterator<SwrveQAUser> iter = SwrveQAUser.getBindedListeners().iterator(); while (iter.hasNext()) { SwrveQAUser sdkListener = iter.next(); sdkListener.pushNotification(msg); } swrveGcmService.processNotification(msg); return true; } return false; }