auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void runReadRequest(OpcUaRequestInfo requestInfo) { ChannelRecord record = requestInfo.driverRecord; final NodeId nodeId = new NodeId(requestInfo.nodeNamespaceIndex, requestInfo.nodeId); final VariableNode node = this.client.getAddressSpace().createVariableNode(nodeId); Object readResult = null; try { logger.debug("reading: ns={};s={}..", requestInfo.nodeNamespaceIndex, requestInfo.nodeId); readResult = extractValue(runSafe(node.readValue())); logger.debug("Read Successful"); } catch (final Exception e) { record.setChannelStatus(new ChannelStatus(ChannelFlag.FAILURE, message.readFailed(), e)); record.setTimestamp(System.currentTimeMillis()); logger.warn(message.readFailed(), e); return; } final Optional<TypedValue<?>> typedValue = this.getTypedValue(requestInfo.dataType, readResult); if (!typedValue.isPresent()) { record.setChannelStatus(new ChannelStatus(FAILURE, message.errorValueTypeConversion(), null)); record.setTimestamp(System.currentTimeMillis()); return; } record.setValue(typedValue.get()); record.setChannelStatus(new ChannelStatus(SUCCESS)); record.setTimestamp(System.currentTimeMillis()); }

Target:
private void runReadRequest(OpcUaRequestInfo requestInfo) { ChannelRecord record = requestInfo.channelRecord; final NodeId nodeId = new NodeId(requestInfo.nodeNamespaceIndex, requestInfo.nodeId); final VariableNode node = this.client.getAddressSpace().createVariableNode(nodeId); Object readResult = null; try { logger.debug("reading: ns={};s={}..", requestInfo.nodeNamespaceIndex, requestInfo.nodeId); readResult = extractValue(runSafe(node.readValue())); logger.debug("Read Successful"); } catch (final Exception e) { record.setChannelStatus(new ChannelStatus(ChannelFlag.FAILURE, message.readFailed(), e)); record.setTimestamp(System.currentTimeMillis()); logger.warn(message.readFailed(), e); return; } final Optional<TypedValue<?>> typedValue = this.getTypedValue(requestInfo.dataType, readResult); if (!typedValue.isPresent()) { record.setChannelStatus(new ChannelStatus(FAILURE, message.errorValueTypeConversion(), null)); record.setTimestamp(System.currentTimeMillis()); return; } record.setValue(typedValue.get()); record.setChannelStatus(new ChannelStatus(SUCCESS)); record.setTimestamp(System.currentTimeMillis()); }
Source:
private static void collectRecursivelyAllLegalChildren(VirtualFile currentDir, String currentPrefix, Map<String, VirtualFile> nameToFiles) throws IOException { if (currentDir.isFile()) { if (currentDir.isDescendant("")) { nameToFiles.put(currentPrefix, currentDir); } } else { if (!currentPrefix.isEmpty()) { currentPrefix += "/"; } List<VirtualFile> children = currentDir.listOnlyDescendants(); for (int i = 0; i < children.size(); i++) { VirtualFile child = children.get(i); collectRecursivelyAllLegalChildren(child, currentPrefix + child.getName(), nameToFiles); } } }

Target:
private static void collectRecursivelyAllLegalChildren(VirtualFile currentDir, String currentPrefix, Map<String, VirtualFile> nameToFiles) throws IOException { if (currentDir.isFile()) { if (currentDir.isDescendant("")) { nameToFiles.put(currentPrefix, currentDir); } } else { if (!currentPrefix.isEmpty()) { currentPrefix += "/"; } List<VirtualFile> children = currentDir.listOnlyDescendants(); for (VirtualFile child : children) { collectRecursivelyAllLegalChildren(child, currentPrefix + child.getName(), nameToFiles); } } }
Source:
public static Object[][] adsVelesTracking() { final String TURN_ON_VELES = "?InstantGlobals.wgAdDriverVelesBidderCountries=[XX]"; return new Object[][]{ { new Page(WIKI_SPECIAL, "SyntheticTests/RTB/Prebid.js/Veles/Both/Leaderboard" + TURN_ON_VELES), ImmutableMap.builder() .put(AdsContent.TOP_LB, "20.00") .put(AdsContent.INCONTENT_PLAYER, "USED") .build() }, { new Page(WIKI_SPECIAL, "SyntheticTests/RTB/Prebid.js/Veles" + TURN_ON_VELES), ImmutableMap.builder() .put(AdsContent.TOP_LB, "20.00") .put(AdsContent.INCONTENT_PLAYER, "20.00") .build() }, { new Page(WIKI_SPECIAL, "Project43_Wikia" + TURN_ON_VELES), ImmutableMap.builder() .put(AdsContent.TOP_LB, "0.00") .build() }, { new Page(WIKI_SPECIAL, "SyntheticTests/RTB/Prebid.js/Veles/Incontent" + TURN_ON_VELES), ImmutableMap.builder() .put(AdsContent.TOP_LB, "NOT_INVOLVED") .put(AdsContent.INCONTENT_PLAYER, "20.00") .build() }, { new Page(WIKI_SPECIAL, "SyntheticTests/RTB/Prebid.js/Veles/Leaderboard" + TURN_ON_VELES), ImmutableMap.builder() .put(AdsContent.TOP_LB, "20.00") .put(AdsContent.INCONTENT_PLAYER, "NOT_INVOLVED") .build() } }; }

Target:
public static Object[][] adsVelesTracking() { return new Object[][]{ { new Page(WIKI_SPECIAL, "SyntheticTests/RTB/Prebid.js/Veles?" + AdsVeles.TURN_ON_QUERY_PARAM), ImmutableMap.builder() .put(AdsContent.TOP_LB, "20.00") .put(AdsContent.INCONTENT_PLAYER, "20.00") .build() }, { new Page(WIKI_SPECIAL, "SyntheticTests/RTB/Prebid.js/Veles/Incontent?" + AdsVeles.TURN_ON_QUERY_PARAM), ImmutableMap.builder() .put(AdsContent.TOP_LB, "NOT_INVOLVED") .put(AdsContent.INCONTENT_PLAYER, "20.00") .build() }, { new Page(WIKI_SPECIAL, "SyntheticTests/RTB/Prebid.js/Veles/Leaderboard?" + AdsVeles.TURN_ON_QUERY_PARAM), ImmutableMap.builder() .put(AdsContent.TOP_LB, "20.00") .put(AdsContent.INCONTENT_PLAYER, "NOT_INVOLVED") .build() } }; }
Source:
public static boolean isSelectTextTutorialEnabled() { return !getBoolean(R.string.preference_key_select_text_tutorial_enabled, false); }

