auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected CommentManager recomputeCommentManager() { MigrationService migrationService = Framework.getService(MigrationService.class); MigrationService.MigrationStatus status = migrationService.getStatus(MIGRATION_ID); if (status == null) { throw new IllegalStateException("Unknown migration status for: " + MIGRATION_ID); } if (status.isRunning()) { String step = status.getStep(); if (Arrays.asList(MIGRATION_STEP_RELATION_TO_PROPERTY, MIGRATION_STEP_PROPERTY_TO_SECURED).contains(step)) { return new BridgeCommentManager(new CommentManagerImpl(config), new PropertyCommentManager(), new TreeCommentManager()); } else { throw new IllegalStateException("Unknown migration step: " + step); } } else { String state = status.getState(); if (MIGRATION_STATE_RELATION.equals(state)) { return new CommentManagerImpl(config); } else if (MIGRATION_STATE_PROPERTY.equals(state)) { return new PropertyCommentManager(); } else if (MIGRATION_STATE_SECURED.equals(state)) { return new TreeCommentManager(); } else { throw new IllegalStateException("Unknown migration state: " + state); } } }

Target:
protected CommentManager recomputeCommentManager() { MigrationService migrationService = Framework.getService(MigrationService.class); MigrationService.MigrationStatus status = migrationService.getStatus(MIGRATION_ID); if (status == null) { throw new IllegalStateException("Unknown migration status for: " + MIGRATION_ID); } if (status.isRunning()) { String step = status.getStep(); if (MIGRATION_STEP_RELATION_TO_PROPERTY.equals(step)) { return new BridgeCommentManager(new CommentManagerImpl(config), new PropertyCommentManager()); } else if (MIGRATION_STEP_PROPERTY_TO_SECURED.equals(step)) { return new BridgeCommentManager(new PropertyCommentManager(), new TreeCommentManager()); } else { throw new IllegalStateException("Unknown migration step: " + step); } } else { String state = status.getState(); if (MIGRATION_STATE_RELATION.equals(state)) { return new CommentManagerImpl(config); } else if (MIGRATION_STATE_PROPERTY.equals(state)) { return new PropertyCommentManager(); } else if (MIGRATION_STATE_SECURED.equals(state)) { return new TreeCommentManager(); } else { throw new IllegalStateException("Unknown migration state: " + state); } } }
Source:
public Detail( String id, DisplayUnit title, Vector<Detail> details, Vector<DetailField> fields, OrderedHashtable<String, String> variables, Action action, Callout callout ) { this( id, title, ArrayUtilities.copyIntoArray(details, new Detail[details.size()]), ArrayUtilities.copyIntoArray(fields, new DetailField[fields.size()]), variables, action ); this.callout = callout; }

Target:
public Detail( String id, DisplayUnit title, Vector<Detail> details, Vector<DetailField> fields, OrderedHashtable<String, String> variables, Action action, Callout callout ) { this( id, title, details, fields, variables, action ); this.callout = callout; }
Source:
public void testDynamicRoutingKey() throws Exception { runFlow("senderFlow"); MuleMessage result = muleContext.getClient().request("vm://result", 5000); assertNotNull(result); assertEquals(result.getPayloadAsString(), "testedDynamicRoutingKey"); }

Target:
public void testDynamicRoutingKey() throws Exception { runFlow("senderFlow"); MuleMessage result = muleContext.getClient().request("vm://result", 5000); assertThat(result, is(notNullValue())); assertThat(result.getPayloadAsString(), is("testedDynamicRoutingKey")); }
Source:
public IntraWikiSearchPageObject searchFor(String query) { typeQuery(query); PageObjectLogging.log("searchFor", "searching for query: " + query, true, driver); return clickSearchButton(); }

Target:
public IntraWikiSearchPageObject searchFor(String query) { PageObjectLogging.log("searchFor", "searching for query: " + query, true, driver); typeQuery(query); return clickSearchButton(); }
Source:
public void initVertex() { super.initVertex(); if (outgoingMsg == null) outgoingMsg = new PathMergeMessage(); else outgoingMsg.reset(); RANDOM_SEED = Long.parseLong(getContext().getConfiguration().get(GenomixJobConf.RANDOM_RANDSEED)); if (randGenerator == null) randGenerator = new Random(RANDOM_SEED); if (probBeingRandomHead < 0) probBeingRandomHead = Float.parseFloat(getContext().getConfiguration().get( GenomixJobConf.PATHMERGE_RANDOM_PROB_BEING_RANDOM_HEAD)); if (repeatKmer == null) repeatKmer = new VKmer(); tmpValue.reset(); if (getSuperstep() == 1) StatisticsAggregator.preGlobalCounters.clear(); counters.clear(); getVertexValue().getCounters().clear(); }

Target:
public void initVertex() { super.initVertex(); if (outgoingMsg == null) outgoingMsg = new PathMergeMessage(); else outgoingMsg.reset(); RANDOM_SEED = Long.parseLong(getContext().getConfiguration().get(GenomixJobConf.RANDOM_SEED)); if (randGenerator == null) randGenerator = new Random(RANDOM_SEED); if (probBeingRandomHead < 0) probBeingRandomHead = Float.parseFloat(getContext().getConfiguration().get( GenomixJobConf.PATHMERGE_RANDOM_PROB_BEING_RANDOM_HEAD)); if (repeatKmer == null) repeatKmer = new VKmer(); tmpValue.reset(); if (getSuperstep() == 1) StatisticsAggregator.preGlobalCounters.clear(); counters.clear(); getVertexValue().getCounters().clear(); }
Source:
public void checkDiskError() throws IOException { Set<FsVolumeSpi> unhealthyVolumes; try { unhealthyVolumes = volumeChecker.checkAllVolumes(allData); lastDiskErrorCheck = Time.monotonicNow(); } catch (InterruptedException e) { LOG.error("Interrupted while running disk check", e); throw new IOException("Interrupted while running disk check", e); } if (unhealthyVolumes.size() > 0) { if (errorDisk == null) { errorDisk = new ArrayList<>(); } List<StorageLocation> tmpDisk = Lists.newArrayList(errorDisk); errorDisk = null; for (FsVolumeSpi vol : unhealthyVolumes) { LOG.info("Add error disk " + vol.getStorageLocation() + " to errorDisk - " + vol.getStorageLocation()); errorDisk.add(vol.getStorageLocation()); if (tmpDisk.contains(vol.getStorageLocation())) { tmpDisk.remove(vol.getStorageLocation()); } } LOG.warn("checkDiskError got failed volumes - {}", unhealthyVolumes.size(), unhealthyVolumes); handleVolumeFailures(unhealthyVolumes); if (!tmpDisk.isEmpty()) { try { Configuration conf = getConf(); String newDataDirs = conf.get(DFS_DATANODE_DATA_DIR_KEY) + "," + Joiner.on(",").join(tmpDisk); refreshVolumes(newDataDirs); } catch (IOException e) { LOG.error("Auto refreshVolumes error : ", e); } } } else { LOG.debug("checkDiskError encountered no failures," + "then check errorDisk"); if (errorDisk != null && !errorDisk.isEmpty()) { try { Configuration conf = getConf(); String newDataDirs = conf.get(DFS_DATANODE_DATA_DIR_KEY) + "," + Joiner.on(",").join(errorDisk); refreshVolumes(newDataDirs); errorDisk = null; } catch (IOException e) { LOG.error("Auto refreshVolumes error : ", e); } } } }

