before
stringlengths
12
3.21M
after
stringlengths
41
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
public void setFlowflag(FlowUnitsType flowflag) throws ENException { values.put(FLOWFLAG, flowflag); }
public void setFlowflag(FlowUnitsType flowflag) throws ENException { <DeepExtract> values.put(FLOWFLAG, flowflag); </DeepExtract> }
Baseform-Epanet-Java-Library
positive
4,594
@Deprecated public CSVFormat withEscape(final char escape) { return new CSVFormat(this); }
@Deprecated public CSVFormat withEscape(final char escape) { <DeepExtract> return new CSVFormat(this); </DeepExtract> }
commons-csv
positive
4,595
public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields; switch(fieldId) { case 1: fields = TRUE_AS_OF_SECS; default: fields = null; } if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; }
public static _Fields findByThriftIdOrThrow(int fieldId) { <DeepExtract> _Fields fields; switch(fieldId) { case 1: fields = TRUE_AS_OF_SECS; default: fields = null; } </DeepExtract> if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; }
big-data-src
positive
4,596
public RetCode cdlAdvanceBlock(int startIdx, int endIdx, float[] inOpen, float[] inHigh, float[] inLow, float[] inClose, MInteger outBegIdx, MInteger outNBElement, int[] outInteger) { double[] ShadowShortPeriodTotal = new double[3]; double[] ShadowLongPeriodTotal = new double[2]; double[] NearPeriodTotal = new double[3...
public RetCode cdlAdvanceBlock(int startIdx, int endIdx, float[] inOpen, float[] inHigh, float[] inLow, float[] inClose, MInteger outBegIdx, MInteger outNBElement, int[] outInteger) { double[] ShadowShortPeriodTotal = new double[3]; double[] ShadowLongPeriodTotal = new double[2]; double[] NearPeriodTotal = new double[3...
clj-ta-lib
positive
4,597
public Object[][] getInnerData() { Object[][] data = new Object[this.results.size()][3]; int i = 0; for (PassageDistancesResult result : this.results) { data[i][0] = result.getDocumentAId(); data[i][1] = result.getDocumentBId(); Double value = new Double(result.getDistance()); DecimalFormat df = new DecimalFormat("#0.0...
public Object[][] getInnerData() { <DeepExtract> Object[][] data = new Object[this.results.size()][3]; int i = 0; for (PassageDistancesResult result : this.results) { data[i][0] = result.getDocumentAId(); data[i][1] = result.getDocumentBId(); Double value = new Double(result.getDistance()); DecimalFormat df = new Decim...
tml
positive
4,598
public TestSource appendTestFields(TestField... fields) { this.specs.addAll(Arrays.asList(Arrays.stream(fields).map(TestField::createFieldSpec).toArray(FieldSpec[]::new))); return this; }
public TestSource appendTestFields(TestField... fields) { <DeepExtract> this.specs.addAll(Arrays.asList(Arrays.stream(fields).map(TestField::createFieldSpec).toArray(FieldSpec[]::new))); return this; </DeepExtract> }
Akatsuki
positive
4,599
public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { final int recoverAnimSize = dX.size(); for (int i = 0; i < recoverAnimSize; i++) { final SakaItemTouchHelper.RecoverAnimation anim = dX.get(i); anim.update()...
public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { <DeepExtract> final int recoverAnimSize = dX.size(); for (int i = 0; i < recoverAnimSize; i++) { final SakaItemTouchHelper.RecoverAnimation anim = dX.get(i);...
TimeLine
positive
4,600
@Test public void preciseMatch() { LocaleMapping lm = impl(); assertThat(lm.findClosestMatch(candidateLocales, new Locale("a", "b", "c")), is(new Locale("a", "b", "c"))); LocaleMapping lm = impl(); assertThat(lm.findClosestMatch(candidateLocales, new Locale("a", "b")), is(new Locale("a", "b"))); LocaleMapping lm = impl...
@Test public void preciseMatch() { LocaleMapping lm = impl(); assertThat(lm.findClosestMatch(candidateLocales, new Locale("a", "b", "c")), is(new Locale("a", "b", "c"))); LocaleMapping lm = impl(); assertThat(lm.findClosestMatch(candidateLocales, new Locale("a", "b")), is(new Locale("a", "b"))); <DeepExtract> LocaleMap...
c10n
positive
4,601
void start() { this.removeMessages(MESSAGE_TICK); this.mStatus = MARQUEE_RUNNING; if (mStatus != MARQUEE_RUNNING) { return; } removeMessages(MESSAGE_TICK); final TextView textView = mView.get(); if (textView != null) { if (mScroll >= mMaxScrollX) { mScrollUpdate = -mScrollUnit; } else if (mScroll < mMinScrollX) { mScro...
void start() { this.removeMessages(MESSAGE_TICK); this.mStatus = MARQUEE_RUNNING; <DeepExtract> if (mStatus != MARQUEE_RUNNING) { return; } removeMessages(MESSAGE_TICK); final TextView textView = mView.get(); if (textView != null) { if (mScroll >= mMaxScrollX) { mScrollUpdate = -mScrollUnit; } else if (mScroll < mMinSc...
Pure-File-Manager
positive
4,602
public int[][] updateMatrix(int[][] matrix) { Queue<int[]> queue = new LinkedList<>(); ; int m = matrix.length, n = matrix[0].length; boolean[][] used = new boolean[m][n]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (matrix[i][j] == 0) { queue.offer(new int[] { i, j }); used[i][j] = true; } } } int[]...
public int[][] updateMatrix(int[][] matrix) { <DeepExtract> Queue<int[]> queue = new LinkedList<>(); ; int m = matrix.length, n = matrix[0].length; boolean[][] used = new boolean[m][n]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (matrix[i][j] == 0) { queue.offer(new int[] { i, j }); used[i][j] = tru...
LeetCode
positive
4,603
@Override protected void onSetUpView() { fileMessageBody = (NormalFileMessageBody) message.getBody(); String filePath = fileMessageBody.getLocalUrl(); fileNameView.setText(fileMessageBody.getFileName()); fileSizeView.setText(TextFormater.getDataSize(fileMessageBody.getFileSize())); if (message.direct == EMMessage.Direc...
@Override protected void onSetUpView() { fileMessageBody = (NormalFileMessageBody) message.getBody(); String filePath = fileMessageBody.getLocalUrl(); fileNameView.setText(fileMessageBody.getFileName()); fileSizeView.setText(TextFormater.getDataSize(fileMessageBody.getFileSize())); if (message.direct == EMMessage.Direc...
EaseUICustomer
positive
4,604
public static void killProcess(String processName) { if (hasBusyBox()) { fastRebootCommand = "busybox killall " + processName; } else { fastRebootCommand = "killall " + processName; } ShellCommand cmd = new ShellCommand(new String[] { fastRebootCommand }, true); return Shell.runCommand(cmd); }
public static void killProcess(String processName) { if (hasBusyBox()) { fastRebootCommand = "busybox killall " + processName; } else { fastRebootCommand = "killall " + processName; } <DeepExtract> ShellCommand cmd = new ShellCommand(new String[] { fastRebootCommand }, true); return Shell.runCommand(cmd); </DeepExtract...
apptoolkit
positive
4,605
public Criteria andCreatetimeIsNotNull() { if ("createtime is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("createtime is not null")); return (Criteria) this; }
public Criteria andCreatetimeIsNotNull() { <DeepExtract> if ("createtime is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("createtime is not null")); </DeepExtract> return (Criteria) this; }
Maven-Spring-SpringMVC-Mybatis
positive
4,606
public void testRideImporterShortRide() throws IOException, ParseException { InputStream is = getClass().getClassLoader().getResourceAsStream("assets/ride-short.ride"); BikeyRideImporter importer = new BikeyRideImporter(mContentResolver, is, getRideImporterProgressListener()); importer.doImport(); RideSelection rideSel...
public void testRideImporterShortRide() throws IOException, ParseException { InputStream is = getClass().getClassLoader().getResourceAsStream("assets/ride-short.ride"); BikeyRideImporter importer = new BikeyRideImporter(mContentResolver, is, getRideImporterProgressListener()); importer.doImport(); RideSelection rideSel...
bikey
positive
4,607
private void initStarImageViews() { removeAllViews(); for (int i = 0; i < starCount; ++i) { ImageView imageView = new ImageView(getContext()); LayoutParams param = new LayoutParams(starWidth, starHeight, 1.0f); imageView.setLayoutParams(param); imageView.setPadding(starPaddingBoth, 0, starPaddingBoth, 0); imageView.set...
private void initStarImageViews() { removeAllViews(); for (int i = 0; i < starCount; ++i) { ImageView imageView = new ImageView(getContext()); LayoutParams param = new LayoutParams(starWidth, starHeight, 1.0f); imageView.setLayoutParams(param); imageView.setPadding(starPaddingBoth, 0, starPaddingBoth, 0); imageView.set...
QuickDevFramework
positive
4,609
public RetCode cdl2Crows(int startIdx, int endIdx, double[] inOpen, double[] inHigh, double[] inLow, double[] inClose, MInteger outBegIdx, MInteger outNBElement, int[] outInteger) { if (startIdx < 0) return RetCode.OutOfRangeStartIndex; if ((endIdx < 0) || (endIdx < startIdx)) return RetCode.OutOfRangeEndIndex; return ...
public RetCode cdl2Crows(int startIdx, int endIdx, double[] inOpen, double[] inHigh, double[] inLow, double[] inClose, MInteger outBegIdx, MInteger outNBElement, int[] outInteger) { if (startIdx < 0) return RetCode.OutOfRangeStartIndex; if ((endIdx < 0) || (endIdx < startIdx)) return RetCode.OutOfRangeEndIndex; <DeepEx...
clj-ta-lib
positive
4,611
@Override public void moveTo(float x, float y) throws IOException { if (rectanglePath == null) { rectanglePath = new Rectangle2D.Double(x, y, 0, 0); } else { rectanglePath.add(x, y); } }
@Override public void moveTo(float x, float y) throws IOException { <DeepExtract> if (rectanglePath == null) { rectanglePath = new Rectangle2D.Double(x, y, 0, 0); } else { rectanglePath.add(x, y); } </DeepExtract> }
testarea-pdfbox2
positive
4,612
private void setFunctions(byte[] buffer, int length) { StringBuilder funcList = new StringBuilder(); functions = new ArrayList<>(); for (int ptr = 5, max = length - 2; ptr < max; ptr++) { if (buffer[ptr] == 0) { functions.add(Function.BIND_IMAGE); funcList.append("BIND, "); } else if (buffer[ptr] == 2) { functions.add(...
private void setFunctions(byte[] buffer, int length) { StringBuilder funcList = new StringBuilder(); functions = new ArrayList<>(); for (int ptr = 5, max = length - 2; ptr < max; ptr++) { if (buffer[ptr] == 0) { functions.add(Function.BIND_IMAGE); funcList.append("BIND, "); } else if (buffer[ptr] == 2) { functions.add(...
dm3270
positive
4,613
public final K lastKey() { if (subHighest() == null) throw new NoSuchElementException(); return subHighest().key; }
public final K lastKey() { <DeepExtract> if (subHighest() == null) throw new NoSuchElementException(); return subHighest().key; </DeepExtract> }
bbst-showdown
positive
4,614
public String getLimitString(String sql, int offset, int limit) { if (offset > 0) { throw new UnsupportedOperationException("sql server has no offset"); } return new StringBuffer(sql.length() + 8).append(sql).insert(getAfterSelectInsertPoint(sql), " top " + limit).toString(); }
public String getLimitString(String sql, int offset, int limit) { <DeepExtract> if (offset > 0) { throw new UnsupportedOperationException("sql server has no offset"); } return new StringBuffer(sql.length() + 8).append(sql).insert(getAfterSelectInsertPoint(sql), " top " + limit).toString(); </DeepExtract> }
redis-admin
positive
4,615
public int getVersion() { return properties.optInt("version", 1); }
public int getVersion() { <DeepExtract> return properties.optInt("version", 1); </DeepExtract> }
WireGoggles
positive
4,616
public void actionPerformed(java.awt.event.ActionEvent evt) { if (restrart_a_previous_run_option.isSelected() == false) { Options_8 = " empty "; Options_9 = " empty "; restart_a_previous_run_box.setText(""); } }
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> if (restrart_a_previous_run_option.isSelected() == false) { Options_8 = " empty "; Options_9 = " empty "; restart_a_previous_run_box.setText(""); } </DeepExtract> }
ERSN-OpenMC
positive
4,617
public void onClick(View view) { mResponse.arg1 = R.id.button_do_nothing; mResponse.sendToTarget(); dismiss(); }
public void onClick(View view) { <DeepExtract> mResponse.arg1 = R.id.button_do_nothing; mResponse.sendToTarget(); dismiss(); </DeepExtract> }
practical-android
positive
4,618
public void reset() { super.reset(); resetThreadCountField(threadCountField, 4); primeSet.clear(); setState(0); GlobalConcurrentMap.set(new ConcurrentHashMap<Integer, String>()); message1(" ", ConcurrentExampleConstants.DEFAULT_BACKGROUND); message2(" ", ConcurrentExampleConstants.DEFAULT_BACKGROUND); }
public void reset() { super.reset(); <DeepExtract> resetThreadCountField(threadCountField, 4); </DeepExtract> primeSet.clear(); setState(0); GlobalConcurrentMap.set(new ConcurrentHashMap<Integer, String>()); message1(" ", ConcurrentExampleConstants.DEFAULT_BACKGROUND); message2(" ", ConcurrentExampleConstants.DEFAULT_B...
java-concurrent-animated
positive
4,619
@Test public void testGetSecretAsParamAsync() throws Exception { final SsmAsyncClient ssmAsyncClient = TestUtils.getClientSSMAsyncV2(); final SecretsManagerAsyncClient secretsManagerAsyncClient = TestUtils.getClientSecretsManagerAsyncV2(); final String secretName = "test-s-" + UUID.randomUUID().toString(); createReq ->...
@Test public void testGetSecretAsParamAsync() throws Exception { final SsmAsyncClient ssmAsyncClient = TestUtils.getClientSSMAsyncV2(); final SecretsManagerAsyncClient secretsManagerAsyncClient = TestUtils.getClientSecretsManagerAsyncV2(); <DeepExtract> final String secretName = "test-s-" + UUID.randomUUID().toString()...
localstack-java-utils
positive
4,620
private void processGTIDEvent(RawEventData eventData, String lastGTIDSet) { this.metrics.getRegistry().counter("augmenter_context.type.gtid").inc(1L); GTIDRawEventData gtidRawEventData = GTIDRawEventData.class.cast(eventData); this.gtidSet.set(lastGTIDSet); this.shouldAugmentFlag.set(false); this.queryType.set(QueryAug...
private void processGTIDEvent(RawEventData eventData, String lastGTIDSet) { this.metrics.getRegistry().counter("augmenter_context.type.gtid").inc(1L); GTIDRawEventData gtidRawEventData = GTIDRawEventData.class.cast(eventData); this.gtidSet.set(lastGTIDSet); this.shouldAugmentFlag.set(false); this.queryType.set(QueryAug...
replicator
positive
4,622
@Override public void widgetSelected(SelectionEvent e) { int index = configTable.getSelectionIndex(); if (index >= 0) { JettyLaunchConfigEntry entry = configEntryList.get(index); IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); IWorkbenchPage page = windo...
@Override public void widgetSelected(SelectionEvent e) { <DeepExtract> int index = configTable.getSelectionIndex(); if (index >= 0) { JettyLaunchConfigEntry entry = configEntryList.get(index); IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); IWorkbenchPag...
eclipse-jetty-plugin
positive
4,623
public void addJdkRequirement(@NotNull Set<Requirement> requirements, @NotNull TaskDefinition taskDefinition, @NotNull String cfgJdkLabel) { final String builderLabel = taskDefinition.getConfiguration().get(cfgJdkLabel); if (builderLabel != null) { requirements.add(new RequirementImpl(Jdk.CAPABILITY_JDK_PREFIX + "." + ...
public void addJdkRequirement(@NotNull Set<Requirement> requirements, @NotNull TaskDefinition taskDefinition, @NotNull String cfgJdkLabel) { <DeepExtract> final String builderLabel = taskDefinition.getConfiguration().get(cfgJdkLabel); if (builderLabel != null) { requirements.add(new RequirementImpl(Jdk.CAPABILITY_JDK_P...
bamboo-artifactory-plugin
positive
4,624
public void doEnterCity(Long chatId, String city) { Matcher matcher = CITY_PATTERN.matcher(city); if (!matcher.find()) { telegramService.sendMessage(new MessageSend(chatId, "You entered the incorrect city, try again.")); return; } Order order = orderStepService.findCachedOrderByChatId(chatId); order.getClient().setCity...
public void doEnterCity(Long chatId, String city) { Matcher matcher = CITY_PATTERN.matcher(city); if (!matcher.find()) { telegramService.sendMessage(new MessageSend(chatId, "You entered the incorrect city, try again.")); return; } Order order = orderStepService.findCachedOrderByChatId(chatId); order.getClient().setCity...
shop-telegram-bot
positive
4,625
public static ChunkBinary fromChunk(Chunk chunk, NamedTag nbt, boolean isEntities) throws IOException { if (nbt == null) { return null; } if (Config.writeChunksAsNbt()) { String filename = (isEntities ? "E" : "B") + chunk.location.getX() + "_" + chunk.location.getZ(); Path output = PathUtils.toPath(Config.getWorldOutpu...
public static ChunkBinary fromChunk(Chunk chunk, NamedTag nbt, boolean isEntities) throws IOException { if (nbt == null) { return null; } if (Config.writeChunksAsNbt()) { String filename = (isEntities ? "E" : "B") + chunk.location.getX() + "_" + chunk.location.getZ(); Path output = PathUtils.toPath(Config.getWorldOutpu...
minecraft-world-downloader
positive
4,626
private void btn_comment_materialsMouseEntered(java.awt.event.MouseEvent evt) { btn_comment_materials.setBackground(Color.RED); int caretPosition = guide_materials.getCaretPosition(); guide_materials.setText("Comment"); guide_materials.setCaretPosition(Math.min(caretPosition, guide_materials.getText().length())); }
private void btn_comment_materialsMouseEntered(java.awt.event.MouseEvent evt) { btn_comment_materials.setBackground(Color.RED); <DeepExtract> int caretPosition = guide_materials.getCaretPosition(); guide_materials.setText("Comment"); guide_materials.setCaretPosition(Math.min(caretPosition, guide_materials.getText().len...
ERSN-OpenMC
positive
4,628
@ResponseStatus(value = HttpStatus.NOT_FOUND) @ExceptionHandler(FileNotFoundException.class) public VndErrors fileNotFoundException(FileNotFoundException ex) { String msg = Optional.of(ex.getMessage()).orElse(ex.getClass().getSimpleName()); return new VndErrors(ex.getLocalizedMessage(), msg); }
@ResponseStatus(value = HttpStatus.NOT_FOUND) @ExceptionHandler(FileNotFoundException.class) public VndErrors fileNotFoundException(FileNotFoundException ex) { <DeepExtract> String msg = Optional.of(ex.getMessage()).orElse(ex.getClass().getSimpleName()); return new VndErrors(ex.getLocalizedMessage(), msg); </DeepExtrac...
building-microservices
positive
4,629
public String execute(Shell ci, String[] args) { long totalMem = Runtime.getRuntime().totalMemory(); long freeMem = Runtime.getRuntime().freeMemory(); if ("Free Memory : " + freeMem / (1024.0 * 1024) + " mbytes" != null && "Free Memory : " + freeMem / (1024.0 * 1024) + " mbytes".length() > 0) { System.out.println("Fr...
public String execute(Shell ci, String[] args) { long totalMem = Runtime.getRuntime().totalMemory(); long freeMem = Runtime.getRuntime().freeMemory(); if ("Free Memory : " + freeMem / (1024.0 * 1024) + " mbytes" != null && "Free Memory : " + freeMem / (1024.0 * 1024) + " mbytes".length() > 0) { System.out.println("Fr...
jEN
positive
4,630
@Override public IQ handleIQRequest(IQ iqRequest) { Boolean doMute = (MuteIq) iqRequest.getMute(); Jid from = (MuteIq) iqRequest.getFrom(); if (doMute == null || !from.getResourceOrEmpty().toString().equals(this.gatewaySession.getFocusResourceAddr())) { return IQ.createErrorResponse((MuteIq) iqRequest, StanzaError.getB...
@Override public IQ handleIQRequest(IQ iqRequest) { <DeepExtract> Boolean doMute = (MuteIq) iqRequest.getMute(); Jid from = (MuteIq) iqRequest.getFrom(); if (doMute == null || !from.getResourceOrEmpty().toString().equals(this.gatewaySession.getFocusResourceAddr())) { return IQ.createErrorResponse((MuteIq) iqRequest, St...
jigasi
positive
4,631
public Saudacao setNovaSaudacao(Saudacao novaSaudacao, String autorizacao) { String email = jwtService.getUsuarioId(autorizacao); novaSaudacao.setUsuario(usuarioService.getUsuario(email)); saudacoesDAO.save(novaSaudacao); return saudacoesDAO.findById((int) saudacoesDAO.count()).get(); }
public Saudacao setNovaSaudacao(Saudacao novaSaudacao, String autorizacao) { String email = jwtService.getUsuarioId(autorizacao); novaSaudacao.setUsuario(usuarioService.getUsuario(email)); saudacoesDAO.save(novaSaudacao); <DeepExtract> return saudacoesDAO.findById((int) saudacoesDAO.count()).get(); </DeepExtract> }
psoft
positive
4,632
public static boolean isAssignableBound(Type lhsType, Type rhsType) { if (rhsType == null) { return true; } if (lhsType == null) { return false; } Assert.notNull(lhsType, "Left-hand side type must not be null"); Assert.notNull(rhsType, "Right-hand side type must not be null"); if (lhsType.equals(rhsType) || lhsType.equ...
public static boolean isAssignableBound(Type lhsType, Type rhsType) { if (rhsType == null) { return true; } if (lhsType == null) { return false; } <DeepExtract> Assert.notNull(lhsType, "Left-hand side type must not be null"); Assert.notNull(rhsType, "Right-hand side type must not be null"); if (lhsType.equals(rhsType) ...
seny-devpkg
positive
4,633
public void selectFromTable(Class<? extends DAO> daoClass) throws DatabaseException { ModelDef model = em.getDefinition(daoClass); this.selectModel = model; involve(model); }
public void selectFromTable(Class<? extends DAO> daoClass) throws DatabaseException { ModelDef model = em.getDefinition(daoClass); <DeepExtract> this.selectModel = model; involve(model); </DeepExtract> }
orm
positive
4,634
public static String getVersion(Context context) { String versionName; try { PackageInfo pi = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); versionName = pi.versionName; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); versionName = context.getString(R.string.version_un...
public static String getVersion(Context context) { String versionName; try { PackageInfo pi = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); versionName = pi.versionName; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); versionName = context.getString(R.string.version_un...
guanggoo-android
positive
4,637
public void run() { System.out.format("%s: %s" + " 早上好!%n", this.name, lisi.getName()); lisi.bowBack(this); }
public void run() { <DeepExtract> System.out.format("%s: %s" + " 早上好!%n", this.name, lisi.getName()); lisi.bowBack(this); </DeepExtract> }
java-study
positive
4,640
public void onCreate() { mSensorManager = (SensorManager) activity.getSystemService(Context.SENSOR_SERVICE); if (mSensorManager == null) { throw new UnsupportedOperationException(); } Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); if (sensor == null) { throw new UnsupportedOperationExceptio...
public void onCreate() { <DeepExtract> mSensorManager = (SensorManager) activity.getSystemService(Context.SENSOR_SERVICE); if (mSensorManager == null) { throw new UnsupportedOperationException(); } Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); if (sensor == null) { throw new UnsupportedOpe...
cniao5-shop
positive
4,642
public long hash(byte[] buffer, long initialValue) { a = 0x09e3779b9L; b = 0x09e3779b9L; c = 0x0E6359A60L; pos = 0; for (len = buffer.length; len >= 12; len -= 12) { a = add(a, fourByteToLong(buffer, pos)); b = add(b, fourByteToLong(buffer, pos + 4)); c = add(c, fourByteToLong(buffer, pos + 8)); hashMix(); pos += 12; }...
public long hash(byte[] buffer, long initialValue) { a = 0x09e3779b9L; b = 0x09e3779b9L; c = 0x0E6359A60L; pos = 0; for (len = buffer.length; len >= 12; len -= 12) { a = add(a, fourByteToLong(buffer, pos)); b = add(b, fourByteToLong(buffer, pos + 4)); c = add(c, fourByteToLong(buffer, pos + 8)); hashMix(); pos += 12; }...
DeFacto
positive
4,643
public static void main(String[] args) { Scanner scan = new Scanner(System.in); Random rand = new Random(); System.out.println("Enter n:"); n = scan.nextInt(); k = n / 2; binaryArray = new int[n]; result = new int[n]; weights = new int[n]; for (int i = 0; i < weights.length; i++) { weights[i] = rand.nextInt(10); System...
public static void main(String[] args) { Scanner scan = new Scanner(System.in); Random rand = new Random(); System.out.println("Enter n:"); n = scan.nextInt(); k = n / 2; binaryArray = new int[n]; result = new int[n]; weights = new int[n]; for (int i = 0; i < weights.length; i++) { weights[i] = rand.nextInt(10); System...
masters
positive
4,644
public Hdr getTextHdr(WordprocessingMLPackage wordprocessingMLPackage, ObjectFactory factory, Part sourcePart, String content, JcEnumeration jcEnumeration) throws Exception { Hdr hdr = factory.createHdr(); P headP = factory.createP(); Text text = factory.createText(); text.setValue(content); R run = factory.createR(); ...
public Hdr getTextHdr(WordprocessingMLPackage wordprocessingMLPackage, ObjectFactory factory, Part sourcePart, String content, JcEnumeration jcEnumeration) throws Exception { Hdr hdr = factory.createHdr(); P headP = factory.createP(); Text text = factory.createText(); text.setValue(content); R run = factory.createR(); ...
docx4j-template
positive
4,645
@Override public void onSuccess(String t) { L.i("android:" + t.toString()); try { JSONObject jsonObject = new JSONObject(t); JSONArray jsonArrayResults = jsonObject.getJSONArray("results"); for (int i = 0; i < jsonArrayResults.length(); i++) { JSONObject json = (JSONObject) jsonArrayResults.get(i); StandardData data = ...
@Override public void onSuccess(String t) { L.i("android:" + t.toString()); <DeepExtract> try { JSONObject jsonObject = new JSONObject(t); JSONArray jsonArrayResults = jsonObject.getJSONArray("results"); for (int i = 0; i < jsonArrayResults.length(); i++) { JSONObject json = (JSONObject) jsonArrayResults.get(i); Standa...
LateNight
positive
4,646
public static String EnycrptDes(String src, String key, String charSet) throws Exception { String keyLen = StringUtils.EMPTY; if (key.length() >= 24) { keyLen = StringUtils.substring(key, key.length() - 24); } else { keyLen = StringUtils.leftPad(key, 24, "0"); } return keyLen; String ret = StringUtils.EMPTY; if (String...
public static String EnycrptDes(String src, String key, String charSet) throws Exception { <DeepExtract> String keyLen = StringUtils.EMPTY; if (key.length() >= 24) { keyLen = StringUtils.substring(key, key.length() - 24); } else { keyLen = StringUtils.leftPad(key, 24, "0"); } return keyLen; </DeepExtract> String ret = ...
carshop
positive
4,647
private void initData() { mGymCoach = new ArrayList<>(); mYogaCoach = new ArrayList<>(); mAdapter = new CoachListAdapter(getActivity()); mCoachListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() { @Override public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) { startGetRemo...
private void initData() { mGymCoach = new ArrayList<>(); mYogaCoach = new ArrayList<>(); mAdapter = new CoachListAdapter(getActivity()); mCoachListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() { @Override public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) { startGetRemo...
AppKit
positive
4,648
@Override protected void onResume() { super.onResume(); Units.instance.setFromPrefs(this); Bundle summaryBundle = getIntent().getExtras(); FlightSummary summary = new FlightSummary(summaryBundle); Units units = Units.instance; String altUnits = units.getAltitudeUnits(); String distUnits = units.getDistanceUnits(); Stri...
@Override protected void onResume() { super.onResume(); Units.instance.setFromPrefs(this); <DeepExtract> Bundle summaryBundle = getIntent().getExtras(); FlightSummary summary = new FlightSummary(summaryBundle); Units units = Units.instance; String altUnits = units.getAltitudeUnits(); String distUnits = units.getDistanc...
Gaggle
positive
4,649
@EventHandler public void onPlayerKick(PlayerKickEvent event) { if (!containsPlayer(event.getPlayer())) return; inRange.remove(event.getPlayer()); leavesRange(event.getPlayer()); }
@EventHandler public void onPlayerKick(PlayerKickEvent event) { <DeepExtract> if (!containsPlayer(event.getPlayer())) return; inRange.remove(event.getPlayer()); leavesRange(event.getPlayer()); </DeepExtract> }
KOTH
positive
4,650
public void readNsHead(InputStream in) throws IOException { _id = EndianUtils.readSwappedShort(in); _version = EndianUtils.readSwappedShort(in); _logid = EndianUtils.readSwappedInteger(in); int count = 0; while (count < _provider.length) { int cnt = in.read(_provider, count, (_provider.length - count)); if (cnt == -1) ...
public void readNsHead(InputStream in) throws IOException { _id = EndianUtils.readSwappedShort(in); _version = EndianUtils.readSwappedShort(in); _logid = EndianUtils.readSwappedInteger(in); <DeepExtract> int count = 0; while (count < _provider.length) { int cnt = in.read(_provider, count, (_provider.length - count)); i...
bae-java-sdk
positive
4,651
public Criteria andTextLessThan(String value) { if (value == null) { throw new RuntimeException("Value for " + "text" + " cannot be null"); } criteria.add(new Criterion("text <", value)); return (Criteria) this; }
public Criteria andTextLessThan(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "text" + " cannot be null"); } criteria.add(new Criterion("text <", value)); </DeepExtract> return (Criteria) this; }
Tmall_SSM-master
positive
4,652
@Override public void write(DataOutput output) throws IOException { output.writeByte(GET_ATTRIBUTE); output.writeInt(correlationId); output.writeByte(OBJECT_NAME); Marshaller marshaller = prepareForMarshalling(output); marshaller.writeObject(name); marshaller.writeByte(STRING); marshaller.writeUTF(attribute); if (manag...
@Override public void write(DataOutput output) throws IOException { output.writeByte(GET_ATTRIBUTE); output.writeInt(correlationId); output.writeByte(OBJECT_NAME); Marshaller marshaller = prepareForMarshalling(output); marshaller.writeObject(name); marshaller.writeByte(STRING); marshaller.writeUTF(attribute); <DeepExtr...
remoting-jmx
positive
4,653
@Override public void onComplete() { Bundle b = new Bundle(); b.putInt("task", this.getId()); b.putString("data", null); Message m = new Message(); m.what = BaseTask.TASK_COMPLETE; m.setData(b); handler.sendMessage(m); }
@Override public void onComplete() { <DeepExtract> Bundle b = new Bundle(); b.putInt("task", this.getId()); b.putString("data", null); Message m = new Message(); m.what = BaseTask.TASK_COMPLETE; m.setData(b); handler.sendMessage(m); </DeepExtract> }
DutSchedule
positive
4,654
@Test public void test401(TestContext context) { Async async = context.async(); getJSON("/json/fail/" + 401, response -> { context.assertEquals(401, response.statusCode()); response.bodyHandler(buff -> { JsonObject json = new JsonObject(buff.toString()); JsonObject error = json.getJsonObject("error"); context.assertEqu...
@Test public void test401(TestContext context) { <DeepExtract> Async async = context.async(); getJSON("/json/fail/" + 401, response -> { context.assertEquals(401, response.statusCode()); response.bodyHandler(buff -> { JsonObject json = new JsonObject(buff.toString()); JsonObject error = json.getJsonObject("error"); con...
nubes
positive
4,655
public Criteria andResourceIdNotBetween(Integer value1, Integer value2) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "resourceId" + " cannot be null"); } criteria.add(new Criterion("resource_id not between", value1, value2)); return (Criteria) this; }
public Criteria andResourceIdNotBetween(Integer value1, Integer value2) { <DeepExtract> if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "resourceId" + " cannot be null"); } criteria.add(new Criterion("resource_id not between", value1, value2)); </DeepExtract> return (Criteria)...
wukong-framework
positive
4,656
public static String parseDate(Date date) { Instant instant = date.toInstant(); ZoneId zone = ZoneId.systemDefault(); LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone); return localDateTime.format(DateTimeFormatter.ofPattern(DATE_FORMAT_DATETIME)); }
public static String parseDate(Date date) { Instant instant = date.toInstant(); ZoneId zone = ZoneId.systemDefault(); LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone); <DeepExtract> return localDateTime.format(DateTimeFormatter.ofPattern(DATE_FORMAT_DATETIME)); </DeepExtract> }
mykit-transaction-message
positive
4,657
@Override public void update(DownloadInfo downloadInfo) { super.update(downloadInfo); label.setText(downloadInfo.getLabel()); state.setText(downloadInfo.getState().toString()); progressBar.setProgress(downloadInfo.getProgress()); stopBtn.setVisibility(View.VISIBLE); stopBtn.setText(x.app().getString(R.string.stop)); Do...
@Override public void update(DownloadInfo downloadInfo) { super.update(downloadInfo); <DeepExtract> label.setText(downloadInfo.getLabel()); state.setText(downloadInfo.getState().toString()); progressBar.setProgress(downloadInfo.getProgress()); stopBtn.setVisibility(View.VISIBLE); stopBtn.setText(x.app().getString(R.str...
xUtils3
positive
4,658
private void readDataFile() { String[] temp = null; File file = new File(filePath); ArrayList<String[]> dataArray = new ArrayList<String[]>(); try { BufferedReader in = new BufferedReader(new FileReader(file)); String str; String[] tempArray; while ((str = in.readLine()) != null) { tempArray = str.split(" "); dataArray...
private void readDataFile() { String[] temp = null; <DeepExtract> File file = new File(filePath); ArrayList<String[]> dataArray = new ArrayList<String[]>(); try { BufferedReader in = new BufferedReader(new FileReader(file)); String str; String[] tempArray; while ((str = in.readLine()) != null) { tempArray = str.split("...
datamining-18algorithms
positive
4,659
@SuppressWarnings("unchecked") public void scheme(Object scheme) { if (!(scheme instanceof List<?>)) { if (!((String) scheme).matches("^[a-zA-Z]+$")) { throw new IllegalArgumentException("The scheme only allows the letters 'a-z'. Was: " + scheme); } this.scheme.add((String) scheme); } else { this.scheme.addAll((List<St...
@SuppressWarnings("unchecked") public void scheme(Object scheme) { if (!(scheme instanceof List<?>)) { if (!((String) scheme).matches("^[a-zA-Z]+$")) { throw new IllegalArgumentException("The scheme only allows the letters 'a-z'. Was: " + scheme); } this.scheme.add((String) scheme); } else { this.scheme.addAll((List<St...
SetupBuilder
positive
4,660
public final int readShort() throws IOException { if (2 < 0 || 2 > 4) { throw new IllegalArgumentException(); } int result = 0; if (m_bigEndian) { for (int i = (2 - 1) * 8; i >= 0; i -= 8) { int b = m_stream.read(); if (b == -1) { throw new EOFException(); } m_position += 1; result |= (b << i); } } else { 2 *= 8; for (...
public final int readShort() throws IOException { <DeepExtract> if (2 < 0 || 2 > 4) { throw new IllegalArgumentException(); } int result = 0; if (m_bigEndian) { for (int i = (2 - 1) * 8; i >= 0; i -= 8) { int b = m_stream.read(); if (b == -1) { throw new EOFException(); } m_position += 1; result |= (b << i); } } else {...
EHBDroid
positive
4,661
public static double getAbilityDamageOrDefault(LivingEntity entity, double _default) { try { return entity.getAttribute(FBAttributes.ABILITY_DAMAGE).getValue(); } catch (NullPointerException e) { return _default; } }
public static double getAbilityDamageOrDefault(LivingEntity entity, double _default) { <DeepExtract> try { return entity.getAttribute(FBAttributes.ABILITY_DAMAGE).getValue(); } catch (NullPointerException e) { return _default; } </DeepExtract> }
ForgeBlock
positive
4,663
public void addPluginResult(PluginResult result, String callbackId) { if (callbackId == null) { Log.e(LOG_TAG, "Got plugin result with no callbackId", new Throwable()); return; } boolean noResult = result.getStatus() == PluginResult.Status.NO_RESULT.ordinal(); boolean keepCallback = result.getKeepCallback(); if (noResu...
public void addPluginResult(PluginResult result, String callbackId) { if (callbackId == null) { Log.e(LOG_TAG, "Got plugin result with no callbackId", new Throwable()); return; } boolean noResult = result.getStatus() == PluginResult.Status.NO_RESULT.ordinal(); boolean keepCallback = result.getKeepCallback(); if (noResu...
cc-calc
positive
4,664
private static GameObject buildCube(IRenderingEngine renderingEngine) throws IOException { File cubeFile = new File("Demos/res/cube.obj"); File diffuseVertFile = new File("Demos/res/diffuse.vert"); File diffuseFragFile = new File("Demos/res/diffuse.frag"); File grassFile = new File("Demos/res/grass.png"); ModelLoader m...
private static GameObject buildCube(IRenderingEngine renderingEngine) throws IOException { File cubeFile = new File("Demos/res/cube.obj"); File diffuseVertFile = new File("Demos/res/diffuse.vert"); File diffuseFragFile = new File("Demos/res/diffuse.frag"); File grassFile = new File("Demos/res/grass.png"); ModelLoader m...
WraithEngine
positive
4,665
public Criteria andCreateTimeGreaterThan(Date value) { if (value == null) { throw new RuntimeException("Value for " + "createTime" + " cannot be null"); } criteria.add(new Criterion("CREATE_TIME >", value)); return (Criteria) this; }
public Criteria andCreateTimeGreaterThan(Date value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "createTime" + " cannot be null"); } criteria.add(new Criterion("CREATE_TIME >", value)); </DeepExtract> return (Criteria) this; }
ECPS
positive
4,666
public AbstractIntegerAssert<?> asInt() { isPrimitive(); if (!actual.getAsJsonPrimitive().isNumber()) { failWithMessage(shouldBeNumberButIs(actual.getAsString())); } return myself; return new JsonElementAssert(actual.getAsInt()); }
public AbstractIntegerAssert<?> asInt() { isPrimitive(); if (!actual.getAsJsonPrimitive().isNumber()) { failWithMessage(shouldBeNumberButIs(actual.getAsString())); } return myself; <DeepExtract> return new JsonElementAssert(actual.getAsInt()); </DeepExtract> }
inject-resources
positive
4,667
public void startActivity(Context context, Intent intent) { checkInit(); String plugIdOrPkg; String actName; ComponentName origComp = intent.getComponent(); if (origComp != null) { plugIdOrPkg = origComp.getPackageName(); actName = origComp.getClassName(); } else { throw new IllegalArgumentException("plug intent must s...
public void startActivity(Context context, Intent intent) { <DeepExtract> checkInit(); String plugIdOrPkg; String actName; ComponentName origComp = intent.getComponent(); if (origComp != null) { plugIdOrPkg = origComp.getPackageName(); actName = origComp.getClassName(); } else { throw new IllegalArgumentException("plug...
AndroidPlugin
positive
4,668
@Override protected void compute() { final Thread thread = Thread.currentThread(); ForkJoinThread forkJoinThread = threadMap.get(thread); if (forkJoinThread == null) { forkJoinThread = new ForkJoinThread(thread); threadMap.put(thread, forkJoinThread); } ForkJoinSprite sprite = new ForkJoinSprite(start, end, level); for...
@Override protected void compute() { final Thread thread = Thread.currentThread(); ForkJoinThread forkJoinThread = threadMap.get(thread); if (forkJoinThread == null) { forkJoinThread = new ForkJoinThread(thread); threadMap.put(thread, forkJoinThread); } ForkJoinSprite sprite = new ForkJoinSprite(start, end, level); for...
java-concurrent-animated
positive
4,669
@Test public void testCreateTable() throws Exception { super.setUp(); hive = createHiveUtil(); TopicPartition tp = new TopicPartition(TOPIC, PARTITION); DataWriter hdfsWriter = createWriter(context, avroData); hdfsWriter.recover(tp); List<SinkRecord> sinkRecords = createSinkRecords(7); hdfsWriter.write(sinkRecords); hd...
@Test public void testCreateTable() throws Exception { super.setUp(); hive = createHiveUtil(); <DeepExtract> TopicPartition tp = new TopicPartition(TOPIC, PARTITION); DataWriter hdfsWriter = createWriter(context, avroData); hdfsWriter.recover(tp); List<SinkRecord> sinkRecords = createSinkRecords(7); hdfsWriter.write(si...
kafka-connect-hdfs
positive
4,670
@Restricted(NoExternalUse.class) public static void throwUnlessUserHasPermissionToAccessJob(final Item context) { final AccessControlled ac = context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance(); ac.checkPermission(Item.READ); }
@Restricted(NoExternalUse.class) public static void throwUnlessUserHasPermissionToAccessJob(final Item context) { <DeepExtract> final AccessControlled ac = context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance(); ac.checkPermission(Item.READ); </DeepExtract> }
vsphere-cloud-plugin
positive
4,671
public String getFullIdentifier() { String fullId = id; if (agency != null) fullId = agency + '/' + fullId; if (version != null) fullId = fullId + '/' + version; return fullId; }
public String getFullIdentifier() { <DeepExtract> String fullId = id; if (agency != null) fullId = agency + '/' + fullId; if (version != null) fullId = fullId + '/' + version; return fullId; </DeepExtract> }
SDMX
positive
4,672
public void pong() throws org.apache.thrift.TException { pong_args args = new pong_args(); sendBase("pong", args); pong_result result = new pong_result(); receiveBase(result, "pong"); return; }
public void pong() throws org.apache.thrift.TException { pong_args args = new pong_args(); sendBase("pong", args); <DeepExtract> pong_result result = new pong_result(); receiveBase(result, "pong"); return; </DeepExtract> }
Thrift-Connection-Pool
positive
4,673
@Override public void run() { currentQuery = query; return null; if (task == null) { loading = false; } }
@Override public void run() { currentQuery = query; <DeepExtract> return null; </DeepExtract> if (task == null) { loading = false; } }
uservoice-android-sdk
positive
4,674
private void setChords() { AbstractButton chords = m_SourceButtons.getElements().nextElement(); m_SourceButtons.setSelected(chords.getModel(), true); ButtonModel sourceSelected = m_SourceButtons.getSelection(); if (sourceSelected == null) { m_DelayItem.setEnabled(false); m_TwidlitInit.setChords(); return; } switch(sour...
private void setChords() { AbstractButton chords = m_SourceButtons.getElements().nextElement(); m_SourceButtons.setSelected(chords.getModel(), true); <DeepExtract> ButtonModel sourceSelected = m_SourceButtons.getSelection(); if (sourceSelected == null) { m_DelayItem.setEnabled(false); m_TwidlitInit.setChords(); return;...
twidlit
positive
4,675
private boolean leaveChannel() { joinedChannel = false; enableLocalAudio = false; NERtcEx.getInstance().enableLocalAudio(enableLocalAudio); enableAudioIb.setImageResource(false ? R.drawable.selector_meeting_mute : R.drawable.selector_meeting_unmute); enableLocalVideo = false; NERtcEx.getInstance().enableLocalVideo(enab...
private boolean leaveChannel() { joinedChannel = false; enableLocalAudio = false; NERtcEx.getInstance().enableLocalAudio(enableLocalAudio); enableAudioIb.setImageResource(false ? R.drawable.selector_meeting_mute : R.drawable.selector_meeting_unmute); <DeepExtract> enableLocalVideo = false; NERtcEx.getInstance().enableL...
FUNimDemoDroid
positive
4,676
@Override public void run() { }
@Override <DeepExtract> </DeepExtract> public void run() { <DeepExtract> </DeepExtract> }
danbooru-gallery-android
positive
4,677
public static ValueType fromURI(final URI uri) { final ValueType[] values = ValueType.values(); for (final ValueType value : values) { if (value.uri.equals(uri.toString())) { return value; } } return null; }
public static ValueType fromURI(final URI uri) { <DeepExtract> final ValueType[] values = ValueType.values(); for (final ValueType value : values) { if (value.uri.equals(uri.toString())) { return value; } } return null; </DeepExtract> }
lyo.core
positive
4,678
public _Fields fieldForId(int fieldId) { switch(fieldId) { case 1: return ID; default: return null; } }
public _Fields fieldForId(int fieldId) { <DeepExtract> switch(fieldId) { case 1: return ID; default: return null; } </DeepExtract> }
tiny-mmo
positive
4,680
@Override public Map<String, Integer> getDroppedMessages() { logger.finest(" getDroppedMessages()"); Map<String, Integer> res = new HashMap<String, Integer>(); JsonArray arr = client.getJsonArray("/messaging_service/messages/dropped_by_ver"); for (int i = 0; i < arr.size(); i++) { JsonObject obj = arr.getJsonObject(i);...
@Override public Map<String, Integer> getDroppedMessages() { <DeepExtract> logger.finest(" getDroppedMessages()"); </DeepExtract> Map<String, Integer> res = new HashMap<String, Integer>(); JsonArray arr = client.getJsonArray("/messaging_service/messages/dropped_by_ver"); for (int i = 0; i < arr.size(); i++) { JsonObjec...
scylla-jmx
positive
4,681
@Test public void findAllCss_example() { browser.visit(InteractionTestsPage()); final String shouldFind = "#inspectingContent ul#cssTest li"; List<ElementScope> all = browser.findAllCss(shouldFind); assertThat(all.size(), is(equalTo(3))); assertThat(all.get(1).getText(), is(equalTo("two"))); assertThat(all.get(2).getTe...
@Test public void findAllCss_example() { <DeepExtract> browser.visit(InteractionTestsPage()); </DeepExtract> final String shouldFind = "#inspectingContent ul#cssTest li"; List<ElementScope> all = browser.findAllCss(shouldFind); assertThat(all.size(), is(equalTo(3))); assertThat(all.get(1).getText(), is(equalTo("two")))...
coypu-jvm
positive
4,682
@Override public K firstKey() { if (size == -1 || PatriciaTrie.this.modCount != expectedModCount) { Iterator<Map.Entry<K, V>> it = entrySet().iterator(); size = 0; Map.Entry<K, V> entry = null; if (it.hasNext()) { entry = it.next(); size = 1; } fromKey = entry == null ? null : entry.getKey(); if (fromKey != null) { Tri...
@Override public K firstKey() { <DeepExtract> if (size == -1 || PatriciaTrie.this.modCount != expectedModCount) { Iterator<Map.Entry<K, V>> it = entrySet().iterator(); size = 0; Map.Entry<K, V> entry = null; if (it.hasNext()) { entry = it.next(); size = 1; } fromKey = entry == null ? null : entry.getKey(); if (fromKey ...
sasi
positive
4,683
public void actionPerformed(java.awt.event.ActionEvent evt) { if (jDynamicTable.getSelectedRow() == -1) { messageComponent.showWarning("Pilih salah satu"); } else { DetailBarang detailBarang = dynamicTableModel.get(jDynamicTable.convertRowIndexToModel(jDynamicTable.getSelectedRow())); int jumlah = Integer.valueOf(jForm...
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> if (jDynamicTable.getSelectedRow() == -1) { messageComponent.showWarning("Pilih salah satu"); } else { DetailBarang detailBarang = dynamicTableModel.get(jDynamicTable.convertRowIndexToModel(jDynamicTable.getSelectedRow())); int jumlah = Integer...
simple-pos
positive
4,684
public static void main(String[] args) { int[] arr = { 1, 5, 4, 3, 2 }; for (int i = 0; i < arr.length; i++) { map.put(arr[i], i); } System.out.println(map); int i = 0, minswap = 0; }
public static void main(String[] args) { int[] arr = { 1, 5, 4, 3, 2 }; <DeepExtract> for (int i = 0; i < arr.length; i++) { map.put(arr[i], i); } System.out.println(map); int i = 0, minswap = 0; </DeepExtract> }
Java-Solutions
positive
4,685
private void collectStatistics(Node node) { if (node == null) { return; } InstanceIdentifier<Node> nodeID = InstanceIdentifier.create(Nodes.class).child(Node.class, node.key()); FlowCapableNode fcnode = node.augmentation(FlowCapableNode.class); if (fcnode != null) { processMeters(node, nodeID, fcnode); processTables(no...
private void collectStatistics(Node node) { if (node == null) { return; } InstanceIdentifier<Node> nodeID = InstanceIdentifier.create(Nodes.class).child(Node.class, node.key()); FlowCapableNode fcnode = node.augmentation(FlowCapableNode.class); if (fcnode != null) { processMeters(node, nodeID, fcnode); processTables(no...
tsdr
positive
4,686
@Override public A onFieldAccess(Expr base, String fieldName) { return this.returnValue; }
@Override public A onFieldAccess(Expr base, String fieldName) { <DeepExtract> return this.returnValue; </DeepExtract> }
dhallj
positive
4,687
private Parent createContent() { Pane root = new Pane(); root.setPrefSize(GRID_WIDTH * TILE_SIZE, GRID_HEIGHT * TILE_SIZE); Canvas canvas = new Canvas(GRID_WIDTH * TILE_SIZE, GRID_HEIGHT * TILE_SIZE); g = canvas.getGraphicsContext2D(); root.getChildren().addAll(canvas); original.add(new Tetromino(Color.GREEN, new Piece...
private Parent createContent() { Pane root = new Pane(); root.setPrefSize(GRID_WIDTH * TILE_SIZE, GRID_HEIGHT * TILE_SIZE); Canvas canvas = new Canvas(GRID_WIDTH * TILE_SIZE, GRID_HEIGHT * TILE_SIZE); g = canvas.getGraphicsContext2D(); root.getChildren().addAll(canvas); original.add(new Tetromino(Color.GREEN, new Piece...
FXTutorials
positive
4,688
int getStartLine(int def) { if (mCachedStart != INVALID_LINE) { return mCachedStart; } if (mViews.size() == 0) { return def; } final View startView = mViews.get(0); final LayoutParams lp = getLayoutParams(startView); mCachedStart = mPrimaryOrientation.getDecoratedStart(startView); if (lp.mFullSpan) { LazySpanLookup.Ful...
int getStartLine(int def) { if (mCachedStart != INVALID_LINE) { return mCachedStart; } if (mViews.size() == 0) { return def; } <DeepExtract> final View startView = mViews.get(0); final LayoutParams lp = getLayoutParams(startView); mCachedStart = mPrimaryOrientation.getDecoratedStart(startView); if (lp.mFullSpan) { Lazy...
SamsungOneUi
positive
4,689
public Criteria andCreateTimeNotIn(List<Date> values) { if (values == null) { throw new RuntimeException("Value for " + "createTime" + " cannot be null"); } addCriterion("create_time not in", new java.sql.Date(values.getTime()), "createTime"); return (Criteria) this; }
public Criteria andCreateTimeNotIn(List<Date> values) { <DeepExtract> if (values == null) { throw new RuntimeException("Value for " + "createTime" + " cannot be null"); } addCriterion("create_time not in", new java.sql.Date(values.getTime()), "createTime"); </DeepExtract> return (Criteria) this; }
SSM_BookSystem
positive
4,690
public String apply(final String markup) { if (tags.isEmpty()) { return markup; } if (null == tagletPattern) { tagletPattern = Pattern.compile(createTagletPattern(), Pattern.MULTILINE); } final Matcher matcher = tagletPattern.matcher(markup); if (!matcher.find()) { return markup; } matcher.reset(); final StringBuffer r...
public String apply(final String markup) { if (tags.isEmpty()) { return markup; } if (null == tagletPattern) { tagletPattern = Pattern.compile(createTagletPattern(), Pattern.MULTILINE); } final Matcher matcher = tagletPattern.matcher(markup); if (!matcher.find()) { return markup; } matcher.reset(); <DeepExtract> final ...
markdown-doclet
positive
4,691
public void setTopRightRadius(int topRightRadius) { mRCHelper.radii[2] = topRightRadius; mRCHelper.radii[3] = topRightRadius; if (null != mRCHelper) { mRCHelper.refreshRegion(this); } super.invalidate(); }
public void setTopRightRadius(int topRightRadius) { mRCHelper.radii[2] = topRightRadius; mRCHelper.radii[3] = topRightRadius; <DeepExtract> if (null != mRCHelper) { mRCHelper.refreshRegion(this); } super.invalidate(); </DeepExtract> }
RxMVVM
positive
4,692
protected float getScale(Matrix matrix) { matrix.getValues(mMatrixValues); return mMatrixValues[Matrix.MSCALE_X]; }
protected float getScale(Matrix matrix) { <DeepExtract> matrix.getValues(mMatrixValues); return mMatrixValues[Matrix.MSCALE_X]; </DeepExtract> }
Playground
positive
4,693
public static Stream<BufferedImage> getValidationStream2014Image() { Path[] paths = Arrays.stream(new File(Crohme.DIRECTORY_2019, "Task1_and_Task2/Task2_offlineRec/MainTask_formula/Train/IMGS/data_png_TestINKMLGT_2013")).flatMap((d) -> { try { return Files.list(d.toPath()); } catch (IOException ex) { Logger.getLogger(O...
public static Stream<BufferedImage> getValidationStream2014Image() { <DeepExtract> Path[] paths = Arrays.stream(new File(Crohme.DIRECTORY_2019, "Task1_and_Task2/Task2_offlineRec/MainTask_formula/Train/IMGS/data_png_TestINKMLGT_2013")).flatMap((d) -> { try { return Files.list(d.toPath()); } catch (IOException ex) { Logg...
mathocr-myscript
positive
4,694
@Override protected int computeHorizontalScrollOffset() { return isHorizontalMode() ? mCurrentScrollOffset : 0; }
@Override protected int computeHorizontalScrollOffset() { <DeepExtract> return isHorizontalMode() ? mCurrentScrollOffset : 0; </DeepExtract> }
ExpectLauncher
positive
4,695
public void childEvent(CuratorFramework curatorFramework, PathChildrenCacheEvent pathChildrenCacheEvent) throws Exception { logger.debug("received path change from zookeeper, key : " + REVERSE_MESSAGE_SOURCE_NAME_ZK_PATH); String partPath = REVERSE_MESSAGE_SOURCE_NAME_ZK_PATH.replace(REVERSE_MESSAGE_ZK_PATH + "/", "");...
public void childEvent(CuratorFramework curatorFramework, PathChildrenCacheEvent pathChildrenCacheEvent) throws Exception { <DeepExtract> logger.debug("received path change from zookeeper, key : " + REVERSE_MESSAGE_SOURCE_NAME_ZK_PATH); String partPath = REVERSE_MESSAGE_SOURCE_NAME_ZK_PATH.replace(REVERSE_MESSAGE_ZK_PA...
banyan
positive
4,696
@Override public void onViewTap(View view, float x, float y) { if (isImgHaveLoad) { if (isBarShow) { isBarShow = false; ObjectAnimator.ofFloat(ll_bottom_bar, "translationY", 0, ll_bottom_bar.getHeight()).setDuration(ANIMATION_DURATION).start(); ObjectAnimator.ofFloat(rl_top_bar, "translationY", 0, -rl_top_bar.getHeight...
@Override public void onViewTap(View view, float x, float y) { <DeepExtract> if (isImgHaveLoad) { if (isBarShow) { isBarShow = false; ObjectAnimator.ofFloat(ll_bottom_bar, "translationY", 0, ll_bottom_bar.getHeight()).setDuration(ANIMATION_DURATION).start(); ObjectAnimator.ofFloat(rl_top_bar, "translationY", 0, -rl_top...
JianDan_OkHttpWithVolley
positive
4,697
public static HttpResponse ok(HttpResponse response, Object data) { ResultCode resultCode = ResultCode.SUCCESS; Map<String, Object> json = new HashMap<>(4); json.put("code", resultCode.getResultCode()); json.put("data", data); response.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON); respon...
public static HttpResponse ok(HttpResponse response, Object data) { ResultCode resultCode = ResultCode.SUCCESS; Map<String, Object> json = new HashMap<>(4); json.put("code", resultCode.getResultCode()); json.put("data", data); <DeepExtract> response.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN...
mica-mqtt
positive
4,698
private void rebuild(int newLength) { int[] oldKeys = keys; int[] oldValues = values; byte[] oldStatus = status; keys = new int[newLength]; values = new int[newLength]; status = new byte[newLength]; size = 0; removedCount = 0; mask = newLength - 1; for (int i = 0; i < oldKeys.length; i++) { if (oldStatus[i] == FILLED) ...
private void rebuild(int newLength) { int[] oldKeys = keys; int[] oldValues = values; byte[] oldStatus = status; <DeepExtract> keys = new int[newLength]; values = new int[newLength]; status = new byte[newLength]; size = 0; removedCount = 0; mask = newLength - 1; </DeepExtract> for (int i = 0; i < oldKeys.length; i++) {...
ez-collections
positive
4,699
@Override public void completed(Line result, Object attachment) { Log.i("DHT: open new link to node " + result.getRemotePeerNode()); if (linkExists(result.getRemotePeerNode())) { Log.w("DHT: link exists"); if (null != null) { null.signal(); } return; } Link link = new Link(this, result.getRemotePeerNode()); link.setTri...
@Override public void completed(Line result, Object attachment) { <DeepExtract> Log.i("DHT: open new link to node " + result.getRemotePeerNode()); if (linkExists(result.getRemotePeerNode())) { Log.w("DHT: link exists"); if (null != null) { null.signal(); } return; } Link link = new Link(this, result.getRemotePeerNode()...
telehash-java
positive
4,700
@Test public void testInheritDifferentScopeResolve2() { begin(); try { for (String perm : "basic.perm1") { QualifiedPermission wp = new QualifiedPermission(perm); getPermissionService().setPermission(TEST_PLAYER, TEST_PLAYER_UUID, false, wp.getRegion(), wp.getWorld(), wp.getPermission(), true); } commit(); } finally { ...
@Test public void testInheritDifferentScopeResolve2() { begin(); try { for (String perm : "basic.perm1") { QualifiedPermission wp = new QualifiedPermission(perm); getPermissionService().setPermission(TEST_PLAYER, TEST_PLAYER_UUID, false, wp.getRegion(), wp.getWorld(), wp.getPermission(), true); } commit(); } finally { ...
zPermissions
positive
4,701
@RequestMapping(method = RequestMethod.GET, produces = JSON_API_MEDIA_TYPE, value = { "/{entity}", "/{entity}/{id}/relationships/{entity2}", "/{entity}/{id}/{child}", "/{entity}/{id}" }) @Cacheable(cacheResolver = "elideCacheResolver", keyGenerator = GetCacheKeyGenerator.NAME) public ResponseEntity<String> get(@Request...
@RequestMapping(method = RequestMethod.GET, produces = JSON_API_MEDIA_TYPE, value = { "/{entity}", "/{entity}/{id}/relationships/{entity2}", "/{entity}/{id}/{child}", "/{entity}/{id}" }) @Cacheable(cacheResolver = "elideCacheResolver", keyGenerator = GetCacheKeyGenerator.NAME) public ResponseEntity<String> get(@Request...
faf-java-api
positive
4,702
@Override public void run() { mEGL = (EGL10) EGLContext.getEGL(); mEGLDisplay = mEGL.eglGetCurrentDisplay(); mEGLContext = mEGL.eglGetCurrentContext(); mEGLScreenSurface = mEGL.eglGetCurrentSurface(EGL10.EGL_DRAW); if (recordStatus != RecordStatus.Stoped) { return; } recordStatus = RecordStatus.Capturing; videoFileInde...
@Override public void run() { <DeepExtract> mEGL = (EGL10) EGLContext.getEGL(); mEGLDisplay = mEGL.eglGetCurrentDisplay(); mEGLContext = mEGL.eglGetCurrentContext(); mEGLScreenSurface = mEGL.eglGetCurrentSurface(EGL10.EGL_DRAW); </DeepExtract> if (recordStatus != RecordStatus.Stoped) { return; } recordStatus = RecordSt...
Meishi_VideoEdit_SDK
positive
4,703
@Override protected void insertFacebookConnection2() { Connection<TestFacebookApi> facebookConnection = getFacebookConnectionFactory().createConnection(FACEBOOK_DATA_2); usersConnectionRepository.createConnectionRepository(getUserId1()).addConnection(facebookConnection); }
@Override protected void insertFacebookConnection2() { <DeepExtract> Connection<TestFacebookApi> facebookConnection = getFacebookConnectionFactory().createConnection(FACEBOOK_DATA_2); usersConnectionRepository.createConnectionRepository(getUserId1()).addConnection(facebookConnection); </DeepExtract> }
spring-social
positive
4,704