Target:
public static boolean isSelectTextTutorialEnabled() { return getBoolean(R.string.preference_key_select_text_tutorial_enabled, true); }
Source:
public int compareTo(MacOsVersion o) { int compareTo = Integer.valueOf(fMajorVersion).compareTo(o.getMajorVersion()); if (compareTo != 0) { return compareTo; } compareTo = Integer.valueOf(fMinorVersion).compareTo(o.getMinorVersion()); if (compareTo != 0) { return compareTo; } return Integer.valueOf(fBugFixVersion).compareTo(o.getBugFixVersion()); }

Target:
public int compareTo(MacOsVersion o) { int compareTo = Integer.compare(fMajorVersion, o.getMajorVersion()); if (compareTo != 0) { return compareTo; } compareTo = Integer.compare(fMinorVersion, o.getMinorVersion()); if (compareTo != 0) { return compareTo; } return Integer.compare(fBugFixVersion, o.getBugFixVersion()); }
Source:
public TestHiveDistributedQueriesWithOptimizedRepartitioning() { super(() -> HiveQueryRunner.createQueryRunner( getTables(), ImmutableMap.of("experimental.optimized-repartitioning", "true", "driver.max-page-partitioning-buffer-size", "200B"), Optional.empty())); }

Target:
public TestHiveDistributedQueriesWithOptimizedRepartitioning() { super(() -> HiveQueryRunner.createQueryRunner( getTables(), ImmutableMap.of( "experimental.optimized-repartitioning", "true", "driver.max-page-partitioning-buffer-size", "10000B"), Optional.empty())); }
Source:
void call(Metric<T> dataPoint) throws IOException; } private final HttpServletRequest request; private final HttpServletResponse response; private final JsonGenerator generator; private final ObjectMapper mapper; private AtomicInteger count; private final ByteArrayOutputStream jsonOutputStream; private volatile Metric<T> current; public MetricObserver(HttpServletRequest request, HttpServletResponse response, ObjectMapper mapper) { this.request = request; this.response = response; this.mapper = mapper; count = new AtomicInteger(); jsonOutputStream = new ByteArrayOutputStream(); try { generator = mapper.getFactory().createGenerator(response.getOutputStream(), JsonEncoding.UTF8); generator.writeStartArray(); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
void call(Metric<T> dataPoint) throws IOException; } private final AsyncContext asyncContext; private final HttpServletRequest request; private final HttpServletResponse response; private final JsonGenerator generator; private final ObjectMapper mapper; private AtomicInteger count; private volatile Metric<T> current; public MetricObserver(AsyncContext asyncContext, ObjectMapper mapper, String extraAccesControlAllowHeaders) { this.asyncContext = asyncContext; request = (HttpServletRequest) asyncContext.getRequest(); response = (HttpServletResponse) asyncContext.getResponse(); this.mapper = mapper; count = new AtomicInteger(); setCorsHeaders(extraAccesControlAllowHeaders); try { generator = mapper.getFactory().createGenerator(response.getOutputStream(), JsonEncoding.UTF8); generator.writeStartArray(); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public IAtsProgram getProgram(IAtsWorkItem workItem) { return null; }

Target:
public IAtsProgram getProgram(IAtsWorkItem workItem) { throw new UnsupportedOperationException("Not implemented yet"); }
Source:
private Topic getOrCreateTopic(MessageID messageId) throws JMSException { Topic topic = topicCache.get(messageId.getId()); if (topic == null) { topic = session.createTopic(messageId.getId()); Topic catchReturn = topicCache.putIfAbsent(messageId.getId(), topic); } return topic; }

Target:
private Topic getOrCreateTopic(MessageID messageId) throws JMSException { Topic topic = topicCache.get(messageId.getId()); if (topic == null) { topic = session.createTopic(messageId.getId()); topicCache.put(messageId.getId(), topic); } return topic; }
Source:
@Override public @Nullable IStrategoTerm invoke(ILanguageImpl impl, FileObject location, IStrategoTerm input, String strategy) throws MetaborgException { List<MetaborgException> exceptions = Lists.newArrayList(); for(ILanguageComponent component : impl.components()) { if(component.facet(DynamicClassLoadingFacet.class) == null) { continue; } final HybridInterpreter runtime = strategoRuntimeService.runtime(component, location, true); try { final IStrategoTerm result = invoke(runtime, input, strategy); return result; } catch(MetaborgException ex) { exceptions.add(ex); } } throw new AggregateMetaborgException(exceptions); }

Target:
@Override public @Nullable IStrategoTerm invoke(ILanguageImpl impl, FileObject location, IStrategoTerm input, String strategy) throws MetaborgException { List<MetaborgException> exceptions = Lists.newArrayList(); for(ILanguageComponent component : impl.components()) { if(!IStrategoCommon.hasStrategoFacets(component)) { continue; } final HybridInterpreter runtime = strategoRuntimeService.runtime(component, location, true); try { final IStrategoTerm result = invoke(runtime, input, strategy); return result; } catch(MetaborgException ex) { exceptions.add(ex); } } throw new AggregateMetaborgException(exceptions); }
Source:
public void onCreate() { super.onCreate(); OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE); String appId = OneSignalPrefs.getOneSignalAppId(this); if (appId == null) { appId = "380dc082-5231-4cc2-ab51-a03da5a0e4c2"; OneSignalPrefs.cacheOneSignalAppId(this, appId); } OneSignal.setAppId(appId); OneSignal.setAppContext(this); OneSignal.unsubscribeWhenNotificationsAreDisabled(true); OneSignal.setInFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification); OneSignal.pauseInAppMessages(true); Log.d(Tag.DEBUG, Text.ONESIGNAL_SDK_INIT); }

Target:
public void onCreate() { super.onCreate(); OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE); String appId = OneSignalPrefs.getOneSignalAppId(this); if (appId == null) { appId = "380dc082-5231-4cc2-ab51-a03da5a0e4c2"; OneSignalPrefs.cacheOneSignalAppId(this, appId); } OneSignal.setAppId(appId); OneSignal.setAppContext(this); OneSignal.setInFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification); OneSignal.pauseInAppMessages(true); Log.d(Tag.DEBUG, Text.ONESIGNAL_SDK_INIT); }
Source:
public void customClassPrefixAndSuffixNoJavaType() throws ClassNotFoundException { ClassLoader resultsClassLoader = generateAndCompile("/schema/properties/primitivePropertiesNoJavaType.json", "com.example", config("classNamePrefix", "prefix", "classNameSuffix","Suffix")); resultsClassLoader.loadClass("com.example.PrefixprimitivePropertiesNoJavaTypeSuffix"); }