Target:
public void checkDiskError() throws IOException { Set<FsVolumeSpi> unhealthyVolumes; Configuration conf = getConf(); String newDataDirs = null; try { unhealthyVolumes = volumeChecker.checkAllVolumes(allData); lastDiskErrorCheck = Time.monotonicNow(); } catch (InterruptedException e) { LOG.error("Interrupted while running disk check", e); throw new IOException("Interrupted while running disk check", e); } if (unhealthyVolumes.size() > 0) { if (errorDisk == null) { errorDisk = new ArrayList<>(); } List<StorageLocation> tmpDisk = Lists.newArrayList(errorDisk); errorDisk.clear(); for (FsVolumeSpi vol : unhealthyVolumes) { LOG.info("Add error disk to errorDisk - {}", vol.getStorageLocation(), vol.getStorageLocation()); errorDisk.add(vol.getStorageLocation()); if (tmpDisk.contains(vol.getStorageLocation())) { tmpDisk.remove(vol.getStorageLocation()); } } LOG.warn("checkDiskError got failed volumes - {}", unhealthyVolumes.size(), unhealthyVolumes); handleVolumeFailures(unhealthyVolumes); if (!tmpDisk.isEmpty()) { newDataDirs = conf.get(DFS_DATANODE_DATA_DIR_KEY) + "," + Joiner.on(",").join(tmpDisk); } } else { LOG.debug("checkDiskError encountered no failures," + "then check errorDisk"); if (errorDisk != null && !errorDisk.isEmpty()) { newDataDirs = conf.get(DFS_DATANODE_DATA_DIR_KEY) + "," + Joiner.on(",").join(errorDisk); } } if (newDataDirs != null) { LOG.debug("Bad disks is repaired, should refreshVolumes disk."); try { refreshVolumes(newDataDirs); } catch (IOException e) { LOG.error("Bad disks is repaired, refreshVolumes error : ", e); } } }
Source:
private static boolean enabled() { final boolean enabled = CalciteSystemProperty.TEST_CASSANDRA.value(); Bug.upgrade("remove JDK version check once current adapter supports Cassandra 4.x"); final List<Integer> incompatibleJdks = Arrays.asList(11, 12, 13); final boolean compatibleJdk = !incompatibleJdks.contains(TestUtil.getJavaMajorVersion()); return enabled && compatibleJdk; }

Target:
private static boolean enabled() { final boolean enabled = CalciteSystemProperty.TEST_CASSANDRA.value(); Bug.upgrade("remove JDK version check once current adapter supports Cassandra 4.x"); final boolean compatibleJdk = TestUtil.getJavaMajorVersion() < 11; return enabled && compatibleJdk; }
Source:
private DfsBlockCache(final DfsBlockCacheConfig cfg) { tableSize = tableSize(cfg); if (tableSize < 1) throw new IllegalArgumentException(JGitText.get().tSizeMustBeGreaterOrEqual1); table = new AtomicReferenceArray<HashEntry>(tableSize); loadLocks = new ReentrantLock[cfg.getConcurrencyLevel()]; for (int i = 0; i < loadLocks.length; i++) loadLocks[i] = new ReentrantLock(true ); maxBytes = cfg.getBlockLimit(); maxStreamThroughCache = (long) (maxBytes * cfg.getStreamRatio()); blockSize = cfg.getBlockSize(); if ((blockSize & (blockSize - 1)) != 0) { throw new IllegalArgumentException(JGitText.get().blockSizeNotPowerOf2); } blockSizeShift = Integer.numberOfTrailingZeros(blockSize); clockLock = new ReentrantLock(true ); clockHand = new Ref<Object>(new DfsPackKey(), -1, 0, null); clockHand.next = clockHand; packCache = new ConcurrentHashMap<DfsPackDescription, DfsPackFile>( 16, 0.75f, 1); packFiles = Collections.unmodifiableCollection(packCache.values()); statHit = new AtomicLong(); statMiss = new AtomicLong(); }

Target:
private DfsBlockCache(final DfsBlockCacheConfig cfg) { tableSize = tableSize(cfg); if (tableSize < 1) throw new IllegalArgumentException(JGitText.get().tSizeMustBeGreaterOrEqual1); table = new AtomicReferenceArray<HashEntry>(tableSize); loadLocks = new ReentrantLock[cfg.getConcurrencyLevel()]; for (int i = 0; i < loadLocks.length; i++) loadLocks[i] = new ReentrantLock(true ); maxBytes = cfg.getBlockLimit(); maxStreamThroughCache = (long) (maxBytes * cfg.getStreamRatio()); blockSize = cfg.getBlockSize(); blockSizeShift = Integer.numberOfTrailingZeros(blockSize); clockLock = new ReentrantLock(true ); clockHand = new Ref<Object>(new DfsPackKey(), -1, 0, null); clockHand.next = clockHand; packCache = new ConcurrentHashMap<DfsPackDescription, DfsPackFile>( 16, 0.75f, 1); packFiles = Collections.unmodifiableCollection(packCache.values()); statHit = new AtomicLong(); statMiss = new AtomicLong(); }
Source:
private void doAnotherRequest(String messageSubject, Map<String, String> messageMap, SsmlDocumentBuilder builder, QuipMetadata metadata) { ConversationHistoryEntry entry = ConversationHistoryUtils.getLastNonMetaRequestBySubject(metadata.getConversationHistory(), new HashSet<String>(Arrays.asList(metaRequestSubjects))); switchOnSubject(entry.getMessageSubject(), messageMap, builder, metadata); }

