before
stringlengths
12
3.21M
after
stringlengths
41
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
static public void smallChest(CatConfig cnf, List<ItemStack> items) { if (cnf.SmallEquipChance()) items.add(leather_equipment(cnf)); List<ItemStack> ll = new ArrayList<ItemStack>(); fillChest(cnf, ll, cnf.LootSmallList()); for (ItemStack i : ll) { items.addItem(i); } }
static public void smallChest(CatConfig cnf, List<ItemStack> items) { if (cnf.SmallEquipChance()) items.add(leather_equipment(cnf)); <DeepExtract> List<ItemStack> ll = new ArrayList<ItemStack>(); fillChest(cnf, ll, cnf.LootSmallList()); for (ItemStack i : ll) { items.addItem(i); } </DeepExtract> }
Catacombs
positive
5,591
private void addCDATAProposal(Collection<ICompletionProposal> proposals, XMLNode node, IQuickAssistInvocationContext context) { int offset = node.getOffset() + 1; int tagLength = node.getContent().length(); String trimmedContent = node.getContent().trim(); String replacement = node.getContent().replace(trimmedContent, ...
private void addCDATAProposal(Collection<ICompletionProposal> proposals, XMLNode node, IQuickAssistInvocationContext context) { int offset = node.getOffset() + 1; int tagLength = node.getContent().length(); String trimmedContent = node.getContent().trim(); String replacement = node.getContent().replace(trimmedContent, ...
rinzo-xml-editor
positive
5,592
@Test public void testAuthenticationPropagation() throws ExecutionException, InterruptedException { SecurityContext newContext = SecurityContextHolder.createEmptyContext(); newContext.setAuthentication("Mr. Bean" == null ? null : new TestAuthentication("Mr. Bean")); SecurityContextHolder.setContext(newContext); Future<...
@Test public void testAuthenticationPropagation() throws ExecutionException, InterruptedException { <DeepExtract> SecurityContext newContext = SecurityContextHolder.createEmptyContext(); newContext.setAuthentication("Mr. Bean" == null ? null : new TestAuthentication("Mr. Bean")); SecurityContextHolder.setContext(newCon...
context-propagation
positive
5,593
private static OWLOntology mireotExtract(IOHelper ioHelper, OWLOntology inputOntology, CommandLine line, Map<String, String> extractOptions) throws Exception { Imports imports; String importsOption = OptionsHelper.getOption(extractOptions, "imports", "include"); if (importsOption.equalsIgnoreCase("include")) { imports ...
private static OWLOntology mireotExtract(IOHelper ioHelper, OWLOntology inputOntology, CommandLine line, Map<String, String> extractOptions) throws Exception { <DeepExtract> Imports imports; String importsOption = OptionsHelper.getOption(extractOptions, "imports", "include"); if (importsOption.equalsIgnoreCase("include...
robot
positive
5,594
private void initBD() { String authHost = "https://aip.baidubce.com/oauth/2.0/token?"; String ak = ConstantUtils.BD_API_KEY; String sk = ConstantUtils.BD_SECRET_KEY; String getAccessTokenUrl = authHost + "grant_type=client_credentials" + "&client_id=" + ak + "&client_secret=" + sk; try { URL realUrl = new URL(getAccess...
private void initBD() { <DeepExtract> String authHost = "https://aip.baidubce.com/oauth/2.0/token?"; String ak = ConstantUtils.BD_API_KEY; String sk = ConstantUtils.BD_SECRET_KEY; String getAccessTokenUrl = authHost + "grant_type=client_credentials" + "&client_id=" + ak + "&client_secret=" + sk; try { URL realUrl = new...
NutritionMaster
positive
5,595
@Override @Transactional(rollbackFor = Exception.class) public AddTaskResponse addTask(AddTaskRequest request) { taskAdditionTrackers.entrySet().stream().filter(it -> it.getValue().test(request)).forEach(it -> it.getKey().track(request)); if (newTaskInterceptPredicate != null && newTaskInterceptPredicate.test(request))...
@Override @Transactional(rollbackFor = Exception.class) public AddTaskResponse addTask(AddTaskRequest request) { <DeepExtract> taskAdditionTrackers.entrySet().stream().filter(it -> it.getValue().test(request)).forEach(it -> it.getKey().track(request)); </DeepExtract> if (newTaskInterceptPredicate != null && newTaskInte...
tw-tasks-executor
positive
5,596
public long randomLongWhatever() { if ((64 <= 0) || (64 > 64)) { throw new IllegalArgumentException(); } final long bitsMask = ((-1L) >>> (64 - 64)); long bits = this.random.nextLong(); if ((MASK_PROBA_INT_LONG == 1.0) || (this.random.nextDouble() < MASK_PROBA_INT_LONG)) { final int shift = this.random.nextInt(64); if ...
public long randomLongWhatever() { <DeepExtract> if ((64 <= 0) || (64 > 64)) { throw new IllegalArgumentException(); } final long bitsMask = ((-1L) >>> (64 - 64)); long bits = this.random.nextLong(); if ((MASK_PROBA_INT_LONG == 1.0) || (this.random.nextDouble() < MASK_PROBA_INT_LONG)) { final int shift = this.random.ne...
jafama
positive
5,597
private void loadStoreProperties() throws Exception { SampleProperties props = new SampleProperties(); if (props.propertiesFileExists()) { props.loadProperties(); } else { this.credentials = Credentials.create(new KeyPairGen().generateKeyPairGetPrivateKey()); setupBesuServiceTransactionManager(); deployContracts(); pro...
private void loadStoreProperties() throws Exception { SampleProperties props = new SampleProperties(); if (props.propertiesFileExists()) { props.loadProperties(); } else { this.credentials = Credentials.create(new KeyPairGen().generateKeyPairGetPrivateKey()); setupBesuServiceTransactionManager(); deployContracts(); pro...
sidechains-samples
positive
5,598
public void add(String key, String value) { FeatureNode fn = add(key); if (kv_pairs != null) { if (getFeatureNames().size() > 0) throw new RuntimeException("Must clear features before forcing value."); } kv_pairs = null; setValue(value); }
public void add(String key, String value) { FeatureNode fn = add(key); <DeepExtract> if (kv_pairs != null) { if (getFeatureNames().size() > 0) throw new RuntimeException("Must clear features before forcing value."); } kv_pairs = null; setValue(value); </DeepExtract> }
relex
positive
5,599
private void GameOver() { if (Settings.world == 4) { Settings.addHighScore(4, 1, Settings.getScore()); Settings.addRecordTime(4, 1, 10000); } state = GameState.Running; isSystemDriven = false; lockInputs = false; mario.resetHealth(); ((AndroidGame) game).setScreenWithFade(new GuiMenuScreen(game)); GuiMenuScreen mainMen...
private void GameOver() { if (Settings.world == 4) { Settings.addHighScore(4, 1, Settings.getScore()); Settings.addRecordTime(4, 1, 10000); } state = GameState.Running; isSystemDriven = false; lockInputs = false; mario.resetHealth(); ((AndroidGame) game).setScreenWithFade(new GuiMenuScreen(game)); <DeepExtract> GuiMenu...
-Android-Super-Mario
positive
5,600
public long decode012() { int index = this.index; int result = this.buffer[this.buffer_offset + (index >> 3)]; result <<= ((index & 0x07) + 24); result >>= (32 - 1); index++; this.index = index; return (result != 0) ? 1 : 0; if (n == 0) return 0; else return get_bits1("") + 1; }
public long decode012() { <DeepExtract> int index = this.index; int result = this.buffer[this.buffer_offset + (index >> 3)]; result <<= ((index & 0x07) + 24); result >>= (32 - 1); index++; this.index = index; return (result != 0) ? 1 : 0; </DeepExtract> if (n == 0) return 0; else return get_bits1("") + 1; }
h264j
positive
5,601
@Test public void StringConcat() throws Exception { ArdenString s = (ArdenString) evalExpression("\"a\" || \"b\""); Assert.assertEquals("ab", s.value); ArdenString s = (ArdenString) evalExpression("null || 3"); Assert.assertEquals("null3", s.value); ArdenString s = (ArdenString) evalExpression("4 || 5"); Assert.assertE...
@Test public void StringConcat() throws Exception { ArdenString s = (ArdenString) evalExpression("\"a\" || \"b\""); Assert.assertEquals("ab", s.value); ArdenString s = (ArdenString) evalExpression("null || 3"); Assert.assertEquals("null3", s.value); ArdenString s = (ArdenString) evalExpression("4 || 5"); Assert.assertE...
arden2bytecode
positive
5,602
public int getCurrentMinute() { return mSelectionDegrees[MINUTES] / DEGREES_FOR_ONE_MINUTE; }
public int getCurrentMinute() { <DeepExtract> return mSelectionDegrees[MINUTES] / DEGREES_FOR_ONE_MINUTE; </DeepExtract> }
SublimePicker
positive
5,603
public void handleMessage(Message message) { DownloadActivity activity = mActivity.get(); if (activity == null) return; String pathname = DownloadService.getPathname(message); if (pathname == null) activity.showDialog("failed download"); if (mProgressDialog != null) mProgressDialog.dismiss(); if (mImageView == null) sh...
public void handleMessage(Message message) { DownloadActivity activity = mActivity.get(); if (activity == null) return; String pathname = DownloadService.getPathname(message); if (pathname == null) activity.showDialog("failed download"); if (mProgressDialog != null) mProgressDialog.dismiss(); <DeepExtract> if (mImageVi...
CS892
positive
5,604
protected static boolean isSpotifyInstalled() { String[] args = { "osascript", "-e", "exists application \"Spotify\"" }; String result; ProcessBuilder builder = new ProcessBuilder(); try { builder.command(args); if (null != null) { builder.directory(new File(null)); } Process process = builder.start(); ByteArrayOutputS...
protected static boolean isSpotifyInstalled() { String[] args = { "osascript", "-e", "exists application \"Spotify\"" }; <DeepExtract> String result; ProcessBuilder builder = new ProcessBuilder(); try { builder.command(args); if (null != null) { builder.directory(new File(null)); } Process process = builder.start(); By...
swdc-intellij-music-time
positive
5,605
@Test public void testDocumentedClass() throws IOException, JSONException { Path source = SRC_PATH.resolve("capital/scalable/restdocs/jsondoclet/DocumentedClass.java"); Iterable<JavaFileObject> compilationUnits; try (InputStream in = new FileInputStream(source.toFile())) { String content = IOUtils.toString(in, UTF_8); ...
@Test public void testDocumentedClass() throws IOException, JSONException { Path source = SRC_PATH.resolve("capital/scalable/restdocs/jsondoclet/DocumentedClass.java"); <DeepExtract> Iterable<JavaFileObject> compilationUnits; try (InputStream in = new FileInputStream(source.toFile())) { String content = IOUtils.toStrin...
spring-auto-restdocs
positive
5,606
public static JComponent createVerticalSeparator(int padding) { return withBorder(wrap(new JSeparator(JSeparator.VERTICAL)), BorderFactory.createEmptyBorder(0, padding, 0, padding)); }
public static JComponent createVerticalSeparator(int padding) { <DeepExtract> return withBorder(wrap(new JSeparator(JSeparator.VERTICAL)), BorderFactory.createEmptyBorder(0, padding, 0, padding)); </DeepExtract> }
threadtear
positive
5,607
public void testFixedParse() { final List<ColumnMetaData> columnMetaData = new ArrayList<ColumnMetaData>(); assertEquals("data and col lengths different size...", new String[] { "test", "test", "test" }.length, new int[] { 5, 10, 20 }.length); for (final int length : new int[] { 5, 10, 20 }) { final ColumnMetaData cmd ...
public void testFixedParse() { final List<ColumnMetaData> columnMetaData = new ArrayList<ColumnMetaData>(); assertEquals("data and col lengths different size...", new String[] { "test", "test", "test" }.length, new int[] { 5, 10, 20 }.length); for (final int length : new int[] { 5, 10, 20 }) { final ColumnMetaData cmd ...
flatpack
positive
5,608
public static void main(String[] args) throws Exception { try { creator = new ExhibitorCreator(args); } catch (ExhibitorCreatorExit exit) { if (exit.getError() != null) { System.err.println(exit.getError()); } exit.getCli().printHelp(); return; } SecurityArguments securityArguments = new SecurityArguments(creator.getSe...
public static void main(String[] args) throws Exception { try { creator = new ExhibitorCreator(args); } catch (ExhibitorCreatorExit exit) { if (exit.getError() != null) { System.err.println(exit.getError()); } exit.getCli().printHelp(); return; } SecurityArguments securityArguments = new SecurityArguments(creator.getSe...
exhibitor
positive
5,609
@Override public void onResume() { super.onResume(); abort = !activity().assertSteamConnection(); }
@Override <DeepExtract> </DeepExtract> public void onResume() { <DeepExtract> </DeepExtract> super.onResume(); <DeepExtract> </DeepExtract> abort = !activity().assertSteamConnection(); <DeepExtract> </DeepExtract> }
SteamTrade
positive
5,610
public static String getBeforeYesData() { Date date = new Date(getNow() - 86400000L - 86400000L); return getYYMMDD(date); }
public static String getBeforeYesData() { <DeepExtract> Date date = new Date(getNow() - 86400000L - 86400000L); return getYYMMDD(date); </DeepExtract> }
Teameeting-Android
positive
5,611
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { String puzzleSourceId = getSelectedPuzzleSource(); if (selectedPuzzleSourceId == null || !selectedPuzzleSourceId.equals(puzzleSourceId)) { updateMiniStats(puzzleSourceId); } }
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { <DeepExtract> String puzzleSourceId = getSelectedPuzzleSource(); if (selectedPuzzleSourceId == null || !selectedPuzzleSourceId.equals(puzzleSourceId)) { updateMiniStats(puzzleSourceId); } </DeepExtract> }
andoku
positive
5,612
private <T extends Collection<String>> RequestMetadata params(Map<String, T> params) { for (Map.Entry<String, T> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { add(key, value, this.params); } } return this; }
private <T extends Collection<String>> RequestMetadata params(Map<String, T> params) { <DeepExtract> for (Map.Entry<String, T> entry : params.entrySet()) { String key = entry.getKey(); for (String value : entry.getValue()) { add(key, value, this.params); } } </DeepExtract> return this; }
newbie-boot-project
positive
5,613
@Override public void actionPerformed(ActionEvent ev) { if (captureEngineConfiguration == null) { Log.warn("CaptureEngineConfiguration is null"); return; } if (captureEngine != null) { captureEngine.stop(); } captureEngine = new CaptureEngine(new RobotCaptureFactory(!shareAllScreens.get())); captureEngine.configure(cap...
@Override public void actionPerformed(ActionEvent ev) { <DeepExtract> if (captureEngineConfiguration == null) { Log.warn("CaptureEngineConfiguration is null"); return; } if (captureEngine != null) { captureEngine.stop(); } captureEngine = new CaptureEngine(new RobotCaptureFactory(!shareAllScreens.get())); captureEngine...
Dayon
positive
5,614
@Test void ensureUpdateWorks() { var client = ThunderClient.fake(); var originalUser = new User(Email.unverified(ADDRESS), PASSWORD, Collections.emptyMap()); var newUser = new User(Email.unverified(ADDRESS), PASSWORD, Collections.singletonMap("k", 2)); var expectedMessage = "HTTP " + 404.toString(); var exception = ass...
@Test void ensureUpdateWorks() { var client = ThunderClient.fake(); var originalUser = new User(Email.unverified(ADDRESS), PASSWORD, Collections.emptyMap()); var newUser = new User(Email.unverified(ADDRESS), PASSWORD, Collections.singletonMap("k", 2)); var expectedMessage = "HTTP " + 404.toString(); var exception = ass...
thunder
positive
5,615
@SuppressWarnings("WeakerAccess") public void calculateAll() { if (!this.source.isModule() || this.locked) return; if (!this.source.isModule() || this.locked) return; double mn, mx; LCG lcg = new LCG(); mn = 10000.0; mx = -10000.0; for (int c = 0; c < this.samples; c++) { double nx = (lcg.get01() * 4.0 - 2.0) * this.sa...
@SuppressWarnings("WeakerAccess") public void calculateAll() { if (!this.source.isModule() || this.locked) return; if (!this.source.isModule() || this.locked) return; double mn, mx; LCG lcg = new LCG(); mn = 10000.0; mx = -10000.0; for (int c = 0; c < this.samples; c++) { double nx = (lcg.get01() * 4.0 - 2.0) * this.sa...
Joise
positive
5,616
public Criteria andCodeIsNull() { if ("code is null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("code is null")); return (Criteria) this; }
public Criteria andCodeIsNull() { <DeepExtract> if ("code is null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("code is null")); </DeepExtract> return (Criteria) this; }
common-admin
positive
5,617
private Map<String, String> createPrefixMap(Map<String, String> prefixMappings) { Map<String, String> prefixMap = new HashMap<String, String>(prefixMappings); String previous = prefixMap.put(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI); if (previous != null && !previous.equals(XMLConstants.XML_NS_URI)) { throw ...
private Map<String, String> createPrefixMap(Map<String, String> prefixMappings) { Map<String, String> prefixMap = new HashMap<String, String>(prefixMappings); String previous = prefixMap.put(XMLConstants.XML_NS_PREFIX, XMLConstants.XML_NS_URI); if (previous != null && !previous.equals(XMLConstants.XML_NS_URI)) { throw ...
anhalytics-core
positive
5,618
public Criteria andUserIdLessThan(Integer value) { if (value == null) { throw new RuntimeException("Value for " + "userId" + " cannot be null"); } criteria.add(new Criterion("user_id <", value)); return (Criteria) this; }
public Criteria andUserIdLessThan(Integer value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "userId" + " cannot be null"); } criteria.add(new Criterion("user_id <", value)); </DeepExtract> return (Criteria) this; }
library_manager_system
positive
5,619
@Override public Adapter caseTransformations(Transformations object) { return null; }
@Override public Adapter caseTransformations(Transformations object) { <DeepExtract> return null; </DeepExtract> }
VSand
positive
5,620
@Override public JobrunrBackgroundjobserversRecord value14(String value) { set(13, value); return this; }
@Override public JobrunrBackgroundjobserversRecord value14(String value) { <DeepExtract> set(13, value); </DeepExtract> return this; }
openvsx
positive
5,621
public void initFonts(int size, Typeface normalFont, Typeface boldFont, Typeface italicFont, Typeface boldItalicFont, int orientation, float extraStroke, boolean inverse, int textColor, int backColor, float lineSpace, float firstLine, int header, int footer, int refreshMode, int paddingLeft, int paddingTop, int padding...
public void initFonts(int size, Typeface normalFont, Typeface boldFont, Typeface italicFont, Typeface boldItalicFont, int orientation, float extraStroke, boolean inverse, int textColor, int backColor, float lineSpace, float firstLine, int header, int footer, int refreshMode, int paddingLeft, int paddingTop, int padding...
NomadReader
positive
5,622
public static void main(String[] args) { runScriptExample(CORE_EXAMPLES_RUBY_DIR, "io/vertx/example/core/net/echossl/server.rb", new VertxOptions().setClustered(false)); }
public static void main(String[] args) { <DeepExtract> runScriptExample(CORE_EXAMPLES_RUBY_DIR, "io/vertx/example/core/net/echossl/server.rb", new VertxOptions().setClustered(false)); </DeepExtract> }
vertx-examples
positive
5,623
@Override public void fired(NumberFieldManipulator axis) { int cat = -1, num = -1; for (int i = 0; i < axes.length; i++) { for (int j = 0; j < axes[i].length; j++) { if (axes[i][j] == axis) { cat = i; num = j; } } } if (cat == -1) { throw new UnsupportedOperationException("Element not in Axes array!"); } Double value; ...
@Override public void fired(NumberFieldManipulator axis) { <DeepExtract> int cat = -1, num = -1; for (int i = 0; i < axes.length; i++) { for (int j = 0; j < axes[i].length; j++) { if (axes[i][j] == axis) { cat = i; num = j; } } } if (cat == -1) { throw new UnsupportedOperationException("Element not in Axes array!"); } ...
cncgcodecontroller
positive
5,624
public static void main(String[] args) { if (new SleeperSolution().enter(new DreamSolution()) != 0) { System.out.println("Am I still dreaming?"); return true; } return false; }
public static void main(String[] args) { <DeepExtract> if (new SleeperSolution().enter(new DreamSolution()) != 0) { System.out.println("Am I still dreaming?"); return true; } return false; </DeepExtract> }
javaspecialists
positive
5,625
@Test public void testFindNearestSet() { pointSet.clear(); for (int i = 0; i < POINTS_COUNT; i++) pointSet.add(new PointD(i / 10, i % 10)); for (PointD q : pointSet) { assertEquals(q, comparer.findNearest(pointSet, q)); final PointD p = new PointD(q.x + 0.1, q.y - 0.1); assertEquals(q, comparer.findNearest(pointSet, p)...
@Test public void testFindNearestSet() { <DeepExtract> pointSet.clear(); for (int i = 0; i < POINTS_COUNT; i++) pointSet.add(new PointD(i / 10, i % 10)); </DeepExtract> for (PointD q : pointSet) { assertEquals(q, comparer.findNearest(pointSet, q)); final PointD p = new PointD(q.x + 0.1, q.y - 0.1); assertEquals(q, comp...
tektosyne
positive
5,626
@Deprecated public String getExcludedLibs() throws CoreException { return configuration.getAttribute(ATTR_EXCLUDED_LIBS, (false) ? JettyPlugin.getDefaultScope().getNode(JettyPlugin.PLUGIN_ID).getBoolean(ATTR_EXCLUDED_LIBS, ".*servlet-api.*") : ".*servlet-api.*"); }
@Deprecated public String getExcludedLibs() throws CoreException { <DeepExtract> return configuration.getAttribute(ATTR_EXCLUDED_LIBS, (false) ? JettyPlugin.getDefaultScope().getNode(JettyPlugin.PLUGIN_ID).getBoolean(ATTR_EXCLUDED_LIBS, ".*servlet-api.*") : ".*servlet-api.*"); </DeepExtract> }
eclipse-jetty-plugin
positive
5,627
@Override public ApiResponse<ChannelMembers> getChannelMembersForUser(String userId, String teamId, String etag) { return doApiRequest(HttpMethod.GET, apiUrl + getUserRoute(userId) + String.format("/teams/%s/channels/members", teamId), null, etag, ChannelMembers.class); }
@Override public ApiResponse<ChannelMembers> getChannelMembersForUser(String userId, String teamId, String etag) { <DeepExtract> return doApiRequest(HttpMethod.GET, apiUrl + getUserRoute(userId) + String.format("/teams/%s/channels/members", teamId), null, etag, ChannelMembers.class); </DeepExtract> }
mattermost4j
positive
5,629
public void segment(Collection<Document> docs, SegmentationMethod segmentation, boolean mergeSections) { log.info("Predicting segmentation {}...", segmentation.toString()); WorkspaceMode cMode = getTagger().getNN().getConfiguration().getInferenceWorkspaceMode(); getTagger().getNN().getConfiguration().setTrainingWorkspa...
public void segment(Collection<Document> docs, SegmentationMethod segmentation, boolean mergeSections) { log.info("Predicting segmentation {}...", segmentation.toString()); <DeepExtract> WorkspaceMode cMode = getTagger().getNN().getConfiguration().getInferenceWorkspaceMode(); getTagger().getNN().getConfiguration().setT...
SECTOR
positive
5,630
@Override public void draw(final Point2D start, final Point2D end) { endpoint.setVisible(true); endpoint.setLayoutX(GeometryUtils.moveOnPixel(end.getX() - ENDPOINT_SIZE / 2)); endpoint.setLayoutY(GeometryUtils.moveOnPixel(end.getY() - ENDPOINT_SIZE / 2)); clearPoints(); addPoint(start); if (DefaultConnectorTypes.getSid...
@Override public void draw(final Point2D start, final Point2D end) { endpoint.setVisible(true); endpoint.setLayoutX(GeometryUtils.moveOnPixel(end.getX() - ENDPOINT_SIZE / 2)); endpoint.setLayoutY(GeometryUtils.moveOnPixel(end.getY() - ENDPOINT_SIZE / 2)); <DeepExtract> clearPoints(); addPoint(start); if (DefaultConnect...
graph-editor
positive
5,631
public void run() { synchronized (mParametersSync) { Log.d(TAG, "setCameraMode -- start " + mode); mIsModeSwitching = true; Camera.Parameters params = getParameters(); if (params == null) { return; } boolean shouldStartPreview = false; if (mode == CameraActivity.CAMERA_MODE_VIDEO) { if (!mIsRecordingHint) { params.setR...
public void run() { synchronized (mParametersSync) { Log.d(TAG, "setCameraMode -- start " + mode); mIsModeSwitching = true; Camera.Parameters params = getParameters(); if (params == null) { return; } boolean shouldStartPreview = false; if (mode == CameraActivity.CAMERA_MODE_VIDEO) { if (!mIsRecordingHint) { params.setR...
-OpenGL-PanoramaCamera_Android
positive
5,632
public static final Intent getCubicLineChartIntent(Context context, XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, float smoothness, String activityTitle) { if (dataset == null || renderer == null || dataset.getSeriesCount() != renderer.getSeriesRendererCount()) { throw new IllegalArgumentException...
public static final Intent getCubicLineChartIntent(Context context, XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, float smoothness, String activityTitle) { <DeepExtract> if (dataset == null || renderer == null || dataset.getSeriesCount() != renderer.getSeriesRendererCount()) { throw new IllegalArg...
S-Tools
positive
5,633
private ParsingError handleError(StreamParser parser, ParsingContext ctxt) throws ParseException, TechnicalException { parser.ensureStartTag("error"); String name = parser.getAttribute("name"); String catc = parser.getAttribute("catch"); LOG.debug("expath-web parser: error: " + name + " catching " + catc); ParsingError...
private ParsingError handleError(StreamParser parser, ParsingContext ctxt) throws ParseException, TechnicalException { parser.ensureStartTag("error"); String name = parser.getAttribute("name"); String catc = parser.getAttribute("catch"); LOG.debug("expath-web parser: error: " + name + " catching " + catc); ParsingError...
servlex
positive
5,634
@SuppressWarnings("unchecked") public <T> T constructClass(Class<T> type) { if (type == null) { throw new IllegalArgumentException("Cannot construct class when beanClass is null"); } Class<T> toType = type; type = (Class<T>) ConstructorUtils.getTypeFromInnerCollection(type); if (type.isInterface()) { if (SortedSet.clas...
@SuppressWarnings("unchecked") public <T> T constructClass(Class<T> type) { if (type == null) { throw new IllegalArgumentException("Cannot construct class when beanClass is null"); } <DeepExtract> Class<T> toType = type; type = (Class<T>) ConstructorUtils.getTypeFromInnerCollection(type); if (type.isInterface()) { if (...
reflectutils
positive
5,635
@Override public int getInfo() { return this.numberOfRegenerators; }
@Override public int getInfo() { <DeepExtract> return this.numberOfRegenerators; </DeepExtract> }
ceons
positive
5,637
public Options addRequiredOption(String opt, String longOpt, boolean hasArg, String description) { Option option = new Option(opt, longOpt, hasArg, description); option.setRequired(true); String key = option.getKey(); if (option.hasLongOpt()) { longOpts.put(option.getLongOpt(), option); } if (option.isRequired()) { if ...
public Options addRequiredOption(String opt, String longOpt, boolean hasArg, String description) { Option option = new Option(opt, longOpt, hasArg, description); option.setRequired(true); <DeepExtract> String key = option.getKey(); if (option.hasLongOpt()) { longOpts.put(option.getLongOpt(), option); } if (option.isReq...
gateplugin-LearningFramework
positive
5,638
public FFReaderBuilder withRecordClass(Class<?> clazz) { classes.add(clazz); try { return read(new FileInputStream(inputStream)); } catch (Exception e) { throw new FFPojoException(e); } }
public FFReaderBuilder withRecordClass(Class<?> clazz) { classes.add(clazz); <DeepExtract> try { return read(new FileInputStream(inputStream)); } catch (Exception e) { throw new FFPojoException(e); } </DeepExtract> }
ffpojo
positive
5,639
protected void releaseAndWait(List<CountDownLatch> locks, int lockIndex) { log.debug("Releasing {}...", lockIndex); locks.get(lockIndex).countDown(); log.debug("Waiting for {} more iterations of the control loop.", 1); blockingLoopLatchTrigger(1); log.debug("Completed waiting on {} loop(s)", 1); }
protected void releaseAndWait(List<CountDownLatch> locks, int lockIndex) { log.debug("Releasing {}...", lockIndex); locks.get(lockIndex).countDown(); <DeepExtract> log.debug("Waiting for {} more iterations of the control loop.", 1); blockingLoopLatchTrigger(1); log.debug("Completed waiting on {} loop(s)", 1); </DeepExt...
parallel-consumer
positive
5,640
private void md5Transform(byte[] block) { long a = state[0]; long b = state[1]; long c = state[2]; long d = state[3]; long[] x = new long[16]; int i; int j; for (i = 0, j = 0; j < 64; i++, j += 4) { x[i] = b2iu(block[j]) | (b2iu(block[j + 1]) << 8) | (b2iu(block[j + 2]) << 16) | (b2iu(block[j + 3]) << 24); } return; lo...
private void md5Transform(byte[] block) { long a = state[0]; long b = state[1]; long c = state[2]; long d = state[3]; long[] x = new long[16]; int i; int j; for (i = 0, j = 0; j < 64; i++, j += 4) { x[i] = b2iu(block[j]) | (b2iu(block[j + 1]) << 8) | (b2iu(block[j + 2]) << 16) | (b2iu(block[j + 3]) << 24); } return; lo...
YoioJava
positive
5,641
private void processTableMapEvent(RawEventData eventData) { this.metrics.getRegistry().counter("augmenter.context.type.table_map").inc(1L); TableMapRawEventData tableMapRawEventData = TableMapRawEventData.class.cast(eventData); this.shouldAugmentFlag.set(false); this.queryType.set(null); this.queryOperationType.set(nul...
private void processTableMapEvent(RawEventData eventData) { this.metrics.getRegistry().counter("augmenter.context.type.table_map").inc(1L); TableMapRawEventData tableMapRawEventData = TableMapRawEventData.class.cast(eventData); <DeepExtract> this.shouldAugmentFlag.set(false); this.queryType.set(null); this.queryOperati...
replicator
positive
5,642
public static boolean adsEnabled(Context context) { Session session = LastFMApplication.getInstance().session; if (session == null || session.getSubscriber().equals("1")) { return false; } TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); if (!tm.getNetworkCountryIso().equals...
public static boolean adsEnabled(Context context) { Session session = LastFMApplication.getInstance().session; if (session == null || session.getSubscriber().equals("1")) { return false; } TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); if (!tm.getNetworkCountryIso().equals...
lastfm-android
positive
5,643
@Override public void onAnimationEnd(Animation animation) { if (refresh) { EventEntity obj = new EventEntity(FunctionConfig.UPDATE_FLAG, selectImages); RxBus.getDefault().post(obj); } }
@Override public void onAnimationEnd(Animation animation) { <DeepExtract> if (refresh) { EventEntity obj = new EventEntity(FunctionConfig.UPDATE_FLAG, selectImages); RxBus.getDefault().post(obj); } </DeepExtract> }
PictureSelector
positive
5,644
@Override public void delete(CourseSection entity) { entityDao.delete(entity); Long courseId = entity.getCourseId(); Long parentCourseSectionId = entity.getParentId(); if (courseId == null || parentCourseSectionId == null) { if (entity.getId() != null) { entity = getById(entity.getId()); courseId = entity.getCourseId()...
@Override public void delete(CourseSection entity) { entityDao.delete(entity); <DeepExtract> Long courseId = entity.getCourseId(); Long parentCourseSectionId = entity.getParentId(); if (courseId == null || parentCourseSectionId == null) { if (entity.getId() != null) { entity = getById(entity.getId()); courseId = entity...
muke
positive
5,645
public void setFcmToken(String fcmToken) { SharedPreferences.Editor editor = mPrefs.edit(); if (fcmToken != null) { editor.putString(FCM_TOKEN, fcmToken); } else { editor.remove(FCM_TOKEN); } editor.apply(); }
public void setFcmToken(String fcmToken) { <DeepExtract> SharedPreferences.Editor editor = mPrefs.edit(); if (fcmToken != null) { editor.putString(FCM_TOKEN, fcmToken); } else { editor.remove(FCM_TOKEN); } editor.apply(); </DeepExtract> }
natrium-android-wallet
positive
5,646
@Test public void should_fetch_offsets() throws IOException, ExecutionException, InterruptedException { String settingsSource = readFromClasspath("com/github/obourgain/elasticsearch/http/handler/document/termvector/settings.json"); ImmutableSettings.Builder settings = ImmutableSettings.builder().loadFromSource(settings...
@Test public void should_fetch_offsets() throws IOException, ExecutionException, InterruptedException { <DeepExtract> String settingsSource = readFromClasspath("com/github/obourgain/elasticsearch/http/handler/document/termvector/settings.json"); ImmutableSettings.Builder settings = ImmutableSettings.builder().loadFromS...
elasticsearch-http
positive
5,647
public static HtmlContentBuilder<HTMLElement> nav() { return new HtmlContentBuilder<>(createElement("nav", HTMLElement.class)); }
public static HtmlContentBuilder<HTMLElement> nav() { <DeepExtract> return new HtmlContentBuilder<>(createElement("nav", HTMLElement.class)); </DeepExtract> }
elemento
positive
5,648
public Builder clearFromId() { bitField0_ = (bitField0_ & ~0x00000008); java.lang.Object ref = fromId_; if (ref instanceof java.lang.String) { fromId_ = (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()...
public Builder clearFromId() { bitField0_ = (bitField0_ & ~0x00000008); <DeepExtract> java.lang.Object ref = fromId_; if (ref instanceof java.lang.String) { fromId_ = (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs...
IM
positive
5,649
public HPacket replaceFirstSubstring(String oldS, String newS) { if (1 == 0) { return this; } int max = packetInBytes.length; int i = packetInBytes.length - 2 - oldS.length(); while (i >= 6) { if (canReadString(i)) { String s = readString(i); System.out.println(s.contains(oldS)); if (s.contains(oldS) && i + 2 + s.lengt...
public HPacket replaceFirstSubstring(String oldS, String newS) { <DeepExtract> if (1 == 0) { return this; } int max = packetInBytes.length; int i = packetInBytes.length - 2 - oldS.length(); while (i >= 6) { if (canReadString(i)) { String s = readString(i); System.out.println(s.contains(oldS)); if (s.contains(oldS) && i...
G-Earth
positive
5,651
private void threadLoop() throws Exception { PointRecDsQueue.PointRec pl = queue.poll(1, TimeUnit.SECONDS); if (pl == null) { return; } list.clear(); list.add(pl); PointRecDsQueue.PointRec pl = null; int max = 100; do { pl = queue.poll(); if (pl == null) { break; } list.add(pl); max--; } while (pl != null && max > 0); ...
private void threadLoop() throws Exception { PointRecDsQueue.PointRec pl = queue.poll(1, TimeUnit.SECONDS); if (pl == null) { return; } list.clear(); list.add(pl); <DeepExtract> PointRecDsQueue.PointRec pl = null; int max = 100; do { pl = queue.poll(); if (pl == null) { break; } list.add(pl); max--; } while (pl != null...
hyena
positive
5,652
public void actionPerformed(java.awt.event.ActionEvent evt) { try { for (int i = 0; i < EventSetsListBox_Model.size(); i++) { JGAAP_API.addEventDriver(EventSetsListBox_Model.elementAt(i).toString()); } UpdateSelectedEventSetListBox(); } catch (Exception e) { logger.error("Error adding all EventDrivers", e); JOptionPane...
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> try { for (int i = 0; i < EventSetsListBox_Model.size(); i++) { JGAAP_API.addEventDriver(EventSetsListBox_Model.elementAt(i).toString()); } UpdateSelectedEventSetListBox(); } catch (Exception e) { logger.error("Error adding all EventDrivers", e...
JGAAP
positive
5,654
@Test public void test_4props_constructor() { fromProperties = new FromProperties(clock, tokenEndpointUrl, accessKeyId, accessKeySecret, scope); String actualTokenEndpointUrl = fromProperties.getTokenEndpointUrl(); assertTrue("expected tokenEndpointUrl " + tokenEndpointUrl + ", actual " + actualTokenEndpointUrl, tokenE...
@Test public void test_4props_constructor() { fromProperties = new FromProperties(clock, tokenEndpointUrl, accessKeyId, accessKeySecret, scope); <DeepExtract> String actualTokenEndpointUrl = fromProperties.getTokenEndpointUrl(); assertTrue("expected tokenEndpointUrl " + tokenEndpointUrl + ", actual " + actualTokenEndpo...
here-aaa-java-sdk
positive
5,655
static private void connectKey(SelectionKey key) throws Exception { SocketChannel channel = (SocketChannel) key.channel(); if (channel.isConnectionPending()) channel.finishConnect(); SocketChannel channel = (SocketChannel) key.channel(); Queue<ByteBuffer> bytebuffers = wrbuffers.get(channel); if (bytebuffers == null ||...
static private void connectKey(SelectionKey key) throws Exception { SocketChannel channel = (SocketChannel) key.channel(); if (channel.isConnectionPending()) channel.finishConnect(); <DeepExtract> SocketChannel channel = (SocketChannel) key.channel(); Queue<ByteBuffer> bytebuffers = wrbuffers.get(channel); if (bytebuff...
NetMash
positive
5,656
@Override public void visit(Multiplication m) { m.getLeftExpression().accept(this); m.getRightExpression().accept(this); }
@Override public void visit(Multiplication m) { <DeepExtract> m.getLeftExpression().accept(this); m.getRightExpression().accept(this); </DeepExtract> }
resthub
positive
5,657
public Object apply(Object... params) throws Exception { InstructionSetContext context = OperateDataCacheManager.fetchInstructionSetContext(true, environment.getContext().getExpressRunner(), environment.getContext(), environment.getContext().getExpressLoader(), environment.getContext().isSupportDynamicFieldName()); Ope...
public Object apply(Object... params) throws Exception { <DeepExtract> InstructionSetContext context = OperateDataCacheManager.fetchInstructionSetContext(true, environment.getContext().getExpressRunner(), environment.getContext(), environment.getContext().getExpressLoader(), environment.getContext().isSupportDynamicFie...
QLExpress
positive
5,658
@Override public String nextName() throws IOException { if (peek() != JsonToken.NAME) { throw new IllegalStateException("Expected " + JsonToken.NAME + " but was " + peek()); } Iterator<?> i = (Iterator<?>) peekStack(); Map.Entry<?, ?> entry = (Map.Entry<?, ?>) i.next(); stack.add(entry.getValue()); return (String) entr...
@Override public String nextName() throws IOException { <DeepExtract> if (peek() != JsonToken.NAME) { throw new IllegalStateException("Expected " + JsonToken.NAME + " but was " + peek()); } </DeepExtract> Iterator<?> i = (Iterator<?>) peekStack(); Map.Entry<?, ?> entry = (Map.Entry<?, ?>) i.next(); stack.add(entry.getV...
funf-core-android
positive
5,659
protected void startNewSearch(final String title, final String text) { disableNaviBar(); if (null != mVLTask) { mVLTask.removeEventListener(mVLTaskListener); mTm.cancelTask(mVLTask, null); } mTitle = title; mText = text; mCurPageToken = ""; YTDataAdapter.VideoListReq ytreq = new YTDataAdapter.VideoListReq(getSearchType...
protected void startNewSearch(final String title, final String text) { <DeepExtract> disableNaviBar(); if (null != mVLTask) { mVLTask.removeEventListener(mVLTaskListener); mTm.cancelTask(mVLTask, null); } mTitle = title; mText = text; mCurPageToken = ""; YTDataAdapter.VideoListReq ytreq = new YTDataAdapter.VideoListReq...
netmbuddy
positive
5,660
public static boolean isValidRawJSON(String text) { if (!_isPrepared) { Class<?> craftServerClass = Bukkit.getServer().getClass(); _craftBukkitPackage = new CachedPackage(craftServerClass.getPackage().getName()); try { Method getHandle = craftServerClass.getMethod("getHandle"); _minecraftPackage = new CachedPackage(get...
public static boolean isValidRawJSON(String text) { <DeepExtract> if (!_isPrepared) { Class<?> craftServerClass = Bukkit.getServer().getClass(); _craftBukkitPackage = new CachedPackage(craftServerClass.getPackage().getName()); try { Method getHandle = craftServerClass.getMethod("getHandle"); _minecraftPackage = new Cac...
NBTEditor
positive
5,661
private static Path getMp4Artifact(int duration) { FFmpeg ffmpeg = FFmpeg.atPath(); String filename = ""; int cutDuration = 5; int extraDuration = duration + 2 * cutDuration; if ("640x480" != null) { filename += "640x480" + "_" + 30 + "fps"; ffmpeg.addInput(UrlInput.fromUrl("testsrc=s=" + "640x480" + ":r=30:d=" + extra...
private static Path getMp4Artifact(int duration) { <DeepExtract> FFmpeg ffmpeg = FFmpeg.atPath(); String filename = ""; int cutDuration = 5; int extraDuration = duration + 2 * cutDuration; if ("640x480" != null) { filename += "640x480" + "_" + 30 + "fps"; ffmpeg.addInput(UrlInput.fromUrl("testsrc=s=" + "640x480" + ":r=...
Jaffree
positive
5,662
@Override protected Void doInBackground(Void... voids) { BackgroundThreadTasksHolder.super.notifyListener(task); return null; }
@Override protected Void doInBackground(Void... voids) { <DeepExtract> BackgroundThreadTasksHolder.super.notifyListener(task); </DeepExtract> return null; }
RairDemo
positive
5,663
private void assertDeleteCallDoesNotDeleteAnything(List<Employee> collection) { this.first = this.repository.saveSelective(this.first); this.second = this.repository.save(this.second); this.third = this.repository.save(this.third); this.fourth = this.repository.save(this.fourth); this.name = this.first.getName(); Asser...
private void assertDeleteCallDoesNotDeleteAnything(List<Employee> collection) { <DeepExtract> this.first = this.repository.saveSelective(this.first); this.second = this.repository.save(this.second); this.third = this.repository.save(this.third); this.fourth = this.repository.save(this.fourth); this.name = this.first.ge...
spring-data-mybatis
positive
5,664
public Criteria andPasswordIsNull() { if ("password is null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("password is null")); return (Criteria) this; }
public Criteria andPasswordIsNull() { <DeepExtract> if ("password is null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("password is null")); </DeepExtract> return (Criteria) this; }
Ordering
positive
5,665
@Test public void testValueMapCRUID() { int id = 999; Map<Integer, Section> contents = new HashMap<Integer, Section>(); contents.put(1, new SectionImpl("first", 1)); contents.put(2, new SectionImpl("second", 2)); session.insert().value(book::id, id).value(book::contents, contents).sync(); Book actual = session.select(B...
@Test public void testValueMapCRUID() { int id = 999; Map<Integer, Section> contents = new HashMap<Integer, Section>(); contents.put(1, new SectionImpl("first", 1)); contents.put(2, new SectionImpl("second", 2)); session.insert().value(book::id, id).value(book::contents, contents).sync(); Book actual = session.select(B...
casser
positive
5,666
@Override public void call(final JsonArray arguments) { registerWindow.close(); try { final User user = ((SecurityProviderSessionImpl) site.getSecurityProvider()).getUserFromSession(); if (arguments.length() == 2 && !(arguments.get(1) instanceof JreJsonNull)) { final double errorCode = arguments.getNumber(1); LOGGER.er...
@Override public void call(final JsonArray arguments) { <DeepExtract> registerWindow.close(); try { final User user = ((SecurityProviderSessionImpl) site.getSecurityProvider()).getUserFromSession(); if (arguments.length() == 2 && !(arguments.get(1) instanceof JreJsonNull)) { final double errorCode = arguments.getNumber...
ilves
positive
5,667
@Override public void onError(int error, Camera camera) { UIUtilities.showToast(CameraActivity.this, R.string.error_camera_failed); synchronized (mSavingInProgress) { mSavingInProgress = false; } synchronized (mSavingInProgress) { if (mSavingInProgress) { mBackPressedDuringPhoto = true; return; } } if (mMediaItemIntern...
@Override public void onError(int error, Camera camera) { UIUtilities.showToast(CameraActivity.this, R.string.error_camera_failed); synchronized (mSavingInProgress) { mSavingInProgress = false; } <DeepExtract> synchronized (mSavingInProgress) { if (mSavingInProgress) { mBackPressedDuringPhoto = true; return; } } if (mM...
mediaphone
positive
5,668
public static void patchPsiFile(@NotNull AdaPsiFile psiFile) { patchPsiFileIfMarked(psiFile, SYMBOLS_PATCH_MARKER, () -> { Document document = Utils.getPsiFileDocument(psiFile); VirtualFile virtualFile = Utils.getPsiFileVirtualFile(psiFile); if (document == null || virtualFile == null) { return; } String documentUri = ...
public static void patchPsiFile(@NotNull AdaPsiFile psiFile) { <DeepExtract> patchPsiFileIfMarked(psiFile, SYMBOLS_PATCH_MARKER, () -> { Document document = Utils.getPsiFileDocument(psiFile); VirtualFile virtualFile = Utils.getPsiFileVirtualFile(psiFile); if (document == null || virtualFile == null) { return; } String ...
Ada-IntelliJ
positive
5,669
private static void assertWarningUseThreadCreatepointBeforeThreadStartpoint(ListAppender<ILoggingEvent> listAppender, String correlationId, String parentThreadName, String childThreadName, String checkpointName) { List<ILoggingEvent> loggingEvents = listAppender.list; assertEquals(Level.WARN, loggingEvents.get(0).getLe...
private static void assertWarningUseThreadCreatepointBeforeThreadStartpoint(ListAppender<ILoggingEvent> listAppender, String correlationId, String parentThreadName, String childThreadName, String checkpointName) { <DeepExtract> List<ILoggingEvent> loggingEvents = listAppender.list; assertEquals(Level.WARN, loggingEvent...
ibis-ladybug
positive
5,670
@Override public Map<String, Object> getMap() { Map<String, Object> map = new HashMap<>(); map.put("limit", limit); map.put("page", page); map.put("order", order != null ? order.getValue() : null); map.put("campaign", campaign); map.put("voucher", voucher); map.put("result", result); map.put("voucher_type", voucherType...
@Override public Map<String, Object> getMap() { Map<String, Object> map = new HashMap<>(); map.put("limit", limit); map.put("page", page); map.put("order", order != null ? order.getValue() : null); map.put("campaign", campaign); map.put("voucher", voucher); map.put("result", result); map.put("voucher_type", voucherType...
voucherify-java-sdk
positive
5,671
@Override public Options prepareForBulkLoad() { dbOptions.setMaxBackgroundFlushes(4); return this; columnFamilyOptions.setDisableAutoCompactions(true); return this; columnFamilyOptions.setLevel0FileNumCompactionTrigger(1 << 30); return this; columnFamilyOptions.setLevel0SlowdownWritesTrigger(1 << 30); return this; colu...
@Override public Options prepareForBulkLoad() { dbOptions.setMaxBackgroundFlushes(4); return this; columnFamilyOptions.setDisableAutoCompactions(true); return this; columnFamilyOptions.setLevel0FileNumCompactionTrigger(1 << 30); return this; columnFamilyOptions.setLevel0SlowdownWritesTrigger(1 << 30); return this; <Dee...
kcache
positive
5,672
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_startup_shutdown_commands); final Intent intent = getIntent(); mSharedPrefsName = intent.getStringExtra(ARG_SHARED_PREFS_NAME); if (mSharedPrefsName == null) { throw new IllegalArgumentExcept...
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_startup_shutdown_commands); final Intent intent = getIntent(); mSharedPrefsName = intent.getStringExtra(ARG_SHARED_PREFS_NAME); if (mSharedPrefsName == null) { throw new IllegalArgumentExcept...
RtkGps
positive
5,673
private double lastFourSpeed() { int cI = getPrevPoint(pointIndex); int cIend = cI; long time = dts[cI]; int itC = 22; while ((time - dts[cI] < 3500) && (itC > 0)) { cI = getPrevPoint(cI); itC--; } if (cI == cIend) { return 0; } double dist = MapRoute.distBetweenCoords(lats[cI], lons[cI], lats[cIend], lons[cIend]); dou...
private double lastFourSpeed() { <DeepExtract> int cI = getPrevPoint(pointIndex); int cIend = cI; long time = dts[cI]; int itC = 22; while ((time - dts[cI] < 3500) && (itC > 0)) { cI = getPrevPoint(cI); itC--; } if (cI == cIend) { return 0; } double dist = MapRoute.distBetweenCoords(lats[cI], lons[cI], lats[cIend], lon...
MapNav
positive
5,674
public final java_libbashParser.escaped_character_return escaped_character() throws RecognitionException { java_libbashParser.escaped_character_return retval = new java_libbashParser.escaped_character_return(); return input.LT(1); CommonTree root_0 = null; Token ESC545 = null; Token DIGIT546 = null; Token DIGIT547 = nu...
public final java_libbashParser.escaped_character_return escaped_character() throws RecognitionException { java_libbashParser.escaped_character_return retval = new java_libbashParser.escaped_character_return(); <DeepExtract> return input.LT(1); </DeepExtract> CommonTree root_0 = null; Token ESC545 = null; Token DIGIT54...
bash
positive
5,675
@Override public void render(float delta, ShapeRenderer shape) { float step = 0.5f * delta * simulationSpeed; for (SimpleBody body : bodies) { body.pos.set(body.pos.cpy().add(body.vel.x * step, body.vel.y * step)); } calculateForces(); for (SimpleBody body : bodies) { body.vel.set(body.vel.cpy().add(body.accel.x * delt...
@Override public void render(float delta, ShapeRenderer shape) { <DeepExtract> float step = 0.5f * delta * simulationSpeed; for (SimpleBody body : bodies) { body.pos.set(body.pos.cpy().add(body.vel.x * step, body.vel.y * step)); } calculateForces(); for (SimpleBody body : bodies) { body.vel.set(body.vel.cpy().add(body....
SpaceProject
positive
5,676
public void run() { if (size == 2) { if (elts[first] > elts[first + 1]) IntArraySortUtils.swap(elts, first, first + 1); } else if (size > 2) { int pivotPosition = IntArraySortUtils.partitionSegment(elts, first, size); PQSTask task1 = new PQSTask(elts, first, pivotPosition - first); PQSTask task2 = new PQSTask(elts, piv...
public void run() { <DeepExtract> if (size == 2) { if (elts[first] > elts[first + 1]) IntArraySortUtils.swap(elts, first, first + 1); } else if (size > 2) { int pivotPosition = IntArraySortUtils.partitionSegment(elts, first, size); PQSTask task1 = new PQSTask(elts, first, pivotPosition - first); PQSTask task2 = new PQS...
java_concurrency
positive
5,677
public void actionPerformed(java.awt.event.ActionEvent evt) { GuiReadFile.loadMergeConfiguration(variables, fileChooser, this); }
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> GuiReadFile.loadMergeConfiguration(variables, fileChooser, this); </DeepExtract> }
prov-viewer
positive
5,678
public static void error(String message, Throwable t) { if (getDefault() != null) getDefault().getLog().log(getDefault().getStatusFactory().toStatus(message, t, null)); else System.err.println(getDefault().getStatusFactory().toStatus(message, t, null).getMessage()); }
public static void error(String message, Throwable t) { <DeepExtract> if (getDefault() != null) getDefault().getLog().log(getDefault().getStatusFactory().toStatus(message, t, null)); else System.err.println(getDefault().getStatusFactory().toStatus(message, t, null).getMessage()); </DeepExtract> }
mylyn-mantis
positive
5,679
@Override public void onChange(boolean selfChange) { return Settings.System.getInt(mContext.getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) == 1; }
@Override public void onChange(boolean selfChange) { <DeepExtract> return Settings.System.getInt(mContext.getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) == 1; </DeepExtract> }
BottomSheetPickers
positive
5,680
public void actionPerformed(java.awt.event.ActionEvent evt) { btnSend("AT+CWLIF"); }
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> btnSend("AT+CWLIF"); </DeepExtract> }
ESPlorer
positive
5,681
public void binderDied() { Logger.d(TAG, String.format("binderDied() name = %s, service = %s", mName, mService)); synchronized (PluginServiceConnection.this) { mBinderMap.remove(mName); } if (mBase != null && mName != null) { Logger.d(TAG, String.format("call %s onServiceDisconnected(%s , %s, %s)", mBase, mName, mServi...
public void binderDied() { Logger.d(TAG, String.format("binderDied() name = %s, service = %s", mName, mService)); synchronized (PluginServiceConnection.this) { mBinderMap.remove(mName); } <DeepExtract> if (mBase != null && mName != null) { Logger.d(TAG, String.format("call %s onServiceDisconnected(%s , %s, %s)", mBase,...
PluginM
positive
5,682
public static boolean Unpositive_float(String value) { Pattern pattern = Pattern.compile(V_UNPOSITIVE_FLOAT); Matcher matcher = pattern.matcher(value); return matcher.matches(); }
public static boolean Unpositive_float(String value) { <DeepExtract> Pattern pattern = Pattern.compile(V_UNPOSITIVE_FLOAT); Matcher matcher = pattern.matcher(value); return matcher.matches(); </DeepExtract> }
search-spring-boot-starter
positive
5,683
public boolean doNext(Resource resource) { if (iterator == null) { reset(); } return true; }
public boolean doNext(Resource resource) { if (iterator == null) { reset(); } <DeepExtract> return true; </DeepExtract> }
halo-docs
positive
5,684
public <T> T get(String url, Type type) throws IOException { OkHttpClient client = new OkHttpClient(); Response response = client.newCall(buildPost(url, null)).execute(); return GOSN.fromJson(response.body().string(), type); }
public <T> T get(String url, Type type) throws IOException { <DeepExtract> OkHttpClient client = new OkHttpClient(); Response response = client.newCall(buildPost(url, null)).execute(); return GOSN.fromJson(response.body().string(), type); </DeepExtract> }
raincat
positive
5,685
@SuppressWarnings({ "unchecked", "rawtypes" }) public void let() { debugMethodCall("=> "); if (row.size() != 5) { getFormatter().exception(row.getCell(row.size() - 1), "Not all cells found: | let | label | type | expr | result |"); debugMethodCallEnd(); return; } String label = row.getCell(1).text().trim(); String loc ...
@SuppressWarnings({ "unchecked", "rawtypes" }) public void let() { <DeepExtract> debugMethodCall("=> "); </DeepExtract> if (row.size() != 5) { getFormatter().exception(row.getCell(row.size() - 1), "Not all cells found: | let | label | type | expr | result |"); debugMethodCallEnd(); return; } String label = row.getCell(...
RestFixture
positive
5,686
@Override public boolean beforeHandle(Jt808ServerExchange exchange, Object handler) { boolean continueProcess = true; for (Jt808RequestLifecycleListener listener : listeners) { try { final boolean success = listener -> listener.beforeHandle(exchange, handler).apply(listener); if (!success) { continueProcess = false; } ...
@Override public boolean beforeHandle(Jt808ServerExchange exchange, Object handler) { <DeepExtract> boolean continueProcess = true; for (Jt808RequestLifecycleListener listener : listeners) { try { final boolean success = listener -> listener.beforeHandle(exchange, handler).apply(listener); if (!success) { continueProce...
jt-framework
positive
5,687
public void setIndicatorSize(@Px float size) { indicatorSize = size; if (!indicatorEnabled) { return; } int indicatorSpace = curvedEnabled ? curvedIndicatorSpace : 0; int halfIndicatorSize = (int) (indicatorSize / 2f); int indicatorHeadCenterYCoordinate = wheelCenterYCoordinate + halfItemHeight + indicatorSpace; int in...
public void setIndicatorSize(@Px float size) { indicatorSize = size; <DeepExtract> if (!indicatorEnabled) { return; } int indicatorSpace = curvedEnabled ? curvedIndicatorSpace : 0; int halfIndicatorSize = (int) (indicatorSize / 2f); int indicatorHeadCenterYCoordinate = wheelCenterYCoordinate + halfItemHeight + indicato...
AndroidPicker
positive
5,688
@Test public void testExactlyOnceWriterWithWatermark() throws Exception { final String streamName = RandomStringUtils.randomAlphabetic(20); final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment().setParallelism(1).enableCheckpointing(1000, CheckpointingMode.EXACTLY_ONCE); env.getConf...
@Test public void testExactlyOnceWriterWithWatermark() throws Exception { final String streamName = RandomStringUtils.randomAlphabetic(20); final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment().setParallelism(1).enableCheckpointing(1000, CheckpointingMode.EXACTLY_ONCE); env.getConf...
flink-connectors
positive
5,689
public static String minimalDate(Date date) { if (date == null || DateUtil.minimalDateFormat() == null) { return ""; } synchronized (DateUtil.minimalDateFormat()) { return DateUtil.minimalDateFormat().format(date); } }
public static String minimalDate(Date date) { <DeepExtract> if (date == null || DateUtil.minimalDateFormat() == null) { return ""; } synchronized (DateUtil.minimalDateFormat()) { return DateUtil.minimalDateFormat().format(date); } </DeepExtract> }
snails
positive
5,690
public Criteria andMp3urlNotIn(List<String> values) { if (values == null) { throw new RuntimeException("Value for " + "mp3url" + " cannot be null"); } criteria.add(new Criterion("mp3url not in", values)); return (Criteria) this; }
public Criteria andMp3urlNotIn(List<String> values) { <DeepExtract> if (values == null) { throw new RuntimeException("Value for " + "mp3url" + " cannot be null"); } criteria.add(new Criterion("mp3url not in", values)); </DeepExtract> return (Criteria) this; }
ReptilianDemo
positive
5,691
public Criteria andOrderIdLessThanOrEqualTo(Integer value) { if (value == null) { throw new RuntimeException("Value for " + "orderId" + " cannot be null"); } criteria.add(new Criterion("order_id <=", value)); return (Criteria) this; }
public Criteria andOrderIdLessThanOrEqualTo(Integer value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "orderId" + " cannot be null"); } criteria.add(new Criterion("order_id <=", value)); </DeepExtract> return (Criteria) this; }
XiaoMiShop
positive
5,692
public Builder writeDouble(Key<Double> key, String fieldName) { BiConsumer<JsonGenerator, ? extends V> keyValueWriter = (JsonGenerator generator, V value) -> { try { generator.writeFieldName(fieldName); Serialisers.toDouble.accept(generator, value); } catch (IOException e) { throw new SerialisationException(e); } }; se...
public Builder writeDouble(Key<Double> key, String fieldName) { <DeepExtract> BiConsumer<JsonGenerator, ? extends V> keyValueWriter = (JsonGenerator generator, V value) -> { try { generator.writeFieldName(fieldName); Serialisers.toDouble.accept(generator, value); } catch (IOException e) { throw new SerialisationExcepti...
octarine
positive
5,693
public static long readUInt32(byte[] bytes, int offset) { int o = ReverseUtils.reverse(bytes, offset); int value = 0; if (ByteOrder.LITTLE == ByteOrder.LITTLE) { value |= (bytes[o] & 0xFF); value |= ((bytes[o + 1] & 0xFF) << 8); value |= ((bytes[o + 2] & 0xFF) << 16); value |= ((bytes[o + 3] & 0xFF) << 24); } else if (...
public static long readUInt32(byte[] bytes, int offset) { <DeepExtract> int o = ReverseUtils.reverse(bytes, offset); int value = 0; if (ByteOrder.LITTLE == ByteOrder.LITTLE) { value |= (bytes[o] & 0xFF); value |= ((bytes[o + 1] & 0xFF) << 8); value |= ((bytes[o + 2] & 0xFF) << 16); value |= ((bytes[o + 3] & 0xFF) << 24...
fastproto
positive
5,694