bug_id stringlengths 22 44 | func_before stringlengths 101 9.03k | func_after stringlengths 161 12.3k |
|---|---|---|
aws-aws-secretsmanager-jdbc-d25e52d637cf | @Override
public String constructUrlFromEndpointPortDatabase(String endpoint, String port, String dbname) {
String url = "jdbc:postgresql://" + endpoint;
if (!StringUtils.isNullOrEmpty(port)) {
url += ":" + port;
}
if (!StringUtils.isNullOrEmpty(dbname)) {
... | @Override
public String constructUrlFromEndpointPortDatabase(String endpoint, String port, String dbname) {
String url = "jdbc:postgresql://" + endpoint;
if (!StringUtils.isNullOrEmpty(port)) {
url += ":" + port;
}
url += "/";
if (!StringUtils.isNullOrEmpty(db... |
jitterted-ensembler-14a39138787f | public void acceptedBy(MemberId memberId) {
requireNotCompleted();
requireNotCanceled();
requireHasSpace();
membersWhoAccepted.add(memberId);
membersWhoDeclined.remove(memberId);
}
| public void acceptedBy(MemberId memberId) {
requireNotCompleted();
requireNotCanceled();
requireHasSpace();
membersWhoAccepted.add(memberId);
membersWhoDeclined.remove(memberId);
membersAsSpectators.remove(memberId);
}
|
dmak-jaxb-xew-plugin-f48935133d6a | private void moveClassLevelUp(Outline outline, JDefinedClass clazz) {
JDefinedClass parent = (JDefinedClass) clazz.parentContainer();
JClassContainer grandParent = parent.parentContainer();
Map<String, JDefinedClass> classes;
if (grandParent.isClass()) {
JDefinedClass grandParentClass = (JDefinedClass) gran... | private void moveClassLevelUp(Outline outline, JDefinedClass clazz) {
JDefinedClass parent = (JDefinedClass) clazz.parentContainer();
JClassContainer grandParent = parent.parentContainer();
Map<String, JDefinedClass> classes;
if (grandParent.isClass()) {
JDefinedClass grandParentClass = (JDefinedClass) gran... |
jhy-jsoup-5f20fcc2f728 | public Safelist addTags(String... tags) {
Validate.notNull(tags);
for (String tagName : tags) {
Validate.notEmpty(tagName);
tagNames.add(TagName.valueOf(tagName));
}
return this;
}
| public Safelist addTags(String... tags) {
Validate.notNull(tags);
for (String tagName : tags) {
Validate.notEmpty(tagName);
Validate.isFalse(tagName.equalsIgnoreCase("noscript"),
"noscript is unsupported in Safelists, due to incompatibilities between parsers w... |
crowdin-crowdin-api-client-java-f0f22b2b56d7 | public JacksonJsonTransformer() {
ObjectMapper cleanObjectMapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
SimpleModule enumModule = new SimpleModule()
.addDeserializer(Enum.class, new EnumDeserializer());
SimpleModule ... | public JacksonJsonTransformer() {
ObjectMapper cleanObjectMapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
SimpleModule enumModule = new SimpleModule()
.addDeserializer(Enum.class, new EnumDeserializer());
SimpleModule ... |
stellar-java-stellar-sdk-1461c2fc5b89 | public boolean isSorobanTransaction() {
if (mOperations.length != 1) {
return false;
}
Operation op = mOperations[0];
return op instanceof InvokeHostFunctionOperation
|| op instanceof BumpSequenceOperation
|| op instanceof RestoreFootprintOperation;
}
| public boolean isSorobanTransaction() {
if (mOperations.length != 1) {
return false;
}
Operation op = mOperations[0];
return op instanceof InvokeHostFunctionOperation
|| op instanceof BumpFootprintExpirationOperation
|| op instanceof RestoreFootprintOperation;
}
|
traccar-traccar-65f54c200cf0 | private void decodeLocation(Position position, ByteBuf buf, int codec, String model) {
int globalMask = 0x0f;
if (codec == CODEC_GH3000) {
long time = buf.readUnsignedInt() & 0x3fffffff;
time += 1167609600;
globalMask = buf.readUnsignedByte();
if (Bit... | private void decodeLocation(Position position, ByteBuf buf, int codec, String model) {
int globalMask = 0x0f;
if (codec == CODEC_GH3000) {
long time = buf.readUnsignedInt() & 0x3fffffff;
time += 1167609600;
globalMask = buf.readUnsignedByte();
if (Bit... |
mthmulders-mcs-eff905bef8d8 | private void printRow(final Help.TextTable table, final SearchResponse.Response.Doc doc) {
var lastUpdated = DATE_TIME_FORMATTER.format(
Instant.ofEpochMilli(doc.timestamp()).atZone(ZoneId.systemDefault())
);
table.addRowValues(doc.id(), lastUpdated);
}
| private void printRow(final Help.TextTable table, final SearchResponse.Response.Doc doc) {
var lastUpdated = DATE_TIME_FORMATTER.format(
Instant.ofEpochMilli(doc.timestamp()).atZone(ZoneId.systemDefault())
);
table.addRowValues(doc.id() + ":" + doc.latestVersion(), lastUpdate... |
traccar-traccar-fdbd269b9b99 | private Object decodePosition(
Channel channel, SocketAddress remoteAddress, String sentence, String id) {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, id);
if (deviceSession == null) {
return null;
}
List<Position> positions = new Li... | private Object decodePosition(
Channel channel, SocketAddress remoteAddress, String sentence, String id) {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, id);
if (deviceSession == null) {
return null;
}
List<Position> positions = new Li... |
traccar-traccar-8b4d3ee0b964 | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
String sentence = (String) msg;
if (sentence.startsWith("!1,")) {
int index = sentence.indexOf(',', 3);
if (index < 0) {
index = sen... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
String sentence = (String) msg;
if (sentence.startsWith("!1,")) {
int index = sentence.indexOf(',', 3);
if (index < 0) {
index = sen... |
traccar-traccar-e73f36db83b9 | private Object decodeEri(Channel channel, SocketAddress remoteAddress, String sentence) {
Parser parser = new Parser(PATTERN_ERI, sentence);
if (!parser.matches()) {
return null;
}
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
... | private Object decodeEri(Channel channel, SocketAddress remoteAddress, String sentence) {
Parser parser = new Parser(PATTERN_ERI, sentence);
if (!parser.matches()) {
return null;
}
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
... |
AuthMe-ConfigMe-aa91a6b315ec | public void setComment(@NotNull String path, @NotNull String... commentLines) {
comments.put(path, Collections.unmodifiableList(Arrays.asList(commentLines)));
}
| public void setComment(@NotNull String path, @NotNull String... commentLines) {
List<String> replaced = comments.put(path, Collections.unmodifiableList(Arrays.asList(commentLines)));
if (replaced != null) {
throw new IllegalStateException("Comment lines already exists for the path '" + p... |
traccar-traccar-8de9a36abef8 | private void decodeFragment(Position position, String fragment) {
int dataIndex = fragment.indexOf(':');
int index = 0;
String[] values;
if (fragment.length() == dataIndex + 1) {
values = new String[0];
} else {
values = fragment.substring(dataIndex + ... | private void decodeFragment(Position position, String fragment) {
int dataIndex = fragment.indexOf(':');
int index = 0;
String[] values;
if (fragment.length() == dataIndex + 1) {
values = new String[0];
} else {
values = fragment.substring(dataIndex + ... |
traccar-traccar-392f00082faf | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... |
cloudsimplus-cloudsimplus-61c8b942d1ec | public HostAbstract(final List<Pe> peList, final boolean activate) {
this(defaultBwCapacity, defaultStorageCapacity, new HarddriveStorage(defaultRamCapacity), peList, activate);
}
| public HostAbstract(final List<Pe> peList, final boolean activate) {
this(defaultRamCapacity, defaultBwCapacity, new HarddriveStorage(defaultStorageCapacity), peList, activate);
}
|
traccar-traccar-3771dd156efb | private Position decodePosition(DeviceSession deviceSession, String data) {
Parser parser = new Parser(PATTERN_POSITION, data);
if (!parser.matches()) {
return null;
}
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDevic... | private Position decodePosition(DeviceSession deviceSession, String data) {
Parser parser = new Parser(PATTERN_POSITION, data);
if (!parser.matches()) {
return null;
}
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDevic... |
traccar-traccar-dfc546a26f5b | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... |
traccar-traccar-3331593759a2 | private Position decodeTransparent(DeviceSession deviceSession, ByteBuf buf) {
int type = buf.readUnsignedByte();
if (type == 0xF0) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Date time = readDate(buf, ... | private Position decodeTransparent(DeviceSession deviceSession, ByteBuf buf) {
int type = buf.readUnsignedByte();
if (type == 0xF0) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Date time = readDate(buf, ... |
semver4j-semver4j-10102b374298 | @Override
public String toString() {
return rangesList.stream()
.map(RangesList::formatRanges)
.collect(joining(OR_JOINER));
}
| @Override
public String toString() {
return rangesList.stream()
.map(RangesList::formatRanges)
.collect(joining(OR_JOINER))
.replaceAll("^\\(([^()]+)\\)$", "$1");
}
|
nikoo28-java-solutions-8d81307ea165 | public int[] calculateSpans(int[] prices) {
int[] spans = new int[prices.length];
spans[0] = 1;
Stack<Integer> indexStack = new Stack<>();
indexStack.push(0);
for (int i = 1; i < prices.length; i++) {
while (!indexStack.isEmpty()
&& prices[indexStack.peek()] <= prices[i])
... | public int[] calculateSpans(int[] prices) {
int[] spans = new int[prices.length];
spans[0] = 1;
Stack<Integer> indexStack = new Stack<>();
indexStack.push(0);
for (int i = 1; i < prices.length; i++) {
while (!indexStack.isEmpty()
&& prices[indexStack.peek()] < prices[i])
i... |
traccar-traccar-5a1a8d9192ee | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
buf.readUnsignedShort();
buf.readUnsignedByte();
buf.readUnsignedShort();
buf.readU... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
buf.readUnsignedShort();
buf.readUnsignedByte();
buf.readUnsignedShort();
buf.readU... |
jitterted-ensembler-0963194c9ebc | public static ParticipantAction from(MemberStatus memberStatus, boolean disabled) {
return switch (memberStatus) {
case UNKNOWN, DECLINED -> new ParticipantAction(
"/member/accept",
"Participate in Rotation ⌨",
disabled);
... | public static ParticipantAction from(MemberStatus memberStatus, boolean disabled) {
return switch (memberStatus) {
case UNKNOWN, DECLINED -> new ParticipantAction(
"/member/accept",
"Participate in Rotation ⌨",
disabled);
... |
jitterted-ensembler-0e512e5b3677 | public static EnsembleSummaryView toView(Ensemble ensemble, MemberId memberId, MemberService memberService) {
List<MemberView> participantViews = transform(memberService, ensemble.acceptedMembers());
return new EnsembleSummaryView(ensemble.getId().id(),
ensembl... | public static EnsembleSummaryView toView(Ensemble ensemble, MemberId memberId, MemberService memberService) {
List<MemberView> participantViews = transform(memberService, ensemble.acceptedMembers());
List<MemberView> spectatorViews = transform(memberService, ensemble.spectators());
return ne... |
jitterted-ensembler-60ec3bf0273b | public void joinAsSpectator(MemberId memberId) {
membersAsSpectators.add(memberId);
membersWhoAccepted.remove(memberId);
}
| public void joinAsSpectator(MemberId memberId) {
membersAsSpectators.add(memberId);
membersWhoAccepted.remove(memberId);
membersWhoDeclined.remove(memberId);
}
|
traccar-traccar-ee3cbd4aba2e | private Position decodeLocation2(DeviceSession deviceSession, ByteBuf buf, int type) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Jt600ProtocolDecoder.decodeBinaryLocation(buf, position);
position.setValid(type != MSG_LOCAT... | private Position decodeLocation2(DeviceSession deviceSession, ByteBuf buf, int type) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Jt600ProtocolDecoder.decodeBinaryLocation(buf, position);
position.setValid(type != MSG_LOCAT... |
fishercoder1534-Leetcode-2110c6b023b7 | public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
if (root == null || p == root || q == root) {
return root;
}
if ((root.val - p.val) * (root.val - q.val) > 0) {
if (root.val - p.val > 0) {
return... | public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
if (root == null || p == root || q == root) {
return root;
}
if (root.val > p.val && root.val > q.val) {
return lowestCommonAncestor(root.left, p, q);
} e... |
jhy-jsoup-8e2b86839b27 | private boolean isFormatAsBlock(Document.OutputSettings out) {
return tag.formatAsBlock() || (parent() != null && parent().tag().formatAsBlock()) || out.outline();
}
| private boolean isFormatAsBlock(Document.OutputSettings out) {
return tag.isBlock() || (parent() != null && parent().tag().formatAsBlock()) || out.outline();
}
|
traccar-traccar-cadcd2676adb | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.skipBytes(2);
int type = buf.readUnsignedByte();
buf.readUnsignedShort();
if (type == MSG_LOGIN || type == MSG_AD... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.skipBytes(2);
int type = buf.readUnsignedByte();
buf.readUnsignedShort();
if (type == MSG_LOGIN || type == MSG_AD... |
traccar-traccar-1a1126d2d392 | private Position decode4(
Channel channel, SocketAddress remoteAddress, String[] values) throws ParseException {
int index = 0;
String type = values[index++].substring(5);
if (!type.equals("STT") && !type.equals("ALT")) {
return null;
}
DeviceSession d... | private Position decode4(
Channel channel, SocketAddress remoteAddress, String[] values) throws ParseException {
int index = 0;
String type = values[index++].substring(5);
if (!type.equals("STT") && !type.equals("ALT")) {
return null;
}
DeviceSession d... |
jhy-jsoup-a349582236a7 | private boolean isInlineable(Document.OutputSettings out) {
return tag().isInline()
&& (parent() == null || parent().isBlock())
&& previousSibling() != null
&& !out.outline();
}
| private boolean isInlineable(Document.OutputSettings out) {
if (!tag.isInline())
return false;
final Node prev = previousSibling();
boolean isFirst = siblingIndex == 0;
if (siblingIndex == 1 && prev instanceof TextNode && (((TextNode) prev).isBlank()))
isFirst... |
jhy-jsoup-2a4a9cf83dea | @Override
public boolean matches(Element root, Element element) {
for (int i = evaluators.size() -1; i >= 0; --i) {
if (element == null)
return false;
Evaluator eval = evaluators.get(i);
if (!eval.matches(root, element))
... | @Override
public boolean matches(Element root, Element element) {
if (element == root)
return false;
for (int i = evaluators.size() -1; i >= 0; --i) {
if (element == null)
return false;
Evaluator eval = evaluato... |
traccar-traccar-d797671b2ce6 | private Position decodeTransparent(DeviceSession deviceSession, ByteBuf buf) {
int type = buf.readUnsignedByte();
if (type == 0xF0) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Date time = readDate(buf, ... | private Position decodeTransparent(DeviceSession deviceSession, ByteBuf buf) {
int type = buf.readUnsignedByte();
if (type == 0xF0) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Date time = readDate(buf, ... |
traccar-traccar-779486a30483 | protected Object decodeAvrmc(
String sentence, Channel channel, SocketAddress remoteAddress) {
Parser parser = new Parser(PATTERN_AVRMC, sentence);
if (!parser.matches()) {
return null;
}
DeviceSession deviceSession =
getDeviceSession(channel, remo... | protected Object decodeAvrmc(
String sentence, Channel channel, SocketAddress remoteAddress) {
Parser parser = new Parser(PATTERN_AVRMC, sentence);
if (!parser.matches()) {
return null;
}
DeviceSession deviceSession =
getDeviceSession(channel, remo... |
traccar-traccar-4ece72558c80 | private List<Position> parseData(
Channel channel, SocketAddress remoteAddress, ByteBuf buf, int locationPacketId, String... imei) {
List<Position> positions = new LinkedList<>();
if (!connectionless) {
buf.readUnsignedInt();
}
int codec = buf.readUnsignedByt... | private List<Position> parseData(
Channel channel, SocketAddress remoteAddress, ByteBuf buf, int locationPacketId, String... imei) {
List<Position> positions = new LinkedList<>();
if (!connectionless) {
buf.readUnsignedInt();
}
int codec = buf.readUnsignedByt... |
jhy-jsoup-6ccd158754e2 | private static void appendToAscii(String s, boolean spaceAsPlus, StringBuilder sb) throws UnsupportedEncodingException {
for (int i = 0; i < s.length(); i++) {
int c = s.codePointAt(i);
if (c == ' ') {
sb.append(spaceAsPlus ? '+' : "%20");
} else if (c > 1... | private static void appendToAscii(String s, boolean spaceAsPlus, StringBuilder sb) throws UnsupportedEncodingException {
for (int i = 0; i < s.length(); i++) {
int c = s.codePointAt(i);
if (c == ' ') {
sb.append(spaceAsPlus ? '+' : "%20");
} else if (c > 1... |
snowflakedb-snowflake-jdbc-f2c8eba73535 | static boolean isNonRetryableHTTPCode(CloseableHttpResponse response, boolean retryHTTP403) {
return response != null
&& (response.getStatusLine().getStatusCode() < 500
||
response.getStatusLine().getStatusCode() >= 600)
&&
response.getStatusLine().getStatusCode()... | static boolean isNonRetryableHTTPCode(CloseableHttpResponse response, boolean retryHTTP403) {
return response != null
&& (response.getStatusLine().getStatusCode() < 500
||
response.getStatusLine().getStatusCode() >= 600)
&&
response.getStatusLine().getStatusCode()... |
traccar-traccar-4a5b8d79b560 | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
String sentence = (String) msg;
sentence = sentence.substring(sentence.indexOf('|') + 1, sentence.lastIndexOf('|'));
Position position = new Position();
pos... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
String sentence = (String) msg;
sentence = sentence.substring(sentence.indexOf('|') + 1, sentence.lastIndexOf('|'));
Position position = new Position();
pos... |
traccar-traccar-6631d7c4b352 | @Override
protected Object decode(
ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception {
int endIndex = -1;
for (int i = buf.writerIndex() - 1; i >= buf.readerIndex(); i--) {
if (buf.getByte(i) == ']') {
endIndex = i + 1;
... | @Override
protected Object decode(
ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception {
int brackets = 0;
int endIndex = -1;
for (int i = buf.readerIndex(); i < buf.writerIndex(); i++) {
byte b = buf.getByte(i);
switch (b) {
... |
jhy-jsoup-9e5869b6e1e2 | void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException {
final boolean prettyPrint = out.prettyPrint();
final Element parent = parentNode instanceof Element ? ((Element) parentNode) : null;
final boolean normaliseWhite = prettyPrint && !Element.preser... | void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException {
final boolean prettyPrint = out.prettyPrint();
final Element parent = parentNode instanceof Element ? ((Element) parentNode) : null;
final boolean normaliseWhite = prettyPrint && !Element.preser... |
stellar-java-stellar-sdk-15cc6d2c8131 | @Override
public boolean equals(Object object) {
if (!(object instanceof KeyPair)) {
return false;
}
KeyPair other = (KeyPair) object;
return this.mPrivateKey.equals(other.mPrivateKey) &&
this.mPublicKey.equals(other.mPublicKey);
}
| @Override
public boolean equals(Object object) {
if (!(object instanceof KeyPair)) {
return false;
}
KeyPair other = (KeyPair) object;
return Objects.equal(this.mPrivateKey, other.mPrivateKey) &&
this.mPublicKey.equals(other.mPublicKey);
}
|
jhy-jsoup-9bb07d2ab43c | protected void replaceChild(Node out, Node in) {
Validate.isTrue(out.parentNode == this);
Validate.notNull(in);
if (in.parentNode != null)
in.parentNode.removeChild(in);
final int index = out.siblingIndex;
ensureChildNodes().set(index, in);
in.parentNode =... | protected void replaceChild(Node out, Node in) {
Validate.isTrue(out.parentNode == this);
Validate.notNull(in);
if (out == in) return;
if (in.parentNode != null)
in.parentNode.removeChild(in);
final int index = out.siblingIndex;
ensureChildNodes().set(ind... |
jhy-jsoup-29be991198d3 | void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException {
final boolean prettyPrint = out.prettyPrint();
final Element parent = parentNode instanceof Element ? ((Element) parentNode) : null;
final boolean normaliseWhite = prettyPrint && !Element.preser... | void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException {
final boolean prettyPrint = out.prettyPrint();
final Element parent = parentNode instanceof Element ? ((Element) parentNode) : null;
final boolean normaliseWhite = prettyPrint && !Element.preser... |
LMAX-Exchange-Simple-DSL-81182e58bd80 | void consume(final RepeatingArgGroup groupArg, final Deque<NameValuePair> arguments)
{
final Map<DslArg, List<String>> valuesByArg = new HashMap<>();
final SimpleArgumentProcessor processor = new SimpleArgumentProcessor(valuesByArg, "Did not supply a value for %s in group " + gro... | void consume(final RepeatingArgGroup groupArg, final Deque<NameValuePair> arguments)
{
final Map<DslArg, List<String>> valuesByArg = new HashMap<>();
final SimpleArgumentProcessor processor = new SimpleArgumentProcessor(valuesByArg, "Did not supply a value for %s in group " + gro... |
jhy-jsoup-111919256590 | private boolean isInlineable(Document.OutputSettings out) {
if (!tag.isInline())
return false;
return (parent() == null || parent().isBlock())
&& !isEffectivelyFirst()
&& !out.outline();
}
| private boolean isInlineable(Document.OutputSettings out) {
if (!tag.isInline())
return false;
return (parent() == null || parent().isBlock())
&& !isEffectivelyFirst()
&& !out.outline()
&& !isNode("br");
}
|
traccar-traccar-d244b4bc4999 | public String getString(String key, String defaultValue) {
if (attributes.containsKey(key)) {
Object value = attributes.containsKey(key);
return value != null ? value.toString() : null;
} else {
return defaultValue;
}
}
| public String getString(String key, String defaultValue) {
if (attributes.containsKey(key)) {
Object value = attributes.get(key);
return value != null ? value.toString() : null;
} else {
return defaultValue;
}
}
|
traccar-traccar-4722f9b6b648 | private Position decodeIridiumPosition(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
buf.readUnsignedShortLE();
buf.skipBytes(3);
buf.readUnsignedIntLE();
DeviceSession deviceSession = getDeviceSession(
channel, remoteAddress, buf.readSlice(15).toStr... | private Position decodeIridiumPosition(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
buf.readUnsignedShort();
buf.skipBytes(3);
buf.readUnsignedInt();
DeviceSession deviceSession = getDeviceSession(
channel, remoteAddress, buf.readSlice(15).toString(... |
jhy-jsoup-d126488db626 | private String consumeSubQuery() {
StringBuilder sq = StringUtil.borrowBuilder();
while (!tq.isEmpty()) {
if (tq.matches("("))
sq.append("(").append(tq.chompBalanced('(', ')')).append(")");
else if (tq.matches("["))
sq.append("[").append(tq.cho... | private String consumeSubQuery() {
StringBuilder sq = StringUtil.borrowBuilder();
boolean seenNonCombinator = false;
while (!tq.isEmpty()) {
if (tq.matches("("))
sq.append("(").append(tq.chompBalanced('(', ')')).append(")");
else if (tq.matches("["))
... |
traccar-traccar-6f59f756a7d3 | private Position decodePosition(
Channel channel, DeviceSession deviceSession, ByteBuf buf, int type, int index, ByteBuf imei) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
position.set(Position.KEY_INDEX, index);
... | private Position decodePosition(
Channel channel, DeviceSession deviceSession, ByteBuf buf, int type, int index, ByteBuf imei) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
position.set(Position.KEY_INDEX, index);
... |
traccar-traccar-105873ab5256 | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
int flags = buf.readUnsignedByte();
buf.readUnsignedShortLE();
buf.readUnsignedShortLE();
... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
int flags = buf.readUnsignedByte();
buf.readUnsignedShortLE();
buf.readUnsignedShortLE();
... |
traccar-traccar-1b8993293646 | private Object decodeLocationNew(
Channel channel, SocketAddress remoteAddress, String sentence) {
Parser parser = new Parser(PATTERN_NEW, sentence);
if (!parser.matches()) {
return null;
}
String imei = parser.next();
DeviceSession deviceSession = get... | private Object decodeLocationNew(
Channel channel, SocketAddress remoteAddress, String sentence) {
Parser parser = new Parser(PATTERN_NEW, sentence);
if (!parser.matches()) {
return null;
}
String imei = parser.next();
DeviceSession deviceSession = get... |
revelc-formatter-maven-plugin-3e9843d2ab99 | @Override
protected String doFormat(final String code, final LineEnding ending) throws IOException {
final var source = new InputSource(new StringReader(code));
final var parser = new CSSOMParser(new SACParserCSS3());
final var sheet = (CSSStyleSheetImpl) parser.parseStyleSheet(source, n... | @Override
protected String doFormat(final String code, final LineEnding ending) throws IOException {
final var source = new InputSource(new StringReader(code));
final var parser = new CSSOMParser(new SACParserCSS3());
final var sheet = (CSSStyleSheetImpl) parser.parseStyleSheet(source, n... |
traccar-traccar-3b6900a95342 | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
int flags = buf.readUnsignedByte();
buf.readUnsignedShortLE();
buf.readUnsignedShortLE();
... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
int flags = buf.readUnsignedByte();
buf.readUnsignedShortLE();
buf.readUnsignedShortLE();
... |
retel-io-ari-proxy-610e9b6725e1 | public static Try<Done> registerCallContext(
final ActorRef<CallContextProviderMessage> callContextProvider,
final String callContext,
final AriCommand ariCommand) {
if (!ariCommand.extractCommandType().isCreationCommand()) {
return Try.success(Done.done());
}
final Option<AriResou... | public static Try<Done> registerCallContext(
final ActorRef<CallContextProviderMessage> callContextProvider,
final String callContext,
final AriCommand ariCommand) {
if (!(ariCommand.extractCommandType().isCreationCommand()
&& "POST".equals(ariCommand.getMethod()))) {
return Try.su... |
spring-projects-spring-retry-e6091f790c64 | public BackOffPolicy build() {
if (this.multiplier != null && this.multiplier > 0 || this.multiplierSupplier != null) {
ExponentialBackOffPolicy policy;
if (Boolean.TRUE.equals(this.random)) {
policy = new ExponentialRandomBackOffPolicy();
}
else {
policy = new ExponentialBackOffPolicy();
}
... | public BackOffPolicy build() {
if (this.multiplier != null && this.multiplier > 0 || this.multiplierSupplier != null) {
ExponentialBackOffPolicy policy;
if (Boolean.TRUE.equals(this.random)) {
policy = new ExponentialRandomBackOffPolicy();
}
else {
policy = new ExponentialBackOffPolicy();
}
... |
jhy-jsoup-1e69577e358c | URL build() {
try {
URI uri = new URI(
u.getProtocol(),
u.getUserInfo(),
IDN.toASCII(decodePart(u.getHost())),
u.getPort(),
decodePart(u.getPath()),
null, null
);
String norm... | URL build() {
try {
URI uri = new URI(
u.getProtocol(),
u.getUserInfo(),
IDN.toASCII(decodePart(u.getHost())),
u.getPort(),
null, null, null
);
StringBuilder normUrl = StringUtil.borrowBuild... |
traccar-traccar-b77131f4be38 | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.skipBytes(1);
manufacturer = buf.readSlice(2).toString(StandardCharsets.US_ASCII);
buf.skipBytes(1);
int idIndex ... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.skipBytes(1);
manufacturer = buf.readSlice(2).toString(StandardCharsets.US_ASCII);
buf.skipBytes(1);
int idIndex ... |
traccar-traccar-6e5481ebb185 | private boolean decodeLbs(Position position, ByteBuf buf, int type, boolean hasLength) {
int length = 0;
if (hasLength) {
length = buf.readUnsignedByte();
if (length == 0) {
boolean zeroedData = true;
for (int i = buf.readerIndex() + 9; i < buf... | private boolean decodeLbs(Position position, ByteBuf buf, int type, boolean hasLength) {
int length = 0;
if (hasLength) {
length = buf.readUnsignedByte();
if (length == 0) {
boolean zeroedData = true;
for (int i = buf.readerIndex() + 9; i < buf... |
traccar-traccar-413d9a49c41a | private Position decodePosition(
Channel channel, SocketAddress remoteAddress, ByteBuf buf, int index) {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);
if (deviceSession == null) {
return null;
}
Position position = new Position(getPro... | private Position decodePosition(
Channel channel, SocketAddress remoteAddress, ByteBuf buf, int index) {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);
if (deviceSession == null) {
return null;
}
Position position = new Position(getPro... |
traccar-traccar-2749e520c9ea | private Position decodeLocation2(DeviceSession deviceSession, ByteBuf buf, int type) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Jt600ProtocolDecoder.decodeBinaryLocation(buf, position);
position.setValid(type != MSG_LOCAT... | private Position decodeLocation2(DeviceSession deviceSession, ByteBuf buf, int type) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Jt600ProtocolDecoder.decodeBinaryLocation(buf, position);
position.setValid(type != MSG_LOCAT... |
traccar-traccar-f92bde208800 | private void readBinaryCustomData(Position position, ByteBuf buf, String form) {
CellTower cellTower = new CellTower();
String[] keys = form.substring(1).split("%");
for (String key : keys) {
switch (key) {
case "SA":
position.set(Position.KEY_... | private void readBinaryCustomData(Position position, ByteBuf buf, String form) {
CellTower cellTower = new CellTower();
String[] keys = form.substring(1).split("%");
for (String key : keys) {
switch (key) {
case "SA":
position.set(Position.KEY_... |
traccar-traccar-f4d10160d951 | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
int flags = buf.readUnsignedByte();
buf.readUnsignedShortLE();
buf.readUnsignedShortLE();
... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
int flags = buf.readUnsignedByte();
buf.readUnsignedShortLE();
buf.readUnsignedShortLE();
... |
traccar-traccar-5c26f25b3b0a | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... |
traccar-traccar-7ce4fb9a628f | protected Object decodePosition(DeviceSession deviceSession, String content) throws Exception {
Parser parser = new Parser(PATTERN_POSITION, content);
if (!parser.matches()) {
return null;
}
Position position = new Position(getProtocolName());
position.setDeviceId... | protected Object decodePosition(DeviceSession deviceSession, String content) throws Exception {
Parser parser = new Parser(PATTERN_POSITION, content);
if (!parser.matches()) {
return null;
}
Position position = new Position(getProtocolName());
position.setDeviceId... |
jhy-jsoup-e52224fbfe66 | @Override
void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException {
final boolean prettyPrint = out.prettyPrint();
final Element parent = parentNode instanceof Element ? ((Element) parentNode) : null;
final boolean normaliseWhite = prettyPrint && !... | @Override
void outerHtmlHead(Appendable accum, int depth, Document.OutputSettings out) throws IOException {
final boolean prettyPrint = out.prettyPrint();
final Element parent = parentNode instanceof Element ? ((Element) parentNode) : null;
final boolean normaliseWhite = prettyPrint && !... |
xtremexp-UT4X-Converter-e719841eb260 | protected String convertScaleAndToT3D(double scaleFactor) {
this.convert();
this.scale(scaleFactor);
return "Begin Map\nBegin Level\n" + toT3d() + "End Level\nEnd Map";
}
| protected String convertScaleAndToT3D(double scaleFactor) {
this.convert();
this.scale(scaleFactor);
String convT3d = toT3d();
if (convT3d == null) {
convT3d = "";
for (T3DActor repActor : this.children) {
convT3d += repActor.toT3d();
}
}
return "Begin Map\nBegin Level\n" + convT3d +... |
traccar-traccar-5e18cb586d34 | private Object decodeCan(Channel channel, SocketAddress remoteAddress, String sentence) throws ParseException {
Position position = new Position(getProtocolName());
int index = 0;
String[] values = sentence.split(",");
index += 1;
index += 1;
DeviceSession deviceSes... | private Object decodeCan(Channel channel, SocketAddress remoteAddress, String sentence) throws ParseException {
Position position = new Position(getProtocolName());
int index = 0;
String[] values = sentence.split(",");
index += 1;
index += 1;
DeviceSession deviceSes... |
traccar-traccar-9a1cbeb7b754 | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... |
TheAlgorithms-Java-e5c7a08874a6 | public static int postfixEvaluate(final String exp) {
Stack<Integer> s = new Stack<Integer>();
Scanner tokens = new Scanner(exp);
while (tokens.hasNext()) {
if (tokens.hasNextInt()) {
s.push(tokens.nextInt());
} else {
int num2 = s.po... | public static int postfixEvaluate(final String exp) {
Stack<Integer> s = new Stack<Integer>();
Scanner tokens = new Scanner(exp);
while (tokens.hasNext()) {
if (tokens.hasNextInt()) {
s.push(tokens.nextInt());
} else {
if (s.size() < ... |
traccar-traccar-a9c311855a49 | @Override
protected Object decode(DeviceSession deviceSession, MqttPublishMessage message) throws Exception {
JsonObject json;
try (ByteBufferInputStream inputStream = new ByteBufferInputStream(message.payload().nioBuffer())) {
json = Json.createReader(inputStream).readObject();
... | @Override
protected Object decode(DeviceSession deviceSession, MqttPublishMessage message) throws Exception {
JsonObject json;
try (ByteBufferInputStream inputStream = new ByteBufferInputStream(message.payload().nioBuffer())) {
json = Json.createReader(inputStream).readObject();
... |
aws-aws-secretsmanager-jdbc-d25e52d637cf | @Override
public String constructUrlFromEndpointPortDatabase(String endpoint, String port, String dbname) {
String url = "jdbc:postgresql://" + endpoint;
if (!StringUtils.isNullOrEmpty(port)) {
url += ":" + port;
}
if (!StringUtils.isNullOrEmpty(dbname)) {
... | @Override
public String constructUrlFromEndpointPortDatabase(String endpoint, String port, String dbname) {
String url = "jdbc:postgresql://" + endpoint;
if (!StringUtils.isNullOrEmpty(port)) {
url += ":" + port;
}
url += "/";
if (!StringUtils.isNullOrEmpty(db... |
jitterted-ensembler-14a39138787f | public void acceptedBy(MemberId memberId) {
requireNotCompleted();
requireNotCanceled();
requireHasSpace();
membersWhoAccepted.add(memberId);
membersWhoDeclined.remove(memberId);
}
| public void acceptedBy(MemberId memberId) {
requireNotCompleted();
requireNotCanceled();
requireHasSpace();
membersWhoAccepted.add(memberId);
membersWhoDeclined.remove(memberId);
membersAsSpectators.remove(memberId);
}
|
dmak-jaxb-xew-plugin-f48935133d6a | private void moveClassLevelUp(Outline outline, JDefinedClass clazz) {
JDefinedClass parent = (JDefinedClass) clazz.parentContainer();
JClassContainer grandParent = parent.parentContainer();
Map<String, JDefinedClass> classes;
if (grandParent.isClass()) {
JDefinedClass grandParentClass = (JDefinedClass) gran... | private void moveClassLevelUp(Outline outline, JDefinedClass clazz) {
JDefinedClass parent = (JDefinedClass) clazz.parentContainer();
JClassContainer grandParent = parent.parentContainer();
Map<String, JDefinedClass> classes;
if (grandParent.isClass()) {
JDefinedClass grandParentClass = (JDefinedClass) gran... |
jhy-jsoup-5f20fcc2f728 | public Safelist addTags(String... tags) {
Validate.notNull(tags);
for (String tagName : tags) {
Validate.notEmpty(tagName);
tagNames.add(TagName.valueOf(tagName));
}
return this;
}
| public Safelist addTags(String... tags) {
Validate.notNull(tags);
for (String tagName : tags) {
Validate.notEmpty(tagName);
Validate.isFalse(tagName.equalsIgnoreCase("noscript"),
"noscript is unsupported in Safelists, due to incompatibilities between parsers w... |
crowdin-crowdin-api-client-java-f0f22b2b56d7 | public JacksonJsonTransformer() {
ObjectMapper cleanObjectMapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
SimpleModule enumModule = new SimpleModule()
.addDeserializer(Enum.class, new EnumDeserializer());
SimpleModule ... | public JacksonJsonTransformer() {
ObjectMapper cleanObjectMapper = new ObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
SimpleModule enumModule = new SimpleModule()
.addDeserializer(Enum.class, new EnumDeserializer());
SimpleModule ... |
stellar-java-stellar-sdk-1461c2fc5b89 | public boolean isSorobanTransaction() {
if (mOperations.length != 1) {
return false;
}
Operation op = mOperations[0];
return op instanceof InvokeHostFunctionOperation
|| op instanceof BumpSequenceOperation
|| op instanceof RestoreFootprintOperation;
}
| public boolean isSorobanTransaction() {
if (mOperations.length != 1) {
return false;
}
Operation op = mOperations[0];
return op instanceof InvokeHostFunctionOperation
|| op instanceof BumpFootprintExpirationOperation
|| op instanceof RestoreFootprintOperation;
}
|
traccar-traccar-65f54c200cf0 | private void decodeLocation(Position position, ByteBuf buf, int codec, String model) {
int globalMask = 0x0f;
if (codec == CODEC_GH3000) {
long time = buf.readUnsignedInt() & 0x3fffffff;
time += 1167609600;
globalMask = buf.readUnsignedByte();
if (Bit... | private void decodeLocation(Position position, ByteBuf buf, int codec, String model) {
int globalMask = 0x0f;
if (codec == CODEC_GH3000) {
long time = buf.readUnsignedInt() & 0x3fffffff;
time += 1167609600;
globalMask = buf.readUnsignedByte();
if (Bit... |
mthmulders-mcs-eff905bef8d8 | private void printRow(final Help.TextTable table, final SearchResponse.Response.Doc doc) {
var lastUpdated = DATE_TIME_FORMATTER.format(
Instant.ofEpochMilli(doc.timestamp()).atZone(ZoneId.systemDefault())
);
table.addRowValues(doc.id(), lastUpdated);
}
| private void printRow(final Help.TextTable table, final SearchResponse.Response.Doc doc) {
var lastUpdated = DATE_TIME_FORMATTER.format(
Instant.ofEpochMilli(doc.timestamp()).atZone(ZoneId.systemDefault())
);
table.addRowValues(doc.id() + ":" + doc.latestVersion(), lastUpdate... |
traccar-traccar-fdbd269b9b99 | private Object decodePosition(
Channel channel, SocketAddress remoteAddress, String sentence, String id) {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, id);
if (deviceSession == null) {
return null;
}
List<Position> positions = new Li... | private Object decodePosition(
Channel channel, SocketAddress remoteAddress, String sentence, String id) {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, id);
if (deviceSession == null) {
return null;
}
List<Position> positions = new Li... |
traccar-traccar-8b4d3ee0b964 | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
String sentence = (String) msg;
if (sentence.startsWith("!1,")) {
int index = sentence.indexOf(',', 3);
if (index < 0) {
index = sen... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
String sentence = (String) msg;
if (sentence.startsWith("!1,")) {
int index = sentence.indexOf(',', 3);
if (index < 0) {
index = sen... |
traccar-traccar-e73f36db83b9 | private Object decodeEri(Channel channel, SocketAddress remoteAddress, String sentence) {
Parser parser = new Parser(PATTERN_ERI, sentence);
if (!parser.matches()) {
return null;
}
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
... | private Object decodeEri(Channel channel, SocketAddress remoteAddress, String sentence) {
Parser parser = new Parser(PATTERN_ERI, sentence);
if (!parser.matches()) {
return null;
}
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
... |
AuthMe-ConfigMe-aa91a6b315ec | public void setComment(@NotNull String path, @NotNull String... commentLines) {
comments.put(path, Collections.unmodifiableList(Arrays.asList(commentLines)));
}
| public void setComment(@NotNull String path, @NotNull String... commentLines) {
List<String> replaced = comments.put(path, Collections.unmodifiableList(Arrays.asList(commentLines)));
if (replaced != null) {
throw new IllegalStateException("Comment lines already exists for the path '" + p... |
traccar-traccar-8de9a36abef8 | private void decodeFragment(Position position, String fragment) {
int dataIndex = fragment.indexOf(':');
int index = 0;
String[] values;
if (fragment.length() == dataIndex + 1) {
values = new String[0];
} else {
values = fragment.substring(dataIndex + ... | private void decodeFragment(Position position, String fragment) {
int dataIndex = fragment.indexOf(':');
int index = 0;
String[] values;
if (fragment.length() == dataIndex + 1) {
values = new String[0];
} else {
values = fragment.substring(dataIndex + ... |
traccar-traccar-392f00082faf | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... |
cloudsimplus-cloudsimplus-61c8b942d1ec | public HostAbstract(final List<Pe> peList, final boolean activate) {
this(defaultBwCapacity, defaultStorageCapacity, new HarddriveStorage(defaultRamCapacity), peList, activate);
}
| public HostAbstract(final List<Pe> peList, final boolean activate) {
this(defaultRamCapacity, defaultBwCapacity, new HarddriveStorage(defaultStorageCapacity), peList, activate);
}
|
traccar-traccar-3771dd156efb | private Position decodePosition(DeviceSession deviceSession, String data) {
Parser parser = new Parser(PATTERN_POSITION, data);
if (!parser.matches()) {
return null;
}
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDevic... | private Position decodePosition(DeviceSession deviceSession, String data) {
Parser parser = new Parser(PATTERN_POSITION, data);
if (!parser.matches()) {
return null;
}
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDevic... |
traccar-traccar-dfc546a26f5b | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... | private List<Position> decodeBinaryE(Channel channel, SocketAddress remoteAddress, ByteBuf buf) {
List<Position> positions = new LinkedList<>();
buf.readerIndex(buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ',') + 1);
String imei = buf.readSlice(15).toString(StandardCharsets.US_AS... |
traccar-traccar-3331593759a2 | private Position decodeTransparent(DeviceSession deviceSession, ByteBuf buf) {
int type = buf.readUnsignedByte();
if (type == 0xF0) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Date time = readDate(buf, ... | private Position decodeTransparent(DeviceSession deviceSession, ByteBuf buf) {
int type = buf.readUnsignedByte();
if (type == 0xF0) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Date time = readDate(buf, ... |
semver4j-semver4j-10102b374298 | @Override
public String toString() {
return rangesList.stream()
.map(RangesList::formatRanges)
.collect(joining(OR_JOINER));
}
| @Override
public String toString() {
return rangesList.stream()
.map(RangesList::formatRanges)
.collect(joining(OR_JOINER))
.replaceAll("^\\(([^()]+)\\)$", "$1");
}
|
nikoo28-java-solutions-8d81307ea165 | public int[] calculateSpans(int[] prices) {
int[] spans = new int[prices.length];
spans[0] = 1;
Stack<Integer> indexStack = new Stack<>();
indexStack.push(0);
for (int i = 1; i < prices.length; i++) {
while (!indexStack.isEmpty()
&& prices[indexStack.peek()] <= prices[i])
... | public int[] calculateSpans(int[] prices) {
int[] spans = new int[prices.length];
spans[0] = 1;
Stack<Integer> indexStack = new Stack<>();
indexStack.push(0);
for (int i = 1; i < prices.length; i++) {
while (!indexStack.isEmpty()
&& prices[indexStack.peek()] < prices[i])
i... |
traccar-traccar-5a1a8d9192ee | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
buf.readUnsignedShort();
buf.readUnsignedByte();
buf.readUnsignedShort();
buf.readU... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte();
buf.readUnsignedShort();
buf.readUnsignedByte();
buf.readUnsignedShort();
buf.readU... |
jitterted-ensembler-0963194c9ebc | public static ParticipantAction from(MemberStatus memberStatus, boolean disabled) {
return switch (memberStatus) {
case UNKNOWN, DECLINED -> new ParticipantAction(
"/member/accept",
"Participate in Rotation ⌨",
disabled);
... | public static ParticipantAction from(MemberStatus memberStatus, boolean disabled) {
return switch (memberStatus) {
case UNKNOWN, DECLINED -> new ParticipantAction(
"/member/accept",
"Participate in Rotation ⌨",
disabled);
... |
jitterted-ensembler-0e512e5b3677 | public static EnsembleSummaryView toView(Ensemble ensemble, MemberId memberId, MemberService memberService) {
List<MemberView> participantViews = transform(memberService, ensemble.acceptedMembers());
return new EnsembleSummaryView(ensemble.getId().id(),
ensembl... | public static EnsembleSummaryView toView(Ensemble ensemble, MemberId memberId, MemberService memberService) {
List<MemberView> participantViews = transform(memberService, ensemble.acceptedMembers());
List<MemberView> spectatorViews = transform(memberService, ensemble.spectators());
return ne... |
jitterted-ensembler-60ec3bf0273b | public void joinAsSpectator(MemberId memberId) {
membersAsSpectators.add(memberId);
membersWhoAccepted.remove(memberId);
}
| public void joinAsSpectator(MemberId memberId) {
membersAsSpectators.add(memberId);
membersWhoAccepted.remove(memberId);
membersWhoDeclined.remove(memberId);
}
|
traccar-traccar-ee3cbd4aba2e | private Position decodeLocation2(DeviceSession deviceSession, ByteBuf buf, int type) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Jt600ProtocolDecoder.decodeBinaryLocation(buf, position);
position.setValid(type != MSG_LOCAT... | private Position decodeLocation2(DeviceSession deviceSession, ByteBuf buf, int type) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
Jt600ProtocolDecoder.decodeBinaryLocation(buf, position);
position.setValid(type != MSG_LOCAT... |
fishercoder1534-Leetcode-2110c6b023b7 | public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
if (root == null || p == root || q == root) {
return root;
}
if ((root.val - p.val) * (root.val - q.val) > 0) {
if (root.val - p.val > 0) {
return... | public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
if (root == null || p == root || q == root) {
return root;
}
if (root.val > p.val && root.val > q.val) {
return lowestCommonAncestor(root.left, p, q);
} e... |
jhy-jsoup-8e2b86839b27 | private boolean isFormatAsBlock(Document.OutputSettings out) {
return tag.formatAsBlock() || (parent() != null && parent().tag().formatAsBlock()) || out.outline();
}
| private boolean isFormatAsBlock(Document.OutputSettings out) {
return tag.isBlock() || (parent() != null && parent().tag().formatAsBlock()) || out.outline();
}
|
traccar-traccar-cadcd2676adb | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.skipBytes(2);
int type = buf.readUnsignedByte();
buf.readUnsignedShort();
if (type == MSG_LOGIN || type == MSG_AD... | @Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
buf.skipBytes(2);
int type = buf.readUnsignedByte();
buf.readUnsignedShort();
if (type == MSG_LOGIN || type == MSG_AD... |
traccar-traccar-1a1126d2d392 | private Position decode4(
Channel channel, SocketAddress remoteAddress, String[] values) throws ParseException {
int index = 0;
String type = values[index++].substring(5);
if (!type.equals("STT") && !type.equals("ALT")) {
return null;
}
DeviceSession d... | private Position decode4(
Channel channel, SocketAddress remoteAddress, String[] values) throws ParseException {
int index = 0;
String type = values[index++].substring(5);
if (!type.equals("STT") && !type.equals("ALT")) {
return null;
}
DeviceSession d... |
jhy-jsoup-a349582236a7 | private boolean isInlineable(Document.OutputSettings out) {
return tag().isInline()
&& (parent() == null || parent().isBlock())
&& previousSibling() != null
&& !out.outline();
}
| private boolean isInlineable(Document.OutputSettings out) {
if (!tag.isInline())
return false;
final Node prev = previousSibling();
boolean isFirst = siblingIndex == 0;
if (siblingIndex == 1 && prev instanceof TextNode && (((TextNode) prev).isBlank()))
isFirst... |
jhy-jsoup-2a4a9cf83dea | @Override
public boolean matches(Element root, Element element) {
for (int i = evaluators.size() -1; i >= 0; --i) {
if (element == null)
return false;
Evaluator eval = evaluators.get(i);
if (!eval.matches(root, element))
... | @Override
public boolean matches(Element root, Element element) {
if (element == root)
return false;
for (int i = evaluators.size() -1; i >= 0; --i) {
if (element == null)
return false;
Evaluator eval = evaluato... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.