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 actionPerformed(java.awt.event.ActionEvent evt) { imageSets.clear(); for (Object obj : jList1.getSelectedValues()) { if (obj instanceof ImageSetChooserPanel) { imageSets.add(((ImageSetChooserPanel) obj).getImageSetName()); } } for (Object obj : jList2.getSelectedValues()) { if (obj instanceof ImageSetChooserPanel) { imageSets.add(((ImageSetChooserPanel) obj).getImageSetName()); } } updateConfigFile(); closeProgram = false; this.dispose(); }
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> imageSets.clear(); for (Object obj : jList1.getSelectedValues()) { if (obj instanceof ImageSetChooserPanel) { imageSets.add(((ImageSetChooserPanel) obj).getImageSetName()); } } for (Object obj : jList2.getSelectedValues()) { if (obj instanceof ImageSetChooserPanel) { imageSets.add(((ImageSetChooserPanel) obj).getImageSetName()); } } updateConfigFile(); closeProgram = false; this.dispose(); </DeepExtract> }
shimeji-universal
positive
3,727
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putBoolean(getString(R.string.pref_key_wifi_only_transfers), isChecked); editor.apply(); }
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { <DeepExtract> SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putBoolean(getString(R.string.pref_key_wifi_only_transfers), isChecked); editor.apply(); </DeepExtract> }
rcloneExplorer
positive
3,728
private void init(Context context) { final View root = LayoutInflater.from(context).inflate(mLayout, this); mIvIcon = (ImageView) root.findViewById(R.id.iv_layout_notice_icon); mTvContent = (TextView) root.findViewById(R.id.tv_layout_notice_content); mTvButton = (TextView) root.findViewById(R.id.tv_layout_notice_button); mIvGoto = (ImageView) root.findViewById(R.id.iv_layout_notice_goto); mIvExit = (ImageView) root.findViewById(R.id.iv_layout_notice_exit); mIvGoto.setVisibility(mVisibilityGoto); mIvExit.setVisibility(mVisibilityExit); if (mIcon != null) { mIvIcon.setImageDrawable(mIcon); } mTvContent.setText(!TextUtils.isEmpty(mContent) ? mContent : ""); mTvButton.setVisibility(!TextUtils.isEmpty(mButton) ? VISIBLE : GONE); mTvContent.setText(!TextUtils.isEmpty(mButton) ? mButton : ""); }
private void init(Context context) { final View root = LayoutInflater.from(context).inflate(mLayout, this); mIvIcon = (ImageView) root.findViewById(R.id.iv_layout_notice_icon); mTvContent = (TextView) root.findViewById(R.id.tv_layout_notice_content); mTvButton = (TextView) root.findViewById(R.id.tv_layout_notice_button); mIvGoto = (ImageView) root.findViewById(R.id.iv_layout_notice_goto); mIvExit = (ImageView) root.findViewById(R.id.iv_layout_notice_exit); mIvGoto.setVisibility(mVisibilityGoto); mIvExit.setVisibility(mVisibilityExit); if (mIcon != null) { mIvIcon.setImageDrawable(mIcon); } mTvContent.setText(!TextUtils.isEmpty(mContent) ? mContent : ""); mTvButton.setVisibility(!TextUtils.isEmpty(mButton) ? VISIBLE : GONE); <DeepExtract> mTvContent.setText(!TextUtils.isEmpty(mButton) ? mButton : ""); </DeepExtract> }
Common
positive
3,730
public boolean addBusMacro(BusMacro bm) { 0x0000FF00 = 0x0000FF00 & 0x0000FF00; for (int y = bm.getRangeA().getYMin(); y <= bm.getRangeA().getYMax(); y++) { for (int x = bm.getRangeA().getXMin(); x <= bm.getRangeA().getXMax(); x++) { slices[x][y] = (slices[x][y] & ~0x0000FF00) | 0x0000FF00; } } return true; }
public boolean addBusMacro(BusMacro bm) { <DeepExtract> 0x0000FF00 = 0x0000FF00 & 0x0000FF00; for (int y = bm.getRangeA().getYMin(); y <= bm.getRangeA().getYMax(); y++) { for (int x = bm.getRangeA().getXMin(); x <= bm.getRangeA().getXMax(); x++) { slices[x][y] = (slices[x][y] & ~0x0000FF00) | 0x0000FF00; } } </DeepExtract> return true; }
reconos
positive
3,731
@Override public boolean removeAll(Collection<String> idlist) { DeleteResult result = mongoTemplate.remove(new Query(Criteria.where("_id").in(idlist)), getClassT()); return result.getDeletedCount() > 0; }
@Override <DeepExtract> </DeepExtract> public boolean removeAll(Collection<String> idlist) { <DeepExtract> </DeepExtract> DeleteResult result = mongoTemplate.remove(new Query(Criteria.where("_id").in(idlist)), getClassT()); <DeepExtract> </DeepExtract> return result.getDeletedCount() > 0; <DeepExtract> </DeepExtract> }
resys-one
positive
3,732
public String romeoAndJulietQuote() { return romeoAndJulietQuotes[faker.random().nextInt(romeoAndJulietQuotes.length)]; }
public String romeoAndJulietQuote() { <DeepExtract> return romeoAndJulietQuotes[faker.random().nextInt(romeoAndJulietQuotes.length)]; </DeepExtract> }
java-faker
positive
3,733
public Criteria andUsernameLessThanOrEqualTo(String value) { if (value == null) { throw new RuntimeException("Value for " + "username" + " cannot be null"); } criteria.add(new Criterion("username <=", value)); return (Criteria) this; }
public Criteria andUsernameLessThanOrEqualTo(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "username" + " cannot be null"); } criteria.add(new Criterion("username <=", value)); </DeepExtract> return (Criteria) this; }
ssmBillBook
positive
3,735
@Override public int addUser(I i) { return this.d.addUser(i); }
@Override public int addUser(I i) { <DeepExtract> return this.d.addUser(i); </DeepExtract> }
kNNBandit
positive
3,736
public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; if (type == Type.COMBINED_ELEMENTS) return; if (type == Type.UNDETERMINED) type = Type.COMBINED_ELEMENTS; else type = Type.CONFLICTING; }
public void setAddressLine2(String addressLine2) { this.addressLine2 = addressLine2; <DeepExtract> if (type == Type.COMBINED_ELEMENTS) return; if (type == Type.UNDETERMINED) type = Type.COMBINED_ELEMENTS; else type = Type.CONFLICTING; </DeepExtract> }
SwissQRBill
positive
3,737
public KnnView<T> setMaxDataPoints(int maxDataPoints) { this.maxDataPoints = maxDataPoints; _tree = new KdTree.WeightedSqrEuclid<T>(formula.weights.length, maxDataPoints == 0 ? null : maxDataPoints); _tree.setWeights(formula.weights); return this; }
public KnnView<T> setMaxDataPoints(int maxDataPoints) { this.maxDataPoints = maxDataPoints; <DeepExtract> _tree = new KdTree.WeightedSqrEuclid<T>(formula.weights.length, maxDataPoints == 0 ? null : maxDataPoints); _tree.setWeights(formula.weights); </DeepExtract> return this; }
Diamond
positive
3,738
public Criteria andUserEmailNotLike(String value) { if (value == null) { throw new RuntimeException("Value for " + "userEmail" + " cannot be null"); } criteria.add(new Criterion("USER_EMAIL not like", value)); return (Criteria) this; }
public Criteria andUserEmailNotLike(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "userEmail" + " cannot be null"); } criteria.add(new Criterion("USER_EMAIL not like", value)); </DeepExtract> return (Criteria) this; }
console
positive
3,739
@Override public boolean hasPermissionForUser(String user, List<String> permission) { try { READ_WRITE_LOCK.readLock().lock(); return () -> super.hasPermissionForUser(user, permission).get(); } finally { READ_WRITE_LOCK.readLock().unlock(); } }
@Override public boolean hasPermissionForUser(String user, List<String> permission) { <DeepExtract> try { READ_WRITE_LOCK.readLock().lock(); return () -> super.hasPermissionForUser(user, permission).get(); } finally { READ_WRITE_LOCK.readLock().unlock(); } </DeepExtract> }
jcasbin
positive
3,740
public void move(NdefRecordModelNode node, NdefRecordModelParent nextParent, int nextIndex) { Activator.info("Move record at " + node.getParent().indexOf(node)); NdefModelMoveRecordOperation ndefModelRecordMoveOperation = new NdefModelMoveRecordOperation(node, nextParent, nextIndex); addStep(ndefModelRecordMoveOperation); ndefModelRecordMoveOperation.execute(); }
public void move(NdefRecordModelNode node, NdefRecordModelParent nextParent, int nextIndex) { Activator.info("Move record at " + node.getParent().indexOf(node)); NdefModelMoveRecordOperation ndefModelRecordMoveOperation = new NdefModelMoveRecordOperation(node, nextParent, nextIndex); <DeepExtract> addStep(ndefModelRecordMoveOperation); </DeepExtract> ndefModelRecordMoveOperation.execute(); }
nfc-eclipse-plugin
positive
3,741
public Distribution<T> scale(double d) { for (T k : keySet()) { put(k, get(k) * d); } return this; }
public Distribution<T> scale(double d) { <DeepExtract> for (T k : keySet()) { put(k, get(k) * d); } return this; </DeepExtract> }
MiCA
positive
3,742
@Before public final void setUp() { JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); jedisPoolConfig.setMaxTotal(8); jedisPoolConfig.setMaxIdle(8); jedisPoolConfig.setMinIdle(0); jedisPoolConfig.setMaxWaitMillis(15000); return jedisPoolConfig; jedisPool = createJedisPool(jedisPoolConfig); jedisTemplate = new JedisTemplate<I>(jedisPool); }
@Before public final void setUp() { <DeepExtract> JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); jedisPoolConfig.setMaxTotal(8); jedisPoolConfig.setMaxIdle(8); jedisPoolConfig.setMinIdle(0); jedisPoolConfig.setMaxWaitMillis(15000); return jedisPoolConfig; </DeepExtract> jedisPool = createJedisPool(jedisPoolConfig); jedisTemplate = new JedisTemplate<I>(jedisPool); }
jedis-ms-sentinel
positive
3,743
public boolean moveNext() { if (cancelFlag.get()) { return false; } final Object[] row = rows.hasNext() ? Table.toArray(rows.next()) : null; if (row == null) { current = null; return false; } return alwaysReturnArray || row.length > 1 ? (E) row : (E) row[0]; return true; }
public boolean moveNext() { if (cancelFlag.get()) { return false; } final Object[] row = rows.hasNext() ? Table.toArray(rows.next()) : null; if (row == null) { current = null; return false; } <DeepExtract> return alwaysReturnArray || row.length > 1 ? (E) row : (E) row[0]; </DeepExtract> return true; }
kareldb
positive
3,744
public boolean loadString(String jsonString) { JsonReader reader = null; try { reader = new JsonReader(new StringReader(jsonString)); JsonParser parser = new JsonParser(); JsonElement element = parser.parse(reader); JsonElement itemElement = element.getAsJsonObject().get(WALLET_DATA_JSON_KEY); if (null == itemElement) { return false; } String hexData = itemElement.getAsString(); if (StringUtils.isEmpty(hexData)) { return false; } mWalletData = HexUtils.toBytes(hexData); return true; } catch (IllegalStateException | JsonIOException | JsonSyntaxException e) { e.printStackTrace(); return false; } finally { if (null != reader) { try { reader.close(); } catch (Throwable t) { } } } }
public boolean loadString(String jsonString) { <DeepExtract> JsonReader reader = null; try { reader = new JsonReader(new StringReader(jsonString)); JsonParser parser = new JsonParser(); JsonElement element = parser.parse(reader); JsonElement itemElement = element.getAsJsonObject().get(WALLET_DATA_JSON_KEY); if (null == itemElement) { return false; } String hexData = itemElement.getAsString(); if (StringUtils.isEmpty(hexData)) { return false; } mWalletData = HexUtils.toBytes(hexData); return true; } catch (IllegalStateException | JsonIOException | JsonSyntaxException e) { e.printStackTrace(); return false; } finally { if (null != reader) { try { reader.close(); } catch (Throwable t) { } } } </DeepExtract> }
bctest
positive
3,745
@Override public void run() { try { LOGGER.info("Running groovy shell"); IO io = new IO(in, out, err); LOGGER.info("in: {} out: {} err: {}", in, out, err); Binding binding = new Binding(); binding.setVariable("out", io.out); Groovysh groovysh = new Groovysh(binding, io); InteractiveShellRunner isr = new InteractiveShellRunner(groovysh, new GroovyPrompt(this)); isr.setErrorHandler(new OutputStreamErrorHandler(this, err)); try { isr.run(); } catch (Exception e) { try (PrintStream ps = new PrintStream(out)) { e.printStackTrace(ps); } this.alive = false; } } finally { this.alive = false; destroy(); callback.onExit(exitValue()); } }
@Override public void run() { <DeepExtract> try { LOGGER.info("Running groovy shell"); IO io = new IO(in, out, err); LOGGER.info("in: {} out: {} err: {}", in, out, err); Binding binding = new Binding(); binding.setVariable("out", io.out); Groovysh groovysh = new Groovysh(binding, io); InteractiveShellRunner isr = new InteractiveShellRunner(groovysh, new GroovyPrompt(this)); isr.setErrorHandler(new OutputStreamErrorHandler(this, err)); try { isr.run(); } catch (Exception e) { try (PrintStream ps = new PrintStream(out)) { e.printStackTrace(ps); } this.alive = false; } } finally { this.alive = false; destroy(); callback.onExit(exitValue()); } </DeepExtract> }
artifactory_ssh_proxy
positive
3,746
public int delete(long id) throws Exception { return template.update("update t_member set name = ? where id = ?", id, "delete from t_member where id = ?"); }
public int delete(long id) throws Exception { <DeepExtract> return template.update("update t_member set name = ? where id = ?", id, "delete from t_member where id = ?"); </DeepExtract> }
gupao-tom
positive
3,747
public void manipulatePdf(String dest) throws IOException { PdfWriter writer = new PdfWriter(DEST, new WriterProperties().setPdfVersion(PdfVersion.PDF_1_5)); PdfDocument pdfDoc = new PdfDocument(writer); pdfDoc.getCatalog().setPageLayout(PdfName.UseOC); PdfCanvas canvas = new PdfCanvas(pdfDoc.addNewPage()); PdfLayer layer = new PdfLayer("Do you see me?", pdfDoc); layer.setOn(true); canvas.beginText().setFontAndSize(PdfFontFactory.createFont(StandardFonts.HELVETICA), 18).moveText(50, 760).showText("Do you see me?").beginLayer(layer).moveText(0, -30).showText("Peek-A-Boo!!!").endLayer().endText().release(); pdfDoc.close(); PdfWriter writer = new PdfWriter(RESULT[1], new WriterProperties().setPdfVersion(PdfVersion.PDF_1_5)); PdfDocument pdfDoc = new PdfDocument(writer); pdfDoc.getCatalog().setPageLayout(PdfName.UseOC); PdfCanvas canvas = new PdfCanvas(pdfDoc.addNewPage()); PdfLayer layer = new PdfLayer("Do you see me?", pdfDoc); layer.setOn(false); canvas.beginText().setFontAndSize(PdfFontFactory.createFont(StandardFonts.HELVETICA), 18).moveText(50, 760).showText("Do you see me?").beginLayer(layer).moveText(0, -30).showText("Peek-A-Boo!!!").endLayer().endText().release(); pdfDoc.close(); }
public void manipulatePdf(String dest) throws IOException { PdfWriter writer = new PdfWriter(DEST, new WriterProperties().setPdfVersion(PdfVersion.PDF_1_5)); PdfDocument pdfDoc = new PdfDocument(writer); pdfDoc.getCatalog().setPageLayout(PdfName.UseOC); PdfCanvas canvas = new PdfCanvas(pdfDoc.addNewPage()); PdfLayer layer = new PdfLayer("Do you see me?", pdfDoc); layer.setOn(true); canvas.beginText().setFontAndSize(PdfFontFactory.createFont(StandardFonts.HELVETICA), 18).moveText(50, 760).showText("Do you see me?").beginLayer(layer).moveText(0, -30).showText("Peek-A-Boo!!!").endLayer().endText().release(); pdfDoc.close(); <DeepExtract> PdfWriter writer = new PdfWriter(RESULT[1], new WriterProperties().setPdfVersion(PdfVersion.PDF_1_5)); PdfDocument pdfDoc = new PdfDocument(writer); pdfDoc.getCatalog().setPageLayout(PdfName.UseOC); PdfCanvas canvas = new PdfCanvas(pdfDoc.addNewPage()); PdfLayer layer = new PdfLayer("Do you see me?", pdfDoc); layer.setOn(false); canvas.beginText().setFontAndSize(PdfFontFactory.createFont(StandardFonts.HELVETICA), 18).moveText(50, 760).showText("Do you see me?").beginLayer(layer).moveText(0, -30).showText("Peek-A-Boo!!!").endLayer().endText().release(); pdfDoc.close(); </DeepExtract> }
i7js-book
positive
3,749
int inflateSync() { if (z == null) return Z_STREAM_ERROR; if (this.mode != BAD) { this.mode = BAD; this.marker = 0; } if ((n = z.avail_in) == 0) return Z_BUF_ERROR; p = z.next_in_index; m = this.marker; while (n != 0 && m < 4) { if (z.next_in[p] == mark[m]) { m++; } else if (z.next_in[p] != 0) { m = 0; } else { m = 4 - m; } p++; n--; } z.total_in += p - z.next_in_index; z.next_in_index = p; z.avail_in = n; this.marker = m; if (m != 4) { return Z_DATA_ERROR; } r = z.total_in; w = z.total_out; if (z == null) return Z_STREAM_ERROR; z.total_in = z.total_out = 0; z.msg = null; this.mode = HEAD; this.need_bytes = -1; this.blocks.reset(); return Z_OK; z.total_in = r; z.total_out = w; this.mode = BLOCKS; return Z_OK; }
int inflateSync() { if (z == null) return Z_STREAM_ERROR; if (this.mode != BAD) { this.mode = BAD; this.marker = 0; } if ((n = z.avail_in) == 0) return Z_BUF_ERROR; p = z.next_in_index; m = this.marker; while (n != 0 && m < 4) { if (z.next_in[p] == mark[m]) { m++; } else if (z.next_in[p] != 0) { m = 0; } else { m = 4 - m; } p++; n--; } z.total_in += p - z.next_in_index; z.next_in_index = p; z.avail_in = n; this.marker = m; if (m != 4) { return Z_DATA_ERROR; } r = z.total_in; w = z.total_out; <DeepExtract> if (z == null) return Z_STREAM_ERROR; z.total_in = z.total_out = 0; z.msg = null; this.mode = HEAD; this.need_bytes = -1; this.blocks.reset(); return Z_OK; </DeepExtract> z.total_in = r; z.total_out = w; this.mode = BLOCKS; return Z_OK; }
Testingbot-Tunnel
positive
3,750
public static List<MessageReaction> get(Long id, HashMap<String, Object> parameters, HashMap<String, Object> options) throws IOException { parameters = parameters != null ? parameters : new HashMap<String, Object>(); options = options != null ? options : new HashMap<String, Object>(); if (id == null && parameters.containsKey("id") && parameters.get("id") != null) { id = ((Long) parameters.get("id")); } if (!(id instanceof Long)) { throw new IllegalArgumentException("Bad parameter: id must be of type Long parameters[\"id\"]"); } if (id == null) { throw new NullPointerException("Argument or Parameter missing: id parameters[\"id\"]"); } String[] urlParts = { FilesConfig.getInstance().getApiRoot(), FilesConfig.getInstance().getApiBase(), String.valueOf(id) }; for (int i = 2; i < urlParts.length; i++) { try { urlParts[i] = new URI(null, null, urlParts[i], null).getRawPath(); } catch (URISyntaxException ex) { } } String url = String.format("%s%s/message_reactions/%s", urlParts); TypeReference<List<MessageReaction>> typeReference = new TypeReference<List<MessageReaction>>() { }; return FilesClient.requestList(url, RequestMethods.GET, typeReference, parameters, options); }
public static List<MessageReaction> get(Long id, HashMap<String, Object> parameters, HashMap<String, Object> options) throws IOException { <DeepExtract> parameters = parameters != null ? parameters : new HashMap<String, Object>(); options = options != null ? options : new HashMap<String, Object>(); if (id == null && parameters.containsKey("id") && parameters.get("id") != null) { id = ((Long) parameters.get("id")); } if (!(id instanceof Long)) { throw new IllegalArgumentException("Bad parameter: id must be of type Long parameters[\"id\"]"); } if (id == null) { throw new NullPointerException("Argument or Parameter missing: id parameters[\"id\"]"); } String[] urlParts = { FilesConfig.getInstance().getApiRoot(), FilesConfig.getInstance().getApiBase(), String.valueOf(id) }; for (int i = 2; i < urlParts.length; i++) { try { urlParts[i] = new URI(null, null, urlParts[i], null).getRawPath(); } catch (URISyntaxException ex) { } } String url = String.format("%s%s/message_reactions/%s", urlParts); TypeReference<List<MessageReaction>> typeReference = new TypeReference<List<MessageReaction>>() { }; return FilesClient.requestList(url, RequestMethods.GET, typeReference, parameters, options); </DeepExtract> }
files-sdk-java
positive
3,751
public Criteria andSexGreaterThan(String value) { if (value == null) { throw new RuntimeException("Value for " + "sex" + " cannot be null"); } criteria.add(new Criterion("sex >", value)); return (Criteria) this; }
public Criteria andSexGreaterThan(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "sex" + " cannot be null"); } criteria.add(new Criterion("sex >", value)); </DeepExtract> return (Criteria) this; }
SpringBoot_EducationalMS
positive
3,753
@Override long alignToCacheLines(long a) { if (a == 0L) return 0L; long mask = ~(C3 / C1 - 1L); if (a > 0L) { long filled = a + C3 / C1 - 1L; if (filled > 0L) { return filled & mask; } else { long maxAlignedLong = Long.MAX_VALUE & mask; if (a <= maxAlignedLong) return maxAlignedLong; } } else { long filled = a - C3 / C1 + 1L; if (filled < 0L) { return filled & mask; } else { long minAlignedLong = Long.MIN_VALUE & mask; if (a >= minAlignedLong) return minAlignedLong; } } throw new IllegalArgumentException("Couldn't align " + a + " by " + C3 / C1); }
@Override long alignToCacheLines(long a) { <DeepExtract> if (a == 0L) return 0L; long mask = ~(C3 / C1 - 1L); if (a > 0L) { long filled = a + C3 / C1 - 1L; if (filled > 0L) { return filled & mask; } else { long maxAlignedLong = Long.MAX_VALUE & mask; if (a <= maxAlignedLong) return maxAlignedLong; } } else { long filled = a - C3 / C1 + 1L; if (filled < 0L) { return filled & mask; } else { long minAlignedLong = Long.MIN_VALUE & mask; if (a >= minAlignedLong) return minAlignedLong; } } throw new IllegalArgumentException("Couldn't align " + a + " by " + C3 / C1); </DeepExtract> }
Chronicle-Algorithms
positive
3,754
public void resolveConfigurations(Map<String, Map<Option<?>, Object>> map, Locale locale, HttpServletRequest request) { logger.debug("Resolving configurations for the locale {}...", locale); if (LibraryDetector.isJstlAvailable() && !LibraryDetector.isThymeleafAvailable() && userProperties != null) { if (!userProperties.isEmpty()) { for (Entry<Object, Object> entry : userProperties.entrySet()) { String key = entry.getKey().toString(); if (key.contains(I18N_MESSAGE_RESOLVER) && StringUtils.isBlank(entry.getValue().toString())) { userProperties.put(entry.getKey(), "com.github.dandelion.datatables.jsp.i18n.JstlMessageResolver"); } } } else { userProperties.put("global." + I18N_MESSAGE_RESOLVER, "com.github.dandelion.datatables.jsp.i18n.JstlMessageResolver"); } } Properties globalProperties = new Properties(); for (Entry<Object, Object> entry : defaultProperties.entrySet()) { String key = entry.getKey().toString(); if (!key.equalsIgnoreCase(I18N_LOCALE_RESOLVER) && !key.equalsIgnoreCase(I18N_MESSAGE_RESOLVER) && !key.equalsIgnoreCase("main.standalone")) { globalProperties.put(key.substring(key.indexOf(".") + 1), entry.getValue()); } } for (Entry<Object, Object> entry : userProperties.entrySet()) { String key = entry.getKey().toString(); if (key.startsWith(DEFAULT_GROUP_NAME)) { globalProperties.put(key.substring(key.indexOf(".") + 1), entry.getValue()); } } if (userProperties.containsKey("main.standalone") && userProperties.getProperty("main.standalone").equals("true")) { AssetRequestContext.get(request).excludeBundles(STANDALONE_BUNDLES_TO_EXCLUDE); } Map<Option<?>, Object> userConf = null; Map<String, List<String>> wrongKeys = new ConcurrentHashMap<String, List<String>>(); for (String groupName : groups) { Properties groupedProperties = new Properties(); groupedProperties.putAll(globalProperties); for (Entry<Object, Object> entry : userProperties.entrySet()) { String key = entry.getKey().toString(); if (key.startsWith(groupName)) { groupedProperties.put(key.substring(key.indexOf(".") + 1), entry.getValue()); } } logger.debug("Group '{}' initialized with {} properties", groupName, groupedProperties.size()); userConf = new HashMap<Option<?>, Object>(); for (Entry<Object, Object> entry : groupedProperties.entrySet()) { String key = entry.getKey().toString().trim().toLowerCase(); Option<?> config = DatatableOptions.findByName(key); if (config != null) { userConf.put(config, entry.getValue().toString()); } else if (!key.equals(I18N_LOCALE_RESOLVER) && !key.equals(I18N_MESSAGE_RESOLVER)) { if (wrongKeys.containsKey(groupName)) { wrongKeys.get(groupName).add(key); } else { List<String> values = new ArrayList<String>(); values.add(key); wrongKeys.put(groupName, values); } } } map.put(groupName, userConf); } if (!wrongKeys.isEmpty()) { StringBuilder msg = new StringBuilder("Some properties of your configuration file are not recognized.\n"); for (Entry<String, List<String>> entry : wrongKeys.entrySet()) { msg.append("The group '"); msg.append(entry.getKey()); msg.append("' contains "); msg.append(entry.getValue().size()); msg.append(" unknown propert"); msg.append(entry.getValue().size() > 1 ? "ies:\n" : "y:\n"); for (int i = 0; i < entry.getValue().size(); i++) { msg.append(entry.getValue().get(i)); if (i < entry.getValue().size() - 1) { msg.append("\n"); } } msg.append("\n"); } logger.error(msg.toString()); throw new DandelionException(msg.toString()); } logger.debug("{} group(s) resolved {} for the locale {}", groups.size(), groups.toString(), locale); }
public void resolveConfigurations(Map<String, Map<Option<?>, Object>> map, Locale locale, HttpServletRequest request) { logger.debug("Resolving configurations for the locale {}...", locale); <DeepExtract> if (LibraryDetector.isJstlAvailable() && !LibraryDetector.isThymeleafAvailable() && userProperties != null) { if (!userProperties.isEmpty()) { for (Entry<Object, Object> entry : userProperties.entrySet()) { String key = entry.getKey().toString(); if (key.contains(I18N_MESSAGE_RESOLVER) && StringUtils.isBlank(entry.getValue().toString())) { userProperties.put(entry.getKey(), "com.github.dandelion.datatables.jsp.i18n.JstlMessageResolver"); } } } else { userProperties.put("global." + I18N_MESSAGE_RESOLVER, "com.github.dandelion.datatables.jsp.i18n.JstlMessageResolver"); } } </DeepExtract> Properties globalProperties = new Properties(); for (Entry<Object, Object> entry : defaultProperties.entrySet()) { String key = entry.getKey().toString(); if (!key.equalsIgnoreCase(I18N_LOCALE_RESOLVER) && !key.equalsIgnoreCase(I18N_MESSAGE_RESOLVER) && !key.equalsIgnoreCase("main.standalone")) { globalProperties.put(key.substring(key.indexOf(".") + 1), entry.getValue()); } } for (Entry<Object, Object> entry : userProperties.entrySet()) { String key = entry.getKey().toString(); if (key.startsWith(DEFAULT_GROUP_NAME)) { globalProperties.put(key.substring(key.indexOf(".") + 1), entry.getValue()); } } if (userProperties.containsKey("main.standalone") && userProperties.getProperty("main.standalone").equals("true")) { AssetRequestContext.get(request).excludeBundles(STANDALONE_BUNDLES_TO_EXCLUDE); } Map<Option<?>, Object> userConf = null; Map<String, List<String>> wrongKeys = new ConcurrentHashMap<String, List<String>>(); for (String groupName : groups) { Properties groupedProperties = new Properties(); groupedProperties.putAll(globalProperties); for (Entry<Object, Object> entry : userProperties.entrySet()) { String key = entry.getKey().toString(); if (key.startsWith(groupName)) { groupedProperties.put(key.substring(key.indexOf(".") + 1), entry.getValue()); } } logger.debug("Group '{}' initialized with {} properties", groupName, groupedProperties.size()); userConf = new HashMap<Option<?>, Object>(); for (Entry<Object, Object> entry : groupedProperties.entrySet()) { String key = entry.getKey().toString().trim().toLowerCase(); Option<?> config = DatatableOptions.findByName(key); if (config != null) { userConf.put(config, entry.getValue().toString()); } else if (!key.equals(I18N_LOCALE_RESOLVER) && !key.equals(I18N_MESSAGE_RESOLVER)) { if (wrongKeys.containsKey(groupName)) { wrongKeys.get(groupName).add(key); } else { List<String> values = new ArrayList<String>(); values.add(key); wrongKeys.put(groupName, values); } } } map.put(groupName, userConf); } if (!wrongKeys.isEmpty()) { StringBuilder msg = new StringBuilder("Some properties of your configuration file are not recognized.\n"); for (Entry<String, List<String>> entry : wrongKeys.entrySet()) { msg.append("The group '"); msg.append(entry.getKey()); msg.append("' contains "); msg.append(entry.getValue().size()); msg.append(" unknown propert"); msg.append(entry.getValue().size() > 1 ? "ies:\n" : "y:\n"); for (int i = 0; i < entry.getValue().size(); i++) { msg.append(entry.getValue().get(i)); if (i < entry.getValue().size() - 1) { msg.append("\n"); } } msg.append("\n"); } logger.error(msg.toString()); throw new DandelionException(msg.toString()); } logger.debug("{} group(s) resolved {} for the locale {}", groups.size(), groups.toString(), locale); }
dandelion-datatables
positive
3,755
public static String nameOf(final CommandName name) { if (name instanceof NestedCommandNameImpl) { return nameOf(((NestedCommandNameImpl) name).parent) + " " + name.value(); } return name; }
public static String nameOf(final CommandName name) { if (name instanceof NestedCommandNameImpl) { return nameOf(((NestedCommandNameImpl) name).parent) + " " + name.value(); } <DeepExtract> return name; </DeepExtract> }
mini-git-server
positive
3,756
@Override public void onResponse(List<String> response) { Log.d("Activity", "response = " + response); returnedCount++; progressBar.setVisibility(View.GONE); if (returnedCount == 1) { textView.setText("10 Requests took " + (System.currentTimeMillis() - start)); } else { textView.setText("returnedCount = " + returnedCount); } }
@Override public void onResponse(List<String> response) { Log.d("Activity", "response = " + response); <DeepExtract> returnedCount++; progressBar.setVisibility(View.GONE); if (returnedCount == 1) { textView.setText("10 Requests took " + (System.currentTimeMillis() - start)); } else { textView.setText("returnedCount = " + returnedCount); } </DeepExtract> }
CrossBow
positive
3,757
public static void e(String message) { if (!isDebuggable()) return; className = new Throwable().getStackTrace()[1].getFileName(); methodName = new Throwable().getStackTrace()[1].getMethodName(); lineNumber = new Throwable().getStackTrace()[1].getLineNumber(); Log.e(className, createLog(message)); }
public static void e(String message) { if (!isDebuggable()) return; <DeepExtract> className = new Throwable().getStackTrace()[1].getFileName(); methodName = new Throwable().getStackTrace()[1].getMethodName(); lineNumber = new Throwable().getStackTrace()[1].getLineNumber(); </DeepExtract> Log.e(className, createLog(message)); }
DouYuLiveSample
positive
3,758
@Override public boolean visit(final UndefinedLiteral node) { final int nodeStart = node.getStartPosition(); final int nodeEnd = nodeStart + node.getLength(); if (nodeEnd < this.fStart || this.fEnd < nodeStart) { return false; } if (nodeStart <= this.fStart && this.fEnd <= nodeEnd) { this.fCoveringNode = node; } if (this.fStart <= nodeStart && nodeEnd <= this.fEnd) { if (this.fCoveringNode == node) { this.fCoveredNode = node; return true; } else if (this.fCoveredNode == null) { this.fCoveredNode = node; } return false; } return true; }
@Override public boolean visit(final UndefinedLiteral node) { <DeepExtract> final int nodeStart = node.getStartPosition(); final int nodeEnd = nodeStart + node.getLength(); if (nodeEnd < this.fStart || this.fEnd < nodeStart) { return false; } if (nodeStart <= this.fStart && this.fEnd <= nodeEnd) { this.fCoveringNode = node; } if (this.fStart <= nodeStart && nodeEnd <= this.fEnd) { if (this.fCoveringNode == node) { this.fCoveredNode = node; return true; } else if (this.fCoveredNode == null) { this.fCoveredNode = node; } return false; } return true; </DeepExtract> }
codemining-core
positive
3,759
@Override public default boolean action(Action action, Creature performer, boolean onSurface, BridgePart bridgePart, int encodedTile, short num, float counter) { return propagate(action, SERVER_PROPAGATION, ACTION_PERFORMER_PROPAGATION); }
@Override public default boolean action(Action action, Creature performer, boolean onSurface, BridgePart bridgePart, int encodedTile, short num, float counter) { <DeepExtract> return propagate(action, SERVER_PROPAGATION, ACTION_PERFORMER_PROPAGATION); </DeepExtract> }
WurmServerModLauncher
positive
3,760
public Criteria andStatusNotIn(List<Integer> values) { if (values == null) { throw new RuntimeException("Value for " + "status" + " cannot be null"); } criteria.add(new Criterion("status not in", values)); return (Criteria) this; }
public Criteria andStatusNotIn(List<Integer> values) { <DeepExtract> if (values == null) { throw new RuntimeException("Value for " + "status" + " cannot be null"); } criteria.add(new Criterion("status not in", values)); </DeepExtract> return (Criteria) this; }
cloud
positive
3,761
private void jButton_srSizeSectionActionPerformed(java.awt.event.ActionEvent evt) { spotReport.setSize(Size.SECTION); jButton_srSize.setText("Size: " + spotReport.getSize()); showCard("Spot Report Activity Card"); }
private void jButton_srSizeSectionActionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> spotReport.setSize(Size.SECTION); jButton_srSize.setText("Size: " + spotReport.getSize()); showCard("Spot Report Activity Card"); </DeepExtract> }
vehicle-commander-java
positive
3,762
public void resetBlock() { setText(null); setTag(null); StateListDrawable background_drawable = new StateListDrawable(); background_drawable.addState(new int[] { android.R.attr.state_pressed }, new ColorDrawable(getResources().getColor(R.color.silver))); background_drawable.addState(new int[] { android.R.attr.state_enabled }, new ColorDrawable(Color.TRANSPARENT)); setBackgroundDrawable(background_drawable); setOnClickListener(null); }
public void resetBlock() { setText(null); setTag(null); <DeepExtract> StateListDrawable background_drawable = new StateListDrawable(); background_drawable.addState(new int[] { android.R.attr.state_pressed }, new ColorDrawable(getResources().getColor(R.color.silver))); background_drawable.addState(new int[] { android.R.attr.state_enabled }, new ColorDrawable(Color.TRANSPARENT)); setBackgroundDrawable(background_drawable); </DeepExtract> setOnClickListener(null); }
TaipeiTechStudent
positive
3,763
@Override public Point getGuiParts(List<Gui> parts, Map<Gui, Setting<?>> callbacks, Point origin) { GuiLegendLabel label = new GuiLegendLabel(0, origin.getX() - 150, origin.getY(), 300, Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT, Color.WHITE); super.addLine("betterHud.group." + this.name); lines.add(I18n.format("betterHud.group." + this.name)); parts.add(label); return origin.add(0, Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT + SPACER); }
@Override public Point getGuiParts(List<Gui> parts, Map<Gui, Setting<?>> callbacks, Point origin) { GuiLegendLabel label = new GuiLegendLabel(0, origin.getX() - 150, origin.getY(), 300, Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT, Color.WHITE); <DeepExtract> super.addLine("betterHud.group." + this.name); lines.add(I18n.format("betterHud.group." + this.name)); </DeepExtract> parts.add(label); return origin.add(0, Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT + SPACER); }
better-hud
positive
3,764
static void moveToFront(Ghost head, Ghost e) { e.prev.next = e.next; e.next.prev = e.prev; e.next = e.prev = null; e.prev = head; e.next = head.next; e.next.prev = e; head.next = e; }
static void moveToFront(Ghost head, Ghost e) { e.prev.next = e.next; e.next.prev = e.prev; e.next = e.prev = null; <DeepExtract> e.prev = head; e.next = head.next; e.next.prev = e; head.next = e; </DeepExtract> }
cache2k-benchmark
positive
3,766
@Test public void testConstructorWithArguments() { List<Object> objList = new ArrayList<>(); Map<String, String> obj1 = new HashMap<>(); obj1.put("key1", "value1"); obj1.put("key2", "value2"); objList.add(obj1); if (2 != 1) { Map<String, String> obj2 = new HashMap<>(); obj2.put("key3", "value3"); obj2.put("key4", "value4"); objList.add(obj2); } GenParameter values = new GenParameter(); values.setName("values"); values.setObjectValues(objList); generator.getGenParameters().add(values); RandomObjectGenerator objGen = (RandomObjectGenerator) TestDataGeneratorFactory.createTestDataGenerator(generator); assertEquals("There should be 2 objects in the list", 2, objGen.getValues().size()); }
@Test public void testConstructorWithArguments() { List<Object> objList = new ArrayList<>(); <DeepExtract> Map<String, String> obj1 = new HashMap<>(); obj1.put("key1", "value1"); obj1.put("key2", "value2"); objList.add(obj1); if (2 != 1) { Map<String, String> obj2 = new HashMap<>(); obj2.put("key3", "value3"); obj2.put("key4", "value4"); objList.add(obj2); } </DeepExtract> GenParameter values = new GenParameter(); values.setName("values"); values.setObjectValues(objList); generator.getGenParameters().add(values); RandomObjectGenerator objGen = (RandomObjectGenerator) TestDataGeneratorFactory.createTestDataGenerator(generator); assertEquals("There should be 2 objects in the list", 2, objGen.getValues().size()); }
RESTest
positive
3,767
@Test public void testDeserializationAsInt02MillisecondsWithoutTimeZone() throws Exception { OffsetDateTime date = OffsetDateTime.ofInstant(Instant.ofEpochSecond(123456789L, 422000000), Z2); ObjectMapper m = newMapper().configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, false); OffsetDateTime value = m.readValue("123456789422", OffsetDateTime.class); assertNotNull("The value should not be null.", value); assertTrue("The value is not correct. Expected timezone-adjusted <" + date + ">, actual <" + value + ">.", date.isEqual(value)); assertEquals("The time zone is not correct.", ZoneOffset.UTC, value.getOffset()); }
@Test public void testDeserializationAsInt02MillisecondsWithoutTimeZone() throws Exception { OffsetDateTime date = OffsetDateTime.ofInstant(Instant.ofEpochSecond(123456789L, 422000000), Z2); ObjectMapper m = newMapper().configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, false); OffsetDateTime value = m.readValue("123456789422", OffsetDateTime.class); assertNotNull("The value should not be null.", value); <DeepExtract> assertTrue("The value is not correct. Expected timezone-adjusted <" + date + ">, actual <" + value + ">.", date.isEqual(value)); </DeepExtract> assertEquals("The time zone is not correct.", ZoneOffset.UTC, value.getOffset()); }
jackson-datatype-jsr310
positive
3,768
@Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { setHasOptionsMenu(true); View view = inflater.inflate(R.layout.fragment_instances, container, false); ButterKnife.bind(this, view); instanceMap = new HashMap<>(); transferInstanceList = new ArrayList<>(); selectedInstances = new LinkedHashSet<>(); buttonLayout.setVisibility(View.GONE); LinearLayoutManager llm = new LinearLayoutManager(getActivity()); llm.setOrientation(RecyclerView.VERTICAL); recyclerView.setLayoutManager(llm); transferInstanceAdapter = new TransferInstanceAdapter(getActivity(), transferInstanceList, this, selectedInstances, showCheckBox); recyclerView.setAdapter(transferInstanceAdapter); return view; }
@Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { setHasOptionsMenu(true); View view = inflater.inflate(R.layout.fragment_instances, container, false); ButterKnife.bind(this, view); instanceMap = new HashMap<>(); transferInstanceList = new ArrayList<>(); selectedInstances = new LinkedHashSet<>(); buttonLayout.setVisibility(View.GONE); LinearLayoutManager llm = new LinearLayoutManager(getActivity()); llm.setOrientation(RecyclerView.VERTICAL); recyclerView.setLayoutManager(llm); <DeepExtract> transferInstanceAdapter = new TransferInstanceAdapter(getActivity(), transferInstanceList, this, selectedInstances, showCheckBox); recyclerView.setAdapter(transferInstanceAdapter); </DeepExtract> return view; }
skunkworks-crow
positive
3,769
@Override public void keyReleased(KeyEvent e) { String oldCode = list.getSelectedValue(); String newCode = textureCodeField.getText(); if (newCode.length() == 0) return; ModelCreator.currentProject.UpdateTextureCode(oldCode, newCode); ignoreSelects = true; DefaultListModel<String> model = new DefaultListModel<String>(); for (TextureEntry entry : ModelCreator.currentProject.TexturesByCode.values()) { model.addElement(entry.getCode()); } return model; list.setModel(model); int newIndex = 0; int i = 0; for (TextureEntry entry : ModelCreator.currentProject.TexturesByCode.values()) { if (entry.code.equals(newCode)) { newIndex = i; break; } i++; } list.setSelectedIndex(newIndex); ignoreSelects = false; }
@Override public void keyReleased(KeyEvent e) { String oldCode = list.getSelectedValue(); String newCode = textureCodeField.getText(); if (newCode.length() == 0) return; ModelCreator.currentProject.UpdateTextureCode(oldCode, newCode); ignoreSelects = true; <DeepExtract> DefaultListModel<String> model = new DefaultListModel<String>(); for (TextureEntry entry : ModelCreator.currentProject.TexturesByCode.values()) { model.addElement(entry.getCode()); } return model; </DeepExtract> list.setModel(model); int newIndex = 0; int i = 0; for (TextureEntry entry : ModelCreator.currentProject.TexturesByCode.values()) { if (entry.code.equals(newCode)) { newIndex = i; break; } i++; } list.setSelectedIndex(newIndex); ignoreSelects = false; }
vsmodelcreator
positive
3,770
@Override protected Void doInBackground(Void... params) { if (getActivity() == null) return null; Context context = getActivity(); if (!preferences.contains(PebbleNotificationCenter.SELECTED_PACKAGES)) return; List<String> list = new ArrayList<String>(); PreferencesUtil.loadCollection(preferences, list, PebbleNotificationCenter.SELECTED_PACKAGES); for (String pkg : list) settingsStorage.setAppChecked(pkg, true); String[] spammyPackageList = preferences.getAll().keySet().toArray(new String[0]); for (String s : spammyPackageList) { if (s.startsWith(PebbleNotificationCenter.SELECTED_PACKAGES)) { editor.remove(s); } } if (getActivity() == null) return null; final PackageManager pm = context.getPackageManager(); List<PackageInfo> packages = pm.getInstalledPackages(0); for (PackageInfo packageInfo : packages) { try { if (packageInfo.packageName.equals(PebbleNotificationCenter.PACKAGE)) continue; ApplicationInfo appInfo = pm.getApplicationInfo(packageInfo.packageName, 0); boolean isSystemApp = ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0); if (isSystemApp == showSystemApps) { AppInfoStorage storage = new AppInfoStorage(); storage.packageName = appInfo.packageName; storage.label = pm.getApplicationLabel(appInfo); apps.add(storage); } } catch (NameNotFoundException e) { continue; } } Collections.sort(apps, new AppInfoComparator()); apps.addAll(0, getVirtualApps(context)); return null; }
@Override protected Void doInBackground(Void... params) { if (getActivity() == null) return null; Context context = getActivity(); <DeepExtract> if (!preferences.contains(PebbleNotificationCenter.SELECTED_PACKAGES)) return; List<String> list = new ArrayList<String>(); PreferencesUtil.loadCollection(preferences, list, PebbleNotificationCenter.SELECTED_PACKAGES); for (String pkg : list) settingsStorage.setAppChecked(pkg, true); String[] spammyPackageList = preferences.getAll().keySet().toArray(new String[0]); for (String s : spammyPackageList) { if (s.startsWith(PebbleNotificationCenter.SELECTED_PACKAGES)) { editor.remove(s); } } </DeepExtract> if (getActivity() == null) return null; final PackageManager pm = context.getPackageManager(); List<PackageInfo> packages = pm.getInstalledPackages(0); for (PackageInfo packageInfo : packages) { try { if (packageInfo.packageName.equals(PebbleNotificationCenter.PACKAGE)) continue; ApplicationInfo appInfo = pm.getApplicationInfo(packageInfo.packageName, 0); boolean isSystemApp = ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0); if (isSystemApp == showSystemApps) { AppInfoStorage storage = new AppInfoStorage(); storage.packageName = appInfo.packageName; storage.label = pm.getApplicationLabel(appInfo); apps.add(storage); } } catch (NameNotFoundException e) { continue; } } Collections.sort(apps, new AppInfoComparator()); apps.addAll(0, getVirtualApps(context)); return null; }
PebbleNotificationCenter-Android
positive
3,771
@Override public void testDoubleArray(double[] v) throws Exception { MessagePack msgpack = new MessagePack(); Template<double[]> tmpl = DoubleArrayTemplate.instance; BufferPacker packer = msgpack.createBufferPacker(); tmpl.write(packer, v); byte[] bytes = packer.toByteArray(); BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes); unpacker.resetReadByteCount(); switch(index) { case 0: ret0 = null; break; case 1: if (v == null) { ret0 = new double[0]; } else { ret0 = new double[v.length]; } break; case 2: if (v == null) { ret0 = new double[0]; } else { ret0 = new double[(int) v.length / 2]; } break; default: throw new IllegalArgumentException(); } double[] ret = tmpl.read(unpacker, ret0); if (v == null) { assertEquals(null, ret); return; } assertEquals(v.length, ret.length); for (int i = 0; i < v.length; ++i) { assertEquals(v[i], ret[i], 10e-10); } assertEquals(bytes.length, unpacker.getReadByteCount()); }
@Override public void testDoubleArray(double[] v) throws Exception { MessagePack msgpack = new MessagePack(); Template<double[]> tmpl = DoubleArrayTemplate.instance; BufferPacker packer = msgpack.createBufferPacker(); tmpl.write(packer, v); byte[] bytes = packer.toByteArray(); BufferUnpacker unpacker = msgpack.createBufferUnpacker(bytes); unpacker.resetReadByteCount(); switch(index) { case 0: ret0 = null; break; case 1: if (v == null) { ret0 = new double[0]; } else { ret0 = new double[v.length]; } break; case 2: if (v == null) { ret0 = new double[0]; } else { ret0 = new double[(int) v.length / 2]; } break; default: throw new IllegalArgumentException(); } double[] ret = tmpl.read(unpacker, ret0); <DeepExtract> if (v == null) { assertEquals(null, ret); return; } assertEquals(v.length, ret.length); for (int i = 0; i < v.length; ++i) { assertEquals(v[i], ret[i], 10e-10); } </DeepExtract> assertEquals(bytes.length, unpacker.getReadByteCount()); }
msgpack-java
positive
3,773
public Criteria andSelectEqualToColumn(TestEntity.Column column) { if (new StringBuilder("`select` = ").append(column.getEscapedColumnName()).toString() == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(new StringBuilder("`select` = ").append(column.getEscapedColumnName()).toString())); return (Criteria) this; }
public Criteria andSelectEqualToColumn(TestEntity.Column column) { <DeepExtract> if (new StringBuilder("`select` = ").append(column.getEscapedColumnName()).toString() == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(new StringBuilder("`select` = ").append(column.getEscapedColumnName()).toString())); </DeepExtract> return (Criteria) this; }
mybatis-generator-gui-extension
positive
3,774
public static void main(String[] args) { Empty empty = new Empty(); System.out.println("For string [" + "foo" + "] empty = " + isEmpty("foo")); System.out.println("For string [" + "bar" + "] empty = " + isEmpty("bar")); System.out.println("For string [" + "" + "] empty = " + isEmpty("")); }
public static void main(String[] args) { Empty empty = new Empty(); System.out.println("For string [" + "foo" + "] empty = " + isEmpty("foo")); System.out.println("For string [" + "bar" + "] empty = " + isEmpty("bar")); <DeepExtract> System.out.println("For string [" + "" + "] empty = " + isEmpty("")); </DeepExtract> }
edu
positive
3,775
@Override protected void notifyFocusGained(int virtualId, Rect bounds) { AccessibilityEvent event = AccessibilityEvent.obtain(); event.setEventType(AccessibilityEvent.TYPE_VIEW_FOCUSED); event.setSource(this, virtualId); event.setEnabled(true); event.setPackageName(getContext().getPackageName()); if (VERBOSE) { Log.v(TAG, "sendAccessibilityEvent(" + AccessibilityEvent.TYPE_VIEW_FOCUSED + ", " + virtualId + "): " + event); } getContext().getSystemService(AccessibilityManager.class).sendAccessibilityEvent(event); }
@Override protected void notifyFocusGained(int virtualId, Rect bounds) { <DeepExtract> AccessibilityEvent event = AccessibilityEvent.obtain(); event.setEventType(AccessibilityEvent.TYPE_VIEW_FOCUSED); event.setSource(this, virtualId); event.setEnabled(true); event.setPackageName(getContext().getPackageName()); if (VERBOSE) { Log.v(TAG, "sendAccessibilityEvent(" + AccessibilityEvent.TYPE_VIEW_FOCUSED + ", " + virtualId + "): " + event); } getContext().getSystemService(AccessibilityManager.class).sendAccessibilityEvent(event); </DeepExtract> }
input-samples
positive
3,777
public void assertKeyInTable(String tableSummaryOrId, String key) { assertTablePresent(tableSummaryOrId); assertTrue("Could not find: [" + getMessage(key) + "]" + "in table [" + tableSummaryOrId + "]", getTestingEngine().getTable(tableSummaryOrId).hasText(getMessage(key))); }
public void assertKeyInTable(String tableSummaryOrId, String key) { <DeepExtract> assertTablePresent(tableSummaryOrId); assertTrue("Could not find: [" + getMessage(key) + "]" + "in table [" + tableSummaryOrId + "]", getTestingEngine().getTable(tableSummaryOrId).hasText(getMessage(key))); </DeepExtract> }
jwebunit
positive
3,778
@Override public void run() { File parent = (File) ((IStructuredSelection) getViewer().getSelection()).getFirstElement(); if (parent == null) { parent = getRootFolder(); } else if (!parent.isDirectory()) { parent = parent.getParentFile(); } if (parent.exists()) { NewFileDialog dialog = new NewFileDialog(getViewSite().getShell(), parent, NLS.bind(Messages.ScriptsFileViewer_6, provider.getName())); dialog.setDefaultExtension(provider.getSupportedFileExtensions()[0]); if (dialog.open()) { File newFile = dialog.getFile(); if (newFile != null) { try { URL urlNewFile = provider.getNewFile(); if (urlNewFile != null) { InputStream in = urlNewFile.openStream(); Files.copy(in, newFile.toPath(), StandardCopyOption.REPLACE_EXISTING); in.close(); } } catch (IOException ex) { ex.printStackTrace(); } getViewer().expandToLevel(parent, 1); getViewer().refresh(); getViewer().setSelection(new StructuredSelection(newFile)); handleEditAction(); } } } }
@Override public void run() { <DeepExtract> File parent = (File) ((IStructuredSelection) getViewer().getSelection()).getFirstElement(); if (parent == null) { parent = getRootFolder(); } else if (!parent.isDirectory()) { parent = parent.getParentFile(); } if (parent.exists()) { NewFileDialog dialog = new NewFileDialog(getViewSite().getShell(), parent, NLS.bind(Messages.ScriptsFileViewer_6, provider.getName())); dialog.setDefaultExtension(provider.getSupportedFileExtensions()[0]); if (dialog.open()) { File newFile = dialog.getFile(); if (newFile != null) { try { URL urlNewFile = provider.getNewFile(); if (urlNewFile != null) { InputStream in = urlNewFile.openStream(); Files.copy(in, newFile.toPath(), StandardCopyOption.REPLACE_EXISTING); in.close(); } } catch (IOException ex) { ex.printStackTrace(); } getViewer().expandToLevel(parent, 1); getViewer().refresh(); getViewer().setSelection(new StructuredSelection(newFile)); handleEditAction(); } } } </DeepExtract> }
archi-scripting-plugin
positive
3,779
@Override public void setDate(int parameterIndex, Date theDate, Calendar cal) throws SQLException { ensureCap(parameterIndex); setObj(parameterIndex, theDate != null ? new Timestamp(theDate.getTime()) : null); }
@Override public void setDate(int parameterIndex, Date theDate, Calendar cal) throws SQLException { <DeepExtract> ensureCap(parameterIndex); setObj(parameterIndex, theDate != null ? new Timestamp(theDate.getTime()) : null); </DeepExtract> }
SQLDroid
positive
3,780
public static void main(String[] args) { MarketplaceWebServiceOrdersAsyncClient client = MarketplaceWebServiceOrdersSampleConfig.getAsyncClient(); List<ListOrdersRequest> requestList = new ArrayList<ListOrdersRequest>(); ListOrdersRequest request = new ListOrdersRequest(); String sellerId = "example"; request.setSellerId(sellerId); XMLGregorianCalendar createdAfter = MwsUtl.getDTF().newXMLGregorianCalendar(); request.setCreatedAfter(createdAfter); XMLGregorianCalendar createdBefore = MwsUtl.getDTF().newXMLGregorianCalendar(); request.setCreatedBefore(createdBefore); XMLGregorianCalendar lastUpdatedAfter = MwsUtl.getDTF().newXMLGregorianCalendar(); request.setLastUpdatedAfter(lastUpdatedAfter); XMLGregorianCalendar lastUpdatedBefore = MwsUtl.getDTF().newXMLGregorianCalendar(); request.setLastUpdatedBefore(lastUpdatedBefore); List<String> orderStatus = new ArrayList<String>(); request.setOrderStatus(orderStatus); List<String> marketplaceId = new ArrayList<String>(); request.setMarketplaceId(marketplaceId); List<String> fulfillmentChannel = new ArrayList<String>(); request.setFulfillmentChannel(fulfillmentChannel); List<String> paymentMethod = new ArrayList<String>(); request.setPaymentMethod(paymentMethod); String buyerEmail = "example"; request.setBuyerEmail(buyerEmail); String sellerOrderId = "example"; request.setSellerOrderId(sellerOrderId); Integer maxResultsPerPage = 1; request.setMaxResultsPerPage(maxResultsPerPage); List<String> tfmShipmentStatus = new ArrayList<String>(); request.setTFMShipmentStatus(tfmShipmentStatus); requestList.add(request); List<Future<ListOrdersResponse>> futureList = new ArrayList<Future<ListOrdersResponse>>(); for (ListOrdersRequest request : requestList) { Future<ListOrdersResponse> future = client.listOrdersAsync(request); futureList.add(future); } List<Object> responseList = new ArrayList<Object>(); for (Future<ListOrdersResponse> future : futureList) { Object xresponse; try { ListOrdersResponse response = future.get(); ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); System.out.println("Response:"); System.out.println("RequestId: " + rhmd.getRequestId()); System.out.println("Timestamp: " + rhmd.getTimestamp()); String responseXml = response.toXML(); System.out.println(responseXml); xresponse = response; } catch (ExecutionException ee) { Throwable cause = ee.getCause(); if (cause instanceof MarketplaceWebServiceOrdersException) { MarketplaceWebServiceOrdersException ex = (MarketplaceWebServiceOrdersException) cause; ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); System.out.println("Service Exception:"); System.out.println("RequestId: " + rhmd.getRequestId()); System.out.println("Timestamp: " + rhmd.getTimestamp()); System.out.println("Message: " + ex.getMessage()); System.out.println("StatusCode: " + ex.getStatusCode()); System.out.println("ErrorCode: " + ex.getErrorCode()); System.out.println("ErrorType: " + ex.getErrorType()); xresponse = ex; } else { xresponse = cause; } } catch (Exception e) { xresponse = e; } responseList.add(xresponse); } return responseList; }
public static void main(String[] args) { MarketplaceWebServiceOrdersAsyncClient client = MarketplaceWebServiceOrdersSampleConfig.getAsyncClient(); List<ListOrdersRequest> requestList = new ArrayList<ListOrdersRequest>(); ListOrdersRequest request = new ListOrdersRequest(); String sellerId = "example"; request.setSellerId(sellerId); XMLGregorianCalendar createdAfter = MwsUtl.getDTF().newXMLGregorianCalendar(); request.setCreatedAfter(createdAfter); XMLGregorianCalendar createdBefore = MwsUtl.getDTF().newXMLGregorianCalendar(); request.setCreatedBefore(createdBefore); XMLGregorianCalendar lastUpdatedAfter = MwsUtl.getDTF().newXMLGregorianCalendar(); request.setLastUpdatedAfter(lastUpdatedAfter); XMLGregorianCalendar lastUpdatedBefore = MwsUtl.getDTF().newXMLGregorianCalendar(); request.setLastUpdatedBefore(lastUpdatedBefore); List<String> orderStatus = new ArrayList<String>(); request.setOrderStatus(orderStatus); List<String> marketplaceId = new ArrayList<String>(); request.setMarketplaceId(marketplaceId); List<String> fulfillmentChannel = new ArrayList<String>(); request.setFulfillmentChannel(fulfillmentChannel); List<String> paymentMethod = new ArrayList<String>(); request.setPaymentMethod(paymentMethod); String buyerEmail = "example"; request.setBuyerEmail(buyerEmail); String sellerOrderId = "example"; request.setSellerOrderId(sellerOrderId); Integer maxResultsPerPage = 1; request.setMaxResultsPerPage(maxResultsPerPage); List<String> tfmShipmentStatus = new ArrayList<String>(); request.setTFMShipmentStatus(tfmShipmentStatus); requestList.add(request); <DeepExtract> List<Future<ListOrdersResponse>> futureList = new ArrayList<Future<ListOrdersResponse>>(); for (ListOrdersRequest request : requestList) { Future<ListOrdersResponse> future = client.listOrdersAsync(request); futureList.add(future); } List<Object> responseList = new ArrayList<Object>(); for (Future<ListOrdersResponse> future : futureList) { Object xresponse; try { ListOrdersResponse response = future.get(); ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); System.out.println("Response:"); System.out.println("RequestId: " + rhmd.getRequestId()); System.out.println("Timestamp: " + rhmd.getTimestamp()); String responseXml = response.toXML(); System.out.println(responseXml); xresponse = response; } catch (ExecutionException ee) { Throwable cause = ee.getCause(); if (cause instanceof MarketplaceWebServiceOrdersException) { MarketplaceWebServiceOrdersException ex = (MarketplaceWebServiceOrdersException) cause; ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); System.out.println("Service Exception:"); System.out.println("RequestId: " + rhmd.getRequestId()); System.out.println("Timestamp: " + rhmd.getTimestamp()); System.out.println("Message: " + ex.getMessage()); System.out.println("StatusCode: " + ex.getStatusCode()); System.out.println("ErrorCode: " + ex.getErrorCode()); System.out.println("ErrorType: " + ex.getErrorType()); xresponse = ex; } else { xresponse = cause; } } catch (Exception e) { xresponse = e; } responseList.add(xresponse); } return responseList; </DeepExtract> }
amazon-mws-orders
positive
3,781
public String toString() { return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name)); }
public String toString() { <DeepExtract> return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name)); </DeepExtract> }
struts2_vulns
positive
3,782
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.activity_home); ButterKnife.bind(this); StatusBarUtil.immersive(this); StatusBarUtil.setPaddingSmart(this, mIvHomeBanner); StatusBarUtil.setPaddingSmart(this, mToolbar); setFabDynamicState(); String[] titles = { GlobalConfig.CATEGORY_NAME_APP, GlobalConfig.CATEGORY_NAME_ANDROID, GlobalConfig.CATEGORY_NAME_IOS, GlobalConfig.CATEGORY_NAME_FRONT_END, GlobalConfig.CATEGORY_NAME_RECOMMEND, GlobalConfig.CATEGORY_NAME_RESOURCE }; CommonViewPagerAdapter infoPagerAdapter = new CommonViewPagerAdapter(getSupportFragmentManager(), titles); appFragment = CategoryFragment.newInstance(titles[0]); androidFragment = CategoryFragment.newInstance(titles[1]); iOSFragment = CategoryFragment.newInstance(titles[2]); frontFragment = CategoryFragment.newInstance(titles[3]); referenceFragment = CategoryFragment.newInstance(titles[4]); resFragment = CategoryFragment.newInstance(titles[5]); infoPagerAdapter.addFragment(appFragment); infoPagerAdapter.addFragment(androidFragment); infoPagerAdapter.addFragment(iOSFragment); infoPagerAdapter.addFragment(frontFragment); infoPagerAdapter.addFragment(referenceFragment); infoPagerAdapter.addFragment(resFragment); mVpCategory.setAdapter(infoPagerAdapter); mDachshundTabLayout.setupWithViewPager(mVpCategory); mVpCategory.setCurrentItem(1); mHomePresenter.subscribe(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.activity_home); ButterKnife.bind(this); <DeepExtract> StatusBarUtil.immersive(this); StatusBarUtil.setPaddingSmart(this, mIvHomeBanner); StatusBarUtil.setPaddingSmart(this, mToolbar); setFabDynamicState(); String[] titles = { GlobalConfig.CATEGORY_NAME_APP, GlobalConfig.CATEGORY_NAME_ANDROID, GlobalConfig.CATEGORY_NAME_IOS, GlobalConfig.CATEGORY_NAME_FRONT_END, GlobalConfig.CATEGORY_NAME_RECOMMEND, GlobalConfig.CATEGORY_NAME_RESOURCE }; CommonViewPagerAdapter infoPagerAdapter = new CommonViewPagerAdapter(getSupportFragmentManager(), titles); appFragment = CategoryFragment.newInstance(titles[0]); androidFragment = CategoryFragment.newInstance(titles[1]); iOSFragment = CategoryFragment.newInstance(titles[2]); frontFragment = CategoryFragment.newInstance(titles[3]); referenceFragment = CategoryFragment.newInstance(titles[4]); resFragment = CategoryFragment.newInstance(titles[5]); infoPagerAdapter.addFragment(appFragment); infoPagerAdapter.addFragment(androidFragment); infoPagerAdapter.addFragment(iOSFragment); infoPagerAdapter.addFragment(frontFragment); infoPagerAdapter.addFragment(referenceFragment); infoPagerAdapter.addFragment(resFragment); mVpCategory.setAdapter(infoPagerAdapter); mDachshundTabLayout.setupWithViewPager(mVpCategory); mVpCategory.setCurrentItem(1); </DeepExtract> mHomePresenter.subscribe(); }
UGank
positive
3,783
public Criteria andCommentThreadIdGreaterThanOrEqualTo(String value) { if (value == null) { throw new RuntimeException("Value for " + "commentThreadId" + " cannot be null"); } criteria.add(new Criterion("comment_thread_id >=", value)); return (Criteria) this; }
public Criteria andCommentThreadIdGreaterThanOrEqualTo(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "commentThreadId" + " cannot be null"); } criteria.add(new Criterion("comment_thread_id >=", value)); </DeepExtract> return (Criteria) this; }
ReptilianDemo
positive
3,784
private void copyFrom(Advertisement other) { if (this == other) { return; } return mStartTimeUtcMillis; return mStopTimeUtcMillis; return mType; return mRequestUrl; }
private void copyFrom(Advertisement other) { if (this == other) { return; } return mStartTimeUtcMillis; return mStopTimeUtcMillis; return mType; <DeepExtract> return mRequestUrl; </DeepExtract> }
xipl
positive
3,785
public Criteria andPasswordBetween(String value1, String value2) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "password" + " cannot be null"); } criteria.add(new Criterion("password between", value1, value2)); return (Criteria) this; }
public Criteria andPasswordBetween(String value1, String value2) { <DeepExtract> if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "password" + " cannot be null"); } criteria.add(new Criterion("password between", value1, value2)); </DeepExtract> return (Criteria) this; }
answerWeb
positive
3,786
public static void main(String[] args) { ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine nashorn = sem.getEngineByName("nashorn"); try { nashorn.eval("load('PATH-TO/org/java8recipes/chapter18/js/helloNashorn.js')"); } catch (ScriptException ex) { Logger.getLogger(NashornInvoker.class.getName()).log(Level.SEVERE, null, ex); } ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine nashorn = sem.getEngineByName("nashorn"); try { nashorn.eval("function gallons(width, length, avgDepth){var volume = avgDepth * width * length;" + " return volume * 7.48; }"); nashorn.eval("print('Gallons of water in pool: '+ gallons(16,32,5))"); } catch (ScriptException ex) { Logger.getLogger(NashornInvoker.class.getName()).log(Level.SEVERE, null, ex); } ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine nashorn = sem.getEngineByName("nashorn"); try { nashorn.eval("function gallons(width, length, avgDepth){var volume = avgDepth * width * length;" + " return volume * 7.48; }"); Double gallons = (Double) nashorn.eval("gallons(16,32,5);"); System.out.println("The number of gallons: " + gallons); } catch (ScriptException ex) { Logger.getLogger(NashornInvoker.class.getName()).log(Level.SEVERE, null, ex); } }
public static void main(String[] args) { ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine nashorn = sem.getEngineByName("nashorn"); try { nashorn.eval("load('PATH-TO/org/java8recipes/chapter18/js/helloNashorn.js')"); } catch (ScriptException ex) { Logger.getLogger(NashornInvoker.class.getName()).log(Level.SEVERE, null, ex); } ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine nashorn = sem.getEngineByName("nashorn"); try { nashorn.eval("function gallons(width, length, avgDepth){var volume = avgDepth * width * length;" + " return volume * 7.48; }"); nashorn.eval("print('Gallons of water in pool: '+ gallons(16,32,5))"); } catch (ScriptException ex) { Logger.getLogger(NashornInvoker.class.getName()).log(Level.SEVERE, null, ex); } <DeepExtract> ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine nashorn = sem.getEngineByName("nashorn"); try { nashorn.eval("function gallons(width, length, avgDepth){var volume = avgDepth * width * length;" + " return volume * 7.48; }"); Double gallons = (Double) nashorn.eval("gallons(16,32,5);"); System.out.println("The number of gallons: " + gallons); } catch (ScriptException ex) { Logger.getLogger(NashornInvoker.class.getName()).log(Level.SEVERE, null, ex); } </DeepExtract> }
java-8-recipes
positive
3,787
@Override protected void onPostExecute(Object result) { ServiceSinkhole.reload("DNS cleanup", ActivityDns.this, false); if (adapter != null) adapter.changeCursor(DatabaseHelper.getInstance(this).getDns()); }
@Override protected void onPostExecute(Object result) { ServiceSinkhole.reload("DNS cleanup", ActivityDns.this, false); <DeepExtract> if (adapter != null) adapter.changeCursor(DatabaseHelper.getInstance(this).getDns()); </DeepExtract> }
tracker-control-android
positive
3,788
public static void doIt(BufferedReader r, PrintWriter w) { BulkArrayDeque c = new BulkArrayDeque(Integer.class); List<Integer> arr = new ArrayList<Integer>(); System.out.println("\nTest Case 1 - add 20 elements:"); for (int i = 0; i < 20; i++) c.add(i); for (int i = 0; i < 20; i++) arr.add(i); System.out.print("BulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.print("\nTest Case 2 - remove(2):"); c.remove(2); arr.remove(2); System.out.print("\nBulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.println("\nTest Case 3 - removeRange(2,8):"); System.out.print("PreremoveRange: "); for (Object o : c) { System.out.print(" " + o + " "); } if (2 < 0 || 2 >= n || 8 < 0 || 8 > n) { throw new IndexOutOfBoundsException(); } if (2 >= 8) { } else { int removing = 8 - 2; int leftover = n - removing; T[] output = f.newArray(leftover); for (int k = 0; k < 2; k++) { output[k] = a[(j + k) % a.length]; } for (int k = 2; k < leftover; k++) { int shiftedIndex = k + removing; output[k] = a[(j + shiftedIndex) % a.length]; } a = output; j = 0; n = a.length; } System.out.print("\nPostremoveRange: "); for (Object o : c) { System.out.print(" " + o + " "); } arr.subList(2, 8).clear(); System.out.print("\nBulkArrayDeque: "); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.println("\nTest Case 4:"); for (int i = 5; i < 10; i++) c.add(i, i); for (int i = 5; i < 10; i++) arr.add(i, i); System.out.print("BulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.print("\nTest Case 5:"); if (4 < 0 || 4 >= n || 10 < 0 || 10 > n) { throw new IndexOutOfBoundsException(); } if (4 >= 10) { } else { int removing = 10 - 4; int leftover = n - removing; T[] output = f.newArray(leftover); for (int k = 0; k < 4; k++) { output[k] = a[(j + k) % a.length]; } for (int k = 4; k < leftover; k++) { int shiftedIndex = k + removing; output[k] = a[(j + shiftedIndex) % a.length]; } a = output; j = 0; n = a.length; } arr.subList(4, 10).clear(); System.out.print("\nBulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.print("\nTest Case 6:"); if (7 < 0 || 7 >= n || 4 < 0 || 4 > n) { throw new IndexOutOfBoundsException(); } if (7 >= 4) { } else { int removing = 4 - 7; int leftover = n - removing; T[] output = f.newArray(leftover); for (int k = 0; k < 7; k++) { output[k] = a[(j + k) % a.length]; } for (int k = 7; k < leftover; k++) { int shiftedIndex = k + removing; output[k] = a[(j + shiftedIndex) % a.length]; } a = output; j = 0; n = a.length; } arr.subList(0, 0).clear(); System.out.print("\nBulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } }
public static void doIt(BufferedReader r, PrintWriter w) { BulkArrayDeque c = new BulkArrayDeque(Integer.class); List<Integer> arr = new ArrayList<Integer>(); System.out.println("\nTest Case 1 - add 20 elements:"); for (int i = 0; i < 20; i++) c.add(i); for (int i = 0; i < 20; i++) arr.add(i); System.out.print("BulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.print("\nTest Case 2 - remove(2):"); c.remove(2); arr.remove(2); System.out.print("\nBulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.println("\nTest Case 3 - removeRange(2,8):"); System.out.print("PreremoveRange: "); for (Object o : c) { System.out.print(" " + o + " "); } if (2 < 0 || 2 >= n || 8 < 0 || 8 > n) { throw new IndexOutOfBoundsException(); } if (2 >= 8) { } else { int removing = 8 - 2; int leftover = n - removing; T[] output = f.newArray(leftover); for (int k = 0; k < 2; k++) { output[k] = a[(j + k) % a.length]; } for (int k = 2; k < leftover; k++) { int shiftedIndex = k + removing; output[k] = a[(j + shiftedIndex) % a.length]; } a = output; j = 0; n = a.length; } System.out.print("\nPostremoveRange: "); for (Object o : c) { System.out.print(" " + o + " "); } arr.subList(2, 8).clear(); System.out.print("\nBulkArrayDeque: "); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.println("\nTest Case 4:"); for (int i = 5; i < 10; i++) c.add(i, i); for (int i = 5; i < 10; i++) arr.add(i, i); System.out.print("BulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.print("\nTest Case 5:"); if (4 < 0 || 4 >= n || 10 < 0 || 10 > n) { throw new IndexOutOfBoundsException(); } if (4 >= 10) { } else { int removing = 10 - 4; int leftover = n - removing; T[] output = f.newArray(leftover); for (int k = 0; k < 4; k++) { output[k] = a[(j + k) % a.length]; } for (int k = 4; k < leftover; k++) { int shiftedIndex = k + removing; output[k] = a[(j + shiftedIndex) % a.length]; } a = output; j = 0; n = a.length; } arr.subList(4, 10).clear(); System.out.print("\nBulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } System.out.println(); System.out.print("\nTest Case 6:"); <DeepExtract> if (7 < 0 || 7 >= n || 4 < 0 || 4 > n) { throw new IndexOutOfBoundsException(); } if (7 >= 4) { } else { int removing = 4 - 7; int leftover = n - removing; T[] output = f.newArray(leftover); for (int k = 0; k < 7; k++) { output[k] = a[(j + k) % a.length]; } for (int k = 7; k < leftover; k++) { int shiftedIndex = k + removing; output[k] = a[(j + shiftedIndex) % a.length]; } a = output; j = 0; n = a.length; } </DeepExtract> arr.subList(0, 0).clear(); System.out.print("\nBulkArrayDeque:"); for (Object o : c) { System.out.print(" " + (Integer) o + " "); } System.out.print("\nArrayList: "); for (int num : arr) { System.out.print(" " + num + " "); } }
Carleton-University-CS-Guide
positive
3,789
private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { send_put("get", new get()); recv_put(); send_put("put", new put()); recv_put(); return processMap; }
private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { send_put("get", new get()); recv_put(); <DeepExtract> send_put("put", new put()); recv_put(); </DeepExtract> return processMap; }
thrift-rpc
positive
3,790
public void changeCursorAndColumns(Cursor c, String[] from, int[] to) { mOriginalFrom = from; mTo = to; if (c != null) { int i; int count = mOriginalFrom.length; if (mFrom == null || mFrom.length != count) { mFrom = new int[count]; } for (i = 0; i < count; i++) { mFrom[i] = c.getColumnIndexOrThrow(mOriginalFrom[i]); } } else { mFrom = null; } super.changeCursor(c); }
public void changeCursorAndColumns(Cursor c, String[] from, int[] to) { mOriginalFrom = from; mTo = to; <DeepExtract> if (c != null) { int i; int count = mOriginalFrom.length; if (mFrom == null || mFrom.length != count) { mFrom = new int[count]; } for (i = 0; i < count; i++) { mFrom[i] = c.getColumnIndexOrThrow(mOriginalFrom[i]); } } else { mFrom = null; } </DeepExtract> super.changeCursor(c); }
WristBilibili
positive
3,791
public static void checkGet(final String namespace, final long startTimestampMillis, final long endTimestampMillis, final Map<String, String> metadataQuery, final Map<String, String> dimensionsQuery) { checkNamespace(namespace); checkArgument(startTimestampMillis >= 0, "invalid start timestamp"); checkArgument(endTimestampMillis >= startTimestampMillis, "end timestamp cannot be before start timestamp"); checkArgument(endTimestampMillis - startTimestampMillis <= TimeUnit.DAYS.toMillis(7), "query cannot be wider than 7 days"); if (metadataQuery == null || metadataQuery.isEmpty()) { return; } final Set<String> uniqueKeys = new HashSet<>(); for (final Map.Entry<String, String> entry : metadataQuery.entrySet()) { final String key = entry.getKey(); checkString(entry.getValue(), "metadata query '" + key + "' has null/empty value"); uniqueKeys.add(key.toUpperCase()); } checkArgument(uniqueKeys.size() == metadataQuery.size(), "metadata keys must be unique ignoring case"); if (dimensionsQuery == null || dimensionsQuery.isEmpty()) { return; } final Set<String> uniqueKeys = new HashSet<>(); for (final Map.Entry<String, String> entry : dimensionsQuery.entrySet()) { checkArgument(entry.getValue() != null, "dimension '" + entry.getKey() + "' has null value"); uniqueKeys.add(entry.getKey().toUpperCase()); } checkArgument(uniqueKeys.size() == dimensionsQuery.size(), "dimension keys must be unique ignoring case"); }
public static void checkGet(final String namespace, final long startTimestampMillis, final long endTimestampMillis, final Map<String, String> metadataQuery, final Map<String, String> dimensionsQuery) { checkNamespace(namespace); checkArgument(startTimestampMillis >= 0, "invalid start timestamp"); checkArgument(endTimestampMillis >= startTimestampMillis, "end timestamp cannot be before start timestamp"); checkArgument(endTimestampMillis - startTimestampMillis <= TimeUnit.DAYS.toMillis(7), "query cannot be wider than 7 days"); if (metadataQuery == null || metadataQuery.isEmpty()) { return; } final Set<String> uniqueKeys = new HashSet<>(); for (final Map.Entry<String, String> entry : metadataQuery.entrySet()) { final String key = entry.getKey(); checkString(entry.getValue(), "metadata query '" + key + "' has null/empty value"); uniqueKeys.add(key.toUpperCase()); } checkArgument(uniqueKeys.size() == metadataQuery.size(), "metadata keys must be unique ignoring case"); <DeepExtract> if (dimensionsQuery == null || dimensionsQuery.isEmpty()) { return; } final Set<String> uniqueKeys = new HashSet<>(); for (final Map.Entry<String, String> entry : dimensionsQuery.entrySet()) { checkArgument(entry.getValue() != null, "dimension '" + entry.getKey() + "' has null value"); uniqueKeys.add(entry.getKey().toUpperCase()); } checkArgument(uniqueKeys.size() == dimensionsQuery.size(), "dimension keys must be unique ignoring case"); </DeepExtract> }
cantor
positive
3,792
public void worldDataBegin() { original = Vars.net; staticNet.setNet(net).setProvider(provider); Vars.net = staticNet; mindustry.gen.Call.worldDataBegin(); Vars.net = original; original = null; }
public void worldDataBegin() { original = Vars.net; staticNet.setNet(net).setProvider(provider); Vars.net = staticNet; mindustry.gen.Call.worldDataBegin(); <DeepExtract> Vars.net = original; original = null; </DeepExtract> }
Mindustry-Ozone
positive
3,794
protected InnerBuilder replaceHeaderWithUrl(String url, String key, String value) { if (UrlUtil.isUrl(url) && !TextUtils.isEmpty(key)) { Map<String, String> existHeaders = mUrlHeaders.get(url); if (existHeaders == null) { existHeaders = new HashMap<String, String>(); mUrlHeaders.put(url, existHeaders); } if (true) { if (existHeaders.containsKey(key)) { existHeaders.remove(key); existHeaders.put(key, value); } } else { if (!existHeaders.containsKey(key)) { existHeaders.put(key, value); } } } return this; }
protected InnerBuilder replaceHeaderWithUrl(String url, String key, String value) { <DeepExtract> if (UrlUtil.isUrl(url) && !TextUtils.isEmpty(key)) { Map<String, String> existHeaders = mUrlHeaders.get(url); if (existHeaders == null) { existHeaders = new HashMap<String, String>(); mUrlHeaders.put(url, existHeaders); } if (true) { if (existHeaders.containsKey(key)) { existHeaders.remove(key); existHeaders.put(key, value); } } else { if (!existHeaders.containsKey(key)) { existHeaders.put(key, value); } } } </DeepExtract> return this; }
file-downloader
positive
3,795
public static void printE(String args) { args = TAG + args; }
public static void printE(String args) { <DeepExtract> </DeepExtract> args = TAG + args; <DeepExtract> </DeepExtract> }
InputScope
positive
3,796
@Override public void handleMessage(Message msg) { dismissDialog(); String msg = ""; if (mInputType == InputType.PLAIN_TEXT || mInputType == InputType.PASSWORD) { msg = mEditText.getText().toString(); } else { msg = content; } Log.d(TAG, "setResult:" + mResultMap); JSONObject ret2 = new JSONObject(); try { ret2.put("role", "master"); ret2.put("stat", "ok"); ret2.put("message", msg); mResultMap.put("value", ret2.toString()); } catch (JSONException e) { e.printStackTrace(); } setResult(mResultMap); }
@Override public void handleMessage(Message msg) { <DeepExtract> dismissDialog(); String msg = ""; if (mInputType == InputType.PLAIN_TEXT || mInputType == InputType.PASSWORD) { msg = mEditText.getText().toString(); } else { msg = content; } Log.d(TAG, "setResult:" + mResultMap); JSONObject ret2 = new JSONObject(); try { ret2.put("role", "master"); ret2.put("stat", "ok"); ret2.put("message", msg); mResultMap.put("value", ret2.toString()); } catch (JSONException e) { e.printStackTrace(); } setResult(mResultMap); </DeepExtract> }
qpysl4a
positive
3,797
public Criteria andAddressIn(List<String> values) { if (values == null) { throw new RuntimeException("Value for " + "address" + " cannot be null"); } criteria.add(new Criterion("address in", values)); return (Criteria) this; }
public Criteria andAddressIn(List<String> values) { <DeepExtract> if (values == null) { throw new RuntimeException("Value for " + "address" + " cannot be null"); } criteria.add(new Criterion("address in", values)); </DeepExtract> return (Criteria) this; }
health_online
positive
3,798
private ChannelHandler getChannelHandler(Object o) throws ClassNotFoundException, IllegalAccessException, InstantiationException { String className; if (o instanceof String) { String s = (String) o; if (s.indexOf('\n') > -1) s = s.substring(0, s.indexOf('\n')); className = s; } else if (o instanceof Element) { Element e = (Element) o; String className = e.getAttribute("classname"); className = className; } throw new RuntimeException("Don't know how to get classname from a " + o.getClass()); String[] parameters; if (o instanceof Element) { Element e = (Element) o; NodeList parameters = e.getElementsByTagName("Parameter"); String[] p = new String[parameters.getLength()]; for (int i = 0; i < parameters.getLength(); i++) { Node n = parameters.item(i); NodeList children = n.getChildNodes(); if (children.getLength() == 1) { p[i] = children.item(0).getTextContent(); } else { for (int j = 0; i < children.getLength(); j++) { if (children.item(j) instanceof CDATASection) { p[i] = ((CharacterData) children.item(j)).getData(); break; } } } } parameters = p; } throw new RuntimeException("Don't know how to get parameters from a " + o.getClass()); Object handler = instanceFactory.getClassInstance(className, ChannelHandler.class, parameters); return (ChannelHandler) handler; }
private ChannelHandler getChannelHandler(Object o) throws ClassNotFoundException, IllegalAccessException, InstantiationException { String className; if (o instanceof String) { String s = (String) o; if (s.indexOf('\n') > -1) s = s.substring(0, s.indexOf('\n')); className = s; } else if (o instanceof Element) { Element e = (Element) o; String className = e.getAttribute("classname"); className = className; } throw new RuntimeException("Don't know how to get classname from a " + o.getClass()); <DeepExtract> String[] parameters; if (o instanceof Element) { Element e = (Element) o; NodeList parameters = e.getElementsByTagName("Parameter"); String[] p = new String[parameters.getLength()]; for (int i = 0; i < parameters.getLength(); i++) { Node n = parameters.item(i); NodeList children = n.getChildNodes(); if (children.getLength() == 1) { p[i] = children.item(0).getTextContent(); } else { for (int j = 0; i < children.getLength(); j++) { if (children.item(j) instanceof CDATASection) { p[i] = ((CharacterData) children.item(j)).getData(); break; } } } } parameters = p; } throw new RuntimeException("Don't know how to get parameters from a " + o.getClass()); </DeepExtract> Object handler = instanceFactory.getClassInstance(className, ChannelHandler.class, parameters); return (ChannelHandler) handler; }
mallet
positive
3,799
@Override public void atTurnStart() { baseCard.isCostModified = this.isCostModified; baseCard.isCostModifiedForTurn = this.isCostModifiedForTurn; baseCard.costForTurn = this.costForTurn; baseCard.cost = this.cost; baseCard.atTurnStart(); }
@Override public void atTurnStart() { <DeepExtract> baseCard.isCostModified = this.isCostModified; baseCard.isCostModifiedForTurn = this.isCostModifiedForTurn; baseCard.costForTurn = this.costForTurn; baseCard.cost = this.cost; </DeepExtract> baseCard.atTurnStart(); }
sts-mad-science-mod
positive
3,801
protected void processBlock(byte[] data) { for (int i = 0; i < 16; i++) { M[i] = decodeBELong(data, i * 8); G[i] = M[i] ^ H[i]; } for (int r = 0; r < 14; r++) { G[0x0] ^= (long) (r) << 56; G[0x1] ^= (long) (0x10 + r) << 56; G[0x2] ^= (long) (0x20 + r) << 56; G[0x3] ^= (long) (0x30 + r) << 56; G[0x4] ^= (long) (0x40 + r) << 56; G[0x5] ^= (long) (0x50 + r) << 56; G[0x6] ^= (long) (0x60 + r) << 56; G[0x7] ^= (long) (0x70 + r) << 56; G[0x8] ^= (long) (0x80 + r) << 56; G[0x9] ^= (long) (0x90 + r) << 56; G[0xA] ^= (long) (0xA0 + r) << 56; G[0xB] ^= (long) (0xB0 + r) << 56; G[0xC] ^= (long) (0xC0 + r) << 56; G[0xD] ^= (long) (0xD0 + r) << 56; G[0xE] ^= (long) (0xE0 + r) << 56; G[0xF] ^= (long) (0xF0 + r) << 56; long t0 = T0[(int) (G[0x0] >>> 56)] ^ T1[(int) (G[0x1] >>> 48) & 0xFF] ^ T2[(int) (G[0x2] >>> 40) & 0xFF] ^ T3[(int) (G[0x3] >>> 32) & 0xFF] ^ T4[((int) G[0x4] >>> 24)] ^ T5[((int) G[0x5] >>> 16) & 0xFF] ^ T6[((int) G[0x6] >>> 8) & 0xFF] ^ T7[(int) G[0xB] & 0xFF]; long t1 = T0[(int) (G[0x1] >>> 56)] ^ T1[(int) (G[0x2] >>> 48) & 0xFF] ^ T2[(int) (G[0x3] >>> 40) & 0xFF] ^ T3[(int) (G[0x4] >>> 32) & 0xFF] ^ T4[((int) G[0x5] >>> 24)] ^ T5[((int) G[0x6] >>> 16) & 0xFF] ^ T6[((int) G[0x7] >>> 8) & 0xFF] ^ T7[(int) G[0xC] & 0xFF]; long t2 = T0[(int) (G[0x2] >>> 56)] ^ T1[(int) (G[0x3] >>> 48) & 0xFF] ^ T2[(int) (G[0x4] >>> 40) & 0xFF] ^ T3[(int) (G[0x5] >>> 32) & 0xFF] ^ T4[((int) G[0x6] >>> 24)] ^ T5[((int) G[0x7] >>> 16) & 0xFF] ^ T6[((int) G[0x8] >>> 8) & 0xFF] ^ T7[(int) G[0xD] & 0xFF]; long t3 = T0[(int) (G[0x3] >>> 56)] ^ T1[(int) (G[0x4] >>> 48) & 0xFF] ^ T2[(int) (G[0x5] >>> 40) & 0xFF] ^ T3[(int) (G[0x6] >>> 32) & 0xFF] ^ T4[((int) G[0x7] >>> 24)] ^ T5[((int) G[0x8] >>> 16) & 0xFF] ^ T6[((int) G[0x9] >>> 8) & 0xFF] ^ T7[(int) G[0xE] & 0xFF]; long t4 = T0[(int) (G[0x4] >>> 56)] ^ T1[(int) (G[0x5] >>> 48) & 0xFF] ^ T2[(int) (G[0x6] >>> 40) & 0xFF] ^ T3[(int) (G[0x7] >>> 32) & 0xFF] ^ T4[((int) G[0x8] >>> 24)] ^ T5[((int) G[0x9] >>> 16) & 0xFF] ^ T6[((int) G[0xA] >>> 8) & 0xFF] ^ T7[(int) G[0xF] & 0xFF]; long t5 = T0[(int) (G[0x5] >>> 56)] ^ T1[(int) (G[0x6] >>> 48) & 0xFF] ^ T2[(int) (G[0x7] >>> 40) & 0xFF] ^ T3[(int) (G[0x8] >>> 32) & 0xFF] ^ T4[((int) G[0x9] >>> 24)] ^ T5[((int) G[0xA] >>> 16) & 0xFF] ^ T6[((int) G[0xB] >>> 8) & 0xFF] ^ T7[(int) G[0x0] & 0xFF]; long t6 = T0[(int) (G[0x6] >>> 56)] ^ T1[(int) (G[0x7] >>> 48) & 0xFF] ^ T2[(int) (G[0x8] >>> 40) & 0xFF] ^ T3[(int) (G[0x9] >>> 32) & 0xFF] ^ T4[((int) G[0xA] >>> 24)] ^ T5[((int) G[0xB] >>> 16) & 0xFF] ^ T6[((int) G[0xC] >>> 8) & 0xFF] ^ T7[(int) G[0x1] & 0xFF]; long t7 = T0[(int) (G[0x7] >>> 56)] ^ T1[(int) (G[0x8] >>> 48) & 0xFF] ^ T2[(int) (G[0x9] >>> 40) & 0xFF] ^ T3[(int) (G[0xA] >>> 32) & 0xFF] ^ T4[((int) G[0xB] >>> 24)] ^ T5[((int) G[0xC] >>> 16) & 0xFF] ^ T6[((int) G[0xD] >>> 8) & 0xFF] ^ T7[(int) G[0x2] & 0xFF]; long t8 = T0[(int) (G[0x8] >>> 56)] ^ T1[(int) (G[0x9] >>> 48) & 0xFF] ^ T2[(int) (G[0xA] >>> 40) & 0xFF] ^ T3[(int) (G[0xB] >>> 32) & 0xFF] ^ T4[((int) G[0xC] >>> 24)] ^ T5[((int) G[0xD] >>> 16) & 0xFF] ^ T6[((int) G[0xE] >>> 8) & 0xFF] ^ T7[(int) G[0x3] & 0xFF]; long t9 = T0[(int) (G[0x9] >>> 56)] ^ T1[(int) (G[0xA] >>> 48) & 0xFF] ^ T2[(int) (G[0xB] >>> 40) & 0xFF] ^ T3[(int) (G[0xC] >>> 32) & 0xFF] ^ T4[((int) G[0xD] >>> 24)] ^ T5[((int) G[0xE] >>> 16) & 0xFF] ^ T6[((int) G[0xF] >>> 8) & 0xFF] ^ T7[(int) G[0x4] & 0xFF]; long tA = T0[(int) (G[0xA] >>> 56)] ^ T1[(int) (G[0xB] >>> 48) & 0xFF] ^ T2[(int) (G[0xC] >>> 40) & 0xFF] ^ T3[(int) (G[0xD] >>> 32) & 0xFF] ^ T4[((int) G[0xE] >>> 24)] ^ T5[((int) G[0xF] >>> 16) & 0xFF] ^ T6[((int) G[0x0] >>> 8) & 0xFF] ^ T7[(int) G[0x5] & 0xFF]; long tB = T0[(int) (G[0xB] >>> 56)] ^ T1[(int) (G[0xC] >>> 48) & 0xFF] ^ T2[(int) (G[0xD] >>> 40) & 0xFF] ^ T3[(int) (G[0xE] >>> 32) & 0xFF] ^ T4[((int) G[0xF] >>> 24)] ^ T5[((int) G[0x0] >>> 16) & 0xFF] ^ T6[((int) G[0x1] >>> 8) & 0xFF] ^ T7[(int) G[0x6] & 0xFF]; long tC = T0[(int) (G[0xC] >>> 56)] ^ T1[(int) (G[0xD] >>> 48) & 0xFF] ^ T2[(int) (G[0xE] >>> 40) & 0xFF] ^ T3[(int) (G[0xF] >>> 32) & 0xFF] ^ T4[((int) G[0x0] >>> 24)] ^ T5[((int) G[0x1] >>> 16) & 0xFF] ^ T6[((int) G[0x2] >>> 8) & 0xFF] ^ T7[(int) G[0x7] & 0xFF]; long tD = T0[(int) (G[0xD] >>> 56)] ^ T1[(int) (G[0xE] >>> 48) & 0xFF] ^ T2[(int) (G[0xF] >>> 40) & 0xFF] ^ T3[(int) (G[0x0] >>> 32) & 0xFF] ^ T4[((int) G[0x1] >>> 24)] ^ T5[((int) G[0x2] >>> 16) & 0xFF] ^ T6[((int) G[0x3] >>> 8) & 0xFF] ^ T7[(int) G[0x8] & 0xFF]; long tE = T0[(int) (G[0xE] >>> 56)] ^ T1[(int) (G[0xF] >>> 48) & 0xFF] ^ T2[(int) (G[0x0] >>> 40) & 0xFF] ^ T3[(int) (G[0x1] >>> 32) & 0xFF] ^ T4[((int) G[0x2] >>> 24)] ^ T5[((int) G[0x3] >>> 16) & 0xFF] ^ T6[((int) G[0x4] >>> 8) & 0xFF] ^ T7[(int) G[0x9] & 0xFF]; long tF = T0[(int) (G[0xF] >>> 56)] ^ T1[(int) (G[0x0] >>> 48) & 0xFF] ^ T2[(int) (G[0x1] >>> 40) & 0xFF] ^ T3[(int) (G[0x2] >>> 32) & 0xFF] ^ T4[((int) G[0x3] >>> 24)] ^ T5[((int) G[0x4] >>> 16) & 0xFF] ^ T6[((int) G[0x5] >>> 8) & 0xFF] ^ T7[(int) G[0xA] & 0xFF]; G[0x0] = t0; G[0x1] = t1; G[0x2] = t2; G[0x3] = t3; G[0x4] = t4; G[0x5] = t5; G[0x6] = t6; G[0x7] = t7; G[0x8] = t8; G[0x9] = t9; G[0xA] = tA; G[0xB] = tB; G[0xC] = tC; G[0xD] = tD; G[0xE] = tE; G[0xF] = tF; } for (int r = 0; r < 14; r++) { M[0x0] ^= (long) r ^ -0x01L; M[0x1] ^= (long) r ^ -0x11L; M[0x2] ^= (long) r ^ -0x21L; M[0x3] ^= (long) r ^ -0x31L; M[0x4] ^= (long) r ^ -0x41L; M[0x5] ^= (long) r ^ -0x51L; M[0x6] ^= (long) r ^ -0x61L; M[0x7] ^= (long) r ^ -0x71L; M[0x8] ^= (long) r ^ -0x81L; M[0x9] ^= (long) r ^ -0x91L; M[0xA] ^= (long) r ^ -0xA1L; M[0xB] ^= (long) r ^ -0xB1L; M[0xC] ^= (long) r ^ -0xC1L; M[0xD] ^= (long) r ^ -0xD1L; M[0xE] ^= (long) r ^ -0xE1L; M[0xF] ^= (long) r ^ -0xF1L; long t0 = T0[(int) (M[0x1] >>> 56)] ^ T1[(int) (M[0x3] >>> 48) & 0xFF] ^ T2[(int) (M[0x5] >>> 40) & 0xFF] ^ T3[(int) (M[0xB] >>> 32) & 0xFF] ^ T4[((int) M[0x0] >>> 24)] ^ T5[((int) M[0x2] >>> 16) & 0xFF] ^ T6[((int) M[0x4] >>> 8) & 0xFF] ^ T7[(int) M[0x6] & 0xFF]; long t1 = T0[(int) (M[0x2] >>> 56)] ^ T1[(int) (M[0x4] >>> 48) & 0xFF] ^ T2[(int) (M[0x6] >>> 40) & 0xFF] ^ T3[(int) (M[0xC] >>> 32) & 0xFF] ^ T4[((int) M[0x1] >>> 24)] ^ T5[((int) M[0x3] >>> 16) & 0xFF] ^ T6[((int) M[0x5] >>> 8) & 0xFF] ^ T7[(int) M[0x7] & 0xFF]; long t2 = T0[(int) (M[0x3] >>> 56)] ^ T1[(int) (M[0x5] >>> 48) & 0xFF] ^ T2[(int) (M[0x7] >>> 40) & 0xFF] ^ T3[(int) (M[0xD] >>> 32) & 0xFF] ^ T4[((int) M[0x2] >>> 24)] ^ T5[((int) M[0x4] >>> 16) & 0xFF] ^ T6[((int) M[0x6] >>> 8) & 0xFF] ^ T7[(int) M[0x8] & 0xFF]; long t3 = T0[(int) (M[0x4] >>> 56)] ^ T1[(int) (M[0x6] >>> 48) & 0xFF] ^ T2[(int) (M[0x8] >>> 40) & 0xFF] ^ T3[(int) (M[0xE] >>> 32) & 0xFF] ^ T4[((int) M[0x3] >>> 24)] ^ T5[((int) M[0x5] >>> 16) & 0xFF] ^ T6[((int) M[0x7] >>> 8) & 0xFF] ^ T7[(int) M[0x9] & 0xFF]; long t4 = T0[(int) (M[0x5] >>> 56)] ^ T1[(int) (M[0x7] >>> 48) & 0xFF] ^ T2[(int) (M[0x9] >>> 40) & 0xFF] ^ T3[(int) (M[0xF] >>> 32) & 0xFF] ^ T4[((int) M[0x4] >>> 24)] ^ T5[((int) M[0x6] >>> 16) & 0xFF] ^ T6[((int) M[0x8] >>> 8) & 0xFF] ^ T7[(int) M[0xA] & 0xFF]; long t5 = T0[(int) (M[0x6] >>> 56)] ^ T1[(int) (M[0x8] >>> 48) & 0xFF] ^ T2[(int) (M[0xA] >>> 40) & 0xFF] ^ T3[(int) (M[0x0] >>> 32) & 0xFF] ^ T4[((int) M[0x5] >>> 24)] ^ T5[((int) M[0x7] >>> 16) & 0xFF] ^ T6[((int) M[0x9] >>> 8) & 0xFF] ^ T7[(int) M[0xB] & 0xFF]; long t6 = T0[(int) (M[0x7] >>> 56)] ^ T1[(int) (M[0x9] >>> 48) & 0xFF] ^ T2[(int) (M[0xB] >>> 40) & 0xFF] ^ T3[(int) (M[0x1] >>> 32) & 0xFF] ^ T4[((int) M[0x6] >>> 24)] ^ T5[((int) M[0x8] >>> 16) & 0xFF] ^ T6[((int) M[0xA] >>> 8) & 0xFF] ^ T7[(int) M[0xC] & 0xFF]; long t7 = T0[(int) (M[0x8] >>> 56)] ^ T1[(int) (M[0xA] >>> 48) & 0xFF] ^ T2[(int) (M[0xC] >>> 40) & 0xFF] ^ T3[(int) (M[0x2] >>> 32) & 0xFF] ^ T4[((int) M[0x7] >>> 24)] ^ T5[((int) M[0x9] >>> 16) & 0xFF] ^ T6[((int) M[0xB] >>> 8) & 0xFF] ^ T7[(int) M[0xD] & 0xFF]; long t8 = T0[(int) (M[0x9] >>> 56)] ^ T1[(int) (M[0xB] >>> 48) & 0xFF] ^ T2[(int) (M[0xD] >>> 40) & 0xFF] ^ T3[(int) (M[0x3] >>> 32) & 0xFF] ^ T4[((int) M[0x8] >>> 24)] ^ T5[((int) M[0xA] >>> 16) & 0xFF] ^ T6[((int) M[0xC] >>> 8) & 0xFF] ^ T7[(int) M[0xE] & 0xFF]; long t9 = T0[(int) (M[0xA] >>> 56)] ^ T1[(int) (M[0xC] >>> 48) & 0xFF] ^ T2[(int) (M[0xE] >>> 40) & 0xFF] ^ T3[(int) (M[0x4] >>> 32) & 0xFF] ^ T4[((int) M[0x9] >>> 24)] ^ T5[((int) M[0xB] >>> 16) & 0xFF] ^ T6[((int) M[0xD] >>> 8) & 0xFF] ^ T7[(int) M[0xF] & 0xFF]; long tA = T0[(int) (M[0xB] >>> 56)] ^ T1[(int) (M[0xD] >>> 48) & 0xFF] ^ T2[(int) (M[0xF] >>> 40) & 0xFF] ^ T3[(int) (M[0x5] >>> 32) & 0xFF] ^ T4[((int) M[0xA] >>> 24)] ^ T5[((int) M[0xC] >>> 16) & 0xFF] ^ T6[((int) M[0xE] >>> 8) & 0xFF] ^ T7[(int) M[0x0] & 0xFF]; long tB = T0[(int) (M[0xC] >>> 56)] ^ T1[(int) (M[0xE] >>> 48) & 0xFF] ^ T2[(int) (M[0x0] >>> 40) & 0xFF] ^ T3[(int) (M[0x6] >>> 32) & 0xFF] ^ T4[((int) M[0xB] >>> 24)] ^ T5[((int) M[0xD] >>> 16) & 0xFF] ^ T6[((int) M[0xF] >>> 8) & 0xFF] ^ T7[(int) M[0x1] & 0xFF]; long tC = T0[(int) (M[0xD] >>> 56)] ^ T1[(int) (M[0xF] >>> 48) & 0xFF] ^ T2[(int) (M[0x1] >>> 40) & 0xFF] ^ T3[(int) (M[0x7] >>> 32) & 0xFF] ^ T4[((int) M[0xC] >>> 24)] ^ T5[((int) M[0xE] >>> 16) & 0xFF] ^ T6[((int) M[0x0] >>> 8) & 0xFF] ^ T7[(int) M[0x2] & 0xFF]; long tD = T0[(int) (M[0xE] >>> 56)] ^ T1[(int) (M[0x0] >>> 48) & 0xFF] ^ T2[(int) (M[0x2] >>> 40) & 0xFF] ^ T3[(int) (M[0x8] >>> 32) & 0xFF] ^ T4[((int) M[0xD] >>> 24)] ^ T5[((int) M[0xF] >>> 16) & 0xFF] ^ T6[((int) M[0x1] >>> 8) & 0xFF] ^ T7[(int) M[0x3] & 0xFF]; long tE = T0[(int) (M[0xF] >>> 56)] ^ T1[(int) (M[0x1] >>> 48) & 0xFF] ^ T2[(int) (M[0x3] >>> 40) & 0xFF] ^ T3[(int) (M[0x9] >>> 32) & 0xFF] ^ T4[((int) M[0xE] >>> 24)] ^ T5[((int) M[0x0] >>> 16) & 0xFF] ^ T6[((int) M[0x2] >>> 8) & 0xFF] ^ T7[(int) M[0x4] & 0xFF]; long tF = T0[(int) (M[0x0] >>> 56)] ^ T1[(int) (M[0x2] >>> 48) & 0xFF] ^ T2[(int) (M[0x4] >>> 40) & 0xFF] ^ T3[(int) (M[0xA] >>> 32) & 0xFF] ^ T4[((int) M[0xF] >>> 24)] ^ T5[((int) M[0x1] >>> 16) & 0xFF] ^ T6[((int) M[0x3] >>> 8) & 0xFF] ^ T7[(int) M[0x5] & 0xFF]; M[0x0] = t0; M[0x1] = t1; M[0x2] = t2; M[0x3] = t3; M[0x4] = t4; M[0x5] = t5; M[0x6] = t6; M[0x7] = t7; M[0x8] = t8; M[0x9] = t9; M[0xA] = tA; M[0xB] = tB; M[0xC] = tC; M[0xD] = tD; M[0xE] = tE; M[0xF] = tF; } for (int i = 0; i < 16; i++) H[i] ^= G[i] ^ M[i]; }
protected void processBlock(byte[] data) { for (int i = 0; i < 16; i++) { M[i] = decodeBELong(data, i * 8); G[i] = M[i] ^ H[i]; } for (int r = 0; r < 14; r++) { G[0x0] ^= (long) (r) << 56; G[0x1] ^= (long) (0x10 + r) << 56; G[0x2] ^= (long) (0x20 + r) << 56; G[0x3] ^= (long) (0x30 + r) << 56; G[0x4] ^= (long) (0x40 + r) << 56; G[0x5] ^= (long) (0x50 + r) << 56; G[0x6] ^= (long) (0x60 + r) << 56; G[0x7] ^= (long) (0x70 + r) << 56; G[0x8] ^= (long) (0x80 + r) << 56; G[0x9] ^= (long) (0x90 + r) << 56; G[0xA] ^= (long) (0xA0 + r) << 56; G[0xB] ^= (long) (0xB0 + r) << 56; G[0xC] ^= (long) (0xC0 + r) << 56; G[0xD] ^= (long) (0xD0 + r) << 56; G[0xE] ^= (long) (0xE0 + r) << 56; G[0xF] ^= (long) (0xF0 + r) << 56; long t0 = T0[(int) (G[0x0] >>> 56)] ^ T1[(int) (G[0x1] >>> 48) & 0xFF] ^ T2[(int) (G[0x2] >>> 40) & 0xFF] ^ T3[(int) (G[0x3] >>> 32) & 0xFF] ^ T4[((int) G[0x4] >>> 24)] ^ T5[((int) G[0x5] >>> 16) & 0xFF] ^ T6[((int) G[0x6] >>> 8) & 0xFF] ^ T7[(int) G[0xB] & 0xFF]; long t1 = T0[(int) (G[0x1] >>> 56)] ^ T1[(int) (G[0x2] >>> 48) & 0xFF] ^ T2[(int) (G[0x3] >>> 40) & 0xFF] ^ T3[(int) (G[0x4] >>> 32) & 0xFF] ^ T4[((int) G[0x5] >>> 24)] ^ T5[((int) G[0x6] >>> 16) & 0xFF] ^ T6[((int) G[0x7] >>> 8) & 0xFF] ^ T7[(int) G[0xC] & 0xFF]; long t2 = T0[(int) (G[0x2] >>> 56)] ^ T1[(int) (G[0x3] >>> 48) & 0xFF] ^ T2[(int) (G[0x4] >>> 40) & 0xFF] ^ T3[(int) (G[0x5] >>> 32) & 0xFF] ^ T4[((int) G[0x6] >>> 24)] ^ T5[((int) G[0x7] >>> 16) & 0xFF] ^ T6[((int) G[0x8] >>> 8) & 0xFF] ^ T7[(int) G[0xD] & 0xFF]; long t3 = T0[(int) (G[0x3] >>> 56)] ^ T1[(int) (G[0x4] >>> 48) & 0xFF] ^ T2[(int) (G[0x5] >>> 40) & 0xFF] ^ T3[(int) (G[0x6] >>> 32) & 0xFF] ^ T4[((int) G[0x7] >>> 24)] ^ T5[((int) G[0x8] >>> 16) & 0xFF] ^ T6[((int) G[0x9] >>> 8) & 0xFF] ^ T7[(int) G[0xE] & 0xFF]; long t4 = T0[(int) (G[0x4] >>> 56)] ^ T1[(int) (G[0x5] >>> 48) & 0xFF] ^ T2[(int) (G[0x6] >>> 40) & 0xFF] ^ T3[(int) (G[0x7] >>> 32) & 0xFF] ^ T4[((int) G[0x8] >>> 24)] ^ T5[((int) G[0x9] >>> 16) & 0xFF] ^ T6[((int) G[0xA] >>> 8) & 0xFF] ^ T7[(int) G[0xF] & 0xFF]; long t5 = T0[(int) (G[0x5] >>> 56)] ^ T1[(int) (G[0x6] >>> 48) & 0xFF] ^ T2[(int) (G[0x7] >>> 40) & 0xFF] ^ T3[(int) (G[0x8] >>> 32) & 0xFF] ^ T4[((int) G[0x9] >>> 24)] ^ T5[((int) G[0xA] >>> 16) & 0xFF] ^ T6[((int) G[0xB] >>> 8) & 0xFF] ^ T7[(int) G[0x0] & 0xFF]; long t6 = T0[(int) (G[0x6] >>> 56)] ^ T1[(int) (G[0x7] >>> 48) & 0xFF] ^ T2[(int) (G[0x8] >>> 40) & 0xFF] ^ T3[(int) (G[0x9] >>> 32) & 0xFF] ^ T4[((int) G[0xA] >>> 24)] ^ T5[((int) G[0xB] >>> 16) & 0xFF] ^ T6[((int) G[0xC] >>> 8) & 0xFF] ^ T7[(int) G[0x1] & 0xFF]; long t7 = T0[(int) (G[0x7] >>> 56)] ^ T1[(int) (G[0x8] >>> 48) & 0xFF] ^ T2[(int) (G[0x9] >>> 40) & 0xFF] ^ T3[(int) (G[0xA] >>> 32) & 0xFF] ^ T4[((int) G[0xB] >>> 24)] ^ T5[((int) G[0xC] >>> 16) & 0xFF] ^ T6[((int) G[0xD] >>> 8) & 0xFF] ^ T7[(int) G[0x2] & 0xFF]; long t8 = T0[(int) (G[0x8] >>> 56)] ^ T1[(int) (G[0x9] >>> 48) & 0xFF] ^ T2[(int) (G[0xA] >>> 40) & 0xFF] ^ T3[(int) (G[0xB] >>> 32) & 0xFF] ^ T4[((int) G[0xC] >>> 24)] ^ T5[((int) G[0xD] >>> 16) & 0xFF] ^ T6[((int) G[0xE] >>> 8) & 0xFF] ^ T7[(int) G[0x3] & 0xFF]; long t9 = T0[(int) (G[0x9] >>> 56)] ^ T1[(int) (G[0xA] >>> 48) & 0xFF] ^ T2[(int) (G[0xB] >>> 40) & 0xFF] ^ T3[(int) (G[0xC] >>> 32) & 0xFF] ^ T4[((int) G[0xD] >>> 24)] ^ T5[((int) G[0xE] >>> 16) & 0xFF] ^ T6[((int) G[0xF] >>> 8) & 0xFF] ^ T7[(int) G[0x4] & 0xFF]; long tA = T0[(int) (G[0xA] >>> 56)] ^ T1[(int) (G[0xB] >>> 48) & 0xFF] ^ T2[(int) (G[0xC] >>> 40) & 0xFF] ^ T3[(int) (G[0xD] >>> 32) & 0xFF] ^ T4[((int) G[0xE] >>> 24)] ^ T5[((int) G[0xF] >>> 16) & 0xFF] ^ T6[((int) G[0x0] >>> 8) & 0xFF] ^ T7[(int) G[0x5] & 0xFF]; long tB = T0[(int) (G[0xB] >>> 56)] ^ T1[(int) (G[0xC] >>> 48) & 0xFF] ^ T2[(int) (G[0xD] >>> 40) & 0xFF] ^ T3[(int) (G[0xE] >>> 32) & 0xFF] ^ T4[((int) G[0xF] >>> 24)] ^ T5[((int) G[0x0] >>> 16) & 0xFF] ^ T6[((int) G[0x1] >>> 8) & 0xFF] ^ T7[(int) G[0x6] & 0xFF]; long tC = T0[(int) (G[0xC] >>> 56)] ^ T1[(int) (G[0xD] >>> 48) & 0xFF] ^ T2[(int) (G[0xE] >>> 40) & 0xFF] ^ T3[(int) (G[0xF] >>> 32) & 0xFF] ^ T4[((int) G[0x0] >>> 24)] ^ T5[((int) G[0x1] >>> 16) & 0xFF] ^ T6[((int) G[0x2] >>> 8) & 0xFF] ^ T7[(int) G[0x7] & 0xFF]; long tD = T0[(int) (G[0xD] >>> 56)] ^ T1[(int) (G[0xE] >>> 48) & 0xFF] ^ T2[(int) (G[0xF] >>> 40) & 0xFF] ^ T3[(int) (G[0x0] >>> 32) & 0xFF] ^ T4[((int) G[0x1] >>> 24)] ^ T5[((int) G[0x2] >>> 16) & 0xFF] ^ T6[((int) G[0x3] >>> 8) & 0xFF] ^ T7[(int) G[0x8] & 0xFF]; long tE = T0[(int) (G[0xE] >>> 56)] ^ T1[(int) (G[0xF] >>> 48) & 0xFF] ^ T2[(int) (G[0x0] >>> 40) & 0xFF] ^ T3[(int) (G[0x1] >>> 32) & 0xFF] ^ T4[((int) G[0x2] >>> 24)] ^ T5[((int) G[0x3] >>> 16) & 0xFF] ^ T6[((int) G[0x4] >>> 8) & 0xFF] ^ T7[(int) G[0x9] & 0xFF]; long tF = T0[(int) (G[0xF] >>> 56)] ^ T1[(int) (G[0x0] >>> 48) & 0xFF] ^ T2[(int) (G[0x1] >>> 40) & 0xFF] ^ T3[(int) (G[0x2] >>> 32) & 0xFF] ^ T4[((int) G[0x3] >>> 24)] ^ T5[((int) G[0x4] >>> 16) & 0xFF] ^ T6[((int) G[0x5] >>> 8) & 0xFF] ^ T7[(int) G[0xA] & 0xFF]; G[0x0] = t0; G[0x1] = t1; G[0x2] = t2; G[0x3] = t3; G[0x4] = t4; G[0x5] = t5; G[0x6] = t6; G[0x7] = t7; G[0x8] = t8; G[0x9] = t9; G[0xA] = tA; G[0xB] = tB; G[0xC] = tC; G[0xD] = tD; G[0xE] = tE; G[0xF] = tF; } <DeepExtract> for (int r = 0; r < 14; r++) { M[0x0] ^= (long) r ^ -0x01L; M[0x1] ^= (long) r ^ -0x11L; M[0x2] ^= (long) r ^ -0x21L; M[0x3] ^= (long) r ^ -0x31L; M[0x4] ^= (long) r ^ -0x41L; M[0x5] ^= (long) r ^ -0x51L; M[0x6] ^= (long) r ^ -0x61L; M[0x7] ^= (long) r ^ -0x71L; M[0x8] ^= (long) r ^ -0x81L; M[0x9] ^= (long) r ^ -0x91L; M[0xA] ^= (long) r ^ -0xA1L; M[0xB] ^= (long) r ^ -0xB1L; M[0xC] ^= (long) r ^ -0xC1L; M[0xD] ^= (long) r ^ -0xD1L; M[0xE] ^= (long) r ^ -0xE1L; M[0xF] ^= (long) r ^ -0xF1L; long t0 = T0[(int) (M[0x1] >>> 56)] ^ T1[(int) (M[0x3] >>> 48) & 0xFF] ^ T2[(int) (M[0x5] >>> 40) & 0xFF] ^ T3[(int) (M[0xB] >>> 32) & 0xFF] ^ T4[((int) M[0x0] >>> 24)] ^ T5[((int) M[0x2] >>> 16) & 0xFF] ^ T6[((int) M[0x4] >>> 8) & 0xFF] ^ T7[(int) M[0x6] & 0xFF]; long t1 = T0[(int) (M[0x2] >>> 56)] ^ T1[(int) (M[0x4] >>> 48) & 0xFF] ^ T2[(int) (M[0x6] >>> 40) & 0xFF] ^ T3[(int) (M[0xC] >>> 32) & 0xFF] ^ T4[((int) M[0x1] >>> 24)] ^ T5[((int) M[0x3] >>> 16) & 0xFF] ^ T6[((int) M[0x5] >>> 8) & 0xFF] ^ T7[(int) M[0x7] & 0xFF]; long t2 = T0[(int) (M[0x3] >>> 56)] ^ T1[(int) (M[0x5] >>> 48) & 0xFF] ^ T2[(int) (M[0x7] >>> 40) & 0xFF] ^ T3[(int) (M[0xD] >>> 32) & 0xFF] ^ T4[((int) M[0x2] >>> 24)] ^ T5[((int) M[0x4] >>> 16) & 0xFF] ^ T6[((int) M[0x6] >>> 8) & 0xFF] ^ T7[(int) M[0x8] & 0xFF]; long t3 = T0[(int) (M[0x4] >>> 56)] ^ T1[(int) (M[0x6] >>> 48) & 0xFF] ^ T2[(int) (M[0x8] >>> 40) & 0xFF] ^ T3[(int) (M[0xE] >>> 32) & 0xFF] ^ T4[((int) M[0x3] >>> 24)] ^ T5[((int) M[0x5] >>> 16) & 0xFF] ^ T6[((int) M[0x7] >>> 8) & 0xFF] ^ T7[(int) M[0x9] & 0xFF]; long t4 = T0[(int) (M[0x5] >>> 56)] ^ T1[(int) (M[0x7] >>> 48) & 0xFF] ^ T2[(int) (M[0x9] >>> 40) & 0xFF] ^ T3[(int) (M[0xF] >>> 32) & 0xFF] ^ T4[((int) M[0x4] >>> 24)] ^ T5[((int) M[0x6] >>> 16) & 0xFF] ^ T6[((int) M[0x8] >>> 8) & 0xFF] ^ T7[(int) M[0xA] & 0xFF]; long t5 = T0[(int) (M[0x6] >>> 56)] ^ T1[(int) (M[0x8] >>> 48) & 0xFF] ^ T2[(int) (M[0xA] >>> 40) & 0xFF] ^ T3[(int) (M[0x0] >>> 32) & 0xFF] ^ T4[((int) M[0x5] >>> 24)] ^ T5[((int) M[0x7] >>> 16) & 0xFF] ^ T6[((int) M[0x9] >>> 8) & 0xFF] ^ T7[(int) M[0xB] & 0xFF]; long t6 = T0[(int) (M[0x7] >>> 56)] ^ T1[(int) (M[0x9] >>> 48) & 0xFF] ^ T2[(int) (M[0xB] >>> 40) & 0xFF] ^ T3[(int) (M[0x1] >>> 32) & 0xFF] ^ T4[((int) M[0x6] >>> 24)] ^ T5[((int) M[0x8] >>> 16) & 0xFF] ^ T6[((int) M[0xA] >>> 8) & 0xFF] ^ T7[(int) M[0xC] & 0xFF]; long t7 = T0[(int) (M[0x8] >>> 56)] ^ T1[(int) (M[0xA] >>> 48) & 0xFF] ^ T2[(int) (M[0xC] >>> 40) & 0xFF] ^ T3[(int) (M[0x2] >>> 32) & 0xFF] ^ T4[((int) M[0x7] >>> 24)] ^ T5[((int) M[0x9] >>> 16) & 0xFF] ^ T6[((int) M[0xB] >>> 8) & 0xFF] ^ T7[(int) M[0xD] & 0xFF]; long t8 = T0[(int) (M[0x9] >>> 56)] ^ T1[(int) (M[0xB] >>> 48) & 0xFF] ^ T2[(int) (M[0xD] >>> 40) & 0xFF] ^ T3[(int) (M[0x3] >>> 32) & 0xFF] ^ T4[((int) M[0x8] >>> 24)] ^ T5[((int) M[0xA] >>> 16) & 0xFF] ^ T6[((int) M[0xC] >>> 8) & 0xFF] ^ T7[(int) M[0xE] & 0xFF]; long t9 = T0[(int) (M[0xA] >>> 56)] ^ T1[(int) (M[0xC] >>> 48) & 0xFF] ^ T2[(int) (M[0xE] >>> 40) & 0xFF] ^ T3[(int) (M[0x4] >>> 32) & 0xFF] ^ T4[((int) M[0x9] >>> 24)] ^ T5[((int) M[0xB] >>> 16) & 0xFF] ^ T6[((int) M[0xD] >>> 8) & 0xFF] ^ T7[(int) M[0xF] & 0xFF]; long tA = T0[(int) (M[0xB] >>> 56)] ^ T1[(int) (M[0xD] >>> 48) & 0xFF] ^ T2[(int) (M[0xF] >>> 40) & 0xFF] ^ T3[(int) (M[0x5] >>> 32) & 0xFF] ^ T4[((int) M[0xA] >>> 24)] ^ T5[((int) M[0xC] >>> 16) & 0xFF] ^ T6[((int) M[0xE] >>> 8) & 0xFF] ^ T7[(int) M[0x0] & 0xFF]; long tB = T0[(int) (M[0xC] >>> 56)] ^ T1[(int) (M[0xE] >>> 48) & 0xFF] ^ T2[(int) (M[0x0] >>> 40) & 0xFF] ^ T3[(int) (M[0x6] >>> 32) & 0xFF] ^ T4[((int) M[0xB] >>> 24)] ^ T5[((int) M[0xD] >>> 16) & 0xFF] ^ T6[((int) M[0xF] >>> 8) & 0xFF] ^ T7[(int) M[0x1] & 0xFF]; long tC = T0[(int) (M[0xD] >>> 56)] ^ T1[(int) (M[0xF] >>> 48) & 0xFF] ^ T2[(int) (M[0x1] >>> 40) & 0xFF] ^ T3[(int) (M[0x7] >>> 32) & 0xFF] ^ T4[((int) M[0xC] >>> 24)] ^ T5[((int) M[0xE] >>> 16) & 0xFF] ^ T6[((int) M[0x0] >>> 8) & 0xFF] ^ T7[(int) M[0x2] & 0xFF]; long tD = T0[(int) (M[0xE] >>> 56)] ^ T1[(int) (M[0x0] >>> 48) & 0xFF] ^ T2[(int) (M[0x2] >>> 40) & 0xFF] ^ T3[(int) (M[0x8] >>> 32) & 0xFF] ^ T4[((int) M[0xD] >>> 24)] ^ T5[((int) M[0xF] >>> 16) & 0xFF] ^ T6[((int) M[0x1] >>> 8) & 0xFF] ^ T7[(int) M[0x3] & 0xFF]; long tE = T0[(int) (M[0xF] >>> 56)] ^ T1[(int) (M[0x1] >>> 48) & 0xFF] ^ T2[(int) (M[0x3] >>> 40) & 0xFF] ^ T3[(int) (M[0x9] >>> 32) & 0xFF] ^ T4[((int) M[0xE] >>> 24)] ^ T5[((int) M[0x0] >>> 16) & 0xFF] ^ T6[((int) M[0x2] >>> 8) & 0xFF] ^ T7[(int) M[0x4] & 0xFF]; long tF = T0[(int) (M[0x0] >>> 56)] ^ T1[(int) (M[0x2] >>> 48) & 0xFF] ^ T2[(int) (M[0x4] >>> 40) & 0xFF] ^ T3[(int) (M[0xA] >>> 32) & 0xFF] ^ T4[((int) M[0xF] >>> 24)] ^ T5[((int) M[0x1] >>> 16) & 0xFF] ^ T6[((int) M[0x3] >>> 8) & 0xFF] ^ T7[(int) M[0x5] & 0xFF]; M[0x0] = t0; M[0x1] = t1; M[0x2] = t2; M[0x3] = t3; M[0x4] = t4; M[0x5] = t5; M[0x6] = t6; M[0x7] = t7; M[0x8] = t8; M[0x9] = t9; M[0xA] = tA; M[0xB] = tB; M[0xC] = tC; M[0xD] = tD; M[0xE] = tE; M[0xF] = tF; } </DeepExtract> for (int i = 0; i < 16; i++) H[i] ^= G[i] ^ M[i]; }
burst-mining-system
positive
3,802
private void checkedSave(Permission p) throws IOException { Jenkins.getActiveInstance().checkPermission(p); Authentication old = SecurityContextHolder.getContext().getAuthentication(); SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM); try { save(); } finally { SecurityContextHolder.getContext().setAuthentication(old); } }
private void checkedSave(Permission p) throws IOException { <DeepExtract> Jenkins.getActiveInstance().checkPermission(p); </DeepExtract> Authentication old = SecurityContextHolder.getContext().getAuthentication(); SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM); try { save(); } finally { SecurityContextHolder.getContext().setAuthentication(old); } }
kube-credentials-plugin
positive
3,803
@Override public void appendTo(AppendableExt app) throws IOException { app.append("WHEN ").append(_test).append(" THEN "); app.append(_result); }
@Override public void appendTo(AppendableExt app) throws IOException { app.append("WHEN ").append(_test).append(" THEN "); <DeepExtract> app.append(_result); </DeepExtract> }
sqlbuilder
positive
3,804
@Override public void show() { if (itemSize <= 0) { return; } listAdapter.notifyDataSetChanged(); if (listView != null) { listView.setAdapter(listAdapter); listView.setOnItemClickListener(itemListener); } super.show(); }
@Override public void show() { if (itemSize <= 0) { return; } <DeepExtract> listAdapter.notifyDataSetChanged(); if (listView != null) { listView.setAdapter(listAdapter); listView.setOnItemClickListener(itemListener); } </DeepExtract> super.show(); }
NIM_Android_AVChatKit
positive
3,805
public static void main(String[] args) { for (int i = 0; i < sort().length; i++) { System.out.println(sort()[i]); } }
public static void main(String[] args) { <DeepExtract> for (int i = 0; i < sort().length; i++) { System.out.println(sort()[i]); } </DeepExtract> }
framework-analysis
positive
3,806
@Deprecated public Set<Rel> getPermittedRelations(MPerm perm) { return FactionColl.get().get(perm); }
@Deprecated public Set<Rel> getPermittedRelations(MPerm perm) { <DeepExtract> return FactionColl.get().get(perm); </DeepExtract> }
Factions
positive
3,807
@Test public void testCommitAfterPoll(TestContext ctx) throws Exception { String topicName = "testCommitAfterPoll-" + this.getClass().getName(); String consumerId = topicName; Async batch = ctx.async(); AtomicInteger index = new AtomicInteger(); int numMessages = 10; kafkaCluster.useTo().produceStrings(numMessages, batch::complete, () -> new ProducerRecord<>(topicName, 0, "key-" + index.get(), "value-" + index.getAndIncrement())); batch.awaitSuccess(10000); Properties config = kafkaCluster.useTo().getConsumerProperties(consumerId, consumerId, OffsetResetStrategy.EARLIEST); config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); CompletableFuture<KafkaReadStream<K, V>> ret = new CompletableFuture<>(); vertx.runOnContext(v -> { try { ret.complete(createConsumer(vertx.owner(), config)); } catch (Exception e) { ret.completeExceptionally(e); } }); return ret.get(10, TimeUnit.SECONDS); consumer.exceptionHandler(ctx::fail); Async subscribe = ctx.async(); consumer.subscribe(Collections.singleton(topicName)).onComplete(ar1 -> { subscribe.complete(); }); subscribe.await(); Async consume = ctx.async(); consumer.poll(Duration.ofSeconds(10)).onComplete(rec -> { if (rec.result().count() == 10) { consume.countDown(); } }); consume.await(); Async committed = ctx.async(); TopicPartition the_topic = new TopicPartition(topicName, 0); consumer.commit(Collections.singletonMap(the_topic, new OffsetAndMetadata(10))).onComplete(ar2 -> { committed.complete(); }); committed.await(); }
@Test public void testCommitAfterPoll(TestContext ctx) throws Exception { String topicName = "testCommitAfterPoll-" + this.getClass().getName(); String consumerId = topicName; Async batch = ctx.async(); AtomicInteger index = new AtomicInteger(); int numMessages = 10; kafkaCluster.useTo().produceStrings(numMessages, batch::complete, () -> new ProducerRecord<>(topicName, 0, "key-" + index.get(), "value-" + index.getAndIncrement())); batch.awaitSuccess(10000); Properties config = kafkaCluster.useTo().getConsumerProperties(consumerId, consumerId, OffsetResetStrategy.EARLIEST); config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); <DeepExtract> CompletableFuture<KafkaReadStream<K, V>> ret = new CompletableFuture<>(); vertx.runOnContext(v -> { try { ret.complete(createConsumer(vertx.owner(), config)); } catch (Exception e) { ret.completeExceptionally(e); } }); return ret.get(10, TimeUnit.SECONDS); </DeepExtract> consumer.exceptionHandler(ctx::fail); Async subscribe = ctx.async(); consumer.subscribe(Collections.singleton(topicName)).onComplete(ar1 -> { subscribe.complete(); }); subscribe.await(); Async consume = ctx.async(); consumer.poll(Duration.ofSeconds(10)).onComplete(rec -> { if (rec.result().count() == 10) { consume.countDown(); } }); consume.await(); Async committed = ctx.async(); TopicPartition the_topic = new TopicPartition(topicName, 0); consumer.commit(Collections.singletonMap(the_topic, new OffsetAndMetadata(10))).onComplete(ar2 -> { committed.complete(); }); committed.await(); }
vertx-kafka-client
positive
3,808
private void notifyHierarchyChanged() { if (currentlyStickingView != null) { stopStickingCurrentlyStickingView(); } stickyViews.clear(); if (!detainStickyView(getChildAt(0)) && (getChildAt(0) instanceof ViewGroup)) { ViewGroup vg = (ViewGroup) getChildAt(0); for (int i = 0; i < vg.getChildCount(); i++) findStickyViews(vg.getChildAt(i)); } View viewThatShouldStick = null; View approachingView = null; for (View v : stickyViews) { int viewTop = getTopForViewRelativeOnlyChild(v) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()); if (viewTop <= 0) { if (viewThatShouldStick == null || viewTop > (getTopForViewRelativeOnlyChild(viewThatShouldStick) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()))) { viewThatShouldStick = v; } } else { if (approachingView == null || viewTop < (getTopForViewRelativeOnlyChild(approachingView) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()))) { approachingView = v; } } } if (viewThatShouldStick != null) { stickyViewTopOffset = approachingView == null ? 0 : Math.min(0, getTopForViewRelativeOnlyChild(approachingView) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()) - viewThatShouldStick.getHeight()); if (viewThatShouldStick != currentlyStickingView) { if (currentlyStickingView != null) { if (mOnViewStickyListeners != null) { for (OnViewStickyListener onViewStickyListener : mOnViewStickyListeners) onViewStickyListener.onUnSticky(currentlyStickingView); } stopStickingCurrentlyStickingView(); } stickyViewLeftOffset = getLeftForViewRelativeOnlyChild(viewThatShouldStick); startStickingView(viewThatShouldStick); if (mOnViewStickyListeners != null) { for (OnViewStickyListener onViewStickyListener : mOnViewStickyListeners) onViewStickyListener.onSticky(currentlyStickingView); } } } else if (currentlyStickingView != null) { if (mOnViewStickyListeners != null) { for (OnViewStickyListener onViewStickyListener : mOnViewStickyListeners) onViewStickyListener.onUnSticky(currentlyStickingView); } stopStickingCurrentlyStickingView(); } invalidate(); }
private void notifyHierarchyChanged() { if (currentlyStickingView != null) { stopStickingCurrentlyStickingView(); } stickyViews.clear(); if (!detainStickyView(getChildAt(0)) && (getChildAt(0) instanceof ViewGroup)) { ViewGroup vg = (ViewGroup) getChildAt(0); for (int i = 0; i < vg.getChildCount(); i++) findStickyViews(vg.getChildAt(i)); } <DeepExtract> View viewThatShouldStick = null; View approachingView = null; for (View v : stickyViews) { int viewTop = getTopForViewRelativeOnlyChild(v) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()); if (viewTop <= 0) { if (viewThatShouldStick == null || viewTop > (getTopForViewRelativeOnlyChild(viewThatShouldStick) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()))) { viewThatShouldStick = v; } } else { if (approachingView == null || viewTop < (getTopForViewRelativeOnlyChild(approachingView) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()))) { approachingView = v; } } } if (viewThatShouldStick != null) { stickyViewTopOffset = approachingView == null ? 0 : Math.min(0, getTopForViewRelativeOnlyChild(approachingView) - getScrollY() + (clippingToPadding ? 0 : getPaddingTop()) - viewThatShouldStick.getHeight()); if (viewThatShouldStick != currentlyStickingView) { if (currentlyStickingView != null) { if (mOnViewStickyListeners != null) { for (OnViewStickyListener onViewStickyListener : mOnViewStickyListeners) onViewStickyListener.onUnSticky(currentlyStickingView); } stopStickingCurrentlyStickingView(); } stickyViewLeftOffset = getLeftForViewRelativeOnlyChild(viewThatShouldStick); startStickingView(viewThatShouldStick); if (mOnViewStickyListeners != null) { for (OnViewStickyListener onViewStickyListener : mOnViewStickyListeners) onViewStickyListener.onSticky(currentlyStickingView); } } } else if (currentlyStickingView != null) { if (mOnViewStickyListeners != null) { for (OnViewStickyListener onViewStickyListener : mOnViewStickyListeners) onViewStickyListener.onUnSticky(currentlyStickingView); } stopStickingCurrentlyStickingView(); } </DeepExtract> invalidate(); }
SwipeRecyclerView
positive
3,809
public void setIdle() { currentlyBusy = false; currentImage = idleImage; SwingUtilities.invokeLater(() -> { jFrame.setIconImage(currentImage); trayIcon.setImage(currentImage); }); }
public void setIdle() { currentlyBusy = false; currentImage = idleImage; <DeepExtract> SwingUtilities.invokeLater(() -> { jFrame.setIconImage(currentImage); trayIcon.setImage(currentImage); }); </DeepExtract> }
dli-downloader
positive
3,811
@Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { if (DEBUGGING) { LogUtil.d(TAG, "beforeTextChanged, count=" + count); } }
@Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { <DeepExtract> if (DEBUGGING) { LogUtil.d(TAG, "beforeTextChanged, count=" + count); } </DeepExtract> }
FMap
positive
3,812
protected void addFilterOption(@Nonnull final String value) { Objects.requireNonNull(value, "parameter value cannot be null"); Objects.requireNonNull(new QueryOption("$filter", value), "parameter option cannot be null"); baseRequest.addQueryOption(new QueryOption("$filter", value)); }
protected void addFilterOption(@Nonnull final String value) { Objects.requireNonNull(value, "parameter value cannot be null"); <DeepExtract> Objects.requireNonNull(new QueryOption("$filter", value), "parameter option cannot be null"); baseRequest.addQueryOption(new QueryOption("$filter", value)); </DeepExtract> }
msgraph-sdk-java-core
positive
3,813
private void initData() { displayItemCount = offset * 2 + 1; views.removeAllViews(); for (String item : items) { views.addView(createView(item)); } int position = itemHeight * (selectedIndex - offset) / itemHeight + offset; int remainder = itemHeight * (selectedIndex - offset) % itemHeight; int divided = itemHeight * (selectedIndex - offset) / itemHeight; if (remainder == 0) { position = divided + offset; } else { if (remainder > itemHeight / 2) { position = divided + offset + 1; } } int childSize = views.getChildCount(); for (int i = 0; i < childSize; i++) { TextView itemView = (TextView) views.getChildAt(i); if (null == itemView) { return; } if (position == i) { itemView.setTextColor(textColorFocus); } else { itemView.setTextColor(textColorNormal); } } }
private void initData() { displayItemCount = offset * 2 + 1; views.removeAllViews(); for (String item : items) { views.addView(createView(item)); } <DeepExtract> int position = itemHeight * (selectedIndex - offset) / itemHeight + offset; int remainder = itemHeight * (selectedIndex - offset) % itemHeight; int divided = itemHeight * (selectedIndex - offset) / itemHeight; if (remainder == 0) { position = divided + offset; } else { if (remainder > itemHeight / 2) { position = divided + offset + 1; } } int childSize = views.getChildCount(); for (int i = 0; i < childSize; i++) { TextView itemView = (TextView) views.getChildAt(i); if (null == itemView) { return; } if (position == i) { itemView.setTextColor(textColorFocus); } else { itemView.setTextColor(textColorNormal); } } </DeepExtract> }
AndroidPicker_LikeiOS
positive
3,814
public void actionPerformed(java.awt.event.ActionEvent evt) { this.show(false); }
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> this.show(false); </DeepExtract> }
ERSN-OpenMC
positive
3,815
public static void showShortSnackbar(View parent, CharSequence text, @ColorInt int textColor, @ColorInt int bgColor, CharSequence actionText, int actionTextColor, View.OnClickListener listener) { snackbarWeakReference = new WeakReference<>(Snackbar.make(parent, text, Snackbar.LENGTH_SHORT)); Snackbar snackbar = snackbarWeakReference.get(); View view = snackbar.getView(); snackbar.setActionTextColor(textColor); view.setBackgroundColor(bgColor); if (actionText != null && actionText.length() > 0 && listener != null) { snackbar.setActionTextColor(actionTextColor); snackbar.setAction(actionText, listener); } snackbar.show(); }
public static void showShortSnackbar(View parent, CharSequence text, @ColorInt int textColor, @ColorInt int bgColor, CharSequence actionText, int actionTextColor, View.OnClickListener listener) { <DeepExtract> snackbarWeakReference = new WeakReference<>(Snackbar.make(parent, text, Snackbar.LENGTH_SHORT)); Snackbar snackbar = snackbarWeakReference.get(); View view = snackbar.getView(); snackbar.setActionTextColor(textColor); view.setBackgroundColor(bgColor); if (actionText != null && actionText.length() > 0 && listener != null) { snackbar.setActionTextColor(actionTextColor); snackbar.setAction(actionText, listener); } snackbar.show(); </DeepExtract> }
OdyAndroidStore
positive
3,816
@Override public void pause() { if (element == null) { throw new IllegalStateException("This music instance is already disposed"); } element.pause(); }
@Override public void pause() { <DeepExtract> if (element == null) { throw new IllegalStateException("This music instance is already disposed"); } </DeepExtract> element.pause(); }
teavm-libgdx
positive
3,817
@Test public void query7() throws Exception { try (Check check = new Check()) { try (TSVReader expected = new TSVReader(new File(lubm + "/answers/answers_query" + 7 + ".txt"))) { expected.next(); for (List<String> line : expected) { check.onceList(line); } } check.ignoreTooOften(); String prefix = "query" + 7 + "/"; for (int j = 0; j < 5; j++) { String relation = prefix + j; if (lubmProgram.rulesForRelation(relation).isEmpty()) continue; try { getRelation(relation).forEach(check::apply); check.close(); return; } catch (AssertionError e) { evaluator().debug(lubmProgram, empty, Collections.singleton(relation)); throw e; } } throw new IllegalStateException("no relation found for query " + 7); } }
@Test public void query7() throws Exception { <DeepExtract> try (Check check = new Check()) { try (TSVReader expected = new TSVReader(new File(lubm + "/answers/answers_query" + 7 + ".txt"))) { expected.next(); for (List<String> line : expected) { check.onceList(line); } } check.ignoreTooOften(); String prefix = "query" + 7 + "/"; for (int j = 0; j < 5; j++) { String relation = prefix + j; if (lubmProgram.rulesForRelation(relation).isEmpty()) continue; try { getRelation(relation).forEach(check::apply); check.close(); return; } catch (AssertionError e) { evaluator().debug(lubmProgram, empty, Collections.singleton(relation)); throw e; } } throw new IllegalStateException("no relation found for query " + 7); } </DeepExtract> }
bashlog
positive
3,819
protected void setPaintColor(final int paintColor) { mPaintModeView.setPaintStrokeColor(paintColor); this.mPaintView.setColor(mPaintModeView.getStokenColor()); this.mPaintView.setWidth(mPaintModeView.getStokenWidth()); }
protected void setPaintColor(final int paintColor) { mPaintModeView.setPaintStrokeColor(paintColor); <DeepExtract> this.mPaintView.setColor(mPaintModeView.getStokenColor()); this.mPaintView.setWidth(mPaintModeView.getStokenWidth()); </DeepExtract> }
SimpleImageEditor
positive
3,820
public View setErrorLayout(@LayoutRes int layoutResId) { if (mErrorView != null) return mErrorView; ViewStub viewStub = (ViewStub) mView.findViewById(R.id.base_error_stub); if (viewStub != null) { viewStub.setLayoutResource(layoutResId); } ViewStub viewStub = (ViewStub) mView.findViewById(R.id.base_error_stub); if (viewStub != null && viewStub.getLayoutResource() != 0) { mErrorView = viewStub.inflate(); } return null; return mErrorView; }
public View setErrorLayout(@LayoutRes int layoutResId) { if (mErrorView != null) return mErrorView; ViewStub viewStub = (ViewStub) mView.findViewById(R.id.base_error_stub); if (viewStub != null) { viewStub.setLayoutResource(layoutResId); } <DeepExtract> ViewStub viewStub = (ViewStub) mView.findViewById(R.id.base_error_stub); if (viewStub != null && viewStub.getLayoutResource() != 0) { mErrorView = viewStub.inflate(); } return null; </DeepExtract> return mErrorView; }
MeiBaseModule
positive
3,821
private void abortHttpDialog(XmlMAPDialog xmlMAPDialog) { this.setXmlMAPDialog(xmlMAPDialog); EventContext httpEventContext = getEventContextCMP(); if (httpEventContext == null) { if (super.logger.isWarningEnabled()) { super.logger.warning("When HTTP Dialog aborting no pending HTTP request is found"); return; } } try { if (super.logger.isFineEnabled()) super.logger.fine("About to send HTTP response."); XmlMAPDialog dialog = getXmlMAPDialog(); byte[] data = getEventsSerializeFactory().serialize(dialog); if (super.logger.isFineEnabled()) { super.logger.fine("Sending HTTP Response Payload = \n" + new String(data)); } EventContext httpEventContext = this.resumeHttpEventContext(); if (httpEventContext == null) { logger.severe("No HTTP event context, can not deliver response for MapXmlDialog: " + dialog); return; } HttpServletRequestEvent httpRequest = (HttpServletRequestEvent) httpEventContext.getEvent(); HttpServletResponse response = httpRequest.getResponse(); response.setStatus(HttpServletResponse.SC_OK); try { response.getOutputStream().write(data); response.getOutputStream().flush(); } catch (NullPointerException npe) { super.logger.warning("Probably HTTPResponse already sent by HTTP-Servlet-RA. Increase HTTP_REQUEST_TIMEOUT in deploy-config.xml of RA to be greater than TCAP Dialog timeout", npe); } } catch (XMLStreamException xmle) { super.logger.severe("Failed to serialize dialog", xmle); } catch (IOException e) { super.logger.severe("Failed to send answer!", e); } HttpSessionActivity httpSessionActivity = this.getHttpSessionActivity(); if (httpSessionActivity != null) { httpSessionActivity.endActivity(); } }
private void abortHttpDialog(XmlMAPDialog xmlMAPDialog) { this.setXmlMAPDialog(xmlMAPDialog); EventContext httpEventContext = getEventContextCMP(); if (httpEventContext == null) { if (super.logger.isWarningEnabled()) { super.logger.warning("When HTTP Dialog aborting no pending HTTP request is found"); return; } } try { if (super.logger.isFineEnabled()) super.logger.fine("About to send HTTP response."); XmlMAPDialog dialog = getXmlMAPDialog(); byte[] data = getEventsSerializeFactory().serialize(dialog); if (super.logger.isFineEnabled()) { super.logger.fine("Sending HTTP Response Payload = \n" + new String(data)); } EventContext httpEventContext = this.resumeHttpEventContext(); if (httpEventContext == null) { logger.severe("No HTTP event context, can not deliver response for MapXmlDialog: " + dialog); return; } HttpServletRequestEvent httpRequest = (HttpServletRequestEvent) httpEventContext.getEvent(); HttpServletResponse response = httpRequest.getResponse(); response.setStatus(HttpServletResponse.SC_OK); try { response.getOutputStream().write(data); response.getOutputStream().flush(); } catch (NullPointerException npe) { super.logger.warning("Probably HTTPResponse already sent by HTTP-Servlet-RA. Increase HTTP_REQUEST_TIMEOUT in deploy-config.xml of RA to be greater than TCAP Dialog timeout", npe); } } catch (XMLStreamException xmle) { super.logger.severe("Failed to serialize dialog", xmle); } catch (IOException e) { super.logger.severe("Failed to send answer!", e); } <DeepExtract> HttpSessionActivity httpSessionActivity = this.getHttpSessionActivity(); if (httpSessionActivity != null) { httpSessionActivity.endActivity(); } </DeepExtract> }
ussdgateway
positive
3,822
@Test public void testAgainstArrayDequeVariousTailHeadPositions() { this.deque.clear(); this.deque.head = this.deque.tail = 2; final Random rnd = new Random(randomLong()); final int rounds = 10000; final int modulo = 100; final ArrayDeque<KType> ad = new ArrayDeque<KType>(); for (int i = 0; i < rounds; i++) { KType k = cast(rnd.nextInt(modulo)); final int op = rnd.nextInt(8); if (op < 2) { deque.addFirst(k); ad.addFirst(k); } else if (op < 4) { deque.addLast(k); ad.addLast(k); } else if (op < 5 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 6 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 7) { assertEquals(ad.removeFirstOccurrence(k), deque.removeFirst(k) >= 0); } else if (op < 8) { assertEquals(ad.removeLastOccurrence(k), deque.removeLast(k) >= 0); } assertEquals(ad.size(), deque.size()); } assertArrayEquals(ad.toArray(), deque.toArray()); this.deque.clear(); this.deque.head = this.deque.tail = this.deque.buffer.length - 2; final Random rnd = new Random(randomLong()); final int rounds = 10000; final int modulo = 100; final ArrayDeque<KType> ad = new ArrayDeque<KType>(); for (int i = 0; i < rounds; i++) { KType k = cast(rnd.nextInt(modulo)); final int op = rnd.nextInt(8); if (op < 2) { deque.addFirst(k); ad.addFirst(k); } else if (op < 4) { deque.addLast(k); ad.addLast(k); } else if (op < 5 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 6 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 7) { assertEquals(ad.removeFirstOccurrence(k), deque.removeFirst(k) >= 0); } else if (op < 8) { assertEquals(ad.removeLastOccurrence(k), deque.removeLast(k) >= 0); } assertEquals(ad.size(), deque.size()); } assertArrayEquals(ad.toArray(), deque.toArray()); this.deque.clear(); this.deque.head = this.deque.tail = this.deque.buffer.length / 2; final Random rnd = new Random(randomLong()); final int rounds = 10000; final int modulo = 100; final ArrayDeque<KType> ad = new ArrayDeque<KType>(); for (int i = 0; i < rounds; i++) { KType k = cast(rnd.nextInt(modulo)); final int op = rnd.nextInt(8); if (op < 2) { deque.addFirst(k); ad.addFirst(k); } else if (op < 4) { deque.addLast(k); ad.addLast(k); } else if (op < 5 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 6 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 7) { assertEquals(ad.removeFirstOccurrence(k), deque.removeFirst(k) >= 0); } else if (op < 8) { assertEquals(ad.removeLastOccurrence(k), deque.removeLast(k) >= 0); } assertEquals(ad.size(), deque.size()); } assertArrayEquals(ad.toArray(), deque.toArray()); }
@Test public void testAgainstArrayDequeVariousTailHeadPositions() { this.deque.clear(); this.deque.head = this.deque.tail = 2; <DeepExtract> final Random rnd = new Random(randomLong()); final int rounds = 10000; final int modulo = 100; final ArrayDeque<KType> ad = new ArrayDeque<KType>(); for (int i = 0; i < rounds; i++) { KType k = cast(rnd.nextInt(modulo)); final int op = rnd.nextInt(8); if (op < 2) { deque.addFirst(k); ad.addFirst(k); } else if (op < 4) { deque.addLast(k); ad.addLast(k); } else if (op < 5 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 6 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 7) { assertEquals(ad.removeFirstOccurrence(k), deque.removeFirst(k) >= 0); } else if (op < 8) { assertEquals(ad.removeLastOccurrence(k), deque.removeLast(k) >= 0); } assertEquals(ad.size(), deque.size()); } assertArrayEquals(ad.toArray(), deque.toArray()); </DeepExtract> this.deque.clear(); this.deque.head = this.deque.tail = this.deque.buffer.length - 2; <DeepExtract> final Random rnd = new Random(randomLong()); final int rounds = 10000; final int modulo = 100; final ArrayDeque<KType> ad = new ArrayDeque<KType>(); for (int i = 0; i < rounds; i++) { KType k = cast(rnd.nextInt(modulo)); final int op = rnd.nextInt(8); if (op < 2) { deque.addFirst(k); ad.addFirst(k); } else if (op < 4) { deque.addLast(k); ad.addLast(k); } else if (op < 5 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 6 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 7) { assertEquals(ad.removeFirstOccurrence(k), deque.removeFirst(k) >= 0); } else if (op < 8) { assertEquals(ad.removeLastOccurrence(k), deque.removeLast(k) >= 0); } assertEquals(ad.size(), deque.size()); } assertArrayEquals(ad.toArray(), deque.toArray()); </DeepExtract> this.deque.clear(); this.deque.head = this.deque.tail = this.deque.buffer.length / 2; <DeepExtract> final Random rnd = new Random(randomLong()); final int rounds = 10000; final int modulo = 100; final ArrayDeque<KType> ad = new ArrayDeque<KType>(); for (int i = 0; i < rounds; i++) { KType k = cast(rnd.nextInt(modulo)); final int op = rnd.nextInt(8); if (op < 2) { deque.addFirst(k); ad.addFirst(k); } else if (op < 4) { deque.addLast(k); ad.addLast(k); } else if (op < 5 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 6 && ad.size() > 0) { deque.removeLast(); ad.removeLast(); } else if (op < 7) { assertEquals(ad.removeFirstOccurrence(k), deque.removeFirst(k) >= 0); } else if (op < 8) { assertEquals(ad.removeLastOccurrence(k), deque.removeLast(k) >= 0); } assertEquals(ad.size(), deque.size()); } assertArrayEquals(ad.toArray(), deque.toArray()); </DeepExtract> }
hppc
positive
3,823
private static void reqObject(String method, String url, Map<String, String> headers, HttpEntity entity, Context parent, ModelCallback<JSONObject> callback) { RequestAsyncTask<JSONObject> task = new RequestAsyncTask<JSONObject>(method, url, entity, false, false, parent, callback) { @Override protected JSONObject toJSON(String responseStr) throws JSONException { if (responseStr == null || responseStr.length() == 0 || responseStr.equals("OK")) { return new JSONObject(); } return new JSONObject(responseStr); } }; task.headers = headers; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { task.executeOnExecutor(HIGH_PRIORITY_EXECUTOR); } else { task.execute(); } }
private static void reqObject(String method, String url, Map<String, String> headers, HttpEntity entity, Context parent, ModelCallback<JSONObject> callback) { RequestAsyncTask<JSONObject> task = new RequestAsyncTask<JSONObject>(method, url, entity, false, false, parent, callback) { @Override protected JSONObject toJSON(String responseStr) throws JSONException { if (responseStr == null || responseStr.length() == 0 || responseStr.equals("OK")) { return new JSONObject(); } return new JSONObject(responseStr); } }; task.headers = headers; <DeepExtract> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { task.executeOnExecutor(HIGH_PRIORITY_EXECUTOR); } else { task.execute(); } </DeepExtract> }
buddycloud-android
positive
3,824
public static void handleError(Throwable t) { log(t.getMessage(), Log.ERROR, true); }
public static void handleError(Throwable t) { <DeepExtract> log(t.getMessage(), Log.ERROR, true); </DeepExtract> }
librus-client
positive
3,825
private void destroyBridgeButtonActionPerformed(java.awt.event.ActionEvent evt) { if (startFloor == Integer.MIN_VALUE) { return; } Map map = planner.getMapPanel().getMap(); Tile startTile = map.getTile(map.getTile(0, 0), startX, startY); if (startFloor >= 0 && startTile.getBridgePart() != null) { startTile.getBridgePart().destroy(); } else if (startFloor < 0 && startTile.getCaveBridgePart() != null) { startTile.getCaveBridgePart().destroy(); } updateTileLabels(); updateBridgeDeletion(); updateWarnings(); }
private void destroyBridgeButtonActionPerformed(java.awt.event.ActionEvent evt) { if (startFloor == Integer.MIN_VALUE) { return; } Map map = planner.getMapPanel().getMap(); Tile startTile = map.getTile(map.getTile(0, 0), startX, startY); if (startFloor >= 0 && startTile.getBridgePart() != null) { startTile.getBridgePart().destroy(); } else if (startFloor < 0 && startTile.getCaveBridgePart() != null) { startTile.getCaveBridgePart().destroy(); } <DeepExtract> updateTileLabels(); updateBridgeDeletion(); updateWarnings(); </DeepExtract> }
DeedPlanner-2
positive
3,826
private void addPersonAttributes(Patient pt, Element root, XformsService xformsService, User creator) throws Exception { List<String> names = DOMUtil.getModelComplexObsNodeNames(root.getOwnerDocument().getDocumentElement().getAttribute("id")); for (String name : names) saveComplexObsValue(DOMUtil.getElement(root.getOwnerDocument(), name), false); List<PersonAttributeType> personAttributeTypes = Context.getPersonService().getPersonAttributeTypes(PERSON_TYPE.PERSON, null); for (PersonAttributeType type : personAttributeTypes) { NodeList nodes = root.getElementsByTagName("person_attribute" + type.getPersonAttributeTypeId()); if (nodes == null || nodes.getLength() == 0) continue; String value = ((Element) nodes.item(0)).getTextContent(); if (value == null || value.length() == 0) continue; PersonAttribute pa = new PersonAttribute(type, value); pa.setCreator(creator); pa.setDateCreated(pt.getDateCreated()); pt.addAttribute(pa); } }
private void addPersonAttributes(Patient pt, Element root, XformsService xformsService, User creator) throws Exception { <DeepExtract> List<String> names = DOMUtil.getModelComplexObsNodeNames(root.getOwnerDocument().getDocumentElement().getAttribute("id")); for (String name : names) saveComplexObsValue(DOMUtil.getElement(root.getOwnerDocument(), name), false); </DeepExtract> List<PersonAttributeType> personAttributeTypes = Context.getPersonService().getPersonAttributeTypes(PERSON_TYPE.PERSON, null); for (PersonAttributeType type : personAttributeTypes) { NodeList nodes = root.getElementsByTagName("person_attribute" + type.getPersonAttributeTypeId()); if (nodes == null || nodes.getLength() == 0) continue; String value = ((Element) nodes.item(0)).getTextContent(); if (value == null || value.length() == 0) continue; PersonAttribute pa = new PersonAttribute(type, value); pa.setCreator(creator); pa.setDateCreated(pt.getDateCreated()); pt.addAttribute(pa); } }
buendia
positive
3,827
public void dilate(final double da, final double db, final double dc) { if (this.ra + da <= 0 || this.rb + db <= 0 || this.rc + dc <= 0) { throw new IllegalArgumentException("Ellipsoid cannot have semiaxis <= 0"); } this.ra = this.ra + da; this.rb = this.rb + db; this.rc = this.rc + dc; setEigenvalues(); }
public void dilate(final double da, final double db, final double dc) { <DeepExtract> if (this.ra + da <= 0 || this.rb + db <= 0 || this.rc + dc <= 0) { throw new IllegalArgumentException("Ellipsoid cannot have semiaxis <= 0"); } this.ra = this.ra + da; this.rb = this.rb + db; this.rc = this.rc + dc; setEigenvalues(); </DeepExtract> }
BoneJ
positive
3,828
@Override public List<Function> findAllFunction() { return groupDao.findAll(); }
@Override public List<Function> findAllFunction() { <DeepExtract> return groupDao.findAll(); </DeepExtract> }
logistics-back
positive
3,829
@Override public void setImageDrawable(Drawable drawable) { super.setImageDrawable(drawable); if (isZoomEnabled) { super.setScaleType(ScaleType.MATRIX); updateBaseMatrix(getDrawable()); } else { resetMatrix(); } }
@Override public void setImageDrawable(Drawable drawable) { super.setImageDrawable(drawable); <DeepExtract> if (isZoomEnabled) { super.setScaleType(ScaleType.MATRIX); updateBaseMatrix(getDrawable()); } else { resetMatrix(); } </DeepExtract> }
ZUILib
positive
3,830
public static synchronized boolean appendFile(String filePath, String fileName, String content) { try { File fileDir = new File(filePath); if (!fileDir.exists()) { fileDir.mkdirs(); } String filePath = filePath + File.separator + fileName; File file = new File(filePath); if (!file.exists()) { try { file.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } try { FileWriter writer = new FileWriter(filePath + File.separator + fileName, true); writer.write(content); writer.write(System.getProperty("line.separator")); writer.close(); } catch (IOException e) { e.printStackTrace(); } return true; }
public static synchronized boolean appendFile(String filePath, String fileName, String content) { <DeepExtract> try { File fileDir = new File(filePath); if (!fileDir.exists()) { fileDir.mkdirs(); } String filePath = filePath + File.separator + fileName; File file = new File(filePath); if (!file.exists()) { try { file.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } </DeepExtract> try { FileWriter writer = new FileWriter(filePath + File.separator + fileName, true); writer.write(content); writer.write(System.getProperty("line.separator")); writer.close(); } catch (IOException e) { e.printStackTrace(); } return true; }
FanucCNCInfo
positive
3,831
@Test public void container_tags_continue_to_support_original_model_rendering_methods() throws IOException { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(String.valueOf(null)); assertThat(stringBuilder.toString(), is("<div><div></div></div>")); }
@Test public void container_tags_continue_to_support_original_model_rendering_methods() throws IOException { StringBuilder stringBuilder = new StringBuilder(); <DeepExtract> stringBuilder.append(String.valueOf(null)); </DeepExtract> assertThat(stringBuilder.toString(), is("<div><div></div></div>")); }
j2html
positive
3,833
@Override public float floatValue() { return toLong(value); }
@Override public float floatValue() { <DeepExtract> return toLong(value); </DeepExtract> }
pancake-smarts
positive
3,834
private void resetFifo() { mCount = 0; mBufferIn = 0; mBufferOut = 0; mTimestamps = new long[mBufferCount]; mBufferRequested = new Semaphore(mBufferCount); mBufferCommitted = new Semaphore(0); mSum = new long[mSize]; mElapsed = new long[mSize]; mNow = SystemClock.elapsedRealtime(); mOldNow = mNow; mCount = 0; mDelta = 0; mTotal = 0; mIndex = 0; mSum = new long[mSize]; mElapsed = new long[mSize]; mNow = SystemClock.elapsedRealtime(); mOldNow = mNow; mCount = 0; mDelta = 0; mTotal = 0; mIndex = 0; }
private void resetFifo() { mCount = 0; mBufferIn = 0; mBufferOut = 0; mTimestamps = new long[mBufferCount]; mBufferRequested = new Semaphore(mBufferCount); mBufferCommitted = new Semaphore(0); <DeepExtract> mSum = new long[mSize]; mElapsed = new long[mSize]; mNow = SystemClock.elapsedRealtime(); mOldNow = mNow; mCount = 0; mDelta = 0; mTotal = 0; mIndex = 0; </DeepExtract> mSum = new long[mSize]; mElapsed = new long[mSize]; mNow = SystemClock.elapsedRealtime(); mOldNow = mNow; mCount = 0; mDelta = 0; mTotal = 0; mIndex = 0; }
RtspServerAndVlcPlay
positive
3,835
private static boolean tupletype_2_0_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "tupletype_2_0_1")) return false; Marker m = enter_section_(b); if (!recursion_guard_(b, l + 1, "infixtype")) r = false; boolean r; Marker m = enter_section_(b, l + 1, _NONE_, "<infixtype>"); r = type(b, l + 1 + 1); r = r && infixtype_1(b, l + 1 + 1); exit_section_(b, l + 1, m, INFIXTYPE, r, false, null); return r; if (!r) r = consumeToken(b, "_"); exit_section_(b, m, null, r); return r; }
private static boolean tupletype_2_0_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "tupletype_2_0_1")) return false; Marker m = enter_section_(b); <DeepExtract> if (!recursion_guard_(b, l + 1, "infixtype")) r = false; boolean r; Marker m = enter_section_(b, l + 1, _NONE_, "<infixtype>"); r = type(b, l + 1 + 1); r = r && infixtype_1(b, l + 1 + 1); exit_section_(b, l + 1, m, INFIXTYPE, r, false, null); return r; </DeepExtract> if (!r) r = consumeToken(b, "_"); exit_section_(b, m, null, r); return r; }
intellij-pony
positive
3,836
public void keyPressed(java.awt.event.KeyEvent evt) { if (evt.getKeyCode() == evt.VK_ENTER) { refreshStack(); } }
public void keyPressed(java.awt.event.KeyEvent evt) { <DeepExtract> if (evt.getKeyCode() == evt.VK_ENTER) { refreshStack(); } </DeepExtract> }
8085
positive
3,837
@Override public int compare(Problem_Index rhs, Problem_Index lhs) { int l; switch(lhs.getLevel()) { case "Easy": l = 0; case "Medium": l = 1; case "Hard": l = 2; default: l = 0; } int r; switch(rhs.getLevel()) { case "Easy": r = 0; case "Medium": r = 1; case "Hard": r = 2; default: r = 0; } if (l < r) return -1; else if (l > r) return 1; else return 0; }
@Override public int compare(Problem_Index rhs, Problem_Index lhs) { int l; switch(lhs.getLevel()) { case "Easy": l = 0; case "Medium": l = 1; case "Hard": l = 2; default: l = 0; } <DeepExtract> int r; switch(rhs.getLevel()) { case "Easy": r = 0; case "Medium": r = 1; case "Hard": r = 2; default: r = 0; } </DeepExtract> if (l < r) return -1; else if (l > r) return 1; else return 0; }
LeeCo
positive
3,838