Target:
protected void doAnotherRequest(String messageSubject, Map<String, String> messageMap, SsmlDocumentBuilder builder, QuipMetadata metadata) { ConversationHistoryEntry entry = ConversationHistoryUtils.getLastNonMetaRequestBySubject(metadata.getConversationHistory(), new HashSet<String>(Arrays.asList(metaRequestSubjects))); if(entry == null){ doDefaultRequest(messageMap, builder, metadata); return; } switchOnSubject(entry.getMessageSubject(), messageMap, builder, metadata); }
Source:
private E findOrThrow(I id) { return find(id).orElseThrow(() -> newIllegalArgumentException( "An entity `%s` with ID `%s` is not found in the repository.", entityClass(), id )); }

Target:
private E findOrThrow(I id) { return find(id).orElseThrow(() -> newIllegalArgumentException( "An entity `%s` with ID `%s` is not found in the repository.", entityClass().getCanonicalName(), id )); }
Source:
public static VmPayload map(Payload model, VmPayload template) { VmPayload entity = template != null ? template : new VmPayload(); if (model.getType() != null) { org.ovirt.engine.api.model.VmDeviceType deviceType = org.ovirt.engine.api.model.VmDeviceType.fromValue(model.getType()); if (deviceType!=null) { entity.setType(map(deviceType, null)); } } entity.setVolumeId(model.getVolumeId()); if (model.getFile() != null) { for (PayloadFile file : model.getFile()) { entity.getFiles().put(file.getName(), file.getContent()); } } return entity; }

Target:
public static VmPayload map(Payload model, VmPayload template) { VmPayload entity = template != null ? template : new VmPayload(); if (model.getType() != null) { org.ovirt.engine.api.model.VmDeviceType deviceType = org.ovirt.engine.api.model.VmDeviceType.fromValue(model.getType()); if (deviceType!=null) { entity.setType(map(deviceType, null)); } } if (model.isSetVolumeId()) { entity.setVolumeId(model.getVolumeId()); } if (model.getFile() != null) { for (PayloadFile file : model.getFile()) { entity.getFiles().put(file.getName(), file.getContent()); } } return entity; }
Source:
private void validateTestEnv(TestEnvironmentEntity testEnv) { String envId = testEnv.getEnvironmentId(); Pattern envIdPattern = Pattern.compile(ENV_ID_PATTERN); Matcher matcher = envIdPattern.matcher(envId); if (!matcher.matches()) throw new TestEnvironmentInvalidIdException(envId, envIdPattern); if (testEnv.getRunningTestSuite() != null && testEnv.getStatus() == RUNNING || testEnv.getRunningTestSuite() == null && testEnv.getStatus() == PENDING) throw new WrongTestEnvironmentStatusException(testEnv.getStatus(), testEnv.getRunningTestSuite()); }

Target:
private void validateTestEnv(TestEnvironmentEntity testEnv) { String envId = testEnv.getEnvironmentId(); Pattern envIdPattern = Pattern.compile(ENV_ID_PATTERN); Matcher matcher = envIdPattern.matcher(envId); if (!matcher.matches()) throw new TestEnvironmentInvalidIdException(envId, envIdPattern); if (testEnv.getRunningTestSuite() == null && testEnv.getStatus() == RUNNING || testEnv.getRunningTestSuite() != null && testEnv.getStatus() == PENDING) throw new WrongTestEnvironmentStatusException(testEnv.getStatus(), testEnv.getRunningTestSuite()); }
Source:
public void handleAction(ActionParameters params) throws ActionException { if(params.getUser().isGuest()) { throw new ActionDeniedException("Session expired"); } final long id = ConversionHelper.getLong(params.getHttpParam(PARAM_ID), -1); if(id == -1) { throw new ActionParamsException("Parameter missing or non-numeric: " + PARAM_ID + "=" + params.getHttpParam(PARAM_ID)); } final UserLayerStyle style = userLayerDbService.getUserLayerStyleById(id); if (style != null){ JSONObject response = style.parseUserLayerStyle2JSON(); ResponseHelper.writeResponse(params, response); }else{ throw new ActionException("Unable to get style for id" + id); } }