Target:
public void customClassPrefixAndSuffixNoJavaType() throws ClassNotFoundException { ClassLoader resultsClassLoader = generateAndCompile("/schema/properties/primitivePropertiesNoJavaType.json", "com.example", config("classNamePrefix", "Prefix", "classNameSuffix","Suffix")); resultsClassLoader.loadClass("com.example.PrefixPrimitivePropertiesNoJavaTypeSuffix"); }
Source:
public void testBucketOneSizeThreeBucketTwoSizeFiveStartWithOne() { TwoBucket twoBucket = new TwoBucket(3, 5, 1, "one"); assertEquals(twoBucket.getTotalMoves(), 4); assertEquals(twoBucket.getFinalBucket(), "one"); assertEquals(twoBucket.getOtherBucket(), 5); }

Target:
public void testBucketOneSizeThreeBucketTwoSizeFiveStartWithOne() { TwoBucket twoBucket = new TwoBucket(3, 5, 1, "one"); assertEquals(4, twoBucket.getTotalMoves()); assertEquals("one", twoBucket.getFinalBucket()); assertEquals(5, twoBucket.getOtherBucket()); }
Source:
public EncoderDecoderFactoryBean(Encoding encoding) { this.encoding = encoding; }

Target:
public EncoderDecoderFactoryBean(Encoding encoding) { Assert.notNull(encoding, "'encoding' cannot be null"); this.encoding = encoding; }
Source:
public Fragment getItem(int i) { Patient patient = new PatientDAO().findPatientByID(mPatientId); switch (i) { case DETAILS_TAB_POS: PatientDetailsFragment patientDetailsFragment = PatientDetailsFragment.newInstance(patient .getPerson() .getName() .getNameString(), patient.getIdentifier().getIdentifier(), patient.getId()); new PatientDashboardDetailsPresenter(mPatientId, patientDetailsFragment); return patientDetailsFragment; case DIAGNOSIS_TAB_POS: PatientDiagnosisFragment patientDiagnosisFragment = PatientDiagnosisFragment.newInstance(); new PatientDashboardDiagnosisPresenter(mPatientId, patientDiagnosisFragment); return patientDiagnosisFragment; case VISITS_TAB_POS: PatientVisitsFragment patientVisitsFragment = PatientVisitsFragment.newInstance(); new PatientDashboardVisitsPresenter(mPatientId, patientVisitsFragment); return patientVisitsFragment; case VITALS_TAB_POS: PatientVitalsFragment patientVitalsFragment = PatientVitalsFragment.newInstance(); new PatientDashboardVitalsPresenter(mPatientId, patientVitalsFragment); return patientVitalsFragment; default: return null; } }

Target:
public Fragment getItem(int i) { switch (i) { case DETAILS_TAB_POS: PatientDetailsFragment patientDetailsFragment = PatientDetailsFragment.newInstance(); new PatientDashboardDetailsPresenter(mPatientId, patientDetailsFragment); return patientDetailsFragment; case DIAGNOSIS_TAB_POS: PatientDiagnosisFragment patientDiagnosisFragment = PatientDiagnosisFragment.newInstance(); new PatientDashboardDiagnosisPresenter(mPatientId, patientDiagnosisFragment); return patientDiagnosisFragment; case VISITS_TAB_POS: PatientVisitsFragment patientVisitsFragment = PatientVisitsFragment.newInstance(); new PatientDashboardVisitsPresenter(mPatientId, patientVisitsFragment); return patientVisitsFragment; case VITALS_TAB_POS: PatientVitalsFragment patientVitalsFragment = PatientVitalsFragment.newInstance(); new PatientDashboardVitalsPresenter(mPatientId, patientVitalsFragment); return patientVitalsFragment; default: return null; } }
Source:
private <T> Sequence<T> runQuery(final Query<T> query) { Hook.QUERY_PLAN.run(query); return queryLifecycleFactory.factorize().runSimple(query, null, null, null, false); }

Target:
private <T> Sequence<T> runQuery(final Query<T> query) { Hook.QUERY_PLAN.run(query); final AuthenticationResult authenticationResult = plannerContext.getAuthenticationResult(); return queryLifecycleFactory.factorize().runSimple(query, authenticationResult, null); }
Source:
private boolean doSave(String path, String fileType, String encoding, ProgressIndicator progress) { boolean didSave = false; try { didSave = doSaveImpl(path, fileType, encoding, progress); } catch (Exception ex) { Debug.log("Exception occurred during save: "); Debug.logException(ex); if (progress != null) { progress.onError("Could not save " + path + ": " + ex.getMessage()); } } final boolean saved = didSave; Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { if (!saved) return; if (docDisplay_.isVimModeOn()) { String oldMarksSpec = ""; if (hasProperty("marks")) oldMarksSpec = getProperty("marks"); String newMarksSpec = VimMarks.encode(docDisplay_.getMarks()); if (!oldMarksSpec.equals(newMarksSpec)) setProperty("marks", newMarksSpec); } String oldRangeSpec = ""; if (hasProperty("selection")) oldRangeSpec = getProperty("selection"); String newRangeSpec = Range.encode(docDisplay_.getSelectionRange()); if (!oldRangeSpec.equals(newRangeSpec)) setProperty("selection", newRangeSpec); } }); return saved; }

Target:
private boolean doSave(String path, String fileType, String encoding, ProgressIndicator progress) { boolean didSave = false; try { didSave = doSaveImpl(path, fileType, encoding, progress); } catch (Exception ex) { Debug.log("Exception occurred during save: "); Debug.logException(ex); if (progress != null) { progress.onError("Could not save " + path + ": " + ex.getMessage()); } } return didSave; }
Source:
public void onStockMediaListFetched(StockMediaStore.OnStockMediaListFetched event) { mIsFetching = false; showProgress(false); if (event.isError()) { AppLog.e(AppLog.T.MEDIA, "An error occurred while searching stock media"); mCanLoadMore = false; return; } if (mSearchQuery == null || !mSearchQuery.equals(event.searchTerm)) { return; } mNextPage = event.nextPage; mCanLoadMore = event.canLoadMore; if (event.nextPage == 2) { mAdapter.setMediaList(event.mediaList); } else { mAdapter.addMediaList(event.mediaList); } showEmptyView(mAdapter.isEmpty() && !TextUtils.isEmpty(mSearchQuery)); }

Target:
public void onStockMediaListFetched(StockMediaStore.OnStockMediaListFetched event) { if (mSearchQuery == null || !mSearchQuery.equals(event.searchTerm)) { return; } mIsFetching = false; showProgress(false); if (event.isError()) { AppLog.e(AppLog.T.MEDIA, "An error occurred while searching stock media"); ToastUtils.showToast(this, R.string.media_generic_error); mCanLoadMore = false; return; } mNextPage = event.nextPage; mCanLoadMore = event.canLoadMore; if (event.nextPage == 2) { mAdapter.setMediaList(event.mediaList); } else { mAdapter.addMediaList(event.mediaList); } showEmptyView(mAdapter.isEmpty() && !TextUtils.isEmpty(mSearchQuery)); }
Source:
public void visitReturnStatement(ReturnStatementTree tree) { if (isWithinCallingMethodBody(tree) && returnsIntegerMinValue(tree.expression())) { addIssue(tree, "Simply return -1"); } super.visitReturnStatement(tree); }

Target:
public void visitReturnStatement(ReturnStatementTree tree) { if (returnsIntegerMinValue(tree.expression())) { addIssue(tree, "Simply return -1"); } }
Source:
public boolean isRetryable(int statusCode) { if (statusCode == 400) { logger.info("No data retrieved."); return true; } else if (statusCode == 401) { logger.info("Authentication failure: invalid login credentials. Check logs for details."); return false; } else if (statusCode == 403) { logger.info("Authorization failure or invalid license. Check logs for details."); return false; } else if (statusCode == 404) { logger.info("Endpoint does not exist."); return true; } else if (statusCode > 500 && statusCode < 600) { logger.info("Unrecoverable server error."); return true; } return false; }

Target:
public boolean isRetryable(int statusCode) { if (statusCode == 400) { logger.info("No data retrieved."); return true; } else if (statusCode == 401) { logger.info("Authentication failure: invalid login credentials. Check logs for details."); return false; } else if (statusCode == 403) { logger.info("Authorization failure or invalid license. Check logs for details."); return false; } else if (statusCode == 404) { logger.info("Endpoint does not exist."); return true; } else if (statusCode >= 500 && statusCode < 600) { logger.info("Unrecoverable server error."); return true; } return false; }
Source:
private void saveToDb(AuditLogableBase auditLogable, AuditLogType logType, String loggerString) { AuditLogSeverity severity = logType.getSeverity(); AuditLog auditLog = createAuditLog(auditLogable, logType, loggerString, severity); if (auditLog == null) { log.warn("Unable to create AuditLog"); } else { setPropertiesFromAuditLogableBase(auditLogable, auditLog); try { getDbFacadeInstance().getAuditLogDao().save(auditLog); } catch (Exception ex) { log.error("Unable to save audit log : to database : {}", getMessageToLog(loggerString, auditLog), ex.getMessage()); } logMessage(severity, getMessageToLog(loggerString, auditLog)); } }

Target:
private void saveToDb(AuditLogableBase auditLogable, AuditLogType logType, String loggerString) { AuditLogSeverity severity = logType.getSeverity(); AuditLog auditLog = createAuditLog(auditLogable, logType, loggerString, severity); if (auditLog == null) { log.warn("Unable to create AuditLog"); } else { setPropertiesFromAuditLogableBase(auditLogable, auditLog); getDbFacadeInstance().getAuditLogDao().save(auditLog); logMessage(severity, getMessageToLog(loggerString, auditLog)); } }
Source:
public Optional<List<String>> getDefaultFieldPhrases() { return Optional.ofNullable(defaultField); }

Target:
public List<String> getDefaultFieldPhrases() { return defaultField; }
Source:
private String getApplication() { String application = "Talend-"; if (!StringUtils.isEmpty(talendProductVersion)) { application += talendProductVersion; } return application; }

Target:
private String getApplication() { StringBuilder application = new StringBuilder(); application.append("Talend"); if (StringUtils.isNotEmpty(talendProductVersion)) { application.append('-'); application.append(talendProductVersion); } return application.toString(); }
Source:
public synchronized boolean registerConnection(L2GameClient client) { if (ConfigData.DUALBOX_PROTECTION_ENABLED) { IpPack pack = new IpPack(client.getConnection().getInetAddress().getHostAddress(), client.getTrace()); Integer count = _address.get(pack); if (count == null) { _address.put(pack, count = 1); } if (count < ConfigData.DUALBOX_MAX_ALLOWED) { _address.put(pack, count =+ 1); } else { _address.put(pack, count =+ 0); return false; } } return true; }

Target:
public synchronized boolean registerConnection(L2GameClient client) { if (ConfigData.DUALBOX_PROTECTION_ENABLED) { try { IpPack pack = new IpPack(client.getConnection().getInetAddress().getHostAddress(), client.getTrace()); Integer count = _address.get(pack) == null ? 0 : _address.get(pack); if (count < ConfigData.DUALBOX_MAX_ALLOWED) { _address.put(pack, count =+ 1); return true; } } catch (Exception e) { e.printStackTrace(); } } return false; }
Source:
public RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final RevCommit r = pending.next(); if (r == null) return null; if ((r.flags & UNINTERESTING) != 0) { markTreeUninteresting(r.getTree()); if (r.has(BOUNDARY) && hasRevSort(RevSort.BOUNDARY)) return r; continue; } if (firstCommit == null) firstCommit = r; lastCommit = r; pendingObjects.add(r.getTree()); return r; } }