Target:
public void handleAction(ActionParameters params) throws ActionException { params.requireLoggedInUser(); final long id = params.getRequiredParamLong(PARAM_ID); final UserLayer userLayer = userLayerDbService.getUserLayerById(id); if(userLayer == null) { throw new ActionParamsException("Userlayer's style id didn't match any userlayer: " + id); } if(!userLayer.isOwnedBy(params.getUser().getUuid())) { throw new ActionDeniedException("Userlayer's style belongs to another user"); } final UserLayerStyle style = userLayerDbService.getUserLayerStyleById(id); if (style != null){ JSONObject response = style.parseUserLayerStyle2JSON(); ResponseHelper.writeResponse(params, response); }else{ throw new ActionParamsException("Unable to get style for id" + id); } }
Source:
public void run(final int iteration) { final long epochStartTime = System.currentTimeMillis(); WorkerMetrics workerMetrics; for (int miniBatchIdx = 0; miniBatchIdx < numMiniBatches; miniBatchIdx++) { resetTracers(); final long miniBatchStartTime = System.currentTimeMillis(); pullTracer.startTimer(); final List<Vector> valueList = parameterWorker.pull(keyList); pullTracer.recordTime(valueList.size()); LOG.log(Level.FINE, "Current values associated with keys {0} is {1}", new Object[]{keyList, valueList}); try { computeTracer.startTimer(); Thread.sleep(computeTime); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while sleeping to simulate computation", e); } finally { computeTracer.recordTime(NUM_DATA_ITEMS_TO_PROCESS); } pushTracer.startTimer(); for (final int key : keyList) { parameterWorker.push(key, delta); } pushTracer.recordTime(keyList.size()); final double miniBatchElapsedTime = (System.currentTimeMillis() - miniBatchStartTime) / 1000.0D; workerMetrics = buildMiniBatchMetric(iteration, miniBatchIdx, miniBatchElapsedTime); LOG.log(Level.INFO, "WorkerMetrics {0}", workerMetrics); sendMetrics(workerMetrics); } final double epochElapsedTime = (System.currentTimeMillis() - epochStartTime) / 1000.0D; workerMetrics = buildEpochMetric(iteration, memoryStore.getNumBlocks(), epochElapsedTime); LOG.log(Level.INFO, "WorkerMetrics {0}", workerMetrics); sendMetrics(workerMetrics); }

Target:
public void run(final int iteration) { final long epochStartTime = System.currentTimeMillis(); for (int miniBatchIdx = 0; miniBatchIdx < numMiniBatches; miniBatchIdx++) { resetTracers(); final long miniBatchStartTime = System.currentTimeMillis(); pullTracer.startTimer(); final List<Vector> valueList = parameterWorker.pull(keyList); pullTracer.recordTime(valueList.size()); LOG.log(Level.FINE, "Current values associated with keys {0} is {1}", new Object[]{keyList, valueList}); try { computeTracer.startTimer(); Thread.sleep(computeTime); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while sleeping to simulate computation", e); } finally { computeTracer.recordTime(NUM_DATA_ITEMS_TO_PROCESS); } pushTracer.startTimer(); for (final int key : keyList) { parameterWorker.push(key, delta); } pushTracer.recordTime(keyList.size()); final double miniBatchElapsedTime = (System.currentTimeMillis() - miniBatchStartTime) / 1000.0D; final WorkerMetrics miniBatchMetric = buildMiniBatchMetric(iteration, miniBatchIdx, miniBatchElapsedTime); LOG.log(Level.INFO, "WorkerMetrics {0}", miniBatchMetric); sendMetrics(miniBatchMetric); } final double epochElapsedTime = (System.currentTimeMillis() - epochStartTime) / 1000.0D; final WorkerMetrics epochMetric = buildEpochMetric(iteration, memoryStore.getNumBlocks(), epochElapsedTime); LOG.log(Level.INFO, "WorkerMetrics {0}", epochMetric); sendMetrics(epochMetric); }
Source:
private void updated(Map<String, Object> properties) { StringBuilder sb = new StringBuilder(); for (Entry<String, Object> entry : properties.entrySet()) { sb.append("[").append(entry.getKey()).append("=").append(entry.getValue()).append("], "); } System.out.println("Properties after update: " + sb.toString()); }

Target:
private void updated(Map<String, Object> properties) { if (logger.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); for (Entry<String, Object> entry : properties.entrySet()) { sb.append("[").append(entry.getKey()).append("=").append(entry.getValue()).append("], "); } logger.debug("Properties after update: " + sb.toString()); } }
Source:
public Builder setMutateRpcTimeoutMs(int mutateRpcTimeoutMs) { Preconditions.checkArgument( mutateRpcTimeoutMs > 0, "Long Timeout ms has to be greater than 0"); this.mutateRpcTimeoutMs = mutateRpcTimeoutMs; return this; }

Target:
public Builder setMutateRpcTimeoutMs(int mutateRpcTimeoutMs) { Preconditions.checkArgument( mutateRpcTimeoutMs > 0, "Mutate Rows RPC Timeout ms has to be greater than 0"); this.mutateRpcTimeoutMs = mutateRpcTimeoutMs; return this; }
Source:
public Model checkSyntax(InputStream dataset, String baseURI, RDFFormat format) { Model parsed = null; try { parsed = Rio.parse(dataset, baseURI, format); } catch (IOException ioe) { log.error("Couldn't read your dataset: {}", ioe.getMessage()); System.exit(1); } catch (RDFParseException rpe) { log.error("Your dataset is not valid RDF. Please fix it: {}", rpe.getMessage()); System.exit(1); return null; } return parsed; }

Target:
public Model checkSyntax(InputStream dataset, String baseURI, RDFFormat format) throws IOException, RDFParseException { return Rio.parse(dataset, baseURI, format); }
Source:
public void setControllerMethod(ControllerMethod controllerMethod) { createValuedParameter(controllerMethod); this.controllerMethod = controllerMethod; }

Target:
public void setControllerMethod(ControllerMethod controllerMethod) { this.controllerMethod = controllerMethod; }
Source:
protected void doHandleUploadRequest(final Request request) { if (isDisabled() || isReadOnly()) { throw new SystemException("File widget cannot be updated."); } if (!"POST".equals(request.getMethod())) { throw new SystemException( "File widget cannot be updated by " + request.getMethod() + "."); } FileItem[] items = request.getFileItems(getId()); if (items.length > 1) { throw new SystemException("More than one file item received on the request."); } String fileId = request.getParameter(FILE_UPLOAD_MULTI_PART_ID_KEY); if (fileId == null) { throw new SystemException("No file id provided for file upload."); } FileItemWrap wrap = new FileItemWrap(items[0]); if (isSetFileTypes()) { if (!FileValidationUtil.validateFileType(wrap, getFileTypes())) { String invalidMessage = String.format(I18nUtilities.format(null, InternalMessages.DEFAULT_VALIDATION_ERROR_FILE_WRONG_TYPE), StringUtils.join(getFileTypes().toArray(new Object[getFileTypes().size()]))); throw new SystemException(invalidMessage); } } if (isSetFileSize()) { if (!FileValidationUtil.validateFileSize(wrap, getMaxFileSize())) { String invalidMessage = String.format(I18nUtilities.format(null, InternalMessages.DEFAULT_VALIDATION_ERROR_FILE_WRONG_SIZE), Util.readableFileSize(wrap.getSize()), Util.readableFileSize(getMaxFileSize())); throw new SystemException(invalidMessage); } } FileWidgetUpload file = new FileWidgetUpload(fileId, wrap); addFile(file); setFileUploadRequestId(fileId); setNewUpload(true); }

Target:
protected void doHandleUploadRequest(final Request request) { if (isDisabled() || isReadOnly()) { throw new SystemException("File widget cannot be updated."); } if (!"POST".equals(request.getMethod())) { throw new SystemException( "File widget cannot be updated by " + request.getMethod() + "."); } FileItem[] items = request.getFileItems(getId()); if (items.length > 1) { throw new SystemException("More than one file item received on the request."); } String fileId = request.getParameter(FILE_UPLOAD_MULTI_PART_ID_KEY); if (fileId == null) { throw new SystemException("No file id provided for file upload."); } FileItemWrap wrap = new FileItemWrap(items[0]); if (hasFileTypes() && !FileUtil.validateFileType(wrap, getFileTypes())) { String invalidMessage = FileUtil.getInvalidFileTypeMessage(getFileTypes()); throw new SystemException(invalidMessage); } if (hasMaxFileSize() && !FileUtil.validateFileSize(wrap, getMaxFileSize())) { String invalidMessage = FileUtil.getInvalidFileSizeMessage(getMaxFileSize()); throw new SystemException(invalidMessage); } FileWidgetUpload file = new FileWidgetUpload(fileId, wrap); addFile(file); setFileUploadRequestId(fileId); setNewUpload(true); }
Source:
public void testApplicationConfiguredInConfigDropins() throws Exception { File in = new File(CONFIG_DROPINS_XML); FileInputStream input = new FileInputStream(in); DocumentBuilderFactory inputBuilderFactory = DocumentBuilderFactory.newInstance(); inputBuilderFactory.setIgnoringComments(true); inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input); XPath xPath = XPathFactory.newInstance().newXPath(); String expression = "/server/webApplication"; NodeList nodes = (NodeList) xPath.compile(expression).evaluate(inputDoc, XPathConstants.NODESET); Assert.assertEquals("Number of <webApplication/> element ==>", 1, nodes.getLength()); Node node = nodes.item(0); Element element = (Element)node; Assert.assertEquals("Value of the 1st <webApplication/> ==>", "test-war.war", element.getAttribute("location")); }

Target:
public void testApplicationConfiguredInConfigDropins() throws Exception { File in = new File(CONFIG_DROPINS_XML); FileInputStream input = new FileInputStream(in); DocumentBuilderFactory inputBuilderFactory = DocumentBuilderFactory.newInstance(); inputBuilderFactory.setIgnoringComments(true); inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input); XPath xPath = XPathFactory.newInstance().newXPath(); String expression = "/server/webApplication"; NodeList nodes = (NodeList) xPath.compile(expression).evaluate(inputDoc, XPathConstants.NODESET); assertEquals("Number of <webApplication/> element ==>", 1, nodes.getLength()); Node node = nodes.item(0); Element element = (Element)node; assertEquals("Value of the 1st <webApplication/> ==>", "test-war.war", element.getAttribute("location")); }
Source:
public void testListContainersByName() throws IOException { respondWith(CONTAINERS_JSON); List<? extends Container> list = osv3().barbican().containers().list("test-container"); assertEquals(list.size(), 1); }

Target:
public void testListContainersByName() throws IOException { respondWith(CONTAINERS_JSON); List<? extends Container> list = osv3().barbican().containers().list("test-container"); assertEquals(list.size(), 1); assertEquals(list.get(0).getName(), containerName); }
Source:
protected void activate(ComponentContext ctxt) { try { BundleContext bundleCtx = ctxt.getBundleContext(); TenantManagementListener idPMgtTenantMgtListener = new TenantManagementListener(); ServiceRegistration tenantMgtListenerSR = bundleCtx.registerService( TenantMgtListener.class.getName(), idPMgtTenantMgtListener, null); if (tenantMgtListenerSR != null) { log.debug("Identity Provider Management - TenantMgtListener registered"); } else { log.error("Identity Provider Management - TenantMgtListener could not be registered"); } ServiceRegistration userOperationListenerSR = bundleCtx.registerService( UserOperationEventListener.class.getName(), new UserStoreListener(), null); if (userOperationListenerSR != null) { log.debug("Identity Provider Management - UserOperationEventListener registered"); } else { log.error("Identity Provider Management - UserOperationEventListener could not be registered"); } ServiceRegistration auditLoggerSR = bundleCtx.registerService(IdentityProviderMgtListener.class.getName() , new IDPMgtAuditLogger(), null); if(auditLoggerSR != null) { log.debug("Identity Provider Management - Audit Logger registered"); } else { log.error("Identity Provider Management - Error while registering Audit Logger"); } setIdentityProviderMgtListenerService(new IdPMgtValidationListener()); buildFileBasedIdPList(); cleanUpRemovedIdps(); log.debug("Identity Provider Management bundle is activated"); } catch (Throwable e) { log.error("Error while activating Identity Provider Management bundle", e); } }

Target:
protected void activate(ComponentContext ctxt) { try { BundleContext bundleCtx = ctxt.getBundleContext(); TenantManagementListener idPMgtTenantMgtListener = new TenantManagementListener(); ServiceRegistration tenantMgtListenerSR = bundleCtx.registerService( TenantMgtListener.class.getName(), idPMgtTenantMgtListener, null); if (tenantMgtListenerSR != null) { log.debug("Identity Provider Management - TenantMgtListener registered"); } else { log.error("Identity Provider Management - TenantMgtListener could not be registered"); } ServiceRegistration userOperationListenerSR = bundleCtx.registerService( UserOperationEventListener.class.getName(), new UserStoreListener(), null); if (userOperationListenerSR != null) { log.debug("Identity Provider Management - UserOperationEventListener registered"); } else { log.error("Identity Provider Management - UserOperationEventListener could not be registered"); } setIdentityProviderMgtListenerService(new IdPMgtValidationListener()); buildFileBasedIdPList(); cleanUpRemovedIdps(); log.debug("Identity Provider Management bundle is activated"); } catch (Throwable e) { log.error("Error while activating Identity Provider Management bundle", e); } }
Source:
protected void ensureValuesCapacity(int capacity, boolean includeNulls) { if (values == null) { values = new int[capacity]; } else if (values == null || values.length < capacity) { values = resize(values, capacity); if (valueIsNull != null) { valueIsNull = resize(valueIsNull, capacity); } } if (includeNulls && valueIsNull == null) { valueIsNull = new boolean[values.length]; } }

Target:
protected void ensureValuesCapacity(int capacity, boolean includeNulls) { if (values == null || values.length < capacity) { values = resize(values, capacity); if (valueIsNull != null) { valueIsNull = resize(valueIsNull, capacity); } } if (includeNulls && valueIsNull == null) { valueIsNull = new boolean[values.length]; } }
Source:
public static SSLContext createSslContext(Map<String, PemX509Certificate> trustCertificatesByAlias) { TrustManager[] trustManagers = createTrustManagers(trustCertificatesByAlias); try { SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(new KeyManager[]{}, trustManagers, null); return sslContext; } catch (GeneralSecurityException e) { throw Throwables.propagate(e); } }

Target:
public static SSLContext createSslContext(Map<String, PemX509Certificate> trustCertificatesByAlias) { TrustManager[] trustManagers = createTrustManagers(trustCertificatesByAlias); return createSslContext(trustManagers, new KeyManager[]{}); }
Source:
public PollingLookup( long pollPeriodMs, DataFetcher dataFetcher, PollingCacheFactory cacheFactory ) { this.pollPeriodMs = pollPeriodMs; this.dataFetcher = Preconditions.checkNotNull(dataFetcher); this.cacheFactory = cacheFactory == null ? new OnHeapPollingCache.OnHeapPollingCacheProvider() : cacheFactory; refOfCacheKeeper.set(new CacheRefKeeper(this.cacheFactory.makeOf(dataFetcher.fetchAll()))); if (pollPeriodMs > 0) { scheduledExecutorService = MoreExecutors.listeningDecorator(Executors.newSingleThreadScheduledExecutor( Execs.makeThreadFactory("PollingLookup-" + id, Thread.MIN_PRIORITY) )); pollFuture = scheduledExecutorService.scheduleAtFixedRate( pollAndSwap(), pollPeriodMs, pollPeriodMs, TimeUnit.MILLISECONDS ); } else { scheduledExecutorService = null; pollFuture = null; } this.isOpen.set(true); }

Target:
public PollingLookup( long pollPeriodMs, DataFetcher dataFetcher, PollingCacheFactory cacheFactory ) { this.pollPeriodMs = pollPeriodMs; this.dataFetcher = Preconditions.checkNotNull(dataFetcher); this.cacheFactory = cacheFactory == null ? new OnHeapPollingCache.OnHeapPollingCacheProvider() : cacheFactory; refOfCacheKeeper.set(new CacheRefKeeper(this.cacheFactory.makeOf(dataFetcher.fetchAll()))); if (pollPeriodMs > 0) { scheduledExecutorService = MoreExecutors.listeningDecorator(Executors.newSingleThreadScheduledExecutor( Execs.makeThreadFactory("PollingLookup-" + id, Thread.MIN_PRIORITY) )); pollFuture = scheduledExecutorService.scheduleWithFixedDelay( pollAndSwap(), pollPeriodMs, pollPeriodMs, TimeUnit.MILLISECONDS ); } else { scheduledExecutorService = null; pollFuture = null; } this.isOpen.set(true); }
Source:
private void configureRatingControls() { if (!replay.getValidity().equals(Validity.VALID)) { showRatingChangeButton.setVisible(false); notRatedReasonLabel.setVisible(true); notRatedReasonLabel.setText(i18n.get("game.reasonNotValid", replay.getValidity())); } else if (!replayService.replayChangedRating(replay)) { showRatingChangeButton.setVisible(false); notRatedReasonLabel.setVisible(true); notRatedReasonLabel.setText(i18n.get("game.notRatedYet")); } else { showRatingChangeButton.setVisible(true); showRatingChangeButton.setDisable(false); notRatedReasonLabel.setVisible(false); } }

Target:
private void configureRatingControls() { if (!replay.getValidity().equals(Validity.VALID)) { showRatingChangeButton.setVisible(false); notRatedReasonLabel.setVisible(true); String reasonText; try { reasonText = i18n.get("game.reasonNotValid", i18n.get(replay.getValidity().getI18nKey())); } catch (NoSuchMessageException e) { reasonText = replay.getValidity().toString(); } notRatedReasonLabel.setText(reasonText); } else if (!replayService.replayChangedRating(replay)) { showRatingChangeButton.setVisible(false); notRatedReasonLabel.setVisible(true); notRatedReasonLabel.setText(i18n.get("game.notRatedYet")); } else { showRatingChangeButton.setVisible(true); showRatingChangeButton.setDisable(false); notRatedReasonLabel.setVisible(false); } }
Source:
public List<ControlPoint> addControlPoints(final ControlPoint... controlPoint) { if (validateControlPointShape()) { return Stream.of(controlPoint) .map(cp -> { double x = cp.getLocation().getX(); double y = cp.getLocation().getY(); addControlPoint(x, y, cp.getIndex() + 1); return cp; }).collect(Collectors.toList()); } refrehControlPoints(); return Collections.emptyList(); }

Target:
public List<ControlPoint> addControlPoints(final ControlPoint... controlPoint) { if (validateControlPointShape()) { final List<ControlPoint> result = Stream.of(controlPoint) .map(cp -> { double x = cp.getLocation().getX(); double y = cp.getLocation().getY(); addControlPoint(x, y, cp.getIndex() + 1); return cp; }).collect(Collectors.toList()); refrehControlPoints(); return result; } return Collections.emptyList(); }
Source:
public ApplicationBasicInfo[] getAllApplicationBasicInfo(String tenantDomain, String username) throws IdentityApplicationManagementException { try { startTenantFlow(tenantDomain, username); ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); ApplicationBasicInfo[] applicationBasicInfos = appDAO.getAllApplicationBasicInfo(); ArrayList<ApplicationBasicInfo> appInfo = new ArrayList<>(); for (ApplicationBasicInfo applicationBasicInfo: applicationBasicInfos) { if (ApplicationMgtUtil.isUserAuthorized(applicationBasicInfo.getApplicationName(), username)) { appInfo.add(applicationBasicInfo); if (log.isDebugEnabled()) { log.debug("Application Name:" + applicationBasicInfo.getApplicationName()); } } } return appInfo.toArray(new ApplicationBasicInfo[appInfo.size()]); } catch (Exception e) { String error = "Error occurred while retrieving all the applications"; throw new IdentityApplicationManagementException(error, e); } finally { endTenantFlow(); } }

Target:
public ApplicationBasicInfo[] getAllApplicationBasicInfo(String tenantDomain, String username) throws IdentityApplicationManagementException { try { startTenantFlow(tenantDomain, username); ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); return appDAO.getAllApplicationBasicInfo(); } catch (Exception e) { String error = "Error occurred while retrieving all the applications"; throw new IdentityApplicationManagementException(error, e); } finally { endTenantFlow(); } }
Source:
Object getValue(Object obj, String attributePath, Object metadata) throws Exception { if (metadata == null) { return getValue(obj, attributePath); } JsonSchemaNode schemaNode = (JsonSchemaNode) metadata; NavigableJsonInputAdapter adapter = annotate(obj); JsonGetterContext queryContext = contextCache.getContext(attributePath); List<WeightedItem<JsonPattern>> patternsSnapshot = queryContext.getPatternListSnapshot(); JsonPathCursor pathCursor = queryContext.newJsonPathCursor(); JsonPattern knownPattern = null; for (int i = 0; i < patternTryCount && i < patternsSnapshot.size(); i++) { WeightedItem<JsonPattern> patternWeightedItem = patternsSnapshot.get(i); knownPattern = patternWeightedItem.getItem(); JsonValue value = JsonSchemaHelper.findValueWithPattern(adapter, schemaNode, knownPattern, pathCursor); pathCursor.reset(); if (value != null) { queryContext.voteFor(patternWeightedItem); return convertFromJsonValue(value); } } knownPattern = JsonSchemaHelper.createPattern(adapter, schemaNode, pathCursor); pathCursor.reset(); if (knownPattern != null) { if (knownPattern.hasAny()) { return getValue(obj, attributePath); } WeightedItem<JsonPattern> weightedItem = queryContext.addPattern(knownPattern); queryContext.voteFor(weightedItem); return convertFromJsonValue(JsonSchemaHelper.findValueWithPattern(adapter, schemaNode, knownPattern, pathCursor)); } return null; }

Target:
Object getValue(Object obj, String attributePath, Object metadata) throws Exception { if (metadata == null) { return getValue(obj, attributePath); } JsonSchemaNode schemaNode = (JsonSchemaNode) metadata; NavigableJsonInputAdapter adapter = annotate(obj); JsonGetterContext queryContext = contextCache.getContext(attributePath); List<WeightedItem<JsonPattern>> patternsSnapshot = queryContext.getPatternListSnapshot(); JsonPathCursor pathCursor = queryContext.newJsonPathCursor(); JsonPattern knownPattern = null; for (int i = 0; i < PATTERN_TRY_COUNT && i < patternsSnapshot.size(); i++) { WeightedItem<JsonPattern> patternWeightedItem = patternsSnapshot.get(i); knownPattern = patternWeightedItem.getItem(); JsonValue value = JsonSchemaHelper.findValueWithPattern(adapter, schemaNode, knownPattern, pathCursor); pathCursor.reset(); if (value != null) { queryContext.voteFor(patternWeightedItem); return convertFromJsonValue(value); } } knownPattern = JsonSchemaHelper.createPattern(adapter, schemaNode, pathCursor); pathCursor.reset(); if (knownPattern != null) { if (knownPattern.hasAny()) { return getValue(obj, attributePath); } queryContext.addOrVoteForPattern(knownPattern); return convertFromJsonValue(JsonSchemaHelper.findValueWithPattern(adapter, schemaNode, knownPattern, pathCursor)); } return null; }
Source:
public void initializeUI(UIBuilder builder) throws Exception { super.initializeUI(builder); idStrategy.setDefaultValue(GenerationType.AUTO); idType.setDefaultValue(EntityIdType.LONG_PROPERTY); idClass.setRequired(new Callable<Boolean>(){ @Override public Boolean call(){ return idType.getValue() == EntityIdType.EMBEDDED_ID; } }); builder.add(idStrategy).add(tableName) .add(idType).add(idClass); }

Target:
public void initializeUI(UIBuilder builder) throws Exception { super.initializeUI(builder); idStrategy.setDefaultValue(GenerationType.AUTO); idType.setDefaultValue(EntityIdType.LONG_PROPERTY); idClass.setRequired(() -> idType.getValue().isClassRequired()); idClass.setValueConverter(new PackageRootConverter(getProjectFactory(), builder)); builder.add(idStrategy).add(tableName) .add(idType).add(idClass); }
Source:
protected Guid getStoragePoolId() { return getDbFacade().getStoragePoolDao().getAllForStorageDomain(getStorageDomainId()).get(0).getId(); }

Target:
protected Guid getStoragePoolId() { return getParameters().getStoragePoolId(); }
Source:
public static void restartJobServiceInterval(Context context, long intervalMillis) { JobScheduler jobScheduler = context.getSystemService(JobScheduler.class); if (jobScheduler != null) { JobInfo oldJob = jobScheduler.getPendingJob(JOB_ID_FEED_UPDATE); if (oldJob == null || oldJob.getIntervalMillis() != intervalMillis) { JobInfo.Builder builder = getFeedUpdateJobBuilder(context); builder.setPeriodic(intervalMillis); jobScheduler.cancel(JOB_ID_FEED_UPDATE); if (intervalMillis <= 0) { Log.d(TAG, "Automatic update was deactivated"); return; } jobScheduler.schedule(builder.build()); Log.d(TAG, "JobScheduler was set at interval " + intervalMillis); } else { Log.d(TAG, "JobScheduler was already set at interval " + intervalMillis + ", ignoring."); } } }

Target:
private static void restartJobServiceInterval(Context context, long intervalMillis) { JobScheduler jobScheduler = context.getSystemService(JobScheduler.class); if (jobScheduler == null) { Log.d(TAG, "JobScheduler was null."); return; } JobInfo oldJob = jobScheduler.getPendingJob(JOB_ID_FEED_UPDATE); if (oldJob != null && oldJob.getIntervalMillis() == intervalMillis) { Log.d(TAG, "JobScheduler was already set at interval " + intervalMillis + ", ignoring."); return; } JobInfo.Builder builder = getFeedUpdateJobBuilder(context); builder.setPeriodic(intervalMillis); jobScheduler.cancel(JOB_ID_FEED_UPDATE); if (intervalMillis <= 0) { Log.d(TAG, "Automatic update was deactivated"); return; } jobScheduler.schedule(builder.build()); Log.d(TAG, "JobScheduler was set at interval " + intervalMillis); }
Source:
private boolean isNestedSingleResourceBinaryModule() { if( module.length > 1 && all.length == 1 && all[0] instanceof IModuleFile) { return true; } return false; }

Target:
private boolean isNestedSingleResourceBinaryModule() { return module.length > 1 && all.length == 1 && all[0] instanceof IModuleFile; }
Source:
public static boolean getOptionAsBoolean(Map<String, String> options, String option, boolean defaultValue) { String value = options.get(option); return value == null ? defaultValue : Boolean.valueOf(value); }

Target:
public static boolean getOptionAsBoolean(Map<String, String> options, String option, boolean defaultValue) { String value = options.get(option); return value == null ? defaultValue : Boolean.parseBoolean(value); }
Source:
public void testValidIsNotHonoredValidateValue() { Validator validator = TestUtil.getValidatorUnderTest(); Customer customer = new Customer(); Order order = new Order(); customer.addOrder( order ); Set<ConstraintViolation<Customer>> constraintViolations = validator.validateValue( Customer.class, "orders", Collections.singleton(order) ); assertNumberOfViolations( constraintViolations, 0 ); }

Target:
public void testValidIsNotHonoredValidateValue() { Validator validator = TestUtil.getValidatorUnderTest(); Order order = new Order(); Set<ConstraintViolation<Customer>> constraintViolations = validator.validateValue( Customer.class, "orders", Collections.singleton(order) ); assertNumberOfViolations( constraintViolations, 0 ); }
Source:
public int hashCode() { final int prime = 31; int result = 1; final Packet child = fChildPacket; result = child != null ? prime * result + child.hashCode() : prime * result; result = prime * result + fPayload.hashCode(); return result; }

Target:
public int hashCode() { final int prime = 31; int result = prime; final Packet child = fChildPacket; if (child != null) { result += child.hashCode(); } result = prime * result + fPayload.hashCode(); return result; }
Source:
public void testCountry() { assertEquals( "country.getCountry().isInEuropeanUnion() does not return false", false, this.country.getCountry().isInEuropeanUnion()); assertEquals("country.getCountry().getCode() does not return US", "US", this.country.getCountry().getIsoCode()); assertEquals("country.getCountry().getGeoNameId() does not return 1", 1, (int) this.country.getCountry().getGeoNameId()); assertEquals("country.getCountry().getConfidence() does not return 56", new Integer(56), this.country.getCountry().getConfidence()); assertEquals( "country.getCountry().getName(\"en\") does not return United States", "United States", this.country.getCountry().getName()); }

Target:
public void testCountry() { assertFalse( "country.getCountry().isInEuropeanUnion() does not return false", this.country.getCountry().isInEuropeanUnion()); assertEquals("country.getCountry().getCode() does not return US", "US", this.country.getCountry().getIsoCode()); assertEquals("country.getCountry().getGeoNameId() does not return 1", 1, (int) this.country.getCountry().getGeoNameId()); assertEquals("country.getCountry().getConfidence() does not return 56", new Integer(56), this.country.getCountry().getConfidence()); assertEquals( "country.getCountry().getName(\"en\") does not return United States", "United States", this.country.getCountry().getName()); }
Source:
public String getColumnText(Object aObj, int aIndex) { if (aObj instanceof ChangeInfo) { ChangeInfo reviewSummary = (ChangeInfo) aObj; switch (aIndex) { case 0: Boolean starred = reviewSummary.isStarred(); return starred.toString(); case 1: return Integer.toString(reviewSummary.get_number()); case 2: return reviewSummary.getSubject(); case 3: String attribute = reviewSummary.getStatus().toString(); return attribute; case 4: return reviewSummary.getOwner().getName(); case 5: return reviewSummary.getProject(); case 6: String branch = reviewSummary.getBranch(); String topic = reviewSummary.getTopic(); if (topic != null && !topic.isEmpty()) { branch += " (" + topic + ")"; } return branch; case 7: { java.util.Date date = null; try { date = formatTimeOut.parse(reviewSummary.getUpdated()); } catch (ParseException e) { EGerritCorePlugin.logError(e.getMessage()); } if (date.before(Calendar.getInstance().getTime())) { return Utils.formatDate(reviewSummary.getUpdated(), shortFormatTimeOut); } else { return Utils.formatDate(reviewSummary.getUpdated(), formatTimeOut); } } case 8: { fCodeReviewState = Utils.verifyTally((CODE_REVIEW), reviewSummary.getLabels()); return EMPTY_STRING; } case 9: { fVerifyState = Utils.verifyTally((VERIFIED), reviewSummary.getLabels()); return EMPTY_STRING; } default: return EMPTY_STRING; } } return EMPTY_STRING; }

Target:
public String getColumnText(Object aObj, int aIndex) { if (aObj instanceof ChangeInfo) { ChangeInfo reviewSummary = (ChangeInfo) aObj; switch (aIndex) { case 0: Boolean starred = reviewSummary.isStarred(); return starred.toString(); case 1: return Integer.toString(reviewSummary.get_number()); case 2: return reviewSummary.getSubject(); case 3: String attribute = reviewSummary.getStatus().toString(); return attribute; case 4: return reviewSummary.getOwner().getName(); case 5: return reviewSummary.getProject(); case 6: String branch = reviewSummary.getBranch(); String topic = reviewSummary.getTopic(); if (topic != null && !topic.isEmpty()) { branch += " (" + topic + ")"; } return branch; case 7: { java.util.Date date = null; try { date = formatTimeOut.parse(reviewSummary.getUpdated()); } catch (ParseException e) { EGerritCorePlugin.logError(e.getMessage()); } boolean sameDay = DateUtils.isSameDay(date, Calendar.getInstance().getTime()); Calendar today = Calendar.getInstance(); Calendar currentReview = Calendar.getInstance(); currentReview.setTime(date); if (sameDay) { return Utils.formatDate(reviewSummary.getUpdated(), sameDayFormatTimeOut); } else if (today.get(Calendar.YEAR) != currentReview.get(Calendar.YEAR)) { return Utils.formatDate(reviewSummary.getUpdated(), differentYearFormatTimeOut); } else { return Utils.formatDate(reviewSummary.getUpdated(), sameYearFormatTimeOut); } } case 8: { fCodeReviewState = Utils.verifyTally((CODE_REVIEW), reviewSummary.getLabels()); return EMPTY_STRING; } case 9: { fVerifyState = Utils.verifyTally((VERIFIED), reviewSummary.getLabels()); return EMPTY_STRING; } default: return EMPTY_STRING; } } return EMPTY_STRING; }
Source:
public void setCurrentFont(String fontName) { currentFont = fonts.get(fontName); if (currentFont != null) Timber.i("Font Selected: %s", fontName); else Timber.e("Couldn't select font: %s", fontName); }

Target:
public void setCurrentFont(String fontName) { currentFont = fonts.get(fontName); if (currentFont != null) Timber.i("Font Selected: %s", fontName); else Timber.w("Couldn't select font: %s", fontName); }