Target:
public RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final RevCommit r = super.next(); if ((r != null) && (r.flags & UNINTERESTING) != 0 && !r.has(BOUNDARY)) continue; return r; } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || o.getClass() != getClass()) { return false; } ForeverBroadcastDistributionRule that = (ForeverBroadcastDistributionRule) o; return colocatedDatasource.equals(that.colocatedDatasource); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || o.getClass() != getClass()) { return false; } ForeverBroadcastDistributionRule that = (ForeverBroadcastDistributionRule) o; return Objects.equals(colocatedDataSources, that.colocatedDataSources); }
Source:
public ASTValue eval(WordsEnvironment environment) throws WordsRuntimeException { ASTValue refList = children.get(0).eval(environment); if (refList.type == ASTValue.ValueType.NOTHING) { ASTValue id = children.get(1).eval(environment); try { WordsObject obj = environment.getObject(id.stringValue); return new ASTValue(obj); } catch (WordsObjectNotFoundException e) { throw new WordsReferenceException("Value expression is not an object"); } } WordsObject obj = refList.objValue; if (obj == null) { throw new WordsReferenceException("Value expression is not an object"); } ASTValue id = children.get(1).eval(environment); String propName = id.stringValue; WordsProperty wordsProp = obj.getProperty(propName); ASTValue astValue = null; switch (wordsProp.type) { case STRING: astValue = new ASTValue(wordsProp.stringProperty); break; case NUM: astValue = new ASTValue(wordsProp.numProperty); break; case OBJECT: astValue = new ASTValue(wordsProp.objProperty); break; case NOTHING: astValue = new ASTValue(ASTValue.ValueType.NOTHING); break; default: new AssertionError("Shouldn't get here in INodeRetrieveProperty"); } return astValue; }

Target:
public ASTValue eval(WordsEnvironment environment) throws WordsRuntimeException { ASTValue refList = children.get(0).eval(environment); if (refList.type == ASTValue.ValueType.NOTHING) { ASTValue id = children.get(1).eval(environment); WordsObject obj = environment.getObject(id.stringValue); return new ASTValue(obj); } WordsObject obj = refList.objValue; if (obj == null) { throw new AssertionError("obj shouldn't be null"); } ASTValue id = children.get(1).eval(environment); String propName = id.stringValue; WordsProperty wordsProp = obj.getProperty(propName); ASTValue astValue = null; switch (wordsProp.type) { case STRING: astValue = new ASTValue(wordsProp.stringProperty); break; case NUM: astValue = new ASTValue(wordsProp.numProperty); break; case OBJECT: astValue = new ASTValue(wordsProp.objProperty); break; case NOTHING: astValue = new ASTValue(ASTValue.ValueType.NOTHING); break; default: throw new AssertionError("Shouldn't get here in INodeRetrieveProperty"); } return astValue; }
Source:
public String getSelectedEntityName() { String name = "--"; if(selectedEntity != null && selectedEntity.getName() != null && !selectedEntity.getName().isEmpty()) { name = selectedEntity.getName().get(0).getValue(); } return name; }

Target:
public String getSelectedEntityName() { String name = NULL_DISPLAY; if (selectedEntity != null && selectedEntity.getName() != null && !selectedEntity.getName().isEmpty()) { name = selectedEntity.getName().get(0).getValue(); } return name; }
Source:
public void testShowTablesLike() { MaterializedResult result = computeActual("SHOW TABLES LIKE 'orde%'"); assertEquals(result.getOnlyColumnAsSet(), ImmutableSet.of(ORDERS.getTableName())); }

Target:
public void testShowTablesLike() { assertThat(computeActual("SHOW TABLES LIKE 'or%'").getOnlyColumnAsSet()) .contains("orders") .allMatch(tableName -> ((String) tableName).startsWith("or")); }
Source:
public boolean validateOptions(Map<String,String> options) { String o = options.get(NUM_SCANS_STRING_NAME); if (o != null && !NumberUtils.isCreatable(o)) throw new IllegalArgumentException( "bad integer " + NUM_SCANS_STRING_NAME + ":" + options.get(NUM_SCANS_STRING_NAME)); return true; }

Target:
public boolean validateOptions(Map<String,String> options) { String o = options.get(NUM_SCANS_STRING_NAME); if (o != null && !NumberUtils.isParsable(o)) throw new IllegalArgumentException( "bad integer " + NUM_SCANS_STRING_NAME + ":" + options.get(NUM_SCANS_STRING_NAME)); return true; }
Source:
protected void initializeDatabase() throws SQLException { String driver = "org.h2.Driver"; try { Class.forName(driver); } catch (ClassNotFoundException e) { e.printStackTrace(); } connection = DriverManager.getConnection("jdbc:h2:mem:openmrs;DB_CLOSE_DELAY=-1", USER_NAME, PASSWORD); connection.setAutoCommit(false); }

Target:
protected void initializeDatabase() throws SQLException, ClassNotFoundException { String driver = "org.h2.Driver"; Class.forName(driver); connection = DriverManager.getConnection("jdbc:h2:mem:openmrs;DB_CLOSE_DELAY=-1", USER_NAME, PASSWORD); connection.setAutoCommit(false); }
Source:
protected Object readResolve() { if (dirName != null && delegate == null) { delegate = new AbstractOnDiskBinding.UnbinderImpl(dirName); } return this; }

Target:
protected Object readResolve() { return new AbstractOnDiskBinding.UnbinderImpl(dirName); }
Source:
public void serverShutDown() throws Exception { Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { try { CarbonCommandToolsUtil.serverShutdown(1, context); } catch (Exception e) { log.error("Error while server shutdown ..", e); } } }); }

Target:
public void serverShutDown() throws CarbonToolsIntegrationTestException { Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { try { CarbonCommandToolsUtil.serverShutdown(1, context); } catch (Exception e) { log.error("Error while server shutdown ..", e); } } }); }
Source:
private DBObject translateUnaryLogicalExpression(FieldTreeNode context, UnaryLogicalExpression expr) { List<DBObject> l=new ArrayList<>(1); l.add(translate(context,expr.getQuery())); return new BasicDBObject("$nor", l); }

Target:
private DBObject translateUnaryLogicalExpression(FieldTreeNode context, UnaryLogicalExpression expr) { List<DBObject> l=new ArrayList<>(1); l.add(translate(context,expr.getQuery())); return new BasicDBObject(UNARY_LOGICAL_OPERATOR_MAP.get(expr.getOp()), l); }
Source:
public void handle(Request request, Response response) throws Exception { userSession.checkLoggedIn().checkIsSystemAdministrator(); if (mutableEditionManagementState.getPendingInstallationStatus() != EditionManagementState.PendingStatus.NONE) { throw BadRequestException.create("Can't uninstall the edition in the current state: " + mutableEditionManagementState.getPendingInstallationStatus()); } editionInstaller.uninstall(); mutableEditionManagementState.uninstall(); response.noContent(); }

Target:
public void handle(Request request, Response response) throws Exception { userSession.checkLoggedIn().checkIsSystemAdministrator(); if (mutableEditionManagementState.getPendingInstallationStatus() != EditionManagementState.PendingStatus.NONE && mutableEditionManagementState.getPendingInstallationStatus() != EditionManagementState.PendingStatus.UNINSTALL_IN_PROGRESS) { throw BadRequestException.create("Uninstall of the current edition is not allowed when install of an edition is in progress"); } editionInstaller.uninstall(); mutableEditionManagementState.uninstall(); response.noContent(); }
Source:
public int getMinAxis() { return (int) Math.round(Math.min(x, y)); }

Target:
public int getMinAxis() { if (x < y) { return 0; } return 1; }
Source:
private CallbackPlugin getPlugin() { if (plugin == null) { try { plugin = (CallbackPlugin) getClassLoader().loadClass(pluginClass).getConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } } return plugin; }

Target:
private synchronized CallbackPlugin getPlugin() { if (plugin == null) { try { plugin = (CallbackPlugin) getClassLoader().loadClass(pluginClass).getConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException(e); } } return plugin; }
Source:
public void testAutoCrashReportEnabling() { Context context = InstrumentationRegistry.getTargetContext(); SettingsActivity.setAutoCrashReportingEnabled(context, false); verify(CrashReporter.reporter, Mockito.times(0)).initialize(context); SettingsActivity.setAutoCrashReportingEnabled(context, true); verify(CrashReporter.reporter, Mockito.times(1)).initialize(context); }

Target:
public void testAutoCrashReportEnabling() { Context context = InstrumentationRegistry.getTargetContext(); SettingsActivity.setAutoCrashReportingEnabled(context, false); verify(reporter, times(0)).initialize(context); SettingsActivity.setAutoCrashReportingEnabled(context, true); verify(reporter, times(1)).initialize(context); }
Source:
static boolean isObjectInBucketIgnoringPermission(AmazonS3 s3Client, String bucketName, String objectKey) { try { return s3Client.doesObjectExist(bucketName, objectKey); } catch (AmazonS3Exception e) { if (e.getStatusCode() == 403) { return true; } throw e; } }

Target:
static boolean isObjectInBucketIgnoringPermission(AmazonS3 s3Client, String bucketName, String objectKey) { try { return s3Client.doesObjectExist(bucketName, objectKey); } catch (AmazonS3Exception e) { if (e.getStatusCode() == 404) { return true; } throw e; } }
Source:
public void applyPartitions(List<Map<String, String>> remainingPartitions) { if (allPartitions.isEmpty()) { if (!remainingPartitions.isEmpty()) { this.allPartitions = remainingPartitions; this.data = mapPartitionToRow(physicalSchema, data.get(Collections.EMPTY_MAP), remainingPartitions); } } else { this.allPartitions = remainingPartitions; } }

Target:
public void applyPartitions(List<Map<String, String>> remainingPartitions) { if (allPartitions.isEmpty()) { if (!remainingPartitions.isEmpty()) { this.allPartitions = remainingPartitions; this.data = mapPartitionToRow(physicalSchema, data.get(Collections.EMPTY_MAP), remainingPartitions); } else { this.data.put(Collections.emptyMap(), Collections.emptyList()); } } else { this.allPartitions = remainingPartitions; if (remainingPartitions.isEmpty()) { this.data.put(Collections.emptyMap(), Collections.emptyList()); } } }
Source:
public void onScoreCalculationLimitInputChange( ChangeEvent event ) { try { Long value = scoreCalculationCountLimitInput.getValue().isEmpty() ? null : Long.parseLong( scoreCalculationCountLimitInput.getValue() ); presenter.onScoreCalculationLimitChange( value ); } catch ( NumberFormatException e ) { } }

Target:
public void onScoreCalculationLimitInputChange( ChangeEvent event ) { boolean isNumeric = scoreCalculationCountLimitInput.getValue().matches( "\\d+" ); if (isNumeric) { presenter.onScoreCalculationLimitChange( Long.parseLong( scoreCalculationCountLimitInput.getValue() ) ); } else { presenter.onScoreCalculationLimitChange( 0l ); scoreCalculationCountLimitInput.setValue( "0" ); } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Method method = (Method) o; return methodId == method.methodId; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Method method = (Method) o; return methodId == method.methodId; }
Source:
public IndexGeneratorJobTest( String partitionType, String interval, Object[][][] shardInfoForEachSegment, List<String> data ) throws IOException { this.partitionType = partitionType; this.shardInfoForEachSegment = shardInfoForEachSegment; this.interval = new Interval(interval); mapper = new DefaultObjectMapper(); mapper.registerSubtypes(new NamedType(HashBasedNumberedShardSpec.class, "hashed")); mapper.registerSubtypes(new NamedType(SingleDimensionShardSpec.class, "single")); InjectableValues inject = new InjectableValues.Std().addValue(ObjectMapper.class, mapper); mapper.setInjectableValues(inject); dataFile = File.createTempFile("test_website_data", "tmp"); dataFile.deleteOnExit(); tmpDir = Files.createTempDir(); tmpDir.deleteOnExit(); FileUtils.writeLines(dataFile, data); config = new HadoopDruidIndexerConfig( new HadoopIngestionSpec( new DataSchema( "website", new StringInputRowParser( new CSVParseSpec( new TimestampSpec("timestamp", "yyyyMMddHH", null), new DimensionsSpec(ImmutableList.of("host"), null, null), null, ImmutableList.of("timestamp", "host", "visited_num") ) ), new AggregatorFactory[]{new LongSumAggregatorFactory("visited_num", "visited_num")}, new UniformGranularitySpec( Granularity.DAY, QueryGranularity.NONE, ImmutableList.of(this.interval) ) ), new HadoopIOConfig( ImmutableMap.<String, Object>of( "paths", dataFile.getCanonicalPath(), "type", "static" ), null, tmpDir.getCanonicalPath() ), new HadoopTuningConfig( tmpDir.getCanonicalPath(), null, null, null, null, null, false, false, false, false, null, false, false, false, null, null ) ) ); config.setShardSpecs(loadShardSpecs(partitionType, shardInfoForEachSegment)); config = HadoopDruidIndexerConfig.fromSpec(config.getSchema()); }

Target:
public IndexGeneratorJobTest( String partitionType, String interval, Object[][][] shardInfoForEachSegment, List<String> data ) throws IOException { this.partitionType = partitionType; this.shardInfoForEachSegment = shardInfoForEachSegment; this.interval = new Interval(interval); this.data = data; }
Source:
private boolean definesPatternProperty(String field) { for (Entry<Pattern, Schema> entry : patternProperties.entrySet()) { if (entry.getKey().matcher(field).matches()) { return true; } } return false; }

Target:
private boolean definesPatternProperty(String field) { return patternProperties.keySet().stream().filter(pattern -> pattern.matcher(field).matches()) .findAny().isPresent(); }
Source:
public void charset(Charset charset) { outputSettings.charset(charset); ensureMetaCharset(); }

Target:
public void charset(Charset charset) { updateMetaCharsetElement(true); outputSettings.charset(charset); ensureMetaCharsetElement(); }
Source:
private PagesSerde createPagesSerdeInternal(Optional<SpillCipher> spillCipher) { Optional<Compressor> compressor; Optional<Decompressor> decompressor; if (compressionEnabled) { compressor = Optional.of(new Lz4Compressor()); decompressor = Optional.of(new Lz4Decompressor()); } else { compressor = Optional.empty(); decompressor = Optional.empty(); } return new PagesSerde(blockEncodingSerde, compressor, decompressor, spillCipher); }

Target:
private PagesSerde createPagesSerdeInternal(Optional<SpillCipher> spillCipher) { if (compressionEnabled) { return new PagesSerde(blockEncodingSerde, Optional.of(new Lz4Compressor()), Optional.of(new Lz4Decompressor()), spillCipher); } return new PagesSerde(blockEncodingSerde, Optional.empty(), Optional.empty(), spillCipher); }
Source:
protected void onReveal() { Event entityChangedEvent = getModel().getDiskViewType().getEntityChangedEvent(); if (!entityChangedEvent.getListeners().contains(getView().getDiskTypeChangedEventListener())) { entityChangedEvent.addListener(getView().getDiskTypeChangedEventListener()); } Event systemTreeSelectedItemChangedEvent = CommonModel.getInstance().getSystemTree().getSelectedItemChangedEvent(); systemTreeSelectedItemChangedEvent.addListener(systemTreeChangedEventListener); super.onReveal(); getView().handleQuotaColumnVisibility(); }

Target:
protected void onReveal() { Event entityChangedEvent = getModel().getDiskViewType().getEntityChangedEvent(); if (!entityChangedEvent.getListeners().contains(getView().getDiskTypeChangedEventListener())) { entityChangedEvent.addListener(getView().getDiskTypeChangedEventListener()); } Event systemTreeSelectedItemChangedEvent = CommonModel.getInstance().getSystemTree().getSelectedItemChangedEvent(); systemTreeSelectedItemChangedEvent.addListener(systemTreeListener); super.onReveal(); getView().handleQuotaColumnVisibility(); }
Source:
public Text replace(Pattern oldValue, Text newValue, boolean lossy) { Text t = this.children.isEmpty() ? this : this.toBuilder().removeAll().append(this.children.stream() .map(x -> x.replace(oldValue, newValue, lossy)).collect(Collectors.toList())).build(); String plain = t.toPlainSingle(); Matcher matcher = oldValue.matcher(plain); if (!matcher.find()) { if (lossy) { plain = t.toPlain(); matcher = oldValue.matcher(plain); if (matcher.find()) { t = t.toBuilder().removeAll().build(); } else { return t; } } else { return t; } } if (matcher.hitEnd()) { if (this.format.equals(TextFormat.NONE)) { return newValue; } return this.reformat(Text.builder()).append(newValue).build(); } Builder builder = Text.builder(); List<String> strs = Arrays.asList(oldValue.split(plain, -1)); for (String str : Iterables.limit(strs, strs.size() - 1)) { builder.append(Text.of(str)); builder.append(newValue); } builder.append(Text.of(strs.get(strs.size() - 1))); return this.reformat(builder).build(); }

Target:
public Text replace(Pattern oldValue, Text newValue, boolean lossy) { Text text = this.children.isEmpty() ? this : this.toBuilder().removeAll().append(this.children.stream() .map(child -> child.replace(oldValue, newValue, lossy)).collect(Collectors.toList())).build(); String plain = text.toPlainSingle(); Matcher matcher = oldValue.matcher(plain); if (!matcher.find()) { if (lossy) { plain = text.toPlain(); matcher = oldValue.matcher(plain); if (matcher.find()) { text = text.toBuilder().removeAll().build(); } else { return text; } } else { return text; } } if (matcher.hitEnd()) { return this.reformat(Text.builder()).append(newValue).append(text.children).build(); } Builder builder = Text.builder(); List<String> strs = Arrays.asList(oldValue.split(plain, -1)); for (String str : Iterables.limit(strs, strs.size() - 1)) { builder.append(Text.of(str)); builder.append(newValue); } builder.append(Text.of(strs.get(strs.size() - 1))).append(text.children); return this.reformat(builder).build(); }
Source:
public UserDetails getCached(String idOrFullName) throws UsernameNotFoundException { Boolean exists = existanceCache.getIfPresent(idOrFullName); if (exists != null && !exists) { throw new UsernameNotFoundException(String.format("\"%s\" does not exist", idOrFullName)); } else { return detailsCache.getIfPresent(idOrFullName); } }

Target:
public UserDetails getCached(String idOrFullName) throws UsernameNotFoundException { Boolean exists = existanceCache.getIfPresent(idOrFullName); if (exists != null && !exists) { throw new UserMayOrMayNotExistException(String.format("\"%s\" does not exist", idOrFullName)); } else { return detailsCache.getIfPresent(idOrFullName); } }
Source:
public void testResolvingNullKeyValueQueryReturnsNullComparator() { HazelcastSortAccessor hazelcastSortAccessor = new HazelcastSortAccessor(); Comparator<Map.Entry<?, ?>> comparator = (Comparator<Map.Entry<?, ?>>) hazelcastSortAccessor.resolve((KeyValueQuery<?>) null); assertNull(comparator); }

Target:
public void testResolvingNullKeyValueQueryReturnsNullComparator() { HazelcastSortAccessor hazelcastSortAccessor = new HazelcastSortAccessor(); Comparator<Map.Entry<?, ?>> comparator = hazelcastSortAccessor.resolve(null); assertNull(comparator); }
Source:
private static @NonNull Set<Integer> getActiveThreads(TmfTimeRange winRange, @NonNull ITmfTrace trace) { KernelAnalysisModule kernelModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, KernelAnalysisModule.class, KernelAnalysisModule.ID); long beginTS = winRange.getStartTime().getValue(); long endTS = winRange.getEndTime().getValue(); if (kernelModule == null) { return new HashSet<>(); } Set<Integer> set = KernelThreadInformationProvider.getActiveThreadsForRange(kernelModule, beginTS, endTS); return set; }

Target:
private static @NonNull Set<Integer> getActiveThreads(TmfTimeRange winRange, @NonNull ITmfTrace trace) { KernelAnalysisModule kernelModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, KernelAnalysisModule.class, KernelAnalysisModule.ID); long beginTS = winRange.getStartTime().getValue(); long endTS = winRange.getEndTime().getValue(); if (kernelModule == null) { return Collections.emptySet(); } return KernelThreadInformationProvider.getActiveThreadsForRange(kernelModule, beginTS, endTS); }
Source:
public void tag(final String... tags) throws IOException { final List<String> args = new ArrayList<String>(); args.add("add"); args.add(this.jid); for (final String tag : tags) { args.add(tag); } this.client.call( LuaCommand.TAG.toString(), args); }

Target:
public void tag(final String... tags) throws IOException { final List<String> args = new ArrayList<>(); args.add("add"); args.add(this.jid); Collections.addAll(args, tags); this.client.call( LuaCommand.TAG.toString(), args); }
Source:
public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface v = new ValueMeta( this.getValueXMLfield(), ValueMetaInterface.TYPE_STRING ); v.setOrigin( name ); TransMeta transMeta = (TransMeta) space; try { String[] targetFieldNames = null; RowMetaInterface targetRowMeta = transMeta.getStepFields( transMeta.findStep( getTargetXMLstep() ), null, null ); if ( targetRowMeta != null ) { targetFieldNames = targetRowMeta.getFieldNames(); } for ( String fieldName : transMeta.getStepFields( transMeta.findStep( getSourceXMLstep() ), null, null ).getFieldNames() ) { if ( targetFieldNames == null || !Arrays.asList( targetFieldNames ).contains( fieldName ) ) { row.removeValueMeta( fieldName ); } } } catch ( KettleValueException e ) { } row.addValueMeta( v ); }

Target:
public void getFields( RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { ValueMetaInterface v = new ValueMeta( this.getValueXMLfield(), ValueMetaInterface.TYPE_STRING ); v.setOrigin( name ); TransMeta transMeta = (TransMeta) space; try { List<String> targetFieldNames = null; RowMetaInterface targetRowMeta = transMeta.getStepFields( transMeta.findStep( getTargetXMLstep() ), null, null ); if ( targetRowMeta != null ) { targetFieldNames = Arrays.asList( targetRowMeta.getFieldNames() ); } for ( String fieldName : transMeta.getStepFields( transMeta.findStep( getSourceXMLstep() ), null, null ).getFieldNames() ) { if ( targetFieldNames == null || !targetFieldNames.contains( fieldName ) ) { row.removeValueMeta( fieldName ); } } } catch ( KettleValueException e ) { } row.addValueMeta( v ); }
Source:
public void ReadSerial() { byte[] buf = new byte[256]; boolean success = true; String data = ""; if (mPhysicaloid.read(buf) > 0) { try { data = new String(buf, "UTF-8"); } catch (UnsupportedEncodingException mEr) { success = false; Log.e(LOG_TAG, mEr.getMessage()); } } else { success = false; } AfterReadSerial(success, data); }

Target:
public String ReadSerial() { String data = ""; if (mPhysicaloid == null) { form.dispatchErrorOccurredEvent(Serial.this, "ReadSerial", ErrorMessages.ERROR_SERIAL_NOT_INITIALIZED); } else { byte[] buf = new byte[this.bytes]; if (mPhysicaloid.read(buf) > 0) { try { data = new String(buf, "UTF-8"); } catch (UnsupportedEncodingException mEr) { Log.e(LOG_TAG, mEr.getMessage()); } } } return data; }
Source:
public boolean getLegal() { if (getUseTimout()) { String keyForCheck = getkeyForCheck(); if (!CacheManager.getTimeoutBaseCache().containsKey(keyForCheck)) { CacheManager.getTimeoutBaseCache().put(keyForCheck, keyForCheck, getEndTime(), TimeUnit.MILLISECONDS); return true; } return false; } return true; }

Target:
public boolean getLegal() { if (getUseTimout()) { String keyForCheck = getkeyForCheck(); synchronized (keyForCheck) { if (!CacheManager.getTimeoutBaseCache().containsKey(keyForCheck)) { CacheManager.getTimeoutBaseCache().put(keyForCheck, keyForCheck, getEndTime(), TimeUnit.MILLISECONDS); return true; } } return false; } return true; }